(command.CommandList
  children: [
    (C {<_Dbg_help_add>} {<history>} 
      {
        (DQ <'history [N]\n'> <'\n'> <'Rerun a debugger command from the debugger history. \n'> <'\n'> 
          <'See also H to list the history. If N is negative you are you going\n'> <'back that many items from the end rather specifying an absolute history number.'>
        )
      }
    )
    (command.ShFunction
      name: _Dbg_do_history
      body: 
        (BraceGroup
          children: [
            (C {<typeset>} {<-i>} {<history_num>})
            (C {<_Dbg_history_parse>} {($ Id.VSub_At '$@')})
            (C {<_Dbg_history_remove_item>})
            (command.If
              arms: [
                (if_arm
                  cond: 
                    (condition.Shell
                      commands: [
                        (command.Sentence
                          child: 
                            (command.DParen
                              child: 
                                (arith_expr.Binary
                                  op_id: Id.Arith_GreatEqual
                                  left: <Id.Lit_ArithVarLike history_num>
                                  right: {<Id.Lit_Digits 0>}
                                )
                            )
                          terminator: <Id.Op_Semi _>
                        )
                      ]
                    )
                  action: [
                    (command.If
                      arms: [
                        (if_arm
                          cond: 
                            (condition.Shell
                              commands: [
                                (command.Sentence
                                  child: 
                                    (command.DParen
                                      child: 
                                        (arith_expr.Binary
                                          op_id: Id.Arith_Less
                                          left: <Id.Lit_ArithVarLike history_num>
                                          right: 
                                            {
                                              (braced_var_sub
                                                token: <Id.VSub_Name _Dbg_history>
                                                prefix_op: (Id.VSub_Pound)
                                                bracket_op: (bracket_op.WholeArray op_id:Id.Lit_At)
                                              )
                                            }
                                        )
                                    )
                                  terminator: <Id.Op_Semi _>
                                )
                              ]
                            )
                          action: [
                            (C {<set>} 
                              {
                                (braced_var_sub
                                  token: <Id.VSub_Name _Dbg_history>
                                  bracket_op: 
                                    (bracket_op.ArrayIndex
                                      expr: {($ Id.VSub_DollarName '$history_num')}
                                    )
                                )
                              }
                            )
                            (command.ShAssignment
                              pairs: [
                                (assign_pair
                                  lhs: (sh_lhs_expr.Name name:_Dbg_cmd)
                                  op: assign_op.Equal
                                  rhs: {($ Id.VSub_Number '$1')}
                                  spids: [149]
                                )
                              ]
                            )
                            (C {<shift>})
                            (command.ShAssignment
                              pairs: [
                                (assign_pair
                                  lhs: (sh_lhs_expr.Name name:_Dbg_args)
                                  op: assign_op.Equal
                                  rhs: {(DQ ($ Id.VSub_At '$@'))}
                                  spids: [156]
                                )
                              ]
                            )
                            (command.Sentence
                              child: 
                                (command.ShAssignment
                                  pairs: [
                                    (assign_pair
                                      lhs: (sh_lhs_expr.Name name:_Dbg_redo)
                                      op: assign_op.Equal
                                      rhs: {<1>}
                                      spids: [162]
                                    )
                                  ]
                                )
                              terminator: <Id.Op_Semi _>
                            )
                          ]
                          spids: [114 135]
                        )
                      ]
                      else_action: [
                        (C {<_Dbg_errmsg>} 
                          {
                            (DQ <'Number '> ($ Id.VSub_Number '$1') <' ('> 
                              ($ Id.VSub_DollarName '$history_num') <') should be less than '> 
                              (braced_var_sub
                                token: <Id.VSub_Name _Dbg_history>
                                prefix_op: (Id.VSub_Pound)
                                bracket_op: (bracket_op.WholeArray op_id:Id.Lit_At)
                              )
                            )
                          }
                        )
                        (command.ControlFlow
                          token: <Id.ControlFlow_Return return>
                          arg_word: {<1>}
                        )
                      ]
                    )
                  ]
                  spids: [95 110]
                )
              ]
            )
            (command.ControlFlow token:<Id.ControlFlow_Return return> arg_word:{<0>})
          ]
        )
    )
    (command.ShFunction
      name: _Dbg_do_history_list
      body: 
        (BraceGroup
          children: [
            (C {<eval>} {(DQ ($ Id.VSub_DollarName '$_seteglob'))})
            (command.If
              arms: [
                (if_arm
                  cond: 
                    (condition.Shell
                      commands: [
                        (command.Sentence
                          child: 
                            (command.AndOr
                              ops: [Id.Op_DAmp Id.Op_DAmp]
                              children: [
                                (command.DBracket
                                  expr: 
                                    (bool_expr.Binary
                                      op_id: Id.BoolBinary_GlobNEqual
                                      left: {($ Id.VSub_Number '$1')}
                                      right: {($ Id.VSub_DollarName '$int_pat')}
                                    )
                                )
                                (command.DBracket
                                  expr: 
                                    (bool_expr.Binary
                                      op_id: Id.BoolBinary_GlobNEqual
                                      left: {($ Id.VSub_Number '$1')}
                                      right: {<-> ($ Id.VSub_DollarName '$int_pat')}
                                    )
                                )
                                (command.DBracket
                                  expr: 
                                    (bool_expr.Unary
                                      op_id: Id.BoolUnary_n
                                      child: {($ Id.VSub_Number '$1')}
                                    )
                                )
                              ]
                            )
                          terminator: <Id.Op_Semi _>
                        )
                      ]
                    )
                  action: [
                    (C {<_Dbg_msg>} {(DQ <'Invalid history number: '> ($ Id.VSub_Number '$1'))})
                    (C {<eval>} {(DQ ($ Id.VSub_DollarName '$_resteglob'))})
                    (command.ControlFlow
                      token: <Id.ControlFlow_Return return>
                      arg_word: {<1>}
                    )
                  ]
                  spids: [232 269]
                )
              ]
            )
            (C {<eval>} {(DQ ($ Id.VSub_DollarName '$_resteglob'))})
            (command.ShAssignment
              pairs: [
                (assign_pair
                  lhs: (sh_lhs_expr.Name name:_Dbg_hi)
                  op: assign_op.Equal
                  rhs: 
                    {
                      (braced_var_sub
                        token: <Id.VSub_Name _Dbg_history>
                        prefix_op: (Id.VSub_Pound)
                        bracket_op: (bracket_op.WholeArray op_id:Id.Lit_At)
                      )
                    }
                  spids: [304]
                )
              ]
            )
            (C {<local>} {<-i>} 
              {<Id.Lit_VarLike 'n='> 
                (braced_var_sub
                  token: <Id.VSub_Number 1>
                  suffix_op: 
                    (suffix_op.Unary
                      tok: <Id.VTest_ColonHyphen ':-'>
                      arg_word: {($ Id.VSub_DollarName '$_Dbg_hi') <-1>}
                    )
                )
              }
            )
            (C {<local>} {<-i>} 
              {<Id.Lit_VarLike 'stop='> 
                (braced_var_sub
                  token: <Id.VSub_Number 2>
                  suffix_op: (suffix_op.Slice begin:{<Id.Lit_Digits 0>})
                )
              }
            )
            (C {<local>} {<-i>} {<i>})
            (command.If
              arms: [
                (if_arm
                  cond: 
                    (condition.Shell
                      commands: [
                        (command.Sentence
                          child: 
                            (command.DParen
                              child: 
                                (arith_expr.Binary
                                  op_id: Id.Arith_Less
                                  left: <Id.Lit_ArithVarLike n>
                                  right: {<Id.Lit_Digits 0>}
                                )
                            )
                          terminator: <Id.Op_Semi _>
                        )
                      ]
                    )
                  action: [
                    (command.DParen
                      child: 
                        (arith_expr.BinaryAssign
                          op_id: Id.Arith_Equal
                          left: <Id.Lit_ArithVarLike stop>
                          right: 
                            (arith_expr.Binary
                              op_id: Id.Arith_Plus
                              left: <Id.Lit_ArithVarLike _Dbg_hi>
                              right: <Id.Lit_ArithVarLike n>
                            )
                        )
                    )
                    (command.DParen
                      child: 
                        (arith_expr.BinaryAssign
                          op_id: Id.Arith_Equal
                          left: <Id.Lit_ArithVarLike n>
                          right: 
                            (arith_expr.Binary
                              op_id: Id.Arith_Minus
                              left: <Id.Lit_ArithVarLike _Dbg_hi>
                              right: {<Id.Lit_Digits 1>}
                            )
                        )
                    )
                  ]
                  spids: [351 364]
                )
                (if_arm
                  cond: 
                    (condition.Shell
                      commands: [
                        (command.Sentence
                          child: 
                            (command.DParen
                              child: 
                                (arith_expr.Binary
                                  op_id: Id.Arith_Great
                                  left: <Id.Lit_ArithVarLike n>
                                  right: 
                                    (arith_expr.Binary
                                      op_id: Id.Arith_Minus
                                      left: <Id.Lit_ArithVarLike _Dbg_hi>
                                      right: {<Id.Lit_Digits 1>}
                                    )
                                )
                            )
                          terminator: <Id.Op_Semi _>
                        )
                      ]
                    )
                  action: [
                    (command.DParen
                      child: 
                        (arith_expr.BinaryAssign
                          op_id: Id.Arith_Equal
                          left: <Id.Lit_ArithVarLike n>
                          right: 
                            (arith_expr.Binary
                              op_id: Id.Arith_Minus
                              left: <Id.Lit_ArithVarLike _Dbg_hi>
                              right: {<Id.Lit_Digits 1>}
                            )
                        )
                    )
                  ]
                  spids: [387 404]
                )
              ]
            )
            (command.ForExpr
              init: 
                (arith_expr.BinaryAssign
                  op_id: Id.Arith_Equal
                  left: <Id.Lit_ArithVarLike i>
                  right: <Id.Lit_ArithVarLike n>
                )
              cond: 
                (arith_expr.Binary
                  op_id: Id.Arith_DAmp
                  left: 
                    (arith_expr.Binary
                      op_id: Id.Arith_GreatEqual
                      left: <Id.Lit_ArithVarLike i>
                      right: <Id.Lit_ArithVarLike stop>
                    )
                  right: 
                    (arith_expr.Binary
                      op_id: Id.Arith_GreatEqual
                      left: <Id.Lit_ArithVarLike i>
                      right: {<Id.Lit_Digits 0>}
                    )
                )
              update: (arith_expr.UnaryAssign op_id:Id.Node_PostDMinus child:<Id.Lit_ArithVarLike i>)
              body: 
                (command.DoGroup
                  children: [
                    (C {<_Dbg_msg>} 
                      {
                        (DQ (${ Id.VSub_Name i) <': '> 
                          (braced_var_sub
                            token: <Id.VSub_Name _Dbg_history>
                            bracket_op: (bracket_op.ArrayIndex expr:{($ Id.VSub_DollarName '$i')})
                          )
                        )
                      }
                    )
                  ]
                )
            )
            (command.ControlFlow token:<Id.ControlFlow_Return return> arg_word:{<0>})
          ]
        )
    )
    (C {<_Dbg_alias_add>} {(SQ <'!'>)} {(SQ <history>)})
  ]
)