(CommandList
  children: [
    (Assignment
      keyword: Assign_None
      pairs: [
        (assign_pair
          lhs: (LhsName name:test_description)
          op: Equal
          rhs: {(SQ <'performance with large numbers of packs'>)}
          spids: [4]
        )
      ]
      spids: [4]
    )
    (C {(.)} {(./perf-lib.sh)})
    (C {(test_perf_large_repo)})
    (FuncDef
      name: repack_into_n
      body: 
        (BraceGroup
          children: [
            (AndOr
              children: [
                (C {(rm)} {(-rf)} {(staging)})
                (AndOr
                  children: [
                    (C {(mkdir)} {(staging)})
                    (Pipeline
                      children: [
                        (C {(git)} {(rev-list)} {(--first-parent)} {(HEAD)})
                        (C {(sed)} {(-n)} {(SQ <'1~5p'>)})
                        (C {(head)} {(-n)} {(DQ ($ VSub_Number '$1'))})
                        (SimpleCommand
                          words: [{(perl)} {(-e)} {(SQ <'print reverse <>'>)}]
                          redirects: [(Redir op_id:Redir_Great fd:-1 arg_word:{(pushes)} spids:[118])]
                        )
                      ]
                      negated: False
                    )
                  ]
                  op_id: Op_DAmp
                )
              ]
              op_id: Op_DAmp
            )
            (Pipeline
              children: [
                (C {(head)} {(-n)} {(1)} {(pushes)})
                (C {(git)} {(pack-objects)} {(--delta-base-offset)} {(--revs)} {(staging/pack)})
              ]
              negated: False
            )
            (AndOr
              children: [
                (Assignment
                  keyword: Assign_None
                  pairs: [(assign_pair lhs:(LhsName name:last) op:Equal rhs:{(SQ )} spids:[154])]
                  spids: [154]
                )
                (AndOr
                  children: [
                    (While
                      cond: [(C {(read)} {(rev)})]
                      body: 
                        (DoGroup
                          children: [
                            (If
                              arms: [
                                (if_arm
                                  cond: [
                                    (Sentence
                                      child: (C {(test)} {(-n)} {(DQ ($ VSub_Name '$last'))})
                                      terminator: <Op_Semi ';'>
                                    )
                                  ]
                                  action: [
                                    (AndOr
                                      children: [
                                        (Pipeline
                                          children: [
                                            (BraceGroup
                                              children: [
                                                (AndOr
                                                  children: [
                                                    (C {(echo)} {(DQ ($ VSub_Name '$rev'))})
                                                    (C {(echo)} {(DQ ('^') ($ VSub_Name '$last'))})
                                                  ]
                                                  op_id: Op_DAmp
                                                )
                                              ]
                                              spids: [183]
                                            )
                                            (C {(git)} {(pack-objects)} {(--delta-base-offset)} 
                                              {(--revs)} {(staging/pack)}
                                            )
                                          ]
                                          negated: False
                                        )
                                        (ControlFlow
                                          token: <ControlFlow_Return return>
                                          arg_word: {(1)}
                                        )
                                      ]
                                      op_id: Op_DPipe
                                    )
                                  ]
                                  spids: [-1 180]
                                )
                              ]
                              spids: [-1 227]
                            )
                            (Assignment
                              keyword: Assign_None
                              pairs: [
                                (assign_pair
                                  lhs: (LhsName name:last)
                                  op: Equal
                                  rhs: {($ VSub_Name '$rev')}
                                  spids: [230]
                                )
                              ]
                              spids: [230]
                            )
                          ]
                          spids: [166 234]
                        )
                      redirects: [(Redir op_id:Redir_Less fd:-1 arg_word:{(pushes)} spids:[236])]
                    )
                    (AndOr
                      children: [
                        (C {(rm)} {(-f)} {(.git/objects/pack/) (Lit_Other '*')})
                        (C {(mv)} {(staging/) (Lit_Other '*')} {(.git/objects/pack/)})
                      ]
                      op_id: Op_DAmp
                    )
                  ]
                  op_id: Op_DAmp
                )
              ]
              op_id: Op_DAmp
            )
          ]
          spids: [55]
        )
      spids: [50 54]
    )
    (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'>
        )
      }
    )
    (ForEach
      iter_name: nr_packs
      iter_words: [{(1)} {(50)} {(1000)}]
      do_arg_iter: False
      body: 
        (DoGroup
          children: [
            (C {(test_expect_success)} {(DQ ('create ') ($ VSub_Name '$nr_packs') ('-pack scenario'))} 
              {(SQ <'\n'> <'\t\trepack_into_n $nr_packs\n'> <'\t'>)}
            )
            (C {(test_perf)} {(DQ ('rev-list (') ($ VSub_Name '$nr_packs') (')'))} 
              {(SQ <'\n'> <'\t\tgit rev-list --objects --all >/dev/null\n'> <'\t'>)}
            )
            (C {(test_perf)} {(DQ ('repack (') ($ VSub_Name '$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'>
                )
              }
            )
          ]
          spids: [306 370]
        )
      spids: [299 -1]
    )
    (C {(test_done)})
  ]
)