(command.CommandList
  children: [
    (command.ShAssignment
      pairs: [
        (assign_pair
          lhs: (sh_lhs_expr.Name name:SRCDIR)
          op: assign_op.Equal
          rhs: {(command_sub left_token:<Id.Left_DollarParen '$('> child:(C {<atf_get_srcdir>}))}
          spids: [82]
        )
      ]
    )
    (command.ShAssignment
      pairs: [
        (assign_pair
          lhs: (sh_lhs_expr.Name name:TESTER)
          op: assign_op.Equal
          rhs: {(DQ (${ Id.VSub_Name SRCDIR) <'/libarchive_test'>)}
          spids: [87]
        )
      ]
    )
    (command.ShFunction
      name: check
      body: 
        (BraceGroup
          children: [
            (command.Sentence
              child: (C {<local>} {<Id.Lit_VarLike 'testcase='> (${ Id.VSub_Number 1)})
              terminator: <Id.Op_Semi _>
            )
            (C {<shift>})
            (C {<atf_check>} {<-o>} {<ignore>} {<-s>} {<Id.ControlFlow_Exit exit> <Id.Lit_Colon ':'> <0>} 
              {(${ Id.VSub_Name TESTER)} {<-d>} {<-r>} {(DQ (${ Id.VSub_Name SRCDIR))} {<-v>} {(DQ (${ Id.VSub_Name testcase))}
            )
          ]
        )
    )
    (command.ShFunction
      name: atf_init_test_cases
      body: 
        (BraceGroup
          children: [
            (command.ShAssignment
              pairs: [
                (assign_pair
                  lhs: (sh_lhs_expr.Name name:testcases)
                  op: assign_op.Equal
                  rhs: 
                    {
                      (command_sub
                        left_token: <Id.Left_DollarParen '$('>
                        child: 
                          (command.Pipeline
                            children: [
                              (command.Simple
                                words: [{(${ Id.VSub_Name TESTER)} {<-h>}]
                                redirects: [
                                  (redir
                                    op: <Id.Redir_GreatAnd '2>&'>
                                    loc: (redir_loc.Fd fd:2)
                                    arg: {<1>}
                                  )
                                ]
                                do_fork: T
                              )
                              (C {<awk>} 
                                {
                                  (SQ 
                                    <
'p != 0 && $1 ~ /^[0-9]+:/ { print $NF } /Available tests:/ { p=1 }'
                                    >
                                  )
                                }
                              )
                            ]
                            negated: F
                          )
                      )
                    }
                  spids: [171]
                )
              ]
            )
            (command.ForEach
              iter_name: testcase
              iter_words: [{(${ Id.VSub_Name testcases)}]
              do_arg_iter: F
              body: 
                (command.DoGroup
                  children: [
                    (C {<atf_test_case>} {(${ Id.VSub_Name testcase)})
                    (C {<eval>} 
                      {
                        (DQ (${ Id.VSub_Name testcase) <'_body() { check '> (${ Id.VSub_Name testcase) 
                          <'; }'>
                        )
                      }
                    )
                    (C {<atf_add_test_case>} {(${ Id.VSub_Name testcase)})
                  ]
                )
            )
          ]
        )
    )
  ]
)