(command.CommandList
  children: [
    (command.ShAssignment
      pairs: [
        (assign_pair
          lhs: (sh_lhs_expr.Name name:test_description)
          op: assign_op.Equal
          rhs: {(SQ <'common tail optimization'>)}
          spids: [4]
        )
      ]
    )
    (C {<.>} {<'./test-lib.sh'>})
    (command.Sentence
      child: 
        (command.ShAssignment
          pairs: [
            (assign_pair
              lhs: (sh_lhs_expr.Name name:z)
              op: assign_op.Equal
              rhs: {<zzzzzzzz>}
              spids: [15]
            )
          ]
        )
      terminator: <Id.Op_Semi _>
    )
    (command.Sentence
      child: 
        (command.ShAssignment
          pairs: [
            (assign_pair
              lhs: (sh_lhs_expr.Name name:z)
              op: assign_op.Equal
              rhs: 
                {
                  (DQ ($ Id.VSub_DollarName '$z') ($ Id.VSub_DollarName '$z') 
                    ($ Id.VSub_DollarName '$z') ($ Id.VSub_DollarName '$z') ($ Id.VSub_DollarName '$z') ($ Id.VSub_DollarName '$z') 
                    ($ Id.VSub_DollarName '$z') ($ Id.VSub_DollarName '$z')
                  )
                }
              spids: [22]
            )
          ]
        )
      terminator: <Id.Op_Semi _>
    )
    (command.Sentence
      child: 
        (command.ShAssignment
          pairs: [
            (assign_pair
              lhs: (sh_lhs_expr.Name name:z)
              op: assign_op.Equal
              rhs: 
                {
                  (DQ ($ Id.VSub_DollarName '$z') ($ Id.VSub_DollarName '$z') 
                    ($ Id.VSub_DollarName '$z') ($ Id.VSub_DollarName '$z') ($ Id.VSub_DollarName '$z') ($ Id.VSub_DollarName '$z') 
                    ($ Id.VSub_DollarName '$z') ($ Id.VSub_DollarName '$z')
                  )
                }
              spids: [38]
            )
          ]
        )
      terminator: <Id.Op_Semi _>
    )
    (command.Sentence
      child: 
        (command.ShAssignment
          pairs: [
            (assign_pair
              lhs: (sh_lhs_expr.Name name:z)
              op: assign_op.Equal
              rhs: 
                {
                  (DQ ($ Id.VSub_DollarName '$z') ($ Id.VSub_DollarName '$z') 
                    ($ Id.VSub_DollarName '$z') ($ Id.VSub_DollarName '$z')
                  )
                }
              spids: [54]
            )
          ]
        )
      terminator: <Id.Op_Semi _>
    )
    (command.Sentence
      child: 
        (command.ShAssignment
          pairs: [
            (assign_pair
              lhs: (sh_lhs_expr.Name name:z2047)
              op: assign_op.Equal
              rhs: 
                {
                  (command_sub
                    left_token: <Id.Left_DollarParen '$('>
                    child: 
                      (C {<expr>} {(DQ ($ Id.VSub_DollarName '$z'))} {<Id.Lit_Colon ':'>} 
                        {(SQ <'.\\(.*\\)'>)}
                      )
                  )
                }
              spids: [66]
            )
          ]
        )
      terminator: <Id.Op_Semi _>
    )
    (command.Sentence
      child: 
        (command.ShAssignment
          pairs: [
            (assign_pair
              lhs: (sh_lhs_expr.Name name:x)
              op: assign_op.Equal
              rhs: {<zzzzzzzzzz>}
              spids: [87]
            )
          ]
        )
      terminator: <Id.Op_Semi _>
    )
    (command.Sentence
      child: 
        (command.ShAssignment
          pairs: [
            (assign_pair
              lhs: (sh_lhs_expr.Name name:y)
              op: assign_op.Equal
              rhs: 
                {
                  (DQ ($ Id.VSub_DollarName '$x') ($ Id.VSub_DollarName '$x') 
                    ($ Id.VSub_DollarName '$x') ($ Id.VSub_DollarName '$x') ($ Id.VSub_DollarName '$x') ($ Id.VSub_DollarName '$x') 
                    ($ Id.VSub_DollarName '$x') ($ Id.VSub_DollarName '$x') ($ Id.VSub_DollarName '$x') ($ Id.VSub_DollarName '$x')
                  )
                }
              spids: [94]
            )
          ]
        )
      terminator: <Id.Op_Semi _>
    )
    (command.Sentence
      child: 
        (command.ShAssignment
          pairs: [
            (assign_pair
              lhs: (sh_lhs_expr.Name name:z)
              op: assign_op.Equal
              rhs: 
                {
                  (DQ ($ Id.VSub_DollarName '$y') ($ Id.VSub_DollarName '$y') 
                    ($ Id.VSub_DollarName '$y') ($ Id.VSub_DollarName '$y') ($ Id.VSub_DollarName '$y') ($ Id.VSub_DollarName '$y') 
                    ($ Id.VSub_DollarName '$y') ($ Id.VSub_DollarName '$y') ($ Id.VSub_DollarName '$y') ($ Id.VSub_DollarName '$y')
                  )
                }
              spids: [112]
            )
          ]
        )
      terminator: <Id.Op_Semi _>
    )
    (command.ShAssignment
      pairs: [
        (assign_pair
          lhs: (sh_lhs_expr.Name name:z1000)
          op: assign_op.Equal
          rhs: {($ Id.VSub_DollarName '$z')}
          spids: [130]
        )
      ]
    )
    (command.ShAssignment
      pairs: [
        (assign_pair
          lhs: (sh_lhs_expr.Name name:z100)
          op: assign_op.Equal
          rhs: {($ Id.VSub_DollarName '$y')}
          spids: [133]
        )
      ]
    )
    (command.ShAssignment
      pairs: [
        (assign_pair
          lhs: (sh_lhs_expr.Name name:z10)
          op: assign_op.Equal
          rhs: {($ Id.VSub_DollarName '$x')}
          spids: [136]
        )
      ]
    )
    (command.ShFunction
      name: zs
      body: 
        (BraceGroup
          children: [
            (command.ShAssignment
              pairs: [
                (assign_pair
                  lhs: (sh_lhs_expr.Name name:count)
                  op: assign_op.Equal
                  rhs: {(DQ ($ Id.VSub_Number '$1'))}
                  spids: [147]
                )
              ]
            )
            (command.WhileUntil
              keyword: <Id.KW_While while>
              cond: 
                (condition.Shell
                  commands: [(C {<test>} {(DQ ($ Id.VSub_DollarName '$count'))} {<-ge>} {<1000>})]
                )
              body: 
                (command.DoGroup
                  children: [
                    (command.ShAssignment
                      pairs: [
                        (assign_pair
                          lhs: (sh_lhs_expr.Name name:count)
                          op: assign_op.Equal
                          rhs: 
                            {
                              (word_part.ArithSub
                                anode: 
                                  (arith_expr.Binary
                                    op_id: Id.Arith_Minus
                                    left: {($ Id.VSub_DollarName '$count')}
                                    right: {<Id.Lit_Digits 1000>}
                                  )
                              )
                            }
                          spids: [169]
                        )
                      ]
                    )
                    (C {<printf>} {(DQ <'%s'>)} {($ Id.VSub_DollarName '$z1000')})
                  ]
                )
            )
            (command.WhileUntil
              keyword: <Id.KW_While while>
              cond: 
                (condition.Shell
                  commands: [(C {<test>} {(DQ ($ Id.VSub_DollarName '$count'))} {<-ge>} {<100>})]
                )
              body: 
                (command.DoGroup
                  children: [
                    (command.ShAssignment
                      pairs: [
                        (assign_pair
                          lhs: (sh_lhs_expr.Name name:count)
                          op: assign_op.Equal
                          rhs: 
                            {
                              (word_part.ArithSub
                                anode: 
                                  (arith_expr.Binary
                                    op_id: Id.Arith_Minus
                                    left: {($ Id.VSub_DollarName '$count')}
                                    right: {<Id.Lit_Digits 100>}
                                  )
                              )
                            }
                          spids: [208]
                        )
                      ]
                    )
                    (C {<printf>} {(DQ <'%s'>)} {($ Id.VSub_DollarName '$z100')})
                  ]
                )
            )
            (command.WhileUntil
              keyword: <Id.KW_While while>
              cond: 
                (condition.Shell
                  commands: [(C {<test>} {(DQ ($ Id.VSub_DollarName '$count'))} {<-ge>} {<10>})]
                )
              body: 
                (command.DoGroup
                  children: [
                    (command.ShAssignment
                      pairs: [
                        (assign_pair
                          lhs: (sh_lhs_expr.Name name:count)
                          op: assign_op.Equal
                          rhs: 
                            {
                              (word_part.ArithSub
                                anode: 
                                  (arith_expr.Binary
                                    op_id: Id.Arith_Minus
                                    left: {($ Id.VSub_DollarName '$count')}
                                    right: {<Id.Lit_Digits 10>}
                                  )
                              )
                            }
                          spids: [247]
                        )
                      ]
                    )
                    (C {<printf>} {(DQ <'%s'>)} {($ Id.VSub_DollarName '$z10')})
                  ]
                )
            )
            (command.WhileUntil
              keyword: <Id.KW_While while>
              cond: 
                (condition.Shell
                  commands: [(C {<test>} {(DQ ($ Id.VSub_DollarName '$count'))} {<-ge>} {<1>})]
                )
              body: 
                (command.DoGroup
                  children: [
                    (command.ShAssignment
                      pairs: [
                        (assign_pair
                          lhs: (sh_lhs_expr.Name name:count)
                          op: assign_op.Equal
                          rhs: 
                            {
                              (word_part.ArithSub
                                anode: 
                                  (arith_expr.Binary
                                    op_id: Id.Arith_Minus
                                    left: {($ Id.VSub_DollarName '$count')}
                                    right: {<Id.Lit_Digits 1>}
                                  )
                              )
                            }
                          spids: [286]
                        )
                      ]
                    )
                    (C {<printf>} {(DQ <z>)})
                  ]
                )
            )
          ]
        )
    )
    (command.ShFunction
      name: zc
      body: 
        (BraceGroup
          children: [
            (command.Sentence
              child: 
                (C {<sed>} {<-e>} {(DQ <'/^index/d'>)} {<-e>} 
                  {(DQ <'s/'> ($ Id.VSub_DollarName '$z1000') <'/Q/g'>)} {<-e>} {(DQ <'s/QQQQQQQQQ/Z9000/g'>)} {<-e>} {(DQ <'s/QQQQQQQQ/Z8000/g'>)} {<-e>} 
                  {(DQ <'s/QQQQQQQ/Z7000/g'>)} {<-e>} {(DQ <'s/QQQQQQ/Z6000/g'>)} {<-e>} {(DQ <'s/QQQQQ/Z5000/g'>)} {<-e>} {(DQ <'s/QQQQ/Z4000/g'>)} {<-e>} 
                  {(DQ <'s/QQQ/Z3000/g'>)} {<-e>} {(DQ <'s/QQ/Z2000/g'>)} {<-e>} {(DQ <'s/Q/Z1000/g'>)} {<-e>} 
                  {(DQ <'s/'> ($ Id.VSub_DollarName '$z100') <'/Q/g'>)} {<-e>} {(DQ <'s/QQQQQQQQQ/Z900/g'>)} {<-e>} {(DQ <'s/QQQQQQQQ/Z800/g'>)} {<-e>} {(DQ <'s/QQQQQQQ/Z700/g'>)} 
                  {<-e>} {(DQ <'s/QQQQQQ/Z600/g'>)} {<-e>} {(DQ <'s/QQQQQ/Z500/g'>)} {<-e>} {(DQ <'s/QQQQ/Z400/g'>)} {<-e>} 
                  {(DQ <'s/QQQ/Z300/g'>)} {<-e>} {(DQ <'s/QQ/Z200/g'>)} {<-e>} {(DQ <'s/Q/Z100/g'>)} {<-e>} {(DQ <'s/000Z//g'>)} {<-e>} 
                  {(DQ <'s/'> ($ Id.VSub_DollarName '$z10') <'/Q/g'>)} {<-e>} {(DQ <'s/QQQQQQQQQ/Z90/g'>)} {<-e>} {(DQ <'s/QQQQQQQQ/Z80/g'>)} {<-e>} {(DQ <'s/QQQQQQQ/Z70/g'>)} 
                  {<-e>} {(DQ <'s/QQQQQQ/Z60/g'>)} {<-e>} {(DQ <'s/QQQQQ/Z50/g'>)} {<-e>} {(DQ <'s/QQQQ/Z40/g'>)} {<-e>} 
                  {(DQ <'s/QQQ/Z30/g'>)} {<-e>} {(DQ <'s/QQ/Z20/g'>)} {<-e>} {(DQ <'s/Q/Z10/g'>)} {<-e>} {(DQ <'s/00Z//g'>)} {<-e>} {(DQ <'s/z/Q/g'>)} 
                  {<-e>} {(DQ <'s/QQQQQQQQQ/Z9/g'>)} {<-e>} {(DQ <'s/QQQQQQQQ/Z8/g'>)} {<-e>} {(DQ <'s/QQQQQQQ/Z7/g'>)} {<-e>} 
                  {(DQ <'s/QQQQQQ/Z6/g'>)} {<-e>} {(DQ <'s/QQQQQ/Z5/g'>)} {<-e>} {(DQ <'s/QQQQ/Z4/g'>)} {<-e>} {(DQ <'s/QQQ/Z3/g'>)} {<-e>} 
                  {(DQ <'s/QQ/Z2/g'>)} {<-e>} {(DQ <'s/Q/Z1/g'>)} {<-e>} {(DQ <'s/0Z//g'>)}
                )
              terminator: <Id.Op_Semi _>
            )
          ]
        )
    )
    (command.ShFunction
      name: expect_pattern
      body: 
        (BraceGroup
          children: [
            (command.ShAssignment
              pairs: [
                (assign_pair
                  lhs: (sh_lhs_expr.Name name:cnt)
                  op: assign_op.Equal
                  rhs: {(DQ ($ Id.VSub_Number '$1'))}
                  spids: [690]
                )
              ]
            )
            (command.Simple
              words: [{<cat>}]
              redirects: [
                (redir
                  op: <Id.Redir_DLess '<<'>
                  loc: (redir_loc.Fd fd:0)
                  arg: 
                    (redir_param.HereDoc
                      here_begin: {<EOF>}
                      here_end_span_id: 774
                      stdin_parts: [
                        <'diff --git a/file-a'>
                        ($ Id.VSub_DollarName '$cnt')
                        <' b/file-a'>
                        ($ Id.VSub_DollarName '$cnt')
                        <'\n'>
                        <'--- a/file-a'>
                        ($ Id.VSub_DollarName '$cnt')
                        <'\n'>
                        <'+++ b/file-a'>
                        ($ Id.VSub_DollarName '$cnt')
                        <'\n'>
                        <'@@ -1 +1 @@\n'>
                        <-Z>
                        (${ Id.VSub_Name cnt)
                        <'a\n'>
                        <'+Z'>
                        (${ Id.VSub_Name cnt)
                        <'A\n'>
                        <'diff --git a/file-b'>
                        ($ Id.VSub_DollarName '$cnt')
                        <' b/file-b'>
                        ($ Id.VSub_DollarName '$cnt')
                        <'\n'>
                        <'--- a/file-b'>
                        ($ Id.VSub_DollarName '$cnt')
                        <'\n'>
                        <'+++ b/file-b'>
                        ($ Id.VSub_DollarName '$cnt')
                        <'\n'>
                        <'@@ -1 +1 @@\n'>
                        <'-b\n'>
                        <'+B\n'>
                        <'diff --git a/file-c'>
                        ($ Id.VSub_DollarName '$cnt')
                        <' b/file-c'>
                        ($ Id.VSub_DollarName '$cnt')
                        <'\n'>
                        <'--- a/file-c'>
                        ($ Id.VSub_DollarName '$cnt')
                        <'\n'>
                        <'+++ b/file-c'>
                        ($ Id.VSub_DollarName '$cnt')
                        <'\n'>
                        <'@@ -1 +1 @@\n'>
                        <-cZ>
                        ($ Id.VSub_DollarName '$cnt')
                        <'\n'>
                        <Id.Lit_BadBackslash '\\'>
                        <' No newline at end of file\n'>
                        <'+CZ'>
                        ($ Id.VSub_DollarName '$cnt')
                        <'\n'>
                        <Id.Lit_BadBackslash '\\'>
                        <' No newline at end of file\n'>
                        <'diff --git a/file-d'>
                        ($ Id.VSub_DollarName '$cnt')
                        <' b/file-d'>
                        ($ Id.VSub_DollarName '$cnt')
                        <'\n'>
                        <'--- a/file-d'>
                        ($ Id.VSub_DollarName '$cnt')
                        <'\n'>
                        <'+++ b/file-d'>
                        ($ Id.VSub_DollarName '$cnt')
                        <'\n'>
                        <'@@ -1 +1 @@\n'>
                        <'-d\n'>
                        <'+D\n'>
                      ]
                    )
                )
              ]
              do_fork: T
            )
          ]
        )
    )
    (command.ShAssignment
      pairs: [
        (assign_pair
          lhs: (sh_lhs_expr.Name name:sample)
          op: assign_op.Equal
          rhs: {(SQ <'1023 1024 1025 2047 4095'>)}
          spids: [778]
        )
      ]
    )
    (C {<test_expect_success>} {<setup>} 
      {
        (SQ <'\n'> <'\n'> <'\tfor n in $sample\n'> <'\tdo\n'> <'\t\t( zs $n ; echo a ) >file-a$n &&\n'> 
          <'\t\t( echo b; zs $n; echo ) >file-b$n &&\n'> <'\t\t( printf c; zs $n ) >file-c$n &&\n'> <'\t\t( echo d; zs $n ) >file-d$n &&\n'> <'\n'> 
          <'\t\tgit add file-a$n file-b$n file-c$n file-d$n &&\n'> <'\n'> <'\t\t( zs $n ; echo A ) >file-a$n &&\n'> <'\t\t( echo B; zs $n; echo ) >file-b$n &&\n'> 
          <'\t\t( printf C; zs $n ) >file-c$n &&\n'> <'\t\t( echo D; zs $n ) >file-d$n &&\n'> <'\n'> <'\t\texpect_pattern $n || return 1\n'> <'\n'> 
          <'\tdone >expect\n'>
        )
      }
    )
    (C {<test_expect_success>} {(SQ <'diff -U0'>)} 
      {
        (SQ <'\n'> <'\n'> <'\tfor n in $sample\n'> <'\tdo\n'> <'\t\tgit diff -U0 file-?$n\n'> 
          <'\tdone | zc >actual &&\n'> <'\ttest_cmp expect actual\n'> <'\n'>
        )
      }
    )
    (C {<test_done>})
  ]
)