(command.CommandList
  children: [
    (C {<set>} {<-eu>})
    (command.ShAssignment
      pairs: [
        (assign_pair
          lhs: (sh_lhs_expr.Name name:OUTPUT)
          op: assign_op.Equal
          rhs: {(DQ (${ Id.VSub_Name PWD) <'/'> ($ Id.VSub_Number '$1'))}
          spids: [65]
        )
      ]
    )
    (C {<shift>})
    (command.ShAssignment
      pairs: [
        (assign_pair
          lhs: (sh_lhs_expr.Name name:TMP_DIR)
          op: assign_op.Equal
          rhs: 
            {
              (braced_var_sub
                token: <Id.VSub_Name TMPDIR>
                suffix_op: 
                  (suffix_op.Unary
                    tok: <Id.VTest_ColonHyphen ':-'>
                    arg_word: {<Id.Lit_Slash '/'> <tmp>}
                  )
              )
            }
          spids: [77]
        )
      ]
    )
    (command.ShAssignment
      pairs: [
        (assign_pair
          lhs: (sh_lhs_expr.Name name:PACKAGE_DIR)
          op: assign_op.Equal
          rhs: 
            {
              (DQ 
                (command_sub
                  left_token: <Id.Left_DollarParen '$('>
                  child: 
                    (C {<mktemp>} {<-d>} 
                      {
                        (braced_var_sub
                          token: <Id.VSub_Name TMP_DIR>
                          suffix_op: 
                            (suffix_op.Unary
                              tok: <Id.VOp1_DPercent '%%'>
                              arg_word: {<Id.Lit_Slash '/'>}
                            )
                        ) <'/bazel.XXXXXXXX'>
                      }
                    )
                )
              )
            }
          spids: [85]
        )
      ]
    )
    (C {<trap>} 
      {
        (DQ <'rm -fr '> (word_part.EscapedLiteral token:<Id.Lit_EscapedChar '\\"'>) 
          (${ Id.VSub_Name PACKAGE_DIR) (word_part.EscapedLiteral token:<Id.Lit_EscapedChar '\\"'>)
        )
      } {<EXIT>}
    )
    (C {<mkdir>} {<-p>} {(DQ (${ Id.VSub_Name PACKAGE_DIR))})
    (command.ForEach
      iter_name: i
      iter_words: [{($ Id.VSub_Star '$*')}]
      do_arg_iter: F
      body: 
        (command.DoGroup
          children: [
            (command.ShAssignment
              pairs: [
                (assign_pair
                  lhs: (sh_lhs_expr.Name name:ARCHIVE)
                  op: assign_op.Equal
                  rhs: {(DQ (${ Id.VSub_Name PWD) <'/'> ($ Id.VSub_DollarName '$i'))}
                  spids: [136]
                )
              ]
            )
            (command.Case
              to_match: {(DQ ($ Id.VSub_DollarName '$i'))}
              arms: [
                (case_arm
                  pat_list: [{<Id.Lit_Star '*'> <.zip>}]
                  action: [
                    (command.ShAssignment
                      pairs: [
                        (assign_pair
                          lhs: (sh_lhs_expr.Name name:UNPACK)
                          op: assign_op.Equal
                          rhs: {(DQ <'unzip -q'>)}
                          spids: [159]
                        )
                      ]
                    )
                  ]
                  spids: [155 157 164 -1]
                )
                (case_arm
                  pat_list: [{<Id.Lit_Star '*'> <.tar>}]
                  action: [
                    (command.ShAssignment
                      pairs: [
                        (assign_pair
                          lhs: (sh_lhs_expr.Name name:UNPACK)
                          op: assign_op.Equal
                          rhs: {(DQ <'tar xf'>)}
                          spids: [171]
                        )
                      ]
                    )
                  ]
                  spids: [167 169 176 -1]
                )
              ]
            )
            (command.Subshell
              child: 
                (command.AndOr
                  ops: [Id.Op_DAmp]
                  children: [
                    (C {<cd>} {(DQ (${ Id.VSub_Name PACKAGE_DIR))})
                    (C {(${ Id.VSub_Name UNPACK)} {(DQ (${ Id.VSub_Name ARCHIVE))})
                  ]
                )
            )
          ]
        )
    )
    (command.Subshell
      child: 
        (command.AndOr
          ops: [Id.Op_DAmp]
          children: [
            (C {<cd>} {(DQ (${ Id.VSub_Name PACKAGE_DIR))})
            (command.Pipeline
              children: [
                (C {<find>} {<.>} {<-type>} {<f>})
                (C {<sort>})
                (C {<zip>} {<-qDX> <Id.Lit_At '@'>} {(DQ (${ Id.VSub_Name OUTPUT))})
              ]
              negated: F
            )
          ]
        )
    )
  ]
)