(command.CommandList
  children: [
    (command.If
      arms: [
        (if_arm
          cond: 
            (condition.Shell
              commands: [
                (command.Sentence
                  child: 
                    (C {<Id.Lit_LBracket '['>} {(DQ ($ Id.VSub_Pound '$#'))} {<-lt>} {(DQ <2>)} 
                      {<Id.Lit_RBracket ']'>}
                    )
                  terminator: <Id.Op_Semi _>
                )
              ]
            )
          action: [
            (command.Simple
              words: [
                {<echo>}
                {
                  (DQ <'Usage:   '> 
                    (command_sub
                      left_token: <Id.Left_Backtick '`'>
                      child: (C {<basename>} {($ Id.VSub_Number '$0')})
                    ) <' timeout_in_seconds command'>
                  )
                }
              ]
              redirects: [(redir op:<Id.Redir_GreatAnd '>&'> loc:(redir_loc.Fd fd:1) arg:{<2>})]
              do_fork: T
            )
            (command.Simple
              words: [
                {<echo>}
                {
                  (DQ <'Example: '> 
                    (command_sub
                      left_token: <Id.Left_Backtick '`'>
                      child: (C {<basename>} {($ Id.VSub_Number '$0')})
                    ) <' 2 sleep 3 || echo timeout'>
                  )
                }
              ]
              redirects: [(redir op:<Id.Redir_GreatAnd '>&'> loc:(redir_loc.Fd fd:1) arg:{<2>})]
              do_fork: T
            )
            (command.ControlFlow token:<Id.ControlFlow_Exit exit> arg_word:{<1>})
          ]
          spids: [81 98]
        )
      ]
    )
    (command.ShFunction
      name: cleanup
      body: 
        (BraceGroup
          children: [
            (C {<trap>} {<->} {<ALRM>})
            (command.Simple
              words: [{<kill>} {<-ALRM>} {($ Id.VSub_DollarName '$a')}]
              redirects: [(redir op:<Id.Redir_Great '2>'> loc:(redir_loc.Fd fd:2) arg:{<'/dev/null'>})]
              do_fork: T
            )
            (command.AndOr
              ops: [Id.Op_DAmp]
              children: [
                (command.Simple
                  words: [{<kill>} {($ Id.VSub_Bang '$!')}]
                  redirects: [
                    (redir
                      op: <Id.Redir_Great '2>'>
                      loc: (redir_loc.Fd fd:2)
                      arg: {<'/dev/null'>}
                    )
                  ]
                  do_fork: T
                )
                (command.ControlFlow token:<Id.ControlFlow_Exit exit> arg_word:{<124>})
              ]
            )
          ]
        )
    )
    (command.ShFunction
      name: watchit
      body: 
        (BraceGroup
          children: [
            (C {<trap>} {(DQ <cleanup>)} {<ALRM>})
            (command.Sentence
              child: (C {<sleep>} {($ Id.VSub_Number '$1')})
              terminator: <Id.Op_Amp _>
            )
            (C {<wait>})
            (C {<kill>} {<-ALRM>} {($ Id.VSub_Dollar '$$')})
          ]
        )
    )
    (command.CommandList
      children: [
        (command.Sentence
          child: (C {<watchit>} {($ Id.VSub_Number '$1')})
          terminator: <Id.Op_Amp _>
        )
        (command.ShAssignment
          pairs: [
            (assign_pair
              lhs: (sh_lhs_expr.Name name:a)
              op: assign_op.Equal
              rhs: {($ Id.VSub_Bang '$!')}
              spids: [235]
            )
          ]
        )
      ]
    )
    (C {<shift>})
    (C {<trap>} {(DQ <cleanup>)} {<ALRM>} {<INT>})
    (command.CommandList
      children: [
        (command.Sentence child:(C {(DQ ($ Id.VSub_At '$@'))}) terminator:<Id.Op_Amp _>)
        (command.Sentence
          child: (C {<wait>} {($ Id.VSub_Bang '$!')})
          terminator: <Id.Op_Semi _>
        )
        (command.ShAssignment
          pairs: [
            (assign_pair
              lhs: (sh_lhs_expr.Name name:RET)
              op: assign_op.Equal
              rhs: {($ Id.VSub_QMark '$?')}
              spids: [269]
            )
          ]
        )
      ]
    )
    (C {<kill>} {<-ALRM>} {($ Id.VSub_DollarName '$a')})
    (C {<wait>} {($ Id.VSub_DollarName '$a')})
    (command.ControlFlow token:<Id.ControlFlow_Exit exit> arg_word:{($ Id.VSub_DollarName '$RET')})
  ]
)