(command.CommandList
  children: [
    (command.ShFunction
      name_tok: <_Dbg_set_onoff>
      name: _Dbg_set_onoff
      body: 
        (BraceGroup
          left: <Id.Lit_LBrace '{'>
          children: [
            (command.Simple
              blame_tok: <typeset>
              more_env: []
              words: [
                {<typeset>}
                {<Id.Lit_VarLike 'onoff='> 
                  (BracedVarSub
                    left: <Id.Left_DollarBrace '${'>
                    token: <Id.VSub_Number 1>
                    var_name: 1
                    suffix_op: (suffix_op.Unary op:<Id.VTest_ColonHyphen _> arg_word:{(SQ <off>)})
                    right: <Id.Right_DollarBrace '}'>
                  )
                }
              ]
              redirects: []
              do_fork: T
            )
            (command.Simple
              blame_tok: <typeset>
              more_env: []
              words: [{<typeset>} {<Id.Lit_VarLike 'cmdname='> ($ Id.VSub_Number 2)}]
              redirects: []
              do_fork: T
            )
            (command.Case
              case_kw: <Id.KW_Case case>
              to_match: (case_arg.Word w:{($ Id.VSub_DollarName onoff)})
              arms_start: <Id.KW_In in>
              arms: [
                (CaseArm
                  left: <on>
                  pattern: (pat.Words words:[{<on>} {<1>}])
                  middle: <Id.Right_CasePat _>
                  action: [
                    (command.Simple
                      blame_tok: <_Dbg_write_journal_eval>
                      more_env: []
                      words: [
                        {<_Dbg_write_journal_eval>}
                        {(DQ <_Dbg_set_> (${ Id.VSub_Name cmdname) <'=1'>)}
                      ]
                      redirects: []
                      do_fork: T
                    )
                  ]
                  right: <Id.Op_DSemi _>
                )
                (CaseArm
                  left: <off>
                  pattern: (pat.Words words:[{<off>} {<0>}])
                  middle: <Id.Right_CasePat _>
                  action: [
                    (command.Simple
                      blame_tok: <_Dbg_write_journal_eval>
                      more_env: []
                      words: [
                        {<_Dbg_write_journal_eval>}
                        {(DQ <_Dbg_set_> (${ Id.VSub_Name cmdname) <'=0'>)}
                      ]
                      redirects: []
                      do_fork: T
                    )
                  ]
                  right: <Id.Op_DSemi _>
                )
                (CaseArm
                  left: <Id.Lit_Star '*'>
                  pattern: (pat.Words words:[{<Id.Lit_Star '*'>}])
                  middle: <Id.Right_CasePat _>
                  action: [
                    (command.Simple
                      blame_tok: <_Dbg_msg>
                      more_env: []
                      words: [
                        {<_Dbg_msg>}
                        {
                          (DQ (word_part.EscapedLiteral token:<Id.Lit_EscapedChar '\\"'> ch:'"') <on> 
                            (word_part.EscapedLiteral
                              token: <Id.Lit_EscapedChar '\\"'>
                              ch: '"'
                            ) <' or '> (word_part.EscapedLiteral token:<Id.Lit_EscapedChar '\\"'> ch:'"') <off> 
                            (word_part.EscapedLiteral
                              token: <Id.Lit_EscapedChar '\\"'>
                              ch: '"'
                            ) <' expected.'>
                          )
                        }
                      ]
                      redirects: []
                      do_fork: T
                    )
                    (command.ControlFlow
                      keyword: <Id.ControlFlow_Return return>
                      arg_word: {<1>}
                    )
                  ]
                )
              ]
              arms_end: <Id.KW_Esac esac>
              redirects: []
            )
            (command.Simple
              blame_tok: <_Dbg_do_show>
              more_env: []
              words: [{<_Dbg_do_show>} {($ Id.VSub_DollarName cmdname)}]
              redirects: []
              do_fork: T
            )
            (command.ControlFlow keyword:<Id.ControlFlow_Return return> arg_word:{<0>})
          ]
          redirects: []
          right: <Id.Lit_RBrace '}'>
        )
    )
    (command.ShFunction
      name_tok: <_Dbg_show_onoff>
      name: _Dbg_show_onoff
      body: 
        (BraceGroup
          left: <Id.Lit_LBrace '{'>
          children: [
            (command.Simple
              blame_tok: <typeset>
              more_env: []
              words: [{<typeset>} {<Id.Lit_VarLike 'cmd='> (DQ ($ Id.VSub_Number 1))}]
              redirects: []
              do_fork: T
            )
            (command.Simple
              blame_tok: <typeset>
              more_env: []
              words: [{<typeset>} {<Id.Lit_VarLike 'msg='> (DQ ($ Id.VSub_Number 2))}]
              redirects: []
              do_fork: T
            )
            (command.Simple
              blame_tok: <typeset>
              more_env: []
              words: [{<typeset>} {<Id.Lit_VarLike 'label='> (DQ ($ Id.VSub_Number 3))}]
              redirects: []
              do_fork: T
            )
            (command.AndOr
              children: [
                (command.DBracket
                  left: <Id.KW_DLeftBracket '[['>
                  expr: (bool_expr.Unary op_id:Id.BoolUnary_n child:{($ Id.VSub_DollarName label)})
                  right: <Id.Lit_DRightBracket ']]'>
                  redirects: []
                )
                (command.ShAssignment
                  left: <Id.Lit_VarLike 'label='>
                  pairs: [
                    (AssignPair
                      left: <Id.Lit_VarLike 'label='>
                      lhs: (sh_lhs_expr.Name left:<Id.Lit_VarLike 'label='> name:label)
                      op: assign_op.Equal
                      rhs: 
                        {
                          (CommandSub
                            left_token: <Id.Left_DollarParen '$('>
                            child: 
                              (command.Simple
                                blame_tok: <printf>
                                more_env: []
                                words: [{<printf>} {(DQ <'%-12s: '>)} {($ Id.VSub_DollarName subcmd)}]
                                redirects: []
                                do_fork: T
                              )
                            right: <Id.Eof_RParen _>
                          )
                        }
                    )
                  ]
                  redirects: []
                )
              ]
              ops: [<Id.Op_DAmp _>]
            )
            (command.Simple
              blame_tok: <typeset>
              more_env: []
              words: [{<typeset>} {<Id.Lit_VarLike 'onoff='> (SQ <off.>)}]
              redirects: []
              do_fork: T
            )
            (command.Simple
              blame_tok: <typeset>
              more_env: []
              words: [{<typeset>} {<value>}]
              redirects: []
              do_fork: T
            )
            (command.Simple
              blame_tok: <eval>
              more_env: []
              words: [
                {<eval>}
                {
                  (DQ <'value='> (word_part.EscapedLiteral token:<Id.Lit_EscapedChar '\\$'> ch:'$') 
                    <_Dbg_set_> (${ Id.VSub_Name cmd)
                  )
                }
              ]
              redirects: []
              do_fork: T
            )
            (command.AndOr
              children: [
                (command.DParen
                  left: <Id.Op_DLeftParen _>
                  child: ($ Id.Lit_ArithVarLike value)
                  right: <Id.Op_DRightParen _>
                  redirects: []
                )
                (command.ShAssignment
                  left: <Id.Lit_VarLike 'onoff='>
                  pairs: [
                    (AssignPair
                      left: <Id.Lit_VarLike 'onoff='>
                      lhs: (sh_lhs_expr.Name left:<Id.Lit_VarLike 'onoff='> name:onoff)
                      op: assign_op.Equal
                      rhs: {(SQ <on.>)}
                    )
                  ]
                  redirects: []
                )
              ]
              ops: [<Id.Op_DAmp _>]
            )
            (command.Simple
              blame_tok: <_Dbg_msg>
              more_env: []
              words: [
                {<_Dbg_msg>}
                {(DQ (${ Id.VSub_Name label) ($ Id.VSub_DollarName msg) <' is'>)}
                {($ Id.VSub_DollarName onoff)}
              ]
              redirects: []
              do_fork: T
            )
            (command.ControlFlow keyword:<Id.ControlFlow_Return return> arg_word:{<0>})
          ]
          redirects: []
          right: <Id.Lit_RBrace '}'>
        )
    )
    (command.ShFunction
      name_tok: <_Dbg_help_set_onoff>
      name: _Dbg_help_set_onoff
      body: 
        (BraceGroup
          left: <Id.Lit_LBrace '{'>
          children: [
            (command.Simple
              blame_tok: <typeset>
              more_env: []
              words: [{<typeset>} {<Id.Lit_VarLike 'subcmd='> (DQ ($ Id.VSub_Number 1))}]
              redirects: []
              do_fork: T
            )
            (command.Simple
              blame_tok: <typeset>
              more_env: []
              words: [{<typeset>} {<Id.Lit_VarLike 'label='> (DQ ($ Id.VSub_Number 2))}]
              redirects: []
              do_fork: T
            )
            (command.Simple
              blame_tok: <typeset>
              more_env: []
              words: [{<typeset>} {<Id.Lit_VarLike 'msg='> (DQ ($ Id.VSub_Number 3))}]
              redirects: []
              do_fork: T
            )
            (command.Simple
              blame_tok: <typeset>
              more_env: []
              words: [{<typeset>} {<-i>} {<variable_value>}]
              redirects: []
              do_fork: T
            )
            (command.ShAssignment
              left: <Id.Lit_VarLike 'eval_cmd='>
              pairs: [
                (AssignPair
                  left: <Id.Lit_VarLike 'eval_cmd='>
                  lhs: (sh_lhs_expr.Name left:<Id.Lit_VarLike 'eval_cmd='> name:eval_cmd)
                  op: assign_op.Equal
                  rhs: 
                    {
                      (DQ <'variable_value='> 
                        (word_part.EscapedLiteral
                          token: <Id.Lit_EscapedChar '\\$'>
                          ch: '$'
                        ) <'{_Dbg_set_'> ($ Id.VSub_DollarName subcmd) <'}'>
                      )
                    }
                )
              ]
              redirects: []
            )
            (command.Simple
              blame_tok: <eval>
              more_env: []
              words: [{<eval>} {($ Id.VSub_DollarName eval_cmd)}]
              redirects: []
              do_fork: T
            )
            (command.AndOr
              children: [
                (command.DBracket
                  left: <Id.KW_DLeftBracket '[['>
                  expr: (bool_expr.Unary op_id:Id.BoolUnary_n child:{($ Id.VSub_DollarName label)})
                  right: <Id.Lit_DRightBracket ']]'>
                  redirects: []
                )
                (command.ShAssignment
                  left: <Id.Lit_VarLike 'label='>
                  pairs: [
                    (AssignPair
                      left: <Id.Lit_VarLike 'label='>
                      lhs: (sh_lhs_expr.Name left:<Id.Lit_VarLike 'label='> name:label)
                      op: assign_op.Equal
                      rhs: 
                        {
                          (CommandSub
                            left_token: <Id.Left_DollarParen '$('>
                            child: 
                              (command.Simple
                                blame_tok: <builtin>
                                more_env: []
                                words: [
                                  {<builtin>}
                                  {<printf>}
                                  {(DQ <'set %-12s-- '>)}
                                  {($ Id.VSub_DollarName subcmd)}
                                ]
                                redirects: []
                                do_fork: T
                              )
                            right: <Id.Eof_RParen _>
                          )
                        }
                    )
                  ]
                  redirects: []
                )
              ]
              ops: [<Id.Op_DAmp _>]
            )
            (command.Simple
              blame_tok: <typeset>
              more_env: []
              words: [{<typeset>} {<Id.Lit_VarLike 'onoff='> (DQ <off.>)}]
              redirects: []
              do_fork: T
            )
            (command.AndOr
              children: [
                (command.DParen
                  left: <Id.Op_DLeftParen _>
                  child: 
                    (arith_expr.Binary
                      op_id: Id.Arith_NEqual
                      left: ($ Id.Lit_ArithVarLike variable_value)
                      right: {<Id.Lit_Digits 0>}
                    )
                  right: <Id.Op_DRightParen _>
                  redirects: []
                )
                (command.ShAssignment
                  left: <Id.Lit_VarLike 'onoff='>
                  pairs: [
                    (AssignPair
                      left: <Id.Lit_VarLike 'onoff='>
                      lhs: (sh_lhs_expr.Name left:<Id.Lit_VarLike 'onoff='> name:onoff)
                      op: assign_op.Equal
                      rhs: {(SQ <on.>)}
                    )
                  ]
                  redirects: []
                )
              ]
              ops: [<Id.Op_DAmp _>]
            )
            (command.Simple
              blame_tok: <_Dbg_msg>
              more_env: []
              words: [
                {<_Dbg_msg>}
                {(DQ (${ Id.VSub_Name label) (${ Id.VSub_Name msg) <' is'>)}
                {($ Id.VSub_DollarName onoff)}
              ]
              redirects: []
              do_fork: T
            )
            (command.ControlFlow keyword:<Id.ControlFlow_Return return> arg_word:{<0>})
          ]
          redirects: []
          right: <Id.Lit_RBrace '}'>
        )
    )
    (command.If
      if_kw: <Id.KW_If if>
      arms: [
        (IfArm
          keyword: <Id.KW_If if>
          cond: 
            (condition.Shell
              commands: [
                (command.Sentence
                  child: 
                    (command.DBracket
                      left: <Id.KW_DLeftBracket '[['>
                      expr: 
                        (bool_expr.Binary
                          op_id: Id.BoolBinary_GlobDEqual
                          left: 
                            {
                              (BracedVarSub
                                left: <Id.Left_DollarBrace '${'>
                                token: <Id.VSub_Name BASH_SOURCE>
                                var_name: BASH_SOURCE
                                bracket_op: (bracket_op.ArrayIndex expr:{<Id.Lit_Digits 0>})
                                right: <Id.Right_DollarBrace '}'>
                              )
                            }
                          right: {($ Id.VSub_Number 0)}
                        )
                      right: <Id.Lit_DRightBracket ']]'>
                      redirects: []
                    )
                  terminator: <Id.Op_Semi _>
                )
              ]
            )
          then_kw: <Id.KW_Then then>
          action: [
            (command.ShFunction
              name_tok: <_Dbg_msg>
              name: _Dbg_msg
              body: 
                (BraceGroup
                  left: <Id.Lit_LBrace '{'>
                  children: [
                    (command.Simple
                      blame_tok: <echo>
                      more_env: []
                      words: [{<echo>} {($ Id.VSub_Star '*')}]
                      redirects: []
                      do_fork: T
                    )
                  ]
                  redirects: []
                  right: <Id.Lit_RBrace '}'>
                )
            )
            (command.Simple
              blame_tok: <typeset>
              more_env: []
              words: [{<typeset>} {<-i>} {<_Dbg_foo>}]
              redirects: []
              do_fork: T
            )
            (command.ForEach
              keyword: <Id.KW_For for>
              iter_names: [i]
              iterable: (for_iter.Words words:[{<0>} {<1>}])
              semi_tok: <Id.Op_Semi _>
              body: 
                (command.DoGroup
                  left: <Id.KW_Do do>
                  children: [
                    (command.ShAssignment
                      left: <Id.Lit_VarLike '_Dbg_foo='>
                      pairs: [
                        (AssignPair
                          left: <Id.Lit_VarLike '_Dbg_foo='>
                          lhs: (sh_lhs_expr.Name left:<Id.Lit_VarLike '_Dbg_foo='> name:_Dbg_foo)
                          op: assign_op.Equal
                          rhs: {($ Id.VSub_DollarName i)}
                        )
                      ]
                      redirects: []
                    )
                    (command.Simple
                      blame_tok: <_Dbg_help_set_onoff>
                      more_env: []
                      words: [{<_Dbg_help_set_onoff>} {(DQ <foo>)} {(DQ <foo>)} {(DQ <'Set short xx'>)}]
                      redirects: []
                      do_fork: T
                    )
                    (command.Simple
                      blame_tok: <typeset>
                      more_env: []
                      words: [{<typeset>} {<-p>} {<_Dbg_set_foo>}]
                      redirects: []
                      do_fork: T
                    )
                  ]
                  right: <Id.KW_Done done>
                )
              redirects: []
            )
          ]
          spids: [423 442]
        )
      ]
      else_action: []
      fi_kw: <Id.KW_Fi fi>
      redirects: []
    )
  ]
)