(CommandList
  children: [
    (C {(set)} {(-o)} {(nounset)})
    (C {(set)} {(-o)} {(pipefail)})
    (C {(set)} {(-o)} {(errexit)})
    (Assignment
      keyword: Assign_Readonly
      pairs: [
        (assign_pair
          lhs: (LhsName name:ROOTFS_URL)
          op: Equal
          rhs: 
            {
              (SQ 
                <
'http://distfiles.gentoo.org/releases/amd64/autobuilds/20180116T214503Z/stage3-amd64-20180116T214503Z.tar.xz'
                >
              )
            }
          spids: [52]
        )
      ]
      spids: [50]
    )
    (Assignment
      keyword: Assign_Readonly
      pairs: [(assign_pair lhs:(LhsName name:CHROOT_DIR) op:Equal rhs:{(_chroot/gentoo)} spids:[59])]
      spids: [57]
    )
    (Assignment
      keyword: Assign_Readonly
      pairs: [
        (assign_pair
          lhs: (LhsName name:PORTAGE_URL)
          op: Equal
          rhs: {(SQ <'http://distfiles.gentoo.org/snapshots/portage-20180202.tar.xz'>)}
          spids: [65]
        )
      ]
      spids: [63]
    )
    (FuncDef
      name: download
      body: 
        (BraceGroup
          children: [
            (C {(wget)} {(--no-clobber)} {(--directory)} {(_tmp)} {($ VSub_Name '$ROOTFS_URL')})
            (C {(wget)} {(--no-clobber)} {(--directory)} {(_tmp)} {($ VSub_Name '$PORTAGE_URL')})
          ]
          spids: [75]
        )
      spids: [71 74]
    )
    (FuncDef
      name: _extract
      body: 
        (BraceGroup
          children: [
            (Assignment
              keyword: Assign_Local
              pairs: [
                (assign_pair
                  lhs: (LhsName name:dest)
                  op: Equal
                  rhs: 
                    {
                      (BracedVarSub
                        token: <VSub_Number 1>
                        suffix_op: 
                          (StringUnary
                            op_id: VTest_ColonHyphen
                            arg_word: {($ VSub_Name '$CHROOT_DIR')}
                          )
                        spids: [112 116]
                      )
                    }
                  spids: [111]
                )
              ]
              spids: [109]
            )
            (Assignment
              keyword: Assign_Local
              pairs: [
                (assign_pair
                  lhs: (LhsName name:tarball)
                  op: Equal
                  rhs: 
                    {(_tmp/) 
                      (CommandSubPart
                        command_list: 
                          (CommandList
                            children: [(C {(basename)} {($ VSub_Name '$ROOTFS_URL')})]
                          )
                        left_token: <Left_CommandSub '$('>
                        spids: [124 128]
                      )
                    }
                  spids: [122]
                )
              ]
              spids: [120]
            )
            (C {(mkdir)} {(-p)} {($ VSub_Name '$dest')})
            (SimpleCommand
              words: [{(tar)} {(--extract)} {(--xz)} {(--directory)} {($ VSub_Name '$dest')}]
              redirects: [
                (Redir
                  op_id: Redir_Less
                  fd: 16777215
                  arg_word: {($ VSub_Name '$tarball')}
                  spids: [153]
                )
              ]
            )
          ]
          spids: [106]
        )
      spids: [102 105]
    )
    (FuncDef
      name: extract
      body: 
        (BraceGroup
          children: [
            (Sentence
              child: (C {(sudo)} {($ VSub_Number '$0')} {(_extract)} {(DQ ($ VSub_At '$@'))})
              terminator: <Op_Semi ';'>
            )
          ]
          spids: [163]
        )
      spids: [159 162]
    )
    (FuncDef
      name: _extract-portage
      body: 
        (BraceGroup
          children: [
            (Assignment
              keyword: Assign_Local
              pairs: [
                (assign_pair
                  lhs: (LhsName name:dest)
                  op: Equal
                  rhs: 
                    {
                      (BracedVarSub
                        token: <VSub_Number 1>
                        suffix_op: 
                          (StringUnary
                            op_id: VTest_ColonHyphen
                            arg_word: {($ VSub_Name '$CHROOT_DIR')}
                          )
                        spids: [189 193]
                      )
                    }
                  spids: [188]
                )
              ]
              spids: [186]
            )
            (Assignment
              keyword: Assign_Local
              pairs: [
                (assign_pair
                  lhs: (LhsName name:portage_dest)
                  op: Equal
                  rhs: {($ VSub_Name '$dest') (/usr)}
                  spids: [198]
                )
              ]
              spids: [196]
            )
            (Assignment
              keyword: Assign_Local
              pairs: [
                (assign_pair
                  lhs: (LhsName name:tarball)
                  op: Equal
                  rhs: 
                    {(_tmp/) 
                      (CommandSubPart
                        command_list: 
                          (CommandList
                            children: [(C {(basename)} {($ VSub_Name '$PORTAGE_URL')})]
                          )
                        left_token: <Left_CommandSub '$('>
                        spids: [208 212]
                      )
                    }
                  spids: [206]
                )
              ]
              spids: [204]
            )
            (SimpleCommand
              words: [{(tar)} {(--extract)} {(--xz)} {(--directory)} {($ VSub_Name '$portage_dest')}]
              redirects: [
                (Redir
                  op_id: Redir_Less
                  fd: 16777215
                  arg_word: {($ VSub_Name '$tarball')}
                  spids: [230]
                )
              ]
            )
          ]
          spids: [183]
        )
      spids: [179 182]
    )
    (FuncDef
      name: extract-portage
      body: 
        (BraceGroup
          children: [
            (Sentence
              child: (C {(sudo)} {($ VSub_Number '$0')} {(_extract-portage)} {(DQ ($ VSub_At '$@'))})
              terminator: <Op_Semi ';'>
            )
          ]
          spids: [240]
        )
      spids: [236 239]
    )
    (FuncDef
      name: _mount-dirs
      body: 
        (BraceGroup
          children: [
            (C {(mount)} {(--rbind)} {(/dev)} {($ VSub_Name '$CHROOT_DIR') (/dev)})
            (C {(mount)} {(--make-rslave)} {($ VSub_Name '$CHROOT_DIR') (/dev)})
            (C {(mount)} {(-t)} {(proc)} {(/proc)} {($ VSub_Name '$CHROOT_DIR') (/proc)})
            (C {(mount)} {(--rbind)} {(/sys)} {($ VSub_Name '$CHROOT_DIR') (/sys)})
            (C {(mount)} {(--make-rslave)} {($ VSub_Name '$CHROOT_DIR') (/sys)})
            (C {(mount)} {(--rbind)} {(/tmp)} {($ VSub_Name '$CHROOT_DIR') (/tmp)})
          ]
          spids: [263]
        )
      spids: [259 262]
    )
    (FuncDef
      name: mount-dirs
      body: 
        (BraceGroup
          children: [
            (Sentence
              child: (C {(sudo)} {($ VSub_Number '$0')} {(_mount-dirs)} {(DQ ($ VSub_At '$@'))})
              terminator: <Op_Semi ';'>
            )
          ]
          spids: [330]
        )
      spids: [326 329]
    )
    (FuncDef
      name: _setup-portage
      body: 
        (BraceGroup
          children: [
            (C {(cp)} {(-v)} {($ VSub_Name '$CHROOT_DIR') (/usr/share/portage/config/make.conf.example)} 
              {($ VSub_Name '$CHROOT_DIR') (/etc/portage)}
            )
          ]
          spids: [350]
        )
      spids: [346 349]
    )
    (FuncDef
      name: setup-portage
      body: 
        (BraceGroup
          children: [
            (Sentence
              child: (C {(sudo)} {($ VSub_Number '$0')} {(_setup-portage)} {(DQ ($ VSub_At '$@'))})
              terminator: <Op_Semi ';'>
            )
          ]
          spids: [369]
        )
      spids: [365 368]
    )
    (FuncDef
      name: add-oil-build-deps
      body: 
        (BraceGroup
          children: [
            (Assignment
              keyword: Assign_Local
              pairs: [
                (assign_pair
                  lhs: (LhsName name:chroot_dir)
                  op: Equal
                  rhs: 
                    {
                      (BracedVarSub
                        token: <VSub_Number 1>
                        suffix_op: 
                          (StringUnary
                            op_id: VTest_ColonHyphen
                            arg_word: {($ VSub_Name '$CHROOT_DIR')}
                          )
                        spids: [419 423]
                      )
                    }
                  spids: [418]
                )
              ]
              spids: [416]
            )
            (SimpleCommand
              words: [{(sudo)} {(chroot)} {($ VSub_Name '$chroot_dir')} {(/bin/sh)}]
              redirects: [
                (HereDoc
                  op_id: Redir_DLess
                  fd: 16777215
                  body: {(DQ ('apk update\n') ('apk add bash make gcc musl-dev \n'))}
                  do_expansion: True
                  here_end: EOF
                  was_filled: T
                  spids: [434]
                )
              ]
            )
          ]
          spids: [413]
        )
      spids: [409 412]
    )
    (C {(DQ ($ VSub_At '$@'))})
  ]
)