(command.CommandList
  children: [
    (command.ShAssignment
      pairs: [
        (assign_pair
          lhs: (sh_lhs_expr.Name name:db)
          op: assign_op.Equal
          rhs: {(DQ </usr/lib/games/state.capitals.txt>)}
          spids: [10]
        )
      ]
    )
    (command.If
      arms: [
        (if_arm
          cond: [
            (command.Sentence
              child: 
                (C {<Id.Lit_LBracket '['>} {<Id.KW_Bang '!'>} {<-r>} {(DQ ($ Id.VSub_DollarName '$db'))} 
                  {<Id.Lit_RBracket ']'>}
                )
              terminator: <Id.Op_Semi _>
            )
          ]
          action: [
            (command.Simple
              words: [
                {<echo>}
                {
                  (DQ ($ Id.VSub_Number '$0') <": Can't open "> ($ Id.VSub_DollarName '$db') 
                    <' for reading.'>
                  )
                }
              ]
              redirects: [(redir.Redir op:<Id.Redir_GreatAnd '>&'> fd:-1 arg_word:{<2>})]
            )
            (command.Simple
              words: [
                {<echo>}
                {(DQ <'(get http://www.intuitive.com/wicked/examples/state.capitals.txt'>)}
              ]
              redirects: [(redir.Redir op:<Id.Redir_GreatAnd '>&'> fd:-1 arg_word:{<2>})]
            )
            (command.Simple
              words: [
                {<echo>}
                {
                  (DQ <'save the file as '> ($ Id.VSub_DollarName '$db') 
                    <" and you're ready to play!)">
                  )
                }
              ]
              redirects: [(redir.Redir op:<Id.Redir_GreatAnd '>&'> fd:-1 arg_word:{<2>})]
            )
            (command.ControlFlow token:<Id.ControlFlow_Exit exit> arg_word:{<1>})
          ]
          spids: [19 35]
        )
      ]
    )
    (command.CommandList
      children: [
        (command.Sentence
          child: 
            (command.ShAssignment
              pairs: [
                (assign_pair
                  lhs: (sh_lhs_expr.Name name:guesses)
                  op: assign_op.Equal
                  rhs: {<0>}
                  spids: [80]
                )
              ]
            )
          terminator: <Id.Op_Semi _>
        )
        (command.Sentence
          child: 
            (command.ShAssignment
              pairs: [
                (assign_pair
                  lhs: (sh_lhs_expr.Name name:correct)
                  op: assign_op.Equal
                  rhs: {<0>}
                  spids: [84]
                )
              ]
            )
          terminator: <Id.Op_Semi _>
        )
        (command.ShAssignment
          pairs: [
            (assign_pair
              lhs: (sh_lhs_expr.Name name:total)
              op: assign_op.Equal
              rhs: {<0>}
              spids: [88]
            )
          ]
        )
      ]
    )
    (command.WhileUntil
      keyword: <Id.KW_While while>
      cond: [
        (command.Sentence
          child: 
            (C {<Id.Lit_LBracket '['>} {(DQ ($ Id.VSub_DollarName '$guess'))} 
              {<Id.KW_Bang '!'> <Id.Lit_Equals '='>} {(DQ <quit>)} {<Id.Lit_RBracket ']'>}
            )
          terminator: <Id.Op_Semi _>
        )
      ]
      body: 
        (command.DoGroup
          children: [
            (command.ShAssignment
              pairs: [
                (assign_pair
                  lhs: (sh_lhs_expr.Name name:thiskey)
                  op: assign_op.Equal
                  rhs: 
                    {
                      (DQ 
                        (command_sub
                          left_token: <Id.Left_DollarParen '$('>
                          command_list: 
                            (command.CommandList
                              children: [(C {<randomquote>} {($ Id.VSub_DollarName '$db')})]
                            )
                        )
                      )
                    }
                  spids: [116]
                )
              ]
            )
            (command.ShAssignment
              pairs: [
                (assign_pair
                  lhs: (sh_lhs_expr.Name name:state)
                  op: assign_op.Equal
                  rhs: 
                    {
                      (DQ 
                        (command_sub
                          left_token: <Id.Left_DollarParen '$('>
                          command_list: 
                            (command.CommandList
                              children: [
                                (command.Pipeline
                                  children: [
                                    (C {<echo>} {($ Id.VSub_DollarName '$thiskey')})
                                    (C {<cut>} 
                                      {<-d> 
                                        (word_part.EscapedLiteral
                                          token: <Id.Lit_EscapedChar '\\ '>
                                        )
                                      } {<-f1>}
                                    )
                                    (C {<sed>} {(SQ <'s/-/ /g'>)})
                                  ]
                                  negated: F
                                )
                              ]
                            )
                        )
                      )
                    }
                  spids: [137]
                )
              ]
            )
            (command.ShAssignment
              pairs: [
                (assign_pair
                  lhs: (sh_lhs_expr.Name name:city)
                  op: assign_op.Equal
                  rhs: 
                    {
                      (DQ 
                        (command_sub
                          left_token: <Id.Left_DollarParen '$('>
                          command_list: 
                            (command.CommandList
                              children: [
                                (command.Pipeline
                                  children: [
                                    (C {<echo>} {($ Id.VSub_DollarName '$thiskey')})
                                    (C {<cut>} 
                                      {<-d> 
                                        (word_part.EscapedLiteral
                                          token: <Id.Lit_EscapedChar '\\ '>
                                        )
                                      } {<-f2>}
                                    )
                                    (C {<sed>} {(SQ <'s/-/ /g'>)})
                                  ]
                                  negated: F
                                )
                              ]
                            )
                        )
                      )
                    }
                  spids: [164]
                )
              ]
            )
            (command.ShAssignment
              pairs: [
                (assign_pair
                  lhs: (sh_lhs_expr.Name name:match)
                  op: assign_op.Equal
                  rhs: 
                    {
                      (DQ 
                        (command_sub
                          left_token: <Id.Left_DollarParen '$('>
                          command_list: 
                            (command.CommandList
                              children: [
                                (command.Pipeline
                                  children: [
                                    (C {<echo>} {($ Id.VSub_DollarName '$city')})
                                    (C {<tr>} {(SQ <'[:upper:]'>)} {(SQ <'[:lower:]'>)})
                                  ]
                                  negated: F
                                )
                              ]
                            )
                        )
                      )
                    }
                  spids: [191]
                )
              ]
            )
            (command.Sentence
              child: 
                (command.ShAssignment
                  pairs: [
                    (assign_pair
                      lhs: (sh_lhs_expr.Name name:guess)
                      op: assign_op.Equal
                      rhs: {(DQ <'??'>)}
                      spids: [214]
                    )
                  ]
                )
              terminator: <Id.Op_Semi _>
            )
            (command.Sentence
              child: 
                (command.ShAssignment
                  pairs: [
                    (assign_pair
                      lhs: (sh_lhs_expr.Name name:total)
                      op: assign_op.Equal
                      rhs: 
                        {
                          (word_part.ArithSub
                            anode: 
                              (arith_expr.Binary
                                op_id: Id.Arith_Plus
                                left: (arith_expr.ArithWord w:{($ Id.VSub_DollarName '$total')})
                                right: (arith_expr.ArithWord w:{<Id.Lit_Digits 1>})
                              )
                          )
                        }
                      spids: [221]
                    )
                  ]
                )
              terminator: <Id.Op_Semi _>
            )
            (C {<echo>} {(DQ )})
            (C {<echo>} {(DQ <'What city is the capital of '> ($ Id.VSub_DollarName '$state') <'?'>)})
            (command.WhileUntil
              keyword: <Id.KW_While while>
              cond: [
                (C {<Id.Lit_LBracket '['>} {(DQ ($ Id.VSub_DollarName '$guess'))} 
                  {<Id.KW_Bang '!'> <Id.Lit_Equals '='>} {(DQ ($ Id.VSub_DollarName '$match'))} {<-a>} {(DQ ($ Id.VSub_DollarName '$guess'))} 
                  {<Id.KW_Bang '!'> <Id.Lit_Equals '='>} {(DQ <next>)} {<-a>} {(DQ ($ Id.VSub_DollarName '$guess'))} {<Id.KW_Bang '!'> <Id.Lit_Equals '='>} 
                  {(DQ <quit>)} {<Id.Lit_RBracket ']'>}
                )
              ]
              body: 
                (command.DoGroup
                  children: [
                    (C {</bin/echo>} {<-n>} {(DQ <'Answer: '>)})
                    (C {<read>} {<guess>})
                    (command.If
                      arms: [
                        (if_arm
                          cond: [
                            (command.Sentence
                              child: 
                                (C {<Id.Lit_LBracket '['>} {(DQ ($ Id.VSub_DollarName '$guess'))} 
                                  {<Id.Lit_Equals '='>} {(DQ ($ Id.VSub_DollarName '$match'))} {<-o>} {(DQ ($ Id.VSub_DollarName '$guess'))} 
                                  {<Id.Lit_Equals '='>} {(DQ ($ Id.VSub_DollarName '$city'))} {<Id.Lit_RBracket ']'>}
                                )
                              terminator: <Id.Op_Semi _>
                            )
                          ]
                          action: [
                            (C {<echo>} {(DQ )})
                            (C {<echo>} {(DQ <'*** Absolutely correct!  Well done! ***'>)})
                            (command.ShAssignment
                              pairs: [
                                (assign_pair
                                  lhs: (sh_lhs_expr.Name name:correct)
                                  op: assign_op.Equal
                                  rhs: 
                                    {
                                      (word_part.ArithSub
                                        anode: 
                                          (arith_expr.Binary
                                            op_id: Id.Arith_Plus
                                            left: 
                                              (arith_expr.ArithWord
                                                w: {($ Id.VSub_DollarName '$correct')}
                                              )
                                            right: (arith_expr.ArithWord w:{<Id.Lit_Digits 1>})
                                          )
                                      )
                                    }
                                  spids: [374]
                                )
                              ]
                            )
                            (command.ShAssignment
                              pairs: [
                                (assign_pair
                                  lhs: (sh_lhs_expr.Name name:guess)
                                  op: assign_op.Equal
                                  rhs: {($ Id.VSub_DollarName '$match')}
                                  spids: [387]
                                )
                              ]
                            )
                          ]
                          spids: [328 358]
                        )
                        (if_arm
                          cond: [
                            (command.Sentence
                              child: 
                                (C {<Id.Lit_LBracket '['>} {(DQ ($ Id.VSub_DollarName '$guess'))} 
                                  {<Id.Lit_Equals '='>} {(DQ <next>)} {<-o>} {(DQ ($ Id.VSub_DollarName '$guess'))} {<Id.Lit_Equals '='>} {(DQ <quit>)} 
                                  {<Id.Lit_RBracket ']'>}
                                )
                              terminator: <Id.Op_Semi _>
                            )
                          ]
                          action: [
                            (C {<echo>} {(DQ )})
                            (C {<echo>} 
                              {
                                (DQ ($ Id.VSub_DollarName '$city') <' is the capital of '> 
                                  ($ Id.VSub_DollarName '$state') <.>
                                )
                              }
                            )
                          ]
                          spids: [391 421]
                        )
                      ]
                      else_action: [(C {<echo>} {(DQ <"I'm afraid that's not correct.">)})]
                    )
                  ]
                )
            )
          ]
        )
    )
    (C {<echo>} 
      {
        (DQ <'You got '> ($ Id.VSub_DollarName '$correct') <' out of '> ($ Id.VSub_DollarName '$total') 
          <' presented.'>
        )
      }
    )
    (command.ControlFlow token:<Id.ControlFlow_Exit exit> arg_word:{<0>})
  ]
)