(command.CommandList
  children: [
    (command.ShAssignment
      pairs: [
        (assign_pair
          lhs: (sh_lhs_expr.Name name:min_slab_name_size)
          op: assign_op.Equal
          rhs: {<11>}
          spids: [82]
        )
      ]
    )
    (command.ShAssignment
      pairs: [(assign_pair lhs:(sh_lhs_expr.Name name:xmin) op:assign_op.Equal rhs:{<0>} spids:[85])]
    )
    (command.ShAssignment
      pairs: [(assign_pair lhs:(sh_lhs_expr.Name name:xmax) op:assign_op.Equal rhs:{<0>} spids:[88])]
    )
    (command.ShAssignment
      pairs: [
        (assign_pair
          lhs: (sh_lhs_expr.Name name:width)
          op: assign_op.Equal
          rhs: {<1500>}
          spids: [91]
        )
      ]
    )
    (command.ShAssignment
      pairs: [
        (assign_pair
          lhs: (sh_lhs_expr.Name name:height)
          op: assign_op.Equal
          rhs: {<700>}
          spids: [94]
        )
      ]
    )
    (command.ShAssignment
      pairs: [
        (assign_pair
          lhs: (sh_lhs_expr.Name name:mode)
          op: assign_op.Equal
          rhs: {<preprocess>}
          spids: [97]
        )
      ]
    )
    (command.ShFunction
      name: usage
      body: 
        (BraceGroup
          children: [
            (C {<echo>} {(DQ <'Usage: [-s W,H] [-r MIN,MAX] [-t|-l] FILE1 [FILE2 ..]'>)})
            (C {<echo>} {(DQ <'FILEs must contain \'slabinfo -X\' samples'>)})
            (C {<echo>} {(DQ <'-t \t\t\t- plot totals for FILE(s)'>)})
            (C {<echo>} {(DQ <'-l \t\t\t- plot slabs stats for FILE(s)'>)})
            (C {<echo>} {(DQ <'-s %d,%d\t\t- set image width and height'>)})
            (C {<echo>} {(DQ <'-r %d,%d\t\t- use data samples from a given range'>)})
          ]
        )
    )
    (command.ShFunction
      name: check_file_exist
      body: 
        (BraceGroup
          children: [
            (command.If
              arms: [
                (if_arm
                  cond: 
                    (condition.Shell
                      commands: [
                        (command.Sentence
                          child: 
                            (C {<Id.Lit_LBracket '['>} {<Id.KW_Bang '!'>} {<-f>} 
                              {(DQ ($ Id.VSub_Number '$1'))} {<Id.Lit_RBracket ']'>}
                            )
                          terminator: <Id.Op_Semi _>
                        )
                      ]
                    )
                  action: [
                    (C {<echo>} {(DQ <'File \''> ($ Id.VSub_Number '$1') <'\' does not exist'>)})
                    (command.ControlFlow
                      token: <Id.ControlFlow_Exit exit>
                      arg_word: {<1>}
                    )
                  ]
                  spids: [159 174]
                )
              ]
            )
          ]
        )
    )
    (command.ShFunction
      name: do_slabs_plotting
      body: 
        (BraceGroup
          children: [
            (C {<local>} {<Id.Lit_VarLike 'file='> ($ Id.VSub_Number '$1')})
            (C {<local>} {<out_file>})
            (C {<local>} {<Id.Lit_VarLike 'range='> (DQ <'every ::'> ($ Id.VSub_DollarName '$xmin'))})
            (C {<local>} {<Id.Lit_VarLike 'xtic='> (DQ )})
            (C {<local>} {<Id.Lit_VarLike 'xtic_rotate='> (DQ <norotate>)})
            (C {<local>} {<Id.Lit_VarLike 'lines='> <2000000>})
            (C {<local>} {<wc_lines>})
            (C {<check_file_exist>} {(DQ ($ Id.VSub_DollarName '$file'))})
            (command.ShAssignment
              pairs: [
                (assign_pair
                  lhs: (sh_lhs_expr.Name name:out_file)
                  op: assign_op.Equal
                  rhs: 
                    {
                      (command_sub
                        left_token: <Id.Left_Backtick '`'>
                        child: (C {<basename>} {(DQ ($ Id.VSub_DollarName '$file'))})
                      )
                    }
                  spids: [258]
                )
              ]
            )
            (command.If
              arms: [
                (if_arm
                  cond: 
                    (condition.Shell
                      commands: [
                        (command.Sentence
                          child: 
                            (C {<Id.Lit_LBracket '['>} {($ Id.VSub_DollarName '$xmax')} {<-ne>} {<0>} 
                              {<Id.Lit_RBracket ']'>}
                            )
                          terminator: <Id.Op_Semi _>
                        )
                      ]
                    )
                  action: [
                    (command.ShAssignment
                      pairs: [
                        (assign_pair
                          lhs: (sh_lhs_expr.Name name:range)
                          op: assign_op.Equal
                          rhs: 
                            {
                              (DQ ($ Id.VSub_DollarName '$range') <'::'> ($ Id.VSub_DollarName '$xmax'))
                            }
                          spids: [286]
                        )
                      ]
                    )
                    (command.ShAssignment
                      pairs: [
                        (assign_pair
                          lhs: (sh_lhs_expr.Name name:lines)
                          op: assign_op.Equal
                          rhs: 
                            {
                              (word_part.ArithSub
                                anode: 
                                  (arith_expr.Binary
                                    op_id: Id.Arith_Minus
                                    left: <Id.Lit_ArithVarLike xmax>
                                    right: <Id.Lit_ArithVarLike xmin>
                                  )
                              )
                            }
                          spids: [294]
                        )
                      ]
                    )
                  ]
                  spids: [270 283]
                )
              ]
            )
            (command.ShAssignment
              pairs: [
                (assign_pair
                  lhs: (sh_lhs_expr.Name name:wc_lines)
                  op: assign_op.Equal
                  rhs: 
                    {
                      (command_sub
                        left_token: <Id.Left_Backtick '`'>
                        child: 
                          (command.Pipeline
                            children: [
                              (C {<cat>} {(DQ ($ Id.VSub_DollarName '$file'))})
                              (C {<wc>} {<-l>})
                            ]
                            negated: F
                          )
                      )
                    }
                  spids: [307]
                )
              ]
            )
            (command.If
              arms: [
                (if_arm
                  cond: 
                    (condition.Shell
                      commands: [
                        (command.Sentence
                          child: 
                            (command.AndOr
                              ops: [Id.Op_DPipe]
                              children: [
                                (C {<Id.Lit_LBracket '['>} {($ Id.VSub_QMark '$?')} {<-ne>} {<0>} 
                                  {<Id.Lit_RBracket ']'>}
                                )
                                (C {<Id.Lit_LBracket '['>} {(DQ ($ Id.VSub_DollarName '$wc_lines'))} 
                                  {<-eq>} {<0>} {<Id.Lit_RBracket ']'>}
                                )
                              ]
                            )
                          terminator: <Id.Op_Semi _>
                        )
                      ]
                    )
                  action: [
                    (command.ShAssignment
                      pairs: [
                        (assign_pair
                          lhs: (sh_lhs_expr.Name name:wc_lines)
                          op: assign_op.Equal
                          rhs: {($ Id.VSub_DollarName '$lines')}
                          spids: [356]
                        )
                      ]
                    )
                  ]
                  spids: [325 353]
                )
              ]
            )
            (command.If
              arms: [
                (if_arm
                  cond: 
                    (condition.Shell
                      commands: [
                        (command.Sentence
                          child: 
                            (C {<Id.Lit_LBracket '['>} {(DQ ($ Id.VSub_DollarName '$wc_lines'))} {<-lt>} 
                              {(DQ ($ Id.VSub_DollarName '$lines'))} {<Id.Lit_RBracket ']'>}
                            )
                          terminator: <Id.Op_Semi _>
                        )
                      ]
                    )
                  action: [
                    (command.ShAssignment
                      pairs: [
                        (assign_pair
                          lhs: (sh_lhs_expr.Name name:lines)
                          op: assign_op.Equal
                          rhs: {($ Id.VSub_DollarName '$wc_lines')}
                          spids: [384]
                        )
                      ]
                    )
                  ]
                  spids: [364 381]
                )
              ]
            )
            (command.If
              arms: [
                (if_arm
                  cond: 
                    (condition.Shell
                      commands: [
                        (command.Sentence
                          child: 
                            (C {<Id.Lit_LBracket '['>} 
                              {
                                (word_part.ArithSub
                                  anode: 
                                    (arith_expr.Binary
                                      op_id: Id.Arith_Slash
                                      left: <Id.Lit_ArithVarLike width>
                                      right: <Id.Lit_ArithVarLike lines>
                                    )
                                )
                              } {<-gt>} {($ Id.VSub_DollarName '$min_slab_name_size')} {<Id.Lit_RBracket ']'>}
                            )
                          terminator: <Id.Op_Semi _>
                        )
                      ]
                    )
                  action: [
                    (command.ShAssignment
                      pairs: [
                        (assign_pair
                          lhs: (sh_lhs_expr.Name name:xtic)
                          op: assign_op.Equal
                          rhs: {(DQ <':xtic(1)'>)}
                          spids: [415]
                        )
                      ]
                    )
                    (command.ShAssignment
                      pairs: [
                        (assign_pair
                          lhs: (sh_lhs_expr.Name name:xtic_rotate)
                          op: assign_op.Equal
                          rhs: {<90>}
                          spids: [421]
                        )
                      ]
                    )
                  ]
                  spids: [392 412]
                )
              ]
            )
            (command.Simple
              words: [{<gnuplot>} {<-p>}]
              redirects: [
                (redir
                  op: <Id.Redir_DLess '<<'>
                  loc: (redir_loc.Fd fd:0)
                  arg: 
                    (redir_param.HereDoc
                      here_begin: {<EOF>}
                      here_end_span_id: 470
                      stdin_parts: [
                        <'#!/usr/bin/env gnuplot\n'>
                        <'\n'>
                        <'set terminal png enhanced size '>
                        ($ Id.VSub_DollarName '$width')
                        <','>
                        ($ Id.VSub_DollarName '$height')
                        <' large\n'>
                        <'set output \''>
                        ($ Id.VSub_DollarName '$out_file')
                        <'.png\'\n'>
                        <'set autoscale xy\n'>
                        <'set xlabel \'samples\'\n'>
                        <'set ylabel \'bytes\'\n'>
                        <'set style histogram columnstacked title textcolor lt -1\n'>
                        <'set style fill solid 0.15\n'>
                        <'set xtics rotate '>
                        ($ Id.VSub_DollarName '$xtic_rotate')
                        <'\n'>
                        <'set key left above Left title reverse\n'>
                        <'\n'>
                        <'plot '>
                        <Id.Right_DoubleQuote '"'>
                        ($ Id.VSub_DollarName '$file')
                        <Id.Right_DoubleQuote '"'>
                        <' '>
                        ($ Id.VSub_DollarName '$range')
                        <' u 2'>
                        ($ Id.VSub_DollarName '$xtic')
                        <' title \'SIZE\' with boxes,'>
                        <'\t\'\' '>
                        ($ Id.VSub_DollarName '$range')
                        <' u 3 title \'LOSS\' with boxes\n'>
                      ]
                    )
                )
              ]
              do_fork: T
            )
            (command.If
              arms: [
                (if_arm
                  cond: 
                    (condition.Shell
                      commands: [
                        (command.Sentence
                          child: 
                            (C {<Id.Lit_LBracket '['>} {($ Id.VSub_QMark '$?')} {<-eq>} {<0>} 
                              {<Id.Lit_RBracket ']'>}
                            )
                          terminator: <Id.Op_Semi _>
                        )
                      ]
                    )
                  action: [(C {<echo>} {(DQ ($ Id.VSub_DollarName '$out_file') <.png>)})]
                  spids: [473 486]
                )
              ]
            )
          ]
        )
    )
    (command.ShFunction
      name: do_totals_plotting
      body: 
        (BraceGroup
          children: [
            (C {<local>} {<Id.Lit_VarLike 'gnuplot_cmd='> (DQ )})
            (C {<local>} {<Id.Lit_VarLike 'range='> (DQ <'every ::'> ($ Id.VSub_DollarName '$xmin'))})
            (C {<local>} {<Id.Lit_VarLike 'file='> (DQ )})
            (command.If
              arms: [
                (if_arm
                  cond: 
                    (condition.Shell
                      commands: [
                        (command.Sentence
                          child: 
                            (C {<Id.Lit_LBracket '['>} {($ Id.VSub_DollarName '$xmax')} {<-ne>} {<0>} 
                              {<Id.Lit_RBracket ']'>}
                            )
                          terminator: <Id.Op_Semi _>
                        )
                      ]
                    )
                  action: [
                    (command.ShAssignment
                      pairs: [
                        (assign_pair
                          lhs: (sh_lhs_expr.Name name:range)
                          op: assign_op.Equal
                          rhs: 
                            {
                              (DQ ($ Id.VSub_DollarName '$range') <'::'> ($ Id.VSub_DollarName '$xmax'))
                            }
                          spids: [549]
                        )
                      ]
                    )
                  ]
                  spids: [533 546]
                )
              ]
            )
            (command.ForEach
              iter_name: i
              iter_words: [
                {
                  (DQ 
                    (braced_var_sub
                      token: <Id.VSub_Name t_files>
                      bracket_op: (bracket_op.WholeArray op_id:Id.Lit_At)
                    )
                  )
                }
              ]
              do_arg_iter: F
              body: 
                (command.DoGroup
                  children: [
                    (C {<check_file_exist>} {(DQ ($ Id.VSub_DollarName '$i'))})
                    (command.ShAssignment
                      pairs: [
                        (assign_pair
                          lhs: (sh_lhs_expr.Name name:file)
                          op: assign_op.Equal
                          rhs: 
                            {(DQ ($ Id.VSub_DollarName '$file')) 
                              (command_sub
                                left_token: <Id.Left_Backtick '`'>
                                child: (C {<basename>} {(DQ ($ Id.VSub_DollarName '$i'))})
                              )
                            }
                          spids: [588]
                        )
                      ]
                    )
                    (command.ShAssignment
                      pairs: [
                        (assign_pair
                          lhs: (sh_lhs_expr.Name name:gnuplot_cmd)
                          op: assign_op.Equal
                          rhs: 
                            {
                              (DQ ($ Id.VSub_DollarName '$gnuplot_cmd') <' \''> 
                                ($ Id.VSub_DollarName '$i') <'\' '> ($ Id.VSub_DollarName '$range') <' using 1 title'> <'\t\t\t\''> ($ Id.VSub_DollarName '$i') 
                                <' Memory usage\' with lines,'>
                              )
                            }
                          spids: [603]
                        )
                      ]
                    )
                    (command.ShAssignment
                      pairs: [
                        (assign_pair
                          lhs: (sh_lhs_expr.Name name:gnuplot_cmd)
                          op: assign_op.Equal
                          rhs: 
                            {
                              (DQ ($ Id.VSub_DollarName '$gnuplot_cmd') <' \'\' '> 
                                ($ Id.VSub_DollarName '$range') <' using 2 title '> <'\t\t\t\''> ($ Id.VSub_DollarName '$i') <' Loss\' with lines,'>
                              )
                            }
                          spids: [618]
                        )
                      ]
                    )
                  ]
                )
            )
            (command.Simple
              words: [{<gnuplot>} {<-p>}]
              redirects: [
                (redir
                  op: <Id.Redir_DLess '<<'>
                  loc: (redir_loc.Fd fd:0)
                  arg: 
                    (redir_param.HereDoc
                      here_begin: {<EOF>}
                      here_end_span_id: 661
                      stdin_parts: [
                        <'#!/usr/bin/env gnuplot\n'>
                        <'\n'>
                        <'set terminal png enhanced size '>
                        ($ Id.VSub_DollarName '$width')
                        <','>
                        ($ Id.VSub_DollarName '$height')
                        <' large\n'>
                        <'set autoscale xy\n'>
                        <'set output \''>
                        ($ Id.VSub_DollarName '$file')
                        <'.png\'\n'>
                        <'set xlabel \'samples\'\n'>
                        <'set ylabel \'bytes\'\n'>
                        <'set key left above Left title reverse\n'>
                        <'\n'>
                        <'plot '>
                        ($ Id.VSub_DollarName '$gnuplot_cmd')
                        <'\n'>
                      ]
                    )
                )
              ]
              do_fork: T
            )
            (command.If
              arms: [
                (if_arm
                  cond: 
                    (condition.Shell
                      commands: [
                        (command.Sentence
                          child: 
                            (C {<Id.Lit_LBracket '['>} {($ Id.VSub_QMark '$?')} {<-eq>} {<0>} 
                              {<Id.Lit_RBracket ']'>}
                            )
                          terminator: <Id.Op_Semi _>
                        )
                      ]
                    )
                  action: [(C {<echo>} {(DQ ($ Id.VSub_DollarName '$file') <.png>)})]
                  spids: [664 677]
                )
              ]
            )
          ]
        )
    )
    (command.ShFunction
      name: do_preprocess
      body: 
        (BraceGroup
          children: [
            (C {<local>} {<out>})
            (C {<local>} {<lines>})
            (C {<local>} {<Id.Lit_VarLike 'in='> ($ Id.VSub_Number '$1')})
            (C {<check_file_exist>} {(DQ ($ Id.VSub_DollarName '$in'))})
            (C {<let>} {<Id.Lit_VarLike 'lines='> <3>})
            (command.ShAssignment
              pairs: [
                (assign_pair
                  lhs: (sh_lhs_expr.Name name:out)
                  op: assign_op.Equal
                  rhs: 
                    {
                      (command_sub
                        left_token: <Id.Left_Backtick '`'>
                        child: (C {<basename>} {(DQ ($ Id.VSub_DollarName '$in'))})
                      ) (DQ <-slabs-by-loss>)
                    }
                  spids: [735]
                )
              ]
            )
            (C 
              {
                (command_sub
                  left_token: <Id.Left_Backtick '`'>
                  child: 
                    (command.Pipeline
                      children: [
                        (C {<cat>} {(DQ ($ Id.VSub_DollarName '$in'))})
                        (C {<grep>} {<-A>} {(DQ ($ Id.VSub_DollarName '$lines'))} 
                          {(SQ <'Slabs sorted by loss'>)}
                        )
                        (C {<egrep>} {<-iv>} {(SQ <'\\-\\-|Name|Slabs'>)})
                        (command.Simple
                          words: [{<awk>} {(SQ <'{print $1" "$4+$2*$3" "$4}'>)}]
                          redirects: [
                            (redir
                              op: <Id.Redir_Great '>'>
                              loc: (redir_loc.Fd fd:1)
                              arg: {(DQ ($ Id.VSub_DollarName '$out'))}
                            )
                          ]
                          do_fork: T
                        )
                      ]
                      negated: F
                    )
                )
              }
            )
            (command.If
              arms: [
                (if_arm
                  cond: 
                    (condition.Shell
                      commands: [
                        (command.Sentence
                          child: 
                            (C {<Id.Lit_LBracket '['>} {($ Id.VSub_QMark '$?')} {<-eq>} {<0>} 
                              {<Id.Lit_RBracket ']'>}
                            )
                          terminator: <Id.Op_Semi _>
                        )
                      ]
                    )
                  action: [(C {<do_slabs_plotting>} {(DQ ($ Id.VSub_DollarName '$out'))})]
                  spids: [811 824]
                )
              ]
            )
            (C {<let>} {<Id.Lit_VarLike 'lines='> <3>})
            (command.ShAssignment
              pairs: [
                (assign_pair
                  lhs: (sh_lhs_expr.Name name:out)
                  op: assign_op.Equal
                  rhs: 
                    {
                      (command_sub
                        left_token: <Id.Left_Backtick '`'>
                        child: (C {<basename>} {(DQ ($ Id.VSub_DollarName '$in'))})
                      ) (DQ <-slabs-by-size>)
                    }
                  spids: [844]
                )
              ]
            )
            (C 
              {
                (command_sub
                  left_token: <Id.Left_Backtick '`'>
                  child: 
                    (command.Pipeline
                      children: [
                        (C {<cat>} {(DQ ($ Id.VSub_DollarName '$in'))})
                        (C {<grep>} {<-A>} {(DQ ($ Id.VSub_DollarName '$lines'))} 
                          {(SQ <'Slabs sorted by size'>)}
                        )
                        (C {<egrep>} {<-iv>} {(SQ <'\\-\\-|Name|Slabs'>)})
                        (command.Simple
                          words: [{<awk>} {(SQ <'{print $1" "$4" "$4-$2*$3}'>)}]
                          redirects: [
                            (redir
                              op: <Id.Redir_Great '>'>
                              loc: (redir_loc.Fd fd:1)
                              arg: {(DQ ($ Id.VSub_DollarName '$out'))}
                            )
                          ]
                          do_fork: T
                        )
                      ]
                      negated: F
                    )
                )
              }
            )
            (command.If
              arms: [
                (if_arm
                  cond: 
                    (condition.Shell
                      commands: [
                        (command.Sentence
                          child: 
                            (C {<Id.Lit_LBracket '['>} {($ Id.VSub_QMark '$?')} {<-eq>} {<0>} 
                              {<Id.Lit_RBracket ']'>}
                            )
                          terminator: <Id.Op_Semi _>
                        )
                      ]
                    )
                  action: [(C {<do_slabs_plotting>} {(DQ ($ Id.VSub_DollarName '$out'))})]
                  spids: [920 933]
                )
              ]
            )
            (command.ShAssignment
              pairs: [
                (assign_pair
                  lhs: (sh_lhs_expr.Name name:out)
                  op: assign_op.Equal
                  rhs: 
                    {
                      (command_sub
                        left_token: <Id.Left_Backtick '`'>
                        child: (C {<basename>} {(DQ ($ Id.VSub_DollarName '$in'))})
                      ) (DQ <-totals>)
                    }
                  spids: [947]
                )
              ]
            )
            (C 
              {
                (command_sub
                  left_token: <Id.Left_Backtick '`'>
                  child: 
                    (command.Pipeline
                      children: [
                        (C {<cat>} {(DQ ($ Id.VSub_DollarName '$in'))})
                        (C {<grep>} {(DQ <'Memory used'>)})
                        (command.Simple
                          words: [{<awk>} {(SQ <'{print $3" "$7}'>)}]
                          redirects: [
                            (redir
                              op: <Id.Redir_Great '>'>
                              loc: (redir_loc.Fd fd:1)
                              arg: {(DQ ($ Id.VSub_DollarName '$out'))}
                            )
                          ]
                          do_fork: T
                        )
                      ]
                      negated: F
                    )
                )
              }
            )
            (command.If
              arms: [
                (if_arm
                  cond: 
                    (condition.Shell
                      commands: [
                        (command.Sentence
                          child: 
                            (C {<Id.Lit_LBracket '['>} {($ Id.VSub_QMark '$?')} {<-eq>} {<0>} 
                              {<Id.Lit_RBracket ']'>}
                            )
                          terminator: <Id.Op_Semi _>
                        )
                      ]
                    )
                  action: [
                    (command.ShAssignment
                      pairs: [
                        (assign_pair
                          lhs: (sh_lhs_expr.IndexedName name:t_files index:{<Id.Lit_Digits 0>})
                          op: assign_op.Equal
                          rhs: {($ Id.VSub_DollarName '$out')}
                          spids: [1015]
                        )
                      ]
                    )
                    (C {<do_totals_plotting>})
                  ]
                  spids: [999 1012]
                )
              ]
            )
          ]
        )
    )
    (command.ShFunction
      name: parse_opts
      body: 
        (BraceGroup
          children: [
            (C {<local>} {<opt>})
            (command.WhileUntil
              keyword: <Id.KW_While while>
              cond: 
                (condition.Shell
                  commands: [
                    (command.Sentence
                      child: (C {<getopts>} {(DQ <'tlr::s::h'>)} {<opt>})
                      terminator: <Id.Op_Semi _>
                    )
                  ]
                )
              body: 
                (command.DoGroup
                  children: [
                    (command.Case
                      to_match: {($ Id.VSub_DollarName '$opt')}
                      arms: [
                        (case_arm
                          pat_list: [{<t>}]
                          action: [
                            (command.ShAssignment
                              pairs: [
                                (assign_pair
                                  lhs: (sh_lhs_expr.Name name:mode)
                                  op: assign_op.Equal
                                  rhs: {<totals>}
                                  spids: [1069]
                                )
                              ]
                            )
                          ]
                          spids: [1065 1066 1073 -1]
                        )
                        (case_arm
                          pat_list: [{<l>}]
                          action: [
                            (command.ShAssignment
                              pairs: [
                                (assign_pair
                                  lhs: (sh_lhs_expr.Name name:mode)
                                  op: assign_op.Equal
                                  rhs: {<slabs>}
                                  spids: [1080]
                                )
                              ]
                            )
                          ]
                          spids: [1076 1077 1084 -1]
                        )
                        (case_arm
                          pat_list: [{<s>}]
                          action: [
                            (command.ShAssignment
                              pairs: [
                                (assign_pair
                                  lhs: (sh_lhs_expr.Name name:array)
                                  op: assign_op.Equal
                                  rhs: 
                                    {
                                      (sh_array_literal
                                        left: <Id.Op_LParen _>
                                        words: [
                                          {
                                            (braced_var_sub
                                              token: <Id.VSub_Name OPTARG>
                                              suffix_op: 
                                                (suffix_op.PatSub
                                                  pat: {<','>}
                                                  replace: {<' '>}
                                                  replace_mode: Id.Lit_Slash
                                                )
                                            )
                                          }
                                        ]
                                      )
                                    }
                                  spids: [1091]
                                )
                              ]
                            )
                            (command.ShAssignment
                              pairs: [
                                (assign_pair
                                  lhs: (sh_lhs_expr.Name name:width)
                                  op: assign_op.Equal
                                  rhs: 
                                    {
                                      (braced_var_sub
                                        token: <Id.VSub_Name array>
                                        bracket_op: (bracket_op.ArrayIndex expr:{<Id.Lit_Digits 0>})
                                      )
                                    }
                                  spids: [1104]
                                )
                              ]
                            )
                            (command.ShAssignment
                              pairs: [
                                (assign_pair
                                  lhs: (sh_lhs_expr.Name name:height)
                                  op: assign_op.Equal
                                  rhs: 
                                    {
                                      (braced_var_sub
                                        token: <Id.VSub_Name array>
                                        bracket_op: (bracket_op.ArrayIndex expr:{<Id.Lit_Digits 1>})
                                      )
                                    }
                                  spids: [1113]
                                )
                              ]
                            )
                          ]
                          spids: [1087 1088 1122 -1]
                        )
                        (case_arm
                          pat_list: [{<r>}]
                          action: [
                            (command.ShAssignment
                              pairs: [
                                (assign_pair
                                  lhs: (sh_lhs_expr.Name name:array)
                                  op: assign_op.Equal
                                  rhs: 
                                    {
                                      (sh_array_literal
                                        left: <Id.Op_LParen _>
                                        words: [
                                          {
                                            (braced_var_sub
                                              token: <Id.VSub_Name OPTARG>
                                              suffix_op: 
                                                (suffix_op.PatSub
                                                  pat: {<','>}
                                                  replace: {<' '>}
                                                  replace_mode: Id.Lit_Slash
                                                )
                                            )
                                          }
                                        ]
                                      )
                                    }
                                  spids: [1129]
                                )
                              ]
                            )
                            (command.ShAssignment
                              pairs: [
                                (assign_pair
                                  lhs: (sh_lhs_expr.Name name:xmin)
                                  op: assign_op.Equal
                                  rhs: 
                                    {
                                      (braced_var_sub
                                        token: <Id.VSub_Name array>
                                        bracket_op: (bracket_op.ArrayIndex expr:{<Id.Lit_Digits 0>})
                                      )
                                    }
                                  spids: [1142]
                                )
                              ]
                            )
                            (command.ShAssignment
                              pairs: [
                                (assign_pair
                                  lhs: (sh_lhs_expr.Name name:xmax)
                                  op: assign_op.Equal
                                  rhs: 
                                    {
                                      (braced_var_sub
                                        token: <Id.VSub_Name array>
                                        bracket_op: (bracket_op.ArrayIndex expr:{<Id.Lit_Digits 1>})
                                      )
                                    }
                                  spids: [1151]
                                )
                              ]
                            )
                          ]
                          spids: [1125 1126 1160 -1]
                        )
                        (case_arm
                          pat_list: [{<h>}]
                          action: [
                            (C {<usage>})
                            (command.ControlFlow
                              token: <Id.ControlFlow_Exit exit>
                              arg_word: {<0>}
                            )
                          ]
                          spids: [1163 1164 1175 -1]
                        )
                        (case_arm
                          pat_list: [{(word_part.EscapedLiteral token:<Id.Lit_EscapedChar '\\?'>)}]
                          action: [
                            (command.Simple
                              words: [
                                {<echo>}
                                {(DQ <'Invalid option: -'> ($ Id.VSub_DollarName '$OPTARG'))}
                              ]
                              redirects: [
                                (redir
                                  op: <Id.Redir_GreatAnd '>&'>
                                  loc: (redir_loc.Fd fd:1)
                                  arg: {<2>}
                                )
                              ]
                              do_fork: T
                            )
                            (command.ControlFlow
                              token: <Id.ControlFlow_Exit exit>
                              arg_word: {<1>}
                            )
                          ]
                          spids: [1178 1179 1198 -1]
                        )
                        (case_arm
                          pat_list: [{<Id.Lit_Colon ':'>}]
                          action: [
                            (command.Simple
                              words: [
                                {<echo>}
                                {(DQ <-> ($ Id.VSub_DollarName '$OPTARG') <' requires an argument.'>)}
                              ]
                              redirects: [
                                (redir
                                  op: <Id.Redir_GreatAnd '>&'>
                                  loc: (redir_loc.Fd fd:1)
                                  arg: {<2>}
                                )
                              ]
                              do_fork: T
                            )
                            (command.ControlFlow
                              token: <Id.ControlFlow_Exit exit>
                              arg_word: {<1>}
                            )
                          ]
                          spids: [1201 1202 1222 -1]
                        )
                      ]
                    )
                  ]
                )
            )
            (command.ControlFlow
              token: <Id.ControlFlow_Return return>
              arg_word: {($ Id.VSub_DollarName '$OPTIND')}
            )
          ]
        )
    )
    (command.ShFunction
      name: parse_args
      body: 
        (BraceGroup
          children: [
            (C {<local>} {<Id.Lit_VarLike 'idx='> <0>})
            (C {<local>} {<p>})
            (command.ForEach
              iter_name: p
              iter_words: [{(DQ ($ Id.VSub_At '$@'))}]
              do_arg_iter: F
              body: 
                (command.DoGroup
                  children: [
                    (command.Case
                      to_match: {($ Id.VSub_DollarName '$mode')}
                      arms: [
                        (case_arm
                          pat_list: [{<preprocess>}]
                          action: [
                            (command.ShAssignment
                              pairs: [
                                (assign_pair
                                  lhs: 
                                    (sh_lhs_expr.IndexedName
                                      name: files
                                      index: {($ Id.VSub_DollarName '$idx')}
                                    )
                                  op: assign_op.Equal
                                  rhs: {($ Id.VSub_DollarName '$p')}
                                  spids: [1283]
                                )
                              ]
                            )
                            (command.ShAssignment
                              pairs: [
                                (assign_pair
                                  lhs: (sh_lhs_expr.Name name:idx)
                                  op: assign_op.Equal
                                  rhs: {($ Id.VSub_DollarName '$idx') <Id.Lit_Other '+'> <1>}
                                  spids: [1291]
                                )
                              ]
                            )
                          ]
                          spids: [1279 1280 1297 -1]
                        )
                        (case_arm
                          pat_list: [{<totals>}]
                          action: [
                            (command.ShAssignment
                              pairs: [
                                (assign_pair
                                  lhs: 
                                    (sh_lhs_expr.IndexedName
                                      name: t_files
                                      index: {($ Id.VSub_DollarName '$idx')}
                                    )
                                  op: assign_op.Equal
                                  rhs: {($ Id.VSub_DollarName '$p')}
                                  spids: [1304]
                                )
                              ]
                            )
                            (command.ShAssignment
                              pairs: [
                                (assign_pair
                                  lhs: (sh_lhs_expr.Name name:idx)
                                  op: assign_op.Equal
                                  rhs: {($ Id.VSub_DollarName '$idx') <Id.Lit_Other '+'> <1>}
                                  spids: [1312]
                                )
                              ]
                            )
                          ]
                          spids: [1300 1301 1318 -1]
                        )
                        (case_arm
                          pat_list: [{<slabs>}]
                          action: [
                            (command.ShAssignment
                              pairs: [
                                (assign_pair
                                  lhs: 
                                    (sh_lhs_expr.IndexedName
                                      name: files
                                      index: {($ Id.VSub_DollarName '$idx')}
                                    )
                                  op: assign_op.Equal
                                  rhs: {($ Id.VSub_DollarName '$p')}
                                  spids: [1325]
                                )
                              ]
                            )
                            (command.ShAssignment
                              pairs: [
                                (assign_pair
                                  lhs: (sh_lhs_expr.Name name:idx)
                                  op: assign_op.Equal
                                  rhs: {($ Id.VSub_DollarName '$idx') <Id.Lit_Other '+'> <1>}
                                  spids: [1333]
                                )
                              ]
                            )
                          ]
                          spids: [1321 1322 1339 -1]
                        )
                      ]
                    )
                  ]
                )
            )
          ]
        )
    )
    (C {<parse_opts>} {(DQ ($ Id.VSub_At '$@'))})
    (command.ShAssignment
      pairs: [
        (assign_pair
          lhs: (sh_lhs_expr.Name name:argstart)
          op: assign_op.Equal
          rhs: {($ Id.VSub_QMark '$?')}
          spids: [1356]
        )
      ]
    )
    (C {<parse_args>} 
      {
        (DQ 
          (braced_var_sub
            token: <Id.VSub_At '@'>
            suffix_op: (suffix_op.Slice begin:{($ Id.VSub_DollarName '$argstart')})
          )
        )
      }
    )
    (command.If
      arms: [
        (if_arm
          cond: 
            (condition.Shell
              commands: [
                (command.Sentence
                  child: 
                    (command.AndOr
                      ops: [Id.Op_DAmp]
                      children: [
                        (C {<Id.Lit_LBracket '['>} 
                          {
                            (braced_var_sub
                              token: <Id.VSub_Name files>
                              prefix_op: (Id.VSub_Pound)
                              bracket_op: (bracket_op.WholeArray op_id:Id.Lit_At)
                            )
                          } {<-eq>} {<0>} {<Id.Lit_RBracket ']'>}
                        )
                        (C {<Id.Lit_LBracket '['>} 
                          {
                            (braced_var_sub
                              token: <Id.VSub_Name t_files>
                              prefix_op: (Id.VSub_Pound)
                              bracket_op: (bracket_op.WholeArray op_id:Id.Lit_At)
                            )
                          } {<-eq>} {<0>} {<Id.Lit_RBracket ']'>}
                        )
                      ]
                    )
                  terminator: <Id.Op_Semi _>
                )
              ]
            )
          action: [(C {<usage>}) (command.ControlFlow token:<Id.ControlFlow_Exit exit> arg_word:{<1>})]
          spids: [1370 1407]
        )
      ]
    )
    (command.Case
      to_match: {($ Id.VSub_DollarName '$mode')}
      arms: [
        (case_arm
          pat_list: [{<preprocess>}]
          action: [
            (command.ForEach
              iter_name: i
              iter_words: [
                {
                  (DQ 
                    (braced_var_sub
                      token: <Id.VSub_Name files>
                      bracket_op: (bracket_op.WholeArray op_id:Id.Lit_At)
                    )
                  )
                }
              ]
              do_arg_iter: F
              body: 
                (command.DoGroup
                  children: [(C {<do_preprocess>} {(DQ ($ Id.VSub_DollarName '$i'))})]
                )
            )
          ]
          spids: [1427 1428 1460 -1]
        )
        (case_arm
          pat_list: [{<totals>}]
          action: [(C {<do_totals_plotting>})]
          spids: [1463 1464 1470 -1]
        )
        (case_arm
          pat_list: [{<slabs>}]
          action: [
            (command.ForEach
              iter_name: i
              iter_words: [
                {
                  (DQ 
                    (braced_var_sub
                      token: <Id.VSub_Name files>
                      bracket_op: (bracket_op.WholeArray op_id:Id.Lit_At)
                    )
                  )
                }
              ]
              do_arg_iter: F
              body: 
                (command.DoGroup
                  children: [(C {<do_slabs_plotting>} {(DQ ($ Id.VSub_DollarName '$i'))})]
                )
            )
          ]
          spids: [1473 1474 1506 -1]
        )
        (case_arm
          pat_list: [{<Id.Lit_Star '*'>}]
          action: [
            (command.Simple
              words: [{<echo>} {(DQ <'Unknown mode '> ($ Id.VSub_DollarName '$mode'))}]
              redirects: [(redir op:<Id.Redir_GreatAnd '>&'> loc:(redir_loc.Fd fd:1) arg:{<2>})]
              do_fork: T
            )
            (C {<usage>})
            (command.ControlFlow token:<Id.ControlFlow_Exit exit> arg_word:{<1>})
          ]
          spids: [1509 1510 1532 -1]
        )
      ]
    )
  ]
)