(command.CommandList
  children: [
    (C {(typeset)} {(-i)} {(Lit_VarLike 'rc=') (0)})
    (command.ShAssignment
      pairs: [
        (assign_pair
          lhs: (sh_lhs_expr.Name name:SH_PROG)
          op: Equal
          rhs: 
            {
              (braced_var_sub
                token: <VSub_Name SH_PROG>
                suffix_op: 
                  (suffix_op.Unary
                    op_id: VTest_ColonHyphen
                    arg_word: {($ VSub_DollarName '$SHELL')}
                  )
              )
            }
        )
      ]
    )
    (command.ShAssignment
      pairs: [
        (assign_pair
          lhs: (sh_lhs_expr.Name name:SH_PROG)
          op: Equal
          rhs: 
            {
              (braced_var_sub
                token: <VSub_Name SH_PROG>
                suffix_op: (suffix_op.Unary op_id:VTest_ColonHyphen arg_word:{(bash)})
              )
            }
        )
      ]
    )
    (command.ShAssignment
      pairs: [
        (assign_pair
          lhs: (sh_lhs_expr.Name name:bash_loc)
          op: Equal
          rhs: 
            {
              (command_sub
                left_token: <Left_DollarParen '$('>
                command_list: 
                  (command.CommandList
                    children: [(C {($ VSub_DollarName '$SH_PROG')} {(-c)} {(SQ <'echo ${SHELL}'>)})]
                  )
              )
            }
        )
      ]
    )
    (command.ShAssignment
      pairs: [(assign_pair lhs:(sh_lhs_expr.Name name:rc) op:Equal rhs:{($ VSub_QMark '$?')})]
    )
    (command.If
      arms: [
        (if_arm
          cond: [
            (command.Sentence
              child: 
                (command.DParen
                  child: 
                    (arith_expr.Binary
                      op_id: Arith_NEqual
                      left: (arith_expr.VarRef token:<Lit_ArithVarLike rc>)
                      right: (arith_expr.ArithWord w:{(Lit_Digits 0)})
                    )
                )
              terminator: <Op_Semi ';'>
            )
          ]
          action: [
            (command.Simple
              words: [
                {(echo)}
                {
                  (DQ ('Something went wrong in getting ') 
                    (word_part.EscapedLiteral token:<Lit_EscapedChar '\\$'>) ('SHELL for ') ($ VSub_DollarName '$SH_PROG')
                  )
                }
              ]
              redirects: [(redir.Redir op:<Redir_GreatAnd '>&'> fd:16777215 arg_word:{(2)})]
            )
            (command.ControlFlow
              token: <ControlFlow_Exit exit>
              arg_word: {($ VSub_DollarName '$rc')}
            )
          ]
        )
      ]
    )
    (command.If
      arms: [
        (if_arm
          cond: [
            (command.Sentence
              child: 
                (command.DBracket
                  expr: (bool_expr.Unary op_id:BoolUnary_z child:{($ VSub_DollarName '$bash_loc')})
                )
              terminator: <Op_Semi ';'>
            )
          ]
          action: [
            (command.Simple
              words: [
                {(echo)}
                {
                  (DQ ('Something went wrong in setting bash location from ') 
                    (word_part.EscapedLiteral token:<Lit_EscapedChar '\\$'>) ('SHELL for ') ($ VSub_DollarName '$SH_PROG')
                  )
                }
              ]
              redirects: [(redir.Redir op:<Redir_GreatAnd '>&'> fd:16777215 arg_word:{(2)})]
            )
            (command.ControlFlow token:<ControlFlow_Exit exit> arg_word:{(3)})
          ]
        )
      ]
    )
    (command.ShAssignment
      pairs: [
        (assign_pair
          lhs: (sh_lhs_expr.Name name:bashdb_main)
          op: Equal
          rhs: 
            {
              (command_sub
                left_token: <Left_DollarParen '$('>
                command_list: 
                  (command.CommandList
                    children: [
                      (command.Pipeline
                        children: [
                          (C {(strings)} {($ VSub_DollarName '$bash_loc')})
                          (C {(grep)} {(bashdb)})
                        ]
                        negated: F
                      )
                    ]
                  )
              )
            }
        )
      ]
    )
    (C {(echo)} 
      {
        (command_sub
          left_token: <Left_DollarParen '$('>
          command_list: 
            (command.CommandList
              children: [
                (C {(dirname)} 
                  {
                    (command_sub
                      left_token: <Left_DollarParen '$('>
                      command_list: 
                        (command.CommandList
                          children: [
                            (C {(dirname)} 
                              {
                                (command_sub
                                  left_token: <Left_DollarParen '$('>
                                  command_list: 
                                    (command.CommandList
                                      children: [(C {(dirname)} {($ VSub_DollarName '$bashdb_main')})]
                                    )
                                )
                              }
                            )
                          ]
                        )
                    )
                  }
                )
              ]
            )
        )
      }
    )
    (command.ControlFlow token:<ControlFlow_Exit exit> arg_word:{(0)})
  ]
)