(command.CommandList
  children: [
    (command.ShAssignment
      pairs: [
        (assign_pair
          lhs: (sh_lhs_expr.Name name:test_description)
          op: assign_op.Equal
          rhs: {(SQ <'performance with large numbers of packs'>)}
          spids: [4]
        )
      ]
    )
    (C {<.>} {<'./perf-lib.sh'>})
    (C {<test_perf_large_repo>})
    (command.ShFunction
      name: repack_into_n
      body: 
        (BraceGroup
          children: [
            (command.AndOr
              ops: [Id.Op_DAmp Id.Op_DAmp]
              children: [
                (C {<rm>} {<-rf>} {<staging>})
                (C {<mkdir>} {<staging>})
                (command.Pipeline
                  children: [
                    (C {<git>} {<rev-list>} {<--first-parent>} {<HEAD>})
                    (C {<sed>} {<-n>} {(SQ <'1~5p'>)})
                    (C {<head>} {<-n>} {(DQ ($ Id.VSub_Number '$1'))})
                    (command.Simple
                      words: [{<perl>} {<-e>} {(SQ <'print reverse <>'>)}]
                      redirects: [
                        (redir
                          op: <Id.Redir_Great '>'>
                          loc: (redir_loc.Fd fd:1)
                          arg: {<pushes>}
                        )
                      ]
                      do_fork: T
                    )
                  ]
                  negated: F
                )
              ]
            )
            (command.Pipeline
              children: [
                (C {<head>} {<-n>} {<1>} {<pushes>})
                (C {<git>} {<pack-objects>} {<--delta-base-offset>} {<--revs>} {<'staging/pack'>})
              ]
              negated: F
            )
            (command.AndOr
              ops: [Id.Op_DAmp Id.Op_DAmp Id.Op_DAmp]
              children: [
                (command.ShAssignment
                  pairs: [
                    (assign_pair
                      lhs: (sh_lhs_expr.Name name:last)
                      op: assign_op.Equal
                      rhs: (word.Empty)
                      spids: [154]
                    )
                  ]
                )
                (command.WhileUntil
                  keyword: <Id.KW_While while>
                  cond: (condition.Shell commands:[(C {<read>} {<rev>})])
                  body: 
                    (command.DoGroup
                      children: [
                        (command.If
                          arms: [
                            (if_arm
                              cond: 
                                (condition.Shell
                                  commands: [
                                    (command.Sentence
                                      child: (C {<test>} {<-n>} {(DQ ($ Id.VSub_DollarName '$last'))})
                                      terminator: <Id.Op_Semi _>
                                    )
                                  ]
                                )
                              action: [
                                (command.AndOr
                                  ops: [Id.Op_DPipe]
                                  children: [
                                    (command.Pipeline
                                      children: [
                                        (BraceGroup
                                          children: [
                                            (command.AndOr
                                              ops: [Id.Op_DAmp]
                                              children: [
                                                (C {<echo>} {(DQ ($ Id.VSub_DollarName '$rev'))})
                                                (C {<echo>} {(DQ <'^'> ($ Id.VSub_DollarName '$last'))})
                                              ]
                                            )
                                          ]
                                        )
                                        (C {<git>} {<pack-objects>} {<--delta-base-offset>} {<--revs>} 
                                          {<'staging/pack'>}
                                        )
                                      ]
                                      negated: F
                                    )
                                    (command.ControlFlow
                                      token: <Id.ControlFlow_Return return>
                                      arg_word: {<1>}
                                    )
                                  ]
                                )
                              ]
                              spids: [169 180]
                            )
                          ]
                        )
                        (command.ShAssignment
                          pairs: [
                            (assign_pair
                              lhs: (sh_lhs_expr.Name name:last)
                              op: assign_op.Equal
                              rhs: {($ Id.VSub_DollarName '$rev')}
                              spids: [230]
                            )
                          ]
                        )
                      ]
                    )
                  redirects: [(redir op:<Id.Redir_Less '<'> loc:(redir_loc.Fd fd:0) arg:{<pushes>})]
                )
                (C {<rm>} {<-f>} {<'.git/objects/pack/'> <Id.Lit_Star '*'>})
                (C {<mv>} {<'staging/'> <Id.Lit_Star '*'>} {<'.git/objects/pack/'>})
              ]
            )
          ]
        )
    )
    (C {<test_expect_success>} {(SQ <'simplify reachability'>)} 
      {
        (SQ <'\n'> <'\ttip=$(git rev-parse --verify HEAD) &&\n'> 
          <'\tgit for-each-ref --format="option no-deref%0adelete %(refname)" |\n'> <'\tgit update-ref --stdin &&\n'> <'\trm -rf .git/logs &&\n'> 
          <'\tgit update-ref refs/heads/master $tip &&\n'> <'\tgit symbolic-ref HEAD refs/heads/master &&\n'> <'\tgit repack -ad\n'>
        )
      }
    )
    (command.ForEach
      iter_name: nr_packs
      iter_words: [{<1>} {<50>} {<1000>}]
      do_arg_iter: F
      body: 
        (command.DoGroup
          children: [
            (C {<test_expect_success>} 
              {(DQ <'create '> ($ Id.VSub_DollarName '$nr_packs') <'-pack scenario'>)} {(SQ <'\n'> <'\t\trepack_into_n $nr_packs\n'> <'\t'>)}
            )
            (C {<test_perf>} {(DQ <'rev-list ('> ($ Id.VSub_DollarName '$nr_packs') <')'>)} 
              {(SQ <'\n'> <'\t\tgit rev-list --objects --all >/dev/null\n'> <'\t'>)}
            )
            (C {<test_perf>} {(DQ <'repack ('> ($ Id.VSub_DollarName '$nr_packs') <')'>)} 
              {
                (SQ <'\n'> <'\t\tgit pack-objects --keep-true-parents \\\n'> 
                  <'\t\t  --honor-pack-keep --non-empty --all \\\n'> <'\t\t  --reflog --indexed-objects --delta-base-offset \\\n'> 
                  <'\t\t  --stdout </dev/null >/dev/null\n'> <'\t'>
                )
              }
            )
          ]
        )
    )
    (C {<test_done>})
  ]
)