(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: (command.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: (command.BraceGroup children: [ (command.If arms: [ (if_arm cond: [ (command.Sentence child: (C {(Id.Lit_LBracket '[')} {(Id.KW_Bang '!')} {(-f)} {(DQ ($ Id.VSub_Number '$1'))} {(Id.Lit_RBracket ']')} ) terminator: (Token id:Id.Op_Semi val:';' span_id:172) ) ] action: [ (C {(echo)} {(DQ ("File '") ($ Id.VSub_Number '$1') ("' does not exist"))}) (command.ControlFlow token: (Token id:Id.ControlFlow_Exit val:exit span_id:186) arg_word: {(1)} ) ] spids: [159 174] ) ] ) ] ) ) (command.ShFunction name: do_slabs_plotting body: (command.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: (Token id:Id.Left_Backtick val:'`' span_id:259) command_list: (command.CommandList children: [(C {(basename)} {(DQ ($ Id.VSub_DollarName '$file'))})] ) ) } spids: [258] ) ] ) (command.If arms: [ (if_arm cond: [ (command.Sentence child: (C {(Id.Lit_LBracket '[')} {($ Id.VSub_DollarName '$xmax')} {(-ne)} {(0)} {(Id.Lit_RBracket ']')} ) terminator: (Token id:Id.Op_Semi val:';' span_id:281) ) ] 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: (arith_expr.VarRef token: (Token id:Id.Lit_ArithVarLike val:xmax span_id:296) ) right: (arith_expr.VarRef token: (Token id:Id.Lit_ArithVarLike val:xmin span_id:298) ) ) ) } 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: (Token id:Id.Left_Backtick val:'`' span_id:308) command_list: (command.CommandList children: [ (command.Pipeline children: [ (C {(cat)} {(DQ ($ Id.VSub_DollarName '$file'))}) (C {(wc)} {(-l)}) ] negated: F ) ] ) ) } spids: [307] ) ] ) (command.If arms: [ (if_arm cond: [ (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: (Token id:Id.Op_Semi val:';' span_id:351) ) ] 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: [ (command.Sentence child: (C {(Id.Lit_LBracket '[')} {(DQ ($ Id.VSub_DollarName '$wc_lines'))} {(-lt)} {(DQ ($ Id.VSub_DollarName '$lines'))} {(Id.Lit_RBracket ']')} ) terminator: (Token id:Id.Op_Semi val:';' span_id:379) ) ] 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: [ (command.Sentence child: (C {(Id.Lit_LBracket '[')} { (word_part.ArithSub anode: (arith_expr.Binary op_id: Id.Arith_Slash left: (arith_expr.VarRef token: (Token id:Id.Lit_ArithVarLike val:width span_id:397) ) right: (arith_expr.VarRef token: (Token id:Id.Lit_ArithVarLike val:lines span_id:401) ) ) ) } {(-gt)} {($ Id.VSub_DollarName '$min_slab_name_size')} {(Id.Lit_RBracket ']')} ) terminator: (Token id:Id.Op_Semi val:';' span_id:410) ) ] 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.HereDoc op: (Token id:Id.Redir_DLess val:'<<' span_id:432) fd: -1 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") ] ) ] ) (command.If arms: [ (if_arm cond: [ (command.Sentence child: (C {(Id.Lit_LBracket '[')} {($ Id.VSub_QMark '$?')} {(-eq)} {(0)} {(Id.Lit_RBracket ']')} ) terminator: (Token id:Id.Op_Semi val:';' span_id:484) ) ] action: [(C {(echo)} {(DQ ($ Id.VSub_DollarName '$out_file') (.png))})] spids: [473 486] ) ] ) ] ) ) (command.ShFunction name: do_totals_plotting body: (command.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: [ (command.Sentence child: (C {(Id.Lit_LBracket '[')} {($ Id.VSub_DollarName '$xmax')} {(-ne)} {(0)} {(Id.Lit_RBracket ']')} ) terminator: (Token id:Id.Op_Semi val:';' span_id:544) ) ] 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: (Token id:Id.VSub_Name val:t_files span_id:569) 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: (Token id:Id.Left_Backtick val:'`' span_id:592) command_list: (command.CommandList children: [(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.HereDoc op: (Token id:Id.Redir_DLess val:'<<' span_id:638) fd: -1 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') ] ) ] ) (command.If arms: [ (if_arm cond: [ (command.Sentence child: (C {(Id.Lit_LBracket '[')} {($ Id.VSub_QMark '$?')} {(-eq)} {(0)} {(Id.Lit_RBracket ']')} ) terminator: (Token id:Id.Op_Semi val:';' span_id:675) ) ] action: [(C {(echo)} {(DQ ($ Id.VSub_DollarName '$file') (.png))})] spids: [664 677] ) ] ) ] ) ) (command.ShFunction name: do_preprocess body: (command.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: (Token id:Id.Left_Backtick val:'`' span_id:736) command_list: (command.CommandList children: [(C {(basename)} {(DQ ($ Id.VSub_DollarName '$in'))})] ) ) (DQ (-slabs-by-loss)) } spids: [735] ) ] ) (C { (command_sub left_token: (Token id:Id.Left_Backtick val:'`' span_id:750) command_list: (command.CommandList children: [ (command.Pipeline children: [ (C {(cat)} {(DQ ($ Id.VSub_DollarName '$in'))}) (C {(grep)} {(-A)} {(DQ ($ Id.VSub_DollarName '$lines'))} {(SQ (Token id:Id.Lit_Chars val:'Slabs sorted by loss' span_id:780))} ) (C {(egrep)} {(-iv)} {(SQ (Token id:Id.Lit_Chars val:'\\-\\-|Name|Slabs' span_id:791))} ) (command.Simple words: [ {(awk)} { (SQ (Token id: Id.Lit_Chars val: '{print $1" "$4+$2*$3" "$4}' span_id: 800 ) ) } ] redirects: [ (redir.Redir op: (Token id:Id.Redir_Great val:'>' span_id:803) fd: -1 arg_word: {(DQ ($ Id.VSub_DollarName '$out'))} ) ] ) ] negated: F ) ] ) ) } ) (command.If arms: [ (if_arm cond: [ (command.Sentence child: (C {(Id.Lit_LBracket '[')} {($ Id.VSub_QMark '$?')} {(-eq)} {(0)} {(Id.Lit_RBracket ']')} ) terminator: (Token id:Id.Op_Semi val:';' span_id:822) ) ] 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: (Token id:Id.Left_Backtick val:'`' span_id:845) command_list: (command.CommandList children: [(C {(basename)} {(DQ ($ Id.VSub_DollarName '$in'))})] ) ) (DQ (-slabs-by-size)) } spids: [844] ) ] ) (C { (command_sub left_token: (Token id:Id.Left_Backtick val:'`' span_id:859) command_list: (command.CommandList children: [ (command.Pipeline children: [ (C {(cat)} {(DQ ($ Id.VSub_DollarName '$in'))}) (C {(grep)} {(-A)} {(DQ ($ Id.VSub_DollarName '$lines'))} {(SQ (Token id:Id.Lit_Chars val:'Slabs sorted by size' span_id:889))} ) (C {(egrep)} {(-iv)} {(SQ (Token id:Id.Lit_Chars val:'\\-\\-|Name|Slabs' span_id:900))} ) (command.Simple words: [ {(awk)} { (SQ (Token id: Id.Lit_Chars val: '{print $1" "$4" "$4-$2*$3}' span_id: 909 ) ) } ] redirects: [ (redir.Redir op: (Token id:Id.Redir_Great val:'>' span_id:912) fd: -1 arg_word: {(DQ ($ Id.VSub_DollarName '$out'))} ) ] ) ] negated: F ) ] ) ) } ) (command.If arms: [ (if_arm cond: [ (command.Sentence child: (C {(Id.Lit_LBracket '[')} {($ Id.VSub_QMark '$?')} {(-eq)} {(0)} {(Id.Lit_RBracket ']')} ) terminator: (Token id:Id.Op_Semi val:';' span_id:931) ) ] 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: (Token id:Id.Left_Backtick val:'`' span_id:948) command_list: (command.CommandList children: [(C {(basename)} {(DQ ($ Id.VSub_DollarName '$in'))})] ) ) (DQ (-totals)) } spids: [947] ) ] ) (C { (command_sub left_token: (Token id:Id.Left_Backtick val:'`' span_id:962) command_list: (command.CommandList children: [ (command.Pipeline children: [ (C {(cat)} {(DQ ($ Id.VSub_DollarName '$in'))}) (C {(grep)} {(DQ ('Memory used'))}) (command.Simple words: [ {(awk)} {(SQ (Token id:Id.Lit_Chars val:'{print $3" "$7}' span_id:988))} ] redirects: [ (redir.Redir op: (Token id:Id.Redir_Great val:'>' span_id:991) fd: -1 arg_word: {(DQ ($ Id.VSub_DollarName '$out'))} ) ] ) ] negated: F ) ] ) ) } ) (command.If arms: [ (if_arm cond: [ (command.Sentence child: (C {(Id.Lit_LBracket '[')} {($ Id.VSub_QMark '$?')} {(-eq)} {(0)} {(Id.Lit_RBracket ']')} ) terminator: (Token id:Id.Op_Semi val:';' span_id:1010) ) ] action: [ (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.IndexedName name: t_files index: (arith_expr.ArithWord w:{(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: (command.BraceGroup children: [ (C {(local)} {(opt)}) (command.WhileUntil keyword: (Token id:Id.KW_While val:while span_id:1044) cond: [ (command.Sentence child: (C {(getopts)} {(DQ ('tlr::s::h'))} {(opt)}) terminator: (Token id:Id.Op_Semi val:';' span_id:1053) ) ] 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: (Token id:Id.Op_LParen val:'(' span_id:1092) words: [ { (braced_var_sub token: (Token id:Id.VSub_Name val:OPTARG span_id:1094) 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: (Token id:Id.VSub_Name val:array span_id:1106) bracket_op: (bracket_op.ArrayIndex expr: (arith_expr.ArithWord w:{(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: (Token id:Id.VSub_Name val:array span_id:1115) bracket_op: (bracket_op.ArrayIndex expr: (arith_expr.ArithWord w:{(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: (Token id:Id.Op_LParen val:'(' span_id:1130) words: [ { (braced_var_sub token: (Token id:Id.VSub_Name val:OPTARG span_id:1132) 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: (Token id:Id.VSub_Name val:array span_id:1144) bracket_op: (bracket_op.ArrayIndex expr: (arith_expr.ArithWord w:{(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: (Token id:Id.VSub_Name val:array span_id:1153) bracket_op: (bracket_op.ArrayIndex expr: (arith_expr.ArithWord w:{(Id.Lit_Digits 1)}) ) ) } spids: [1151] ) ] ) ] spids: [1125 1126 1160 -1] ) (case_arm pat_list: [{(h)}] action: [ (C {(usage)}) (command.ControlFlow token: (Token id:Id.ControlFlow_Exit val:exit span_id:1170) arg_word: {(0)} ) ] spids: [1163 1164 1175 -1] ) (case_arm pat_list: [ { (word_part.EscapedLiteral token: (Token id:Id.Lit_EscapedChar val:'\\?' span_id:1178) ) } ] action: [ (command.Simple words: [ {(echo)} {(DQ ('Invalid option: -') ($ Id.VSub_DollarName '$OPTARG'))} ] redirects: [ (redir.Redir op: (Token id:Id.Redir_GreatAnd val:'>&' span_id:1189) fd: -1 arg_word: {(2)} ) ] ) (command.ControlFlow token: (Token id:Id.ControlFlow_Exit val:exit span_id:1193) arg_word: {(1)} ) ] spids: [1178 1179 1198 -1] ) (case_arm pat_list: [{(Id.Lit_Other ':')}] action: [ (command.Simple words: [ {(echo)} {(DQ (-) ($ Id.VSub_DollarName '$OPTARG') (' requires an argument.'))} ] redirects: [ (redir.Redir op: (Token id:Id.Redir_GreatAnd val:'>&' span_id:1213) fd: -1 arg_word: {(2)} ) ] ) (command.ControlFlow token: (Token id:Id.ControlFlow_Exit val:exit span_id:1217) arg_word: {(1)} ) ] spids: [1201 1202 1222 -1] ) ] ) ] ) ) (command.ControlFlow token: (Token id:Id.ControlFlow_Return val:return span_id:1232) arg_word: {($ Id.VSub_DollarName '$OPTIND')} ) ] ) ) (command.ShFunction name: parse_args body: (command.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: (arith_expr.ArithWord w:{($ 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: (arith_expr.ArithWord w:{($ 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: (arith_expr.ArithWord w:{($ 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: (Token id:Id.VSub_At val:'@' span_id:1363) suffix_op: (suffix_op.Slice begin: (arith_expr.ArithWord w:{($ Id.VSub_DollarName '$argstart')}) ) ) ) } ) (command.If arms: [ (if_arm cond: [ (command.Sentence child: (command.AndOr ops: [Id.Op_DAmp] children: [ (C {(Id.Lit_LBracket '[')} { (braced_var_sub token: (Token id:Id.VSub_Name val:files span_id:1376) 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: (Token id:Id.VSub_Name val:t_files span_id:1394) prefix_op: (Id.VSub_Pound) bracket_op: (bracket_op.WholeArray op_id:Id.Lit_At) ) } {(-eq)} {(0)} {(Id.Lit_RBracket ']')} ) ] ) terminator: (Token id:Id.Op_Semi val:';' span_id:1405) ) ] action: [ (C {(usage)}) (command.ControlFlow token: (Token id:Id.ControlFlow_Exit val:exit span_id:1413) 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: (Token id:Id.VSub_Name val:files span_id:1439) 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: (Token id:Id.VSub_Name val:files span_id:1485) 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.Redir op: (Token id:Id.Redir_GreatAnd val:'>&' span_id:1520) fd: -1 arg_word: {(2)} ) ] ) (C {(usage)}) (command.ControlFlow token: (Token id:Id.ControlFlow_Exit val:exit span_id:1527) arg_word: {(1)} ) ] spids: [1509 1510 1532 -1] ) ] ) ] )