(command.CommandList
  children: [
    (C {<Id.KW_Set set>} {<-e>})
    (command.ShAssignment
      pairs: [
        (assign_pair
          lhs: (sh_lhs_expr.Name name:type)
          op: assign_op.Equal
          rhs: {($ Id.VSub_Number '$1')}
          spids: [67]
        )
      ]
    )
    (command.ShAssignment
      pairs: [
        (assign_pair
          lhs: (sh_lhs_expr.Name name:objpfx)
          op: assign_op.Equal
          rhs: {($ Id.VSub_Number '$2')}
          spids: [70]
        )
      ]
    )
    (C {<shift>} {<2>})
    (command.Case
      to_match: {($ Id.VSub_DollarName '$type')}
      arms: [
        (case_arm
          pat_list: [{<-s>}]
          action: [
            (command.ShAssignment
              pairs: [
                (assign_pair
                  lhs: (sh_lhs_expr.Name name:subdir)
                  op: assign_op.Equal
                  rhs: {($ Id.VSub_Number '$1')}
                  spids: [89]
                )
              ]
            )
            (C {<shift>})
            (command.ShAssignment
              pairs: [
                (assign_pair
                  lhs: (sh_lhs_expr.Name name:subdir)
                  op: assign_op.Equal
                  rhs: 
                    {
                      (braced_var_sub
                        token: <Id.VSub_Name subdir>
                        suffix_op: 
                          (suffix_op.Unary
                            op_id: Id.VTest_ColonPlus
                            arg_word: {($ Id.VSub_DollarName '$subdir') <Id.Lit_Slash />}
                          )
                      )
                    }
                  spids: [96]
                )
              ]
            )
            (command.ForEach
              iter_name: t
              iter_words: [{(DQ ($ Id.VSub_At '$@'))}]
              do_arg_iter: F
              body: 
                (command.DoGroup
                  children: [
                    (command.If
                      arms: [
                        (if_arm
                          cond: [
                            (command.Sentence
                              child: 
                                (C {<Id.Lit_LBracket '['>} {<-s>} 
                                  {
                                    (DQ ($ Id.VSub_DollarName '$objpfx') ($ Id.VSub_DollarName '$t') 
                                      <.test-result>
                                    )
                                  } {<Id.Lit_RBracket ']'>}
                                )
                              terminator: <Id.Op_Semi _>
                            )
                          ]
                          action: [
                            (C {<head>} {<-n1>} 
                              {
                                (DQ ($ Id.VSub_DollarName '$objpfx') ($ Id.VSub_DollarName '$t') 
                                  <.test-result>
                                )
                              }
                            )
                          ]
                          spids: [119 134]
                        )
                      ]
                      else_action: [
                        (C {<echo>} 
                          {
                            (DQ <'UNRESOLVED: '> ($ Id.VSub_DollarName '$subdir') 
                              ($ Id.VSub_DollarName '$t')
                            )
                          }
                        )
                      ]
                    )
                  ]
                )
            )
          ]
          spids: [85 86 166 -1]
        )
        (case_arm
          pat_list: [{<-t>}]
          action: [
            (command.ShAssignment
              pairs: [
                (assign_pair
                  lhs: (sh_lhs_expr.Name name:subdir_file_name)
                  op: assign_op.Equal
                  rhs: {($ Id.VSub_Number '$1')}
                  spids: [174]
                )
              ]
            )
            (C {<shift>})
            (command.ForEach
              iter_name: d
              iter_words: [{(DQ ($ Id.VSub_At '$@'))}]
              do_arg_iter: F
              body: 
                (command.DoGroup
                  children: [
                    (command.If
                      arms: [
                        (if_arm
                          cond: [
                            (command.Sentence
                              child: 
                                (C {<Id.Lit_LBracket '['>} {<-f>} 
                                  {
                                    (DQ ($ Id.VSub_DollarName '$objpfx') ($ Id.VSub_DollarName '$d') 
                                      </> ($ Id.VSub_DollarName '$subdir_file_name')
                                    )
                                  } {<Id.Lit_RBracket ']'>}
                                )
                              terminator: <Id.Op_Semi _>
                            )
                          ]
                          action: [
                            (C {<cat>} 
                              {
                                (DQ ($ Id.VSub_DollarName '$objpfx') ($ Id.VSub_DollarName '$d') </> 
                                  ($ Id.VSub_DollarName '$subdir_file_name')
                                )
                              }
                            )
                          ]
                          spids: [195 211]
                        )
                      ]
                      else_action: [
                        (C {<echo>} 
                          {
                            (DQ <'ERROR: test results for '> ($ Id.VSub_DollarName '$d') 
                              <' directory missing'>
                            )
                          }
                        )
                      ]
                    )
                  ]
                )
            )
          ]
          spids: [170 171 242 -1]
        )
        (case_arm
          pat_list: [{<Id.Lit_Star '*'>}]
          action: [
            (command.Simple
              words: [{<echo>} {(DQ <'unknown type '> ($ Id.VSub_DollarName '$type'))}]
              redirects: [(redir.Redir op:<Id.Redir_GreatAnd '>&'> fd:-1 arg_word:{<2>})]
            )
            (command.ControlFlow token:<Id.ControlFlow_Exit exit> arg_word:{<1>})
          ]
          spids: [246 247 266 -1]
        )
      ]
    )
  ]
)