(command.CommandList
  children: [
    (C {(_Dbg_help_add)} {(SQ (Token id:Id.Lit_Chars val:reverse span_id:61))} 
      {
        (SQ (Token id:Id.Lit_Chars val:'?search\n' span_id:66) 
          (Token id:Id.Lit_Chars val:'\n' span_id:67) (Token id:Id.Lit_Chars val:'Search backword and list line of a script.' span_id:68)
        )
      }
    )
    (command.ShFunction
      name: _Dbg_do_reverse
      body: 
        (command.BraceGroup
          children: [
            (C {(typeset)} {(Id.Lit_VarLike 'delim_search_pat=') ($ Id.VSub_Number '$1')})
            (command.If
              arms: [
                (if_arm
                  cond: [
                    (command.Sentence
                      child: 
                        (command.DParen
                          child: 
                            (arith_expr.Binary
                              op_id: Id.Arith_Less
                              left: (arith_expr.ArithWord w:{($ Id.VSub_Pound '$#')})
                              right: (arith_expr.ArithWord w:{(Id.Lit_Digits 1)})
                            )
                        )
                      terminator: (Token id:Id.Op_Semi val:';' span_id:99)
                    )
                  ]
                  action: [
                    (C {(_Dbg_errmsg)} {(DQ ('Need a search pattern'))})
                    (command.ControlFlow
                      token: (Token id:Id.ControlFlow_Return val:return span_id:111)
                      arg_word: {(1)}
                    )
                  ]
                  spids: [86 101]
                )
              ]
            )
            (C {(shift)})
            (command.Case
              to_match: {(DQ ($ Id.VSub_DollarName '$delim_search_pat'))}
              arms: [
                (case_arm
                  pat_list: [{(Id.Lit_LBracket '[') (Id.Lit_QMark '?') (Id.Lit_RBracket ']')}]
                  spids: [132 136 139 -1]
                )
                (case_arm
                  pat_list: [
                    {(Id.Lit_LBracket '[') (Id.Lit_QMark '?') (Id.Lit_RBracket ']') (Id.Lit_Star '*')}
                  ]
                  action: [
                    (C {(typeset)} {(-a)} {(word)})
                    (command.ShAssignment
                      pairs: [
                        (assign_pair
                          lhs: (sh_lhs_expr.Name name:word)
                          op: assign_op.Equal
                          rhs: 
                            {
                              (sh_array_literal
                                left: (Token id:Id.Op_LParen val:'(' span_id:158)
                                words: [
                                  {
                                    (command_sub
                                      left_token: (Token id:Id.Left_DollarParen val:'$(' span_id:159)
                                      command_list: 
                                        (command.CommandList
                                          children: [
                                            (C {(_Dbg_split)} 
                                              {(SQ (Token id:Id.Lit_Chars val:'?' span_id:163))} {($ Id.VSub_DollarName '$delim_search_pat')}
                                            )
                                          ]
                                        )
                                    )
                                  }
                                ]
                              )
                            }
                          spids: [157]
                        )
                      ]
                    )
                    (command.ShAssignment
                      pairs: [
                        (assign_pair
                          lhs: (sh_lhs_expr.Name name:_Dbg_last_search_pat)
                          op: assign_op.Equal
                          rhs: 
                            {
                              (braced_var_sub
                                token: (Token id:Id.VSub_Name val:word span_id:173)
                                bracket_op: 
                                  (bracket_op.ArrayIndex
                                    expr: (arith_expr.ArithWord w:{(Id.Lit_Digits 0)})
                                  )
                              )
                            }
                          spids: [171]
                        )
                      ]
                    )
                  ]
                  spids: [142 147 180 -1]
                )
                (case_arm
                  pat_list: [{(Id.Lit_Star '*')}]
                  action: [
                    (command.ShAssignment
                      pairs: [
                        (assign_pair
                          lhs: (sh_lhs_expr.Name name:_Dbg_last_search_pat)
                          op: assign_op.Equal
                          rhs: {($ Id.VSub_DollarName '$delim_search_pat')}
                          spids: [192]
                        )
                      ]
                    )
                  ]
                  spids: [187 189 -1 196]
                )
              ]
            )
            (C {(typeset)} {(-i)} {(i)})
            (command.ForExpr
              init: 
                (arith_expr.BinaryAssign
                  op_id: Id.Arith_Equal
                  left: (sh_lhs_expr.Name name:i)
                  right: 
                    (arith_expr.Binary
                      op_id: Id.Arith_Minus
                      left: 
                        (arith_expr.VarRef
                          token: (Token id:Id.Lit_ArithVarLike val:_Dbg_listline span_id:212)
                        )
                      right: (arith_expr.ArithWord w:{(Id.Lit_Digits 1)})
                    )
                )
              cond: 
                (arith_expr.Binary
                  op_id: Id.Arith_Great
                  left: (arith_expr.VarRef token:(Token id:Id.Lit_ArithVarLike val:i span_id:217))
                  right: (arith_expr.ArithWord w:{(Id.Lit_Digits 0)})
                )
              update: 
                (arith_expr.UnaryAssign
                  op_id: Id.Node_PostDMinus
                  child: (sh_lhs_expr.Name name:i)
                )
              body: 
                (command.DoGroup
                  children: [
                    (C {(_Dbg_get_source_line)} {($ Id.VSub_DollarName '$i')} 
                      {(DQ ($ Id.VSub_DollarName '$_Dbg_frame_last_filename'))}
                    )
                    (C {(eval)} {(DQ ($ Id.VSub_DollarName '$_seteglob'))})
                    (command.If
                      arms: [
                        (if_arm
                          cond: [
                            (command.Sentence
                              child: 
                                (command.DBracket
                                  expr: 
                                    (bool_expr.Binary
                                      op_id: Id.BoolBinary_GlobDEqual
                                      left: {($ Id.VSub_DollarName '$_Dbg_source_line')}
                                      right: 
                                        {(Id.Lit_Other '*') 
                                          ($ Id.VSub_DollarName '$_Dbg_last_search_pat') (Id.Lit_Other '*')
                                        }
                                    )
                                )
                              terminator: (Token id:Id.Op_Semi val:';' span_id:266)
                            )
                          ]
                          action: [
                            (C {(eval)} {(DQ ($ Id.VSub_DollarName '$_resteglob'))})
                            (C {(_Dbg_do_list)} {($ Id.VSub_DollarName '$i')} {(1)})
                            (command.ShAssignment
                              pairs: [
                                (assign_pair
                                  lhs: (sh_lhs_expr.Name name:_Dbg_listline)
                                  op: assign_op.Equal
                                  rhs: {($ Id.VSub_DollarName '$i')}
                                  spids: [285]
                                )
                              ]
                            )
                            (command.ShAssignment
                              pairs: [
                                (assign_pair
                                  lhs: (sh_lhs_expr.Name name:_Dbg_last_cmd)
                                  op: assign_op.Equal
                                  rhs: {(SQ (Token id:Id.Lit_Chars val:search span_id:291))}
                                  spids: [289]
                                )
                              ]
                            )
                            (command.ControlFlow
                              token: (Token id:Id.ControlFlow_Return val:return span_id:295)
                              arg_word: {(0)}
                            )
                          ]
                          spids: [252 268]
                        )
                      ]
                    )
                    (C {(eval)} {(DQ ($ Id.VSub_DollarName '$_resteglob'))})
                  ]
                )
            )
            (C {(_Dbg_msg)} 
              {
                (DQ ('search pattern: ') ($ Id.VSub_DollarName '$_Dbg_last_search_pat') (' not found.'))
              }
            )
            (command.ControlFlow
              token: (Token id:Id.ControlFlow_Return val:return span_id:322)
              arg_word: {(1)}
            )
          ]
        )
    )
    (C {(_Dbg_help_add)} {(SQ (Token id:Id.Lit_Chars val:search span_id:333))} 
      {
        (SQ 
          (Token
            id: Id.Lit_Chars
            val: '/search/ -- Search forward and list line of a script.'
            span_id: 338
          )
        )
      }
    )
    (command.ShFunction
      name: _Dbg_do_search
      body: 
        (command.BraceGroup
          children: [
            (C {(typeset)} {(Id.Lit_VarLike 'delim_search_pat=') (${ Id.VSub_Number 1)})
            (command.If
              arms: [
                (if_arm
                  cond: [
                    (command.Sentence
                      child: 
                        (command.DParen
                          child: 
                            (arith_expr.Binary
                              op_id: Id.Arith_Less
                              left: (arith_expr.ArithWord w:{($ Id.VSub_Pound '$#')})
                              right: (arith_expr.ArithWord w:{(Id.Lit_Digits 1)})
                            )
                        )
                      terminator: (Token id:Id.Op_Semi val:';' span_id:374)
                    )
                  ]
                  action: [
                    (C {(_Dbg_errmsg)} {(DQ ('Need a search pattern'))})
                    (command.ControlFlow
                      token: (Token id:Id.ControlFlow_Return val:return span_id:386)
                      arg_word: {(1)}
                    )
                  ]
                  spids: [361 376]
                )
              ]
            )
            (C {(shift)})
            (C {(typeset)} {(search_pat)})
            (command.Case
              to_match: {(DQ ($ Id.VSub_DollarName '$delim_search_pat'))}
              arms: [
                (case_arm pat_list:[{(/)}] spids:[411 413 416 -1])
                (case_arm
                  pat_list: [{(/) (Id.Lit_Star '*')}]
                  action: [
                    (C {(typeset)} {(-a)} {(word)})
                    (command.ShAssignment
                      pairs: [
                        (assign_pair
                          lhs: (sh_lhs_expr.Name name:word)
                          op: assign_op.Equal
                          rhs: 
                            {
                              (sh_array_literal
                                left: (Token id:Id.Op_LParen val:'(' span_id:433)
                                words: [
                                  {
                                    (command_sub
                                      left_token: (Token id:Id.Left_DollarParen val:'$(' span_id:434)
                                      command_list: 
                                        (command.CommandList
                                          children: [
                                            (C {(_Dbg_split)} 
                                              {(SQ (Token id:Id.Lit_Chars val:/ span_id:438))} {($ Id.VSub_DollarName '$delim_search_pat')}
                                            )
                                          ]
                                        )
                                    )
                                  }
                                ]
                              )
                            }
                          spids: [432]
                        )
                      ]
                    )
                    (command.ShAssignment
                      pairs: [
                        (assign_pair
                          lhs: (sh_lhs_expr.Name name:_Dbg_last_search_pat)
                          op: assign_op.Equal
                          rhs: 
                            {
                              (braced_var_sub
                                token: (Token id:Id.VSub_Name val:word span_id:448)
                                bracket_op: 
                                  (bracket_op.ArrayIndex
                                    expr: (arith_expr.ArithWord w:{(Id.Lit_Digits 0)})
                                  )
                              )
                            }
                          spids: [446]
                        )
                      ]
                    )
                  ]
                  spids: [419 422 455 -1]
                )
                (case_arm
                  pat_list: [{(Id.Lit_Star '*')}]
                  action: [
                    (command.ShAssignment
                      pairs: [
                        (assign_pair
                          lhs: (sh_lhs_expr.Name name:_Dbg_last_search_pat)
                          op: assign_op.Equal
                          rhs: {($ Id.VSub_DollarName '$delim_search_pat')}
                          spids: [463]
                        )
                      ]
                    )
                  ]
                  spids: [458 460 -1 467]
                )
              ]
            )
            (C {(typeset)} {(max_line)})
            (command.ShAssignment
              pairs: [
                (assign_pair
                  lhs: (sh_lhs_expr.Name name:max_line)
                  op: assign_op.Equal
                  rhs: 
                    {
                      (command_sub
                        left_token: (Token id:Id.Left_DollarParen val:'$(' span_id:477)
                        command_list: 
                          (command.CommandList
                            children: [
                              (C {(_Dbg_get_maxline)} 
                                {(DQ ($ Id.VSub_DollarName '$_Dbg_frame_last_filename'))}
                              )
                            ]
                          )
                      )
                    }
                  spids: [476]
                )
              ]
            )
            (C {(typeset)} {(-i)} {(i)})
            (command.ForExpr
              init: 
                (arith_expr.BinaryAssign
                  op_id: Id.Arith_Equal
                  left: (sh_lhs_expr.Name name:i)
                  right: 
                    (arith_expr.Binary
                      op_id: Id.Arith_Plus
                      left: 
                        (arith_expr.VarRef
                          token: (Token id:Id.Lit_ArithVarLike val:_Dbg_listline span_id:500)
                        )
                      right: (arith_expr.ArithWord w:{(Id.Lit_Digits 1)})
                    )
                )
              cond: 
                (arith_expr.Binary
                  op_id: Id.Arith_Less
                  left: (arith_expr.VarRef token:(Token id:Id.Lit_ArithVarLike val:i span_id:505))
                  right: 
                    (arith_expr.VarRef
                      token: (Token id:Id.Lit_ArithVarLike val:max_line span_id:509)
                    )
                )
              update: (arith_expr.UnaryAssign op_id:Id.Node_PostDPlus child:(sh_lhs_expr.Name name:i))
              body: 
                (command.DoGroup
                  children: [
                    (C {(_Dbg_get_source_line)} {($ Id.VSub_DollarName '$i')} 
                      {(DQ ($ Id.VSub_DollarName '$_Dbg_frame_last_filename'))}
                    )
                    (C {(eval)} {(DQ ($ Id.VSub_DollarName '$_seteglob'))})
                    (command.If
                      arms: [
                        (if_arm
                          cond: [
                            (command.Sentence
                              child: 
                                (command.DBracket
                                  expr: 
                                    (bool_expr.Binary
                                      op_id: Id.BoolBinary_GlobDEqual
                                      left: {($ Id.VSub_DollarName '$_Dbg_source_line')}
                                      right: 
                                        {(Id.Lit_Other '*') 
                                          ($ Id.VSub_DollarName '$_Dbg_last_search_pat') (Id.Lit_Other '*')
                                        }
                                    )
                                )
                              terminator: (Token id:Id.Op_Semi val:';' span_id:554)
                            )
                          ]
                          action: [
                            (C {(eval)} {(DQ ($ Id.VSub_DollarName '$_resteglob'))})
                            (C {(_Dbg_do_list)} {($ Id.VSub_DollarName '$i')} {(1)})
                            (command.ShAssignment
                              pairs: [
                                (assign_pair
                                  lhs: (sh_lhs_expr.Name name:_Dbg_listline)
                                  op: assign_op.Equal
                                  rhs: {($ Id.VSub_DollarName '$i')}
                                  spids: [573]
                                )
                              ]
                            )
                            (command.ControlFlow
                              token: (Token id:Id.ControlFlow_Return val:return span_id:581)
                              arg_word: {(0)}
                            )
                          ]
                          spids: [540 556]
                        )
                      ]
                    )
                    (C {(eval)} {(DQ ($ Id.VSub_DollarName '$_resteglob'))})
                  ]
                )
            )
            (C {(_Dbg_errmsg)} 
              {
                (DQ ('search pattern: ') ($ Id.VSub_DollarName '$_Dbg_last_search_pat') (' not found.'))
              }
            )
            (command.ControlFlow
              token: (Token id:Id.ControlFlow_Return val:return span_id:608)
              arg_word: {(1)}
            )
          ]
        )
    )
  ]
)