(command.CommandList
  children: [
    (C {<Id.KW_Set set>} {<-o>} {<nounset>})
    (C {<Id.KW_Set set>} {<-o>} {<pipefail>})
    (C {<Id.KW_Set set>} {<-o>} {<errexit>})
    (C {<source>} {<'test/common.sh'>})
    (command.ShFunction
      name: stage2
      body: 
        (BraceGroup
          children: [
            (C {<local>} {<Id.Lit_VarLike 'base_dir='> ($ Id.VSub_Number '$1')})
            (C {<local>} 
              {<Id.Lit_VarLike 'action='> 
                (command_sub
                  left_token: <Id.Left_DollarParen '$('>
                  child: (C {<basename>} {($ Id.VSub_DollarName '$base_dir')})
                )
              }
            )
            (C {<local>} {<Id.Lit_VarLike 'out='> ($ Id.VSub_DollarName '$base_dir') <'/stage2'>})
            (C {<mkdir>} {<-p>} {($ Id.VSub_DollarName '$out')})
            (C {<'benchmarks/report.R'>} {($ Id.VSub_DollarName '$action')} 
              {($ Id.VSub_DollarName '$base_dir') <'/stage1'>} {($ Id.VSub_DollarName '$out')}
            )
            (C {<tree>} {($ Id.VSub_DollarName '$out')})
          ]
        )
    )
    (command.ShFunction
      name: stage3
      body: 
        (BraceGroup
          children: [
            (C {<local>} {<Id.Lit_VarLike 'base_dir='> ($ Id.VSub_Number '$1')})
            (C {<local>} 
              {<Id.Lit_VarLike 'name='> 
                (command_sub
                  left_token: <Id.Left_DollarParen '$('>
                  child: (C {<basename>} {($ Id.VSub_DollarName '$base_dir')})
                )
              }
            )
            (C {<local>} 
              {<Id.Lit_VarLike 'script='> <'benchmarks/'> ($ Id.VSub_DollarName '$name') <.sh>}
            )
            (C {<local>} {<Id.Lit_VarLike 'out='> ($ Id.VSub_DollarName '$base_dir') <'/index.html'>})
            (C {<mkdir>} {<-p>} 
              {
                (command_sub
                  left_token: <Id.Left_DollarParen '$('>
                  child: (C {<dirname>} {($ Id.VSub_DollarName '$out')})
                )
              }
            )
            (command.Simple
              words: [
                {($ Id.VSub_DollarName '$script')}
                {<print-report>}
                {($ Id.VSub_DollarName '$base_dir') <'/stage2'>}
              ]
              redirects: [
                (redir
                  op: <Id.Redir_Great '>'>
                  loc: (redir_loc.Fd fd:1)
                  arg: {($ Id.VSub_DollarName '$out')}
                )
              ]
              do_fork: T
            )
            (C {<echo>} {(DQ <'Wrote '> ($ Id.VSub_DollarName '$out'))})
          ]
        )
    )
    (command.ShFunction
      name: osh-parser
      body: 
        (BraceGroup
          children: [
            (C {<local>} {<Id.Lit_VarLike 'base_dir='> <'_tmp/osh-parser'>})
            (C {<'benchmarks/osh-parser.sh'>} {<stage1>} {<'../benchmark-data/osh-parser'>})
            (C {<stage2>} {($ Id.VSub_DollarName '$base_dir')})
            (C {<stage3>} {($ Id.VSub_DollarName '$base_dir')})
          ]
        )
    )
    (command.ShFunction
      name: osh-runtime
      body: 
        (BraceGroup
          children: [
            (C {<local>} {<Id.Lit_VarLike 'base_dir='> <'_tmp/osh-runtime'>})
            (C {<'benchmarks/osh-runtime.sh'>} {<stage1>} {<'../benchmark-data/osh-runtime'>})
            (C {<stage2>} {($ Id.VSub_DollarName '$base_dir')})
            (C {<stage3>} {($ Id.VSub_DollarName '$base_dir')})
          ]
        )
    )
    (command.ShFunction
      name: vm-baseline
      body: 
        (BraceGroup
          children: [
            (C {<local>} {<Id.Lit_VarLike 'base_dir='> <'_tmp/vm-baseline'>})
            (C {<'benchmarks/vm-baseline.sh'>} {<stage1>} {<'../benchmark-data/vm-baseline'>})
            (C {<stage2>} {($ Id.VSub_DollarName '$base_dir')})
            (C {<stage3>} {($ Id.VSub_DollarName '$base_dir')})
          ]
        )
    )
    (command.ShFunction
      name: ovm-build
      body: 
        (BraceGroup
          children: [
            (C {<local>} {<Id.Lit_VarLike 'base_dir='> <'_tmp/ovm-build'>})
            (C {<'benchmarks/ovm-build.sh'>} {<stage1>} {<'../benchmark-data/ovm-build'>})
            (C {<stage2>} {($ Id.VSub_DollarName '$base_dir')})
            (C {<stage3>} {($ Id.VSub_DollarName '$base_dir')})
          ]
        )
    )
    (command.ShFunction
      name: oheap
      body: 
        (BraceGroup
          children: [
            (C {<local>} {<Id.Lit_VarLike 'base_dir='> <'_tmp/oheap'>})
            (C {<'benchmarks/oheap.sh'>} {<stage1>})
            (C {<stage2>} {($ Id.VSub_DollarName '$base_dir')})
            (C {<stage3>} {($ Id.VSub_DollarName '$base_dir')})
          ]
        )
    )
    (command.ShFunction
      name: all
      body: 
        (BraceGroup
          children: [
            (C {<osh-parser>})
            (C {<osh-runtime>})
            (C {<vm-baseline>})
            (C {<ovm-build>})
            (C {<oheap>})
          ]
        )
    )
    (command.ShFunction
      name: dev-index
      body: 
        (BraceGroup
          children: [
            (C {<local>} {<Id.Lit_VarLike 'out='> <'_tmp/benchmarks.html'>})
            (command.ForEach
              iter_name: name
              iter_words: [{<osh-parser>} {<osh-runtime>} {<vm-baseline>} {<ovm-build>} {<oheap>}]
              do_arg_iter: F
              body: 
                (command.DoGroup
                  children: [
                    (C {<echo>} 
                      {
                        (DQ <'<a href='> (word_part.EscapedLiteral token:<Id.Lit_EscapedChar '\\"'>) 
                          ($ Id.VSub_DollarName '$name') <'/index.html'> (word_part.EscapedLiteral token:<Id.Lit_EscapedChar '\\"'>) <'>'> 
                          ($ Id.VSub_DollarName '$name') <'</a> <br/>'>
                        )
                      }
                    )
                  ]
                )
              redirects: [
                (redir
                  op: <Id.Redir_Great '>'>
                  loc: (redir_loc.Fd fd:1)
                  arg: {($ Id.VSub_DollarName '$out')}
                )
              ]
            )
            (C {<log>} {(DQ <'Wrote '> ($ Id.VSub_DollarName '$out'))})
          ]
        )
    )
    (C {(DQ ($ Id.VSub_At '$@'))})
  ]
)