(command.CommandList
  children: [
    (command.ShFunction
      name: _Dbg_set_onoff
      body: 
        (command.BraceGroup
          children: [
            (C {(typeset)} 
              {(Lit_VarLike 'onoff=') 
                (braced_var_sub
                  token: <VSub_Number 1>
                  suffix_op: (suffix_op.Unary op_id:VTest_ColonHyphen arg_word:{(SQ <off>)})
                )
              }
            )
            (C {(typeset)} {(Lit_VarLike 'cmdname=') ($ VSub_Number '$2')})
            (command.Case
              to_match: {($ VSub_DollarName '$onoff')}
              arms: [
                (case_arm
                  pat_list: [{(on)} {(1)}]
                  action: [
                    (C {(_Dbg_write_journal_eval)} {(DQ (_Dbg_set_) (${ VSub_Name cmdname) ('=1'))})
                  ]
                )
                (case_arm
                  pat_list: [{(off)} {(0)}]
                  action: [
                    (C {(_Dbg_write_journal_eval)} {(DQ (_Dbg_set_) (${ VSub_Name cmdname) ('=0'))})
                  ]
                )
                (case_arm
                  pat_list: [{(Lit_Star '*')}]
                  action: [
                    (C {(_Dbg_msg)} 
                      {
                        (DQ (word_part.EscapedLiteral token:<Lit_EscapedChar '\\"'>) (on) 
                          (word_part.EscapedLiteral
                            token: <Lit_EscapedChar '\\"'>
                          ) (' or ') (word_part.EscapedLiteral token:<Lit_EscapedChar '\\"'>) (off) 
                          (word_part.EscapedLiteral
                            token: <Lit_EscapedChar '\\"'>
                          ) (' expected.')
                        )
                      }
                    )
                    (command.ControlFlow
                      token: <ControlFlow_Return return>
                      arg_word: {(1)}
                    )
                  ]
                )
              ]
            )
            (C {(_Dbg_do_show)} {($ VSub_DollarName '$cmdname')})
            (command.ControlFlow token:<ControlFlow_Return return> arg_word:{(0)})
          ]
        )
    )
    (command.ShFunction
      name: _Dbg_show_onoff
      body: 
        (command.BraceGroup
          children: [
            (C {(typeset)} {(Lit_VarLike 'cmd=') (DQ ($ VSub_Number '$1'))})
            (C {(typeset)} {(Lit_VarLike 'msg=') (DQ ($ VSub_Number '$2'))})
            (C {(typeset)} {(Lit_VarLike 'label=') (DQ ($ VSub_Number '$3'))})
            (command.AndOr
              ops: [Op_DAmp]
              children: [
                (command.DBracket
                  expr: (bool_expr.Unary op_id:BoolUnary_n child:{($ VSub_DollarName '$label')})
                )
                (command.ShAssignment
                  pairs: [
                    (assign_pair
                      lhs: (sh_lhs_expr.Name name:label)
                      op: Equal
                      rhs: 
                        {
                          (command_sub
                            left_token: <Left_DollarParen '$('>
                            command_list: 
                              (command.CommandList
                                children: [
                                  (C {(printf)} {(DQ ('%-12s: '))} {($ VSub_DollarName '$subcmd')})
                                ]
                              )
                          )
                        }
                    )
                  ]
                )
              ]
            )
            (C {(typeset)} {(Lit_VarLike 'onoff=') (SQ <off.>)})
            (C {(typeset)} {(value)})
            (C {(eval)} 
              {
                (DQ ('value=') (word_part.EscapedLiteral token:<Lit_EscapedChar '\\$'>) (_Dbg_set_) 
                  (${ VSub_Name cmd)
                )
              }
            )
            (command.AndOr
              ops: [Op_DAmp]
              children: [
                (command.DParen
                  child: (arith_expr.VarRef token:<Lit_ArithVarLike value>)
                )
                (command.ShAssignment
                  pairs: [(assign_pair lhs:(sh_lhs_expr.Name name:onoff) op:Equal rhs:{(SQ <on.>)})]
                )
              ]
            )
            (C {(_Dbg_msg)} {(DQ (${ VSub_Name label) ($ VSub_DollarName '$msg') (' is'))} 
              {($ VSub_DollarName '$onoff')}
            )
            (command.ControlFlow token:<ControlFlow_Return return> arg_word:{(0)})
          ]
        )
    )
    (command.ShFunction
      name: _Dbg_help_set_onoff
      body: 
        (command.BraceGroup
          children: [
            (C {(typeset)} {(Lit_VarLike 'subcmd=') (DQ ($ VSub_Number '$1'))})
            (C {(typeset)} {(Lit_VarLike 'label=') (DQ ($ VSub_Number '$2'))})
            (C {(typeset)} {(Lit_VarLike 'msg=') (DQ ($ VSub_Number '$3'))})
            (C {(typeset)} {(-i)} {(variable_value)})
            (command.ShAssignment
              pairs: [
                (assign_pair
                  lhs: (sh_lhs_expr.Name name:eval_cmd)
                  op: Equal
                  rhs: 
                    {
                      (DQ ('variable_value=') (word_part.EscapedLiteral token:<Lit_EscapedChar '\\$'>) 
                        ('{_Dbg_set_') ($ VSub_DollarName '$subcmd') ('}')
                      )
                    }
                )
              ]
            )
            (C {(eval)} {($ VSub_DollarName '$eval_cmd')})
            (command.AndOr
              ops: [Op_DAmp]
              children: [
                (command.DBracket
                  expr: (bool_expr.Unary op_id:BoolUnary_n child:{($ VSub_DollarName '$label')})
                )
                (command.ShAssignment
                  pairs: [
                    (assign_pair
                      lhs: (sh_lhs_expr.Name name:label)
                      op: Equal
                      rhs: 
                        {
                          (command_sub
                            left_token: <Left_DollarParen '$('>
                            command_list: 
                              (command.CommandList
                                children: [
                                  (C {(builtin)} {(printf)} {(DQ ('set %-12s-- '))} 
                                    {($ VSub_DollarName '$subcmd')}
                                  )
                                ]
                              )
                          )
                        }
                    )
                  ]
                )
              ]
            )
            (C {(typeset)} {(Lit_VarLike 'onoff=') (DQ (off.))})
            (command.AndOr
              ops: [Op_DAmp]
              children: [
                (command.DParen
                  child: 
                    (arith_expr.Binary
                      op_id: Arith_NEqual
                      left: (arith_expr.VarRef token:<Lit_ArithVarLike variable_value>)
                      right: (arith_expr.ArithWord w:{(Lit_Digits 0)})
                    )
                )
                (command.ShAssignment
                  pairs: [(assign_pair lhs:(sh_lhs_expr.Name name:onoff) op:Equal rhs:{(SQ <on.>)})]
                )
              ]
            )
            (C {(_Dbg_msg)} {(DQ (${ VSub_Name label) (${ VSub_Name msg) (' is'))} 
              {($ VSub_DollarName '$onoff')}
            )
            (command.ControlFlow token:<ControlFlow_Return return> arg_word:{(0)})
          ]
        )
    )
    (command.If
      arms: [
        (if_arm
          cond: [
            (command.Sentence
              child: 
                (command.DBracket
                  expr: 
                    (bool_expr.Binary
                      op_id: BoolBinary_GlobDEqual
                      left: 
                        {
                          (braced_var_sub
                            token: <VSub_Name BASH_SOURCE>
                            bracket_op: 
                              (bracket_op.ArrayIndex
                                expr: (arith_expr.ArithWord w:{(Lit_Digits 0)})
                              )
                          )
                        }
                      right: {($ VSub_Number '$0')}
                    )
                )
              terminator: <Op_Semi ';'>
            )
          ]
          action: [
            (command.ShFunction
              name: _Dbg_msg
              body: (command.BraceGroup children:[(C {(echo)} {($ VSub_Star '$*')})])
            )
            (C {(typeset)} {(-i)} {(_Dbg_foo)})
            (command.ForEach
              iter_name: i
              iter_words: [{(0)} {(1)}]
              do_arg_iter: F
              body: 
                (command.DoGroup
                  children: [
                    (command.ShAssignment
                      pairs: [
                        (assign_pair
                          lhs: (sh_lhs_expr.Name name:_Dbg_foo)
                          op: Equal
                          rhs: {($ VSub_DollarName '$i')}
                        )
                      ]
                    )
                    (C {(_Dbg_help_set_onoff)} {(DQ (foo))} {(DQ (foo))} {(DQ ('Set short xx'))})
                    (C {(typeset)} {(-p)} {(_Dbg_set_foo)})
                  ]
                )
            )
          ]
        )
      ]
    )
  ]
)