(command.CommandList
  children: [
    (C {<.>} 
      {
        (DQ 
          (command_sub
            left_token: <Id.Left_DollarParen '$('>
            child: (C {<dirname>} {(DQ ($ Id.VSub_Number '$0'))})
          ) <'/../../GIT-BUILD-OPTIONS'>
        )
      }
    )
    (C {<Id.Lit_Colon ':'>} 
      {
        (braced_var_sub
          token: <Id.VSub_Name TEST_OUTPUT_DIRECTORY>
          suffix_op: 
            (suffix_op.Unary
              tok: <Id.VTest_Equals '='>
              arg_word: 
                {
                  (command_sub
                    left_token: <Id.Left_DollarParen '$('>
                    child: (C {<dirname>} {(DQ ($ Id.VSub_Number '$0'))})
                  ) <Id.Lit_Slash '/'> <..>
                }
            )
        )
      }
    )
    (command.ShAssignment
      pairs: [
        (assign_pair
          lhs: (sh_lhs_expr.Name name:output)
          op: assign_op.Equal
          rhs: (word.Empty)
          spids: [40]
        )
      ]
    )
    (command.ShAssignment
      pairs: [(assign_pair lhs:(sh_lhs_expr.Name name:count) op:assign_op.Equal rhs:{<0>} spids:[42])]
    )
    (command.ShAssignment
      pairs: [
        (assign_pair
          lhs: (sh_lhs_expr.Name name:total_count)
          op: assign_op.Equal
          rhs: {<0>}
          spids: [45]
        )
      ]
    )
    (command.ShAssignment
      pairs: [
        (assign_pair
          lhs: (sh_lhs_expr.Name name:missing_message)
          op: assign_op.Equal
          rhs: (word.Empty)
          spids: [48]
        )
      ]
    )
    (command.ShAssignment
      pairs: [
        (assign_pair
          lhs: (sh_lhs_expr.Name name:new_line)
          op: assign_op.Equal
          rhs: {(SQ <'\n'>)}
          spids: [50]
        )
      ]
    )
    (command.ShFunction
      name: start_output
      body: 
        (BraceGroup
          children: [
            (command.AndOr
              ops: [Id.Op_DPipe]
              children: [
                (C {<test>} {<-z>} {(DQ ($ Id.VSub_DollarName '$output'))})
                (command.ControlFlow token:<Id.ControlFlow_Return return>)
              ]
            )
            (command.ShAssignment
              pairs: [
                (assign_pair
                  lhs: (sh_lhs_expr.Name name:total_count)
                  op: assign_op.Equal
                  rhs: 
                    {
                      (word_part.ArithSub
                        anode: 
                          (arith_expr.Binary
                            op_id: Id.Arith_Plus
                            left: {($ Id.VSub_DollarName '$total_count')}
                            right: {<Id.Lit_Digits 1>}
                          )
                      )
                    }
                  spids: [88]
                )
              ]
            )
            (command.AndOr
              ops: [Id.Op_DAmp]
              children: [
                (C {<test>} {<-t>} {<2>})
                (command.Simple
                  words: [
                    {<printf>}
                    {(DQ <Id.Lit_BadBackslash '\\'> <'rFound %d errors'>)}
                    {($ Id.VSub_DollarName '$total_count')}
                  ]
                  redirects: [(redir op:<Id.Redir_GreatAnd '>&'> loc:(redir_loc.Fd fd:1) arg:{<2>})]
                  do_fork: T
                )
              ]
            )
            (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_Plus
                            left: {($ Id.VSub_DollarName '$count')}
                            right: {<Id.Lit_Digits 1>}
                          )
                      )
                    }
                  spids: [119]
                )
              ]
            )
            (command.ShAssignment
              pairs: [
                (assign_pair
                  lhs: (sh_lhs_expr.Name name:output)
                  op: assign_op.Equal
                  rhs: {($ Id.VSub_DollarName '$out_prefix') <.> ($ Id.VSub_DollarName '$count')}
                  spids: [128]
                )
              ]
            )
            (command.Simple
              words: [{<Id.Lit_Colon ':'>}]
              redirects: [
                (redir
                  op: <Id.Redir_Great '>'>
                  loc: (redir_loc.Fd fd:1)
                  arg: {($ Id.VSub_DollarName '$output')}
                )
              ]
              do_fork: T
            )
            (command.Simple
              words: [{<echo>} {(DQ <'*** '> ($ Id.VSub_Number '$1') <' ***'>)}]
              redirects: [
                (redir
                  op: <Id.Redir_Great '>'>
                  loc: (redir_loc.Fd fd:1)
                  arg: {($ Id.VSub_DollarName '$output') <.message>}
                )
              ]
              do_fork: T
            )
          ]
        )
    )
    (command.ShFunction
      name: finish_output
      body: 
        (BraceGroup
          children: [
            (command.AndOr
              ops: [Id.Op_DPipe]
              children: [
                (C {<test>} {<Id.KW_Bang '!'>} {<-z>} {(DQ ($ Id.VSub_DollarName '$output'))})
                (command.ControlFlow token:<Id.ControlFlow_Return return>)
              ]
            )
            (command.ShAssignment
              pairs: [
                (assign_pair
                  lhs: (sh_lhs_expr.Name name:output)
                  op: assign_op.Equal
                  rhs: (word.Empty)
                  spids: [181]
                )
              ]
            )
            (command.AndOr
              ops: [Id.Op_DPipe]
              children: [
                (C {<test>} {<-z>} {(DQ ($ Id.VSub_DollarName '$missing_message'))})
                (BraceGroup
                  children: [
                    (command.WhileUntil
                      keyword: <Id.KW_While while>
                      cond: 
                        (condition.Shell
                          commands: [
                            (C {<test>} {($ Id.VSub_DollarName '$missing_message')} {<-lt>} 
                              {($ Id.VSub_DollarName '$count')}
                            )
                          ]
                        )
                      body: 
                        (command.DoGroup
                          children: [
                            (C {<cp>} 
                              {($ Id.VSub_DollarName '$out_prefix') <.> 
                                ($ Id.VSub_DollarName '$count') <.message>
                              } {($ Id.VSub_DollarName '$out_prefix') <.> ($ Id.VSub_DollarName '$missing_message') <.message>}
                            )
                            (command.ShAssignment
                              pairs: [
                                (assign_pair
                                  lhs: (sh_lhs_expr.Name name:missing_message)
                                  op: assign_op.Equal
                                  rhs: 
                                    {
                                      (word_part.ArithSub
                                        anode: 
                                          (arith_expr.Binary
                                            op_id: Id.Arith_Plus
                                            left: {($ Id.VSub_DollarName '$missing_message')}
                                            right: {<Id.Lit_Digits 1>}
                                          )
                                      )
                                    }
                                  spids: [235]
                                )
                              ]
                            )
                          ]
                        )
                    )
                    (command.ShAssignment
                      pairs: [
                        (assign_pair
                          lhs: (sh_lhs_expr.Name name:missing_message)
                          op: assign_op.Equal
                          rhs: (word.Empty)
                          spids: [247]
                        )
                      ]
                    )
                  ]
                )
              ]
            )
          ]
        )
    )
    (command.ShFunction
      name: output_all
      body: 
        (BraceGroup
          children: [
            (command.ShAssignment
              pairs: [
                (assign_pair
                  lhs: (sh_lhs_expr.Name name:last_line)
                  op: assign_op.Equal
                  rhs: (word.Empty)
                  spids: [266]
                )
              ]
            )
            (command.ShAssignment
              pairs: [
                (assign_pair
                  lhs: (sh_lhs_expr.Name name:j)
                  op: assign_op.Equal
                  rhs: {<0>}
                  spids: [269]
                )
              ]
            )
            (command.ShAssignment
              pairs: [
                (assign_pair
                  lhs: (sh_lhs_expr.Name name:i)
                  op: assign_op.Equal
                  rhs: {<1>}
                  spids: [273]
                )
              ]
            )
            (command.Pipeline
              children: [
                (command.WhileUntil
                  keyword: <Id.KW_While while>
                  cond: 
                    (condition.Shell
                      commands: [
                        (C {<test>} {($ Id.VSub_DollarName '$i')} {<-le>} 
                          {($ Id.VSub_DollarName '$count')}
                        )
                      ]
                    )
                  body: 
                    (command.DoGroup
                      children: [
                        (C {<echo>} 
                          {
                            (DQ ($ Id.VSub_DollarName '$i') <' '> 
                              (command_sub
                                left_token: <Id.Left_DollarParen '$('>
                                child: 
                                  (command.Simple
                                    words: [{<tr>} {(SQ <'\\n'>)} {(SQ <' '>)}]
                                    redirects: [
                                      (redir
                                        op: <Id.Redir_Less '<'>
                                        loc: (redir_loc.Fd fd:0)
                                        arg: 
                                          {($ Id.VSub_DollarName '$out_prefix') <.> 
                                            ($ Id.VSub_DollarName '$i')
                                          }
                                      )
                                    ]
                                    do_fork: T
                                  )
                              )
                            )
                          }
                        )
                        (command.ShAssignment
                          pairs: [
                            (assign_pair
                              lhs: (sh_lhs_expr.Name name:i)
                              op: assign_op.Equal
                              rhs: 
                                {
                                  (word_part.ArithSub
                                    anode: 
                                      (arith_expr.Binary
                                        op_id: Id.Arith_Plus
                                        left: {($ Id.VSub_DollarName '$i')}
                                        right: {<Id.Lit_Digits 1>}
                                      )
                                  )
                                }
                              spids: [320]
                            )
                          ]
                        )
                      ]
                    )
                )
                (C {<sort>} {<-t>} {(SQ <' '>)} {<-k>} {<2>})
                (command.WhileUntil
                  keyword: <Id.KW_While while>
                  cond: (condition.Shell commands:[(C {<read>} {<number>} {<line>})])
                  body: 
                    (command.DoGroup
                      children: [
                        (command.If
                          arms: [
                            (if_arm
                              cond: 
                                (condition.Shell
                                  commands: [
                                    (C {<test>} {(DQ ($ Id.VSub_DollarName '$line'))} 
                                      {<Id.KW_Bang '!'> <Id.Lit_Equals '='>} {(DQ ($ Id.VSub_DollarName '$last_line'))}
                                    )
                                  ]
                                )
                              action: [
                                (command.ShAssignment
                                  pairs: [
                                    (assign_pair
                                      lhs: (sh_lhs_expr.Name name:last_line)
                                      op: assign_op.Equal
                                      rhs: {($ Id.VSub_DollarName '$line')}
                                      spids: [387]
                                    )
                                  ]
                                )
                                (command.ShAssignment
                                  pairs: [
                                    (assign_pair
                                      lhs: (sh_lhs_expr.Name name:j)
                                      op: assign_op.Equal
                                      rhs: 
                                        {
                                          (word_part.ArithSub
                                            anode: 
                                              (arith_expr.Binary
                                                op_id: Id.Arith_Plus
                                                left: {($ Id.VSub_DollarName '$j')}
                                                right: {<Id.Lit_Digits 1>}
                                              )
                                          )
                                        }
                                      spids: [391]
                                    )
                                  ]
                                )
                                (C {<printf>} 
                                  {
                                    (DQ <Id.Lit_BadBackslash '\\'> <'nValgrind error '> 
                                      ($ Id.VSub_DollarName '$j') <':'> <Id.Lit_BadBackslash '\\'> <n> <Id.Lit_BadBackslash '\\'> <n>
                                    )
                                  }
                                )
                                (C {<cat>} 
                                  {($ Id.VSub_DollarName '$out_prefix') <.> 
                                    ($ Id.VSub_DollarName '$number')
                                  }
                                )
                                (C {<printf>} 
                                  {
                                    (DQ <Id.Lit_BadBackslash '\\'> <'nfound in:'> 
                                      <Id.Lit_BadBackslash '\\'> <n>
                                    )
                                  }
                                )
                              ]
                              spids: [368 384]
                            )
                          ]
                        )
                        (C {<printf>} {(DQ <Id.Lit_BadBackslash '\\'> <n>)})
                        (C {<cat>} 
                          {($ Id.VSub_DollarName '$out_prefix') <.> ($ Id.VSub_DollarName '$number') 
                            <.message>
                          }
                        )
                      ]
                    )
                )
              ]
              negated: F
            )
          ]
        )
    )
    (command.ShFunction
      name: handle_one
      body: 
        (BraceGroup
          children: [
            (command.ShAssignment
              pairs: [
                (assign_pair
                  lhs: (sh_lhs_expr.Name name:OLDIFS)
                  op: assign_op.Equal
                  rhs: {($ Id.VSub_DollarName '$IFS')}
                  spids: [467]
                )
              ]
            )
            (command.ShAssignment
              pairs: [
                (assign_pair
                  lhs: (sh_lhs_expr.Name name:IFS)
                  op: assign_op.Equal
                  rhs: {(DQ ($ Id.VSub_DollarName '$new_line'))}
                  spids: [471]
                )
              ]
            )
            (command.WhileUntil
              keyword: <Id.KW_While while>
              cond: (condition.Shell commands:[(C {<read>} {<line>})])
              body: 
                (command.DoGroup
                  children: [
                    (command.Case
                      to_match: {(DQ ($ Id.VSub_DollarName '$line'))}
                      arms: [
                        (case_arm
                          pat_list: [
                            {<Id.Lit_Equals '='> <Id.Lit_Equals '='> <Id.Lit_LBracket '['> <0-9> 
                              <Id.Lit_RBracket ']'> <Id.Lit_Star '*'>
                            }
                          ]
                          action: [
                            (command.Case
                              to_match: {(DQ ($ Id.VSub_DollarName '$output'))}
                              arms: [
                                (case_arm
                                  pat_list: [{<Id.Lit_Star '*'> <.message>}]
                                  action: [
                                    (command.AndOr
                                      ops: [Id.Op_DAmp]
                                      children: [
                                        (C {<test>} {<-z>} 
                                          {(DQ ($ Id.VSub_DollarName '$missing_message'))}
                                        )
                                        (command.ShAssignment
                                          pairs: [
                                            (assign_pair
                                              lhs: (sh_lhs_expr.Name name:missing_message)
                                              op: assign_op.Equal
                                              rhs: {($ Id.VSub_DollarName '$count')}
                                              spids: [539]
                                            )
                                          ]
                                        )
                                      ]
                                    )
                                    (command.ShAssignment
                                      pairs: [
                                        (assign_pair
                                          lhs: (sh_lhs_expr.Name name:output)
                                          op: assign_op.Equal
                                          rhs: (word.Empty)
                                          spids: [543]
                                        )
                                      ]
                                    )
                                  ]
                                  spids: [523 525 -1 546]
                                )
                              ]
                            )
                            (C {<start_output>} 
                              {
                                (command_sub
                                  left_token: <Id.Left_DollarParen '$('>
                                  child: (C {<basename>} {($ Id.VSub_Number '$1')})
                                )
                              }
                            )
                            (command.Pipeline
                              children: [
                                (C {<echo>} {(DQ ($ Id.VSub_DollarName '$line'))})
                                (command.Simple
                                  words: [{<sed>} {(SQ <'s/==[0-9]*==/==valgrind==/'>)}]
                                  redirects: [
                                    (redir
                                      op: <Id.Redir_DGreat '>>'>
                                      loc: (redir_loc.Fd fd:1)
                                      arg: {($ Id.VSub_DollarName '$output')}
                                    )
                                  ]
                                  do_fork: T
                                )
                              ]
                              negated: F
                            )
                          ]
                          spids: [500 506 579 -1]
                        )
                        (case_arm
                          pat_list: [{(SQ <'}'>)}]
                          action: [
                            (command.AndOr
                              ops: [Id.Op_DPipe]
                              children: [
                                (C {<test>} {<-z>} {(DQ ($ Id.VSub_DollarName '$output'))})
                                (BraceGroup
                                  children: [
                                    (command.Simple
                                      words: [{<echo>} {(DQ ($ Id.VSub_DollarName '$line'))}]
                                      redirects: [
                                        (redir
                                          op: <Id.Redir_DGreat '>>'>
                                          loc: (redir_loc.Fd fd:1)
                                          arg: {($ Id.VSub_DollarName '$output')}
                                        )
                                      ]
                                      do_fork: T
                                    )
                                    (command.AndOr
                                      ops: [Id.Op_DAmp]
                                      children: [
                                        (C {<test>} {($ Id.VSub_DollarName '$output')} 
                                          {<Id.Lit_Equals '='>} 
                                          {
                                            (braced_var_sub
                                              token: <Id.VSub_Name output>
                                              suffix_op: 
                                                (suffix_op.Unary
                                                  tok: <Id.VOp1_Percent '%'>
                                                  arg_word: {<.message>}
                                                )
                                            )
                                          }
                                        )
                                        (command.ShAssignment
                                          pairs: [
                                            (assign_pair
                                              lhs: (sh_lhs_expr.Name name:output)
                                              op: assign_op.Equal
                                              rhs: {($ Id.VSub_DollarName '$output') <.message>}
                                              spids: [631]
                                            )
                                          ]
                                        )
                                      ]
                                    )
                                  ]
                                )
                              ]
                            )
                          ]
                          spids: [586 589 639 -1]
                        )
                        (case_arm
                          pat_list: [{(SQ )}]
                          action: [(C {<finish_output>})]
                          spids: [646 648 654 -1]
                        )
                        (case_arm
                          pat_list: [{<Id.Lit_Star '*'>}]
                          action: [
                            (command.AndOr
                              ops: [Id.Op_DPipe]
                              children: [
                                (C {<test>} {<-z>} {(DQ ($ Id.VSub_DollarName '$output'))})
                                (command.Simple
                                  words: [{<echo>} {(DQ ($ Id.VSub_DollarName '$line'))}]
                                  redirects: [
                                    (redir
                                      op: <Id.Redir_DGreat '>>'>
                                      loc: (redir_loc.Fd fd:1)
                                      arg: {($ Id.VSub_DollarName '$output')}
                                    )
                                  ]
                                  do_fork: T
                                )
                              ]
                            )
                          ]
                          spids: [661 662 686 -1]
                        )
                      ]
                    )
                  ]
                )
              redirects: [
                (redir
                  op: <Id.Redir_Less '<'>
                  loc: (redir_loc.Fd fd:0)
                  arg: {($ Id.VSub_Number '$1')}
                )
              ]
            )
            (command.ShAssignment
              pairs: [
                (assign_pair
                  lhs: (sh_lhs_expr.Name name:IFS)
                  op: assign_op.Equal
                  rhs: {($ Id.VSub_DollarName '$OLDIFS')}
                  spids: [699]
                )
              ]
            )
            (C {<finish_output>})
          ]
        )
    )
    (command.ForEach
      iter_names: [test_script]
      iterable: 
        (for_iter.Words
          words: [
            {(DQ ($ Id.VSub_DollarName '$TEST_OUTPUT_DIRECTORY')) <'/test-results/'> <Id.Lit_Star '*'> 
              <.out>
            }
          ]
        )
      body: (command.DoGroup children:[(C {<handle_one>} {($ Id.VSub_DollarName '$test_script')})])
    )
    (C {<output_all>})
  ]
)