(command.CommandList
  children: [
    (command.If
      arms: [
        (if_arm
          cond: 
            (condition.Shell
              commands: [
                (C {<Id.Lit_LBracket '['>} {<-z>} 
                  {(DQ ($ Id.VSub_DollarName '$NO_SANITIZE_ENVIRONMENT'))} {<Id.Lit_RBracket ']'>}
                )
              ]
            )
          action: [
            (command.ShAssignment
              pairs: [
                (assign_pair
                  lhs: (sh_lhs_expr.Name name:TEMP)
                  op: assign_op.Equal
                  rhs: 
                    {
                      (command_sub
                        left_token: <Id.Left_DollarParen '$('>
                        child: 
                          (command.Pipeline
                            children: [
                              (C {<echo>} 
                                {
                                  (command_sub
                                    left_token: <Id.Left_DollarParen '$('>
                                    child: 
                                      (C {<sed>} {<-n>} {(SQ <'s/.*export[ \\t]*\\([^=]*\\)=.*/\\1/p'>)} 
                                        {<config>}
                                      )
                                  )
                                }
                              )
                              (C {<sed>} {(SQ <'s/ /,/g'>)})
                            ]
                            negated: F
                          )
                      )
                    }
                  spids: [40]
                )
              ]
            )
            (command.ShAssignment
              pairs: [
                (assign_pair
                  lhs: (sh_lhs_expr.Name name:TEMP)
                  op: assign_op.Equal
                  rhs: 
                    {
                      (DQ ($ Id.VSub_DollarName '$TEMP') 
                        <',LANG,PATH,SHELL,TERM,USER,USERNAME,LOGNAME,PWD,EDITOR,HOME'>
                      )
                    }
                  spids: [72]
                )
              ]
            )
            (command.ShAssignment
              pairs: [
                (assign_pair
                  lhs: (sh_lhs_expr.Name name:TEMP)
                  op: assign_op.Equal
                  rhs: 
                    {
                      (DQ ($ Id.VSub_DollarName '$TEMP') 
                        <',DISPLAY,_,TOPSHELL,START_TIME,STAGE_NAME,TOOLCHAIN_PREFIX'>
                      )
                    }
                  spids: [79]
                )
              ]
            )
            (command.ShAssignment
              pairs: [
                (assign_pair
                  lhs: (sh_lhs_expr.Name name:TEMP)
                  op: assign_op.Equal
                  rhs: 
                    {
                      (DQ ($ Id.VSub_DollarName '$TEMP') 
                        <',HOST_ARCH,WRAPPY_LOGPATH,OLDPATH,http_proxy,ftp_proxy'>
                      )
                    }
                  spids: [86]
                )
              ]
            )
            (command.ShAssignment
              pairs: [
                (assign_pair
                  lhs: (sh_lhs_expr.Name name:TEMP)
                  op: assign_op.Equal
                  rhs: 
                    {
                      (DQ ($ Id.VSub_DollarName '$TEMP') 
                        <',https_proxy,no_proxy,TEMP,TMPDIR,FORK,MUSL'>
                      )
                    }
                  spids: [93]
                )
              ]
            )
            (command.ForEach
              iter_name: i
              iter_words: [
                {
                  (command_sub
                    left_token: <Id.Left_DollarParen '$('>
                    child: 
                      (command.Pipeline
                        children: [(C {<env>}) (C {<sed>} {<-n>} {(SQ <'s/=.*//p'>)})]
                        negated: F
                      )
                  )
                }
              ]
              do_arg_iter: F
              body: 
                (command.DoGroup
                  children: [
                    (command.AndOr
                      ops: [Id.Op_DAmp]
                      children: [
                        (C {<is_in_list>} {($ Id.VSub_DollarName '$i')} 
                          {(DQ ($ Id.VSub_DollarName '$TEMP'))}
                        )
                        (command.ControlFlow
                          token: <Id.ControlFlow_Continue continue>
                        )
                      ]
                    )
                    (command.AndOr
                      ops: [Id.Op_DAmp]
                      children: [
                        (C {<Id.Lit_LBracket '['>} 
                          {
                            (DQ 
                              (braced_var_sub
                                token: <Id.VSub_Name i>
                                suffix_op: 
                                  (suffix_op.Slice
                                    begin: {<Id.Lit_Digits 0>}
                                    length: {<Id.Lit_Digits 7>}
                                  )
                              )
                            )
                          } {<Id.Lit_Equals '='> <Id.Lit_Equals '='>} {(DQ <DISTCC_>)} {<Id.Lit_RBracket ']'>}
                        )
                        (command.ControlFlow
                          token: <Id.ControlFlow_Continue continue>
                        )
                      ]
                    )
                    (command.AndOr
                      ops: [Id.Op_DAmp]
                      children: [
                        (C {<Id.Lit_LBracket '['>} 
                          {
                            (DQ 
                              (braced_var_sub
                                token: <Id.VSub_Name i>
                                suffix_op: 
                                  (suffix_op.Slice
                                    begin: {<Id.Lit_Digits 0>}
                                    length: {<Id.Lit_Digits 7>}
                                  )
                              )
                            )
                          } {<Id.Lit_Equals '='> <Id.Lit_Equals '='>} {(DQ <CCACHE_>)} {<Id.Lit_RBracket ']'>}
                        )
                        (command.ControlFlow
                          token: <Id.ControlFlow_Continue continue>
                        )
                      ]
                    )
                    (command.Simple
                      words: [{<unset>} {($ Id.VSub_DollarName '$i')}]
                      redirects: [
                        (redir
                          op: <Id.Redir_Great '2>'>
                          loc: (redir_loc.Fd fd:2)
                          arg: {<'/dev/null'>}
                        )
                      ]
                      do_fork: T
                    )
                  ]
                )
            )
          ]
          spids: [20 32]
        )
      ]
    )
    (command.ShFunction
      name: export_if_blank
      body: 
        (BraceGroup
          children: [
            (command.AndOr
              ops: [Id.Op_DAmp]
              children: [
                (C {<Id.Lit_LBracket '['>} {<-z>} 
                  {
                    (DQ 
                      (command_sub
                        left_token: <Id.Left_DollarParen '$('>
                        child: 
                          (C {<eval>} 
                            {
                              (DQ <'echo '> (word_part.EscapedLiteral token:<Id.Lit_EscapedChar '\\"'>) 
                                (word_part.EscapedLiteral
                                  token: <Id.Lit_EscapedChar '\\$'>
                                ) <'{'> 
                                (braced_var_sub
                                  token: <Id.VSub_Number 1>
                                  suffix_op: 
                                    (suffix_op.PatSub
                                      pat: {<'='> <Id.Lit_Other '*'>}
                                      replace: {}
                                      replace_mode: Id.Undefined_Tok
                                    )
                                ) <'}'> (word_part.EscapedLiteral token:<Id.Lit_EscapedChar '\\"'>)
                              )
                            }
                          )
                      )
                    )
                  } {<Id.Lit_RBracket ']'>}
                )
                (C {<export>} {(DQ ($ Id.VSub_Number '$1'))})
              ]
            )
          ]
        )
    )
    (C {<export_if_blank>} 
      {<Id.Lit_VarLike 'MIRROR_LIST='> 
        (DQ <'http://landley.net/code/aboriginal/mirror http://127.0.0.1/code/aboriginal/mirror'>)
      }
    )
    (C {<export_if_blank>} 
      {<Id.Lit_VarLike 'TOP='> (command_sub left_token:<Id.Left_Backtick '`'> child:(C {<pwd>}))}
    )
    (C {<export_if_blank>} {<Id.Lit_VarLike 'SOURCES='> (DQ ($ Id.VSub_DollarName '$TOP') <'/sources'>)})
    (C {<export_if_blank>} {<Id.Lit_VarLike 'SRCDIR='> (DQ ($ Id.VSub_DollarName '$TOP') <'/packages'>)})
    (C {<export_if_blank>} 
      {<Id.Lit_VarLike 'PATCHDIR='> (DQ ($ Id.VSub_DollarName '$SOURCES') <'/patches'>)}
    )
    (C {<export_if_blank>} {<Id.Lit_VarLike 'BUILD='> (DQ ($ Id.VSub_DollarName '$TOP') <'/build'>)})
    (C {<export_if_blank>} 
      {<Id.Lit_VarLike 'SRCTREE='> (DQ ($ Id.VSub_DollarName '$BUILD') <'/packages'>)}
    )
    (C {<export_if_blank>} 
      {<Id.Lit_VarLike 'HOSTTOOLS='> (DQ ($ Id.VSub_DollarName '$BUILD') <'/host'>)}
    )
    (C {<export_if_blank>} 
      {<Id.Lit_VarLike 'WRAPDIR='> (DQ ($ Id.VSub_DollarName '$BUILD') <'/record-commands'>)}
    )
    (command.AndOr
      ops: [Id.Op_DAmp]
      children: [
        (C {<Id.Lit_LBracket '['>} {<Id.KW_Bang '!'>} {<-z>} {(DQ ($ Id.VSub_DollarName '$MY_PATCH_DIR'))} 
          {<Id.Lit_RBracket ']'>}
        )
        (C {<export>} 
          {<Id.Lit_VarLike 'MY_PATCH_DIR='> 
            (DQ 
              (command_sub
                left_token: <Id.Left_DollarParen '$('>
                child: (C {<readlink>} {<-e>} {(DQ ($ Id.VSub_DollarName '$MY_PATCH_DIR'))})
              )
            )
          }
        )
      ]
    )
    (C {<export>} {<Id.Lit_VarLike 'WORK='> (DQ (${ Id.VSub_Name BUILD) <'/host-temp'>)})
    (C {<export>} {<Id.Lit_VarLike 'ARCH_NAME='> <host>})
    (C {<export_if_blank>} {<Id.Lit_VarLike 'CC='> <cc>})
    (command.ShAssignment
      pairs: [
        (assign_pair
          lhs: (sh_lhs_expr.Name name:MEMTOTAL)
          op: assign_op.Equal
          rhs: 
            {
              (DQ 
                (command_sub
                  left_token: <Id.Left_DollarParen '$('>
                  child: (C {<awk>} {(SQ <'/MemTotal:/{print $2}'>)} {<'/proc/meminfo'>})
                )
              )
            }
          spids: [405]
        )
      ]
    )
    (command.If
      arms: [
        (if_arm
          cond: 
            (condition.Shell
              commands: [
                (C {<Id.Lit_LBracket '['>} {<-z>} {(DQ ($ Id.VSub_DollarName '$CPUS'))} 
                  {<Id.Lit_RBracket ']'>}
                )
              ]
            )
          action: [
            (C {<export>} 
              {<Id.Lit_VarLike 'CPUS='> 
                (command_sub
                  left_token: <Id.Left_DollarParen '$('>
                  child: 
                    (command.Pipeline
                      children: [
                        (C {<echo>} 
                          {<'/sys/devices/system/cpu/cpu'> <Id.Lit_LBracket '['> <0-9> 
                            <Id.Lit_RBracket ']'> <Id.Lit_Star '*'>
                          }
                        )
                        (C {<wc>} {<-w>})
                      ]
                      negated: F
                    )
                )
              }
            )
            (command.AndOr
              ops: [Id.Op_DAmp]
              children: [
                (C {<Id.Lit_LBracket '['>} {(DQ ($ Id.VSub_DollarName '$CPUS'))} {<-lt>} {<1>} 
                  {<Id.Lit_RBracket ']'>}
                )
                (command.ShAssignment
                  pairs: [
                    (assign_pair
                      lhs: (sh_lhs_expr.Name name:CPUS)
                      op: assign_op.Equal
                      rhs: {<1>}
                      spids: [467]
                    )
                  ]
                )
              ]
            )
            (command.AndOr
              ops: [Id.Op_DAmp Id.Op_DAmp]
              children: [
                (C {<Id.Lit_LBracket '['>} {<-z>} 
                  {
                    (DQ 
                      (command_sub
                        left_token: <Id.Left_DollarParen '$('>
                        child: 
                          (command.Pipeline
                            children: [
                              (C {<cat>} {<'/proc/cpuinfo'>})
                              (C {<grep>} {(SQ <'^flags'>)})
                              (C {<head>} {<-n>} {<1>})
                              (C {<grep>} {<-w>} {<ht>})
                            ]
                            negated: F
                          )
                      )
                    )
                  } {<Id.Lit_RBracket ']'>}
                )
                (C {<Id.Lit_LBracket '['>} 
                  {
                    (word_part.ArithSub
                      anode: 
                        (arith_expr.Binary
                          op_id: Id.Arith_Star
                          left: 
                            (arith_expr.Binary
                              op_id: Id.Arith_Star
                              left: {($ Id.VSub_DollarName '$CPUS')}
                              right: {<Id.Lit_Digits 512>}
                            )
                          right: {<Id.Lit_Digits 1024>}
                        )
                    )
                  } {<-le>} {($ Id.VSub_DollarName '$MEMTOTAL')} {<Id.Lit_RBracket ']'>}
                )
                (command.ShAssignment
                  pairs: [
                    (assign_pair
                      lhs: (sh_lhs_expr.Name name:CPUS)
                      op: assign_op.Equal
                      rhs: 
                        {
                          (word_part.ArithSub
                            anode: 
                              (arith_expr.Binary
                                op_id: Id.Arith_Slash
                                left: 
                                  (arith_expr.Binary
                                    op_id: Id.Arith_Star
                                    left: {($ Id.VSub_DollarName '$CPUS')}
                                    right: {<Id.Lit_Digits 3>}
                                  )
                                right: {<Id.Lit_Digits 2>}
                              )
                          )
                        }
                      spids: [542]
                    )
                  ]
                )
              ]
            )
          ]
          spids: [418 430]
        )
      ]
    )
    (C {<export_if_blank>} 
      {<Id.Lit_VarLike 'STAGE_NAME='> 
        (command_sub
          left_token: <Id.Left_Backtick '`'>
          child: 
            (command.Pipeline
              children: [
                (C {<echo>} {($ Id.VSub_Number '$0')})
                (C {<sed>} {(SQ <'s@.*/\\(.*\\)\\.sh@\\1@'>)})
              ]
              negated: F
            )
        )
      }
    )
    (command.AndOr
      ops: [Id.Op_DAmp]
      children: [
        (C {<Id.Lit_LBracket '['>} {<Id.KW_Bang '!'>} {<-z>} 
          {(DQ ($ Id.VSub_DollarName '$BUILD_VERBOSE'))} {<Id.Lit_RBracket ']'>}
        )
        (command.ShAssignment
          pairs: [
            (assign_pair
              lhs: (sh_lhs_expr.Name name:VERBOSITY)
              op: assign_op.Equal
              rhs: {(DQ <'V=1'>)}
              spids: [598]
            )
          ]
        )
      ]
    )
    (C {<export_if_blank>} 
      {<Id.Lit_VarLike 'BUILD_STATIC='> <busybox> <Id.Lit_Comma ','> <toybox> <Id.Lit_Comma ','> 
        <binutils> <Id.Lit_Comma ','> <gcc-core> <Id.Lit_Comma ','> <gcc-g> <Id.Lit_Other '+'> <Id.Lit_Other '+'> 
        <Id.Lit_Comma ','> <make>
      }
    )
    (C {<export>} {<PATH>})
    (command.If
      arms: [
        (if_arm
          cond: 
            (condition.Shell
              commands: [
                (C {<Id.Lit_LBracket '['>} {<-z>} {(DQ ($ Id.VSub_DollarName '$OLDPATH'))} 
                  {<Id.Lit_RBracket ']'>}
                )
              ]
            )
          action: [
            (C {<export>} {<Id.Lit_VarLike 'OLDPATH='> (DQ ($ Id.VSub_DollarName '$PATH'))})
            (command.AndOr
              ops: [Id.Op_DPipe]
              children: [
                (C {<Id.Lit_LBracket '['>} {<-z>} {(DQ ($ Id.VSub_DollarName '$BUSYBOX'))} 
                  {<Id.Lit_RBracket ']'>}
                )
                (command.ShAssignment
                  pairs: [
                    (assign_pair
                      lhs: (sh_lhs_expr.Name name:BUSYBOX)
                      op: assign_op.Equal
                      rhs: {<busybox>}
                      spids: [665]
                    )
                  ]
                )
              ]
            )
            (command.AndOr
              ops: [Id.Op_DAmp Id.Op_DPipe]
              children: [
                (C {<Id.Lit_LBracket '['>} {<-f>} 
                  {
                    (DQ ($ Id.VSub_DollarName '$HOSTTOOLS') <'/'> 
                      (braced_var_sub
                        token: <Id.VSub_Name BUSYBOX>
                        suffix_op: 
                          (suffix_op.Unary
                            tok: <Id.VTest_ColonHyphen ':-'>
                            arg_word: {<toybox>}
                          )
                      )
                    )
                  } {<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 {<hosttools_path>})
                            )
                          )
                        }
                      spids: [688]
                    )
                  ]
                )
                (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 {<hosttools_path>})
                            ) <':'> ($ Id.VSub_DollarName '$PATH')
                          )
                        }
                      spids: [698]
                    )
                  ]
                )
              ]
            )
            (command.If
              arms: [
                (if_arm
                  cond: 
                    (condition.Shell
                      commands: [
                        (C {<Id.Lit_LBracket '['>} {<-f>} 
                          {(DQ ($ Id.VSub_DollarName '$WRAPDIR') <'/wrappy'>)} {<Id.Lit_RBracket ']'>}
                        )
                      ]
                    )
                  action: [
                    (command.ShAssignment
                      pairs: [
                        (assign_pair
                          lhs: (sh_lhs_expr.Name name:OLDPATH)
                          op: assign_op.Equal
                          rhs: {(DQ ($ Id.VSub_DollarName '$PATH'))}
                          spids: [726]
                        )
                      ]
                    )
                    (C {<mkdir>} {<-p>} {(DQ ($ Id.VSub_DollarName '$BUILD') <'/logs'>)})
                    (command.AndOr
                      ops: [Id.Op_DAmp Id.Op_DAmp]
                      children: [
                        (C {<Id.Lit_LBracket '['>} {($ Id.VSub_QMark '$?')} {<-ne>} {<0>} 
                          {<Id.Lit_RBracket ']'>}
                        )
                        (command.Simple
                          words: [{<echo>} {(DQ <'Bad '> ($ Id.VSub_DollarName '$WRAPDIR'))}]
                          redirects: [
                            (redir
                              op: <Id.Redir_GreatAnd '>&'>
                              loc: (redir_loc.Fd fd:1)
                              arg: {<2>}
                            )
                          ]
                          do_fork: T
                        )
                        (C {<dienow>})
                      ]
                    )
                    (command.ShAssignment
                      pairs: [
                        (assign_pair
                          lhs: (sh_lhs_expr.Name name:PATH)
                          op: assign_op.Equal
                          rhs: {(DQ ($ Id.VSub_DollarName '$WRAPDIR'))}
                          spids: [769]
                        )
                      ]
                    )
                  ]
                  spids: [709 723]
                )
              ]
            )
          ]
          spids: [630 642]
        )
      ]
    )
    (C {<export>} 
      {<Id.Lit_VarLike 'WRAPPY_LOGPATH='> 
        (DQ ($ Id.VSub_DollarName '$BUILD') <'/logs/cmdlines.'> ($ Id.VSub_DollarName '$ARCH_NAME') 
          <.early>
        )
      }
    )
  ]
)