(command.CommandList
  children: [
    (command.ShFunction
      name: initializeDeck
      body: 
        (BraceGroup
          children: [
            (command.ShAssignment
              pairs: [
                (assign_pair
                  lhs: (sh_lhs_expr.Name name:card)
                  op: assign_op.Equal
                  rhs: {<1>}
                  spids: [28]
                )
              ]
            )
            (command.WhileUntil
              keyword: <Id.KW_While while>
              cond: [
                (C {<Id.Lit_LBracket '['>} {($ Id.VSub_DollarName '$card')} 
                  {<Id.KW_Bang '!'> <Id.Lit_Equals '='>} {<53>} {<Id.Lit_RBracket ']'>}
                )
              ]
              body: 
                (command.DoGroup
                  children: [
                    (command.ShAssignment
                      pairs: [
                        (assign_pair
                          lhs: 
                            (sh_lhs_expr.IndexedName
                              name: deck
                              index: {($ Id.VSub_DollarName '$card')}
                            )
                          op: assign_op.Equal
                          rhs: {($ Id.VSub_DollarName '$card')}
                          spids: [52]
                        )
                      ]
                    )
                    (command.ShAssignment
                      pairs: [
                        (assign_pair
                          lhs: (sh_lhs_expr.Name name:card)
                          op: assign_op.Equal
                          rhs: 
                            {
                              (word_part.ArithSub
                                anode: 
                                  (arith_expr.Binary
                                    op_id: Id.Arith_Plus
                                    left: {($ Id.VSub_DollarName '$card')}
                                    right: {<Id.Lit_Digits 1>}
                                  )
                              )
                            }
                          spids: [60]
                        )
                      ]
                    )
                  ]
                )
            )
          ]
        )
    )
    (command.ShFunction
      name: shuffleDeck
      body: 
        (BraceGroup
          children: [
            (command.ShAssignment
              pairs: [
                (assign_pair
                  lhs: (sh_lhs_expr.Name name:count)
                  op: assign_op.Equal
                  rhs: {<1>}
                  spids: [94]
                )
              ]
            )
            (command.WhileUntil
              keyword: <Id.KW_While while>
              cond: [
                (C {<Id.Lit_LBracket '['>} {($ Id.VSub_DollarName '$count')} 
                  {<Id.KW_Bang '!'> <Id.Lit_Equals '='>} {<53>} {<Id.Lit_RBracket ']'>}
                )
              ]
              body: 
                (command.DoGroup
                  children: [
                    (C {<pickCard>})
                    (command.ShAssignment
                      pairs: [
                        (assign_pair
                          lhs: 
                            (sh_lhs_expr.IndexedName
                              name: newdeck
                              index: {($ Id.VSub_DollarName '$count')}
                            )
                          op: assign_op.Equal
                          rhs: {($ Id.VSub_DollarName '$picked')}
                          spids: [119]
                        )
                      ]
                    )
                    (command.ShAssignment
                      pairs: [
                        (assign_pair
                          lhs: (sh_lhs_expr.Name name:count)
                          op: assign_op.Equal
                          rhs: 
                            {
                              (word_part.ArithSub
                                anode: 
                                  (arith_expr.Binary
                                    op_id: Id.Arith_Plus
                                    left: {($ Id.VSub_DollarName '$count')}
                                    right: {<Id.Lit_Digits 1>}
                                  )
                              )
                            }
                          spids: [127]
                        )
                      ]
                    )
                  ]
                )
            )
          ]
        )
    )
    (command.ShFunction
      name: pickCard
      body: 
        (BraceGroup
          children: [
            (C {<local>} {<errcount>} {<randomcard>})
            (command.ShAssignment
              pairs: [
                (assign_pair
                  lhs: (sh_lhs_expr.Name name:threshold)
                  op: assign_op.Equal
                  rhs: {<10>}
                  spids: [169]
                )
              ]
            )
            (command.ShAssignment
              pairs: [
                (assign_pair
                  lhs: (sh_lhs_expr.Name name:errcount)
                  op: assign_op.Equal
                  rhs: {<0>}
                  spids: [176]
                )
              ]
            )
            (command.WhileUntil
              keyword: <Id.KW_While while>
              cond: [
                (C {<Id.Lit_LBracket '['>} {($ Id.VSub_DollarName '$errcount')} {<-lt>} 
                  {($ Id.VSub_DollarName '$threshold')} {<Id.Lit_RBracket ']'>}
                )
              ]
              body: 
                (command.DoGroup
                  children: [
                    (command.ShAssignment
                      pairs: [
                        (assign_pair
                          lhs: (sh_lhs_expr.Name name:randomcard)
                          op: assign_op.Equal
                          rhs: 
                            {
                              (word_part.ArithSub
                                anode: 
                                  (arith_expr.Binary
                                    op_id: Id.Arith_Plus
                                    left: 
                                      (arith_expr.Binary
                                        op_id: Id.Arith_Percent
                                        left: {($ Id.VSub_DollarName '$RANDOM')}
                                        right: {<Id.Lit_Digits 52>}
                                      )
                                    right: {<Id.Lit_Digits 1>}
                                  )
                              )
                            }
                          spids: [210]
                        )
                      ]
                    )
                    (command.ShAssignment
                      pairs: [
                        (assign_pair
                          lhs: (sh_lhs_expr.Name name:errcount)
                          op: assign_op.Equal
                          rhs: 
                            {
                              (word_part.ArithSub
                                anode: 
                                  (arith_expr.Binary
                                    op_id: Id.Arith_Plus
                                    left: {($ Id.VSub_DollarName '$errcount')}
                                    right: {<Id.Lit_Digits 1>}
                                  )
                              )
                            }
                          spids: [231]
                        )
                      ]
                    )
                    (command.If
                      arms: [
                        (if_arm
                          cond: [
                            (command.Sentence
                              child: 
                                (C {<Id.Lit_LBracket '['>} 
                                  {
                                    (DQ 
                                      (braced_var_sub
                                        token: <Id.VSub_Name deck>
                                        bracket_op: 
                                          (bracket_op.ArrayIndex
                                            expr: {($ Id.VSub_DollarName '$randomcard')}
                                          )
                                      )
                                    )
                                  } {<Id.KW_Bang '!'> <Id.Lit_Equals '='>} {(DQ <0>)} {<Id.Lit_RBracket ']'>}
                                )
                              terminator: <Id.Op_Semi _>
                            )
                          ]
                          action: [
                            (command.ShAssignment
                              pairs: [
                                (assign_pair
                                  lhs: (sh_lhs_expr.Name name:picked)
                                  op: assign_op.Equal
                                  rhs: 
                                    {
                                      (braced_var_sub
                                        token: <Id.VSub_Name deck>
                                        bracket_op: 
                                          (bracket_op.ArrayIndex
                                            expr: {($ Id.VSub_DollarName '$randomcard')}
                                          )
                                      )
                                    }
                                  spids: [272]
                                )
                              ]
                            )
                            (command.ShAssignment
                              pairs: [
                                (assign_pair
                                  lhs: 
                                    (sh_lhs_expr.IndexedName
                                      name: deck
                                      index: {($ Id.VSub_DollarName '$picked')}
                                    )
                                  op: assign_op.Equal
                                  rhs: {<0>}
                                  spids: [281]
                                )
                              ]
                            )
                            (command.ControlFlow
                              token: <Id.ControlFlow_Return return>
                              arg_word: {($ Id.VSub_DollarName '$picked')}
                            )
                          ]
                          spids: [245 269]
                        )
                      ]
                    )
                  ]
                )
            )
            (command.ShAssignment
              pairs: [
                (assign_pair
                  lhs: (sh_lhs_expr.Name name:randomcard)
                  op: assign_op.Equal
                  rhs: {<1>}
                  spids: [314]
                )
              ]
            )
            (command.WhileUntil
              keyword: <Id.KW_While while>
              cond: [
                (C {<Id.Lit_LBracket '['>} 
                  {
                    (braced_var_sub
                      token: <Id.VSub_Name newdeck>
                      bracket_op: (bracket_op.ArrayIndex expr:{($ Id.VSub_DollarName '$randomcard')})
                    )
                  } {<-eq>} {<0>} {<Id.Lit_RBracket ']'>}
                )
              ]
              body: 
                (command.DoGroup
                  children: [
                    (command.ShAssignment
                      pairs: [
                        (assign_pair
                          lhs: (sh_lhs_expr.Name name:randomcard)
                          op: assign_op.Equal
                          rhs: 
                            {
                              (word_part.ArithSub
                                anode: 
                                  (arith_expr.Binary
                                    op_id: Id.Arith_Plus
                                    left: {($ Id.VSub_DollarName '$randomcard')}
                                    right: {<Id.Lit_Digits 1>}
                                  )
                              )
                            }
                          spids: [340]
                        )
                      ]
                    )
                  ]
                )
            )
            (command.ShAssignment
              pairs: [
                (assign_pair
                  lhs: (sh_lhs_expr.Name name:picked)
                  op: assign_op.Equal
                  rhs: {($ Id.VSub_DollarName '$randomcard')}
                  spids: [357]
                )
              ]
            )
            (command.ShAssignment
              pairs: [
                (assign_pair
                  lhs: (sh_lhs_expr.IndexedName name:deck index:{($ Id.VSub_DollarName '$picked')})
                  op: assign_op.Equal
                  rhs: {<0>}
                  spids: [361]
                )
              ]
            )
            (command.ControlFlow
              token: <Id.ControlFlow_Return return>
              arg_word: {($ Id.VSub_DollarName '$picked')}
            )
          ]
        )
    )
    (command.ShFunction
      name: showCard
      body: 
        (BraceGroup
          children: [
            (command.ShAssignment
              pairs: [
                (assign_pair
                  lhs: (sh_lhs_expr.Name name:card)
                  op: assign_op.Equal
                  rhs: {($ Id.VSub_Number '$1')}
                  spids: [400]
                )
              ]
            )
            (command.If
              arms: [
                (if_arm
                  cond: [
                    (command.Sentence
                      child: 
                        (C {<Id.Lit_LBracket '['>} {($ Id.VSub_DollarName '$card')} {<-lt>} {<1>} {<-o>} 
                          {($ Id.VSub_DollarName '$card')} {<-gt>} {<52>} {<Id.Lit_RBracket ']'>}
                        )
                      terminator: <Id.Op_Semi _>
                    )
                  ]
                  action: [
                    (C {<echo>} {(DQ <'Bad card value: '> ($ Id.VSub_DollarName '$card'))})
                    (command.ControlFlow
                      token: <Id.ControlFlow_Exit exit>
                      arg_word: {<1>}
                    )
                  ]
                  spids: [405 427]
                )
              ]
            )
            (command.ShAssignment
              pairs: [
                (assign_pair
                  lhs: (sh_lhs_expr.Name name:suit)
                  op: assign_op.Equal
                  rhs: 
                    {
                      (DQ 
                        (word_part.ArithSub
                          anode: 
                            (arith_expr.Binary
                              op_id: Id.Arith_Plus
                              left: 
                                (arith_expr.Binary
                                  op_id: Id.Arith_Slash
                                  left: 
                                    (arith_expr.Binary
                                      op_id: Id.Arith_Minus
                                      left: {($ Id.VSub_DollarName '$card')}
                                      right: {<Id.Lit_Digits 1>}
                                    )
                                  right: {<Id.Lit_Digits 13>}
                                )
                              right: {<Id.Lit_Digits 1>}
                            )
                        )
                      )
                    }
                  spids: [452]
                )
              ]
            )
            (command.ShAssignment
              pairs: [
                (assign_pair
                  lhs: (sh_lhs_expr.Name name:rank)
                  op: assign_op.Equal
                  rhs: 
                    {
                      (DQ 
                        (word_part.ArithSub
                          anode: 
                            (arith_expr.Binary
                              op_id: Id.Arith_Percent
                              left: {($ Id.VSub_DollarName '$card')}
                              right: {<Id.Lit_Digits 13>}
                            )
                        )
                      )
                    }
                  spids: [481]
                )
              ]
            )
            (command.Case
              to_match: {($ Id.VSub_DollarName '$suit')}
              arms: [
                (case_arm
                  pat_list: [{<1>}]
                  action: [
                    (command.ShAssignment
                      pairs: [
                        (assign_pair
                          lhs: (sh_lhs_expr.Name name:suit)
                          op: assign_op.Equal
                          rhs: {(DQ <Hearts>)}
                          spids: [507]
                        )
                      ]
                    )
                  ]
                  spids: [503 505 512 -1]
                )
                (case_arm
                  pat_list: [{<2>}]
                  action: [
                    (command.ShAssignment
                      pairs: [
                        (assign_pair
                          lhs: (sh_lhs_expr.Name name:suit)
                          op: assign_op.Equal
                          rhs: {(DQ <Clubs>)}
                          spids: [519]
                        )
                      ]
                    )
                  ]
                  spids: [515 517 524 -1]
                )
                (case_arm
                  pat_list: [{<3>}]
                  action: [
                    (command.ShAssignment
                      pairs: [
                        (assign_pair
                          lhs: (sh_lhs_expr.Name name:suit)
                          op: assign_op.Equal
                          rhs: {(DQ <Spades>)}
                          spids: [531]
                        )
                      ]
                    )
                  ]
                  spids: [527 529 536 -1]
                )
                (case_arm
                  pat_list: [{<4>}]
                  action: [
                    (command.ShAssignment
                      pairs: [
                        (assign_pair
                          lhs: (sh_lhs_expr.Name name:suit)
                          op: assign_op.Equal
                          rhs: {(DQ <Diamonds>)}
                          spids: [543]
                        )
                      ]
                    )
                  ]
                  spids: [539 541 548 -1]
                )
                (case_arm
                  pat_list: [{<Id.Lit_Star '*'>}]
                  action: [
                    (command.Sentence
                      child: (C {<echo>} {(DQ <'Bad suit value: '> ($ Id.VSub_DollarName '$suit'))})
                      terminator: <Id.Op_Semi _>
                    )
                    (command.ControlFlow
                      token: <Id.ControlFlow_Exit exit>
                      arg_word: {<1>}
                    )
                  ]
                  spids: [551 553 -1 568]
                )
              ]
            )
            (command.Case
              to_match: {($ Id.VSub_DollarName '$rank')}
              arms: [
                (case_arm
                  pat_list: [{<0>}]
                  action: [
                    (command.ShAssignment
                      pairs: [
                        (assign_pair
                          lhs: (sh_lhs_expr.Name name:rank)
                          op: assign_op.Equal
                          rhs: {(DQ <King>)}
                          spids: [586]
                        )
                      ]
                    )
                  ]
                  spids: [582 584 591 -1]
                )
                (case_arm
                  pat_list: [{<1>}]
                  action: [
                    (command.ShAssignment
                      pairs: [
                        (assign_pair
                          lhs: (sh_lhs_expr.Name name:rank)
                          op: assign_op.Equal
                          rhs: {(DQ <Ace>)}
                          spids: [598]
                        )
                      ]
                    )
                  ]
                  spids: [594 596 603 -1]
                )
                (case_arm
                  pat_list: [{<11>}]
                  action: [
                    (command.ShAssignment
                      pairs: [
                        (assign_pair
                          lhs: (sh_lhs_expr.Name name:rank)
                          op: assign_op.Equal
                          rhs: {(DQ <Jack>)}
                          spids: [609]
                        )
                      ]
                    )
                  ]
                  spids: [606 607 614 -1]
                )
                (case_arm
                  pat_list: [{<12>}]
                  action: [
                    (command.ShAssignment
                      pairs: [
                        (assign_pair
                          lhs: (sh_lhs_expr.Name name:rank)
                          op: assign_op.Equal
                          rhs: {(DQ <Queen>)}
                          spids: [620]
                        )
                      ]
                    )
                  ]
                  spids: [617 618 625 -1]
                )
              ]
            )
            (command.ShAssignment
              pairs: [
                (assign_pair
                  lhs: (sh_lhs_expr.Name name:cardname)
                  op: assign_op.Equal
                  rhs: {(DQ ($ Id.VSub_DollarName '$rank') <' of '> ($ Id.VSub_DollarName '$suit'))}
                  spids: [632]
                )
              ]
            )
          ]
        )
    )
    (command.ShFunction
      name: dealCards
      body: 
        (BraceGroup
          children: [
            (command.ShAssignment
              pairs: [
                (assign_pair
                  lhs: (sh_lhs_expr.Name name:card1)
                  op: assign_op.Equal
                  rhs: 
                    {
                      (braced_var_sub
                        token: <Id.VSub_Name newdeck>
                        bracket_op: (bracket_op.ArrayIndex expr:{<Id.Lit_Digits 1>})
                      )
                    }
                  spids: [655]
                )
              ]
            )
            (command.ShAssignment
              pairs: [
                (assign_pair
                  lhs: (sh_lhs_expr.Name name:card2)
                  op: assign_op.Equal
                  rhs: 
                    {
                      (braced_var_sub
                        token: <Id.VSub_Name newdeck>
                        bracket_op: (bracket_op.ArrayIndex expr:{<Id.Lit_Digits 2>})
                      )
                    }
                  spids: [667]
                )
              ]
            )
            (command.ShAssignment
              pairs: [
                (assign_pair
                  lhs: (sh_lhs_expr.Name name:card3)
                  op: assign_op.Equal
                  rhs: 
                    {
                      (braced_var_sub
                        token: <Id.VSub_Name newdeck>
                        bracket_op: (bracket_op.ArrayIndex expr:{<Id.Lit_Digits 3>})
                      )
                    }
                  spids: [679]
                )
              ]
            )
            (command.ShAssignment
              pairs: [
                (assign_pair
                  lhs: (sh_lhs_expr.Name name:rank1)
                  op: assign_op.Equal
                  rhs: 
                    {
                      (word_part.ArithSub
                        anode: 
                          (arith_expr.Binary
                            op_id: Id.Arith_Percent
                            left: 
                              {
                                (braced_var_sub
                                  token: <Id.VSub_Name newdeck>
                                  bracket_op: (bracket_op.ArrayIndex expr:{<Id.Lit_Digits 1>})
                                )
                              }
                            right: {<Id.Lit_Digits 13>}
                          )
                      )
                    }
                  spids: [692]
                )
              ]
            )
            (command.ShAssignment
              pairs: [
                (assign_pair
                  lhs: (sh_lhs_expr.Name name:rank2)
                  op: assign_op.Equal
                  rhs: 
                    {
                      (word_part.ArithSub
                        anode: 
                          (arith_expr.Binary
                            op_id: Id.Arith_Percent
                            left: 
                              {
                                (braced_var_sub
                                  token: <Id.VSub_Name newdeck>
                                  bracket_op: (bracket_op.ArrayIndex expr:{<Id.Lit_Digits 2>})
                                )
                              }
                            right: {<Id.Lit_Digits 13>}
                          )
                      )
                    }
                  spids: [713]
                )
              ]
            )
            (command.ShAssignment
              pairs: [
                (assign_pair
                  lhs: (sh_lhs_expr.Name name:rank3)
                  op: assign_op.Equal
                  rhs: 
                    {
                      (word_part.ArithSub
                        anode: 
                          (arith_expr.Binary
                            op_id: Id.Arith_Percent
                            left: 
                              {
                                (braced_var_sub
                                  token: <Id.VSub_Name newdeck>
                                  bracket_op: (bracket_op.ArrayIndex expr:{<Id.Lit_Digits 3>})
                                )
                              }
                            right: {<Id.Lit_Digits 13>}
                          )
                      )
                    }
                  spids: [734]
                )
              ]
            )
            (command.If
              arms: [
                (if_arm
                  cond: [
                    (command.Sentence
                      child: 
                        (C {<Id.Lit_LBracket '['>} {($ Id.VSub_DollarName '$rank1')} {<-eq>} {<0>} 
                          {<Id.Lit_RBracket ']'>}
                        )
                      terminator: <Id.Op_Semi _>
                    )
                  ]
                  action: [
                    (command.Sentence
                      child: 
                        (command.ShAssignment
                          pairs: [
                            (assign_pair
                              lhs: (sh_lhs_expr.Name name:rank1)
                              op: assign_op.Equal
                              rhs: {<13>}
                              spids: [779]
                            )
                          ]
                        )
                      terminator: <Id.Op_Semi _>
                    )
                  ]
                  spids: [762 776]
                )
              ]
            )
            (command.If
              arms: [
                (if_arm
                  cond: [
                    (command.Sentence
                      child: 
                        (C {<Id.Lit_LBracket '['>} {($ Id.VSub_DollarName '$rank2')} {<-eq>} {<0>} 
                          {<Id.Lit_RBracket ']'>}
                        )
                      terminator: <Id.Op_Semi _>
                    )
                  ]
                  action: [
                    (command.Sentence
                      child: 
                        (command.ShAssignment
                          pairs: [
                            (assign_pair
                              lhs: (sh_lhs_expr.Name name:rank2)
                              op: assign_op.Equal
                              rhs: {<13>}
                              spids: [804]
                            )
                          ]
                        )
                      terminator: <Id.Op_Semi _>
                    )
                  ]
                  spids: [787 801]
                )
              ]
            )
            (command.If
              arms: [
                (if_arm
                  cond: [
                    (command.Sentence
                      child: 
                        (C {<Id.Lit_LBracket '['>} {($ Id.VSub_DollarName '$rank3')} {<-eq>} {<0>} 
                          {<Id.Lit_RBracket ']'>}
                        )
                      terminator: <Id.Op_Semi _>
                    )
                  ]
                  action: [
                    (command.Sentence
                      child: 
                        (command.ShAssignment
                          pairs: [
                            (assign_pair
                              lhs: (sh_lhs_expr.Name name:rank3)
                              op: assign_op.Equal
                              rhs: {<13>}
                              spids: [829]
                            )
                          ]
                        )
                      terminator: <Id.Op_Semi _>
                    )
                  ]
                  spids: [812 826]
                )
              ]
            )
            (command.If
              arms: [
                (if_arm
                  cond: [
                    (command.Sentence
                      child: 
                        (C {<Id.Lit_LBracket '['>} {($ Id.VSub_DollarName '$rank1')} {<-gt>} 
                          {($ Id.VSub_DollarName '$rank2')} {<Id.Lit_RBracket ']'>}
                        )
                      terminator: <Id.Op_Semi _>
                    )
                  ]
                  action: [
                    (command.Sentence
                      child: 
                        (command.ShAssignment
                          pairs: [
                            (assign_pair
                              lhs: (sh_lhs_expr.Name name:temp)
                              op: assign_op.Equal
                              rhs: {($ Id.VSub_DollarName '$card1')}
                              spids: [860]
                            )
                          ]
                        )
                      terminator: <Id.Op_Semi _>
                    )
                    (command.Sentence
                      child: 
                        (command.ShAssignment
                          pairs: [
                            (assign_pair
                              lhs: (sh_lhs_expr.Name name:card1)
                              op: assign_op.Equal
                              rhs: {($ Id.VSub_DollarName '$card2')}
                              spids: [864]
                            )
                          ]
                        )
                      terminator: <Id.Op_Semi _>
                    )
                    (command.ShAssignment
                      pairs: [
                        (assign_pair
                          lhs: (sh_lhs_expr.Name name:card2)
                          op: assign_op.Equal
                          rhs: {($ Id.VSub_DollarName '$temp')}
                          spids: [868]
                        )
                      ]
                    )
                    (command.Sentence
                      child: 
                        (command.ShAssignment
                          pairs: [
                            (assign_pair
                              lhs: (sh_lhs_expr.Name name:temp)
                              op: assign_op.Equal
                              rhs: {($ Id.VSub_DollarName '$rank1')}
                              spids: [872]
                            )
                          ]
                        )
                      terminator: <Id.Op_Semi _>
                    )
                    (command.Sentence
                      child: 
                        (command.ShAssignment
                          pairs: [
                            (assign_pair
                              lhs: (sh_lhs_expr.Name name:rank1)
                              op: assign_op.Equal
                              rhs: {($ Id.VSub_DollarName '$rank2')}
                              spids: [876]
                            )
                          ]
                        )
                      terminator: <Id.Op_Semi _>
                    )
                    (command.ShAssignment
                      pairs: [
                        (assign_pair
                          lhs: (sh_lhs_expr.Name name:rank2)
                          op: assign_op.Equal
                          rhs: {($ Id.VSub_DollarName '$temp')}
                          spids: [880]
                        )
                      ]
                    )
                  ]
                  spids: [843 857]
                )
              ]
            )
            (command.Sentence
              child: (C {<showCard>} {($ Id.VSub_DollarName '$card1')})
              terminator: <Id.Op_Semi _>
            )
            (command.ShAssignment
              pairs: [
                (assign_pair
                  lhs: (sh_lhs_expr.Name name:cardname1)
                  op: assign_op.Equal
                  rhs: {($ Id.VSub_DollarName '$cardname')}
                  spids: [894]
                )
              ]
            )
            (command.Sentence
              child: (C {<showCard>} {($ Id.VSub_DollarName '$card2')})
              terminator: <Id.Op_Semi _>
            )
            (command.ShAssignment
              pairs: [
                (assign_pair
                  lhs: (sh_lhs_expr.Name name:cardname2)
                  op: assign_op.Equal
                  rhs: {($ Id.VSub_DollarName '$cardname')}
                  spids: [904]
                )
              ]
            )
            (command.Sentence
              child: (C {<showCard>} {($ Id.VSub_DollarName '$card3')})
              terminator: <Id.Op_Semi _>
            )
            (command.ShAssignment
              pairs: [
                (assign_pair
                  lhs: (sh_lhs_expr.Name name:cardname3)
                  op: assign_op.Equal
                  rhs: {($ Id.VSub_DollarName '$cardname')}
                  spids: [915]
                )
              ]
            )
            (command.Sentence
              child: (C {<echo>} {(DQ <'I\'ve dealt:'>)})
              terminator: <Id.Op_Semi _>
            )
            (command.Sentence
              child: (C {<echo>} {(DQ <'   '> ($ Id.VSub_DollarName '$cardname1'))})
              terminator: <Id.Op_Semi _>
            )
            (C {<echo>} {(DQ <'   '> ($ Id.VSub_DollarName '$cardname2'))})
          ]
        )
    )
    (command.ShFunction
      name: introblurb
      body: 
        (BraceGroup
          children: [
            (command.Simple
              words: [{<cat>}]
              redirects: [
                (redir
                  op: <Id.Redir_DLess '<<'>
                  loc: (redir_loc.Fd fd:0)
                  arg: 
                    (redir_param.MultiLine
                      here_begin: {<EOF>}
                      here_end_span_id: 971
                      stdin_parts: [
                        <'\n'>
                        <
'Welcome to Acey Deucey. The goal of this game is for you to correctly guess\n'
                        >
                        <
'whether the third card is going to be between the two cards I\'ll pull from\n'
                        >
                        <
'the deck. For example, if I flip up a 5 of hearts and a jack of diamonds, you\'d bet on whether the next card will have a higher rank than a 5 AND a lower rank than a jack (e.g., a 6, 7, 8, 9, or 10 of any suit).\n'
                        >
                        <'\n'>
                        <'Ready? Let\'s go!\n'>
                        <'\n'>
                      ]
                    )
                )
              ]
              do_fork: T
            )
          ]
        )
    )
    (command.ShAssignment
      pairs: [
        (assign_pair
          lhs: (sh_lhs_expr.Name name:games)
          op: assign_op.Equal
          rhs: {<0>}
          spids: [982]
        )
      ]
    )
    (command.ShAssignment
      pairs: [(assign_pair lhs:(sh_lhs_expr.Name name:won) op:assign_op.Equal rhs:{<0>} spids:[985])]
    )
    (command.If
      arms: [
        (if_arm
          cond: [
            (command.Sentence
              child: 
                (C {<Id.Lit_LBracket '['>} {($ Id.VSub_Pound '$#')} {<-gt>} {<0>} {<Id.Lit_RBracket ']'>})
              terminator: <Id.Op_Semi _>
            )
          ]
          action: [(C {<introblurb>})]
          spids: [989 1003]
        )
      ]
    )
    (command.WhileUntil
      keyword: <Id.KW_While while>
      cond: [
        (command.Sentence
          child: (C {<Id.Lit_LBracket '['>} {<'/bin/true'>} {<Id.Lit_RBracket ']'>})
          terminator: <Id.Op_Semi _>
        )
      ]
      body: 
        (command.DoGroup
          children: [
            (C {<initializeDeck>})
            (C {<shuffleDeck>})
            (C {<dealCards>})
            (command.ShAssignment
              pairs: [
                (assign_pair
                  lhs: (sh_lhs_expr.Name name:splitValue)
                  op: assign_op.Equal
                  rhs: 
                    {
                      (word_part.ArithSub
                        anode: 
                          (arith_expr.Binary
                            op_id: Id.Arith_Minus
                            left: {($ Id.VSub_DollarName '$rank2')}
                            right: {($ Id.VSub_DollarName '$rank1')}
                          )
                      )
                    }
                  spids: [1043]
                )
              ]
            )
            (command.If
              arms: [
                (if_arm
                  cond: [
                    (command.Sentence
                      child: 
                        (C {<Id.Lit_LBracket '['>} {($ Id.VSub_DollarName '$splitValue')} {<-eq>} {<0>} 
                          {<Id.Lit_RBracket ']'>}
                        )
                      terminator: <Id.Op_Semi _>
                    )
                  ]
                  action: [
                    (C {<echo>} {(DQ <'No point in betting when they\'re the same rank!'>)})
                    (command.ControlFlow token:<Id.ControlFlow_Continue continue>)
                  ]
                  spids: [1057 1071]
                )
              ]
            )
            (C {<'/bin/echo'>} {<-n>} 
              {
                (DQ <'The spread is '> ($ Id.VSub_DollarName '$splitValue') 
                  <'. Do you think the next card will '>
                )
              }
            )
            (C {<'/bin/echo'>} {<-n>} {(DQ <'be between them? (y/n/q) '>)})
            (C {<read>} {<answer>})
            (command.If
              arms: [
                (if_arm
                  cond: [
                    (command.Sentence
                      child: 
                        (C {<Id.Lit_LBracket '['>} {(DQ ($ Id.VSub_DollarName '$answer'))} 
                          {<Id.Lit_Equals '='>} {(DQ <q>)} {<Id.Lit_RBracket ']'>}
                        )
                      terminator: <Id.Op_Semi _>
                    )
                  ]
                  action: [
                    (C {<echo>} {(DQ )})
                    (C {<echo>} 
                      {
                        (DQ <'You played '> ($ Id.VSub_DollarName '$games') <' games and won '> 
                          ($ Id.VSub_DollarName '$won') <' times.'>
                        )
                      }
                    )
                    (command.ControlFlow
                      token: <Id.ControlFlow_Exit exit>
                      arg_word: {<0>}
                    )
                  ]
                  spids: [1114 1132]
                )
              ]
            )
            (C {<echo>} {(DQ <'I picked: '> ($ Id.VSub_DollarName '$cardname3'))})
            (command.If
              arms: [
                (if_arm
                  cond: [
                    (command.Sentence
                      child: 
                        (C {<Id.Lit_LBracket '['>} {($ Id.VSub_DollarName '$rank3')} {<-gt>} 
                          {($ Id.VSub_DollarName '$rank1')} {<-a>} {($ Id.VSub_DollarName '$rank3')} {<-lt>} {($ Id.VSub_DollarName '$rank2')} {<Id.Lit_RBracket ']'>}
                        )
                      terminator: <Id.Op_Semi _>
                    )
                  ]
                  action: [
                    (command.ShAssignment
                      pairs: [
                        (assign_pair
                          lhs: (sh_lhs_expr.Name name:winner)
                          op: assign_op.Equal
                          rhs: {<1>}
                          spids: [1204]
                        )
                      ]
                    )
                  ]
                  spids: [1176 1198]
                )
              ]
              else_action: [
                (command.ShAssignment
                  pairs: [
                    (assign_pair
                      lhs: (sh_lhs_expr.Name name:winner)
                      op: assign_op.Equal
                      rhs: {<0>}
                      spids: [1211]
                    )
                  ]
                )
              ]
            )
            (command.If
              arms: [
                (if_arm
                  cond: [
                    (command.Sentence
                      child: 
                        (C {<Id.Lit_LBracket '['>} {($ Id.VSub_DollarName '$winner')} {<-eq>} {<1>} {<-a>} 
                          {(DQ ($ Id.VSub_DollarName '$answer'))} {<Id.Lit_Equals '='>} {(DQ <y>)} {<Id.Lit_RBracket ']'>}
                        )
                      terminator: <Id.Op_Semi _>
                    )
                  ]
                  action: [
                    (C {<echo>} {(DQ <'You bet that it would be between the two, and it is. WIN!'>)})
                    (command.ShAssignment
                      pairs: [
                        (assign_pair
                          lhs: (sh_lhs_expr.Name name:won)
                          op: assign_op.Equal
                          rhs: 
                            {
                              (word_part.ArithSub
                                anode: 
                                  (arith_expr.Binary
                                    op_id: Id.Arith_Plus
                                    left: {($ Id.VSub_DollarName '$won')}
                                    right: {<Id.Lit_Digits 1>}
                                  )
                              )
                            }
                          spids: [1256]
                        )
                      ]
                    )
                  ]
                  spids: [1220 1246]
                )
                (if_arm
                  cond: [
                    (command.Sentence
                      child: 
                        (C {<Id.Lit_LBracket '['>} {($ Id.VSub_DollarName '$winner')} {<-eq>} {<0>} {<-a>} 
                          {(DQ ($ Id.VSub_DollarName '$answer'))} {<Id.Lit_Equals '='>} {(DQ <n>)} {<Id.Lit_RBracket ']'>}
                        )
                      terminator: <Id.Op_Semi _>
                    )
                  ]
                  action: [
                    (C {<echo>} 
                      {(DQ <'You bet that it would not be between the two, and it isn\'t. WIN!'>)}
                    )
                    (command.ShAssignment
                      pairs: [
                        (assign_pair
                          lhs: (sh_lhs_expr.Name name:won)
                          op: assign_op.Equal
                          rhs: 
                            {
                              (word_part.ArithSub
                                anode: 
                                  (arith_expr.Binary
                                    op_id: Id.Arith_Plus
                                    left: {($ Id.VSub_DollarName '$won')}
                                    right: {<Id.Lit_Digits 1>}
                                  )
                              )
                            }
                          spids: [1305]
                        )
                      ]
                    )
                  ]
                  spids: [1269 1295]
                )
              ]
              else_action: [(C {<echo>} {(DQ <'Bad betting strategy. You lose.'>)})]
            )
            (command.ShAssignment
              pairs: [
                (assign_pair
                  lhs: (sh_lhs_expr.Name name:games)
                  op: assign_op.Equal
                  rhs: 
                    {
                      (word_part.ArithSub
                        anode: 
                          (arith_expr.Binary
                            op_id: Id.Arith_Plus
                            left: {($ Id.VSub_DollarName '$games')}
                            right: {<Id.Lit_Digits 1>}
                          )
                      )
                    }
                  spids: [1332]
                )
              ]
            )
          ]
        )
    )
    (command.ControlFlow token:<Id.ControlFlow_Exit exit> arg_word:{<0>})
  ]
)