(command.CommandList
  children: [
    (command.ShAssignment
      pairs: [
        (assign_pair
          lhs: (sh_lhs_expr.Name name:test_description)
          op: assign_op.Equal
          rhs: {(SQ <'diff hunk fusing'>)}
          spids: [4]
        )
      ]
    )
    (C {<.>} {<'./test-lib.sh'>})
    (command.ShFunction
      name: f
      body: 
        (BraceGroup
          children: [
            (C {<echo>} {($ Id.VSub_Number '$1')})
            (command.ShAssignment
              pairs: [
                (assign_pair
                  lhs: (sh_lhs_expr.Name name:i)
                  op: assign_op.Equal
                  rhs: {<1>}
                  spids: [27]
                )
              ]
            )
            (command.WhileUntil
              keyword: <Id.KW_While while>
              cond: 
                (condition.Shell
                  commands: [
                    (C {<test>} {($ Id.VSub_DollarName '$i')} {<-le>} {($ Id.VSub_Number '$2')})
                  ]
                )
              body: 
                (command.DoGroup
                  children: [
                    (C {<echo>} {($ Id.VSub_DollarName '$i')})
                    (command.ShAssignment
                      pairs: [
                        (assign_pair
                          lhs: (sh_lhs_expr.Name name:i)
                          op: assign_op.Equal
                          rhs: 
                            {
                              (command_sub
                                left_token: <Id.Left_DollarParen '$('>
                                child: 
                                  (C {<expr>} {($ Id.VSub_DollarName '$i')} {<Id.Lit_Other '+'>} {<1>})
                              )
                            }
                          spids: [50]
                        )
                      ]
                    )
                  ]
                )
            )
            (C {<echo>} {($ Id.VSub_Number '$3')})
          ]
        )
    )
    (command.ShFunction
      name: t
      body: 
        (BraceGroup
          children: [
            (command.Case
              to_match: {($ Id.VSub_Pound '$#')}
              arms: [
                (case_arm
                  pat_list: [{<4>}]
                  action: [
                    (command.Sentence
                      child: 
                        (command.ShAssignment
                          pairs: [
                            (assign_pair
                              lhs: (sh_lhs_expr.Name name:hunks)
                              op: assign_op.Equal
                              rhs: {($ Id.VSub_Number '$4')}
                              spids: [89]
                            )
                          ]
                        )
                      terminator: <Id.Op_Semi _>
                    )
                    (command.ShAssignment
                      pairs: [
                        (assign_pair
                          lhs: (sh_lhs_expr.Name name:cmd)
                          op: assign_op.Equal
                          rhs: {(DQ <'diff -U'> ($ Id.VSub_Number '$3'))}
                          spids: [93]
                        )
                      ]
                    )
                  ]
                  spids: [86 87 98 -1]
                )
                (case_arm
                  pat_list: [{<5>}]
                  action: [
                    (command.Sentence
                      child: 
                        (command.ShAssignment
                          pairs: [
                            (assign_pair
                              lhs: (sh_lhs_expr.Name name:hunks)
                              op: assign_op.Equal
                              rhs: {($ Id.VSub_Number '$5')}
                              spids: [104]
                            )
                          ]
                        )
                      terminator: <Id.Op_Semi _>
                    )
                    (command.ShAssignment
                      pairs: [
                        (assign_pair
                          lhs: (sh_lhs_expr.Name name:cmd)
                          op: assign_op.Equal
                          rhs: 
                            {
                              (DQ <'diff -U'> ($ Id.VSub_Number '$3') <' --inter-hunk-context='> 
                                ($ Id.VSub_Number '$4')
                              )
                            }
                          spids: [108]
                        )
                      ]
                    )
                  ]
                  spids: [101 102 115 -1]
                )
              ]
            )
            (command.ShAssignment
              pairs: [
                (assign_pair
                  lhs: (sh_lhs_expr.Name name:label)
                  op: assign_op.Equal
                  rhs: 
                    {
                      (DQ ($ Id.VSub_DollarName '$cmd') <', '> ($ Id.VSub_Number '$1') <' common '> 
                        ($ Id.VSub_Number '$2')
                      )
                    }
                  spids: [121]
                )
              ]
            )
            (command.ShAssignment
              pairs: [
                (assign_pair
                  lhs: (sh_lhs_expr.Name name:file)
                  op: assign_op.Equal
                  rhs: {<f> ($ Id.VSub_Number '$1')}
                  spids: [131]
                )
              ]
            )
            (command.ShAssignment
              pairs: [
                (assign_pair
                  lhs: (sh_lhs_expr.Name name:expected)
                  op: assign_op.Equal
                  rhs: 
                    {<expected.> ($ Id.VSub_DollarName '$file') <.> ($ Id.VSub_Number '$3') <.> 
                      ($ Id.VSub_DollarName '$hunks')
                    }
                  spids: [136]
                )
              ]
            )
            (command.If
              arms: [
                (if_arm
                  cond: 
                    (condition.Shell
                      commands: [
                        (command.Pipeline
                          children: [(C {<test>} {<-f>} {($ Id.VSub_DollarName '$file')})]
                          negated: T
                        )
                      ]
                    )
                  action: [
                    (command.Simple
                      words: [{<f>} {<A>} {($ Id.VSub_Number '$1')} {<B>}]
                      redirects: [
                        (redir
                          op: <Id.Redir_Great '>'>
                          loc: (redir_loc.Fd fd:1)
                          arg: {($ Id.VSub_DollarName '$file')}
                        )
                      ]
                      do_fork: T
                    )
                    (C {<git>} {<add>} {($ Id.VSub_DollarName '$file')})
                    (C {<git>} {<commit>} {<-q>} {<-m.>} {($ Id.VSub_DollarName '$file')})
                    (command.Simple
                      words: [{<f>} {<X>} {($ Id.VSub_Number '$1')} {<Y>}]
                      redirects: [
                        (redir
                          op: <Id.Redir_Great '>'>
                          loc: (redir_loc.Fd fd:1)
                          arg: {($ Id.VSub_DollarName '$file')}
                        )
                      ]
                      do_fork: T
                    )
                  ]
                  spids: [146 157]
                )
              ]
            )
            (C {<test_expect_success>} 
              {
                (DQ ($ Id.VSub_DollarName '$label') <': count hunks ('> ($ Id.VSub_DollarName '$hunks') 
                  <')'>
                )
              } 
              {
                (DQ <'\n'> <'\t\ttest '> 
                  (command_sub
                    left_token: <Id.Left_DollarParen '$('>
                    child: 
                      (command.Pipeline
                        children: [
                          (C {<git>} {($ Id.VSub_DollarName '$cmd')} {($ Id.VSub_DollarName '$file')})
                          (C {<grep>} {(SQ <'^@@ '>)})
                          (C {<wc>} {<-l>})
                        ]
                        negated: F
                      )
                  ) <' = '> ($ Id.VSub_DollarName '$hunks') <'\n'> <'\t'>
                )
              }
            )
            (command.AndOr
              ops: [Id.Op_DAmp]
              children: [
                (C {<test>} {<-f>} {($ Id.VSub_DollarName '$expected')})
                (C {<test_expect_success>} {(DQ ($ Id.VSub_DollarName '$label') <': check output'>)} 
                  {
                    (DQ <'\n'> <'\t\tgit '> ($ Id.VSub_DollarName '$cmd') <' '> 
                      ($ Id.VSub_DollarName '$file') <' | grep -v \'^index \' >actual &&\n'> <'\t\ttest_cmp '> ($ Id.VSub_DollarName '$expected') 
                      <' actual\n'> <'\t'>
                    )
                  }
                )
              ]
            )
          ]
        )
    )
    (command.AndOr
      ops: [Id.Op_DPipe]
      children: [
        (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: 303
                  stdin_parts: [
                    <'diff --git a/f1 b/f1\n'>
                    <'--- a/f1\n'>
                    <'+++ b/f1\n'>
                    <'@@ -1,3 +1,3 @@\n'>
                    <'-A\n'>
                    <'+X\n'>
                    <' 1\n'>
                    <'-B\n'>
                    <'+Y\n'>
                  ]
                )
            )
            (redir op:<Id.Redir_Great '>'> loc:(redir_loc.Fd fd:1) arg:{<expected.f1.0.1>})
          ]
          do_fork: T
        )
        (command.ControlFlow token:<Id.ControlFlow_Exit exit> arg_word:{<1>})
      ]
    )
    (command.AndOr
      ops: [Id.Op_DPipe]
      children: [
        (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: 329
                  stdin_parts: [
                    <'diff --git a/f1 b/f1\n'>
                    <'--- a/f1\n'>
                    <'+++ b/f1\n'>
                    <'@@ -1 +1 @@\n'>
                    <'-A\n'>
                    <'+X\n'>
                    <'@@ -3 +3 @@ A\n'>
                    <'-B\n'>
                    <'+Y\n'>
                  ]
                )
            )
            (redir op:<Id.Redir_Great '>'> loc:(redir_loc.Fd fd:1) arg:{<expected.f1.0.2>})
          ]
          do_fork: T
        )
        (command.ControlFlow token:<Id.ControlFlow_Exit exit> arg_word:{<1>})
      ]
    )
    (C {<t>} {<1>} {<line>} {<0>} {<2>})
    (C {<t>} {<1>} {<line>} {<0>} {<0>} {<2>})
    (C {<t>} {<1>} {<line>} {<0>} {<1>} {<1>})
    (C {<t>} {<1>} {<line>} {<0>} {<2>} {<1>})
    (C {<t>} {<1>} {<line>} {<1>} {<1>})
    (C {<t>} {<2>} {<lines>} {<0>} {<2>})
    (C {<t>} {<2>} {<lines>} {<0>} {<0>} {<2>})
    (C {<t>} {<2>} {<lines>} {<0>} {<1>} {<2>})
    (C {<t>} {<2>} {<lines>} {<0>} {<2>} {<1>})
    (C {<t>} {<2>} {<lines>} {<1>} {<1>})
    (C {<t>} {<3>} {<lines>} {<1>} {<2>})
    (C {<t>} {<3>} {<lines>} {<1>} {<0>} {<2>})
    (C {<t>} {<3>} {<lines>} {<1>} {<1>} {<1>})
    (C {<t>} {<3>} {<lines>} {<1>} {<2>} {<1>})
    (C {<t>} {<9>} {<lines>} {<3>} {<2>})
    (C {<t>} {<9>} {<lines>} {<3>} {<2>} {<2>})
    (C {<t>} {<9>} {<lines>} {<3>} {<3>} {<1>})
    (C {<test_done>})
  ]
)