(CommandList
  children: [
    (C {(set)} {(-u)})
    (FuncDef
      name: die
      body: 
        (BraceGroup
          children: [
            (AndOr
              ops: [Op_DAmp]
              children: [
                (C {(Lit_Other '[')} {($ VSub_Pound '$#')} {(-gt)} {(0)} {(Lit_Other ']')})
                (SimpleCommand
                  words: [{(echo)} {(DQ ('error: ') ($ VSub_Star '$*'))}]
                  redirects: [(Redir op_id:Redir_GreatAnd fd:16777215 arg_word:{(2)} spids:[89])]
                )
              ]
            )
            (ControlFlow token:<ControlFlow_Exit exit> arg_word:{(1)})
          ]
          spids: [67]
        )
      spids: [63 66]
    )
    (Assignment
      keyword: Assign_None
      pairs: [
        (assign_pair
          lhs: (LhsName name:BASE_DIR)
          op: Equal
          rhs: 
            {
              (CommandSubPart
                command_list: (CommandList children:[(C {(dirname)} {(DQ ($ VSub_Number '$0'))})])
                left_token: <Left_CommandSub '$('>
                spids: [101 107]
              )
            }
          spids: [100]
        )
      ]
      spids: [100]
    )
    (Assignment
      keyword: Assign_None
      pairs: [
        (assign_pair
          lhs: (LhsName name:LIB_DIR)
          op: Equal
          rhs: {(DQ (${ VSub_Name BASE_DIR) (/lib))}
          spids: [109]
        )
      ]
      spids: [109]
    )
    (AndOr
      ops: [Op_DPipe]
      children: [
        (C {(.)} {(DQ (${ VSub_Name LIB_DIR) (/shflags))})
        (C {(die)} {(SQ <'unable to load shflags library'>)})
      ]
    )
    (AndOr
      ops: [Op_DPipe]
      children: [
        (C {(.)} {(DQ (${ VSub_Name LIB_DIR) (/shlib))})
        (C {(die)} {(SQ <'unable to load shlib library'>)})
      ]
    )
    (AndOr
      ops: [Op_DPipe]
      children: [
        (C {(.)} {(DQ (${ VSub_Name LIB_DIR) (/versions))})
        (C {(die)} {(SQ <'unable to load versions library'>)})
      ]
    )
    (Assignment
      keyword: Assign_None
      pairs: [
        (assign_pair
          lhs: (LhsName name:BASE_DIR)
          op: Equal
          rhs: 
            {
              (CommandSubPart
                command_list: 
                  (CommandList
                    children: [(C {(shlib_relToAbsPath)} {(DQ (${ VSub_Name BASE_DIR))})]
                  )
                left_token: <Left_CommandSub '$('>
                spids: [183 191]
              )
            }
          spids: [182]
        )
      ]
      spids: [182]
    )
    (Assignment
      keyword: Assign_None
      pairs: [
        (assign_pair
          lhs: (LhsName name:os_name)
          op: Equal
          rhs: 
            {
              (CommandSubPart
                command_list: 
                  (CommandList
                    children: [
                      (Pipeline
                        children: [(C {(versions_osName)}) (C {(sed)} {(SQ <'s/ /_/g'>)})]
                        negated: F
                      )
                    ]
                  )
                left_token: <Left_CommandSub '$('>
                spids: [198 207]
              )
            }
          spids: [197]
        )
      ]
      spids: [197]
    )
    (Assignment
      keyword: Assign_None
      pairs: [
        (assign_pair
          lhs: (LhsName name:os_version)
          op: Equal
          rhs: 
            {
              (CommandSubPart
                command_list: (CommandList children:[(C {(versions_osVersion)})])
                left_token: <Left_CommandSub '$('>
                spids: [210 212]
              )
            }
          spids: [209]
        )
      ]
      spids: [209]
    )
    (C {(DEFINE_boolean)} {(force)} {(false)} {(SQ <'force overwrite'>)} {(f)})
    (C {(DEFINE_string)} {(output_dir)} {(DQ (${ VSub_Name TMPDIR))} {(SQ <'output dir'>)} {(d)})
    (C {(DEFINE_string)} {(output_file)} 
      {(DQ (${ VSub_Name os_name) (-) (${ VSub_Name os_version) (.txt))} {(SQ <'output file'>)} {(o)}
    )
    (C {(DEFINE_string)} {(runner)} {(SQ <test_runner>)} {(SQ <'unit test runner'>)} {(r)})
    (C {(DEFINE_boolean)} {(dry_run)} {(false)} {(DQ ('suppress logging to a file'))} {(n)})
    (FuncDef
      name: main
      body: 
        (BraceGroup
          children: [
            (Assignment
              keyword: Assign_None
              pairs: [
                (assign_pair
                  lhs: (LhsName name:output)
                  op: Equal
                  rhs: 
                    {
                      (DQ 
                        (BracedVarSub
                          token: <VSub_Name FLAGS_output_dir>
                          suffix_op: 
                            (StringUnary
                              op_id: VTest_ColonPlus
                              arg_word: {(${ VSub_Name FLAGS_output_dir) (Lit_Slash /)}
                            )
                          spids: [308 315]
                        ) (${ VSub_Name FLAGS_output_file)
                      )
                    }
                  spids: [306]
                )
              ]
              spids: [306]
            )
            (Assignment
              keyword: Assign_None
              pairs: [
                (assign_pair
                  lhs: (LhsName name:output)
                  op: Equal
                  rhs: 
                    {
                      (CommandSubPart
                        command_list: 
                          (CommandList
                            children: [(C {(shlib_relToAbsPath)} {(DQ (${ VSub_Name output))})]
                          )
                        left_token: <Left_CommandSub '$('>
                        spids: [323 331]
                      )
                    }
                  spids: [322]
                )
              ]
              spids: [322]
            )
            (If
              arms: [
                (if_arm
                  cond: [
                    (Sentence
                      child: 
                        (C {(Lit_Other '[')} {(DQ (${ VSub_Name FLAGS_dry_run))} {(-eq)} 
                          {(DQ (${ VSub_Name FLAGS_FALSE))} {(-a)} {(-f)} {(DQ (${ VSub_Name output))} {(Lit_Other ']')}
                        )
                      terminator: <Op_Semi ';'>
                    )
                  ]
                  action: [
                    (If
                      arms: [
                        (if_arm
                          cond: [
                            (Sentence
                              child: 
                                (C {(Lit_Other '[')} {(DQ (${ VSub_Name FLAGS_force))} {(-eq)} 
                                  {(DQ (${ VSub_Name FLAGS_TRUE))} {(Lit_Other ']')}
                                )
                              terminator: <Op_Semi ';'>
                            )
                          ]
                          action: [(C {(rm)} {(-f)} {(DQ (${ VSub_Name output))})]
                          spids: [16777215 394]
                        )
                      ]
                      else_action: [
                        (SimpleCommand
                          words: [{(echo)} {(DQ ("not overwriting '") (${ VSub_Name output) ("'"))}]
                          redirects: [
                            (Redir
                              op_id: Redir_GreatAnd
                              fd: 16777215
                              arg_word: {(2)}
                              spids: [421]
                            )
                          ]
                        )
                        (ControlFlow
                          token: <ControlFlow_Exit exit>
                          arg_word: {(DQ (${ VSub_Name FLAGS_ERROR))}
                        )
                      ]
                      spids: [408 434]
                    )
                  ]
                  spids: [16777215 370]
                )
              ]
              spids: [16777215 437]
            )
            (If
              arms: [
                (if_arm
                  cond: [
                    (Sentence
                      child: 
                        (C {(Lit_Other '[')} {(DQ (${ VSub_Name FLAGS_dry_run))} {(-eq)} 
                          {(DQ (${ VSub_Name FLAGS_FALSE))} {(Lit_Other ']')}
                        )
                      terminator: <Op_Semi ';'>
                    )
                  ]
                  action: [
                    (AndOr
                      ops: [Op_DPipe]
                      children: [
                        (SimpleCommand
                          words: [{(touch)} {(DQ (${ VSub_Name output))}]
                          redirects: [
                            (Redir
                              op_id: Redir_Great
                              fd: 2
                              arg_word: {(/dev/null)}
                              spids: [472]
                            )
                          ]
                        )
                        (C {(die)} {(DQ ("unable to write to '") (${ VSub_Name output) ("'"))})
                      ]
                    )
                  ]
                  spids: [16777215 461]
                )
              ]
              spids: [16777215 488]
            )
            (Subshell
              child: 
                (If
                  arms: [
                    (if_arm
                      cond: [
                        (Sentence
                          child: 
                            (C {(Lit_Other '[')} {(DQ (${ VSub_Name FLAGS_dry_run))} {(-eq)} 
                              {(DQ (${ VSub_Name FLAGS_FALSE))} {(Lit_Other ']')}
                            )
                          terminator: <Op_Semi ';'>
                        )
                      ]
                      action: [
                        (Pipeline
                          children: [
                            (C {(DQ (./) (${ VSub_Name FLAGS_runner))})
                            (C {(tee)} {(DQ (${ VSub_Name output))})
                          ]
                          negated: F
                        )
                      ]
                      spids: [16777215 520]
                    )
                  ]
                  else_action: [(C {(DQ (./) (${ VSub_Name FLAGS_runner))})]
                  spids: [540 551]
                )
              spids: [496 554]
            )
            (If
              arms: [
                (if_arm
                  cond: [
                    (Sentence
                      child: 
                        (C {(Lit_Other '[')} {(DQ (${ VSub_Name FLAGS_dry_run))} {(-eq)} 
                          {(DQ (${ VSub_Name FLAGS_FALSE))} {(Lit_Other ']')}
                        )
                      terminator: <Op_Semi ';'>
                    )
                  ]
                  action: [
                    (SimpleCommand
                      words: [{(echo)}]
                      redirects: [(Redir op_id:Redir_GreatAnd fd:16777215 arg_word:{(2)} spids:[584])]
                    )
                    (SimpleCommand
                      words: [{(echo)} {(DQ ("Output written to '") (${ VSub_Name output) ("'."))}]
                      redirects: [(Redir op_id:Redir_GreatAnd fd:16777215 arg_word:{(2)} spids:[598])]
                    )
                  ]
                  spids: [16777215 579]
                )
              ]
              spids: [16777215 602]
            )
          ]
          spids: [295]
        )
      spids: [291 294]
    )
    (AndOr
      ops: [Op_DPipe]
      children: [
        (C {(FLAGS)} {(DQ ($ VSub_At '$@'))})
        (ControlFlow token:<ControlFlow_Exit exit> arg_word:{($ VSub_QMark '$?')})
      ]
    )
    (AndOr
      ops: [Op_DPipe]
      children: [
        (C {(Lit_Other '[')} {(DQ (${ VSub_Name FLAGS_help))} {(-eq)} {(DQ (${ VSub_Name FLAGS_FALSE))} 
          {(Lit_Other ']')}
        )
        (ControlFlow token:<ControlFlow_Exit exit>)
      ]
    )
    (C {(eval)} {(set)} {(--)} {(DQ (${ VSub_Name FLAGS_ARGV))})
    (C {(main)} 
      {
        (DQ 
          (BracedVarSub
            token: <VSub_At '@'>
            suffix_op: (StringUnary op_id:VTest_ColonHyphen arg_word:{(EmptyPart)})
            spids: [656 659]
          )
        )
      }
    )
  ]
)