(command.CommandList
  children: [
    (C {<_Dbg_help_add>} {<watch>} 
      {(SQ <'watch [ARITH?] EXP\n'> <'\n'> <'Set or clear a watch expression.'>)}
    )
    (C {<_Dbg_alias_add>} {<W>} {<watch>})
    (command.ShFunction
      name: _Dbg_do_watch
      body: 
        (BraceGroup
          children: [
            (C {<typeset>} {<-a>} {<a>})
            (command.ShAssignment
              pairs: [
                (assign_pair
                  lhs: (sh_lhs_expr.Name name:a)
                  op: assign_op.Equal
                  rhs: 
                    {
                      (sh_array_literal
                        left: <Id.Op_LParen _>
                        words: [{($ Id.VSub_DollarName '$_Dbg_args')}]
                      )
                    }
                  spids: [94]
                )
              ]
            )
            (C {<typeset>} 
              {<Id.Lit_VarLike 'first='> 
                (braced_var_sub
                  token: <Id.VSub_Name a>
                  bracket_op: (bracket_op.ArrayIndex expr:{<Id.Lit_Digits 0>})
                )
              }
            )
            (command.If
              arms: [
                (if_arm
                  cond: 
                    (condition.Shell
                      commands: [
                        (command.Sentence
                          child: 
                            (command.DBracket
                              expr: 
                                (bool_expr.Binary
                                  op_id: Id.BoolBinary_GlobDEqual
                                  left: {($ Id.VSub_DollarName '$first')}
                                  right: {(SQ )}
                                )
                            )
                          terminator: <Id.Op_Semi _>
                        )
                      ]
                    )
                  action: [(C {<_Dbg_do_watch_internal>} {<0>})]
                  spids: [111 126]
                )
                (if_arm
                  cond: 
                    (condition.Shell
                      commands: [
                        (command.Sentence
                          child: 
                            (command.Pipeline
                              children: [(C {<_Dbg_defined>} {(DQ ($ Id.VSub_DollarName '$first'))})]
                              negated: T
                            )
                          terminator: <Id.Op_Semi _>
                        )
                      ]
                    )
                  action: [
                    (C {<_Dbg_errmsg>} 
                      {
                        (DQ <'Can\'t set watch: no such variable '> ($ Id.VSub_DollarName '$first') <.>)
                      }
                    )
                  ]
                  spids: [134 146]
                )
              ]
              else_action: [
                (C {<unset>} {<a>} {<first>})
                (C {<_Dbg_do_watch_internal>} {<0>} 
                  {
                    (DQ (word_part.EscapedLiteral token:<Id.Lit_EscapedChar '\\$'>) 
                      ($ Id.VSub_DollarName '$_Dbg_args')
                    )
                  }
                )
              ]
            )
            (command.ControlFlow
              token: <Id.ControlFlow_Return return>
              arg_word: {($ Id.VSub_QMark '$?')}
            )
          ]
        )
    )
    (C {<_Dbg_help_add>} {<watche>} {(SQ <'watche [EXP] -- Set or clear a watch expression.'>)})
    (C {<_Dbg_alias_add>} {<We>})
    (command.ShFunction
      name: _Dbg_do_watche
      body: 
        (BraceGroup
          children: [
            (C {<_Dbg_do_watch_internal>} {<1>} {(DQ ($ Id.VSub_DollarName '$_Dbg_args'))})
            (command.ControlFlow
              token: <Id.ControlFlow_Return return>
              arg_word: {($ Id.VSub_QMark '$?')}
            )
          ]
        )
    )
    (command.ShFunction
      name: _Dbg_do_watch_internal
      body: 
        (BraceGroup
          children: [
            (command.If
              arms: [
                (if_arm
                  cond: 
                    (condition.Shell
                      commands: [
                        (command.Sentence
                          child: 
                            (C {<Id.Lit_LBracket '['>} {<-z>} {(DQ ($ Id.VSub_Number '$2'))} 
                              {<Id.Lit_RBracket ']'>}
                            )
                          terminator: <Id.Op_Semi _>
                        )
                      ]
                    )
                  action: [(C {<_Dbg_clear_watch>})]
                  spids: [237 250]
                )
              ]
              else_action: [
                (C {<typeset>} {<-i>} 
                  {<Id.Lit_VarLike 'n='> <_Dbg_watch_max> <Id.Lit_Other '+'> <Id.Lit_Other '+'>}
                )
                (command.ShAssignment
                  pairs: [
                    (assign_pair
                      lhs: 
                        (sh_lhs_expr.IndexedName
                          name: _Dbg_watch_arith
                          index: {($ Id.VSub_DollarName '$n')}
                        )
                      op: assign_op.Equal
                      rhs: {(DQ ($ Id.VSub_Number '$1'))}
                      spids: [271]
                    )
                  ]
                )
                (C {<shift>})
                (command.ShAssignment
                  pairs: [
                    (assign_pair
                      lhs: 
                        (sh_lhs_expr.IndexedName
                          name: _Dbg_watch_exp
                          index: {($ Id.VSub_DollarName '$n')}
                        )
                      op: assign_op.Equal
                      rhs: {(DQ ($ Id.VSub_Number '$1'))}
                      spids: [284]
                    )
                  ]
                )
                (command.ShAssignment
                  pairs: [
                    (assign_pair
                      lhs: 
                        (sh_lhs_expr.IndexedName
                          name: _Dbg_watch_val
                          index: {($ Id.VSub_DollarName '$n')}
                        )
                      op: assign_op.Equal
                      rhs: 
                        {
                          (command_sub
                            left_token: <Id.Left_DollarParen '$('>
                            child: (C {<_Dbg_get_watch_exp_eval>} {($ Id.VSub_DollarName '$n')})
                          )
                        }
                      spids: [294]
                    )
                  ]
                )
                (command.ShAssignment
                  pairs: [
                    (assign_pair
                      lhs: 
                        (sh_lhs_expr.IndexedName
                          name: _Dbg_watch_enable
                          index: {($ Id.VSub_DollarName '$n')}
                        )
                      op: assign_op.Equal
                      rhs: {<1>}
                      spids: [306]
                    )
                  ]
                )
                (command.ShAssignment
                  pairs: [
                    (assign_pair
                      lhs: 
                        (sh_lhs_expr.IndexedName
                          name: _Dbg_watch_count
                          index: {($ Id.VSub_DollarName '$n')}
                        )
                      op: assign_op.Equal
                      rhs: {<0>}
                      spids: [314]
                    )
                  ]
                )
                (C {<_Dbg_printf>} {(SQ <'%2d: %s==%s arith: %d'>)} {($ Id.VSub_DollarName '$n')} 
                  {
                    (DQ <'('> 
                      (braced_var_sub
                        token: <Id.VSub_Name _Dbg_watch_exp>
                        bracket_op: (bracket_op.ArrayIndex expr:{($ Id.VSub_DollarName '$n')})
                      ) <')'>
                    )
                  } 
                  {
                    (braced_var_sub
                      token: <Id.VSub_Name _Dbg_watch_val>
                      bracket_op: (bracket_op.ArrayIndex expr:{($ Id.VSub_DollarName '$n')})
                    )
                  } 
                  {
                    (braced_var_sub
                      token: <Id.VSub_Name _Dbg_watch_arith>
                      bracket_op: (bracket_op.ArrayIndex expr:{($ Id.VSub_DollarName '$n')})
                    )
                  }
                )
              ]
            )
            (command.ControlFlow token:<Id.ControlFlow_Return return> arg_word:{<0>})
          ]
        )
    )
  ]
)