(command.CommandList
  children: [
    (C {(set)} {(-o)} {(nounset)})
    (C {(set)} {(-o)} {(pipefail)})
    (C {(set)} {(-o)} {(errexit)})
    (C {(source)} {(test/common.sh)})
    (command.FuncDef
      name: process-file
      body: 
        (command.BraceGroup
          children: [
            (command.Assignment
              keyword: Assign_Local
              pairs: [
                (assign_pair
                  lhs: (lhs_expr.LhsName name:proj spids:[46])
                  op: Equal
                  rhs: {($ VSub_Number '$1')}
                  spids: [46]
                )
              ]
              spids: [44]
            )
            (command.Assignment
              keyword: Assign_Local
              pairs: [
                (assign_pair
                  lhs: (lhs_expr.LhsName name:abs_path spids:[52])
                  op: Equal
                  rhs: {($ VSub_Number '$2')}
                  spids: [52]
                )
              ]
              spids: [50]
            )
            (command.Assignment
              keyword: Assign_Local
              pairs: [
                (assign_pair
                  lhs: (lhs_expr.LhsName name:rel_path spids:[58])
                  op: Equal
                  rhs: {($ VSub_Number '$3')}
                  spids: [58]
                )
              ]
              spids: [56]
            )
            (command.Assignment
              keyword: Assign_Local
              pairs: [
                (assign_pair
                  lhs: (lhs_expr.LhsName name:raw_base spids:[65])
                  op: Equal
                  rhs: 
                    {(_tmp/wild/raw/) ($ VSub_DollarName '$proj') (/) ($ VSub_DollarName '$rel_path')}
                  spids: [65]
                )
              ]
              spids: [63]
            )
            (command.Assignment
              keyword: Assign_Local
              pairs: [
                (assign_pair
                  lhs: (lhs_expr.LhsName name:www_base spids:[74])
                  op: Equal
                  rhs: 
                    {(_tmp/wild/www/) ($ VSub_DollarName '$proj') (/) ($ VSub_DollarName '$rel_path')}
                  spids: [74]
                )
              ]
              spids: [72]
            )
            (C {(mkdir)} {(-p)} 
              {
                (word_part.CommandSubPart
                  command_list: 
                    (command.CommandList
                      children: [(C {(dirname)} {($ VSub_DollarName '$raw_base')})]
                    )
                  left_token: <Left_CommandSub '$('>
                  spids: [85 89]
                )
              }
            )
            (C {(mkdir)} {(-p)} 
              {
                (word_part.CommandSubPart
                  command_list: 
                    (command.CommandList
                      children: [(C {(dirname)} {($ VSub_DollarName '$www_base')})]
                    )
                  left_token: <Left_CommandSub '$('>
                  spids: [96 100]
                )
              }
            )
            (C {(log)} 
              {
                (DQ ('--- Processing ') ($ VSub_DollarName '$proj') (' - ') 
                  ($ VSub_DollarName '$rel_path')
                )
              }
            )
            (command.SimpleCommand
              words: [{(wc)} {($ VSub_DollarName '$abs_path')}]
              redirects: [
                (redir.Redir
                  op: <Redir_Great '>'>
                  fd: 16777215
                  arg_word: {(${ VSub_Name raw_base) (__wc.txt)}
                )
              ]
            )
            (C {(cp)} {($ VSub_DollarName '$abs_path')} {(${ VSub_Name www_base) (.txt)})
            (command.Assignment
              keyword: Assign_Local
              pairs: [
                (assign_pair
                  lhs: (lhs_expr.LhsName name:task_file spids:[157])
                  op: Equal
                  rhs: {(${ VSub_Name raw_base) (__parse.task.txt)}
                  spids: [157]
                )
              ]
              spids: [155]
            )
            (command.Assignment
              keyword: Assign_Local
              pairs: [
                (assign_pair
                  lhs: (lhs_expr.LhsName name:stderr_file spids:[166])
                  op: Equal
                  rhs: {(${ VSub_Name raw_base) (__parse.stderr.txt)}
                  spids: [166]
                )
              ]
              spids: [164]
            )
            (command.Assignment
              keyword: Assign_Local
              pairs: [
                (assign_pair
                  lhs: (lhs_expr.LhsName name:out_file spids:[175])
                  op: Equal
                  rhs: {(${ VSub_Name www_base) (__ast.html)}
                  spids: [175]
                )
              ]
              spids: [173]
            )
            (command.SimpleCommand
              words: [
                {(run-task-with-status)}
                {($ VSub_DollarName '$task_file')}
                {(bin/osh)}
                {(--ast-format)}
                {(abbrev-html)}
                {(-n)}
                {($ VSub_DollarName '$abs_path')}
              ]
              redirects: [
                (redir.Redir
                  op: <Redir_Great '>'>
                  fd: 16777215
                  arg_word: {($ VSub_DollarName '$out_file')}
                )
                (redir.Redir
                  op: <Redir_Great '2>'>
                  fd: 2
                  arg_word: {($ VSub_DollarName '$stderr_file')}
                )
              ]
            )
            (command.Assignment
              keyword: Assign_None
              pairs: [
                (assign_pair
                  lhs: (lhs_expr.LhsName name:task_file spids:[215])
                  op: Equal
                  rhs: {(${ VSub_Name raw_base) (__osh2oil.task.txt)}
                  spids: [215]
                )
              ]
              spids: [215]
            )
            (command.Assignment
              keyword: Assign_None
              pairs: [
                (assign_pair
                  lhs: (lhs_expr.LhsName name:stderr_file spids:[222])
                  op: Equal
                  rhs: {(${ VSub_Name raw_base) (__osh2oil.stderr.txt)}
                  spids: [222]
                )
              ]
              spids: [222]
            )
            (command.Assignment
              keyword: Assign_None
              pairs: [
                (assign_pair
                  lhs: (lhs_expr.LhsName name:out_file spids:[229])
                  op: Equal
                  rhs: {(${ VSub_Name www_base) (__oil.txt)}
                  spids: [229]
                )
              ]
              spids: [229]
            )
            (command.SimpleCommand
              words: [
                {(run-task-with-status)}
                {($ VSub_DollarName '$task_file')}
                {($ VSub_DollarName '$OSH')}
                {(-n)}
                {(--fix)}
                {($ VSub_DollarName '$abs_path')}
              ]
              redirects: [
                (redir.Redir
                  op: <Redir_Great '>'>
                  fd: 16777215
                  arg_word: {($ VSub_DollarName '$out_file')}
                )
                (redir.Redir
                  op: <Redir_Great '2>'>
                  fd: 2
                  arg_word: {($ VSub_DollarName '$stderr_file')}
                )
              ]
            )
          ]
          spids: [41]
        )
      spids: [37 40]
    )
    (command.Assignment
      keyword: Assign_Readonly
      pairs: [
        (assign_pair
          lhs: (lhs_expr.LhsName name:NUM_TASKS spids:[266])
          op: Equal
          rhs: {(200)}
          spids: [266]
        )
      ]
      spids: [264]
    )
    (command.Assignment
      keyword: Assign_Readonly
      pairs: [
        (assign_pair
          lhs: (lhs_expr.LhsName name:MANIFEST spids:[271])
          op: Equal
          rhs: {(_tmp/wild/MANIFEST.txt)}
          spids: [271]
        )
      ]
      spids: [269]
    )
    (command.FuncDef
      name: parse-in-parallel
      body: 
        (command.BraceGroup
          children: [
            (command.Assignment
              keyword: Assign_Local
              pairs: [
                (assign_pair
                  lhs: (lhs_expr.LhsName name:failed spids:[284])
                  op: Equal
                  rhs: {(SQ )}
                  spids: [284]
                )
              ]
              spids: [282]
            )
            (command.AndOr
              ops: [Op_DPipe]
              children: [
                (C {(xargs)} {(-n)} {(3)} {(-P)} {($ VSub_DollarName '$JOBS')} {(--)} {($ VSub_Number '$0')} 
                  {(process-file)}
                )
                (command.Assignment
                  keyword: Assign_None
                  pairs: [
                    (assign_pair
                      lhs: (lhs_expr.LhsName name:failed spids:[307])
                      op: Equal
                      rhs: {(1)}
                      spids: [307]
                    )
                  ]
                  spids: [307]
                )
              ]
            )
            (C {(tree)} {(-L)} {(3)} {(_tmp/wild)})
          ]
          spids: [279]
        )
      spids: [275 278]
    )
    (command.FuncDef
      name: parse-and-report
      body: 
        (command.BraceGroup
          children: [
            (command.Assignment
              keyword: Assign_Local
              pairs: [
                (assign_pair
                  lhs: (lhs_expr.LhsName name:manifest_regex spids:[343])
                  op: Equal
                  rhs: 
                    {
                      (word_part.BracedVarSub
                        token: <VSub_Number 1>
                        suffix_op: (suffix_op.StringUnary op_id:VTest_ColonHyphen arg_word:{})
                        spids: [344 347]
                      )
                    }
                  spids: [343]
                )
              ]
              spids: [341]
            )
            (command.TimeBlock
              pipeline: 
                (command.BraceGroup
                  children: [
                    (C {(test/wild.sh)} {(write-manifest)})
                    (command.If
                      arms: [
                        (if_arm
                          cond: [
                            (command.Sentence
                              child: (C {(test)} {(-n)} {(DQ ($ VSub_DollarName '$manifest_regex'))})
                              terminator: <Op_Semi ';'>
                            )
                          ]
                          action: [
                            (command.Pipeline
                              children: [
                                (C {(egrep)} {(--)} {(DQ ($ VSub_DollarName '$manifest_regex'))} 
                                  {($ VSub_DollarName '$MANIFEST')}
                                )
                                (C {(parse-in-parallel)})
                              ]
                              negated: F
                            )
                          ]
                          spids: [16777215 376]
                        )
                      ]
                      else_action: [
                        (command.Pipeline
                          children: [
                            (C {(cat)} {($ VSub_DollarName '$MANIFEST')})
                            (C {(parse-in-parallel)})
                          ]
                          negated: F
                        )
                      ]
                      spids: [394 406]
                    )
                    (C {(make-report)})
                  ]
                  spids: [356]
                )
            )
          ]
          spids: [338]
        )
      spids: [334 337]
    )
    (command.FuncDef
      name: wild-report
      body: 
        (command.BraceGroup
          children: [
            (command.SimpleCommand
              words: [{(test/wild_report.py)} {(DQ ($ VSub_At '$@'))}]
              more_env: [
                (env_pair
                  name: PYTHONPATH
                  val: {(Lit_TildeLike '~') (/hg/json-template/python)}
                  spids: [425]
                )
              ]
            )
          ]
          spids: [422]
        )
      spids: [418 421]
    )
    (command.FuncDef
      name: _link
      body: 
        (command.BraceGroup
          children: [(C {(ln)} {(-s)} {(-f)} {(-v)} {(DQ ($ VSub_At '$@'))})]
          spids: [442]
        )
      spids: [438 441]
    )
    (command.FuncDef
      name: make-report
      body: 
        (command.BraceGroup
          children: [
            (command.Pipeline
              children: [
                (C {(cat)} {($ VSub_DollarName '$MANIFEST')})
                (C {(wild-report)} {(summarize-dirs)})
              ]
              negated: F
            )
            (C {(_link)} 
              (word.BracedWordTree
                parts: [
                  ($ VSub_DollarName '$PWD')
                  (/web/osh-to-oil.)
                  (word_part.BracedAltPart words:[{(html)} {(js)}])
                ]
              ) {(_tmp/wild/www)}
            )
            (C {(_link)} {($ VSub_DollarName '$PWD') (/web)} {(_tmp)})
          ]
          spids: [464]
        )
      spids: [460 463]
    )
    (command.FuncDef
      name: test-wild-report
      body: 
        (command.BraceGroup
          children: [
            (command.Pipeline
              children: [
                (C {(egrep)} {(--)} {(SQ <'^oil|^perf-tools'>)} {($ VSub_DollarName '$MANIFEST')})
                (C {(wild-report)} {(summarize-dirs)})
              ]
              negated: F
            )
          ]
          spids: [519]
        )
      spids: [515 518]
    )
    (command.If
      arms: [
        (if_arm
          cond: [
            (command.Sentence
              child: 
                (C {(test)} 
                  {
                    (DQ 
                      (word_part.CommandSubPart
                        command_list: 
                          (command.CommandList
                            children: [(C {(basename)} {($ VSub_Number '$0')})]
                          )
                        left_token: <Left_CommandSub '$('>
                        spids: [546 550]
                      )
                    )
                  } {(Lit_Other '=')} {(SQ <wild-runner.sh>)}
                )
              terminator: <Op_Semi ';'>
            )
          ]
          action: [(C {(DQ ($ VSub_At '$@'))})]
          spids: [16777215 560]
        )
      ]
      spids: [16777215 567]
    )
  ]
)