(command.CommandList
  children: [
    (command.ShFunction
      name: die
      body: 
        (BraceGroup
          children: [
            (command.Simple
              words: [{<echo>} {(DQ ($ Id.VSub_At '$@'))}]
              redirects: [(redir op:<Id.Redir_GreatAnd '>&'> loc:(redir_loc.Fd fd:1) arg:{<2>})]
              do_fork: T
            )
            (command.ControlFlow token:<Id.ControlFlow_Exit exit> arg_word:{<1>})
          ]
        )
    )
    (command.ShFunction
      name: xmkdir
      body: 
        (BraceGroup
          children: [
            (command.WhileUntil
              keyword: <Id.KW_While while>
              cond: 
                (condition.Shell
                  commands: [
                    (command.Sentence
                      child: 
                        (C {<Id.Lit_LBracket '['>} {<-n>} {(DQ ($ Id.VSub_Number '$1'))} 
                          {<Id.Lit_RBracket ']'>}
                        )
                      terminator: <Id.Op_Semi _>
                    )
                  ]
                )
              body: 
                (command.DoGroup
                  children: [
                    (command.AndOr
                      ops: [Id.Op_DPipe Id.Op_DPipe]
                      children: [
                        (C {<Id.Lit_LBracket '['>} {<-d>} {(DQ ($ Id.VSub_Number '$1'))} 
                          {<Id.Lit_RBracket ']'>}
                        )
                        (C {<mkdir>} {(DQ ($ Id.VSub_Number '$1'))})
                        (C {<die>} {(DQ <'Unable to mkdir '> ($ Id.VSub_Number '$1'))})
                      ]
                    )
                    (C {<shift>})
                  ]
                )
            )
          ]
        )
    )
    (command.ShAssignment
      pairs: [
        (assign_pair
          lhs: (sh_lhs_expr.Name name:R)
          op: assign_op.Equal
          rhs: {(DQ ($ Id.VSub_Number '$1'))}
          spids: [87]
        )
      ]
    )
    (command.AndOr
      ops: [Id.Op_DAmp]
      children: [
        (C {<Id.Lit_LBracket '['>} 
          {(DQ (command_sub left_token:<Id.Left_DollarParen '$('> child:(C {<id>} {<-u>})))} {<-eq>} {<0>} {<Id.Lit_RBracket ']'>}
        )
        (C {<die>} {(DQ <'This script should not be run as root, what if it does rm -rf /?'>)})
      ]
    )
    (command.AndOr
      ops: [Id.Op_DPipe]
      children: [
        (C {<Id.Lit_LBracket '['>} {<-n>} {(DQ ($ Id.VSub_DollarName '$R'))} {<Id.Lit_RBracket ']'>})
        (C {<die>} {(DQ <'usage: prepare-chroot.sh <root>'>)})
      ]
    )
    (command.AndOr
      ops: [Id.Op_DPipe]
      children: [
        (C {<Id.Lit_LBracket '['>} {<-x>} {<git>} {<Id.Lit_RBracket ']'>})
        (C {<die>} {(DQ <'This script needs to be executed at git source code\'s top directory'>)})
      ]
    )
    (command.If
      arms: [
        (if_arm
          cond: 
            (condition.Shell
              commands: [
                (command.Sentence
                  child: (C {<Id.Lit_LBracket '['>} {<-x>} {<'/bin/busybox'>} {<Id.Lit_RBracket ']'>})
                  terminator: <Id.Op_Semi _>
                )
              ]
            )
          action: [
            (command.ShAssignment
              pairs: [
                (assign_pair
                  lhs: (sh_lhs_expr.Name name:BB)
                  op: assign_op.Equal
                  rhs: {<'/bin/busybox'>}
                  spids: [165]
                )
              ]
            )
          ]
          spids: [151 162]
        )
        (if_arm
          cond: 
            (condition.Shell
              commands: [
                (command.Sentence
                  child: 
                    (C {<Id.Lit_LBracket '['>} {<-x>} {<'/usr/bin/busybox'>} {<Id.Lit_RBracket ']'>})
                  terminator: <Id.Op_Semi _>
                )
              ]
            )
          action: [
            (command.ShAssignment
              pairs: [
                (assign_pair
                  lhs: (sh_lhs_expr.Name name:BB)
                  op: assign_op.Equal
                  rhs: {<'/usr/bin/busybox'>}
                  spids: [182]
                )
              ]
            )
          ]
          spids: [168 179]
        )
      ]
      else_action: [(C {<die>} {(DQ <'You need busybox'>)})]
    )
    (C {<xmkdir>} {(DQ ($ Id.VSub_DollarName '$R'))} {(DQ ($ Id.VSub_DollarName '$R') <'/bin'>)} 
      {(DQ ($ Id.VSub_DollarName '$R') <'/etc'>)} {(DQ ($ Id.VSub_DollarName '$R') <'/lib'>)} {(DQ ($ Id.VSub_DollarName '$R') <'/dev'>)}
    )
    (C {<touch>} {(DQ ($ Id.VSub_DollarName '$R') <'/dev/null'>)})
    (command.Simple
      words: [{<echo>} {(DQ <'root:x:0:0:root:/:/bin/sh'>)}]
      redirects: [
        (redir
          op: <Id.Redir_Great '>'>
          loc: (redir_loc.Fd fd:1)
          arg: {(DQ ($ Id.VSub_DollarName '$R') <'/etc/passwd'>)}
        )
      ]
      do_fork: T
    )
    (command.Simple
      words: [
        {<echo>}
        {
          (DQ (command_sub left_token:<Id.Left_DollarParen '$('> child:(C {<id>} {<-nu>})) <':x:'> 
            (command_sub left_token:<Id.Left_DollarParen '$('> child:(C {<id>} {<-u>})) <':'> (command_sub left_token:<Id.Left_DollarParen '$('> child:(C {<id>} {<-g>})) <'::'> 
            (command_sub left_token:<Id.Left_DollarParen '$('> child:(C {<pwd>})) <'/t:/bin/sh'>
          )
        }
      ]
      redirects: [
        (redir
          op: <Id.Redir_DGreat '>>'>
          loc: (redir_loc.Fd fd:1)
          arg: {(DQ ($ Id.VSub_DollarName '$R') <'/etc/passwd'>)}
        )
      ]
      do_fork: T
    )
    (command.Simple
      words: [{<echo>} {(DQ <'root::0:root'>)}]
      redirects: [
        (redir
          op: <Id.Redir_Great '>'>
          loc: (redir_loc.Fd fd:1)
          arg: {(DQ ($ Id.VSub_DollarName '$R') <'/etc/group'>)}
        )
      ]
      do_fork: T
    )
    (command.Simple
      words: [
        {<echo>}
        {
          (DQ (command_sub left_token:<Id.Left_DollarParen '$('> child:(C {<id>} {<-ng>})) <'::'> 
            (command_sub left_token:<Id.Left_DollarParen '$('> child:(C {<id>} {<-g>})) <':'> (command_sub left_token:<Id.Left_DollarParen '$('> child:(C {<id>} {<-nu>}))
          )
        }
      ]
      redirects: [
        (redir
          op: <Id.Redir_DGreat '>>'>
          loc: (redir_loc.Fd fd:1)
          arg: {(DQ ($ Id.VSub_DollarName '$R') <'/etc/group'>)}
        )
      ]
      do_fork: T
    )
    (command.AndOr
      ops: [Id.Op_DPipe]
      children: [
        (C {<Id.Lit_LBracket '['>} {<-x>} {(DQ ($ Id.VSub_DollarName '$R') ($ Id.VSub_DollarName '$BB'))} 
          {<Id.Lit_RBracket ']'>}
        )
        (C {<cp>} {($ Id.VSub_DollarName '$BB')} {(DQ ($ Id.VSub_DollarName '$R') <'/bin/busybox'>)})
      ]
    )
    (command.ForEach
      iter_name: cmd
      iter_words: [
        {<sh>}
        {<su>}
        {<ls>}
        {<expr>}
        {<tr>}
        {<basename>}
        {<rm>}
        {<mkdir>}
        {<mv>}
        {<id>}
        {<uname>}
        {<dirname>}
        {<cat>}
        {<true>}
        {<sed>}
        {<diff>}
      ]
      do_arg_iter: F
      body: 
        (command.DoGroup
          children: [
            (C {<ln>} {<-f>} {<-s>} {<'/bin/busybox'>} 
              {(DQ ($ Id.VSub_DollarName '$R') <'/bin/'> ($ Id.VSub_DollarName '$cmd'))}
            )
          ]
        )
    )
    (C {<mkdir>} {<-p>} 
      {
        (DQ ($ Id.VSub_DollarName '$R') 
          (command_sub left_token:<Id.Left_DollarParen '$('> child:(C {<pwd>}))
        )
      }
    )
    (C {<rsync>} {<--exclude-from>} {<'t/t1509/excludes'>} {<-Ha>} {<.>} 
      {
        (DQ ($ Id.VSub_DollarName '$R') 
          (command_sub left_token:<Id.Left_DollarParen '$('> child:(C {<pwd>}))
        )
      }
    )
    (command.Simple
      words: [{<sed>} {(SQ <'s|^PERL_PATH=.*|PERL_PATH=/bin/true|'>)} {<GIT-BUILD-OPTIONS>}]
      redirects: [
        (redir
          op: <Id.Redir_Great '>'>
          loc: (redir_loc.Fd fd:1)
          arg: 
            {
              (DQ ($ Id.VSub_DollarName '$R') 
                (command_sub left_token:<Id.Left_DollarParen '$('> child:(C {<pwd>})) <'/GIT-BUILD-OPTIONS'>
              )
            }
        )
      ]
      do_fork: T
    )
    (command.ForEach
      iter_name: cmd
      iter_words: [{<git>} {($ Id.VSub_DollarName '$BB')}]
      do_arg_iter: F
      body: 
        (command.DoGroup
          children: [
            (command.Pipeline
              children: [
                (C {<ldd>} {($ Id.VSub_DollarName '$cmd')})
                (C {<grep>} {(SQ <'/'>)})
                (C {<sed>} {(SQ <'s,.*\\s\\(/[^ ]*\\).*,\\1,'>)})
                (command.WhileUntil
                  keyword: <Id.KW_While while>
                  cond: 
                    (condition.Shell
                      commands: [(command.Sentence child:(C {<read>} {<i>}) terminator:<Id.Op_Semi _>)]
                    )
                  body: 
                    (command.DoGroup
                      children: [
                        (C {<mkdir>} {<-p>} 
                          {
                            (DQ ($ Id.VSub_DollarName '$R') 
                              (command_sub
                                left_token: <Id.Left_DollarParen '$('>
                                child: (C {<dirname>} {($ Id.VSub_DollarName '$i')})
                              )
                            )
                          }
                        )
                        (C {<cp>} {(DQ ($ Id.VSub_DollarName '$i'))} 
                          {(DQ ($ Id.VSub_DollarName '$R') <'/'> ($ Id.VSub_DollarName '$i'))}
                        )
                      ]
                    )
                )
              ]
              negated: F
            )
          ]
        )
    )
    (command.Simple
      words: [{<cat>}]
      redirects: [
        (redir
          op: <Id.Redir_DLess '<<'>
          loc: (redir_loc.Fd fd:0)
          arg: 
            (redir_param.HereDoc
              here_begin: {<EOF>}
              here_end_span_id: 554
              stdin_parts: [
                <'All is set up in '>
                ($ Id.VSub_DollarName '$R')
                <', execute t1509 with the following commands:\n'>
                <'\n'>
                <'sudo chroot '>
                ($ Id.VSub_DollarName '$R')
                <' /bin/su - '>
                (command_sub
                  left_token: <Id.Left_DollarParen '$('>
                  child: (C {<id>} {<-nu>})
                )
                <'\n'>
                <'IKNOWWHATIAMDOING=YES ./t1509-root-worktree.sh -v -i\n'>
                <'\n'>
                <'When you are done, simply delete '>
                ($ Id.VSub_DollarName '$R')
                <' to clean up\n'>
              ]
            )
        )
      ]
      do_fork: T
    )
  ]
)