(command.CommandList
  children: [
    (command.ShAssignment
      pairs: [
        (assign_pair
          lhs: (sh_lhs_expr.Name name:convargs)
          op: assign_op.Equal
          rhs: {(DQ <'-unsharp 0x.5 -resize'>)}
          spids: [10]
        )
      ]
    )
    (command.CommandList
      children: [
        (command.Sentence
          child: 
            (command.ShAssignment
              pairs: [
                (assign_pair
                  lhs: (sh_lhs_expr.Name name:count)
                  op: assign_op.Equal
                  rhs: {<0>}
                  spids: [15]
                )
              ]
            )
          terminator: <Id.Op_Semi _>
        )
        (command.Sentence
          child: 
            (command.ShAssignment
              pairs: [
                (assign_pair
                  lhs: (sh_lhs_expr.Name name:exact)
                  op: assign_op.Equal
                  rhs: {(DQ )}
                  spids: [19]
                )
              ]
            )
          terminator: <Id.Op_Semi _>
        )
        (command.ShAssignment
          pairs: [
            (assign_pair
              lhs: (sh_lhs_expr.Name name:fit)
              op: assign_op.Equal
              rhs: {(DQ )}
              spids: [24]
            )
          ]
        )
      ]
    )
    (command.ShFunction
      name: usage
      body: 
        (BraceGroup
          children: [
            (command.Simple
              words: [
                {<echo>}
                {
                  (DQ <'Usage: '> 
                    (command_sub
                      left_token: <Id.Left_DollarParen '$('>
                      child: (C {<basename>} {($ Id.VSub_Number '$0')})
                    ) <' (-e|-f) thumbnail-size image [image] [image]'>
                  )
                }
              ]
              redirects: [(redir op:<Id.Redir_GreatAnd '>&'> loc:(redir_loc.Fd fd:1) arg:{<2>})]
              do_fork: T
            )
            (command.Simple
              words: [{<echo>} {(DQ <'-e  resize to exact dimensions, ignoring original proportions'>)}]
              redirects: [(redir op:<Id.Redir_GreatAnd '>&'> loc:(redir_loc.Fd fd:1) arg:{<2>})]
              do_fork: T
            )
            (command.Simple
              words: [{<echo>} {(DQ <'-f  fit image into specified dimensions, retaiing proportion'>)}]
              redirects: [(redir op:<Id.Redir_GreatAnd '>&'> loc:(redir_loc.Fd fd:1) arg:{<2>})]
              do_fork: T
            )
            (command.Simple
              words: [{<echo>} {(DQ <'-s  strip EXIF information (make ready for Web use)'>)}]
              redirects: [(redir op:<Id.Redir_GreatAnd '>&'> loc:(redir_loc.Fd fd:1) arg:{<2>})]
              do_fork: T
            )
            (C {<echo>} {(DQ <'    please use WIDTHxHEIGHT for requested size (e.g., 100x100)'>)})
            (command.ControlFlow token:<Id.ControlFlow_Exit exit> arg_word:{<1>})
          ]
        )
    )
    (command.If
      arms: [
        (if_arm
          cond: 
            (condition.Shell
              commands: [
                (command.Sentence
                  child: 
                    (C {<Id.Lit_LBracket '['>} {($ Id.VSub_Pound '$#')} {<-eq>} {<0>} 
                      {<Id.Lit_RBracket ']'>}
                    )
                  terminator: <Id.Op_Semi _>
                )
              ]
            )
          action: [(C {<usage>})]
          spids: [104 118]
        )
      ]
    )
    (command.WhileUntil
      keyword: <Id.KW_While while>
      cond: 
        (condition.Shell
          commands: [
            (command.Sentence
              child: (C {<getopts>} {(DQ <'e:f:s'>)} {<opt>})
              terminator: <Id.Op_Semi _>
            )
          ]
        )
      body: 
        (command.DoGroup
          children: [
            (command.Case
              to_match: {($ Id.VSub_DollarName '$opt')}
              arms: [
                (case_arm
                  pat_list: [{<e>}]
                  action: [
                    (command.Sentence
                      child: 
                        (command.ShAssignment
                          pairs: [
                            (assign_pair
                              lhs: (sh_lhs_expr.Name name:exact)
                              op: assign_op.Equal
                              rhs: {(DQ ($ Id.VSub_DollarName '$OPTARG'))}
                              spids: [151]
                            )
                          ]
                        )
                      terminator: <Id.Op_Semi _>
                    )
                  ]
                  spids: [147 149 157 -1]
                )
                (case_arm
                  pat_list: [{<f>}]
                  action: [
                    (command.Sentence
                      child: 
                        (command.ShAssignment
                          pairs: [
                            (assign_pair
                              lhs: (sh_lhs_expr.Name name:fit)
                              op: assign_op.Equal
                              rhs: {(DQ ($ Id.VSub_DollarName '$OPTARG'))}
                              spids: [164]
                            )
                          ]
                        )
                      terminator: <Id.Op_Semi _>
                    )
                  ]
                  spids: [160 162 170 -1]
                )
                (case_arm
                  pat_list: [{<s>}]
                  action: [
                    (command.Sentence
                      child: 
                        (command.ShAssignment
                          pairs: [
                            (assign_pair
                              lhs: (sh_lhs_expr.Name name:strip)
                              op: assign_op.Equal
                              rhs: {(DQ <-strip>)}
                              spids: [177]
                            )
                          ]
                        )
                      terminator: <Id.Op_Semi _>
                    )
                  ]
                  spids: [173 175 183 -1]
                )
                (case_arm
                  pat_list: [{<Id.Lit_QMark '?'>}]
                  action: [(command.Sentence child:(C {<usage>}) terminator:<Id.Op_Semi _>)]
                  spids: [186 188 193 -1]
                )
              ]
            )
          ]
        )
    )
    (C {<shift>} 
      {
        (word_part.ArithSub
          anode: 
            (arith_expr.Binary
              op_id: Id.Arith_Minus
              left: {($ Id.VSub_DollarName '$OPTIND')}
              right: {<Id.Lit_Digits 1>}
            )
        )
      }
    )
    (command.ShAssignment
      pairs: [
        (assign_pair
          lhs: (sh_lhs_expr.Name name:rwidth)
          op: assign_op.Equal
          rhs: 
            {
              (DQ 
                (command_sub
                  left_token: <Id.Left_DollarParen '$('>
                  child: 
                    (command.Pipeline
                      children: [
                        (C {<echo>} {($ Id.VSub_DollarName '$exact')} {($ Id.VSub_DollarName '$fit')})
                        (C {<cut>} {<-dx>} {<-f1>})
                      ]
                      negated: F
                    )
                )
              )
            }
          spids: [216]
        )
      ]
    )
    (command.ShAssignment
      pairs: [
        (assign_pair
          lhs: (sh_lhs_expr.Name name:rheight)
          op: assign_op.Equal
          rhs: 
            {
              (DQ 
                (command_sub
                  left_token: <Id.Left_DollarParen '$('>
                  child: 
                    (command.Pipeline
                      children: [
                        (C {<echo>} {($ Id.VSub_DollarName '$exact')} {($ Id.VSub_DollarName '$fit')})
                        (C {<cut>} {<-dx>} {<-f2>})
                      ]
                      negated: F
                    )
                )
              )
            }
          spids: [238]
        )
      ]
    )
    (command.ForEach
      iter_name: image
      do_arg_iter: T
      body: 
        (command.DoGroup
          children: [
            (command.ShAssignment
              pairs: [
                (assign_pair
                  lhs: (sh_lhs_expr.Name name:width)
                  op: assign_op.Equal
                  rhs: 
                    {
                      (DQ 
                        (command_sub
                          left_token: <Id.Left_DollarParen '$('>
                          child: 
                            (C {<identify>} {<-format>} {(DQ <'%w'>)} 
                              {(DQ ($ Id.VSub_DollarName '$image'))}
                            )
                        )
                      )
                    }
                  spids: [268]
                )
              ]
            )
            (command.ShAssignment
              pairs: [
                (assign_pair
                  lhs: (sh_lhs_expr.Name name:height)
                  op: assign_op.Equal
                  rhs: 
                    {
                      (DQ 
                        (command_sub
                          left_token: <Id.Left_DollarParen '$('>
                          child: 
                            (C {<identify>} {<-format>} {(DQ <'%h'>)} 
                              {(DQ ($ Id.VSub_DollarName '$image'))}
                            )
                        )
                      )
                    }
                  spids: [286]
                )
              ]
            )
            (command.If
              arms: [
                (if_arm
                  cond: 
                    (condition.Shell
                      commands: [
                        (command.Sentence
                          child: 
                            (C {<Id.Lit_LBracket '['>} {($ Id.VSub_DollarName '$width')} {<-le>} 
                              {($ Id.VSub_DollarName '$rwidth')} {<-a>} {($ Id.VSub_DollarName '$height')} {<-le>} {($ Id.VSub_DollarName '$rheight')} 
                              {<Id.Lit_RBracket ']'>}
                            )
                          terminator: <Id.Op_Semi _>
                        )
                      ]
                    )
                  action: [
                    (C {<echo>} 
                      {
                        (DQ <'Image '> ($ Id.VSub_DollarName '$image') 
                          <' is already smaller than reqeusted dimensions. Skipped.'>
                        )
                      }
                    )
                  ]
                  spids: [309 331]
                )
              ]
              else_action: [
                (command.ShAssignment
                  pairs: [
                    (assign_pair
                      lhs: (sh_lhs_expr.Name name:suffix)
                      op: assign_op.Equal
                      rhs: 
                        {
                          (DQ 
                            (command_sub
                              left_token: <Id.Left_DollarParen '$('>
                              child: 
                                (command.Pipeline
                                  children: [
                                    (C {<echo>} {($ Id.VSub_DollarName '$image')})
                                    (C {<rev>})
                                    (C {<cut>} {<-d.>} {<-f1>})
                                    (C {<rev>})
                                  ]
                                  negated: F
                                )
                            )
                          )
                        }
                      spids: [351]
                    )
                  ]
                )
                (command.ShAssignment
                  pairs: [
                    (assign_pair
                      lhs: (sh_lhs_expr.Name name:prefix)
                      op: assign_op.Equal
                      rhs: 
                        {
                          (DQ 
                            (command_sub
                              left_token: <Id.Left_DollarParen '$('>
                              child: 
                                (command.Pipeline
                                  children: [
                                    (C {<echo>} {($ Id.VSub_DollarName '$image')})
                                    (C {<rev>})
                                    (C {<cut>} {<-d.>} {<-f2->})
                                    (C {<rev>})
                                  ]
                                  negated: F
                                )
                            )
                          )
                        }
                      spids: [377]
                    )
                  ]
                )
                (command.ShAssignment
                  pairs: [
                    (assign_pair
                      lhs: (sh_lhs_expr.Name name:newname)
                      op: assign_op.Equal
                      rhs: 
                        {
                          (DQ ($ Id.VSub_DollarName '$prefix') <-thumb.> 
                            ($ Id.VSub_DollarName '$suffix')
                          )
                        }
                      spids: [403]
                    )
                  ]
                )
                (command.If
                  arms: [
                    (if_arm
                      cond: 
                        (condition.Shell
                          commands: [
                            (command.Sentence
                              child: 
                                (C {<Id.Lit_LBracket '['>} {<-z>} {(DQ ($ Id.VSub_DollarName '$fit'))} 
                                  {<Id.Lit_RBracket ']'>}
                                )
                              terminator: <Id.Op_Semi _>
                            )
                          ]
                        )
                      action: [
                        (command.ShAssignment
                          pairs: [
                            (assign_pair
                              lhs: (sh_lhs_expr.Name name:size)
                              op: assign_op.Equal
                              rhs: {(DQ ($ Id.VSub_DollarName '$exact') <'!'>)}
                              spids: [435]
                            )
                          ]
                        )
                        (C {<echo>} 
                          {
                            (DQ <'Creating '> (${ Id.VSub_Name rwidth) <x> (${ Id.VSub_Name rheight) 
                              <' (exact size) thumbnail for file '> ($ Id.VSub_DollarName '$image')
                            )
                          }
                        )
                      ]
                      spids: [418 432]
                    )
                  ]
                  else_action: [
                    (command.ShAssignment
                      pairs: [
                        (assign_pair
                          lhs: (sh_lhs_expr.Name name:size)
                          op: assign_op.Equal
                          rhs: {(DQ ($ Id.VSub_DollarName '$fit'))}
                          spids: [461]
                        )
                      ]
                    )
                    (C {<echo>} 
                      {
                        (DQ <'Creating '> (${ Id.VSub_Name rwidth) <x> (${ Id.VSub_Name rheight) 
                          <' (max dimensions) thumbnail for file '> ($ Id.VSub_DollarName '$image')
                        )
                      }
                    )
                  ]
                )
                (C {<convert>} {(DQ ($ Id.VSub_DollarName '$image'))} {($ Id.VSub_DollarName '$strip')} 
                  {($ Id.VSub_DollarName '$convargs')} {(DQ ($ Id.VSub_DollarName '$size'))} {(DQ ($ Id.VSub_DollarName '$newname'))}
                )
              ]
            )
            (command.ShAssignment
              pairs: [
                (assign_pair
                  lhs: (sh_lhs_expr.Name name:count)
                  op: assign_op.Equal
                  rhs: 
                    {
                      (word_part.ArithSub
                        anode: 
                          (arith_expr.Binary
                            op_id: Id.Arith_Plus
                            left: {($ Id.VSub_DollarName '$count')}
                            right: {<Id.Lit_Digits 1>}
                          )
                      )
                    }
                  spids: [509]
                )
              ]
            )
          ]
        )
    )
    (command.If
      arms: [
        (if_arm
          cond: 
            (condition.Shell
              commands: [
                (command.Sentence
                  child: 
                    (C {<Id.Lit_LBracket '['>} {($ Id.VSub_DollarName '$count')} {<-eq>} {<0>} 
                      {<Id.Lit_RBracket ']'>}
                    )
                  terminator: <Id.Op_Semi _>
                )
              ]
            )
          action: [(C {<echo>} {(DQ <'Warning: no images found to process.'>)})]
          spids: [524 538]
        )
      ]
    )
    (command.ControlFlow token:<Id.ControlFlow_Exit exit> arg_word:{<0>})
  ]
)