(command.CommandList
  children: [
    (C {(set)} {(-u)})
    (command.Assignment
      keyword: Assign_None
      pairs: [
        (assign_pair
          lhs: (lhs_expr.LhsName name:ARGV0 spids:[45])
          op: Equal
          rhs: 
            {
              (word_part.CommandSubPart
                command_list: 
                  (command.CommandList
                    children: [(C {(basename)} {(DQ ($ VSub_Number '$0'))})]
                  )
                left_token: <Left_Backtick '`'>
                spids: [46 52]
              )
            }
          spids: [45]
        )
      ]
      spids: [45]
    )
    (command.Assignment
      keyword: Assign_None
      pairs: [
        (assign_pair
          lhs: (lhs_expr.LhsName name:ARGV0_DIR spids:[54])
          op: Equal
          rhs: 
            {
              (word_part.CommandSubPart
                command_list: 
                  (command.CommandList
                    children: [(C {(dirname)} {(DQ ($ VSub_Number '$0'))})]
                  )
                left_token: <Left_Backtick '`'>
                spids: [55 61]
              )
            }
          spids: [54]
        )
      ]
      spids: [54]
    )
    (command.Assignment
      keyword: Assign_None
      pairs: [
        (assign_pair
          lhs: (lhs_expr.LhsName name:SHLIB_DIR spids:[63])
          op: Equal
          rhs: {(DQ (${ VSub_Name ARGV0_DIR) (/../lib))}
          spids: [63]
        )
      ]
      spids: [63]
    )
    (command.AndOr
      ops: [Op_DPipe]
      children: [
        (C {(.)} 
          {
            (word_part.BracedVarSub
              token: <VSub_Name SHFLAGS_LIB>
              suffix_op: 
                (suffix_op.StringUnary
                  op_id: VTest_ColonHyphen
                  arg_word: {(${ VSub_Name SHLIB_DIR) (Lit_Slash /) (shflags)}
                )
              spids: [77 85]
            )
          }
        )
        (command.Subshell
          child: 
            (command.CommandList
              children: [
                (command.Sentence
                  child: 
                    (command.SimpleCommand
                      words: [{(echo)} {(SQ <'unable to load shflags library'>)}]
                      redirects: [(redir.Redir op:<Redir_GreatAnd '>&'> fd:16777215 arg_word:{(2)})]
                    )
                  terminator: <Op_Semi ';'>
                )
                (command.ControlFlow token:<ControlFlow_Exit exit> arg_word:{(1)})
              ]
            )
          spids: [91 105]
        )
      ]
    )
    (command.AndOr
      ops: [Op_DPipe]
      children: [
        (C {(.)} 
          {
            (word_part.BracedVarSub
              token: <VSub_Name VERSIONS_LIB>
              suffix_op: 
                (suffix_op.StringUnary
                  op_id: VTest_ColonHyphen
                  arg_word: {(${ VSub_Name SHLIB_DIR) (Lit_Slash /) (versions)}
                )
              spids: [109 117]
            )
          }
        )
        (command.Subshell
          child: 
            (command.CommandList
              children: [
                (command.Sentence
                  child: 
                    (command.SimpleCommand
                      words: [{(echo)} {(SQ <'unable to load versions library'>)}]
                      redirects: [(redir.Redir op:<Redir_GreatAnd '>&'> fd:16777215 arg_word:{(2)})]
                    )
                  terminator: <Op_Semi ';'>
                )
                (command.ControlFlow token:<ControlFlow_Exit exit> arg_word:{(1)})
              ]
            )
          spids: [123 137]
        )
      ]
    )
    (command.Assignment
      keyword: Assign_None
      pairs: [
        (assign_pair
          lhs: (lhs_expr.LhsName name:OUTPUT_FILE spids:[140])
          op: Equal
          rhs: {(DQ (${ VSub_Name VERSIONS_OS_NAME) (_) (${ VSub_Name VERSIONS_OS_RELEASE))}
          spids: [140]
        )
      ]
      spids: [140]
    )
    (C {(DEFINE_string)} {(SQ <command>)} {(SQ )} {(SQ <'the command to start a build'>)} {(SQ <c>)})
    (C {(DEFINE_string)} {(SQ <watch>)} {(SQ )} {(SQ <'file to watch for changes'>)} {(SQ <w>)})
    (C {(DEFINE_string)} {(SQ <watch_from>)} {(SQ )} {(SQ <'file containing filenames to watch'>)} 
      {(SQ <W>)}
    )
    (C {(DEFINE_string)} {(SQ <output>)} {(DQ (${ VSub_Name OUTPUT_FILE))} 
      {(SQ <'output file to write to'>)} {(SQ <o>)}
    )
    (C {(DEFINE_string)} {(SQ <output_dir>)} {(SQ <.>)} {(SQ <'directory to write output file'>)} 
      {(SQ <O>)}
    )
    (C {(DEFINE_integer)} {(SQ <pause>)} {(60)} {(SQ <'pause between successive runs (sec)'>)} {(SQ <p>)})
    (command.Assignment
      keyword: Assign_None
      pairs: [
        (assign_pair
          lhs: (lhs_expr.LhsName name:FLAGS_HELP spids:[261])
          op: Equal
          rhs: {(DQ ('USAGE: ') (${ VSub_Name ARGV0) (' [flags]'))}
          spids: [261]
        )
      ]
      spids: [261]
    )
    (command.FuncDef
      name: die
      body: 
        (command.BraceGroup
          children: [
            (command.AndOr
              ops: [Op_DAmp]
              children: [
                (C {(Lit_Other '[')} {($ VSub_Pound '$#')} {(-ne)} {(0)} {(Lit_Other ']')})
                (command.SimpleCommand
                  words: [{(echo)} {(DQ ($ VSub_At '$@'))}]
                  redirects: [(redir.Redir op:<Redir_GreatAnd '>&'> fd:16777215 arg_word:{(2)})]
                )
              ]
            )
            (C {(flags_help)})
            (command.ControlFlow token:<ControlFlow_Exit exit> arg_word:{(1)})
          ]
          spids: [303]
        )
      spids: [299 302]
    )
    (command.FuncDef
      name: isodate
      body: 
        (command.BraceGroup
          children: [(C {(date)} {(-u)} {(SQ <'+%Y%m%dT%H%M%SZ'>)})]
          spids: [360]
        )
      spids: [356 359]
    )
    (command.FuncDef
      name: age
      body: 
        (command.BraceGroup
          children: [
            (command.Assignment
              keyword: Assign_None
              pairs: [
                (assign_pair
                  lhs: (lhs_expr.LhsName name:awkScript spids:[381])
                  op: Equal
                  rhs: {(SQ )}
                  spids: [381]
                )
              ]
              spids: [381]
            )
            (command.Case
              to_match: {(${ VSub_Name VERSIONS_OS_NAME)}
              arms: [
                (case_arm
                  pat_list: [{(FreeBSD)} {(Solaris)}]
                  action: [
                    (command.Assignment
                      keyword: Assign_None
                      pairs: [
                        (assign_pair
                          lhs: (lhs_expr.LhsName name:awkScript spids:[400])
                          op: Equal
                          rhs: {(SQ <'{print $6,$7,$8}'>)}
                          spids: [400]
                        )
                      ]
                      spids: [400]
                    )
                  ]
                  spids: [395 398 405 16777215]
                )
                (case_arm
                  pat_list: [{(Linux)}]
                  action: [
                    (command.Assignment
                      keyword: Assign_None
                      pairs: [
                        (assign_pair
                          lhs: (lhs_expr.LhsName name:awkScript spids:[411])
                          op: Equal
                          rhs: {(SQ <'{print $6,$7}'>)}
                          spids: [411]
                        )
                      ]
                      spids: [411]
                    )
                  ]
                  spids: [408 409 416 16777215]
                )
                (case_arm
                  pat_list: [{(Lit_Other '*')}]
                  action: [
                    (command.SimpleCommand
                      words: [
                        {(echo)}
                        {(DQ ('unrecognized OS name (') (${ VSub_Name VERSIONS_OS_NAME) (')'))}
                      ]
                      redirects: [(redir.Redir op:<Redir_GreatAnd '>&'> fd:16777215 arg_word:{(2)})]
                    )
                  ]
                  spids: [419 420 435 16777215]
                )
              ]
              spids: [386 392 438]
            )
            (command.Pipeline
              children: [
                (C {(ls)} {(-l)} {(DQ ($ VSub_Number '$1'))})
                (C {(awk)} {(DQ (${ VSub_Name awkScript))})
              ]
              negated: F
            )
          ]
          spids: [378]
        )
      spids: [374 377]
    )
    (command.FuncDef
      name: main
      body: 
        (command.BraceGroup
          children: [
            (command.AndOr
              ops: [Op_DPipe]
              children: [
                (C {(Lit_Other '[')} {(-n)} {(DQ (${ VSub_Name FLAGS_command))} {(Lit_Other ']')})
                (C {(die)} {(SQ <'command required'>)})
              ]
            )
            (command.AndOr
              ops: [Op_DAmp]
              children: [
                (C {(Lit_Other '[')} {(-z)} {(DQ (${ VSub_Name FLAGS_watch))} {(-a)} {(-z)} 
                  {(DQ (${ VSub_Name FLAGS_watch_from))} {(Lit_Other ']')}
                )
                (C {(die)} {(SQ <'one of watch or watch_from required'>)})
              ]
            )
            (command.AndOr
              ops: [Op_DAmp]
              children: [
                (C {(Lit_Other '[')} {(-n)} {(DQ (${ VSub_Name FLAGS_watch))} {(-a)} {(-n)} 
                  {(DQ (${ VSub_Name FLAGS_watch_from))} {(Lit_Other ']')}
                )
                (C {(die)} {(SQ <'only one of watch or watch_from can be specified'>)})
              ]
            )
            (command.AndOr
              ops: [Op_DPipe]
              children: [
                (C {(Lit_Other '[')} {(-r)} {(DQ (${ VSub_Name FLAGS_watch))} {(Lit_Other ']')})
                (C {(die)} {(SQ <'unable to read watch file'>)})
              ]
            )
            (command.AndOr
              ops: [Op_DPipe]
              children: [
                (C {(Lit_Other '[')} {(-w)} {(DQ (${ VSub_Name FLAGS_output_dir))} {(Lit_Other ']')})
                (C {(die)} {(SQ <'unable to write to output directory'>)})
              ]
            )
            (command.Assignment
              keyword: Assign_None
              pairs: [
                (assign_pair
                  lhs: (lhs_expr.LhsName name:watchAge spids:[612])
                  op: Equal
                  rhs: 
                    {
                      (word_part.CommandSubPart
                        command_list: 
                          (command.CommandList
                            children: [(C {(age)} {(DQ (${ VSub_Name FLAGS_watch))})]
                          )
                        left_token: <Left_Backtick '`'>
                        spids: [613 621]
                      )
                    }
                  spids: [612]
                )
              ]
              spids: [612]
            )
            (command.Assignment
              keyword: Assign_None
              pairs: [
                (assign_pair
                  lhs: (lhs_expr.LhsName name:watchAgePrev spids:[624])
                  op: Equal
                  rhs: {(${ VSub_Name watchAge)}
                  spids: [624]
                )
              ]
              spids: [624]
            )
            (command.WhileUntil
              keyword: <KW_While while>
              cond: [(command.Sentence child:(C {(true)}) terminator:<Op_Semi ';'>)]
              body: 
                (command.DoGroup
                  children: [
                    (command.If
                      arms: [
                        (if_arm
                          cond: [
                            (command.Sentence
                              child: 
                                (C {(Lit_Other '[')} {(KW_Bang '!')} {(DQ (${ VSub_Name watchAge))} 
                                  {(Lit_Other '=') (Lit_Other '=')} {(DQ (${ VSub_Name watchAgePrev))} {(Lit_Other ']')}
                                )
                              terminator: <Op_Semi ';'>
                            )
                          ]
                          action: [
                            (command.Assignment
                              keyword: Assign_None
                              pairs: [
                                (assign_pair
                                  lhs: (lhs_expr.LhsName name:date spids:[670])
                                  op: Equal
                                  rhs: 
                                    {
                                      (word_part.CommandSubPart
                                        command_list: 
                                          (command.CommandList
                                            children: [(C {(isodate)})]
                                          )
                                        left_token: <Left_Backtick '`'>
                                        spids: [671 673]
                                      )
                                    }
                                  spids: [670]
                                )
                              ]
                              spids: [670]
                            )
                            (C {(echo)} 
                              {
                                (DQ ('building ') (${ VSub_Name VERSIONS_OS_NAME) (-) 
                                  (${ VSub_Name VERSIONS_OS_RELEASE) (' @ ') (${ VSub_Name date)
                                )
                              }
                            )
                            (command.Assignment
                              keyword: Assign_None
                              pairs: [
                                (assign_pair
                                  lhs: (lhs_expr.LhsName name:outputFileDated spids:[694])
                                  op: Equal
                                  rhs: {(DQ (${ VSub_Name FLAGS_output) (-) (${ VSub_Name date))}
                                  spids: [694]
                                )
                              ]
                              spids: [694]
                            )
                            (command.SimpleCommand
                              words: [{(${ VSub_Name FLAGS_command)}]
                              redirects: [
                                (redir.Redir
                                  op: <Redir_Great '>'>
                                  fd: 16777215
                                  arg_word: 
                                    {
                                      (DQ (${ VSub_Name FLAGS_output_dir) (/) 
                                        (${ VSub_Name outputFileDated)
                                      )
                                    }
                                )
                                (redir.Redir
                                  op: <Redir_GreatAnd '2>&'>
                                  fd: 2
                                  arg_word: {(1)}
                                )
                              ]
                            )
                            (command.Subshell
                              child: 
                                (command.CommandList
                                  children: [
                                    (command.Sentence
                                      child: (C {(cd)} {(DQ (${ VSub_Name FLAGS_output_dir))})
                                      terminator: <Op_Semi ';'>
                                    )
                                    (command.Sentence
                                      child: (C {(rm)} {(-f)} {(DQ (${ VSub_Name FLAGS_output))})
                                      terminator: <Op_Semi ';'>
                                    )
                                    (command.Sentence
                                      child: 
                                        (C {(ln)} {(-s)} {(DQ (${ VSub_Name outputFileDated))} 
                                          {(DQ (${ VSub_Name FLAGS_output))}
                                        )
                                      terminator: <Op_Semi ';'>
                                    )
                                    (command.Sentence
                                      child: (C {(grep)} {(FAIL)} {(DQ (${ VSub_Name FLAGS_output))})
                                      terminator: <Op_Semi ';'>
                                    )
                                  ]
                                )
                              spids: [726 779]
                            )
                            (command.Assignment
                              keyword: Assign_None
                              pairs: [
                                (assign_pair
                                  lhs: (lhs_expr.LhsName name:watchAgePrev spids:[783])
                                  op: Equal
                                  rhs: {(${ VSub_Name watchAge)}
                                  spids: [783]
                                )
                              ]
                              spids: [783]
                            )
                          ]
                          spids: [16777215 667]
                        )
                      ]
                      spids: [16777215 789]
                    )
                    (command.Assignment
                      keyword: Assign_None
                      pairs: [
                        (assign_pair
                          lhs: (lhs_expr.LhsName name:watchAge spids:[793])
                          op: Equal
                          rhs: 
                            {
                              (word_part.CommandSubPart
                                command_list: 
                                  (command.CommandList
                                    children: [(C {(age)} {(DQ (${ VSub_Name FLAGS_watch))})]
                                  )
                                left_token: <Left_Backtick '`'>
                                spids: [794 802]
                              )
                            }
                          spids: [793]
                        )
                      ]
                      spids: [793]
                    )
                    (command.If
                      arms: [
                        (if_arm
                          cond: [
                            (command.Sentence
                              child: 
                                (C {(Lit_Other '[')} {(DQ (${ VSub_Name watchAge))} 
                                  {(Lit_Other '=') (Lit_Other '=')} {(DQ (${ VSub_Name watchAgePrev))} {(Lit_Other ']')}
                                )
                              terminator: <Op_Semi ';'>
                            )
                          ]
                          action: [
                            (C {(echo)} {(SQ <sleeping...>)})
                            (command.WhileUntil
                              keyword: <KW_While while>
                              cond: [
                                (command.Sentence
                                  child: 
                                    (C {(Lit_Other '[')} {(DQ (${ VSub_Name watchAge))} 
                                      {(Lit_Other '=') (Lit_Other '=')} {(DQ (${ VSub_Name watchAgePrev))} {(Lit_Other ']')}
                                    )
                                  terminator: <Op_Semi ';'>
                                )
                              ]
                              body: 
                                (command.DoGroup
                                  children: [
                                    (C {(sleep)} {(${ VSub_Name FLAGS_pause)})
                                    (command.Assignment
                                      keyword: Assign_None
                                      pairs: [
                                        (assign_pair
                                          lhs: (lhs_expr.LhsName name:watchAge spids:[869])
                                          op: Equal
                                          rhs: 
                                            {
                                              (word_part.CommandSubPart
                                                command_list: 
                                                  (command.CommandList
                                                    children: [
                                                      (C {(age)} {(DQ (${ VSub_Name FLAGS_watch))})
                                                    ]
                                                  )
                                                left_token: <Left_Backtick '`'>
                                                spids: [870 878]
                                              )
                                            }
                                          spids: [869]
                                        )
                                      ]
                                      spids: [869]
                                    )
                                  ]
                                  spids: [859 881]
                                )
                            )
                          ]
                          spids: [16777215 827]
                        )
                      ]
                      spids: [16777215 884]
                    )
                  ]
                  spids: [640 887]
                )
            )
          ]
          spids: [475]
        )
      spids: [471 474]
    )
    (command.Assignment
      keyword: Assign_None
      pairs: [
        (assign_pair
          lhs: (lhs_expr.LhsName name:argv0 spids:[895])
          op: Equal
          rhs: 
            {
              (word_part.CommandSubPart
                command_list: 
                  (command.CommandList
                    children: [
                      (command.Pipeline
                        children: [
                          (C {(echo)} {(DQ (${ VSub_Name ARGV0))})
                          (C {(sed)} {(SQ <'s/_test$//;s/_test\\.sh$//'>)})
                        ]
                        negated: F
                      )
                    ]
                  )
                left_token: <Left_Backtick '`'>
                spids: [896 911]
              )
            }
          spids: [895]
        )
      ]
      spids: [895]
    )
    (command.If
      arms: [
        (if_arm
          cond: [
            (command.Sentence
              child: 
                (C {(Lit_Other '[')} {(DQ (${ VSub_Name ARGV0))} {(Lit_Other '=')} 
                  {(DQ (${ VSub_Name argv0))} {(Lit_Other ']')}
                )
              terminator: <Op_Semi ';'>
            )
          ]
          action: [
            (command.AndOr
              ops: [Op_DPipe]
              children: [
                (C {(FLAGS)} {(DQ ($ VSub_At '$@'))})
                (command.ControlFlow
                  token: <ControlFlow_Exit exit>
                  arg_word: {($ VSub_QMark '$?')}
                )
              ]
            )
            (C {(eval)} {(set)} {(--)} {(DQ (${ VSub_Name FLAGS_ARGV))})
            (command.If
              arms: [
                (if_arm
                  cond: [
                    (command.Sentence
                      child: 
                        (C {(Lit_Other '[')} {($ VSub_Pound '$#')} {(-gt)} {(0)} {(Lit_Other ']')})
                      terminator: <Op_Semi ';'>
                    )
                  ]
                  action: [
                    (command.Sentence
                      child: (C {(main)} {(DQ ($ VSub_At '$@'))})
                      terminator: <Op_Semi ';'>
                    )
                  ]
                  spids: [16777215 976]
                )
              ]
              else_action: [(command.Sentence child:(C {(main)}) terminator:<Op_Semi ';'>)]
              spids: [985 990]
            )
          ]
          spids: [16777215 934]
        )
      ]
      spids: [16777215 992]
    )
  ]
)