(command.CommandList
  children: [
    (command.ShAssignment
      pairs: [
        (assign_pair
          lhs: (sh_lhs_expr.Name left:<Id.Lit_VarLike 'BALLS_LIB='> name:BALLS_LIB)
          op: assign_op.Equal
          rhs: 
            {
              (command_sub
                left_token: <Id.Left_DollarParen '$('>
                child: 
                  (C {<readlink>} {<-f>} 
                    {
                      (command_sub
                        left_token: <Id.Left_DollarParen '$('>
                        child: (C {<dirname>} {($ Id.VSub_Number 0)})
                        right: <Id.Eof_RParen _>
                      ) <'/../lib'>
                    }
                  )
                right: <Id.Eof_RParen _>
              )
            }
          spids: [3]
        )
      ]
      redirects: []
    )
    (C {<shopt>} {<-s>} {<extglob>})
    (C {<.>} {($ Id.VSub_DollarName BALLS_LIB) <'/balls.sh'>})
    (command.ShFunction
      name: dash_trim_r
      body: 
        (BraceGroup
          left: <Id.Lit_LBrace '{'>
          children: [
            (C {<local>} 
              {<Id.Lit_VarLike 'str='> 
                (DQ 
                  (braced_var_sub
                    left: <Id.Left_DollarBrace '${'>
                    token: <Id.VSub_Number 1>
                    var_name: 1
                    prefix_op: <Id.VSub_Bang '!'>
                    right: <Id.Right_DollarBrace '}'>
                  )
                )
              }
            )
            (command.ShAssignment
              pairs: [
                (assign_pair
                  lhs: (sh_lhs_expr.Name left:<Id.Lit_VarLike 'str='> name:str)
                  op: assign_op.Equal
                  rhs: 
                    {
                      (DQ 
                        (braced_var_sub
                          left: <Id.Left_DollarBrace '${'>
                          token: <Id.VSub_Name str>
                          var_name: str
                          suffix_op: 
                            (suffix_op.Unary
                              op: <Id.VOp1_DPercent '%%'>
                              arg_word: {(word_part.ExtGlob op:<Id.ExtGlob_Star '*('> arms:[{<' '>}])}
                            )
                          right: <Id.Right_DollarBrace '}'>
                        )
                      )
                    }
                  spids: [49]
                )
              ]
              redirects: []
            )
            (C {<export>} 
              {(DQ ($ Id.VSub_Number 1)) <Id.Lit_Equals '='> (DQ ($ Id.VSub_DollarName str))}
            )
          ]
          redirects: []
          right: <Id.Lit_RBrace '}'>
        )
    )
    (command.ShFunction
      name: compile
      body: 
        (BraceGroup
          left: <Id.Lit_LBrace '{'>
          children: [
            (C {<local>} {<code>})
            (C {<local>} {<chunk>})
            (C {<local>} {<Id.Lit_VarLike 'trim_next='> <0>})
            (command.WhileUntil
              keyword: <Id.KW_While while>
              cond: 
                (condition.Shell
                  commands: [
                    (command.Sentence
                      child: (C {<read_until>} {(SQ <'<%'>)} {<chunk>})
                      terminator: <Id.Op_Semi _>
                    )
                  ]
                )
              body: 
                (command.DoGroup
                  children: [
                    (command.If
                      arms: [
                        (if_arm
                          cond: 
                            (condition.Shell
                              commands: [
                                (command.Sentence
                                  child: 
                                    (C {<Id.Lit_LBracket '['>} {(DQ ($ Id.VSub_DollarName FOUND))} 
                                      {<Id.Lit_Equals '='>} {<1>} {<Id.Lit_RBracket ']'>}
                                    )
                                  terminator: <Id.Op_Semi _>
                                )
                              ]
                            )
                          action: [
                            (C {<read_until>} {(SQ <'%>'>)} {<code>})
                            (C {<trim>} {<code>})
                            (command.Case
                              to_match: 
                                {
                                  (DQ 
                                    (braced_var_sub
                                      left: <Id.Left_DollarBrace '${'>
                                      token: <Id.VSub_Name code>
                                      var_name: code
                                      suffix_op: 
                                        (suffix_op.Slice
                                          begin: {<Id.Lit_Digits 0>}
                                          length: {<Id.Lit_Digits 1>}
                                        )
                                      right: <Id.Arith_RBrace _>
                                    )
                                  )
                                }
                              arms: [
                                (case_arm
                                  pat_list: [{<Id.Lit_Equals '='>}]
                                  action: [
                                    (command.ShAssignment
                                      pairs: [
                                        (assign_pair
                                          lhs: 
                                            (sh_lhs_expr.Name
                                              left: <Id.Lit_VarLike 'code='>
                                              name: code
                                            )
                                          op: assign_op.Equal
                                          rhs: 
                                            {
                                              (DQ 
                                                (braced_var_sub
                                                  left: <Id.Left_DollarBrace '${'>
                                                  token: <Id.VSub_Name code>
                                                  var_name: code
                                                  suffix_op: 
                                                    (suffix_op.Slice
                                                      begin: {<Id.Lit_Digits 1>}
                                                    )
                                                  right: <Id.Arith_RBrace _>
                                                )
                                              )
                                            }
                                          spids: [163]
                                        )
                                      ]
                                      redirects: []
                                    )
                                    (C {<trim>} {<code>})
                                    (command.ShAssignment
                                      pairs: [
                                        (assign_pair
                                          lhs: 
                                            (sh_lhs_expr.Name
                                              left: <Id.Lit_VarLike 'code='>
                                              name: code
                                            )
                                          op: assign_op.Equal
                                          rhs: {(DQ <'echo -n '> ($ Id.VSub_DollarName code))}
                                          spids: [178]
                                        )
                                      ]
                                      redirects: []
                                    )
                                  ]
                                  spids: [159 160 185 -1]
                                )
                                (case_arm
                                  pat_list: [{<->}]
                                  action: [
                                    (command.ShAssignment
                                      pairs: [
                                        (assign_pair
                                          lhs: 
                                            (sh_lhs_expr.Name
                                              left: <Id.Lit_VarLike 'code='>
                                              name: code
                                            )
                                          op: assign_op.Equal
                                          rhs: 
                                            {
                                              (DQ 
                                                (braced_var_sub
                                                  left: <Id.Left_DollarBrace '${'>
                                                  token: <Id.VSub_Name code>
                                                  var_name: code
                                                  suffix_op: 
                                                    (suffix_op.Slice
                                                      begin: {<Id.Lit_Digits 1>}
                                                    )
                                                  right: <Id.Arith_RBrace _>
                                                )
                                              )
                                            }
                                          spids: [192]
                                        )
                                      ]
                                      redirects: []
                                    )
                                    (C {<dash_trim_r>} {<chunk>})
                                    (C {<trim>} {<code>})
                                  ]
                                  spids: [188 189 212 -1]
                                )
                              ]
                              redirects: []
                            )
                            (command.Case
                              to_match: 
                                {
                                  (DQ 
                                    (braced_var_sub
                                      left: <Id.Left_DollarBrace '${'>
                                      token: <Id.VSub_Name code>
                                      var_name: code
                                      suffix_op: 
                                        (suffix_op.Slice
                                          begin: 
                                            (arith_expr.Binary
                                              op_id: Id.Arith_Minus
                                              left: 
                                                {
                                                  (braced_var_sub
                                                    left: <Id.Left_DollarBrace '${'>
                                                    token: <Id.VSub_Name code>
                                                    var_name: code
                                                    prefix_op: <Id.VSub_Pound '#'>
                                                    right: <Id.Right_DollarBrace '}'>
                                                  )
                                                }
                                              right: {<Id.Lit_Digits 1>}
                                            )
                                        )
                                      right: <Id.Arith_RBrace _>
                                    )
                                  )
                                }
                              arms: [
                                (case_arm
                                  pat_list: [{<->}]
                                  action: [
                                    (C {<read>})
                                    (command.ShAssignment
                                      pairs: [
                                        (assign_pair
                                          lhs: 
                                            (sh_lhs_expr.Name
                                              left: <Id.Lit_VarLike 'code='>
                                              name: code
                                            )
                                          op: assign_op.Equal
                                          rhs: 
                                            {
                                              (DQ 
                                                (braced_var_sub
                                                  left: <Id.Left_DollarBrace '${'>
                                                  token: <Id.VSub_Name code>
                                                  var_name: code
                                                  suffix_op: 
                                                    (suffix_op.Slice
                                                      begin: {<Id.Lit_Digits 0>}
                                                      length: 
                                                        (arith_expr.Binary
                                                          op_id: Id.Arith_Minus
                                                          left: 
                                                            {
                                                              (braced_var_sub
                                                                left: <Id.Left_DollarBrace '${'>
                                                                token: <Id.VSub_Name code>
                                                                var_name: code
                                                                prefix_op: <Id.VSub_Pound '#'>
                                                                right: <Id.Right_DollarBrace '}'>
                                                              )
                                                            }
                                                          right: {<Id.Lit_Digits 1>}
                                                        )
                                                    )
                                                  right: <Id.Arith_RBrace _>
                                                )
                                              )
                                            }
                                          spids: [248]
                                        )
                                      ]
                                      redirects: []
                                    )
                                    (C {<trim>} {<code>})
                                  ]
                                  spids: [237 238 270 -1]
                                )
                              ]
                              redirects: []
                            )
                          ]
                          spids: [111 126]
                        )
                      ]
                      else_action: []
                      redirects: []
                    )
                    (C {<bash_safe>} {<chunk>})
                    (C {<echo>} {(DQ <'echo -n '> ($ Id.VSub_DollarName chunk))})
                    (command.AndOr
                      ops: [Id.Op_DAmp]
                      children: [
                        (C {<Id.Lit_LBracket '['>} {(DQ ($ Id.VSub_DollarName FOUND))} 
                          {<Id.Lit_Equals '='>} {<1>} {<Id.Lit_RBracket ']'>}
                        )
                        (C {<echo>} {(DQ ($ Id.VSub_DollarName code))})
                      ]
                    )
                  ]
                )
              redirects: []
            )
            (C {<true>})
          ]
          redirects: []
          right: <Id.Lit_RBrace '}'>
        )
    )
    (command.CommandList
      children: [
        (command.Sentence
          child: 
            (command.ShAssignment
              pairs: [
                (assign_pair
                  lhs: (sh_lhs_expr.Name left:<Id.Lit_VarLike 'fname='> name:fname)
                  op: assign_op.Equal
                  rhs: {($ Id.VSub_Number 1)}
                  spids: [335]
                )
              ]
              redirects: []
            )
          terminator: <Id.Op_Semi _>
        )
        (C {<shift>})
      ]
    )
    (C {<export>} 
      {<Id.Lit_VarLike 'eof='> 
        (DQ 
          (command_sub
            left_token: <Id.Left_DollarParen '$('>
            child: (C {<echo>} {<-e>} {(SQ <'\\004'>)})
            right: <Id.Eof_RParen _>
          )
        )
      }
    )
    (command.Pipeline
      children: [
        (command.If
          arms: [
            (if_arm
              cond: 
                (condition.Shell
                  commands: [
                    (command.Sentence
                      child: 
                        (C {<Id.Lit_LBracket '['>} {<-n>} {(DQ ($ Id.VSub_DollarName fname))} 
                          {<Id.Lit_RBracket ']'>}
                        )
                      terminator: <Id.Op_Semi _>
                    )
                  ]
                )
              action: [
                (command.AndOr
                  ops: [Id.Op_DPipe]
                  children: [
                    (C {<cat>} {($ Id.VSub_DollarName fname)})
                    (command.ControlFlow
                      token: <Id.ControlFlow_Exit exit>
                      arg_word: {<1>}
                    )
                  ]
                )
              ]
              spids: [358 371]
            )
          ]
          else_action: [(C {<cat>} {<->})]
          redirects: []
        )
        (C {<compile>})
      ]
      negated: F
      stderr_indices: []
    )
  ]
)