(command.CommandList
  children: [
    (C {(typeset)} {(-a)} {(_Dbg_dir)})
    (command.ShAssignment
      pairs: [
        (assign_pair
          lhs: (sh_lhs_expr.Name name:_Dbg_dir)
          op: Equal
          rhs: {(sh_array_literal left:<Op_LParen '('> words:[{(SQ <'\\$cdir'>)} {(SQ <'\\$cwd'>)}])}
        )
      ]
    )
    (command.AndOr
      ops: [Op_DAmp]
      children: [
        (command.DBracket
          expr: (bool_expr.Unary op_id:BoolUnary_z child:{(${ VSub_Name _Dbg_cdir)})
        )
        (C {(typeset)} 
          {(Lit_VarLike '_Dbg_cdir=') 
            (braced_var_sub
              token: <VSub_Name _Dbg_source_file>
              suffix_op: (suffix_op.Unary op_id:VOp1_Percent arg_word:{(Lit_Slash /) ('*')})
            )
          }
        )
      ]
    )
    (command.AndOr
      ops: [Op_DAmp]
      children: [
        (command.DBracket
          expr: (bool_expr.Unary op_id:BoolUnary_z child:{(${ VSub_Name _Dbg_cdir)})
        )
        (C {(typeset)} 
          {(Lit_VarLike '_Dbg_cdir=') 
            (command_sub
              left_token: <Left_DollarParen '$('>
              command_list: (command.CommandList children:[(C {(pwd)})])
            )
          }
        )
      ]
    )
    (command.ShFunction
      name: _Dbg_adjust_filename
      body: 
        (command.BraceGroup
          children: [
            (C {(typeset)} {(-r)} {(Lit_VarLike 'filename=') (DQ ($ VSub_Number '$1'))})
            (command.If
              arms: [
                (if_arm
                  cond: [
                    (command.Sentence
                      child: 
                        (command.DParen
                          child: 
                            (arith_expr.Binary
                              op_id: Arith_DEqual
                              left: (arith_expr.VarRef token:<Lit_ArithVarLike _Dbg_set_annotate>)
                              right: (arith_expr.ArithWord w:{(Lit_Digits 1)})
                            )
                        )
                      terminator: <Op_Semi ';'>
                    )
                  ]
                  action: [
                    (C {(echo)} 
                      {
                        (command_sub
                          left_token: <Left_DollarParen '$('>
                          command_list: 
                            (command.CommandList
                              children: [
                                (C {(_Dbg_resolve_expand_filename)} {($ VSub_DollarName '$filename')})
                              ]
                            )
                        )
                      }
                    )
                  ]
                )
                (if_arm
                  cond: [
                    (command.Sentence
                      child: 
                        (command.DParen
                          child: (arith_expr.VarRef token:<Lit_ArithVarLike _Dbg_set_basename>)
                        )
                      terminator: <Op_Semi ';'>
                    )
                  ]
                  action: [
                    (C {(echo)} 
                      {
                        (braced_var_sub
                          token: <VSub_Name filename>
                          suffix_op: (suffix_op.Unary op_id:VOp1_DPound arg_word:{('*') (Lit_Slash /)})
                        )
                      }
                    )
                  ]
                )
              ]
              else_action: [(C {(echo)} {($ VSub_DollarName '$filename')})]
            )
          ]
        )
    )
    (command.ShFunction
      name: _Dbg_file_canonic
      body: 
        (command.BraceGroup
          children: [
            (command.If
              arms: [
                (if_arm
                  cond: [
                    (command.Sentence
                      child: 
                        (command.DParen
                          child: 
                            (arith_expr.Binary
                              op_id: Arith_NEqual
                              left: (arith_expr.ArithWord w:{($ VSub_Pound '$#')})
                              right: (arith_expr.ArithWord w:{(Lit_Digits 1)})
                            )
                        )
                      terminator: <Op_Semi ';'>
                    )
                  ]
                  action: [
                    (C {(echo)} {(SQ <'??'>)})
                    (command.ControlFlow
                      token: <ControlFlow_Return return>
                      arg_word: {(1)}
                    )
                  ]
                )
              ]
            )
            (C {(typeset)} {(Lit_VarLike 'filename=') (DQ ($ VSub_Number '$1'))})
            (command.AndOr
              ops: [Op_DAmp]
              children: [
                (command.DParen
                  child: (arith_expr.VarRef token:<Lit_ArithVarLike _Dbg_set_basename>)
                )
                (command.ShAssignment
                  pairs: [
                    (assign_pair
                      lhs: (sh_lhs_expr.Name name:filename)
                      op: Equal
                      rhs: 
                        {
                          (braced_var_sub
                            token: <VSub_Name filename>
                            suffix_op: 
                              (suffix_op.Unary
                                op_id: VOp1_DPound
                                arg_word: {('*') (Lit_Slash /)}
                              )
                          )
                        }
                    )
                  ]
                )
              ]
            )
            (C {(echo)} {($ VSub_DollarName '$filename')})
            (command.ControlFlow token:<ControlFlow_Return return> arg_word:{(0)})
          ]
        )
    )
    (command.ShFunction
      name: _Dbg_tilde_expand_filename
      body: 
        (command.BraceGroup
          children: [
            (C {(typeset)} 
              {(Lit_VarLike 'cmd=') 
                (DQ ('filename=') (word_part.EscapedLiteral token:<Lit_EscapedChar '\\$'>) 
                  ('(builtin echo ') ($ VSub_Number '$1') (')')
                )
              }
            )
            (C {(eval)} {($ VSub_DollarName '$cmd')})
            (command.DBracket
              expr: (bool_expr.Unary op_id:BoolUnary_r child:{($ VSub_DollarName '$filename')})
            )
          ]
        )
    )
    (command.ShFunction
      name: _Dbg_resolve_expand_filename
      body: 
        (command.BraceGroup
          children: [
            (command.If
              arms: [
                (if_arm
                  cond: [
                    (command.Sentence
                      child: 
                        (command.DParen
                          child: 
                            (arith_expr.Binary
                              op_id: Arith_DEqual
                              left: (arith_expr.ArithWord w:{($ VSub_Pound '$#')})
                              right: (arith_expr.ArithWord w:{(Lit_Digits 0)})
                            )
                        )
                      terminator: <Op_Semi ';'>
                    )
                  ]
                  action: [
                    (C {(_Dbg_errmsg)} 
                      {
                        (DQ 
                          ('Internal debug error _Dbg_resolve_expand_filename(): null file to find')
                        )
                      }
                    )
                    (C {(echo)} {(SQ )})
                    (command.ControlFlow
                      token: <ControlFlow_Return return>
                      arg_word: {(1)}
                    )
                  ]
                )
              ]
            )
            (C {(typeset)} {(Lit_VarLike 'find_file=') (DQ ($ VSub_Number '$1'))})
            (C {(typeset)} {(found_file)})
            (command.ShAssignment
              pairs: [
                (assign_pair
                  lhs: (sh_lhs_expr.Name name:found_file)
                  op: Equal
                  rhs: 
                    {
                      (DQ 
                        (braced_var_sub
                          token: <VSub_Name _Dbg_file2canonic>
                          bracket_op: 
                            (bracket_op.ArrayIndex
                              expr: (arith_expr.ArithWord w:{($ VSub_DollarName '$find_file')})
                            )
                        )
                      )
                    }
                )
              ]
            )
            (command.If
              arms: [
                (if_arm
                  cond: [
                    (command.Sentence
                      child: 
                        (command.DBracket
                          expr: 
                            (bool_expr.Unary
                              op_id: BoolUnary_n
                              child: {($ VSub_DollarName '$found_file')}
                            )
                        )
                      terminator: <Op_Semi ';'>
                    )
                  ]
                  action: [
                    (C {(echo)} {(DQ ($ VSub_DollarName '$found_file'))})
                    (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 find_file>
                                    suffix_op: 
                                      (suffix_op.Slice
                                        begin: (arith_expr.ArithWord w:{(Lit_Digits 0)})
                                        length: (arith_expr.ArithWord w:{(Lit_Digits 1)})
                                      )
                                  )
                                }
                              right: {(SQ </>)}
                            )
                        )
                      terminator: <Op_Semi ';'>
                    )
                  ]
                  action: [
                    (command.ShAssignment
                      pairs: [
                        (assign_pair
                          lhs: (sh_lhs_expr.Name name:full_find_file)
                          op: Equal
                          rhs: 
                            {
                              (command_sub
                                left_token: <Left_DollarParen '$('>
                                command_list: 
                                  (command.CommandList
                                    children: [
                                      (C {(_Dbg_expand_filename)} 
                                        {(DQ ($ VSub_DollarName '$find_file'))}
                                      )
                                    ]
                                  )
                              )
                            }
                        )
                      ]
                    )
                    (C {(echo)} {(DQ ($ VSub_DollarName '$full_find_file'))})
                    (command.ControlFlow
                      token: <ControlFlow_Return return>
                      arg_word: {(0)}
                    )
                  ]
                )
                (if_arm
                  cond: [
                    (command.Sentence
                      child: 
                        (command.DBracket
                          expr: 
                            (bool_expr.Binary
                              op_id: BoolBinary_GlobDEqual
                              left: 
                                {
                                  (braced_var_sub
                                    token: <VSub_Name find_file>
                                    suffix_op: 
                                      (suffix_op.Slice
                                        begin: (arith_expr.ArithWord w:{(Lit_Digits 0)})
                                        length: (arith_expr.ArithWord w:{(Lit_Digits 1)})
                                      )
                                  )
                                }
                              right: {(SQ <.>)}
                            )
                        )
                      terminator: <Op_Semi ';'>
                    )
                  ]
                  action: [
                    (command.ShAssignment
                      pairs: [
                        (assign_pair
                          lhs: (sh_lhs_expr.Name name:full_find_file)
                          op: Equal
                          rhs: 
                            {
                              (command_sub
                                left_token: <Left_DollarParen '$('>
                                command_list: 
                                  (command.CommandList
                                    children: [
                                      (C {(_Dbg_expand_filename)} 
                                        {
                                          (DQ (${ VSub_Name _Dbg_init_cwd) (/) 
                                            ($ VSub_DollarName '$find_file')
                                          )
                                        }
                                      )
                                    ]
                                  )
                              )
                            }
                        )
                      ]
                    )
                    (command.If
                      arms: [
                        (if_arm
                          cond: [
                            (command.Sentence
                              child: 
                                (command.AndOr
                                  ops: [Op_DPipe]
                                  children: [
                                    (command.DBracket
                                      expr: 
                                        (bool_expr.Unary
                                          op_id: BoolUnary_z
                                          child: {(DQ ($ VSub_DollarName '$full_find_file'))}
                                        )
                                    )
                                    (command.DBracket
                                      expr: 
                                        (bool_expr.LogicalNot
                                          child: 
                                            (bool_expr.Unary
                                              op_id: BoolUnary_r
                                              child: {($ VSub_DollarName '$full_find_file')}
                                            )
                                        )
                                    )
                                  ]
                                )
                              terminator: <Op_Semi ';'>
                            )
                          ]
                          action: [
                            (command.ShAssignment
                              pairs: [
                                (assign_pair
                                  lhs: (sh_lhs_expr.Name name:full_find_file)
                                  op: Equal
                                  rhs: 
                                    {
                                      (command_sub
                                        left_token: <Left_DollarParen '$('>
                                        command_list: 
                                          (command.CommandList
                                            children: [
                                              (C {(_Dbg_expand_filename)} 
                                                {(DQ ($ VSub_DollarName '$find_file'))}
                                              )
                                            ]
                                          )
                                      )
                                    }
                                )
                              ]
                            )
                          ]
                        )
                      ]
                    )
                    (C {(echo)} {(DQ ($ VSub_DollarName '$full_find_file'))})
                    (command.ControlFlow
                      token: <ControlFlow_Return return>
                      arg_word: {(0)}
                    )
                  ]
                )
              ]
              else_action: [
                (C {(typeset)} {(-i)} 
                  {(Lit_VarLike 'n=') 
                    (braced_var_sub
                      token: <VSub_Name _Dbg_dir>
                      prefix_op: VSub_Pound
                      bracket_op: (bracket_op.WholeArray op_id:Lit_At)
                    )
                  }
                )
                (C {(typeset)} {(-i)} {(i)})
                (command.ForExpr
                  init: 
                    (arith_expr.BinaryAssign
                      op_id: Arith_Equal
                      left: (sh_lhs_expr.Name name:i)
                      right: (arith_expr.ArithWord w:{(Lit_Digits 0)})
                    )
                  cond: 
                    (arith_expr.Binary
                      op_id: Arith_Less
                      left: (arith_expr.VarRef token:<Lit_ArithVarLike i>)
                      right: (arith_expr.VarRef token:<Lit_ArithVarLike n>)
                    )
                  update: 
                    (arith_expr.UnaryAssign
                      op_id: Node_PostDPlus
                      child: (sh_lhs_expr.Name name:i)
                    )
                  body: 
                    (command.DoGroup
                      children: [
                        (C {(typeset)} 
                          {(Lit_VarLike 'basename=') 
                            (DQ 
                              (braced_var_sub
                                token: <VSub_Name _Dbg_dir>
                                bracket_op: 
                                  (bracket_op.ArrayIndex
                                    expr: (arith_expr.VarRef token:<Lit_ArithVarLike i>)
                                  )
                              )
                            )
                          }
                        )
                        (command.If
                          arms: [
                            (if_arm
                              cond: [
                                (command.Sentence
                                  child: 
                                    (command.DBracket
                                      expr: 
                                        (bool_expr.Binary
                                          op_id: BoolBinary_GlobDEqual
                                          left: {($ VSub_DollarName '$basename')}
                                          right: {(SQ <'\\$cdir'>)}
                                        )
                                    )
                                  terminator: <Op_Semi ';'>
                                )
                              ]
                              action: [
                                (command.ShAssignment
                                  pairs: [
                                    (assign_pair
                                      lhs: (sh_lhs_expr.Name name:basename)
                                      op: Equal
                                      rhs: {($ VSub_DollarName '$_Dbg_cdir')}
                                    )
                                  ]
                                )
                              ]
                            )
                            (if_arm
                              cond: [
                                (command.Sentence
                                  child: 
                                    (command.DBracket
                                      expr: 
                                        (bool_expr.Binary
                                          op_id: BoolBinary_GlobDEqual
                                          left: {($ VSub_DollarName '$basename')}
                                          right: {(SQ <'\\$cwd'>)}
                                        )
                                    )
                                  terminator: <Op_Semi ';'>
                                )
                              ]
                              action: [
                                (command.ShAssignment
                                  pairs: [
                                    (assign_pair
                                      lhs: (sh_lhs_expr.Name name:basename)
                                      op: Equal
                                      rhs: 
                                        {
                                          (command_sub
                                            left_token: <Left_DollarParen '$('>
                                            command_list: 
                                              (command.CommandList
                                                children: [(C {(pwd)})]
                                              )
                                          )
                                        }
                                    )
                                  ]
                                )
                              ]
                            )
                          ]
                        )
                        (command.If
                          arms: [
                            (if_arm
                              cond: [
                                (command.Sentence
                                  child: 
                                    (command.DBracket
                                      expr: 
                                        (bool_expr.Unary
                                          op_id: BoolUnary_f
                                          child: 
                                            {
                                              (DQ ($ VSub_DollarName '$basename') (/) 
                                                ($ VSub_DollarName '$find_file')
                                              )
                                            }
                                        )
                                    )
                                  terminator: <Op_Semi ';'>
                                )
                              ]
                              action: [
                                (C {(echo)} 
                                  {
                                    (DQ ($ VSub_DollarName '$basename') (/) 
                                      ($ VSub_DollarName '$find_file')
                                    )
                                  }
                                )
                                (command.ControlFlow
                                  token: <ControlFlow_Return return>
                                  arg_word: {(0)}
                                )
                              ]
                            )
                          ]
                        )
                      ]
                    )
                )
              ]
            )
            (C {(echo)} {(SQ )})
            (command.ControlFlow token:<ControlFlow_Return return> arg_word:{(1)})
          ]
        )
    )
  ]
)