(command.CommandList
  children: [
    (C {(KW_Set set)} {(-o)} {(nounset)})
    (C {(KW_Set set)} {(-o)} {(pipefail)})
    (C {(KW_Set set)} {(-o)} {(errexit)})
    (C {(source)} {(test/common.sh)})
    (C {(source)} {(benchmarks/common.sh)})
    (C {(readonly)} {(Lit_VarLike 'BASE_DIR=') (_tmp/osh-runtime)})
    (C {(readonly)} {(Lit_VarLike 'TAR_DIR=') ($ VSub_DollarName '$PWD') (/_deps/osh-runtime)})
    (C {(readonly)} {(-a)} 
      {(Lit_VarLike 'TAR_SUBDIRS=') 
        (sh_array_literal
          left: <Op_LParen '('>
          words: [{(ocaml-4.06.0)} {(tcc-0.9.26)} {(yash-2.46)}]
        )
      }
    )
    (command.ShFunction
      name: tarballs
      body: 
        (command.BraceGroup
          children: [
            (command.Simple
              words: [{(cat)}]
              redirects: [
                (redir.HereDoc
                  op: <Redir_DLess '<<'>
                  fd: 16777215
                  here_begin: {(EOF)}
                  here_end_span_id: 110
                  stdin_parts: [
                    ('tcc-0.9.26.tar.bz2\n')
                    ('yash-2.46.tar.xz\n')
                    ('ocaml-4.06.0.tar.xz\n')
                  ]
                )
              ]
            )
          ]
        )
    )
    (command.ShFunction
      name: download
      body: 
        (command.BraceGroup
          children: [
            (C {(mkdir)} {(-p)} {($ VSub_DollarName '$TAR_DIR')})
            (command.Pipeline
              children: [
                (C {(tarballs)})
                (C {(xargs)} {(-n)} {(1)} {(-I)} {(Lit_LBrace '{') (Lit_RBrace '}')} {(--verbose)} {(--)} 
                  {(wget)} {(--directory)} {($ VSub_DollarName '$TAR_DIR')} {(SQ <'https://www.oilshell.org/blob/testdata/{}'>)}
                )
              ]
              negated: F
            )
          ]
        )
    )
    (command.ShFunction
      name: extract
      body: 
        (command.BraceGroup
          children: [
            (command.TimeBlock
              pipeline: 
                (command.ForEach
                  iter_name: f
                  iter_words: [
                    (word.BracedTree
                      parts: [
                        ($ VSub_DollarName '$TAR_DIR')
                        (/)
                        (Lit_Star '*')
                        (.)
                        (word_part.BracedTuple words:[{(bz2)} {(xz)}])
                      ]
                    )
                  ]
                  do_arg_iter: F
                  body: 
                    (command.DoGroup
                      children: [
                        (C {(tar)} {(-x)} {(--directory)} {($ VSub_DollarName '$TAR_DIR')} {(--file)} 
                          {($ VSub_DollarName '$f')}
                        )
                      ]
                    )
                )
            )
            (C {(ls)} {(-l)} {($ VSub_DollarName '$TAR_DIR')})
          ]
        )
    )
    (C {(readonly)} {(Lit_VarLike 'PY27_DIR=') ($ VSub_DollarName '$PWD') (/Python-2.7.13)})
    (command.ShFunction
      name: cpython-configure
      body: 
        (command.BraceGroup
          children: [
            (C {(local)} 
              {(Lit_VarLike 'sh_path=') 
                (braced_var_sub
                  token: <VSub_Number 1>
                  suffix_op: (suffix_op.Unary op_id:VTest_ColonHyphen arg_word:{(bash)})
                )
              }
            )
            (C {(local)} 
              {(Lit_VarLike 'out_dir=') 
                (braced_var_sub
                  token: <VSub_Number 2>
                  suffix_op: 
                    (suffix_op.Unary
                      op_id: VTest_ColonHyphen
                      arg_word: 
                        {($ VSub_DollarName '$BASE_DIR') (Lit_Slash /) (${ VSub_Name sh_path) 
                          (-cpython-configure)
                        }
                    )
                )
              }
            )
            (C {(mkdir)} {(-p)} {($ VSub_DollarName '$out_dir')})
            (C {(pushd)} {($ VSub_DollarName '$out_dir')})
            (command.AndOr
              ops: [Op_DPipe]
              children: [
                (command.TimeBlock
                  pipeline: 
                    (C {($ VSub_DollarName '$sh_path')} {($ VSub_DollarName '$PY27_DIR') (/configure)})
                )
                (C {(true)})
              ]
            )
            (C {(popd)})
            (C {(tree)} {($ VSub_DollarName '$out_dir')})
          ]
        )
    )
    (command.ShFunction
      name: osh-cpython-configure
      body: 
        (command.BraceGroup
          children: [
            (C {(cpython-configure)} {($ VSub_DollarName '$OSH_OVM')} 
              {($ VSub_DollarName '$BASE_DIR') (/osh-cpython-configure)}
            )
          ]
        )
    )
    (command.ShFunction
      name: runtime-task
      body: 
        (command.BraceGroup
          children: [
            (C {(local)} {(Lit_VarLike 'raw_dir=') ($ VSub_Number '$1')})
            (C {(local)} {(Lit_VarLike 'job_id=') ($ VSub_Number '$2')})
            (C {(local)} {(Lit_VarLike 'host=') ($ VSub_Number '$3')})
            (C {(local)} {(Lit_VarLike 'host_hash=') ($ VSub_Number '$4')})
            (C {(local)} {(Lit_VarLike 'sh_path=') ($ VSub_Number '$5')})
            (C {(local)} {(Lit_VarLike 'shell_hash=') ($ VSub_Number '$6')})
            (C {(local)} {(Lit_VarLike 'task_type=') ($ VSub_Number '$7')})
            (C {(local)} {(Lit_VarLike 'task_arg=') ($ VSub_Number '$8')})
            (C {(local)} 
              {(Lit_VarLike 'shell_name=') 
                (command_sub
                  left_token: <Left_DollarParen '$('>
                  command_list: 
                    (command.CommandList
                      children: [(C {(basename)} {($ VSub_DollarName '$sh_path')})]
                    )
                )
              }
            )
            (C {(local)} 
              {(Lit_VarLike 'x=') 
                (command_sub
                  left_token: <Left_DollarParen '$('>
                  command_list: 
                    (command.CommandList
                      children: [(C {(basename)} {($ VSub_DollarName '$task_arg')})]
                    )
                )
              }
            )
            (C {(local)} 
              {(Lit_VarLike 'task_label=') 
                (DQ (${ VSub_Name shell_name) (-) (${ VSub_Name shell_hash) (__) (${ VSub_Name x))
              }
            )
            (C {(local)} 
              {(Lit_VarLike 'times_out=') 
                (DQ ($ VSub_DollarName '$PWD') (/) ($ VSub_DollarName '$raw_dir') (/) 
                  ($ VSub_DollarName '$host') (.) ($ VSub_DollarName '$job_id') (.times.csv)
                )
              }
            )
            (C {(local)} 
              {(Lit_VarLike 'vm_out_dir=') 
                (DQ ($ VSub_DollarName '$PWD') (/) ($ VSub_DollarName '$raw_dir') (/) 
                  ($ VSub_DollarName '$host') (.) ($ VSub_DollarName '$job_id') (.virtual-memory)
                )
              }
            )
            (C {(local)} 
              {(Lit_VarLike 'files_out_dir=') 
                (DQ ($ VSub_DollarName '$PWD') (/) ($ VSub_DollarName '$raw_dir') (/) 
                  ($ VSub_DollarName '$host') (.) ($ VSub_DollarName '$job_id') (.files/) ($ VSub_DollarName '$task_label')
                )
              }
            )
            (C {(mkdir)} {(-p)} {($ VSub_DollarName '$vm_out_dir')} 
              {($ VSub_DollarName '$files_out_dir')}
            )
            (C {(local)} {(-a)} 
              {(Lit_VarLike 'TIME_PREFIX=') 
                (sh_array_literal
                  left: <Op_LParen '('>
                  words: [
                    {($ VSub_DollarName '$PWD') (/benchmarks/time.py)}
                    {(--output)}
                    {($ VSub_DollarName '$times_out')}
                    {(--field)}
                    {(DQ ($ VSub_DollarName '$host'))}
                    {(--field)}
                    {(DQ ($ VSub_DollarName '$host_hash'))}
                    {(--field)}
                    {(DQ ($ VSub_DollarName '$shell_name'))}
                    {(--field)}
                    {(DQ ($ VSub_DollarName '$shell_hash'))}
                    {(--field)}
                    {(DQ ($ VSub_DollarName '$task_type'))}
                    {(--field)}
                    {(DQ ($ VSub_DollarName '$task_arg'))}
                  ]
                )
              }
            )
            (command.ShAssignment
              pairs: [(assign_pair lhs:(sh_lhs_expr.Name name:extra_args) op:Equal rhs:{(SQ )})]
            )
            (command.If
              arms: [
                (if_arm
                  cond: [
                    (command.Sentence
                      child: 
                        (C {(test)} {(DQ ($ VSub_DollarName '$shell_name'))} {(Lit_Equals '=')} 
                          {(SQ <osh>)}
                        )
                      terminator: <Op_Semi ';'>
                    )
                  ]
                  action: [
                    (C {(local)} 
                      {(Lit_VarLike 'pdump=') 
                        (DQ (${ VSub_Name vm_out_dir) (/) (${ VSub_Name task_label) (__parser.txt))
                      }
                    )
                    (C {(local)} 
                      {(Lit_VarLike 'rdump=') 
                        (DQ (${ VSub_Name vm_out_dir) (/) (${ VSub_Name task_label) (__runtime.txt))
                      }
                    )
                    (command.ShAssignment
                      pairs: [
                        (assign_pair
                          lhs: (sh_lhs_expr.Name name:extra_args)
                          op: Equal
                          rhs: 
                            {
                              (DQ ('--parser-mem-dump ') ($ VSub_DollarName '$pdump') 
                                (' --runtime-mem-dump ') ($ VSub_DollarName '$rdump')
                              )
                            }
                        )
                      ]
                    )
                  ]
                )
              ]
            )
            (C {(echo)})
            (C {(echo)} 
              {
                (DQ ('--- ') ($ VSub_DollarName '$sh_path') (' ') ($ VSub_DollarName '$task_type') (' ') 
                  ($ VSub_DollarName '$task_arg') (' ---')
                )
              }
            )
            (C {(echo)})
            (command.Case
              to_match: {($ VSub_DollarName '$task_type')}
              arms: [
                (case_arm
                  pat_list: [{(abuild)}]
                  action: [
                    (command.Simple
                      words: [
                        {
                          (DQ 
                            (braced_var_sub
                              token: <VSub_Name TIME_PREFIX>
                              bracket_op: (bracket_op.WholeArray op_id:Lit_At)
                            )
                          )
                        }
                        {(--)}
                        {(DQ ($ VSub_DollarName '$sh_path'))}
                        {($ VSub_DollarName '$extra_args')}
                        {(testdata/osh-runtime/abuild)}
                        {(-h)}
                      ]
                      redirects: [
                        (redir.Redir
                          op: <Redir_Great '>'>
                          fd: 16777215
                          arg_word: {($ VSub_DollarName '$files_out_dir') (/STDOUT.txt)}
                        )
                      ]
                    )
                  ]
                )
                (case_arm
                  pat_list: [{(cpython)}]
                  action: [
                    (command.Simple
                      words: [{(pushd)} {($ VSub_DollarName '$files_out_dir')}]
                      redirects: [(redir.Redir op:<Redir_Great '>'> fd:16777215 arg_word:{(/dev/null)})]
                    )
                    (command.Simple
                      words: [
                        {
                          (DQ 
                            (braced_var_sub
                              token: <VSub_Name TIME_PREFIX>
                              bracket_op: (bracket_op.WholeArray op_id:Lit_At)
                            )
                          )
                        }
                        {(--)}
                        {(DQ ($ VSub_DollarName '$sh_path'))}
                        {($ VSub_DollarName '$extra_args')}
                        {($ VSub_DollarName '$PY27_DIR') (/configure)}
                      ]
                      redirects: [
                        (redir.Redir
                          op: <Redir_Great '>'>
                          fd: 16777215
                          arg_word: {($ VSub_DollarName '$files_out_dir') (/STDOUT.txt)}
                        )
                      ]
                    )
                    (command.Simple
                      words: [{(popd)}]
                      redirects: [(redir.Redir op:<Redir_Great '>'> fd:16777215 arg_word:{(/dev/null)})]
                    )
                  ]
                )
                (case_arm
                  pat_list: [{(configure)}]
                  action: [
                    (C {(local)} {(Lit_VarLike 'conf_dir=') ($ VSub_DollarName '$task_arg')})
                    (command.Simple
                      words: [{(pushd)} {($ VSub_DollarName '$conf_dir')}]
                      redirects: [(redir.Redir op:<Redir_Great '>'> fd:16777215 arg_word:{(/dev/null)})]
                    )
                    (C {(touch)} {(__TIMESTAMP)})
                    (command.Simple
                      words: [
                        {
                          (DQ 
                            (braced_var_sub
                              token: <VSub_Name TIME_PREFIX>
                              bracket_op: (bracket_op.WholeArray op_id:Lit_At)
                            )
                          )
                        }
                        {(--)}
                        {(DQ ($ VSub_DollarName '$sh_path'))}
                        {($ VSub_DollarName '$extra_args')}
                        {(./configure)}
                      ]
                      redirects: [
                        (redir.Redir
                          op: <Redir_Great '>'>
                          fd: 16777215
                          arg_word: {($ VSub_DollarName '$files_out_dir') (/STDOUT.txt)}
                        )
                      ]
                    )
                    (command.Pipeline
                      children: [
                        (C {(find)} {(.)} {(-type)} {(f)} {(-newer)} {(__TIMESTAMP)})
                        (C {(xargs)} {(-I)} {(Lit_LBrace '{') (Lit_RBrace '}')} {(--)} {(cp)} {(--verbose)} 
                          {(Lit_LBrace '{') (Lit_RBrace '}')} {($ VSub_DollarName '$files_out_dir')}
                        )
                      ]
                      negated: F
                    )
                    (command.Simple
                      words: [{(popd)}]
                      redirects: [(redir.Redir op:<Redir_Great '>'> fd:16777215 arg_word:{(/dev/null)})]
                    )
                  ]
                )
                (case_arm
                  pat_list: [{(Lit_Star '*')}]
                  action: [(C {(die)} {(DQ ('Invalid task type ') ($ VSub_DollarName '$task_type'))})]
                )
              ]
            )
          ]
        )
    )
    (command.ShFunction
      name: print-tasks
      body: 
        (command.BraceGroup
          children: [
            (C {(local)} {(Lit_VarLike 'provenance=') ($ VSub_Number '$1')})
            (command.Pipeline
              children: [
                (C {(cat)} {($ VSub_DollarName '$provenance')})
                (command.WhileUntil
                  keyword: <KW_While while>
                  cond: [
                    (command.Sentence
                      child: 
                        (C {(read)} {(job_id)} {(host_name)} {(host_hash)} {(sh_path)} {(shell_hash)})
                      terminator: <Op_Semi ';'>
                    )
                  ]
                  body: 
                    (command.DoGroup
                      children: [
                        (command.Case
                          to_match: {($ VSub_DollarName '$sh_path')}
                          arms: [
                            (case_arm
                              pat_list: [{(mksh)} {(zsh)} {(bin/osh)}]
                              action: [
                                (C {(log)} {(DQ ('--- Skipping ') ($ VSub_DollarName '$sh_path'))})
                                (command.ControlFlow
                                  token: <ControlFlow_Continue continue>
                                )
                              ]
                            )
                          ]
                        )
                        (command.Case
                          to_match: {($ VSub_DollarName '$sh_path')}
                          arms: [
                            (case_arm
                              pat_list: [{(Lit_Star '*') (/osh)}]
                              action: [
                                (command.ShAssignment
                                  pairs: [
                                    (assign_pair
                                      lhs: (sh_lhs_expr.Name name:sh_path)
                                      op: Equal
                                      rhs: 
                                        {($ VSub_DollarName '$PWD') (/) ($ VSub_DollarName '$sh_path')}
                                    )
                                  ]
                                )
                              ]
                            )
                          ]
                        )
                        (C {(local)} 
                          {(Lit_VarLike 'prefix=') 
                            (DQ ($ VSub_DollarName '$job_id') (' ') ($ VSub_DollarName '$host_name') 
                              (' ') ($ VSub_DollarName '$host_hash') (' ') ($ VSub_DollarName '$sh_path') (' ') 
                              ($ VSub_DollarName '$shell_hash')
                            )
                          }
                        )
                        (C {(echo)} {(DQ ($ VSub_DollarName '$prefix'))} {(abuild)} {(abuild-help)})
                        (C {(echo)} {(DQ ($ VSub_DollarName '$prefix'))} {(cpython)} 
                          {(cpython-configure)}
                        )
                        (command.ForEach
                          iter_name: dir
                          iter_words: [
                            {
                              (DQ 
                                (braced_var_sub
                                  token: <VSub_Name TAR_SUBDIRS>
                                  bracket_op: (bracket_op.WholeArray op_id:Lit_At)
                                )
                              )
                            }
                          ]
                          do_arg_iter: F
                          body: 
                            (command.DoGroup
                              children: [
                                (C {(echo)} {(DQ ($ VSub_DollarName '$prefix'))} {(configure)} 
                                  {($ VSub_DollarName '$TAR_DIR') (/) ($ VSub_DollarName '$dir')}
                                )
                              ]
                            )
                        )
                      ]
                    )
                )
              ]
              negated: F
            )
          ]
        )
    )
    (C {(readonly)} 
      {(Lit_VarLike 'HEADER=') 
        (SQ <'status,elapsed_secs,host_name,host_hash,shell_name,shell_hash,task_type,task_arg'>)
      }
    )
    (C {(readonly)} {(Lit_VarLike 'NUM_COLUMNS=') (7)})
    (command.ShFunction
      name: measure
      body: 
        (command.BraceGroup
          children: [
            (C {(local)} {(Lit_VarLike 'provenance=') ($ VSub_Number '$1')})
            (C {(local)} 
              {(Lit_VarLike 'raw_dir=') 
                (braced_var_sub
                  token: <VSub_Number 2>
                  suffix_op: 
                    (suffix_op.Unary
                      op_id: VTest_ColonHyphen
                      arg_word: {($ VSub_DollarName '$BASE_DIR') (Lit_Slash /) (raw)}
                    )
                )
              }
            )
            (C {(local)} 
              {(Lit_VarLike 'pattern=') 
                (braced_var_sub
                  token: <VSub_Number 3>
                  suffix_op: (suffix_op.Unary op_id:VTest_ColonHyphen arg_word:{})
                )
              }
            )
            (C {(local)} 
              {(Lit_VarLike 'name=') 
                (command_sub
                  left_token: <Left_DollarParen '$('>
                  command_list: 
                    (command.CommandList
                      children: [(C {(basename)} {($ VSub_DollarName '$provenance')})]
                    )
                )
              }
            )
            (C {(local)} 
              {(Lit_VarLike 'prefix=') 
                (braced_var_sub
                  token: <VSub_Name name>
                  suffix_op: (suffix_op.Unary op_id:VOp1_Percent arg_word:{(.provenance.txt)})
                )
              }
            )
            (C {(local)} 
              {(Lit_VarLike 'times_out=') 
                (DQ ($ VSub_DollarName '$raw_dir') (/) ($ VSub_DollarName '$prefix') (.times.csv))
              }
            )
            (C {(mkdir)} {(-p)} 
              (word.BracedTree
                parts: [
                  ($ VSub_DollarName '$BASE_DIR')
                  (/)
                  (word_part.BracedTuple words:[{(raw)} {(stage1)}])
                ]
              ) {($ VSub_DollarName '$raw_dir')}
            )
            (command.Simple
              words: [{(echo)} {($ VSub_DollarName '$HEADER')}]
              redirects: [
                (redir.Redir
                  op: <Redir_Great '>'>
                  fd: 16777215
                  arg_word: {($ VSub_DollarName '$times_out')}
                )
              ]
            )
            (C {(local)} {(Lit_VarLike 'tasks=') ($ VSub_DollarName '$BASE_DIR') (/tasks.txt)})
            (command.Simple
              words: [{(print-tasks)} {($ VSub_DollarName '$provenance')}]
              redirects: [
                (redir.Redir
                  op: <Redir_Great '>'>
                  fd: 16777215
                  arg_word: {($ VSub_DollarName '$tasks')}
                )
              ]
            )
            (command.AndOr
              ops: [Op_DPipe]
              children: [
                (command.TimeBlock
                  pipeline: 
                    (command.Pipeline
                      children: [
                        (C {(egrep)} {(DQ ($ VSub_DollarName '$pattern'))} 
                          {($ VSub_DollarName '$tasks')}
                        )
                        (C {(xargs)} {(-n)} {($ VSub_DollarName '$NUM_COLUMNS')} {(--)} 
                          {($ VSub_Number '$0')} {(runtime-task)} {($ VSub_DollarName '$raw_dir')}
                        )
                      ]
                      negated: F
                    )
                )
                (C {(die)} {(DQ ('*** Some tasks failed. ***'))})
              ]
            )
            (C {(cp)} {(-v)} {($ VSub_DollarName '$provenance')} {($ VSub_DollarName '$raw_dir')})
          ]
        )
    )
    (command.ShFunction
      name: stage1
      body: 
        (command.BraceGroup
          children: [
            (C {(local)} 
              {(Lit_VarLike 'raw_dir=') 
                (braced_var_sub
                  token: <VSub_Number 1>
                  suffix_op: 
                    (suffix_op.Unary
                      op_id: VTest_ColonHyphen
                      arg_word: {($ VSub_DollarName '$BASE_DIR') (Lit_Slash /) (raw)}
                    )
                )
              }
            )
            (C {(local)} {(Lit_VarLike 'out_dir=') ($ VSub_DollarName '$BASE_DIR') (/stage1)})
            (C {(mkdir)} {(-p)} {($ VSub_DollarName '$out_dir')})
            (C {(local)} {(Lit_VarLike 'times_csv=') ($ VSub_DollarName '$out_dir') (/times.csv)})
            (C {(local)} {(-a)} 
              {(Lit_VarLike 'a=') 
                (sh_array_literal
                  left: <Op_LParen '('>
                  words: [{($ VSub_DollarName '$raw_dir') (/flanders.) (Lit_Star '*') (.times.csv)}]
                )
              }
            )
            (C {(local)} {(-a)} 
              {(Lit_VarLike 'b=') 
                (sh_array_literal
                  left: <Op_LParen '('>
                  words: [{($ VSub_DollarName '$raw_dir') (/lisa.) (Lit_Star '*') (.times.csv)}]
                )
              }
            )
            (command.Simple
              words: [
                {(csv-concat)}
                {
                  (braced_var_sub
                    token: <VSub_Name a>
                    bracket_op: 
                      (bracket_op.ArrayIndex
                        expr: 
                          (arith_expr.Unary
                            op_id: Node_UnaryMinus
                            child: (arith_expr.ArithWord w:{(Lit_Digits 1)})
                          )
                      )
                  )
                }
                {
                  (braced_var_sub
                    token: <VSub_Name b>
                    bracket_op: 
                      (bracket_op.ArrayIndex
                        expr: 
                          (arith_expr.Unary
                            op_id: Node_UnaryMinus
                            child: (arith_expr.ArithWord w:{(Lit_Digits 1)})
                          )
                      )
                  )
                }
              ]
              redirects: [
                (redir.Redir
                  op: <Redir_Great '>'>
                  fd: 16777215
                  arg_word: {($ VSub_DollarName '$times_csv')}
                )
              ]
            )
            (C {(local)} {(Lit_VarLike 'vm_csv=') ($ VSub_DollarName '$out_dir') (/virtual-memory.csv)})
            (C {(local)} {(-a)} 
              {(Lit_VarLike 'c=') 
                (sh_array_literal
                  left: <Op_LParen '('>
                  words: [
                    {($ VSub_DollarName '$raw_dir') (/flanders.) (Lit_Star '*') (.virtual-memory)}
                  ]
                )
              }
            )
            (C {(local)} {(-a)} 
              {(Lit_VarLike 'd=') 
                (sh_array_literal
                  left: <Op_LParen '('>
                  words: [{($ VSub_DollarName '$raw_dir') (/lisa.) (Lit_Star '*') (.virtual-memory)}]
                )
              }
            )
            (command.Simple
              words: [
                {(benchmarks/virtual_memory.py)}
                {(osh-runtime)}
                {
                  (braced_var_sub
                    token: <VSub_Name c>
                    bracket_op: 
                      (bracket_op.ArrayIndex
                        expr: 
                          (arith_expr.Unary
                            op_id: Node_UnaryMinus
                            child: (arith_expr.ArithWord w:{(Lit_Digits 1)})
                          )
                      )
                  )
                }
                {
                  (braced_var_sub
                    token: <VSub_Name d>
                    bracket_op: 
                      (bracket_op.ArrayIndex
                        expr: 
                          (arith_expr.Unary
                            op_id: Node_UnaryMinus
                            child: (arith_expr.ArithWord w:{(Lit_Digits 1)})
                          )
                      )
                  )
                }
              ]
              redirects: [
                (redir.Redir
                  op: <Redir_Great '>'>
                  fd: 16777215
                  arg_word: {($ VSub_DollarName '$vm_csv')}
                )
              ]
            )
          ]
        )
    )
    (command.ShFunction
      name: print-report
      body: 
        (command.BraceGroup
          children: [
            (C {(local)} {(Lit_VarLike 'in_dir=') ($ VSub_Number '$1')})
            (C {(local)} {(Lit_VarLike 'base_url=') (SQ <../../web>)})
            (command.Simple
              words: [{(cat)}]
              redirects: [
                (redir.HereDoc
                  op: <Redir_DLess '<<'>
                  fd: 16777215
                  here_begin: {(EOF)}
                  here_end_span_id: 1589
                  stdin_parts: [
                    ('<!DOCTYPE html>\n')
                    ('<html>\n')
                    ('  <head>\n')
                    ('    <title>OSH Runtime Performance</title>\n')
                    ('    <script type=')
                    (Right_DoubleQuote '"')
                    (text/javascript)
                    (Right_DoubleQuote '"')
                    (' src=')
                    (Right_DoubleQuote '"')
                    ($ VSub_DollarName '$base_url')
                    (/table/table-sort.js)
                    (Right_DoubleQuote '"')
                    ('></script>\n')
                    ('    <link rel=')
                    (Right_DoubleQuote '"')
                    (stylesheet)
                    (Right_DoubleQuote '"')
                    (' type=')
                    (Right_DoubleQuote '"')
                    (text/css)
                    (Right_DoubleQuote '"')
                    (' href=')
                    (Right_DoubleQuote '"')
                    ($ VSub_DollarName '$base_url')
                    (/table/table-sort.css)
                    (Right_DoubleQuote '"')
                    (' />\n')
                    ('    <link rel=')
                    (Right_DoubleQuote '"')
                    (stylesheet)
                    (Right_DoubleQuote '"')
                    (' type=')
                    (Right_DoubleQuote '"')
                    (text/css)
                    (Right_DoubleQuote '"')
                    (' href=')
                    (Right_DoubleQuote '"')
                    ($ VSub_DollarName '$base_url')
                    (/benchmarks.css)
                    (Right_DoubleQuote '"')
                    (' />\n')
                    ('\n')
                    ('  </head>\n')
                    ('  <body>\n')
                    ('    <p id=')
                    (Right_DoubleQuote '"')
                    (home-link)
                    (Right_DoubleQuote '"')
                    ('>\n')
                    ('      <a href=')
                    (Right_DoubleQuote '"')
                    (/)
                    (Right_DoubleQuote '"')
                    ('>oilshell.org</a>\n')
                    ('    </p>\n')
                    ('    <h2>OSH Runtime Performance</h2>\n')
                    ('\n')
                    ('    <h3>Elapsed Time by Shell (milliseconds)</h3>\n')
                    ('\n')
                    (
'    <p>Some benchmarks call many external tools, while some exercise the shell\n'
                    )
                    ('    interpreter itself.  Parse time is included.</p>\n')
                  ]
                )
              ]
            )
            (C {(csv2html)} {($ VSub_DollarName '$in_dir') (/times.csv)})
            (command.Simple
              words: [{(cat)}]
              redirects: [
                (redir.HereDoc
                  op: <Redir_DLess '<<'>
                  fd: 16777215
                  here_begin: {(EOF)}
                  here_end_span_id: 1609
                  stdin_parts: [
                    ('    <h3>Memory Used to Run</h3>\n')
                    ('\n')
                    ('    <p>Running under <code>osh-ovm</code>.  Memory usage is measured in MB\n')
                    ('    (powers of 10), not MiB (powers of 2).</p>\n')
                    ('\n')
                  ]
                )
              ]
            )
            (C {(csv2html)} {($ VSub_DollarName '$in_dir') (/virtual-memory.csv)})
            (command.Simple
              words: [{(cat)}]
              redirects: [
                (redir.HereDoc
                  op: <Redir_DLess '<<'>
                  fd: 16777215
                  here_begin: {(EOF)}
                  here_end_span_id: 1626
                  stdin_parts: [('\n') ('    <h3>Shell and Host Details</h3>\n')]
                )
              ]
            )
            (C {(csv2html)} {($ VSub_DollarName '$in_dir') (/shells.csv)})
            (C {(csv2html)} {($ VSub_DollarName '$in_dir') (/hosts.csv)})
            (command.Simple
              words: [{(cat)}]
              redirects: [
                (redir.HereDoc
                  op: <Redir_DLess '<<'>
                  fd: 16777215
                  here_begin: {(EOF)}
                  here_end_span_id: 1649
                  stdin_parts: [('  </body>\n') ('</html>\n')]
                )
              ]
            )
          ]
        )
    )
    (command.ShFunction
      name: abuild-h
      body: 
        (command.BraceGroup
          children: [
            (C {(local)} {(Lit_VarLike 'out_dir=') (_tmp/osh-runtime)})
            (C {(mkdir)} {(-p)} {($ VSub_DollarName '$out_dir')})
            (C {(local)} {(Lit_VarLike 'out=') ($ VSub_DollarName '$out_dir') (/abuild-h-times.csv)})
            (command.Simple
              words: [{(echo)} {(SQ <'status,elapsed_secs,sh_path'>)}]
              redirects: [
                (redir.Redir
                  op: <Redir_Great '>'>
                  fd: 16777215
                  arg_word: {($ VSub_DollarName '$out')}
                )
              ]
            )
            (command.ForEach
              iter_name: sh_path
              iter_words: [{(bash)} {(dash)} {(mksh)} {(zsh)} {($ VSub_DollarName '$OSH_OVM')}]
              do_arg_iter: F
              body: 
                (command.DoGroup
                  children: [
                    (C {(benchmarks/time.py)} {(--output)} {($ VSub_DollarName '$out')} {(--field)} 
                      {(DQ ($ VSub_DollarName '$sh_path'))} {(--)} {($ VSub_DollarName '$sh_path')} {(benchmarks/testdata/abuild)} {(-h)}
                    )
                  ]
                )
            )
          ]
        )
    )
    (command.ShFunction
      name: qemu-old
      body: 
        (command.BraceGroup
          children: [
            (C {(local)} {(Lit_VarLike 'out_dir=') ($ VSub_DollarName '$PWD') (/_tmp/qemu-old)})
            (C {(mkdir)} {(-p)} {($ VSub_DollarName '$out_dir')})
            (C {(configure-and-copy)} 
              {(word_part.TildeSub token:<Lit_TildeLike '~'>) (/src/qemu-1.6.0)} {($ VSub_DollarName '$OSH_OVM')} {($ VSub_DollarName '$out_dir')}
            )
          ]
        )
    )
    (command.ShFunction
      name: self-exe
      body: 
        (command.BraceGroup
          children: [
            (C {(KW_Set set)} {(Lit_Other '+') (o)} {(errexit)})
            (command.Simple
              words: [{(dash)}]
              redirects: [
                (redir.HereDoc
                  op: <Redir_DLess '<<'>
                  fd: 16777215
                  here_begin: {(EOF)}
                  here_end_span_id: 1829
                  stdin_parts: [('/proc/self/exe -V\n')]
                )
              ]
            )
            (C {(echo)})
            (command.Simple
              words: [{(_bin/osh)}]
              redirects: [
                (redir.HereDoc
                  op: <Redir_DLess '<<'>
                  fd: 16777215
                  here_begin: {(EOF)}
                  here_end_span_id: 1842
                  stdin_parts: [('/proc/self/exe -V\n')]
                )
              ]
            )
            (command.Simple
              words: [{(_tmp/shells/ash)}]
              redirects: [
                (redir.HereDoc
                  op: <Redir_DLess '<<'>
                  fd: 16777215
                  here_begin: {(EOF)}
                  here_end_span_id: 1852
                  stdin_parts: [('/proc/self/exe -V\n')]
                )
              ]
            )
          ]
        )
    )
    (C {(DQ ($ VSub_At '$@'))})
  ]
)