(CommandList
  children: [
    (AndOr
      children: [
        (C {(Lit_Other '[')} {(KW_Bang '!')} {(-z)} {(DQ ($ VSub_Number '$2'))} {(Lit_Other ']')})
        (AndOr
          children: [
            (Assignment
              keyword: Assign_None
              pairs: [
                (assign_pair
                  lhs: (LhsName name:REBUILD)
                  op: Equal
                  rhs: {(DQ ($ VSub_Number '$2'))}
                  spids: [77]
                )
              ]
              spids: [77]
            )
            (AndOr
              children: [
                (C {(Lit_Other '[')} {(KW_Bang '!')} {(-e)} {(DQ ($ VSub_Number '$2')) (.sh)} 
                  {(Lit_Other ']')}
                )
                (AndOr
                  children: [(C {(echo)} {(DQ ('no stage ') ($ VSub_Number '$2'))}) (C {(exit)} {(1)})]
                  op_id: Op_DAmp
                )
              ]
              op_id: Op_DAmp
            )
          ]
          op_id: Op_DAmp
        )
      ]
      op_id: Op_DAmp
    )
    (If
      arms: [
        (if_arm
          cond: [
            (AndOr
              children: [
                (C {(Lit_Other '[')} {($ VSub_Pound '$#')} {(-lt)} {(1)} {(Lit_Other ']')})
                (AndOr
                  children: [
                    (C {(Lit_Other '[')} {($ VSub_Pound '$#')} {(-gt)} {(2)} {(Lit_Other ']')})
                    (C {(Lit_Other '[')} {(KW_Bang '!')} {(-e)} 
                      {(sources/targets/) (DQ ($ VSub_Number '$1'))} {(Lit_Other ']')}
                    )
                  ]
                  op_id: Op_DPipe
                )
              ]
              op_id: Op_DPipe
            )
          ]
          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: False
            )
            (C {(echo)})
            (C {(exit)} {(1)})
          ]
          spids: [-1 153]
        )
      ]
      spids: [-1 224]
    )
    (Assignment
      keyword: Assign_None
      pairs: [
        (assign_pair
          lhs: (LhsName name:ARCH)
          op: Equal
          rhs: {(DQ ($ VSub_Number '$1'))}
          spids: [226]
        )
      ]
      spids: [226]
    )
    (AndOr
      children: [(C {(Lit_Other '[')} {(-e)} {(config)} {(Lit_Other ']')}) (C {(source)} {(config)})]
      op_id: Op_DAmp
    )
    (AndOr
      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]
        )
      ]
      op_id: Op_DAmp
    )
    (FuncDef
      name: not_already
      body: 
        (BraceGroup
          children: [
            (AndOr
              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)})
              ]
              op_id: Op_DAmp
            )
            (AndOr
              children: [
                (C {(Lit_Other '[')} {(DQ ($ VSub_Name '$REBUILD'))} {(Lit_Other '=') (Lit_Other '=')} 
                  {(DQ ($ VSub_Number '$1'))} {(Lit_Other ']')}
                )
                (C {(zap)} {(DQ ($ VSub_Number '$1'))})
              ]
              op_id: Op_DAmp
            )
            (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: [-1 362]
                )
              ]
              spids: [-1 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: False
              body: 
                (DoGroup
                  children: [
                    (C {(rm)} {(-f)} 
                      {
                        (DQ ($ VSub_Name '$BUILD') (/) ($ VSub_Name '$i') (-) ($ VSub_Name '$ARCH') 
                          (.tar.gz)
                        )
                      }
                    )
                  ]
                  spids: [410 427]
                )
              spids: [404 -1]
            )
          ]
          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: [-1 470]
                )
              ]
              else_action: [
                (AndOr
                  children: [
                    (TimeBlock
                      pipeline: (C {(./) (DQ ($ VSub_Name '$STAGE')) (.sh)} {(DQ ($ VSub_At '$@'))})
                    )
                    (C {(exit)} {(1)})
                  ]
                  op_id: Op_DPipe
                )
              ]
              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: [-1 549]
        )
      ]
      spids: [-1 556]
    )
    (If
      arms: [
        (if_arm
          cond: [
            (AndOr
              children: [
                (C {(Lit_Other '[')} {(-z)} {(DQ ($ VSub_Name '$MY_CROSS_PATH'))} {(Lit_Other ']')})
                (C {(not_already)} {(simple-cross-compiler)})
              ]
              op_id: Op_DAmp
            )
          ]
          action: [
            (C {(zap)} {(root-filesystem)} {(cross-compiler)} {(native-compiler)})
            (C {(do_stage)} {(simple-cross-compiler)} {(DQ ($ VSub_Name '$ARCH'))})
          ]
          spids: [-1 581]
        )
      ]
      spids: [-1 607]
    )
    (If
      arms: [
        (if_arm
          cond: [
            (AndOr
              children: [
                (C {(Lit_Other '[')} {(-z)} {(DQ ($ VSub_Name '$MY_CROSS_PATH'))} {(Lit_Other ']')})
                (AndOr
                  children: [
                    (C {(Lit_Other '[')} {(KW_Bang '!')} {(-z)} 
                      {(DQ ($ VSub_Name '$CROSS_COMPILER_HOST'))} {(Lit_Other ']')}
                    )
                    (C {(not_already)} {(cross-compiler)})
                  ]
                  op_id: Op_DAmp
                )
              ]
              op_id: Op_DAmp
            )
          ]
          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: [-1 681]
                )
              ]
              spids: [-1 693]
            )
            (C {(do_stage)} {(cross-compiler)} {(DQ ($ VSub_Name '$ARCH'))})
          ]
          spids: [-1 653]
        )
      ]
      spids: [-1 705]
    )
    (If
      arms: [
        (if_arm
          cond: [
            (Pipeline
              children: [
                (C {(grep)} {(-q)} {(Lit_VarLike 'KARCH=')} 
                  {(sources/targets/) (DQ ($ VSub_Name '$ARCH'))}
                )
              ]
              negated: True
            )
          ]
          action: [
            (C {(echo)} {(no)} {(KARCH)} {(KW_In in)} {($ VSub_Number '$1') (Lit_Comma ',')} {(stopping)} 
              {(here)}
            )
          ]
          spids: [-1 723]
        )
      ]
      spids: [-1 741]
    )
    (If
      arms: [
        (if_arm
          cond: [(C {(not_already)} {(root-filesystem)})]
          action: [(C {(do_stage)} {(root-filesystem)} {(DQ ($ VSub_Name '$ARCH'))})]
          spids: [-1 754]
        )
      ]
      spids: [-1 765]
    )
    (If
      arms: [
        (if_arm
          cond: [
            (AndOr
              children: [
                (C {(Lit_Other '[')} {(-z)} {(DQ ($ VSub_Name '$MY_CROSS_PATH'))} {(Lit_Other ']')})
                (AndOr
                  children: [
                    (Pipeline
                      children: [
                        (C {(grep)} {(-q)} {(ELF2FLT)} {(sources/targets/) (DQ ($ VSub_Name '$ARCH'))})
                      ]
                      negated: True
                    )
                    (C {(not_already)} {(native-compiler)})
                  ]
                  op_id: Op_DAmp
                )
              ]
              op_id: Op_DAmp
            )
          ]
          action: [(C {(do_stage)} {(native-compiler)} {(DQ ($ VSub_Name '$ARCH'))})]
          spids: [-1 813]
        )
      ]
      spids: [-1 824]
    )
    (C {(do_stage)} {(system-image)} {(DQ ($ VSub_Name '$ARCH'))})
  ]
)