(command.CommandList
  children: [
    (C {(export)} {(Lit_VarLike 'LANG=') (C)})
    (C {(ulimit)} {(-c)} {(0)})
    (C {(trap)} {(SQ )} {(TSTP)})
    (command.AndOr
      ops: [Op_DAmp]
      children: [
        (command.ShAssignment
          pairs: [
            (assign_pair
              lhs: (sh_lhs_expr.Name name:save_tty)
              op: Equal
              rhs: 
                {
                  (command_sub
                    left_token: <Left_Backtick '`'>
                    command_list: (command.CommandList children:[(C {(stty)} {(-g)})])
                  )
                }
            )
          ]
        )
        (C {(trap)} {(DQ ('stty ') ($ VSub_DollarName '$save_tty'))} {(EXIT)})
      ]
    )
    (C {(stty)} {(quit)} {(SQ <' '>)})
    (C {(stty)} {(eof)} {(SQ <'?'>)})
    (C {(stty)} {(-echo)})
    (command.ShFunction
      name: cache_progs
      body: 
        (command.BraceGroup
          children: [
            (command.Simple
              words: [{(stty)}]
              redirects: [(redir.Redir op:<Redir_Great '>'> fd:16777215 arg_word:{(/dev/null)})]
            )
            (command.Simple
              words: [{(date)}]
              redirects: [(redir.Redir op:<Redir_Great '>'> fd:16777215 arg_word:{(/dev/null)})]
            )
            (command.Simple
              words: [{(grep)} {(.)}]
              redirects: [(redir.Redir op:<Redir_Less '<'> fd:16777215 arg_word:{(/dev/null)})]
            )
            (command.Subshell
              command_list: 
                (command.CommandList
                  children: [
                    (command.Pipeline
                      children: [(C {(echo)} {(DQ ('import time'))}) (C {(python)})]
                      negated: F
                    )
                  ]
                )
              redirects: [(redir.Redir op:<Redir_Great '2>'> fd:2 arg_word:{(/dev/null)})]
            )
            (command.Simple
              words: [{(bc)}]
              redirects: [(redir.Redir op:<Redir_Less '<'> fd:16777215 arg_word:{(/dev/null)})]
            )
            (command.Simple
              words: [{(sed)} {(SQ )}]
              redirects: [(redir.Redir op:<Redir_Less '<'> fd:16777215 arg_word:{(/dev/null)})]
            )
            (command.Simple
              words: [{(printf)} {(SQ <1>)}]
              redirects: [(redir.Redir op:<Redir_Great '>'> fd:16777215 arg_word:{(/dev/null)})]
            )
            (command.Simple
              words: [{(/usr/bin/time)} {(false)}]
              redirects: [(redir.Redir op:<Redir_Great '2>'> fd:2 arg_word:{(/dev/null)})]
            )
            (command.Simple
              words: [{(cat)}]
              redirects: [(redir.Redir op:<Redir_Less '<'> fd:16777215 arg_word:{(/dev/null)})]
            )
          ]
        )
    )
    (C {(cache_progs)})
    (command.AndOr
      ops: [Op_DAmp]
      children: [
        (command.Pipeline
          children: [
            (C {(date)} {(Lit_Other '+') (Lit_Other '%') (s.) (Lit_Other '%') (N)})
            (C {(grep)} {(-qF)} {(SQ <N>)})
          ]
          negated: F
        )
        (command.ShAssignment
          pairs: [(assign_pair lhs:(sh_lhs_expr.Name name:use_python) op:Equal rhs:{(1)})]
        )
      ]
    )
    (command.ShFunction
      name: now
      body: 
        (command.BraceGroup
          children: [
            (command.If
              arms: [
                (if_arm
                  cond: [
                    (command.Sentence
                      child: 
                        (C {(Lit_LBracket '[')} {(DQ ($ VSub_DollarName '$use_python'))} 
                          {(Lit_RBracket ']')}
                        )
                      terminator: <Op_Semi ';'>
                    )
                  ]
                  action: [
                    (command.Pipeline
                      children: [
                        (command.Simple
                          words: [{(echo)} {(DQ ('import time; print time.time()'))}]
                          redirects: [(redir.Redir op:<Redir_Great '2>'> fd:2 arg_word:{(/dev/null)})]
                        )
                        (C {(python)})
                      ]
                      negated: F
                    )
                  ]
                )
              ]
              else_action: [
                (C {(printf)} {(DQ ('%.2f'))} 
                  {
                    (command_sub
                      left_token: <Left_Backtick '`'>
                      command_list: 
                        (command.CommandList
                          children: [
                            (C {(date)} {(Lit_Other '+') (Lit_Other '%') (s.) (Lit_Other '%') (N)})
                          ]
                        )
                    )
                  }
                )
              ]
            )
          ]
        )
    )
    (command.ShFunction
      name: fmt_seconds
      body: 
        (command.BraceGroup
          children: [
            (command.ShAssignment
              pairs: [
                (assign_pair
                  lhs: (sh_lhs_expr.Name name:seconds)
                  op: Equal
                  rhs: {($ VSub_Number '$1')}
                )
              ]
            )
            (command.ShAssignment
              pairs: [
                (assign_pair
                  lhs: (sh_lhs_expr.Name name:mins)
                  op: Equal
                  rhs: 
                    {
                      (command_sub
                        left_token: <Left_Backtick '`'>
                        command_list: 
                          (command.CommandList
                            children: [
                              (command.Pipeline
                                children: [
                                  (C {(echo)} {($ VSub_DollarName '$seconds') (/60)})
                                  (C {(bc)})
                                ]
                                negated: F
                              )
                            ]
                          )
                      )
                    }
                )
              ]
            )
            (command.If
              arms: [
                (if_arm
                  cond: [
                    (command.Sentence
                      child: 
                        (C {(Lit_LBracket '[')} {(DQ ($ VSub_DollarName '$mins'))} 
                          {(KW_Bang '!') (Lit_Equals '=')} {(DQ (0))} {(Lit_RBracket ']')}
                        )
                      terminator: <Op_Semi ';'>
                    )
                  ]
                  action: [
                    (command.ShAssignment
                      pairs: [
                        (assign_pair
                          lhs: (sh_lhs_expr.Name name:seconds)
                          op: Equal
                          rhs: 
                            {
                              (command_sub
                                left_token: <Left_Backtick '`'>
                                command_list: 
                                  (command.CommandList
                                    children: [
                                      (command.Pipeline
                                        children: [
                                          (C {(echo)} 
                                            {
                                              (DQ ($ VSub_DollarName '$seconds') (' - (') 
                                                ($ VSub_DollarName '$mins') ('*60)')
                                              )
                                            }
                                          )
                                          (C {(bc)})
                                        ]
                                        negated: F
                                      )
                                    ]
                                  )
                              )
                            }
                        )
                      ]
                    )
                    (C {(echo)} {(DQ ($ VSub_DollarName '$mins') (':') ($ VSub_DollarName '$seconds'))})
                  ]
                )
              ]
              else_action: [(C {(echo)} {(DQ ($ VSub_DollarName '$seconds'))})]
            )
          ]
        )
    )
    (command.ShFunction
      name: total
      body: 
        (command.BraceGroup
          children: [
            (command.ShAssignment
              pairs: [
                (assign_pair
                  lhs: (sh_lhs_expr.Name name:end)
                  op: Equal
                  rhs: 
                    {
                      (command_sub
                        left_token: <Left_Backtick '`'>
                        command_list: (command.CommandList children:[(C {(now)})])
                      )
                    }
                )
              ]
            )
            (command.ShAssignment
              pairs: [
                (assign_pair
                  lhs: (sh_lhs_expr.Name name:total)
                  op: Equal
                  rhs: 
                    {
                      (command_sub
                        left_token: <Left_Backtick '`'>
                        command_list: 
                          (command.CommandList
                            children: [
                              (command.Pipeline
                                children: [
                                  (C {(echo)} 
                                    {
                                      (DQ ($ VSub_DollarName '$end') (' - ') 
                                        ($ VSub_DollarName '$start')
                                      )
                                    }
                                  )
                                  (C {(bc)})
                                ]
                                negated: F
                              )
                            ]
                          )
                      )
                    }
                )
              ]
            )
            (C {(fmt_seconds)} {($ VSub_DollarName '$total')})
          ]
        )
    )
    (command.ShFunction
      name: stop
      body: 
        (command.BraceGroup
          children: [
            (command.AndOr
              ops: [Op_DAmp]
              children: [
                (C {(Lit_LBracket '[')} {(DQ ($ VSub_DollarName '$lapped'))} {(Lit_RBracket ']')})
                (C {(lap)} {(DQ ($ VSub_DollarName '$laptime'))} {(DQ (display))})
              ]
            )
            (C {(total)})
            (command.ControlFlow token:<ControlFlow_Exit exit>)
          ]
        )
    )
    (command.ShFunction
      name: lap
      body: 
        (command.BraceGroup
          children: [
            (command.ShAssignment
              pairs: [
                (assign_pair
                  lhs: (sh_lhs_expr.Name name:laptime)
                  op: Equal
                  rhs: 
                    {
                      (command_sub
                        left_token: <Left_Backtick '`'>
                        command_list: 
                          (command.CommandList
                            children: [
                              (command.Pipeline
                                children: [
                                  (C {(echo)} {(DQ ($ VSub_Number '$1'))})
                                  (C {(sed)} {(-n)} {(SQ <'s/.*real[^0-9.]*\\(.*\\)/\\1/p'>)})
                                ]
                                negated: F
                              )
                            ]
                          )
                      )
                    }
                )
              ]
            )
            (command.AndOr
              ops: [Op_DAmp]
              children: [
                (C {(Lit_LBracket '[')} {(KW_Bang '!')} {(DQ ($ VSub_DollarName '$laptime'))} {(-o)} 
                  {(DQ ($ VSub_DollarName '$laptime'))} {(Lit_Equals '=')} {(DQ (0.00))} {(Lit_RBracket ']')}
                )
                (command.ControlFlow token:<ControlFlow_Return return>)
              ]
            )
            (command.ShAssignment
              pairs: [
                (assign_pair
                  lhs: (sh_lhs_expr.Name name:laptotal)
                  op: Equal
                  rhs: 
                    {
                      (command_sub
                        left_token: <Left_Backtick '`'>
                        command_list: 
                          (command.CommandList
                            children: [
                              (command.Pipeline
                                children: [
                                  (C {(echo)} 
                                    {($ VSub_DollarName '$laptime') (Lit_Other '+') (0) 
                                      ($ VSub_DollarName '$laptotal')
                                    }
                                  )
                                  (C {(bc)})
                                ]
                                negated: F
                              )
                            ]
                          )
                      )
                    }
                )
              ]
            )
            (command.If
              arms: [
                (if_arm
                  cond: [
                    (command.Sentence
                      child: 
                        (C {(Lit_LBracket '[')} {(DQ ($ VSub_Number '$2'))} {(Lit_Equals '=')} 
                          {(DQ (display))} {(Lit_RBracket ']')}
                        )
                      terminator: <Op_Semi ';'>
                    )
                  ]
                  action: [
                    (command.ShAssignment
                      pairs: [
                        (assign_pair
                          lhs: (sh_lhs_expr.Name name:lapcount)
                          op: Equal
                          rhs: 
                            {
                              (command_sub
                                left_token: <Left_Backtick '`'>
                                command_list: 
                                  (command.CommandList
                                    children: [
                                      (command.Pipeline
                                        children: [
                                          (C {(echo)} 
                                            {(0) ($ VSub_DollarName '$lapcount') (Lit_Other '+') (1)}
                                          )
                                          (C {(bc)})
                                        ]
                                        negated: F
                                      )
                                    ]
                                  )
                              )
                            }
                        )
                      ]
                    )
                    (command.ShAssignment
                      pairs: [
                        (assign_pair
                          lhs: (sh_lhs_expr.Name name:laptime)
                          op: Equal
                          rhs: 
                            {
                              (command_sub
                                left_token: <Left_Backtick '`'>
                                command_list: 
                                  (command.CommandList
                                    children: [(C {(fmt_seconds)} {($ VSub_DollarName '$laptotal')})]
                                  )
                              )
                            }
                        )
                      ]
                    )
                    (C {(echo)} {($ VSub_DollarName '$laptime')} 
                      {(DQ ('(') ($ VSub_DollarName '$lapcount') (')'))}
                    )
                    (command.ShAssignment
                      pairs: [
                        (assign_pair
                          lhs: (sh_lhs_expr.Name name:lapped)
                          op: Equal
                          rhs: {(DQ (true))}
                        )
                      ]
                    )
                    (command.ShAssignment
                      pairs: [(assign_pair lhs:(sh_lhs_expr.Name name:laptotal) op:Equal rhs:{(DQ (0))})]
                    )
                  ]
                )
              ]
            )
          ]
        )
    )
    (command.Simple
      words: [{(printf)} {(DQ ('Space for lap | ? for split | Ctrl-C to stop | Space to start...'))}]
      redirects: [(redir.Redir op:<Redir_GreatAnd '>&'> fd:16777215 arg_word:{(2)})]
    )
    (command.WhileUntil
      keyword: <KW_While while>
      cond: [(command.Sentence child:(C {(true)}) terminator:<Op_Semi ';'>)]
      body: 
        (command.DoGroup
          children: [
            (C {(trap)} {(true)} {(INT)} {(QUIT)})
            (command.ShAssignment
              pairs: [
                (assign_pair
                  lhs: (sh_lhs_expr.Name name:laptime)
                  op: Equal
                  rhs: 
                    {
                      (command_sub
                        left_token: <Left_Backtick '`'>
                        command_list: 
                          (command.CommandList
                            children: [
                              (command.Simple
                                words: [{(/usr/bin/time)} {(-p)} {(cat)}]
                                redirects: [
                                  (redir.Redir
                                    op: <Redir_GreatAnd '2>&'>
                                    fd: 2
                                    arg_word: {(1)}
                                  )
                                  (redir.Redir
                                    op: <Redir_Great '>'>
                                    fd: 16777215
                                    arg_word: {(/dev/null)}
                                  )
                                ]
                              )
                            ]
                          )
                      )
                    }
                )
              ]
            )
            (command.ShAssignment
              pairs: [(assign_pair lhs:(sh_lhs_expr.Name name:ret) op:Equal rhs:{($ VSub_QMark '$?')})]
            )
            (C {(trap)} {(SQ )} {(INT)} {(QUIT)})
            (command.If
              arms: [
                (if_arm
                  cond: [
                    (command.Sentence
                      child: 
                        (C {(Lit_LBracket '[')} {($ VSub_DollarName '$ret')} {(-eq)} {(1)} {(-o)} 
                          {($ VSub_DollarName '$ret')} {(-eq)} {(2)} {(-o)} {($ VSub_DollarName '$ret')} {(-eq)} {(130)} {(Lit_RBracket ']')}
                        )
                      terminator: <Op_Semi ';'>
                    )
                  ]
                  action: [
                    (command.AndOr
                      ops: [Op_DAmp]
                      children: [
                        (C {(Lit_LBracket '[')} {(KW_Bang '!')} {(DQ ($ VSub_DollarName '$start'))} 
                          {(Lit_RBracket ']')}
                        )
                        (command.BraceGroup
                          children: [
                            (command.Sentence
                              child: 
                                (command.Simple
                                  words: [{(echo)}]
                                  redirects: [
                                    (redir.Redir
                                      op: <Redir_GreatAnd '>&'>
                                      fd: 16777215
                                      arg_word: {(2)}
                                    )
                                  ]
                                )
                              terminator: <Op_Semi ';'>
                            )
                            (command.Sentence
                              child: (command.ControlFlow token:<ControlFlow_Exit exit>)
                              terminator: <Op_Semi ';'>
                            )
                          ]
                        )
                      ]
                    )
                    (C {(stop)})
                  ]
                )
                (if_arm
                  cond: [
                    (command.Sentence
                      child: 
                        (C {(Lit_LBracket '[')} {($ VSub_DollarName '$ret')} {(-eq)} {(3)} {(-o)} 
                          {($ VSub_DollarName '$ret')} {(-eq)} {(131)} {(Lit_RBracket ']')}
                        )
                      terminator: <Op_Semi ';'>
                    )
                  ]
                  action: [
                    (command.If
                      arms: [
                        (if_arm
                          cond: [
                            (command.Sentence
                              child: 
                                (C {(Lit_LBracket '[')} {(KW_Bang '!')} 
                                  {(DQ ($ VSub_DollarName '$start'))} {(Lit_RBracket ']')}
                                )
                              terminator: <Op_Semi ';'>
                            )
                          ]
                          action: [
                            (command.AndOr
                              ops: [Op_DPipe]
                              children: [
                                (command.ShAssignment
                                  pairs: [
                                    (assign_pair
                                      lhs: (sh_lhs_expr.Name name:start)
                                      op: Equal
                                      rhs: 
                                        {
                                          (command_sub
                                            left_token: <Left_Backtick '`'>
                                            command_list: 
                                              (command.CommandList
                                                children: [(C {(now)})]
                                              )
                                          )
                                        }
                                    )
                                  ]
                                )
                                (command.ControlFlow
                                  token: <ControlFlow_Exit exit>
                                  arg_word: {(1)}
                                )
                              ]
                            )
                            (command.Simple
                              words: [{(echo)}]
                              redirects: [
                                (redir.Redir
                                  op: <Redir_GreatAnd '>&'>
                                  fd: 16777215
                                  arg_word: {(2)}
                                )
                              ]
                            )
                            (command.ControlFlow
                              token: <ControlFlow_Continue continue>
                            )
                          ]
                        )
                      ]
                    )
                    (C {(lap)} {(DQ ($ VSub_DollarName '$laptime'))} {(DQ (display))})
                  ]
                )
              ]
              else_action: [
                (command.AndOr
                  ops: [Op_DAmp]
                  children: [
                    (C {(Lit_LBracket '[')} {(KW_Bang '!')} {(DQ ($ VSub_DollarName '$start'))} 
                      {(Lit_RBracket ']')}
                    )
                    (command.ControlFlow token:<ControlFlow_Continue continue>)
                  ]
                )
                (C {(total)})
                (C {(lap)} {(DQ ($ VSub_DollarName '$laptime'))})
              ]
            )
          ]
        )
    )
  ]
)