(command.CommandList
  children: [
    (command.If
      arms: [
        (if_arm
          cond: [
            (command.Sentence
              child: 
                (command.DBracket
                  expr: 
                    (bool_expr.Unary
                      op_id: Id.BoolUnary_z
                      child: 
                        {
                          (DQ 
                            (braced_var_sub
                              token: (Token id:Id.VSub_Name val:BASH_SOURCE span_id:70)
                              bracket_op: 
                                (bracket_op.ArrayIndex
                                  expr: (arith_expr.ArithWord w:{(Id.Lit_Digits 0)})
                                )
                            )
                          )
                        }
                    )
                )
              terminator: (Token id:Id.Op_Semi val:';' span_id:79)
            )
          ]
          action: [
            (command.Simple
              words: [{(echo)} {(DQ ('Sorry, you need to use a debugger-enabled version of bash.'))}]
              redirects: [
                (redir.Redir
                  op: (Token id:Id.Redir_GreatAnd val:'2>&' span_id:91)
                  fd: 2
                  arg_word: {(1)}
                )
              ]
            )
            (command.ControlFlow
              token: (Token id:Id.ControlFlow_Exit val:exit span_id:95)
              arg_word: {(2)}
            )
          ]
          spids: [62 81]
        )
      ]
    )
    (command.ForEach
      iter_name: _Dbg_file
      iter_words: [{(require)} {(pre)} {(vars)} {(io)}]
      do_arg_iter: F
      body: 
        (command.DoGroup
          children: [
            (C {(source)} {(${ Id.VSub_Name _Dbg_libdir) (/init/) (${ Id.VSub_Name _Dbg_file) (.sh)})
          ]
        )
    )
    (command.ForEach
      iter_name: _Dbg_file
      iter_words: [
        {(${ Id.VSub_Name _Dbg_libdir) (/lib/) (Id.Lit_Star '*') (.sh)}
        {(${ Id.VSub_Name _Dbg_libdir) (/command/) (Id.Lit_Star '*') (.sh)}
      ]
      do_arg_iter: F
      body: (command.DoGroup children:[(C {(source)} {($ Id.VSub_DollarName '$_Dbg_file')})])
    )
    (command.If
      arms: [
        (if_arm
          cond: [
            (command.Sentence
              child: (command.DBracket expr:(bool_expr.Unary op_id:Id.BoolUnary_r child:{(/dev/stdin)}))
              terminator: (Token id:Id.Op_Semi val:';' span_id:185)
            )
          ]
          action: [(C {(_Dbg_do_source)} {(/dev/stdin)})]
          spids: [175 187]
        )
        (if_arm
          cond: [
            (command.Sentence
              child: 
                (command.DBracket
                  expr: 
                    (bool_expr.Binary
                      op_id: Id.BoolBinary_GlobNEqual
                      left: 
                        {
                          (command_sub
                            left_token: (Token id:Id.Left_DollarParen val:'$(' span_id:198)
                            command_list: (command.CommandList children:[(C {(tty)})])
                          )
                        }
                      right: {(SQ (Token id:Id.Lit_Chars val:'not a tty' span_id:205))}
                    )
                )
              terminator: (Token id:Id.Op_Semi val:';' span_id:210)
            )
          ]
          action: [
            (C {(_Dbg_do_source)} 
              {
                (command_sub
                  left_token: (Token id:Id.Left_DollarParen val:'$(' span_id:217)
                  command_list: (command.CommandList children:[(C {(tty)})])
                )
              }
            )
          ]
          spids: [194 212]
        )
      ]
    )
    (C {(typeset)} {(-a)} {(_Dbg_input)})
    (command.If
      arms: [
        (if_arm
          cond: [
            (command.Sentence
              child: 
                (command.DBracket
                  expr: 
                    (bool_expr.Unary
                      op_id: Id.BoolUnary_n
                      child: {(DQ ($ Id.VSub_DollarName '$DBG_INPUT'))}
                    )
                )
              terminator: (Token id:Id.Op_Semi val:';' span_id:258)
            )
          ]
          action: [
            (command.ShAssignment
              pairs: [
                (assign_pair
                  lhs: (sh_lhs_expr.Name name:_Dbg_input)
                  op: assign_op.Equal
                  rhs: 
                    {
                      (sh_array_literal
                        left: (Token id:Id.Op_LParen val:'(' span_id:265)
                        words: [{(DQ ($ Id.VSub_DollarName '$DBG_INPUT'))}]
                      )
                    }
                  spids: [264]
                )
              ]
            )
            (C {(_Dbg_do_source)} 
              {
                (DQ 
                  (braced_var_sub
                    token: (Token id:Id.VSub_Name val:_Dbg_input span_id:276)
                    bracket_op: 
                      (bracket_op.ArrayIndex
                        expr: (arith_expr.ArithWord w:{(Id.Lit_Digits 0)})
                      )
                  )
                )
              }
            )
            (command.ShAssignment
              pairs: [
                (assign_pair
                  lhs: (sh_lhs_expr.Name name:_Dbg_no_nx)
                  op: assign_op.Equal
                  rhs: {(1)}
                  spids: [284]
                )
              ]
            )
          ]
          spids: [246 260]
        )
      ]
    )
    (C {(typeset)} 
      {(Id.Lit_VarLike '_Dbg_startup_cmdfile=') 
        (braced_var_sub
          token: (Token id:Id.VSub_Name val:HOME span_id:294)
          suffix_op: (suffix_op.Unary op_id:Id.VTest_ColonHyphen arg_word:{('~')})
        ) (/.) (${ Id.VSub_Name _Dbg_debugger_name) (rc)
      }
    )
    (command.If
      arms: [
        (if_arm
          cond: [
            (command.Sentence
              child: 
                (command.AndOr
                  ops: [Id.Op_DAmp]
                  children: [
                    (command.DParen
                      child: 
                        (arith_expr.Binary
                          op_id: Id.Arith_DEqual
                          left: (arith_expr.ArithWord w:{(Id.Lit_Digits 0)})
                          right: 
                            (arith_expr.VarRef
                              token: (Token id:Id.Lit_ArithVarLike val:_Dbg_o_nx span_id:312)
                            )
                        )
                    )
                    (command.DBracket
                      expr: 
                        (bool_expr.Unary
                          op_id: Id.BoolUnary_r
                          child: {(DQ ($ Id.VSub_DollarName '$_Dbg_startup_cmdfile'))}
                        )
                    )
                  ]
                )
              terminator: (Token id:Id.Op_Semi val:';' span_id:328)
            )
          ]
          action: [(C {(_Dbg_do_source)} {(DQ ($ Id.VSub_DollarName '$_Dbg_startup_cmdfile'))})]
          spids: [304 330]
        )
      ]
    )
    (command.If
      arms: [
        (if_arm
          cond: [
            (command.Sentence
              child: 
                (command.DBracket
                  expr: 
                    (bool_expr.Unary
                      op_id: Id.BoolUnary_z
                      child: {(DQ (${ Id.VSub_Name _Dbg_DEBUGGER_LEVEL))}
                    )
                )
              terminator: (Token id:Id.Op_Semi val:';' span_id:362)
            )
          ]
          action: [(C {(typeset)} {(-xi)} {(Id.Lit_VarLike '_Dbg_DEBUGGER_LEVEL=') (1)})]
          spids: [348 364]
        )
      ]
    )
    (command.If
      arms: [
        (if_arm
          cond: [
            (command.Sentence
              child: 
                (command.DBracket
                  expr: 
                    (bool_expr.Binary
                      op_id: Id.BoolBinary_GlobDEqual
                      left: 
                        {
                          (braced_var_sub
                            token: (Token id:Id.VSub_Name val:_Dbg_libdir span_id:392)
                            suffix_op: 
                              (suffix_op.Slice
                                begin: (arith_expr.ArithWord w:{(Id.Lit_Digits 0)})
                                length: (arith_expr.ArithWord w:{(Id.Lit_Digits 1)})
                              )
                          )
                        }
                      right: {(SQ (Token id:Id.Lit_Chars val:. span_id:402))}
                    )
                )
              terminator: (Token id:Id.Op_Semi val:';' span_id:407)
            )
          ]
          action: [
            (command.ShAssignment
              pairs: [
                (assign_pair
                  lhs: (sh_lhs_expr.Name name:_Dbg_libdir)
                  op: assign_op.Equal
                  rhs: 
                    {
                      (command_sub
                        left_token: (Token id:Id.Left_DollarParen val:'$(' span_id:417)
                        command_list: 
                          (command.CommandList
                            children: [
                              (C {(_Dbg_expand_filename)} 
                                {(${ Id.VSub_Name _Dbg_init_cwd) (/) (${ Id.VSub_Name _Dbg_libdir)}
                              )
                            ]
                          )
                      )
                    }
                  spids: [416]
                )
              ]
            )
          ]
          spids: [387 409]
        )
      ]
    )
    (command.ForEach
      iter_name: source_file
      iter_words: [
        {
          (braced_var_sub
            token: (Token id:Id.VSub_Name val:_Dbg_o_init_files span_id:439)
            bracket_op: (bracket_op.WholeArray op_id:Id.Lit_At)
          )
        }
        {(DQ ($ Id.VSub_DollarName '$DBG_RESTART_FILE'))}
      ]
      do_arg_iter: F
      body: 
        (command.DoGroup
          children: [
            (command.If
              arms: [
                (if_arm
                  cond: [
                    (command.Sentence
                      child: 
                        (command.DBracket
                          expr: 
                            (bool_expr.Unary
                              op_id: Id.BoolUnary_n
                              child: {(DQ ($ Id.VSub_DollarName '$source_file'))}
                            )
                        )
                      terminator: (Token id:Id.Op_Semi val:';' span_id:465)
                    )
                  ]
                  action: [
                    (command.If
                      arms: [
                        (if_arm
                          cond: [
                            (command.Sentence
                              child: 
                                (command.AndOr
                                  ops: [Id.Op_DAmp]
                                  children: [
                                    (command.DBracket
                                      expr: 
                                        (bool_expr.Unary
                                          op_id: Id.BoolUnary_r
                                          child: {(DQ ($ Id.VSub_DollarName '$source_file'))}
                                        )
                                    )
                                    (command.DBracket
                                      expr: 
                                        (bool_expr.Unary
                                          op_id: Id.BoolUnary_f
                                          child: {(DQ ($ Id.VSub_DollarName '$source_file'))}
                                        )
                                    )
                                  ]
                                )
                              terminator: (Token id:Id.Op_Semi val:';' span_id:494)
                            )
                          ]
                          action: [(C {(source)} {($ Id.VSub_DollarName '$source_file')})]
                          spids: [470 496]
                        )
                      ]
                      else_action: [
                        (C {(_Dbg_errmsg)} 
                          {(DQ ('Unable to read shell script: ') (${ Id.VSub_Name source_file))}
                        )
                      ]
                    )
                  ]
                  spids: [453 467]
                )
              ]
            )
          ]
        )
    )
  ]
)