(CommandList
  children: [
    (AndOr
      ops: [Op_DAmp Op_DAmp Op_DAmp Op_DAmp]
      children: [
        (C {(Lit_Other '[')} {(KW_Bang '!')} {(-z)} {(DQ ($ VSub_Number '$2'))} {(Lit_Other ']')})
        (Assignment
          keyword: Assign_None
          pairs: [
            (assign_pair
              lhs: (LhsName name:REBUILD)
              op: Equal
              rhs: {(DQ ($ VSub_Number '$2'))}
              spids: [77]
            )
          ]
          spids: [77]
        )
        (C {(Lit_Other '[')} {(KW_Bang '!')} {(-e)} {(DQ ($ VSub_Number '$2')) (.sh)} {(Lit_Other ']')})
        (C {(echo)} {(DQ ('no stage ') ($ VSub_Number '$2'))})
        (ControlFlow token:<ControlFlow_Exit exit> arg_word:{(1)})
      ]
    )
    (If
      arms: [
        (if_arm
          cond: [
            (AndOr
              ops: [Op_DPipe Op_DPipe]
              children: [
                (C {(Lit_Other '[')} {($ VSub_Pound '$#')} {(-lt)} {(1)} {(Lit_Other ']')})
                (C {(Lit_Other '[')} {($ VSub_Pound '$#')} {(-gt)} {(2)} {(Lit_Other ']')})
                (C {(Lit_Other '[')} {(KW_Bang '!')} {(-e)} {(sources/targets/) (DQ ($ VSub_Number '$1'))} 
                  {(Lit_Other ']')}
                )
              ]
            )
          ]
          action: [
            (C {(echo)})
            (C {(echo)} {(DQ ('Usage: ') ($ VSub_Number '$0') (' TARGET [REBUILD_FROM_STAGE]'))})
            (C {(echo)})
            (C {(echo)} {(DQ ('Supported architectures:'))})
            (C {(ls)} {(sources/targets)})
            (C {(echo)})
            (C {(echo)} {(DQ ('Build stages:'))})
            (Pipeline
              children: [
                (C {(sed)} {(-n)} {(SQ <'s/#.*//;s@.*[.]/\\([^.]*\\)[.]sh.*@\\1@p'>)} 
                  {(DQ ($ VSub_Number '$0'))}
                )
                (C {(uniq)})
                (C {(xargs)} {(echo)})
              ]
              negated: F
            )
            (C {(echo)})
            (ControlFlow token:<ControlFlow_Exit exit> arg_word:{(1)})
          ]
          spids: [16777215 153]
        )
      ]
      spids: [16777215 224]
    )
    (Assignment
      keyword: Assign_None
      pairs: [
        (assign_pair
          lhs: (LhsName name:ARCH)
          op: Equal
          rhs: {(DQ ($ VSub_Number '$1'))}
          spids: [226]
        )
      ]
      spids: [226]
    )
    (AndOr
      ops: [Op_DAmp]
      children: [(C {(Lit_Other '[')} {(-e)} {(config)} {(Lit_Other ']')}) (C {(source)} {(config)})]
    )
    (AndOr
      ops: [Op_DAmp]
      children: [
        (C {(Lit_Other '[')} {(-z)} {(DQ ($ VSub_Name '$BUILD'))} {(Lit_Other ']')})
        (Assignment
          keyword: Assign_None
          pairs: [(assign_pair lhs:(LhsName name:BUILD) op:Equal rhs:{(DQ (build))} spids:[270])]
          spids: [270]
        )
      ]
    )
    (FuncDef
      name: not_already
      body: 
        (BraceGroup
          children: [
            (AndOr
              ops: [Op_DAmp]
              children: [
                (C {(Lit_Other '[')} {(DQ ($ VSub_Name '$AGAIN'))} {(Lit_Other '=') (Lit_Other '=')} 
                  {(DQ ($ VSub_Number '$1'))} {(Lit_Other ']')}
                )
                (ControlFlow token:<ControlFlow_Return return> arg_word:{(0)})
              ]
            )
            (AndOr
              ops: [Op_DAmp]
              children: [
                (C {(Lit_Other '[')} {(DQ ($ VSub_Name '$REBUILD'))} {(Lit_Other '=') (Lit_Other '=')} 
                  {(DQ ($ VSub_Number '$1'))} {(Lit_Other ']')}
                )
                (C {(zap)} {(DQ ($ VSub_Number '$1'))})
              ]
            )
            (If
              arms: [
                (if_arm
                  cond: [
                    (C {(Lit_Other '[')} {(-f)} 
                      {
                        (DQ ($ VSub_Name '$BUILD') (/) ($ VSub_Number '$1') (-) ($ VSub_Name '$ARCH') 
                          (.tar.gz)
                        )
                      } {(Lit_Other ']')}
                    )
                  ]
                  action: [
                    (C {(echo)} 
                      {
                        (DQ ('=== Skipping ') ($ VSub_Number '$1') (-) ($ VSub_Name '$ARCH') 
                          (' (already there)')
                        )
                      }
                    )
                    (ControlFlow token:<ControlFlow_Return return> arg_word:{(1)})
                  ]
                  spids: [16777215 362]
                )
              ]
              spids: [16777215 381]
            )
            (ControlFlow token:<ControlFlow_Return return> arg_word:{(0)})
          ]
          spids: [294]
        )
      spids: [290 293]
    )
    (FuncDef
      name: zap
      body: 
        (BraceGroup
          children: [
            (ForEach
              iter_name: i
              iter_words: [{(DQ ($ VSub_At '$@'))}]
              do_arg_iter: F
              body: 
                (DoGroup
                  children: [
                    (C {(rm)} {(-f)} 
                      {
                        (DQ ($ VSub_Name '$BUILD') (/) ($ VSub_Name '$i') (-) ($ VSub_Name '$ARCH') 
                          (.tar.gz)
                        )
                      }
                    )
                  ]
                  spids: [410 427]
                )
              spids: [404 16777215]
            )
          ]
          spids: [396]
        )
      spids: [392 395]
    )
    (FuncDef
      name: do_stage
      body: 
        (BraceGroup
          children: [
            (Assignment
              keyword: Assign_None
              pairs: [
                (assign_pair
                  lhs: (LhsName name:STAGE)
                  op: Equal
                  rhs: {(DQ ($ VSub_Number '$1'))}
                  spids: [442]
                )
              ]
              spids: [442]
            )
            (C {(shift)})
            (If
              arms: [
                (if_arm
                  cond: [
                    (C {(Lit_Other '[')} {(DQ ($ VSub_Name '$AFTER'))} {(Lit_Other '=') (Lit_Other '=')} 
                      {(DQ ($ VSub_Name '$STAGE'))} {(Lit_Other ']')}
                    )
                  ]
                  action: [(C {(unset)} {(AFTER)})]
                  spids: [16777215 470]
                )
              ]
              else_action: [
                (AndOr
                  ops: [Op_DPipe]
                  children: [
                    (TimeBlock
                      pipeline: (C {(./) (DQ ($ VSub_Name '$STAGE')) (.sh)} {(DQ ($ VSub_At '$@'))})
                    )
                    (ControlFlow token:<ControlFlow_Exit exit> arg_word:{(1)})
                  ]
                )
              ]
              spids: [478 500]
            )
          ]
          spids: [439]
        )
      spids: [435 438]
    )
    (C {(do_stage)} {(download)})
    (If
      arms: [
        (if_arm
          cond: [(C {(Lit_Other '[')} {(-z)} {(DQ ($ VSub_Name '$NO_HOST_TOOLS'))} {(Lit_Other ']')})]
          action: [(C {(do_stage)} {(host-tools)})]
          spids: [16777215 549]
        )
      ]
      spids: [16777215 556]
    )
    (If
      arms: [
        (if_arm
          cond: [
            (AndOr
              ops: [Op_DAmp]
              children: [
                (C {(Lit_Other '[')} {(-z)} {(DQ ($ VSub_Name '$MY_CROSS_PATH'))} {(Lit_Other ']')})
                (C {(not_already)} {(simple-cross-compiler)})
              ]
            )
          ]
          action: [
            (C {(zap)} {(root-filesystem)} {(cross-compiler)} {(native-compiler)})
            (C {(do_stage)} {(simple-cross-compiler)} {(DQ ($ VSub_Name '$ARCH'))})
          ]
          spids: [16777215 581]
        )
      ]
      spids: [16777215 607]
    )
    (If
      arms: [
        (if_arm
          cond: [
            (AndOr
              ops: [Op_DAmp Op_DAmp]
              children: [
                (C {(Lit_Other '[')} {(-z)} {(DQ ($ VSub_Name '$MY_CROSS_PATH'))} {(Lit_Other ']')})
                (C {(Lit_Other '[')} {(KW_Bang '!')} {(-z)} {(DQ ($ VSub_Name '$CROSS_COMPILER_HOST'))} 
                  {(Lit_Other ']')}
                )
                (C {(not_already)} {(cross-compiler)})
              ]
            )
          ]
          action: [
            (C {(zap)} {(root-filesystem)} {(native-compiler)})
            (If
              arms: [
                (if_arm
                  cond: [
                    (SimpleCommand
                      words: [{(not_already)} {(simple-cross-compiler)}]
                      more_env: [
                        (env_pair
                          name: ARCH
                          val: {(DQ ($ VSub_Name '$CROSS_COMPILER_HOST'))}
                          spids: [671]
                        )
                      ]
                    )
                  ]
                  action: [
                    (C {(do_stage)} {(simple-cross-compiler)} {(DQ ($ VSub_Name '$CROSS_COMPILER_HOST'))})
                  ]
                  spids: [16777215 681]
                )
              ]
              spids: [16777215 693]
            )
            (C {(do_stage)} {(cross-compiler)} {(DQ ($ VSub_Name '$ARCH'))})
          ]
          spids: [16777215 653]
        )
      ]
      spids: [16777215 705]
    )
    (If
      arms: [
        (if_arm
          cond: [
            (Pipeline
              children: [
                (C {(grep)} {(-q)} {(Lit_VarLike 'KARCH=')} 
                  {(sources/targets/) (DQ ($ VSub_Name '$ARCH'))}
                )
              ]
              negated: T
            )
          ]
          action: [
            (C {(echo)} {(no)} {(KARCH)} {(KW_In in)} {($ VSub_Number '$1') (Lit_Comma ',')} {(stopping)} 
              {(here)}
            )
          ]
          spids: [16777215 723]
        )
      ]
      spids: [16777215 741]
    )
    (If
      arms: [
        (if_arm
          cond: [(C {(not_already)} {(root-filesystem)})]
          action: [(C {(do_stage)} {(root-filesystem)} {(DQ ($ VSub_Name '$ARCH'))})]
          spids: [16777215 754]
        )
      ]
      spids: [16777215 765]
    )
    (If
      arms: [
        (if_arm
          cond: [
            (AndOr
              ops: [Op_DAmp Op_DAmp]
              children: [
                (C {(Lit_Other '[')} {(-z)} {(DQ ($ VSub_Name '$MY_CROSS_PATH'))} {(Lit_Other ']')})
                (Pipeline
                  children: [
                    (C {(grep)} {(-q)} {(ELF2FLT)} {(sources/targets/) (DQ ($ VSub_Name '$ARCH'))})
                  ]
                  negated: T
                )
                (C {(not_already)} {(native-compiler)})
              ]
            )
          ]
          action: [(C {(do_stage)} {(native-compiler)} {(DQ ($ VSub_Name '$ARCH'))})]
          spids: [16777215 813]
        )
      ]
      spids: [16777215 824]
    )
    (C {(do_stage)} {(system-image)} {(DQ ($ VSub_Name '$ARCH'))})
  ]
)