(command.CommandList
  children: [
    (command.Assignment
      pairs: [
        (assign_pair
          lhs: (lhs_expr.LhsName name:DIR)
          op: Equal
          rhs: 
            {
              (DQ 
                (word_part.CommandSub
                  left_token: <Left_DollarParen '$('>
                  command_list: 
                    (command.CommandList
                      children: [
                        (command.AndOr
                          ops: [Op_DAmp]
                          children: [
                            (C {(cd)} 
                              {
                                (DQ 
                                  (word_part.CommandSub
                                    left_token: <Left_DollarParen '$('>
                                    command_list: 
                                      (command.CommandList
                                        children: [
                                          (C {(dirname)} 
                                            {
                                              (DQ 
                                                (word_part.BracedVarSub
                                                  token: <VSub_Name BASH_SOURCE>
                                                  bracket_op: 
                                                    (bracket_op.ArrayIndex
                                                      expr: (arith_expr.ArithWord w:{(Lit_Digits 0)})
                                                    )
                                                )
                                              )
                                            }
                                          )
                                        ]
                                      )
                                  )
                                )
                              }
                            )
                            (C {(pwd)})
                          ]
                        )
                      ]
                    )
                )
              )
            }
        )
      ]
    )
    (command.Assignment
      pairs: [(assign_pair lhs:(lhs_expr.LhsName name:REFMT) op:Equal rhs:{(DQ )})]
    )
    (command.If
      arms: [
        (if_arm
          cond: [
            (command.Sentence
              child: 
                (command.DBracket
                  expr: 
                    (bool_expr.Unary
                      op_id: BoolUnary_f
                      child: {($ VSub_DollarName '$DIR') (/refmt_impl.native)}
                    )
                )
              terminator: <Op_Semi ';'>
            )
          ]
          action: [
            (command.Assignment
              pairs: [
                (assign_pair
                  lhs: (lhs_expr.LhsName name:REFMT)
                  op: Equal
                  rhs: {(DQ ($ VSub_DollarName '$DIR') (/refmt_impl.native))}
                )
              ]
            )
          ]
        )
      ]
    )
    (command.If
      arms: [
        (if_arm
          cond: [
            (command.Sentence
              child: 
                (command.DBracket
                  expr: (bool_expr.Unary op_id:BoolUnary_f child:{($ VSub_DollarName '$DIR') (/refmt)})
                )
              terminator: <Op_Semi ';'>
            )
          ]
          action: [
            (command.Assignment
              pairs: [
                (assign_pair
                  lhs: (lhs_expr.LhsName name:REFMT)
                  op: Equal
                  rhs: {(DQ ($ VSub_DollarName '$DIR') (/refmt))}
                )
              ]
            )
          ]
        )
      ]
    )
    (command.If
      arms: [
        (if_arm
          cond: [
            (command.Sentence
              child: 
                (command.DBracket
                  expr: (bool_expr.Unary op_id:BoolUnary_z child:{($ VSub_DollarName '$REFMT')})
                )
              terminator: <Op_Semi ';'>
            )
          ]
          action: [
            (command.Simple
              words: [{(echo)} {(DQ ("Couldn't find refmt"))}]
              redirects: [(redir.Redir op:<Redir_GreatAnd '>&'> fd:16777215 arg_word:{(2)})]
            )
            (command.ControlFlow token:<ControlFlow_Exit exit> arg_word:{(1)})
          ]
        )
      ]
    )
    (C {($ VSub_DollarName '$REFMT')} {($ VSub_At '$@')} {(-recoverable)} {(true)} {(-parse)} {(re)})
  ]
)