(command.CommandList
  children: [
    (command.AndOr
      ops: [Id.Op_DPipe]
      children: [
        (C {<.>} {<'sources/utility_functions.sh'>})
        (command.ControlFlow token:<Id.ControlFlow_Exit exit> arg_word:{<1>})
      ]
    )
    (command.If
      arms: [
        (if_arm
          cond: 
            (condition.Shell
              commands: [
                (C {<Id.Lit_LBracket '['>} {<Id.KW_Bang '!'>} {<-f>} {(DQ ($ Id.VSub_Number '$1'))} 
                  {<Id.Lit_RBracket ']'>}
                )
              ]
            )
          action: [
            (command.Simple
              words: [
                {<echo>}
                {
                  (DQ <'Can\'t find control image at '> 
                    (word_part.EscapedLiteral token:<Id.Lit_EscapedChar '\\"'>) ($ Id.VSub_Number '$1') (word_part.EscapedLiteral token:<Id.Lit_EscapedChar '\\"'>)
                  )
                }
              ]
              redirects: [(redir op:<Id.Redir_GreatAnd '>&'> loc:(redir_loc.Fd fd:1) arg:{<2>})]
              do_fork: T
            )
            (command.ControlFlow token:<Id.ControlFlow_Exit exit> arg_word:{<1>})
          ]
          spids: [33 47]
        )
      ]
    )
    (C {<trap>} {(DQ <'killtree '> ($ Id.VSub_Dollar '$$'))} {<EXIT>})
    (command.AndOr
      ops: [Id.Op_DAmp]
      children: [
        (C {<Id.Lit_LBracket '['>} {<Id.KW_Bang '!'>} {<-z>} {(DQ ($ Id.VSub_DollarName '$FORK'))} 
          {<Id.Lit_RBracket ']'>}
        )
        (command.Simple
          words: [
            {<'more/for-each-target.sh'>}
            {
              (SQ 
                <
'. sources/toys/make-hdb.sh; HDBMEGS=2048; HDB=build/system-image-$TARGET/hdb.img; echo "$HDB"; rm -f "$HDB"; make_hdb'
                >
              )
            }
          ]
          more_env: [(env_pair name:FORK val:(word.Empty) spids:[101])]
          do_fork: T
        )
      ]
    )
    (command.AndOr
      ops: [Id.Op_DPipe]
      children: [(C {<mkdir>} {<-p>} {<'build/logs'>}) (C {<dienow>})]
    )
    (command.AndOr
      ops: [Id.Op_DAmp]
      children: [
        (C {<Id.Lit_LBracket '['>} {<-z>} {(DQ ($ Id.VSub_DollarName '$TIMEOUT'))} 
          {<Id.Lit_RBracket ']'>}
        )
        (C {<export>} {<Id.Lit_VarLike 'TIMEOUT='> <60>})
      ]
    )
    (command.AndOr
      ops: [Id.Op_DAmp]
      children: [
        (C {<Id.Lit_LBracket '['>} {<-z>} {(DQ ($ Id.VSub_DollarName '$LOGFILE'))} 
          {<Id.Lit_RBracket ']'>}
        )
        (command.ShAssignment
          pairs: [
            (assign_pair
              lhs: (sh_lhs_expr.Name name:LOGFILE)
              op: assign_op.Equal
              rhs: 
                {
                  (DQ 
                    (command_sub
                      left_token: <Id.Left_DollarParen '$('>
                      child: 
                        (command.Pipeline
                          children: [
                            (C {<echo>} {($ Id.VSub_Number '$1')})
                            (C {<sed>} {(SQ <'s@.*/\\(.*\\)\\.hdc@\\1@'>)})
                          ]
                          negated: F
                        )
                    )
                  )
                }
              spids: [160]
            )
          ]
        )
      ]
    )
    (C {<'more/for-each-target.sh'>} 
      {
        (SQ 
          <
'ln -sfn .. build/system-image-$TARGET/upload && more/timeout.sh $TIMEOUT "HDB=hdb.img more/native-build-from-build.sh $TARGET '
          >
        ) (DQ ($ Id.VSub_Number '$1') <' | tee build/logs/native-'> ($ Id.VSub_DollarName '$LOGFILE') <->) 
        (SQ <'$TARGET.txt"'>)
      }
    )
  ]
)