(CommandList
  children: [
    (Assignment
      keyword: Assign_None
      pairs: [(assign_pair lhs:(LhsName name:PERMS) op:Equal rhs:{($ VSub_Number '$1')} spids:[14])]
      spids: [14]
    )
    (C {(shift)})
    (Assignment
      keyword: Assign_None
      pairs: [(assign_pair lhs:(LhsName name:ARGS) op:Equal rhs:{(DQ )} spids:[20])]
      spids: [20]
    )
    (While
      cond: [
        (Sentence
          child: (C {(Lit_Other '[')} {($ VSub_Pound '$#')} {(-gt)} {(1)} {(Lit_Other ']')})
          terminator: <Op_Semi ';'>
        )
      ]
      body: 
        (DoGroup
          children: [
            (Assignment
              keyword: Assign_None
              pairs: [
                (assign_pair
                  lhs: (LhsName name:ARGS)
                  op: Equal
                  rhs: {(DQ ($ VSub_Name '$ARGS') (' ') ($ VSub_Number '$1'))}
                  spids: [40]
                )
              ]
              spids: [40]
            )
            (C {(shift)})
          ]
          spids: [37 50]
        )
    )
    (Assignment
      keyword: Assign_None
      pairs: [(assign_pair lhs:(LhsName name:DEST) op:Equal rhs:{($ VSub_Number '$1')} spids:[52])]
      spids: [52]
    )
    (ForEach
      iter_name: SRC
      iter_words: [{($ VSub_Name '$ARGS')}]
      do_arg_iter: False
      body: 
        (DoGroup
          children: [
            (C {(cp)} {(-a)} {($ VSub_Name '$SRC')} {($ VSub_Name '$DEST')})
            (If
              arms: [
                (if_arm
                  cond: [
                    (Sentence
                      child: 
                        (C {(Lit_Other '[')} {(-d)} {(DQ ($ VSub_Name '$DEST'))} {(Lit_Other ']')})
                      terminator: <Op_Semi ';'>
                    )
                  ]
                  action: [
                    (Assignment
                      keyword: Assign_None
                      pairs: [
                        (assign_pair
                          lhs: (LhsName name:DESTFILE)
                          op: Equal
                          rhs: 
                            {
                              (DQ ($ VSub_Name '$DEST') (/) 
                                (CommandSubPart
                                  command_list: 
                                    (CommandList
                                      children: [(C {(basename)} {(DQ ($ VSub_Name '$SRC'))})]
                                    )
                                  left_token: <Left_CommandSub '$('>
                                  spids: [98 104]
                                )
                              )
                            }
                          spids: [94]
                        )
                      ]
                      spids: [94]
                    )
                  ]
                  spids: [16777215 91]
                )
              ]
              else_action: [
                (Assignment
                  keyword: Assign_None
                  pairs: [
                    (assign_pair
                      lhs: (LhsName name:DESTFILE)
                      op: Equal
                      rhs: {(DQ ($ VSub_Name '$DEST'))}
                      spids: [111]
                    )
                  ]
                  spids: [111]
                )
              ]
              spids: [108 117]
            )
            (SimpleCommand
              words: [{(chmod)} {($ VSub_Name '$PERMS')} {($ VSub_Name '$DESTFILE')}]
              redirects: [(Redir op_id:Redir_Great fd:2 arg_word:{(/dev/null)} spids:[135])]
            )
          ]
          spids: [65 138]
        )
      spids: [61 63]
    )
    (C {(exit)} {(0)})
  ]
)