(command.CommandList
  children: [
    (command.If
      arms: [
        (if_arm
          cond: 
            (condition.Shell
              commands: [
                (command.Sentence
                  child: 
                    (command.DBracket
                      expr: 
                        (bool_expr.Unary
                          op_id: Id.BoolUnary_z
                          child: 
                            {
                              (DQ 
                                (braced_var_sub
                                  token: <Id.VSub_Name BASH_SOURCE>
                                  bracket_op: (bracket_op.ArrayIndex expr:{<Id.Lit_Digits 0>})
                                )
                              )
                            }
                        )
                    )
                  terminator: <Id.Op_Semi _>
                )
              ]
            )
          action: [
            (command.Simple
              words: [{<echo>} {(DQ <'Sorry, you need to use a debugger-enabled version of bash.'>)}]
              redirects: [(redir op:<Id.Redir_GreatAnd '2>&'> loc:(redir_loc.Fd fd:2) arg:{<1>})]
              do_fork: T
            )
            (command.ControlFlow token:<Id.ControlFlow_Exit exit> 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: 
            (condition.Shell
              commands: [
                (command.Sentence
                  child: 
                    (command.DBracket
                      expr: (bool_expr.Unary op_id:Id.BoolUnary_r child:{<'/dev/stdin'>})
                    )
                  terminator: <Id.Op_Semi _>
                )
              ]
            )
          action: [(C {<_Dbg_do_source>} {<'/dev/stdin'>})]
          spids: [175 187]
        )
        (if_arm
          cond: 
            (condition.Shell
              commands: [
                (command.Sentence
                  child: 
                    (command.DBracket
                      expr: 
                        (bool_expr.Binary
                          op_id: Id.BoolBinary_GlobNEqual
                          left: {(command_sub left_token:<Id.Left_DollarParen '$('> child:(C {<tty>}))}
                          right: {(SQ <'not a tty'>)}
                        )
                    )
                  terminator: <Id.Op_Semi _>
                )
              ]
            )
          action: [
            (C {<_Dbg_do_source>} {(command_sub left_token:<Id.Left_DollarParen '$('> child:(C {<tty>}))})
          ]
          spids: [194 212]
        )
      ]
    )
    (C {<typeset>} {<-a>} {<_Dbg_input>})
    (command.If
      arms: [
        (if_arm
          cond: 
            (condition.Shell
              commands: [
                (command.Sentence
                  child: 
                    (command.DBracket
                      expr: 
                        (bool_expr.Unary
                          op_id: Id.BoolUnary_n
                          child: {(DQ ($ Id.VSub_DollarName '$DBG_INPUT'))}
                        )
                    )
                  terminator: <Id.Op_Semi _>
                )
              ]
            )
          action: [
            (command.ShAssignment
              pairs: [
                (assign_pair
                  lhs: (sh_lhs_expr.Name name:_Dbg_input)
                  op: assign_op.Equal
                  rhs: 
                    {
                      (sh_array_literal
                        left: <Id.Op_LParen _>
                        words: [{(DQ ($ Id.VSub_DollarName '$DBG_INPUT'))}]
                      )
                    }
                  spids: [264]
                )
              ]
            )
            (C {<_Dbg_do_source>} 
              {
                (DQ 
                  (braced_var_sub
                    token: <Id.VSub_Name _Dbg_input>
                    bracket_op: (bracket_op.ArrayIndex expr:{<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: <Id.VSub_Name HOME>
          suffix_op: 
            (suffix_op.Unary
              tok: <Id.VTest_ColonHyphen ':-'>
              arg_word: {(word_part.TildeSub token:<Id.Lit_TildeLike '~'>)}
            )
        ) <'/.'> (${ Id.VSub_Name _Dbg_debugger_name) <rc>
      }
    )
    (command.If
      arms: [
        (if_arm
          cond: 
            (condition.Shell
              commands: [
                (command.Sentence
                  child: 
                    (command.AndOr
                      ops: [Id.Op_DAmp]
                      children: [
                        (command.DParen
                          child: 
                            (arith_expr.Binary
                              op_id: Id.Arith_DEqual
                              left: {<Id.Lit_Digits 0>}
                              right: <Id.Lit_ArithVarLike _Dbg_o_nx>
                            )
                        )
                        (command.DBracket
                          expr: 
                            (bool_expr.Unary
                              op_id: Id.BoolUnary_r
                              child: {(DQ ($ Id.VSub_DollarName '$_Dbg_startup_cmdfile'))}
                            )
                        )
                      ]
                    )
                  terminator: <Id.Op_Semi _>
                )
              ]
            )
          action: [(C {<_Dbg_do_source>} {(DQ ($ Id.VSub_DollarName '$_Dbg_startup_cmdfile'))})]
          spids: [304 330]
        )
      ]
    )
    (command.If
      arms: [
        (if_arm
          cond: 
            (condition.Shell
              commands: [
                (command.Sentence
                  child: 
                    (command.DBracket
                      expr: 
                        (bool_expr.Unary
                          op_id: Id.BoolUnary_z
                          child: {(DQ (${ Id.VSub_Name _Dbg_DEBUGGER_LEVEL))}
                        )
                    )
                  terminator: <Id.Op_Semi _>
                )
              ]
            )
          action: [(C {<typeset>} {<-xi>} {<Id.Lit_VarLike '_Dbg_DEBUGGER_LEVEL='> <1>})]
          spids: [348 364]
        )
      ]
    )
    (command.If
      arms: [
        (if_arm
          cond: 
            (condition.Shell
              commands: [
                (command.Sentence
                  child: 
                    (command.DBracket
                      expr: 
                        (bool_expr.Binary
                          op_id: Id.BoolBinary_GlobDEqual
                          left: 
                            {
                              (braced_var_sub
                                token: <Id.VSub_Name _Dbg_libdir>
                                suffix_op: 
                                  (suffix_op.Slice
                                    begin: {<Id.Lit_Digits 0>}
                                    length: {<Id.Lit_Digits 1>}
                                  )
                              )
                            }
                          right: {(SQ <.>)}
                        )
                    )
                  terminator: <Id.Op_Semi _>
                )
              ]
            )
          action: [
            (command.ShAssignment
              pairs: [
                (assign_pair
                  lhs: (sh_lhs_expr.Name name:_Dbg_libdir)
                  op: assign_op.Equal
                  rhs: 
                    {
                      (command_sub
                        left_token: <Id.Left_DollarParen '$('>
                        child: 
                          (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: <Id.VSub_Name _Dbg_o_init_files>
            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: 
                    (condition.Shell
                      commands: [
                        (command.Sentence
                          child: 
                            (command.DBracket
                              expr: 
                                (bool_expr.Unary
                                  op_id: Id.BoolUnary_n
                                  child: {(DQ ($ Id.VSub_DollarName '$source_file'))}
                                )
                            )
                          terminator: <Id.Op_Semi _>
                        )
                      ]
                    )
                  action: [
                    (command.If
                      arms: [
                        (if_arm
                          cond: 
                            (condition.Shell
                              commands: [
                                (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: <Id.Op_Semi _>
                                )
                              ]
                            )
                          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]
                )
              ]
            )
          ]
        )
    )
  ]
)