(CommandList
  children: [
    (Assignment
      keyword: Assign_None
      pairs: [
        (assign_pair
          lhs: (LhsName name:test_description)
          op: Equal
          rhs: {(SQ <"Test commit notes index (expensive!)">)}
          spids: [13]
        )
      ]
      spids: [13]
    )
    (C {(.)} {(./test-lib.sh)})
    (FuncDef
      name: create_repo
      body: 
        (BraceGroup
          children: [
            (Assignment
              keyword: Assign_None
              pairs: [
                (assign_pair
                  lhs: (LhsName name:number_of_commits)
                  op: Equal
                  rhs: {($ VSub_Number "$1")}
                  spids: [32]
                )
              ]
              spids: [32]
            )
            (Assignment
              keyword: Assign_None
              pairs: [(assign_pair lhs:(LhsName name:nr) op:Equal rhs:{(0)} spids:[36])]
              spids: [36]
            )
            (AndOr
              children: [
                (C {(test)} {(-d)} {(.git)})
                (BraceGroup
                  children: [
                    (AndOr
                      children: [
                        (C {(git)} {(init)})
                        (AndOr
                          children: [
                            (Pipeline
                              children: [
                                (Subshell
                                  child: 
                                    (AndOr
                                      children: [
                                        (While
                                          cond: [
                                            (C {(test)} {($ VSub_Name "$nr")} {(-lt)} 
                                              {($ VSub_Name "$number_of_commits")}
                                            )
                                          ]
                                          body: 
                                            (DoGroup
                                              children: [
                                                (Assignment
                                                  keyword: Assign_None
                                                  pairs: [
                                                    (assign_pair
                                                      lhs: (LhsName name:nr)
                                                      op: Equal
                                                      rhs: 
                                                        {
                                                          (ArithSubPart
                                                            anode: 
                                                              (ArithBinary
                                                                op_id: Arith_Plus
                                                                left: 
                                                                  (ArithWord
                                                                    w: {($ VSub_Name "$nr")}
                                                                  )
                                                                right: (ArithWord w:{(Lit_Digits 1)})
                                                              )
                                                            spids: [76 81]
                                                          )
                                                        }
                                                      spids: [75]
                                                    )
                                                  ]
                                                  spids: [75]
                                                )
                                                (Assignment
                                                  keyword: Assign_None
                                                  pairs: [
                                                    (assign_pair
                                                      lhs: (LhsName name:mark)
                                                      op: Equal
                                                      rhs: 
                                                        {
                                                          (ArithSubPart
                                                            anode: 
                                                              (ArithBinary
                                                                op_id: Arith_Plus
                                                                left: 
                                                                  (ArithWord
                                                                    w: {($ VSub_Name "$nr")}
                                                                  )
                                                                right: 
                                                                  (ArithWord
                                                                    w: {($ VSub_Name "$nr")}
                                                                  )
                                                              )
                                                            spids: [85 90]
                                                          )
                                                        }
                                                      spids: [84]
                                                    )
                                                  ]
                                                  spids: [84]
                                                )
                                                (Assignment
                                                  keyword: Assign_None
                                                  pairs: [
                                                    (assign_pair
                                                      lhs: (LhsName name:notemark)
                                                      op: Equal
                                                      rhs: 
                                                        {
                                                          (ArithSubPart
                                                            anode: 
                                                              (ArithBinary
                                                                op_id: Arith_Plus
                                                                left: 
                                                                  (ArithWord
                                                                    w: {($ VSub_Name "$mark")}
                                                                  )
                                                                right: (ArithWord w:{(Lit_Digits 1)})
                                                              )
                                                            spids: [94 99]
                                                          )
                                                        }
                                                      spids: [93]
                                                    )
                                                  ]
                                                  spids: [93]
                                                )
                                                (AndOr
                                                  children: [
                                                    (C {(test_tick)})
                                                    (AndOr
                                                      children: [
                                                        (SimpleCommand
                                                          words: [{(cat)}]
                                                          redirects: [
                                                            (HereDoc
                                                              op_id: Redir_DLessDash
                                                              fd: -1
                                                              body: 
                                                                {
                                                                  (DQ ("commit refs/heads/master\n") 
                                                                    ("mark :") ($ VSub_Name "$mark") ("\n") ("committer ") ($ VSub_Name "$GIT_COMMITTER_NAME") (" <") 
                                                                    ($ VSub_Name 
"$GIT_COMMITTER_EMAIL"
                                                                    ) ("> ") ($ VSub_Name "$GIT_COMMITTER_DATE") ("\n") ("data <<COMMIT\n") ("commit #") ($ VSub_Name "$nr") 
                                                                    ("\n") ("COMMIT\n") ("\n") ("M 644 inline file\n") ("data <<EOF\n") ("file in commit #") ($ VSub_Name "$nr") 
                                                                    ("\n") ("EOF\n") ("\n") ("blob\n") ("mark :") ($ VSub_Name "$notemark") ("\n") ("data <<EOF\n") 
                                                                    ("note for commit #") ($ VSub_Name "$nr") ("\n") ("EOF\n") ("\n")
                                                                  )
                                                                }
                                                              do_expansion: True
                                                              here_end: INPUT_END
                                                              was_filled: True
                                                              spids: [109]
                                                            )
                                                          ]
                                                        )
                                                        (SimpleCommand
                                                          words: [
                                                            {(echo)}
                                                            {
                                                              (DQ ("N :") ($ VSub_Name "$notemark") 
                                                                (" :") ($ VSub_Name "$mark")
                                                              )
                                                            }
                                                          ]
                                                          redirects: [
                                                            (Redir
                                                              op_id: Redir_DGreat
                                                              fd: -1
                                                              arg_word: {(note_commit)}
                                                              spids: [158]
                                                            )
                                                          ]
                                                        )
                                                      ]
                                                      op_id: Op_DAmp
                                                    )
                                                  ]
                                                  op_id: Op_DAmp
                                                )
                                              ]
                                              spids: [72 162]
                                            )
                                        )
                                        (AndOr
                                          children: [
                                            (C {(test_tick)})
                                            (AndOr
                                              children: [
                                                (SimpleCommand
                                                  words: [{(cat)}]
                                                  redirects: [
                                                    (HereDoc
                                                      op_id: Redir_DLessDash
                                                      fd: -1
                                                      body: 
                                                        {
                                                          (DQ ("commit refs/notes/commits\n") 
                                                            ("committer ") ($ VSub_Name "$GIT_COMMITTER_NAME") (" <") ($ VSub_Name "$GIT_COMMITTER_EMAIL") ("> ") 
                                                            ($ VSub_Name "$GIT_COMMITTER_DATE") ("\n") ("data <<COMMIT\n") ("notes\n") ("COMMIT\n") ("\n")
                                                          )
                                                        }
                                                      do_expansion: True
                                                      here_end: INPUT_END
                                                      was_filled: True
                                                      spids: [174]
                                                    )
                                                  ]
                                                )
                                                (C {(cat)} {(note_commit)})
                                              ]
                                              op_id: Op_DAmp
                                            )
                                          ]
                                          op_id: Op_DAmp
                                        )
                                      ]
                                      op_id: Op_DAmp
                                    )
                                  spids: [58 198]
                                )
                                (C {(git)} {(fast-import)} {(--quiet)})
                              ]
                              negated: False
                            )
                            (C {(git)} {(config)} {(core.notesRef)} {(refs/notes/commits)})
                          ]
                          op_id: Op_DAmp
                        )
                      ]
                      op_id: Op_DAmp
                    )
                  ]
                  spids: [48]
                )
              ]
              op_id: Op_DPipe
            )
          ]
          spids: [29]
        )
      spids: [24 28]
    )
    (FuncDef
      name: test_notes
      body: 
        (BraceGroup
          children: [
            (AndOr
              children: [
                (Assignment
                  keyword: Assign_None
                  pairs: [
                    (assign_pair
                      lhs: (LhsName name:count)
                      op: Equal
                      rhs: {($ VSub_Number "$1")}
                      spids: [234]
                    )
                  ]
                  spids: [234]
                )
                (AndOr
                  children: [
                    (C {(git)} {(config)} {(core.notesRef)} {(refs/notes/commits)})
                    (AndOr
                      children: [
                        (Pipeline
                          children: [
                            (C {(git)} {(log)})
                            (SimpleCommand
                              words: [{(grep)} {(DQ ("^    "))}]
                              redirects: [
                                (Redir
                                  op_id: Redir_Great
                                  fd: -1
                                  arg_word: {(output)}
                                  spids: [263]
                                )
                              ]
                            )
                          ]
                          negated: False
                        )
                        (AndOr
                          children: [
                            (Assignment
                              keyword: Assign_None
                              pairs: [
                                (assign_pair
                                  lhs: (LhsName name:i)
                                  op: Equal
                                  rhs: {($ VSub_Name "$count")}
                                  spids: [269]
                                )
                              ]
                              spids: [269]
                            )
                            (AndOr
                              children: [
                                (While
                                  cond: [(C {(test)} {($ VSub_Name "$i")} {(-gt)} {(0)})]
                                  body: 
                                    (DoGroup
                                      children: [
                                        (AndOr
                                          children: [
                                            (C {(echo)} {(DQ ("    commit #") ($ VSub_Name "$i"))})
                                            (AndOr
                                              children: [
                                                (C {(echo)} 
                                                  {(DQ ("    note for commit #") ($ VSub_Name "$i"))}
                                                )
                                                (Assignment
                                                  keyword: Assign_None
                                                  pairs: [
                                                    (assign_pair
                                                      lhs: (LhsName name:i)
                                                      op: Equal
                                                      rhs: 
                                                        {
                                                          (ArithSubPart
                                                            anode: 
                                                              (ArithBinary
                                                                op_id: Arith_Minus
                                                                left: 
                                                                  (ArithWord
                                                                    w: {($ VSub_Name "$i")}
                                                                  )
                                                                right: (ArithWord w:{(Lit_Digits 1)})
                                                              )
                                                            spids: [310 315]
                                                          )
                                                        }
                                                      spids: [309]
                                                    )
                                                  ]
                                                  spids: [309]
                                                )
                                              ]
                                              op_id: Op_DAmp
                                            )
                                          ]
                                          op_id: Op_DAmp
                                        )
                                      ]
                                      spids: [286 318]
                                    )
                                  redirects: [
                                    (Redir
                                      op_id: Redir_Great
                                      fd: -1
                                      arg_word: {(expect)}
                                      spids: [320]
                                    )
                                  ]
                                )
                                (C {(test_cmp)} {(expect)} {(output)})
                              ]
                              op_id: Op_DAmp
                            )
                          ]
                          op_id: Op_DAmp
                        )
                      ]
                      op_id: Op_DAmp
                    )
                  ]
                  op_id: Op_DAmp
                )
              ]
              op_id: Op_DAmp
            )
          ]
          spids: [231]
        )
      spids: [226 230]
    )
    (SimpleCommand
      words: [{(write_script)} {(time_notes)}]
      redirects: [
        (HereDoc
          op_id: Redir_DLess
          fd: -1
          body: 
            {("\tmode=$1\n") ("\ti=1\n") ("\twhile test $i -lt $2\n") ("\tdo\n") ("\t\tcase $1 in\n") 
              ("\t\tno-notes)\n") ("\t\t\tGIT_NOTES_REF=non-existing\n") ("\t\t\texport GIT_NOTES_REF\n") ("\t\t\t;;\n") ("\t\tnotes)\n") 
              ("\t\t\tunset GIT_NOTES_REF\n") ("\t\t\t;;\n") ("\t\tesac\n") ("\t\tgit log\n") ("\t\ti=$(($i+1))\n") ("\tdone >/dev/null\n")
            }
          do_expansion: False
          here_end: EOF
          was_filled: True
          spids: [339]
        )
      ]
    )
    (FuncDef
      name: time_notes
      body: 
        (BraceGroup
          children: [
            (ForEach
              iter_name: mode
              iter_words: [{(no-notes)} {(notes)}]
              do_arg_iter: False
              body: 
                (DoGroup
                  children: [
                    (C {(echo)} {($ VSub_Name "$mode")})
                    (C {(/usr/bin/time)} {(../time_notes)} {($ VSub_Name "$mode")} {($ VSub_Number "$1")})
                  ]
                  spids: [363 380]
                )
              spids: [357 -1]
            )
          ]
          spids: [349]
        )
      spids: [344 348]
    )
    (FuncDef
      name: do_tests
      body: 
        (BraceGroup
          children: [
            (Assignment
              keyword: Assign_None
              pairs: [
                (assign_pair
                  lhs: (LhsName name:count)
                  op: Equal
                  rhs: {($ VSub_Number "$1")}
                  spids: [393]
                )
                (assign_pair
                  lhs: (LhsName name:pr)
                  op: Equal
                  rhs: 
                    {
                      (BracedVarSub
                        token: <VSub_Number 2>
                        suffix_op: (StringUnary op_id:VTest_Hyphen arg_word:{})
                        spids: [397 400]
                      )
                    }
                  spids: [396]
                )
              ]
              spids: [393]
            )
            (C {(test_expect_success)} {($ VSub_Name "$pr")} {(DQ ("setup ") ($ VSub_Name "$count"))} 
              {
                (SQ <"\n"> <"\t\tmkdir \"$count\" &&\n"> <"\t\t(\n"> <"\t\t\tcd \"$count\" &&\n"> 
                  <"\t\t\tcreate_repo \"$count\"\n"> <"\t\t)\n"> <"\t">
                )
              }
            )
            (C {(test_expect_success)} {($ VSub_Name "$pr")} {(SQ <"notes work">)} 
              {
                (SQ <"\n"> <"\t\t(\n"> <"\t\t\tcd \"$count\" &&\n"> <"\t\t\ttest_notes \"$count\"\n"> 
                  <"\t\t)\n"> <"\t">
                )
              }
            )
            (C {(test_expect_success)} 
              {
                (DQ (USR_BIN_TIME) 
                  (BracedVarSub
                    token: <VSub_Name pr>
                    suffix_op: (StringUnary op_id:VTest_ColonPlus arg_word:{(",") ($ VSub_Name "$pr")})
                    spids: [448 453]
                  )
                )
              } {(SQ <"notes timing with /usr/bin/time">)} 
              {
                (SQ <"\n"> <"\t\t(\n"> <"\t\t\tcd \"$count\" &&\n"> <"\t\t\ttime_notes 100\n"> 
                  <"\t\t)\n"> <"\t">
                )
              }
            )
          ]
          spids: [390]
        )
      spids: [385 389]
    )
    (C {(do_tests)} {(10)})
    (ForEach
      iter_name: count
      iter_words: [{(100)} {(1000)} {(10000)}]
      do_arg_iter: False
      body: 
        (DoGroup
          children: [(C {(do_tests)} {(DQ ($ VSub_Name "$count"))} {(EXPENSIVE)})]
          spids: [488 499]
        )
      spids: [481 -1]
    )
    (C {(test_done)})
  ]
)