(CommandList
  children: [
    (Assignment
      keyword: Assign_None
      pairs: [
        (assign_pair
          lhs: (LhsName name:wmfile)
          op: Equal
          rhs: {(DQ (/tmp/watermark.) ($ VSub_Dollar '$$') (.png))}
          spids: [10]
        )
      ]
      spids: [10]
    )
    (Assignment
      keyword: Assign_None
      pairs: [(assign_pair lhs:(LhsName name:fontsize) op:Equal rhs:{(DQ (44))} spids:[17])]
      spids: [17]
    )
    (C {(trap)} 
      {
        (DQ 
          (CommandSubPart
            command_list: (CommandList children:[(C {(which)} {(rm)})])
            left_token: <Left_Backtick '`'>
            spids: [29 33]
          ) (' -f ') ($ VSub_Name '$wmfile')
        )
      } {(0)} {(1)} {(15)}
    )
    (If
      arms: [
        (if_arm
          cond: [
            (Sentence
              child: (C {(Lit_Other '[')} {($ VSub_Pound '$#')} {(-ne)} {(2)} {(Lit_Other ']')})
              terminator: <Op_Semi ';'>
            )
          ]
          action: [
            (Sentence
              child: 
                (SimpleCommand
                  words: [
                    {(echo)}
                    {
                      (DQ ('Usage: ') 
                        (CommandSubPart
                          command_list: 
                            (CommandList
                              children: [(C {(basename)} {($ VSub_Number '$0')})]
                            )
                          left_token: <Left_CommandSub '$('>
                          spids: [69 73]
                        ) (' imagefile ')
                      ) (watermark)
                    }
                    {(text) (DQ )}
                  ]
                  redirects: [(Redir op_id:Redir_GreatAnd fd:-1 arg_word:{(2)} spids:[82])]
                )
              terminator: <Op_Semi ';'>
            )
            (C {(exit)} {(1)})
          ]
          spids: [-1 62]
        )
      ]
      spids: [-1 91]
    )
    (If
      arms: [
        (if_arm
          cond: [
            (Sentence
              child: 
                (C {(Lit_Other '[')} {(KW_Bang '!')} {(-r)} {(DQ ($ VSub_Number '$1'))} {(Lit_Other ']')})
              terminator: <Op_Semi ';'>
            )
          ]
          action: [
            (Sentence
              child: 
                (SimpleCommand
                  words: [
                    {(echo)}
                    {
                      (DQ 
                        (CommandSubPart
                          command_list: 
                            (CommandList
                              children: [(C {(basename)} {($ VSub_Number '$0')})]
                            )
                          left_token: <Left_CommandSub '$('>
                          spids: [116 120]
                        ) (": Can't read input image ") ($ VSub_Number '$1')
                      )
                    }
                  ]
                  redirects: [(Redir op_id:Redir_GreatAnd fd:-1 arg_word:{(2)} spids:[125])]
                )
              terminator: <Op_Semi ';'>
            )
            (C {(exit)} {(1)})
          ]
          spids: [-1 110]
        )
      ]
      spids: [-1 134]
    )
    (Assignment
      keyword: Assign_None
      pairs: [
        (assign_pair
          lhs: (LhsName name:dimensions)
          op: Equal
          rhs: 
            {
              (DQ 
                (CommandSubPart
                  command_list: 
                    (CommandList
                      children: [(C {(identify)} {(-format)} {(DQ ('%G'))} {(DQ ($ VSub_Number '$1'))})]
                    )
                  left_token: <Left_CommandSub '$('>
                  spids: [143 155]
                )
              )
            }
          spids: [141]
        )
      ]
      spids: [141]
    )
    (C {(convert)} {(-size)} {($ VSub_Name '$dimensions')} {(xc) (Lit_Other ':') (none)} {(-pointsize)} 
      {($ VSub_Name '$fontsize')} {(-gravity)} {(south)} {(-draw)} 
      {
        (DQ ("fill black text 1,1 '") ($ VSub_Number '$2') ("' text 0,0 '") ($ VSub_Number '$2') 
          ("' fill white text 2,2 '") ($ VSub_Number '$2') ("'")
        )
      } {($ VSub_Name '$wmfile')}
    )
    (Assignment
      keyword: Assign_None
      pairs: [
        (assign_pair
          lhs: (LhsName name:suffix)
          op: Equal
          rhs: 
            {
              (DQ 
                (CommandSubPart
                  command_list: 
                    (CommandList
                      children: [
                        (Pipeline
                          children: [
                            (C {(echo)} {($ VSub_Number '$1')})
                            (C {(rev)})
                            (C {(cut)} {(-d.)} {(-f1)})
                            (C {(rev)})
                          ]
                          negated: False
                        )
                      ]
                    )
                  left_token: <Left_CommandSub '$('>
                  spids: [210 230]
                )
              )
            }
          spids: [208]
        )
      ]
      spids: [208]
    )
    (Assignment
      keyword: Assign_None
      pairs: [
        (assign_pair
          lhs: (LhsName name:prefix)
          op: Equal
          rhs: 
            {
              (DQ 
                (CommandSubPart
                  command_list: 
                    (CommandList
                      children: [
                        (Pipeline
                          children: [
                            (C {(echo)} {($ VSub_Number '$1')})
                            (C {(rev)})
                            (C {(cut)} {(-d.)} {(-f2-)})
                            (C {(rev)})
                          ]
                          negated: False
                        )
                      ]
                    )
                  left_token: <Left_CommandSub '$('>
                  spids: [235 255]
                )
              )
            }
          spids: [233]
        )
      ]
      spids: [233]
    )
    (Assignment
      keyword: Assign_None
      pairs: [
        (assign_pair
          lhs: (LhsName name:newfilename)
          op: Equal
          rhs: {(DQ ($ VSub_Name '$prefix') ('+wm.') ($ VSub_Name '$suffix'))}
          spids: [259]
        )
      ]
      spids: [259]
    )
    (C {(composite)} {(-dissolve)} {(75) (Lit_Other '%')} {(-gravity)} {(south)} {($ VSub_Name '$wmfile')} 
      {(DQ ($ VSub_Number '$1'))} {(DQ ($ VSub_Name '$newfilename'))}
    )
    (C {(echo)} {(DQ ('Created new watermarked image file ') ($ VSub_Name '$newfilename'))})
    (C {(exit)} {(0)})
  ]
)