(command.CommandList
  children: [
    (command.ShFunction
      name: cc_path
      body: 
        (BraceGroup
          children: [
            (C {<local>} {<i>})
            (command.If
              arms: [
                (if_arm
                  cond: 
                    (condition.Shell
                      commands: [
                        (C {<Id.Lit_LBracket '['>} {<Id.KW_Bang '!'>} {<-z>} 
                          {(DQ ($ Id.VSub_DollarName '$MY_CROSS_PATH'))} {<Id.Lit_RBracket ']'>}
                        )
                      ]
                    )
                  action: [
                    (command.ShAssignment
                      pairs: [
                        (assign_pair
                          lhs: (sh_lhs_expr.Name name:CC_PREFIX)
                          op: assign_op.Equal
                          rhs: {(DQ ($ Id.VSub_DollarName '$MY_CC_PREFIX'))}
                          spids: [43]
                        )
                      ]
                    )
                    (command.AndOr
                      ops: [Id.Op_DAmp Id.Op_DAmp]
                      children: [
                        (C {<Id.Lit_LBracket '['>} {<-z>} {(DQ ($ Id.VSub_DollarName '$CC_PREFIX'))} 
                          {<Id.Lit_RBracket ']'>}
                        )
                        (command.Simple
                          words: [{<echo>} {(DQ <'MY_CROSS_PATH without MY_CC_PREFIX'>)}]
                          redirects: [
                            (redir
                              op: <Id.Redir_GreatAnd '>&'>
                              loc: (redir_loc.Fd fd:1)
                              arg: {<2>}
                            )
                          ]
                          do_fork: T
                        )
                        (C {<dienow>})
                      ]
                    )
                    (C {<echo>} {<-n>} {(DQ ($ Id.VSub_DollarName '$MY_CROSS_PATH') <':'>)})
                    (command.ControlFlow token:<Id.ControlFlow_Return return>)
                  ]
                  spids: [25 40]
                )
              ]
            )
            (command.ForEach
              iter_name: i
              iter_words: [
                (word.BracedTree
                  parts: [
                    (DQ ($ Id.VSub_DollarName '$BUILD'))
                    <'/'>
                    (word_part.BracedTuple words:[{} {<simple->}])
                    <cross-compiler->
                    (DQ ($ Id.VSub_Number '$1') <'/bin'>)
                  ]
                )
              ]
              do_arg_iter: F
              body: 
                (command.DoGroup
                  children: [
                    (command.AndOr
                      ops: [Id.Op_DAmp]
                      children: [
                        (C {<Id.Lit_LBracket '['>} {<-e>} 
                          {(DQ ($ Id.VSub_DollarName '$i') <'/'> ($ Id.VSub_Number '$1') <-cc>)} {<Id.Lit_RBracket ']'>}
                        )
                        (command.ControlFlow
                          token: <Id.ControlFlow_Break break>
                        )
                      ]
                    )
                  ]
                )
            )
            (C {<echo>} {<-n>} {(DQ ($ Id.VSub_DollarName '$i') <':'>)})
          ]
        )
    )
    (command.ShFunction
      name: base_architecture
      body: 
        (BraceGroup
          children: [
            (command.ShAssignment
              pairs: [
                (assign_pair
                  lhs: (sh_lhs_expr.Name name:ARCH)
                  op: assign_op.Equal
                  rhs: {(DQ ($ Id.VSub_Number '$1'))}
                  spids: [163]
                )
              ]
            )
            (C {<source>} {(DQ ($ Id.VSub_DollarName '$CONFIG_DIR') <'/'> ($ Id.VSub_Number '$1'))})
          ]
        )
    )
    (command.ShFunction
      name: load_target
      body: 
        (BraceGroup
          children: [
            (command.ShAssignment
              pairs: [
                (assign_pair
                  lhs: (sh_lhs_expr.Name name:ARCH_NAME)
                  op: assign_op.Equal
                  rhs: {(DQ ($ Id.VSub_Number '$1'))}
                  spids: [192]
                )
              ]
            )
            (command.ShAssignment
              pairs: [
                (assign_pair
                  lhs: (sh_lhs_expr.Name name:CONFIG_DIR)
                  op: assign_op.Equal
                  rhs: {(DQ ($ Id.VSub_DollarName '$SOURCES') <'/targets'>)}
                  spids: [198]
                )
              ]
            )
            (command.If
              arms: [
                (if_arm
                  cond: 
                    (condition.Shell
                      commands: [
                        (C {<Id.Lit_LBracket '['>} {<-f>} 
                          {(DQ ($ Id.VSub_DollarName '$CONFIG_DIR') <'/'> ($ Id.VSub_Number '$1'))} {<Id.Lit_RBracket ']'>}
                        )
                      ]
                    )
                  action: [
                    (C {<base_architecture>} {(DQ ($ Id.VSub_DollarName '$ARCH_NAME'))})
                    (command.ShAssignment
                      pairs: [
                        (assign_pair
                          lhs: (sh_lhs_expr.Name name:CONFIG_DIR)
                          op: assign_op.Equal
                          rhs: (word.Empty)
                          spids: [236]
                        )
                      ]
                    )
                  ]
                  spids: [211 226]
                )
                (if_arm
                  cond: 
                    (condition.Shell
                      commands: [
                        (C {<Id.Lit_LBracket '['>} {<-f>} 
                          {
                            (DQ ($ Id.VSub_DollarName '$CONFIG_DIR') <'/'> ($ Id.VSub_Number '$1') 
                              <'/settings'>
                            )
                          } {<Id.Lit_RBracket ']'>}
                        )
                      ]
                    )
                  action: [
                    (C {<source>} 
                      {
                        (DQ ($ Id.VSub_DollarName '$CONFIG_DIR') <'/'> ($ Id.VSub_Number '$1') 
                          <'/settings'>
                        )
                      }
                    )
                    (command.AndOr
                      ops: [Id.Op_DAmp]
                      children: [
                        (C {<Id.Lit_LBracket '['>} {<-z>} {(DQ ($ Id.VSub_DollarName '$ARCH'))} 
                          {<Id.Lit_RBracket ']'>}
                        )
                        (C {<dienow>} {(DQ <'No base_architecture'>)})
                      ]
                    )
                  ]
                  spids: [239 255]
                )
              ]
              else_action: [
                (C {<echo>} {(DQ <'Supported architectures: '>)})
                (C {<ls>} {(DQ ($ Id.VSub_DollarName '$CONFIG_DIR'))})
                (command.ControlFlow token:<Id.ControlFlow_Exit exit> arg_word:{<1>})
              ]
            )
            (C {<export>} 
              {<Id.Lit_VarLike 'WORK='> 
                (DQ (${ Id.VSub_Name BUILD) <'/temp-'> ($ Id.VSub_DollarName '$ARCH_NAME'))
              }
            )
            (C {<export_if_blank>} 
              {<Id.Lit_VarLike 'CROSS_HOST='> 
                (command_sub
                  left_token: <Id.Left_Backtick '`'>
                  child: (C {<uname>} {<-m>})
                ) <-walrus-linux>
              }
            )
            (C {<export_if_blank>} 
              {<Id.Lit_VarLike 'CROSS_TARGET='> (${ Id.VSub_Name ARCH) <-unknown-linux>}
            )
            (command.ShAssignment
              pairs: [
                (assign_pair
                  lhs: (sh_lhs_expr.Name name:STAGE_DIR)
                  op: assign_op.Equal
                  rhs: 
                    {
                      (DQ ($ Id.VSub_DollarName '$BUILD') <'/'> (${ Id.VSub_Name STAGE_NAME) <-> 
                        (${ Id.VSub_Name ARCH_NAME)
                      )
                    }
                  spids: [380]
                )
              ]
            )
            (command.If
              arms: [
                (if_arm
                  cond: 
                    (condition.Shell
                      commands: [
                        (C {<Id.Lit_LBracket '['>} {<-z>} {(DQ ($ Id.VSub_DollarName '$KEEP_STAGEDIR'))} 
                          {<Id.Lit_RBracket ']'>}
                        )
                      ]
                    )
                  action: [(C {<blank_tempdir>} {(DQ ($ Id.VSub_DollarName '$STAGE_DIR'))})]
                  spids: [395 408]
                )
              ]
              else_action: [
                (command.AndOr
                  ops: [Id.Op_DPipe]
                  children: [
                    (C {<mkdir>} {<-p>} {(DQ ($ Id.VSub_DollarName '$STAGE_DIR'))})
                    (C {<dienow>})
                  ]
                )
              ]
            )
            (command.Simple
              words: [{<blank_tempdir>} {(DQ ($ Id.VSub_DollarName '$WORK'))}]
              more_env: [
                (env_pair
                  name: NO_CLEANUP
                  val: 
                    {
                      (braced_var_sub
                        token: <Id.VSub_Name NO_CLEANUP>
                        suffix_op: 
                          (suffix_op.PatSub
                            pat: {<temp>}
                            replace: {<Id.Lit_Slash '/'>}
                            replace_mode: Id.Undefined_Tok
                          )
                      )
                    }
                  spids: [437]
                )
              ]
              do_fork: T
            )
            (C {<export>} 
              {<Id.Lit_VarLike 'PATH='> 
                (DQ 
                  (command_sub
                    left_token: <Id.Left_DollarParen '$('>
                    child: (C {<cc_path>} {(DQ ($ Id.VSub_DollarName '$ARCH'))})
                  ) ($ Id.VSub_DollarName '$PATH')
                )
              }
            )
            (command.AndOr
              ops: [Id.Op_DAmp Id.Op_DAmp]
              children: [
                (C {<Id.Lit_LBracket '['>} {<Id.KW_Bang '!'>} {<-z>} 
                  {(DQ ($ Id.VSub_DollarName '$HOST_ARCH'))} {<Id.Lit_RBracket ']'>}
                )
                (C {<Id.Lit_LBracket '['>} {(DQ ($ Id.VSub_DollarName '$HOST_ARCH'))} 
                  {<Id.KW_Bang '!'> <Id.Lit_Equals '='>} {(DQ ($ Id.VSub_DollarName '$ARCH'))} {<Id.Lit_RBracket ']'>}
                )
                (command.ShAssignment
                  pairs: [
                    (assign_pair
                      lhs: (sh_lhs_expr.Name name:PATH)
                      op: assign_op.Equal
                      rhs: 
                        {
                          (DQ 
                            (command_sub
                              left_token: <Id.Left_DollarParen '$('>
                              child: (C {<cc_path>} {(DQ ($ Id.VSub_DollarName '$HOST_ARCH'))})
                            ) ($ Id.VSub_DollarName '$PATH')
                          )
                        }
                      spids: [501]
                    )
                  ]
                )
              ]
            )
            (C {<export_if_blank>} {<Id.Lit_VarLike 'CC_PREFIX='> (DQ (${ Id.VSub_Name ARCH) <->)})
            (command.ShAssignment
              pairs: [
                (assign_pair
                  lhs: (sh_lhs_expr.Name name:DO_CROSS)
                  op: assign_op.Equal
                  rhs: {(DQ <'CROSS_COMPILE='> ($ Id.VSub_DollarName '$CC_PREFIX'))}
                  spids: [526]
                )
              ]
            )
            (command.ControlFlow token:<Id.ControlFlow_Return return> arg_word:{<0>})
          ]
        )
    )
    (command.ShFunction
      name: build_section
      body: 
        (BraceGroup
          children: [
            (command.AndOr
              ops: [Id.Op_DAmp Id.Op_DAmp]
              children: [
                (C {<is_in_list>} {($ Id.VSub_Number '$1')} {($ Id.VSub_DollarName '$BUILD_STATIC')})
                (C {<Id.Lit_LBracket '['>} {<Id.KW_Bang '!'>} {<-z>} {(DQ ($ Id.VSub_DollarName '$ARCH'))} 
                  {<Id.Lit_RBracket ']'>}
                )
                (command.ShAssignment
                  pairs: [
                    (assign_pair
                      lhs: (sh_lhs_expr.Name name:STATIC_FLAGS)
                      op: assign_op.Equal
                      rhs: {(DQ <--static>)}
                      spids: [589]
                    )
                  ]
                )
              ]
            )
            (command.ShAssignment
              pairs: [
                (assign_pair
                  lhs: (sh_lhs_expr.Name name:OLDCPUS)
                  op: assign_op.Equal
                  rhs: {($ Id.VSub_DollarName '$CPUS')}
                  spids: [596]
                )
              ]
            )
            (command.ShAssignment
              pairs: [
                (assign_pair
                  lhs: (sh_lhs_expr.Name name:OLDNOCLEAN)
                  op: assign_op.Equal
                  rhs: {($ Id.VSub_DollarName '$NO_CLEANUP')}
                  spids: [600]
                )
              ]
            )
            (command.AndOr
              ops: [Id.Op_DAmp Id.Op_DAmp]
              children: [
                (C {<is_in_list>} {($ Id.VSub_Number '$1')} {($ Id.VSub_DollarName '$DEBUG_PACKAGE')})
                (command.ShAssignment
                  pairs: [
                    (assign_pair
                      lhs: (sh_lhs_expr.Name name:CPUS)
                      op: assign_op.Equal
                      rhs: {<1>}
                      spids: [612]
                    )
                  ]
                )
                (command.ShAssignment
                  pairs: [
                    (assign_pair
                      lhs: (sh_lhs_expr.Name name:NO_CLEANUP)
                      op: assign_op.Equal
                      rhs: {<1>}
                      spids: [617]
                    )
                  ]
                )
              ]
            )
            (command.If
              arms: [
                (if_arm
                  cond: 
                    (condition.Shell
                      commands: [
                        (C {<Id.Lit_LBracket '['>} {<-e>} 
                          {
                            (DQ ($ Id.VSub_DollarName '$SOURCES') <'/sections/'> 
                              ($ Id.VSub_Number '$1')
                            ) <.build>
                          } {<Id.Lit_RBracket ']'>}
                        )
                      ]
                    )
                  action: [
                    (C {<setupfor>} {(DQ ($ Id.VSub_Number '$1'))})
                    (C {<.>} 
                      {(DQ ($ Id.VSub_DollarName '$SOURCES') <'/sections/'> ($ Id.VSub_Number '$1')) 
                        <.build>
                      }
                    )
                    (C {<cleanup>})
                  ]
                  spids: [622 638]
                )
              ]
              else_action: [
                (C {<announce>} {(DQ ($ Id.VSub_Number '$1'))})
                (C {<.>} 
                  {(DQ ($ Id.VSub_DollarName '$SOURCES')) <'/sections/'> (DQ ($ Id.VSub_Number '$1')) 
                    <.sh>
                  }
                )
              ]
            )
            (command.ShAssignment
              pairs: [
                (assign_pair
                  lhs: (sh_lhs_expr.Name name:CPUS)
                  op: assign_op.Equal
                  rhs: {($ Id.VSub_DollarName '$OLDCPUS')}
                  spids: [686]
                )
              ]
            )
            (command.ShAssignment
              pairs: [
                (assign_pair
                  lhs: (sh_lhs_expr.Name name:NO_CLEANUP)
                  op: assign_op.Equal
                  rhs: {($ Id.VSub_DollarName '$OLDNOCLEAN')}
                  spids: [690]
                )
              ]
            )
          ]
        )
    )
    (command.ShFunction
      name: getconfig
      body: 
        (BraceGroup
          children: [
            (command.ForEach
              iter_name: i
              iter_words: [
                (word.BracedTree
                  parts: [
                    (word_part.BracedTuple
                      words: [{($ Id.VSub_DollarName '$ARCH_NAME')} {($ Id.VSub_DollarName '$ARCH')}]
                    )
                    <'/miniconfig-'>
                    ($ Id.VSub_Number '$1')
                  ]
                )
              ]
              do_arg_iter: F
              body: 
                (command.DoGroup
                  children: [
                    (command.AndOr
                      ops: [Id.Op_DAmp Id.Op_DAmp]
                      children: [
                        (C {<Id.Lit_LBracket '['>} {<-f>} 
                          {
                            (DQ ($ Id.VSub_DollarName '$CONFIG_DIR') <'/'> ($ Id.VSub_DollarName '$i'))
                          } {<Id.Lit_RBracket ']'>}
                        )
                        (C {<cat>} 
                          {
                            (DQ ($ Id.VSub_DollarName '$CONFIG_DIR') <'/'> ($ Id.VSub_DollarName '$i'))
                          }
                        )
                        (command.ControlFlow
                          token: <Id.ControlFlow_Return return>
                        )
                      ]
                    )
                  ]
                )
            )
            (C {<cat>} {(DQ ($ Id.VSub_DollarName '$SOURCES') <'/baseconfig-'> ($ Id.VSub_Number '$1'))})
            (C {<eval>} 
              {
                (DQ <'echo '> (word_part.EscapedLiteral token:<Id.Lit_EscapedChar '\\"'>) 
                  (word_part.EscapedLiteral token:<Id.Lit_EscapedChar '\\$'>) <'{'> 
                  (command_sub
                    left_token: <Id.Left_DollarParen '$('>
                    child: 
                      (command.Pipeline
                        children: [(C {<echo>} {($ Id.VSub_Number '$1')}) (C {<tr>} {<a-z>} {<A-Z>})]
                        negated: F
                      )
                  ) <'_CONFIG}'> (word_part.EscapedLiteral token:<Id.Lit_EscapedChar '\\"'>)
                )
              }
            )
          ]
        )
    )
    (command.ShFunction
      name: recent_binary_files
      body: 
        (BraceGroup
          children: [
            (command.ShAssignment
              pairs: [
                (assign_pair
                  lhs: (sh_lhs_expr.Name name:PREVIOUS)
                  op: assign_op.Equal
                  rhs: (word.Empty)
                  spids: [807]
                )
              ]
            )
            (command.Pipeline
              children: [
                (command.Subshell
                  child: 
                    (command.CommandList
                      children: [
                        (command.AndOr
                          ops: [Id.Op_DPipe]
                          children: [
                            (C {<cd>} {(DQ ($ Id.VSub_DollarName '$STAGE_DIR'))})
                            (C {<dienow>})
                          ]
                        )
                        (command.Pipeline
                          children: [
                            (C {<find>} {<.>} {<-depth>} {<-newer>} 
                              {(DQ ($ Id.VSub_DollarName '$CURSRC') <'/BUILD-TIMESTAMP'>)}
                            )
                            (C {<sed>} {<-e>} {(SQ <'s/^.//'>)} {<-e>} {(SQ <'s/^.//'>)} {<-e>} 
                              {(SQ <'/^$/d'>)}
                            )
                          ]
                          negated: F
                        )
                      ]
                    )
                )
                (command.WhileUntil
                  keyword: <Id.KW_While while>
                  cond: (condition.Shell commands:[(C {<read>} {<i>})])
                  body: 
                    (command.DoGroup
                      children: [
                        (command.ShAssignment
                          pairs: [
                            (assign_pair
                              lhs: (sh_lhs_expr.Name name:TEMP)
                              op: assign_op.Equal
                              rhs: 
                                {
                                  (DQ 
                                    (braced_var_sub
                                      token: <Id.VSub_Name PREVIOUS>
                                      suffix_op: 
                                        (suffix_op.Unary
                                          tok: <Id.VOp1_DPound '##'>
                                          arg_word: 
                                            {(DQ ($ Id.VSub_DollarName '$i')) <Id.Lit_Slash '/'>}
                                        )
                                    )
                                  )
                                }
                              spids: [874]
                            )
                          ]
                        )
                        (command.If
                          arms: [
                            (if_arm
                              cond: 
                                (condition.Shell
                                  commands: [
                                    (C {<Id.Lit_LBracket '['>} 
                                      {
                                        (word_part.ExprSub
                                          left: <Id.Left_DollarBracket '$['>
                                          child: 
                                            (expr.Binary
                                              op: <Id.Arith_Minus _>
                                              left: 
                                                (braced_var_sub
                                                  token: <Id.VSub_Name PREVIOUS>
                                                  prefix_op: (Id.VSub_Pound)
                                                )
                                              right: 
                                                (braced_var_sub
                                                  token: <Id.VSub_Name TEMP>
                                                  prefix_op: (Id.VSub_Pound)
                                                )
                                            )
                                        )
                                      } {<-ne>} 
                                      {
                                        (word_part.ExprSub
                                          left: <Id.Left_DollarBracket '$['>
                                          child: 
                                            (expr.Binary
                                              op: <Id.Arith_Plus _>
                                              left: 
                                                (braced_var_sub
                                                  token: <Id.VSub_Name i>
                                                  prefix_op: (Id.VSub_Pound)
                                                )
                                              right: (Const Id.Expr_DecInt 1)
                                            )
                                        )
                                      } {<Id.Lit_RBracket ']'>}
                                    )
                                  ]
                                )
                              action: [
                                (C {<echo>} {<-n>} {(DQ ($ Id.VSub_DollarName '$i'))})
                                (C {<echo>} {<-ne>} {(SQ <'\\0'>)})
                              ]
                              spids: [888 918]
                            )
                          ]
                        )
                        (command.ShAssignment
                          pairs: [
                            (assign_pair
                              lhs: (sh_lhs_expr.Name name:PREVIOUS)
                              op: assign_op.Equal
                              rhs: {(DQ ($ Id.VSub_DollarName '$i'))}
                              spids: [946]
                            )
                          ]
                        )
                      ]
                    )
                )
              ]
              negated: F
            )
          ]
        )
    )
    (command.ShFunction
      name: cleanup
      body: 
        (BraceGroup
          children: [
            (command.AndOr
              ops: [Id.Op_DAmp]
              children: [
                (C {<Id.Lit_LBracket '['>} {($ Id.VSub_QMark '$?')} {<-ne>} {<0>} {<Id.Lit_RBracket ']'>})
                (C {<dienow>})
              ]
            )
            (command.If
              arms: [
                (if_arm
                  cond: 
                    (condition.Shell
                      commands: [
                        (C {<Id.Lit_LBracket '['>} {<Id.KW_Bang '!'>} {<-z>} 
                          {(DQ ($ Id.VSub_DollarName '$BINARY_PACKAGE_TARBALLS'))} {<Id.Lit_RBracket ']'>}
                        )
                      ]
                    )
                  action: [
                    (command.ShAssignment
                      pairs: [
                        (assign_pair
                          lhs: (sh_lhs_expr.Name name:TARNAME)
                          op: assign_op.Equal
                          rhs: 
                            {
                              (DQ ($ Id.VSub_DollarName '$PACKAGE') <-> 
                                ($ Id.VSub_DollarName '$STAGE_NAME') <-> (${ Id.VSub_Name ARCH_NAME)
                              ) <.tar.gz>
                            }
                          spids: [1007]
                        )
                      ]
                    )
                    (command.AndOr
                      ops: [Id.Op_DAmp Id.Op_DAmp]
                      children: [
                        (C {<Id.Lit_LBracket '['>} {<Id.KW_Bang '!'>} {<-z>} 
                          {
                            (DQ 
                              (command_sub
                                left_token: <Id.Left_DollarParen '$('>
                                child: (C {<recent_binary_files>})
                              )
                            )
                          } {<Id.Lit_RBracket ']'>}
                        )
                        (C {<echo>} {<-n>} {<Creating>} {(DQ ($ Id.VSub_DollarName '$TARNAME'))})
                        (command.Pipeline
                          children: [
                            (BraceGroup
                              children: [
                                (command.AndOr
                                  ops: [Id.Op_DPipe]
                                  children: [
                                    (command.Pipeline
                                      children: [
                                        (C {<recent_binary_files>})
                                        (C {<xargs>} {<-0>} {<tar>} {<-czvf>} 
                                          {
                                            (DQ ($ Id.VSub_DollarName '$BUILD') <'/'> 
                                              (${ Id.VSub_Name TARNAME)
                                            )
                                          } {<-C>} {(DQ ($ Id.VSub_DollarName '$STAGE_DIR'))}
                                        )
                                      ]
                                      negated: F
                                    )
                                    (C {<dienow>})
                                  ]
                                )
                              ]
                            )
                            (C {<dotprogress>})
                          ]
                          negated: F
                        )
                      ]
                    )
                  ]
                  spids: [989 1004]
                )
              ]
            )
            (command.If
              arms: [
                (if_arm
                  cond: 
                    (condition.Shell
                      commands: [
                        (C {<Id.Lit_LBracket '['>} {<Id.KW_Bang '!'>} {<-z>} 
                          {(DQ ($ Id.VSub_DollarName '$NO_CLEANUP'))} {<Id.Lit_RBracket ']'>}
                        )
                      ]
                    )
                  action: [
                    (C {<echo>} 
                      {
                        (DQ <'skip cleanup '> ($ Id.VSub_DollarName '$PACKAGE') <' '> 
                          ($ Id.VSub_At '$@')
                        )
                      }
                    )
                    (command.ControlFlow token:<Id.ControlFlow_Return return>)
                  ]
                  spids: [1096 1111]
                )
              ]
            )
            (command.AndOr
              ops: [Id.Op_DPipe]
              children: [(C {<cd>} {(DQ ($ Id.VSub_DollarName '$WORK'))}) (C {<dienow>})]
            )
            (command.ForEach
              iter_name: i
              iter_words: [{($ Id.VSub_DollarName '$WORKDIR_LIST')}]
              do_arg_iter: F
              body: 
                (command.DoGroup
                  children: [
                    (C {<echo>} {(DQ <'cleanup '> ($ Id.VSub_DollarName '$i'))})
                    (command.AndOr
                      ops: [Id.Op_DPipe]
                      children: [(C {<rm>} {<-rf>} {(DQ ($ Id.VSub_DollarName '$i'))}) (C {<dienow>})]
                    )
                  ]
                )
            )
            (command.ShAssignment
              pairs: [
                (assign_pair
                  lhs: (sh_lhs_expr.Name name:WORKDIR_LIST)
                  op: assign_op.Equal
                  rhs: (word.Empty)
                  spids: [1183]
                )
              ]
            )
          ]
        )
    )
    (command.ShFunction
      name: blank_workdir
      body: 
        (BraceGroup
          children: [
            (command.ShAssignment
              pairs: [
                (assign_pair
                  lhs: (sh_lhs_expr.Name name:WORKDIR_LIST)
                  op: assign_op.Equal
                  rhs: {(DQ ($ Id.VSub_Number '$1') <' '> ($ Id.VSub_DollarName '$WORKDIR_LIST'))}
                  spids: [1202]
                )
              ]
            )
            (command.Simple
              words: [
                {<blank_tempdir>}
                {(DQ ($ Id.VSub_DollarName '$WORK') <'/'> ($ Id.VSub_Number '$1'))}
              ]
              more_env: [(env_pair name:NO_CLEANUP val:(word.Empty) spids:[1210])]
              do_fork: T
            )
            (command.AndOr
              ops: [Id.Op_DPipe]
              children: [
                (C {<cd>} {(DQ ($ Id.VSub_DollarName '$WORK') <'/'> ($ Id.VSub_Number '$1'))})
                (C {<dienow>})
              ]
            )
          ]
        )
    )
    (command.ShFunction
      name: setupfor
      body: 
        (BraceGroup
          children: [
            (C {<export>} 
              {<Id.Lit_VarLike 'WRAPPY_LOGPATH='> 
                (DQ ($ Id.VSub_DollarName '$BUILD') <'/logs/cmdlines.'> (${ Id.VSub_Name ARCH_NAME) <.> 
                  (${ Id.VSub_Name STAGE_NAME) <.setupfor>
                )
              }
            )
            (command.AndOr
              ops: [Id.Op_DPipe]
              children: [
                (C {<extract_package>} {(DQ ($ Id.VSub_Number '$1'))})
                (command.ControlFlow token:<Id.ControlFlow_Exit exit> arg_word:{<1>})
              ]
            )
            (command.ShAssignment
              pairs: [
                (assign_pair
                  lhs: (sh_lhs_expr.Name name:SNAPFROM)
                  op: assign_op.Equal
                  rhs: 
                    {
                      (DQ 
                        (command_sub
                          left_token: <Id.Left_DollarParen '$('>
                          child: (C {<package_cache>} {(DQ ($ Id.VSub_Number '$1'))})
                        )
                      )
                    }
                  spids: [1282]
                )
              ]
            )
            (C {<echo>} {(DQ <'Snapshot \''> ($ Id.VSub_DollarName '$PACKAGE') <'\'...'>)})
            (command.ForEach
              iter_name: LINKTYPE
              iter_words: [{<l>} {<s>} {<n>}]
              do_arg_iter: F
              body: 
                (command.DoGroup
                  children: [
                    (command.If
                      arms: [
                        (if_arm
                          cond: 
                            (condition.Shell
                              commands: [
                                (C {<Id.Lit_LBracket '['>} {<-z>} 
                                  {(DQ ($ Id.VSub_DollarName '$REUSE_CURSRC'))} {<Id.Lit_RBracket ']'>}
                                )
                              ]
                            )
                          action: [
                            (C {<blank_workdir>} {(DQ ($ Id.VSub_DollarName '$PACKAGE'))})
                            (command.ShAssignment
                              pairs: [
                                (assign_pair
                                  lhs: (sh_lhs_expr.Name name:CURSRC)
                                  op: assign_op.Equal
                                  rhs: 
                                    {
                                      (DQ 
                                        (command_sub
                                          left_token: <Id.Left_DollarParen '$('>
                                          child: (C {<pwd>})
                                        )
                                      )
                                    }
                                  spids: [1357]
                                )
                              ]
                            )
                          ]
                          spids: [1334 1347]
                        )
                      ]
                    )
                    (command.AndOr
                      ops: [Id.Op_DAmp]
                      children: [
                        (C {<cp>} {<-> (${ Id.VSub_Name LINKTYPE) <fR>} 
                          {(DQ ($ Id.VSub_DollarName '$SNAPFROM') <'/'>) <Id.Lit_Star '*'>} {(DQ ($ Id.VSub_DollarName '$CURSRC'))}
                        )
                        (command.ControlFlow
                          token: <Id.ControlFlow_Break break>
                        )
                      ]
                    )
                  ]
                )
            )
            (command.AndOr
              ops: [Id.Op_DPipe]
              children: [(C {<cd>} {(DQ ($ Id.VSub_DollarName '$CURSRC'))}) (C {<dienow>})]
            )
            (C {<export>} 
              {<Id.Lit_VarLike 'WRAPPY_LOGPATH='> 
                (DQ ($ Id.VSub_DollarName '$BUILD') <'/logs/cmdlines.'> (${ Id.VSub_Name ARCH_NAME) <.> 
                  (${ Id.VSub_Name STAGE_NAME) <.> ($ Id.VSub_Number '$1')
                )
              }
            )
            (command.If
              arms: [
                (if_arm
                  cond: 
                    (condition.Shell
                      commands: [
                        (C {<Id.Lit_LBracket '['>} {<Id.KW_Bang '!'>} {<-z>} 
                          {(DQ ($ Id.VSub_DollarName '$BINARY_PACKAGE_TARBALLS'))} {<Id.Lit_RBracket ']'>}
                        )
                      ]
                    )
                  action: [
                    (command.AndOr
                      ops: [Id.Op_DPipe]
                      children: [
                        (C {<touch>} {(DQ ($ Id.VSub_DollarName '$CURSRC') <'/BUILD-TIMESTAMP'>)})
                        (C {<dienow>})
                      ]
                    )
                    (command.ShAssignment
                      pairs: [
                        (assign_pair
                          lhs: (sh_lhs_expr.Name name:TIME)
                          op: assign_op.Equal
                          rhs: 
                            {
                              (command_sub
                                left_token: <Id.Left_DollarParen '$('>
                                child: (C {<date>} {<Id.Lit_Other '+'> <Id.Lit_Other '%'> <s>})
                              )
                            }
                          spids: [1469]
                        )
                      ]
                    )
                    (command.WhileUntil
                      keyword: <Id.KW_While while>
                      cond: (condition.Shell commands:[(C {<true>})])
                      body: 
                        (command.DoGroup
                          children: [
                            (command.AndOr
                              ops: [Id.Op_DAmp]
                              children: [
                                (C {<Id.Lit_LBracket '['>} {($ Id.VSub_DollarName '$TIME')} 
                                  {<Id.KW_Bang '!'> <Id.Lit_Equals '='>} 
                                  {
                                    (DQ 
                                      (command_sub
                                        left_token: <Id.Left_DollarParen '$('>
                                        child: (C {<date>} {<Id.Lit_Other '+'> <Id.Lit_Other '%'> <s>})
                                      )
                                    )
                                  } {<Id.Lit_RBracket ']'>}
                                )
                                (command.ControlFlow
                                  token: <Id.ControlFlow_Break break>
                                )
                              ]
                            )
                            (C {<sleep>} {<.1>})
                          ]
                        )
                    )
                  ]
                  spids: [1439 1454]
                )
              ]
            )
          ]
        )
    )
    (command.ShFunction
      name: getversion
      body: 
        (BraceGroup
          children: [
            (command.Pipeline
              children: [
                (C {<echo>} {(DQ ($ Id.VSub_Number '$1'))})
                (C {<sed>} {<-e>} 
                  {
                    (SQ 
                      <
's/.*-\\(\\([0-9\\.]\\)*\\([_-]rc\\)*\\(-pre\\)*\\([0-9][a-zA-Z]\\)*\\)*\\(\\.tar\\..z2*\\)$/'
                      >
                    ) (DQ ($ Id.VSub_Number '$2')) (SQ <'\\1/'>)
                  }
                )
              ]
              negated: F
            )
          ]
        )
    )
    (command.ShFunction
      name: get_download_version
      body: 
        (BraceGroup
          children: [
            (C {<getversion>} 
              {
                (command_sub
                  left_token: <Id.Left_DollarParen '$('>
                  child: 
                    (command.Pipeline
                      children: [
                        (C {<sed>} {<-n>} {(SQ <'s@URL=.*/\\(.[^ ]*\\).*@\\1@p'>)} 
                          {(DQ ($ Id.VSub_DollarName '$TOP') <'/download.sh'>)}
                        )
                        (C {<grep>} {(${ Id.VSub_Number 1) <->})
                      ]
                      negated: F
                    )
                )
              }
            )
          ]
        )
    )
    (command.ShFunction
      name: identify_release
      body: 
        (BraceGroup
          children: [
            (command.ShAssignment
              pairs: [
                (assign_pair
                  lhs: (sh_lhs_expr.Name name:DIR)
                  op: assign_op.Equal
                  rhs: {(DQ ($ Id.VSub_DollarName '$SRCDIR') <'/'> ($ Id.VSub_Number '$1'))}
                  spids: [1611]
                )
              ]
            )
            (command.If
              arms: [
                (if_arm
                  cond: 
                    (condition.Shell
                      commands: [
                        (C {<Id.Lit_LBracket '['>} {<-d>} {(DQ ($ Id.VSub_DollarName '$DIR'))} 
                          {<Id.Lit_RBracket ']'>}
                        )
                      ]
                    )
                  action: [
                    (command.Subshell
                      child: 
                        (command.CommandList
                          children: [
                            (command.AndOr
                              ops: [Id.Op_DPipe]
                              children: [(C {<cd>} {(DQ ($ Id.VSub_DollarName '$DIR'))}) (C {<dienow>})]
                            )
                            (command.ShAssignment
                              pairs: [
                                (assign_pair
                                  lhs: (sh_lhs_expr.Name name:ID)
                                  op: assign_op.Equal
                                  rhs: 
                                    {
                                      (DQ 
                                        (command_sub
                                          left_token: <Id.Left_DollarParen '$('>
                                          child: 
                                            (command.Simple
                                              words: [
                                                {<git>}
                                                {<log>}
                                                {<-1>}
                                                {<--format> <Id.Lit_Equals '='> <Id.Lit_Other '%'> <H>}
                                              ]
                                              redirects: [
                                                (redir
                                                  op: <Id.Redir_Great '2>'>
                                                  loc: (redir_loc.Fd fd:2)
                                                  arg: {<'/dev/null'>}
                                                )
                                              ]
                                              do_fork: T
                                            )
                                        )
                                      )
                                    }
                                  spids: [1649]
                                )
                              ]
                            )
                            (command.AndOr
                              ops: [Id.Op_DAmp Id.Op_DAmp]
                              children: [
                                (C {<Id.Lit_LBracket '['>} {<Id.KW_Bang '!'>} {<-z>} 
                                  {(DQ ($ Id.VSub_DollarName '$ID'))} {<Id.Lit_RBracket ']'>}
                                )
                                (C {<echo>} {<git>} {(DQ ($ Id.VSub_DollarName '$ID'))})
                                (command.ControlFlow
                                  token: <Id.ControlFlow_Return return>
                                )
                              ]
                            )
                            (command.ShAssignment
                              pairs: [
                                (assign_pair
                                  lhs: (sh_lhs_expr.Name name:ID)
                                  op: assign_op.Equal
                                  rhs: 
                                    {
                                      (DQ 
                                        (command_sub
                                          left_token: <Id.Left_DollarParen '$('>
                                          child: 
                                            (command.Simple
                                              words: [{<hg>} {<identify>} {<-n>}]
                                              redirects: [
                                                (redir
                                                  op: <Id.Redir_Great '2>'>
                                                  loc: (redir_loc.Fd fd:2)
                                                  arg: {<'/dev/null'>}
                                                )
                                              ]
                                              do_fork: T
                                            )
                                        )
                                      )
                                    }
                                  spids: [1697]
                                )
                              ]
                            )
                            (command.AndOr
                              ops: [Id.Op_DAmp Id.Op_DAmp]
                              children: [
                                (C {<Id.Lit_LBracket '['>} {<Id.KW_Bang '!'>} {<-z>} 
                                  {(DQ ($ Id.VSub_DollarName '$ID'))} {<Id.Lit_RBracket ']'>}
                                )
                                (C {<echo>} {<hg>} {(DQ ($ Id.VSub_DollarName '$ID'))})
                                (command.ControlFlow
                                  token: <Id.ControlFlow_Return return>
                                )
                              ]
                            )
                            (command.ShAssignment
                              pairs: [
                                (assign_pair
                                  lhs: (sh_lhs_expr.Name name:ID)
                                  op: assign_op.Equal
                                  rhs: 
                                    {
                                      (DQ 
                                        (command_sub
                                          left_token: <Id.Left_DollarParen '$('>
                                          child: 
                                            (command.Pipeline
                                              children: [
                                                (command.Simple
                                                  words: [{<svn>} {<info>}]
                                                  redirects: [
                                                    (redir
                                                      op: <Id.Redir_Great '2>'>
                                                      loc: (redir_loc.Fd fd:2)
                                                      arg: {<'/dev/null'>}
                                                    )
                                                  ]
                                                  do_fork: T
                                                )
                                                (C {<sed>} {<-n>} {(DQ <'s/^Revision: //p'>)})
                                              ]
                                              negated: F
                                            )
                                        )
                                      )
                                    }
                                  spids: [1740]
                                )
                              ]
                            )
                            (command.AndOr
                              ops: [Id.Op_DAmp Id.Op_DAmp]
                              children: [
                                (C {<Id.Lit_LBracket '['>} {<Id.KW_Bang '!'>} {<-z>} 
                                  {(DQ ($ Id.VSub_DollarName '$ID'))} {<Id.Lit_RBracket ']'>}
                                )
                                (C {<echo>} {<svn>} {(DQ ($ Id.VSub_DollarName '$ID'))})
                                (command.ControlFlow
                                  token: <Id.ControlFlow_Return return>
                                )
                              ]
                            )
                          ]
                        )
                    )
                  ]
                  spids: [1619 1632]
                )
              ]
            )
            (C {<echo>} {<release>} {<version>} 
              {
                (command_sub
                  left_token: <Id.Left_DollarParen '$('>
                  child: (C {<get_download_version>} {($ Id.VSub_Number '$1')})
                )
              }
            )
          ]
        )
    )
    (command.ShFunction
      name: do_manifest
      body: 
        (BraceGroup
          children: [
            (command.AndOr
              ops: [Id.Op_DAmp]
              children: [
                (C {<Id.Lit_LBracket '['>} {<-z>} {(DQ ($ Id.VSub_DollarName '$SCRIPT_VERS'))} 
                  {<Id.Lit_RBracket ']'>}
                )
                (command.ShAssignment
                  pairs: [
                    (assign_pair
                      lhs: (sh_lhs_expr.Name name:SCRIPT_VERS)
                      op: assign_op.Equal
                      rhs: 
                        {
                          (DQ <'mercurial rev '> 
                            (command_sub
                              left_token: <Id.Left_DollarParen '$('>
                              child: 
                                (command.CommandList
                                  children: [
                                    (command.Sentence
                                      child: (C {<cd>} {(DQ ($ Id.VSub_DollarName '$TOP'))})
                                      terminator: <Id.Op_Semi _>
                                    )
                                    (command.Simple
                                      words: [{<hg>} {<identify>} {<-n>}]
                                      redirects: [
                                        (redir
                                          op: <Id.Redir_Great '2>'>
                                          loc: (redir_loc.Fd fd:2)
                                          arg: {<'/dev/null'>}
                                        )
                                      ]
                                      do_fork: T
                                    )
                                  ]
                                )
                            )
                          )
                        }
                      spids: [1841]
                    )
                  ]
                )
              ]
            )
            (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: 1964
                      stdin_parts: [
                        <'Built on '>
                        (command_sub
                          left_token: <Id.Left_DollarParen '$('>
                          child: (C {<date>} {<Id.Lit_Other '+'> <Id.Lit_Other '%'> <F>})
                        )
                        <' from:\n'>
                        <'\n'>
                        <'  Build script:\n'>
                        <'    Aboriginal Linux (http://landley.net/aboriginal) '>
                        ($ Id.VSub_DollarName '$SCRIPT_VERS')
                        <'\n'>
                        <'\n'>
                        <'  Base packages:\n'>
                        <'    uClibc (http://uclibc.org) '>
                        (command_sub
                          left_token: <Id.Left_DollarParen '$('>
                          child: (C {<identify_release>} {<uClibc>})
                        )
                        <'\n'>
                        <'    BusyBox (http://busybox.net) '>
                        (command_sub
                          left_token: <Id.Left_DollarParen '$('>
                          child: (C {<identify_release>} {<busybox>})
                        )
                        <'\n'>
                        <'    Linux (http://kernel.org/pub/linux/kernel) '>
                        (command_sub
                          left_token: <Id.Left_DollarParen '$('>
                          child: (C {<identify_release>} {<linux>})
                        )
                        <'\n'>
                        <'    toybox (http://landley.net/toybox) '>
                        (command_sub
                          left_token: <Id.Left_DollarParen '$('>
                          child: (C {<identify_release>} {<toybox>})
                        )
                        <'\n'>
                        <'\n'>
                        <'  Toolchain packages:\n'>
                        <'    Binutils (http://www.gnu.org/software/binutils/) '>
                        (command_sub
                          left_token: <Id.Left_DollarParen '$('>
                          child: (C {<identify_release>} {<binutils>})
                        )
                        <'\n'>
                        <'    GCC (http://gcc.gnu.org) '>
                        (command_sub
                          left_token: <Id.Left_DollarParen '$('>
                          child: (C {<identify_release>} {<gcc-core>})
                        )
                        <'\n'>
                        <'    gmake (http://www.gnu.org/software/make) '>
                        (command_sub
                          left_token: <Id.Left_DollarParen '$('>
                          child: (C {<identify_release>} {<make>})
                        )
                        <'\n'>
                        <'    bash (ftp://ftp.gnu.org/gnu/bash) '>
                        (command_sub
                          left_token: <Id.Left_DollarParen '$('>
                          child: (C {<identify_release>} {<bash>})
                        )
                        <'\n'>
                        <'\n'>
                        <'  Optional packages:\n'>
                        <'    distcc (http://distcc.samba.org) '>
                        (command_sub
                          left_token: <Id.Left_DollarParen '$('>
                          child: (C {<identify_release>} {<distcc>})
                        )
                        <'\n'>
                        <'    uClibc++ (http://cxx.uclibc.org) '>
                        (command_sub
                          left_token: <Id.Left_DollarParen '$('>
                          child: 
                            (C {<identify_release>} {<uClibc> <Id.Lit_Other '+'> <Id.Lit_Other '+'>})
                        )
                        <'\n'>
                      ]
                    )
                )
              ]
              do_fork: T
            )
          ]
        )
    )
    (command.ShFunction
      name: link_arch_name
      body: 
        (BraceGroup
          children: [
            (command.AndOr
              ops: [Id.Op_DAmp]
              children: [
                (C {<Id.Lit_LBracket '['>} {(DQ ($ Id.VSub_DollarName '$ARCH'))} 
                  {<Id.Lit_Equals '='> <Id.Lit_Equals '='>} {(DQ ($ Id.VSub_DollarName '$ARCH_NAME'))} {<Id.Lit_RBracket ']'>}
                )
                (command.ControlFlow
                  token: <Id.ControlFlow_Return return>
                  arg_word: {<0>}
                )
              ]
            )
            (command.AndOr
              ops: [Id.Op_DAmp Id.Op_DPipe]
              children: [
                (C {<rm>} {<-rf>} {(DQ ($ Id.VSub_DollarName '$BUILD') <'/'> ($ Id.VSub_Number '$2'))})
                (C {<ln>} {<-s>} {(DQ ($ Id.VSub_Number '$1'))} 
                  {(DQ ($ Id.VSub_DollarName '$BUILD') <'/'> ($ Id.VSub_Number '$2'))}
                )
                (C {<dienow>})
              ]
            )
          ]
        )
    )
    (command.ShFunction
      name: check_for_base_arch
      body: 
        (BraceGroup
          children: [
            (command.If
              arms: [
                (if_arm
                  cond: 
                    (condition.Shell
                      commands: [
                        (C {<Id.Lit_LBracket '['>} {(DQ ($ Id.VSub_DollarName '$ARCH'))} 
                          {<Id.KW_Bang '!'> <Id.Lit_Equals '='>} {(DQ ($ Id.VSub_DollarName '$ARCH_NAME'))} {<Id.Lit_RBracket ']'>}
                        )
                      ]
                    )
                  action: [
                    (C {<link_arch_name>} 
                      (word.BracedTree
                        parts: [
                          ($ Id.VSub_DollarName '$STAGE_NAME')
                          <->
                          (word_part.BracedTuple
                            words: [
                              {(DQ ($ Id.VSub_DollarName '$ARCH'))}
                              {(DQ ($ Id.VSub_DollarName '$ARCH_NAME'))}
                            ]
                          )
                        ]
                      )
                    )
                    (command.AndOr
                      ops: [Id.Op_DAmp]
                      children: [
                        (C {<Id.Lit_LBracket '['>} {<-e>} 
                          {($ Id.VSub_DollarName '$STAGE_NAME') <-> (DQ ($ Id.VSub_DollarName '$ARCH')) 
                            <.tar.gz>
                          } {<Id.Lit_RBracket ']'>}
                        )
                        (C {<link_arch_name>} 
                          (word.BracedTree
                            parts: [
                              ($ Id.VSub_DollarName '$STAGE_NAME')
                              <->
                              (word_part.BracedTuple
                                words: [
                                  {(DQ ($ Id.VSub_DollarName '$ARCH'))}
                                  {(DQ ($ Id.VSub_DollarName '$ARCH_NAME'))}
                                ]
                              )
                              <.tar.gz>
                            ]
                          )
                        )
                      ]
                    )
                    (command.If
                      arms: [
                        (if_arm
                          cond: 
                            (condition.Shell
                              commands: [
                                (C {<Id.Lit_LBracket '['>} {<-e>} 
                                  {
                                    (DQ ($ Id.VSub_DollarName '$BUILD') <'/'> 
                                      ($ Id.VSub_DollarName '$STAGE_NAME') <-> ($ Id.VSub_DollarName '$ARCH')
                                    )
                                  } {<Id.Lit_RBracket ']'>}
                                )
                              ]
                            )
                          action: [
                            (C {<announce>} 
                              {
                                (DQ <'Using existing '> (${ Id.VSub_Name STAGE_NAME) <-> 
                                  ($ Id.VSub_DollarName '$ARCH')
                                )
                              }
                            )
                            (command.ControlFlow
                              token: <Id.ControlFlow_Return return>
                              arg_word: {<1>}
                            )
                          ]
                          spids: [2128 2145]
                        )
                      ]
                      else_action: [
                        (command.AndOr
                          ops: [Id.Op_DPipe]
                          children: [
                            (C {<mkdir>} {<-p>} 
                              {
                                (DQ ($ Id.VSub_DollarName '$BUILD') <'/'> 
                                  ($ Id.VSub_DollarName '$STAGE_NAME') <-> ($ Id.VSub_DollarName '$ARCH')
                                )
                              }
                            )
                            (C {<dienow>})
                          ]
                        )
                      ]
                    )
                  ]
                  spids: [2059 2077]
                )
              ]
            )
          ]
        )
    )
    (command.ShFunction
      name: create_stage_tarball
      body: 
        (BraceGroup
          children: [
            (command.Simple
              words: [{<rmdir>} {(DQ ($ Id.VSub_DollarName '$WORK'))}]
              redirects: [(redir op:<Id.Redir_Great '2>'> loc:(redir_loc.Fd fd:2) arg:{<'/dev/null'>})]
              do_fork: T
            )
            (command.AndOr
              ops: [Id.Op_DPipe]
              children: [(C {<cd>} {(DQ ($ Id.VSub_DollarName '$BUILD'))}) (C {<dienow>})]
            )
            (C {<link_arch_name>} 
              (word.BracedTree
                parts: [
                  ($ Id.VSub_DollarName '$STAGE_NAME')
                  <->
                  (word_part.BracedTuple
                    words: [{($ Id.VSub_DollarName '$ARCH')} {($ Id.VSub_DollarName '$ARCH_NAME')}]
                  )
                ]
              )
            )
            (command.If
              arms: [
                (if_arm
                  cond: 
                    (condition.Shell
                      commands: [
                        (C {<Id.Lit_LBracket '['>} {<-z>} 
                          {(DQ ($ Id.VSub_DollarName '$NO_STAGE_TARBALLS'))} {<Id.Lit_RBracket ']'>}
                        )
                      ]
                    )
                  action: [
                    (C {<echo>} {<-n>} {<creating>} 
                      {(DQ ($ Id.VSub_DollarName '$STAGE_NAME') <-> (${ Id.VSub_Name ARCH)) <.tar.gz>}
                    )
                    (command.Pipeline
                      children: [
                        (BraceGroup
                          children: [
                            (command.AndOr
                              ops: [Id.Op_DPipe]
                              children: [
                                (C {<tar>} {<czvf>} 
                                  {
                                    (DQ ($ Id.VSub_DollarName '$STAGE_NAME') <-> (${ Id.VSub_Name ARCH)) <.tar.gz>
                                  } {(DQ ($ Id.VSub_DollarName '$STAGE_NAME') <-> (${ Id.VSub_Name ARCH))}
                                )
                                (C {<dienow>})
                              ]
                            )
                          ]
                        )
                        (C {<dotprogress>})
                      ]
                      negated: F
                    )
                    (C {<link_arch_name>} 
                      (word.BracedTree
                        parts: [
                          ($ Id.VSub_DollarName '$STAGE_NAME')
                          <->
                          (word_part.BracedTuple
                            words: [
                              {($ Id.VSub_DollarName '$ARCH')}
                              {($ Id.VSub_DollarName '$ARCH_NAME')}
                            ]
                          )
                          <.tar.gz>
                        ]
                      )
                    )
                  ]
                  spids: [2245 2258]
                )
              ]
            )
          ]
        )
    )
    (command.ShFunction
      name: hosttools_path
      body: 
        (BraceGroup
          children: [
            (C {<local>} {<X>})
            (C {<echo>} {<-n>} {(DQ ($ Id.VSub_DollarName '$HOSTTOOLS'))})
            (command.ShAssignment
              pairs: [
                (assign_pair
                  lhs: (sh_lhs_expr.Name name:X)
                  op: assign_op.Equal
                  rhs: {<1>}
                  spids: [2360]
                )
              ]
            )
            (command.WhileUntil
              keyword: <Id.KW_While while>
              cond: 
                (condition.Shell
                  commands: [
                    (C {<Id.Lit_LBracket '['>} {<-e>} 
                      {
                        (DQ ($ Id.VSub_DollarName '$HOSTTOOLS') <'/fallback-'> 
                          ($ Id.VSub_DollarName '$X')
                        )
                      } {<Id.Lit_RBracket ']'>}
                    )
                  ]
                )
              body: 
                (command.DoGroup
                  children: [
                    (C {<echo>} {<-n>} 
                      {
                        (DQ <':'> ($ Id.VSub_DollarName '$HOSTTOOLS') <'/fallback-'> 
                          ($ Id.VSub_DollarName '$X')
                        )
                      }
                    )
                    (command.ShAssignment
                      pairs: [
                        (assign_pair
                          lhs: (sh_lhs_expr.Name name:X)
                          op: assign_op.Equal
                          rhs: 
                            {
                              (word_part.ExprSub
                                left: <Id.Left_DollarBracket '$['>
                                child: 
                                  (expr.Binary
                                    op: <Id.Arith_Plus _>
                                    left: ($ Id.VSub_DollarName '$X')
                                    right: (Const Id.Expr_DecInt 1)
                                  )
                              )
                            }
                          spids: [2394]
                        )
                      ]
                    )
                  ]
                )
            )
          ]
        )
    )
    (command.ShFunction
      name: image_filesystem
      body: 
        (BraceGroup
          children: [
            (C {<echo>} 
              {(DQ <'make '> ($ Id.VSub_DollarName '$SYSIMAGE_TYPE') <' '> ($ Id.VSub_Number '$2'))}
            )
            (command.If
              arms: [
                (if_arm
                  cond: 
                    (condition.Shell
                      commands: [
                        (command.AndOr
                          ops: [Id.Op_DPipe]
                          children: [
                            (C {<Id.Lit_LBracket '['>} {(DQ ($ Id.VSub_DollarName '$SYSIMAGE_TYPE'))} 
                              {<Id.Lit_Equals '='> <Id.Lit_Equals '='>} {(DQ <cpio>)} {<Id.Lit_RBracket ']'>}
                            )
                            (C {<Id.Lit_LBracket '['>} {(DQ ($ Id.VSub_DollarName '$SYSIMAGE_TYPE'))} 
                              {<Id.Lit_Equals '='> <Id.Lit_Equals '='>} {(DQ <rootfs>)} {<Id.Lit_RBracket ']'>}
                            )
                          ]
                        )
                      ]
                    )
                  action: [
                    (command.AndOr
                      ops: [Id.Op_DAmp Id.Op_DPipe]
                      children: [
                        (C {<extract_package>} {<linux>})
                        (C {($ Id.VSub_DollarName '$CC')} 
                          {
                            (DQ 
                              (command_sub
                                left_token: <Id.Left_DollarParen '$('>
                                child: (C {<package_cache>} {($ Id.VSub_DollarName '$PACKAGE')})
                              ) <'/usr/gen_init_cpio.c'>
                            )
                          } {<-o>} {(DQ ($ Id.VSub_DollarName '$WORK')) <'/my_gen_init_cpio'>}
                        )
                        (C {<dienow>})
                      ]
                    )
                    (command.AndOr
                      ops: [Id.Op_DPipe]
                      children: [
                        (command.Pipeline
                          children: [
                            (C {(DQ ($ Id.VSub_DollarName '$WORK')) <'/my_gen_init_cpio'>} 
                              {
                                (command_sub
                                  left_token: <Id.Left_ProcSubIn '<('>
                                  child: 
                                    (command.CommandList
                                      children: [
                                        (command.AndOr
                                          ops: [Id.Op_DPipe]
                                          children: [
                                            (C 
                                              {(DQ ($ Id.VSub_DollarName '$SOURCES')) 
                                                <'/toys/gen_initramfs_list.sh'>
                                              } {(DQ ($ Id.VSub_Number '$1'))}
                                            )
                                            (C {<dienow>})
                                          ]
                                        )
                                        (command.AndOr
                                          ops: [Id.Op_DAmp]
                                          children: [
                                            (C {<Id.Lit_LBracket '['>} {<Id.KW_Bang '!'>} {<-e>} 
                                              {(DQ ($ Id.VSub_Number '$1')) <'/init'>} {<Id.Lit_RBracket ']'>}
                                            )
                                            (C {<echo>} {(DQ <'slink /init /sbin/init.sh 755 0 0'>)})
                                          ]
                                        )
                                        (command.AndOr
                                          ops: [Id.Op_DAmp]
                                          children: [
                                            (C {<Id.Lit_LBracket '['>} {<Id.KW_Bang '!'>} {<-d>} 
                                              {(DQ ($ Id.VSub_Number '$1')) <'/dev'>} {<Id.Lit_RBracket ']'>}
                                            )
                                            (C {<echo>} {(DQ <'dir /dev 755 0 0'>)})
                                          ]
                                        )
                                        (C {<echo>} {(DQ <'nod /dev/console 660 0 0 c 5 1'>)})
                                      ]
                                    )
                                )
                              }
                            )
                            (command.Simple
                              words: [{<gzip>} {<-9>}]
                              redirects: [
                                (redir
                                  op: <Id.Redir_Great '>'>
                                  loc: (redir_loc.Fd fd:1)
                                  arg: {(DQ ($ Id.VSub_Number '$2') <.cpio.gz>)}
                                )
                              ]
                              do_fork: T
                            )
                          ]
                          negated: F
                        )
                        (C {<dienow>})
                      ]
                    )
                    (C {<echo>} {<Initramfs>} {<generated.>})
                  ]
                  spids: [2434 2469]
                )
                (if_arm
                  cond: 
                    (condition.Shell
                      commands: [
                        (command.AndOr
                          ops: [Id.Op_DPipe]
                          children: [
                            (C {<Id.Lit_LBracket '['>} {(DQ ($ Id.VSub_DollarName '$SYSIMAGE_TYPE'))} 
                              {<Id.Lit_Equals '='> <Id.Lit_Equals '='>} {(DQ <ext2>)} {<Id.Lit_RBracket ']'>}
                            )
                            (C {<Id.Lit_LBracket '['>} {(DQ ($ Id.VSub_DollarName '$SYSIMAGE_TYPE'))} 
                              {<Id.Lit_Equals '='> <Id.Lit_Equals '='>} {(DQ <ext3>)} {<Id.Lit_RBracket ']'>}
                            )
                          ]
                        )
                      ]
                    )
                  action: [
                    (command.AndOr
                      ops: [Id.Op_DAmp]
                      children: [
                        (C {<Id.Lit_LBracket '['>} {<-z>} 
                          {(DQ ($ Id.VSub_DollarName '$SYSIMAGE_HDA_MEGS'))} {<Id.Lit_RBracket ']'>}
                        )
                        (command.ShAssignment
                          pairs: [
                            (assign_pair
                              lhs: (sh_lhs_expr.Name name:SYSIMAGE_HDA_MEGS)
                              op: assign_op.Equal
                              rhs: {<64>}
                              spids: [2668]
                            )
                          ]
                        )
                      ]
                    )
                    (command.ShAssignment
                      pairs: [
                        (assign_pair
                          lhs: (sh_lhs_expr.Name name:BLOCKS)
                          op: assign_op.Equal
                          rhs: 
                            {
                              (word_part.ExprSub
                                left: <Id.Left_DollarBracket '$['>
                                child: 
                                  (expr.Binary
                                    op: <Id.Arith_Star _>
                                    left: (Const Id.Expr_DecInt 1024)
                                    right: 
                                      (expr.Binary
                                        op: <Id.Arith_Slash _>
                                        left: 
                                          (expr.Binary
                                            op: <Id.Arith_Star _>
                                            left: 
                                              (command_sub
                                                left_token: <Id.Left_DollarParen '$('>
                                                child: 
                                                  (command.Pipeline
                                                    children: [
                                                      (C {<du>} {<-m>} {<-s>} 
                                                        {(DQ ($ Id.VSub_Number '$1'))}
                                                      )
                                                      (C {<awk>} {(SQ <'{print $1}'>)})
                                                    ]
                                                    negated: F
                                                  )
                                              )
                                            right: (Const Id.Expr_DecInt 12)
                                          )
                                        right: (Const Id.Expr_DecInt 10)
                                      )
                                  )
                              )
                            }
                          spids: [2682]
                        )
                      ]
                    )
                    (command.AndOr
                      ops: [Id.Op_DAmp]
                      children: [
                        (C {<Id.Lit_LBracket '['>} {($ Id.VSub_DollarName '$BLOCKS')} {<-lt>} {<4096>} 
                          {<Id.Lit_RBracket ']'>}
                        )
                        (command.ShAssignment
                          pairs: [
                            (assign_pair
                              lhs: (sh_lhs_expr.Name name:BLOCKS)
                              op: assign_op.Equal
                              rhs: {<4096>}
                              spids: [2728]
                            )
                          ]
                        )
                      ]
                    )
                    (command.ShAssignment
                      pairs: [
                        (assign_pair
                          lhs: (sh_lhs_expr.Name name:FILE)
                          op: assign_op.Equal
                          rhs: 
                            {(DQ ($ Id.VSub_Number '$2') <.> ($ Id.VSub_DollarName '$SYSIMAGE_TYPE'))}
                          spids: [2732]
                        )
                      ]
                    )
                    (command.AndOr
                      ops: [Id.Op_DAmp Id.Op_DAmp Id.Op_DAmp Id.Op_DPipe]
                      children: [
                        (command.Simple
                          words: [{<echo>} {(DQ <'/dev d 755 0 0 - - - - -'>)}]
                          redirects: [
                            (redir
                              op: <Id.Redir_Great '>'>
                              loc: (redir_loc.Fd fd:1)
                              arg: {(DQ ($ Id.VSub_DollarName '$WORK') <'/devs'>)}
                            )
                          ]
                          do_fork: T
                        )
                        (command.Simple
                          words: [{<echo>} {(DQ <'/dev/console c 640 0 0 5 1 0 0 -'>)}]
                          redirects: [
                            (redir
                              op: <Id.Redir_DGreat '>>'>
                              loc: (redir_loc.Fd fd:1)
                              arg: {(DQ ($ Id.VSub_DollarName '$WORK') <'/devs'>)}
                            )
                          ]
                          do_fork: T
                        )
                        (C {<genext2fs>} {<-z>} {<-D>} {(DQ ($ Id.VSub_DollarName '$WORK') <'/devs'>)} 
                          {<-d>} {(DQ ($ Id.VSub_Number '$1'))} {<-b>} {($ Id.VSub_DollarName '$BLOCKS')} {<-i>} {<1024>} 
                          {(DQ ($ Id.VSub_DollarName '$FILE'))}
                        )
                        (C {<rm>} {(DQ ($ Id.VSub_DollarName '$WORK') <'/devs'>)})
                        (C {<dienow>})
                      ]
                    )
                    (command.If
                      arms: [
                        (if_arm
                          cond: 
                            (condition.Shell
                              commands: [
                                (command.AndOr
                                  ops: [Id.Op_DAmp]
                                  children: [
                                    (C {<Id.Lit_LBracket '['>} {<Id.KW_Bang '!'>} {<-z>} 
                                      {(DQ ($ Id.VSub_DollarName '$SYSIMAGE_HDA_MEGS'))} {<Id.Lit_RBracket ']'>}
                                    )
                                    (C {<Id.Lit_LBracket '['>} 
                                      {
                                        (word_part.ArithSub
                                          anode: 
                                            (arith_expr.Binary
                                              op_id: Id.Arith_Slash
                                              left: 
                                                {
                                                  (command_sub
                                                    left_token: <Id.Left_Backtick '`'>
                                                    child: 
                                                      (C {<stat>} {<-c>} {<Id.Lit_Other '%'> <s>} 
                                                        {(DQ ($ Id.VSub_DollarName '$FILE'))}
                                                      )
                                                  )
                                                }
                                              right: 
                                                (arith_expr.Binary
                                                  op_id: Id.Arith_Star
                                                  left: {<Id.Lit_Digits 1024>}
                                                  right: {<Id.Lit_Digits 1024>}
                                                )
                                            )
                                        )
                                      } {<-lt>} {(DQ ($ Id.VSub_DollarName '$SYSIMAGE_HDA_MEGS'))} {<Id.Lit_RBracket ']'>}
                                    )
                                  ]
                                )
                              ]
                            )
                          action: [
                            (C {<echo>} {<resizing>} {<image>} {<to>} 
                              {($ Id.VSub_DollarName '$SYSIMAGE_HDA_MEGS')}
                            )
                            (command.AndOr
                              ops: [Id.Op_DPipe]
                              children: [
                                (C {<resize2fs>} {(DQ ($ Id.VSub_DollarName '$FILE'))} 
                                  {(${ Id.VSub_Name SYSIMAGE_HDA_MEGS) <M>}
                                )
                                (C {<dienow>})
                              ]
                            )
                          ]
                          spids: [2831 2886]
                        )
                      ]
                    )
                    (command.AndOr
                      ops: [Id.Op_DPipe]
                      children: [
                        (C {<tune2fs>} {<-c>} {<0>} {<-i>} {<0>} 
                          {
                            (command_sub
                              left_token: <Id.Left_DollarParen '$('>
                              child: 
                                (command.AndOr
                                  ops: [Id.Op_DAmp]
                                  children: [
                                    (C {<Id.Lit_LBracket '['>} 
                                      {(DQ ($ Id.VSub_DollarName '$SYS_IMAGE_TYPE'))} {<Id.Lit_Equals '='>} {(DQ <ext3>)} {<Id.Lit_RBracket ']'>}
                                    )
                                    (C {<echo>} {<-j>})
                                  ]
                                )
                            )
                          } {(DQ ($ Id.VSub_DollarName '$FILE'))}
                        )
                        (C {<dienow>})
                      ]
                    )
                    (C {<echo>} {($ Id.VSub_DollarName '$SYSIMAGE_TYPE')} {<generated>})
                  ]
                  spids: [2609 2644]
                )
                (if_arm
                  cond: 
                    (condition.Shell
                      commands: [
                        (C {<Id.Lit_LBracket '['>} {(DQ ($ Id.VSub_DollarName '$SYSIMAGE_TYPE'))} 
                          {<Id.Lit_Equals '='> <Id.Lit_Equals '='>} {(DQ <squashfs>)} {<Id.Lit_RBracket ']'>}
                        )
                      ]
                    )
                  action: [
                    (command.AndOr
                      ops: [Id.Op_DPipe]
                      children: [
                        (C {<mksquashfs>} {(DQ ($ Id.VSub_Number '$1'))} 
                          {(DQ ($ Id.VSub_Number '$2') <.sqf>)} {<-noappend>} {<-all-root>} 
                          {
                            (braced_var_sub
                              token: <Id.VSub_Name FORK>
                              suffix_op: 
                                (suffix_op.Unary
                                  tok: <Id.VTest_ColonPlus ':+'>
                                  arg_word: {<-no-progress>}
                                )
                            )
                          }
                        )
                        (C {<dienow>})
                      ]
                    )
                  ]
                  spids: [2969 2987]
                )
              ]
              else_action: [
                (command.Simple
                  words: [
                    {<echo>}
                    {(DQ <'Unknown image type '> ($ Id.VSub_DollarName '$SYSIMAGE_TYPE'))}
                  ]
                  redirects: [(redir op:<Id.Redir_GreatAnd '>&'> loc:(redir_loc.Fd fd:1) arg:{<2>})]
                  do_fork: T
                )
                (C {<dienow>})
              ]
            )
          ]
        )
    )
  ]
)