(CommandList
  children: [
    (If
      arms: [
        (if_arm
          cond: [
            (Sentence
              child: 
                (DBracket
                  expr: (BoolBinary op_id:BoolBinary_GlobNEqual left:{($ VSub_Pound "$#")} right:{(2)})
                )
              terminator: <Op_Semi ";">
            )
          ]
          action: [
            (SimpleCommand
              words: [{(echo)} {(DQ ("Usage ") ($ VSub_Number "$0") (" BASH_PROGRAM PREFIX"))}]
              redirects: [(Redir op_id:Redir_GreatAnd fd:-1 arg_word:{(2)} spids:[21])]
            )
            (C {(exit)} {(3)})
          ]
          spids: [-1 16]
        )
      ]
      spids: [-1 35]
    )
    (Assignment
      keyword: Assign_None
      pairs: [(assign_pair lhs:(LhsName name:SH_PROG) op:Equal rhs:{($ VSub_Number "$1")} spids:[37])]
      spids: [37]
    )
    (Assignment
      keyword: Assign_None
      pairs: [(assign_pair lhs:(LhsName name:PREFIX) op:Equal rhs:{($ VSub_Number "$2")} spids:[40])]
      spids: [40]
    )
    (C {(typeset)} {(-i)} {(Lit_VarLike "rc=") (0)})
    (Assignment
      keyword: Assign_None
      pairs: [
        (assign_pair
          lhs: (LhsName name:bash_loc)
          op: Equal
          rhs: 
            {
              (CommandSubPart
                command_list: 
                  (CommandList
                    children: [(C {($ VSub_Name "$SH_PROG")} {(-c)} {(SQ <"echo ${SHELL}">)})]
                  )
                left_token: <Left_CommandSub "$(">
                spids: [51 59]
              )
            }
          spids: [50]
        )
      ]
      spids: [50]
    )
    (Assignment
      keyword: Assign_None
      pairs: [(assign_pair lhs:(LhsName name:rc) op:Equal rhs:{($ VSub_QMark "$?")} spids:[61])]
      spids: [61]
    )
    (If
      arms: [
        (if_arm
          cond: [
            (Sentence
              child: 
                (DParen
                  child: 
                    (ArithBinary
                      op_id: Arith_NEqual
                      left: (ArithVarRef name:rc)
                      right: (ArithWord w:{(Lit_Digits 0)})
                    )
                )
              terminator: <Op_Semi ";">
            )
          ]
          action: [
            (SimpleCommand
              words: [
                {(echo)}
                {
                  (DQ ("Something went wrong in getting ") 
                    (EscapedLiteralPart token:<Lit_EscapedChar "\\$">) ("SHELL for ") ($ VSub_Name "$SH_PROG")
                  )
                }
              ]
              redirects: [(Redir op_id:Redir_GreatAnd fd:-1 arg_word:{(2)} spids:[84])]
            )
            (C {(exit)} {($ VSub_Name "$rc")})
          ]
          spids: [-1 79]
        )
      ]
      spids: [-1 99]
    )
    (If
      arms: [
        (if_arm
          cond: [
            (Sentence
              child: (DBracket expr:(BoolUnary op_id:BoolUnary_z child:{($ VSub_Name "$bash_loc")}))
              terminator: <Op_Semi ";">
            )
          ]
          action: [
            (SimpleCommand
              words: [
                {(echo)}
                {
                  (DQ ("Something went wrong in setting bash location from ") 
                    (EscapedLiteralPart token:<Lit_EscapedChar "\\$">) ("SHELL for ") ($ VSub_Name "$SH_PROG")
                  )
                }
              ]
              redirects: [(Redir op_id:Redir_GreatAnd fd:-1 arg_word:{(2)} spids:[118])]
            )
            (C {(exit)} {(3)})
          ]
          spids: [-1 113]
        )
      ]
      spids: [-1 133]
    )
    (Assignment
      keyword: Assign_None
      pairs: [
        (assign_pair
          lhs: (LhsName name:bashdb_main)
          op: Equal
          rhs: 
            {
              (CommandSubPart
                command_list: 
                  (CommandList
                    children: [
                      (Pipeline
                        children: [(C {(strings)} {($ VSub_Name "$SH_PROG")}) (C {(grep)} {(bashdb)})]
                        negated: False
                      )
                    ]
                  )
                left_token: <Left_CommandSub "$(">
                spids: [136 146]
              )
            }
          spids: [135]
        )
      ]
      spids: [135]
    )
    (Assignment
      keyword: Assign_None
      pairs: [
        (assign_pair
          lhs: (LhsName name:check_loc)
          op: Equal
          rhs: 
            {
              (CommandSubPart
                command_list: 
                  (CommandList
                    children: [
                      (C {(dirname)} 
                        {
                          (CommandSubPart
                            command_list: 
                              (CommandList
                                children: [(C {(dirname)} {($ VSub_Name "$bashdb_main")})]
                              )
                            left_token: <Left_CommandSub "$(">
                            spids: [152 156]
                          )
                        }
                      )
                    ]
                  )
                left_token: <Left_CommandSub "$(">
                spids: [149 157]
              )
            }
          spids: [148]
        )
      ]
      spids: [148]
    )
    (If
      arms: [
        (if_arm
          cond: [
            (Sentence
              child: 
                (DBracket
                  expr: 
                    (BoolBinary
                      op_id: BoolBinary_GlobNEqual
                      left: {($ VSub_Name "$PREFIX")}
                      right: {($ VSub_Name "$check_loc")}
                    )
                )
              terminator: <Op_Semi ";">
            )
          ]
          action: [
            (SimpleCommand
              words: [
                {(echo)}
                {
                  (DQ ("bash says prefix should be ") ($ VSub_Name "$check_loc") (". You gave ") 
                    ($ VSub_Name "$PREFIX")
                  )
                }
              ]
              redirects: [(Redir op_id:Redir_GreatAnd fd:-1 arg_word:{(2)} spids:[178])]
            )
            (C {(exit)} {(4)})
          ]
          spids: [-1 173]
        )
      ]
      spids: [-1 193]
    )
    (C {(exit)} {(0)})
  ]
)