(command.CommandList
  children: [
    (command.ShFunction
      name: this_filename
      body: 
        (command.BraceGroup
          children: [
            (command.ShAssignment
              pairs: [(assign_pair lhs:(sh_lhs_expr.Name name:ctr) op:Equal rhs:{(0)})]
            )
            (command.WhileUntil
              keyword: <KW_While while>
              cond: [(command.Sentence child:(C {(true)}) terminator:<Op_Semi ';'>)]
              body: 
                (command.DoGroup
                  children: [
                    (command.If
                      arms: [
                        (if_arm
                          cond: [
                            (command.Sentence
                              child: 
                                (command.DBracket
                                  expr: 
                                    (bool_expr.Unary
                                      op_id: BoolUnary_z
                                      child: 
                                        {
                                          (DQ 
                                            (braced_var_sub
                                              token: <VSub_Name FUNCNAME>
                                              bracket_op: 
                                                (bracket_op.ArrayIndex
                                                  expr: 
                                                    (arith_expr.ArithWord
                                                      w: {($ VSub_DollarName '$ctr')}
                                                    )
                                                )
                                            )
                                          )
                                        }
                                    )
                                )
                              terminator: <Op_Semi ';'>
                            )
                          ]
                          action: [
                            (command.Simple
                              words: [{(echo)} {(DQ ("Error: couldn't find this_filename"))}]
                              redirects: [(redir.Redir op:<Redir_GreatAnd '1>&'> fd:1 arg_word:{(2)})]
                            )
                            (command.ControlFlow
                              token: <ControlFlow_Exit exit>
                              arg_word: {(1)}
                            )
                          ]
                        )
                      ]
                    )
                    (command.If
                      arms: [
                        (if_arm
                          cond: [
                            (command.Sentence
                              child: 
                                (command.DBracket
                                  expr: 
                                    (bool_expr.Binary
                                      op_id: BoolBinary_GlobDEqual
                                      left: 
                                        {
                                          (DQ 
                                            (braced_var_sub
                                              token: <VSub_Name FUNCNAME>
                                              bracket_op: 
                                                (bracket_op.ArrayIndex
                                                  expr: 
                                                    (arith_expr.ArithWord
                                                      w: {($ VSub_DollarName '$ctr')}
                                                    )
                                                )
                                            )
                                          )
                                        }
                                      right: {(DQ (this_filename))}
                                    )
                                )
                              terminator: <Op_Semi ';'>
                            )
                          ]
                          action: [
                            (C {(echo)} 
                              {
                                (braced_var_sub
                                  token: <VSub_Name BASH_SOURCE>
                                  bracket_op: 
                                    (bracket_op.ArrayIndex
                                      expr: (arith_expr.ArithWord w:{($ VSub_DollarName '$ctr')})
                                    )
                                )
                              }
                            )
                            (command.ControlFlow
                              token: <ControlFlow_Exit exit>
                              arg_word: {(0)}
                            )
                          ]
                        )
                      ]
                    )
                    (command.ShAssignment
                      pairs: [
                        (assign_pair
                          lhs: (sh_lhs_expr.Name name:ctr)
                          op: Equal
                          rhs: 
                            {
                              (word_part.ArithSub
                                anode: 
                                  (arith_expr.Binary
                                    op_id: Arith_Plus
                                    left: (arith_expr.ArithWord w:{($ VSub_DollarName '$ctr')})
                                    right: (arith_expr.ArithWord w:{(Lit_Digits 1)})
                                  )
                              )
                            }
                        )
                      ]
                    )
                  ]
                )
            )
          ]
        )
    )
    (command.ShAssignment
      pairs: [
        (assign_pair
          lhs: (sh_lhs_expr.Name name:LIBALLOCS_BASE)
          op: Equal
          rhs: 
            {
              (DQ 
                (braced_var_sub
                  token: <VSub_Name LIBALLOCS_BASE>
                  suffix_op: 
                    (suffix_op.Unary
                      op_id: VTest_ColonHyphen
                      arg_word: 
                        {
                          (command_sub
                            left_token: <Left_DollarParen '$('>
                            command_list: 
                              (command.CommandList
                                children: [
                                  (C {(dirname)} 
                                    {
                                      (DQ 
                                        (command_sub
                                          left_token: <Left_DollarParen '$('>
                                          command_list: 
                                            (command.CommandList
                                              children: [(C {(this_filename)})]
                                            )
                                        )
                                      )
                                    }
                                  )
                                ]
                              )
                          ) (Lit_Slash /) (..)
                        }
                    )
                )
              )
            }
        )
      ]
    )
    (command.ShAssignment
      pairs: [
        (assign_pair
          lhs: (sh_lhs_expr.Name name:USEDTYPES)
          op: Equal
          rhs: 
            {
              (braced_var_sub
                token: <VSub_Name USEDTYPES>
                suffix_op: 
                  (suffix_op.Unary
                    op_id: VTest_ColonHyphen
                    arg_word: 
                      {(${ VSub_Name LIBALLOCS_BASE) (Lit_Slash /) (tools) (Lit_Slash /) (usedtypes)}
                  )
              )
            }
        )
      ]
    )
    (command.ShAssignment
      pairs: [
        (assign_pair
          lhs: (sh_lhs_expr.Name name:BASE_TYPES_TRANSLATION)
          op: Equal
          rhs: 
            {
              (braced_var_sub
                token: <VSub_Name BASE_TYPES_TRANSLATION>
                suffix_op: 
                  (suffix_op.Unary
                    op_id: VTest_ColonHyphen
                    arg_word: 
                      {(${ VSub_Name LIBALLOCS_BASE) (Lit_Slash /) (tools) (Lit_Slash /) (lang) 
                        (Lit_Slash /) (c) (Lit_Slash /) (bin) (Lit_Slash /) (base-types-translation)
                      }
                  )
              )
            }
        )
      ]
    )
    (command.ShAssignment
      pairs: [
        (assign_pair
          lhs: (sh_lhs_expr.Name name:CC)
          op: Equal
          rhs: 
            {
              (braced_var_sub
                token: <VSub_Name CC>
                suffix_op: 
                  (suffix_op.Unary
                    op_id: VTest_ColonHyphen
                    arg_word: 
                      {
                        (command_sub
                          left_token: <Left_DollarParen '$('>
                          command_list: (command.CommandList children:[(C {(which)} {(cc)})])
                        )
                      }
                  )
              )
            }
        )
      ]
    )
    (command.ShAssignment
      pairs: [
        (assign_pair
          lhs: (sh_lhs_expr.Name name:LD)
          op: Equal
          rhs: 
            {
              (braced_var_sub
                token: <VSub_Name LD>
                suffix_op: 
                  (suffix_op.Unary
                    op_id: VTest_ColonHyphen
                    arg_word: 
                      {
                        (command_sub
                          left_token: <Left_DollarParen '$('>
                          command_list: (command.CommandList children:[(C {(which)} {(ld)})])
                        )
                      }
                  )
              )
            }
        )
      ]
    )
    (command.ShAssignment
      pairs: [
        (assign_pair
          lhs: (sh_lhs_expr.Name name:OBJCOPY)
          op: Equal
          rhs: 
            {
              (braced_var_sub
                token: <VSub_Name OBJCOPY>
                suffix_op: 
                  (suffix_op.Unary
                    op_id: VTest_ColonHyphen
                    arg_word: 
                      {
                        (command_sub
                          left_token: <Left_DollarParen '$('>
                          command_list: (command.CommandList children:[(C {(which)} {(objcopy)})])
                        )
                      }
                  )
              )
            }
        )
      ]
    )
    (command.ShFunction
      name: compile
      body: 
        (command.BraceGroup
          children: [
            (command.ShAssignment
              pairs: [
                (assign_pair
                  lhs: (sh_lhs_expr.Name name:src)
                  op: Equal
                  rhs: {(DQ ($ VSub_Number '$1'))}
                )
              ]
            )
            (command.ShAssignment
              pairs: [
                (assign_pair
                  lhs: (sh_lhs_expr.Name name:dest)
                  op: Equal
                  rhs: {(DQ ($ VSub_Number '$2'))}
                )
              ]
            )
            (command.ShAssignment
              pairs: [
                (assign_pair
                  lhs: (sh_lhs_expr.Name name:asm)
                  op: Equal
                  rhs: 
                    {
                      (DQ 
                        (command_sub
                          left_token: <Left_DollarParen '$('>
                          command_list: 
                            (command.CommandList
                              children: [(C {(mktemp)} {(--suffix) (Lit_Equals '=') (.s)})]
                            )
                        )
                      )
                    }
                )
              ]
            )
            (command.AndOr
              ops: [Op_DAmp Op_DAmp]
              children: [
                (C {(gcc)} {(-S)} {(-x)} {(c)} {(-o)} {(DQ ($ VSub_DollarName '$asm'))} 
                  {(DQ ($ VSub_DollarName '$src'))}
                )
                (C {(gcc)} {(-c)} {(-o)} {(DQ ($ VSub_DollarName '$dest'))} 
                  {(DQ ($ VSub_DollarName '$asm'))}
                )
                (command.Simple
                  words: [{(echo)} {(DQ ('Compiler generated ') ($ VSub_DollarName '$dest'))}]
                  redirects: [(redir.Redir op:<Redir_GreatAnd '1>&'> fd:1 arg_word:{(2)})]
                )
              ]
            )
          ]
        )
    )
    (command.ShFunction
      name: link_defining_aliases
      body: 
        (command.BraceGroup
          children: [
            (command.ShAssignment
              pairs: [
                (assign_pair
                  lhs: (sh_lhs_expr.Name name:our_objfile)
                  op: Equal
                  rhs: {(DQ ($ VSub_Number '$1'))}
                )
              ]
            )
            (command.ShAssignment
              pairs: [
                (assign_pair
                  lhs: (sh_lhs_expr.Name name:our_usedtypes_obj)
                  op: Equal
                  rhs: {(DQ ($ VSub_Number '$2'))}
                )
              ]
            )
            (command.ShAssignment
              pairs: [
                (assign_pair
                  lhs: (sh_lhs_expr.Name name:temporary_out)
                  op: Equal
                  rhs: 
                    {
                      (command_sub
                        left_token: <Left_DollarParen '$('>
                        command_list: (command.CommandList children:[(C {(mktemp)})])
                      )
                    }
                )
              ]
            )
            (command.AndOr
              ops: [Op_DAmp Op_DAmp]
              children: [
                (C {(${ VSub_Name LD)} {(-o)} {(DQ ($ VSub_DollarName '$temporary_out'))} {(-r)} 
                  {(DQ ($ VSub_DollarName '$our_objfile'))} {(DQ ($ VSub_DollarName '$our_usedtypes_obj'))}
                )
                (command.Simple
                  words: [
                    {(echo)}
                    {
                      (DQ ('Linker generated ') (${ VSub_Name temporary_out) (', moving to ') 
                        (${ VSub_Name our_objfile)
                      )
                    }
                  ]
                  redirects: [(redir.Redir op:<Redir_GreatAnd '1>&'> fd:1 arg_word:{(2)})]
                )
                (C {(mv)} {(DQ ($ VSub_DollarName '$temporary_out'))} 
                  {(DQ ($ VSub_DollarName '$our_objfile'))}
                )
              ]
            )
          ]
        )
    )
    (command.ShFunction
      name: symbol_redefinitions
      body: 
        (command.BraceGroup
          children: [
            (command.ShAssignment
              pairs: [
                (assign_pair
                  lhs: (sh_lhs_expr.Name name:f)
                  op: Equal
                  rhs: {(DQ ($ VSub_Number '$1'))}
                )
              ]
            )
            (command.Pipeline
              children: [
                (C {(nm)} {(-fposix)} {(--defined-only)} {(DQ ($ VSub_DollarName '$f'))})
                (C {(tr)} {(-s)} {(SQ <'[:blank:]'>)} {(SQ <'\\t'>)})
                (C {(cut)} {(-f1)})
                (C {(egrep)} {(SQ <'__uniqtype_([0-9a-f]{8})_'>)})
                (C {(sed)} {(-r)} 
                  {
                    (SQ 
                      <
's/__uniqtype_([0-9a-f]{8})_(.*)/--redefine-sym __uniqtype__\\2=__uniqtype_\\1_\\2/'
                      >
                    )
                  }
                )
              ]
              negated: F
            )
          ]
        )
    )
    (command.ShFunction
      name: objcopy_and_redefine_codeless_names
      body: 
        (command.BraceGroup
          children: [
            (command.ShAssignment
              pairs: [
                (assign_pair
                  lhs: (sh_lhs_expr.Name name:our_objfile)
                  op: Equal
                  rhs: {(DQ ($ VSub_Number '$1'))}
                )
              ]
            )
            (command.ShAssignment
              pairs: [
                (assign_pair
                  lhs: (sh_lhs_expr.Name name:our_usedtypes_obj)
                  op: Equal
                  rhs: {(DQ ($ VSub_Number '$2'))}
                )
              ]
            )
            (command.AndOr
              ops: [Op_DAmp Op_DAmp Op_DAmp]
              children: [
                (command.ShAssignment
                  pairs: [
                    (assign_pair
                      lhs: (sh_lhs_expr.Name name:second_redefinition_args)
                      op: Equal
                      rhs: 
                        {
                          (DQ 
                            (command_sub
                              left_token: <Left_DollarParen '$('>
                              command_list: 
                                (command.CommandList
                                  children: [
                                    (C {(symbol_redefinitions)} 
                                      {(DQ ($ VSub_DollarName '$our_usedtypes_obj'))}
                                    )
                                  ]
                                )
                            )
                          )
                        }
                    )
                  ]
                )
                (command.Simple
                  words: [
                    {(echo)}
                    {(${ VSub_Name OBJCOPY)}
                    {($ VSub_DollarName '$second_redefinition_args')}
                    {(DQ ($ VSub_DollarName '$our_objfile'))}
                  ]
                  redirects: [(redir.Redir op:<Redir_GreatAnd '1>&'> fd:1 arg_word:{(2)})]
                )
                (C {(${ VSub_Name OBJCOPY)} {($ VSub_DollarName '$second_redefinition_args')} 
                  {(DQ ($ VSub_DollarName '$our_objfile'))}
                )
                (command.Simple
                  words: [
                    {(echo)}
                    {
                      (DQ ('objcopy renamed symbols in ') ($ VSub_DollarName '$our_objfile') 
                        (' according to ') ($ VSub_DollarName '$second_redefinition_args')
                      )
                    }
                  ]
                  redirects: [(redir.Redir op:<Redir_GreatAnd '1>&'> fd:1 arg_word:{(2)})]
                )
              ]
            )
          ]
        )
    )
  ]
)