(CommandList children: [ (If arms: [ (if_arm cond: (AndOr children: [ (C {(Lit_Other "[")} {(KW_Bang "!")} {(-f)} {(DQ ($ VSub_Number "$1"))} {(Lit_Other "]")}) (AndOr children: [ (Subshell children: [ (AndOr children: [ (C {(Lit_Other "[")} {(KW_Bang "!")} {(-z)} {(DQ ($ VSub_Number "$2"))} {(Lit_Other "]")} ) (C {(Lit_Other "[")} {(KW_Bang "!")} {(-f)} {(DQ ($ VSub_Number "$2"))} {(Lit_Other "]")} ) ] op_id: Op_DAmp ) ] spids: [48 76] ) (Subshell children: [ (AndOr children: [ (C {(Lit_Other "[")} {(KW_Bang "!")} {(-z)} {(DQ ($ VSub_Number "$3"))} {(Lit_Other "]")} ) (C {(Lit_Other "[")} {(KW_Bang "!")} {(-f)} {(DQ ($ VSub_Number "$3"))} {(Lit_Other "]")} ) ] op_id: Op_DAmp ) ] spids: [81 109] ) ] op_id: Op_DPipe ) ] op_id: Op_DPipe ) action: (CommandList children: [ (SimpleCommand words: [{(echo)} {(DQ ("Usage: trximg.sh file1 [file2 [file3]]"))}] redirects: [(Redirect op_id:Redir_GreatAnd arg_word:{(2)} fd:-1 spids:[120])] ) (C {(exit)} {(1)}) ] ) spids: [-1 111] ) ] spids: [-1 128] ) (FuncDef name: leout body: (BraceGroup children: [ (Assignment keyword: Assign_None pairs: [(assign_pair lhs:(LeftVar name:X) rhs:{(0)} spids:[144])] spids: [144] ) (Assignment keyword: Assign_None pairs: [(assign_pair lhs:(LeftVar name:DATA) rhs:{($ VSub_Number "$2")} spids:[148])] spids: [148] ) (While cond: (C {(Lit_Other "[")} {($ VSub_Name "$X")} {(-lt)} {($ VSub_Number "$1")} {(Lit_Other "]")}) body: (DoGroup child: (CommandList children: [ (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LeftVar name:BYTE) rhs: { (ArithSubPart anode: (ArithBinary op_id: Arith_Percent left: (ArithWord w:{($ VSub_Name "$DATA")}) right: (ArithWord w:{(Lit_Digits 256)}) ) spids: [180 184] ) } spids: [179] ) ] spids: [179] ) (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LeftVar name:DATA) rhs: { (ArithSubPart anode: (ArithBinary op_id: Arith_Slash left: (ArithWord w:{($ VSub_Name "$DATA")}) right: (ArithWord w:{(Lit_Digits 256)}) ) spids: [188 192] ) } spids: [187] ) ] spids: [187] ) (Assignment keyword: Assign_None pairs: [(assign_pair lhs:(LeftVar name:OCTAL) rhs:{(DQ )} spids:[201])] spids: [201] ) (ForEach iter_name: i iter_words: [{(1)} {(2)} {(3)}] do_arg_iter: False body: (DoGroup child: (CommandList children: [ (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LeftVar name:OCTAL) rhs: { (ArithSubPart anode: (ArithBinary op_id: Arith_Percent left: (ArithWord w:{($ VSub_Name "$BYTE")}) right: (ArithWord w:{(Lit_Digits 8)}) ) spids: [223 227] ) (DQ ($ VSub_Name "$OCTAL")) } spids: [222] ) ] spids: [222] ) (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LeftVar name:BYTE) rhs: { (ArithSubPart anode: (ArithBinary op_id: Arith_Slash left: (ArithWord w:{($ VSub_Name "$BYTE")}) right: (ArithWord w:{(Lit_Digits 8)}) ) spids: [234 238] ) } spids: [233] ) ] spids: [233] ) ] ) spids: [219 241] ) spids: [211 -1] ) (C {(echo)} {(-ne)} { (DQ (EscapedLiteralPart token:<Lit_EscapedChar "\\0">) ($ VSub_Name "$OCTAL") ) } ) (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LeftVar name:X) rhs: { (ArithSubPart anode: (ArithBinary op_id: Arith_Plus left: (ArithWord w:{($ VSub_Name "$X")}) right: (ArithWord w:{(Lit_Digits 1)}) ) spids: [262 266] ) } spids: [261] ) ] spids: [261] ) (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LeftVar name:BYTE) rhs: {($ VSub_Name "$x")} spids: [269] ) ] spids: [269] ) ] ) spids: [171 273] ) ) ] spids: [141] ) spids: [135 140] ) (FuncDef name: padlen body: (BraceGroup children: [ (C {(echo)} { (ArithSubPart anode: (ArithBinary op_id: Arith_Percent left: (ArithBinary op_id: Arith_Minus left: (ArithWord w:{($ VSub_Number "$1")}) right: (ArithBinary op_id: Arith_Percent left: (ArithWord w:{($ VSub_Number "$2")}) right: (ArithWord w:{($ VSub_Number "$1")}) ) ) right: (ArithWord w:{($ VSub_Number "$1")}) ) spids: [293 305] ) } ) ] spids: [288] ) spids: [282 287] ) (FuncDef name: roundlen body: (BraceGroup children: [ (C {(echo)} { (ArithSubPart anode: (ArithBinary op_id: Arith_Plus left: (ArithWord w:{($ VSub_Number "$2")}) right: (ArithWord w: { (CommandSubPart command_list: (C {(padlen)} {($ VSub_Number "$1")} {($ VSub_Number "$2")}) spids: [328 334] ) } ) ) spids: [325 335] ) } ) ] spids: [320] ) spids: [314 319] ) (FuncDef name: filelen body: (BraceGroup children: [ (Pipeline children: [(C {(wc)} {(-c)} {(DQ ($ VSub_Number "$1"))}) (C {(awk)} {(SQ <"{print $1}">)})] negated: False ) ] spids: [350] ) spids: [344 349] ) (FuncDef name: zpad body: (BraceGroup children: [ (AndOr children: [ (C {(Lit_Other "[")} {($ VSub_Number "$1")} {(-ne)} {(0)} {(Lit_Other "]")}) (SimpleCommand words: [ {(dd)} {(Lit_VarLike "if=") (/dev/zero)} {(Lit_VarLike "bs=") ($ VSub_Number "$1")} {(Lit_VarLike "count=") (1)} ] redirects: [(Redirect op_id:Redir_Great arg_word:{(/dev/null)} fd:2 spids:[408])] ) ] op_id: Op_DAmp ) ] spids: [382] ) spids: [376 381] ) (FuncDef name: zpad_file body: (BraceGroup children: [ (AndOr children: [ (C {(Lit_Other "[")} {(-z)} {(DQ ($ VSub_Number "$2"))} {(Lit_Other "]")}) (C {(return)}) ] op_id: Op_DAmp ) (C {(cat)} {($ VSub_Number "$2")}) (C {(zpad)} { (CommandSubPart command_list: (C {(padlen)} {($ VSub_Number "$1")} { (CommandSubPart command_list: (C {(filelen)} {(DQ ($ VSub_Number "$2"))}) spids: [454 460] ) } ) spids: [449 461] ) } ) ] spids: [424] ) spids: [418 423] ) (FuncDef name: emit_header body: (BraceGroup children: [ (If arms: [ (if_arm cond: (C {(Lit_Other "[")} {(-z)} {(DQ ($ VSub_Number "$1"))} {(Lit_Other "]")}) action: (CommandList children: [ (C {(echo)} {(-n)} {(DQ (HDR0))}) (C {(leout)} {(4)} {($ VSub_Name "$LENGTH")}) (C {(leout)} {(4)} {($ VSub_Name "$CRC32")}) ] ) spids: [-1 490] ) ] spids: [-1 525] ) (C {(leout)} {(2)} {(0)}) (C {(leout)} {(2)} {(1)}) (C {(leout)} {(4)} {(28)}) (C {(leout)} {(4)} {($ VSub_Name "$OFFSET2")}) (C {(leout)} {(4)} {($ VSub_Name "$OFFSET3")}) ] spids: [474] ) spids: [470 473] ) (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LeftVar name:TOTAL) rhs: { (ArithSubPart anode: (ArithBinary op_id: Arith_Plus left: (ArithWord w:{(Lit_Digits 28)}) right: (ArithWord w: { (CommandSubPart command_list: (C {(roundlen)} {(4)} { (CommandSubPart command_list: (C {(filelen)} {(DQ ($ VSub_Number "$1"))}) spids: [594 600] ) } ) spids: [589 601] ) } ) ) spids: [586 602] ) } spids: [585] ) ] spids: [585] ) (If arms: [ (if_arm cond: (C {(Lit_Other "[")} {(-z)} {(DQ ($ VSub_Number "$2"))} {(Lit_Other "]")}) action: (Assignment keyword: Assign_None pairs: [(assign_pair lhs:(LeftVar name:OFFSET2) rhs:{(0)} spids:[619])] spids: [619] ) spids: [-1 616] ) ] else_action: (CommandList children: [ (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LeftVar name:OFFSET2) rhs: {($ VSub_Name "$TOTAL")} spids: [625] ) ] spids: [625] ) (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LeftVar name:TOTAL) rhs: { (ArithSubPart anode: (ArithBinary op_id: Arith_Plus left: (ArithWord w:{($ VSub_Name "$TOTAL")}) right: (ArithWord w: { (CommandSubPart command_list: (C {(roundlen)} {(4)} { (CommandSubPart command_list: (C {(filelen)} {(DQ ($ VSub_Number "$2"))}) spids: [638 644] ) } ) spids: [633 645] ) } ) ) spids: [630 646] ) } spids: [629] ) ] spids: [629] ) ] ) spids: [622 648] ) (If arms: [ (if_arm cond: (C {(Lit_Other "[")} {(-z)} {(DQ ($ VSub_Number "$3"))} {(Lit_Other "]")}) action: (Assignment keyword: Assign_None pairs: [(assign_pair lhs:(LeftVar name:OFFSET3) rhs:{(0)} spids:[665])] spids: [665] ) spids: [-1 662] ) ] else_action: (CommandList children: [ (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LeftVar name:OFFSET3) rhs: {($ VSub_Name "$TOTAL")} spids: [671] ) ] spids: [671] ) (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LeftVar name:TOTAL) rhs: { (ArithSubPart anode: (ArithBinary op_id: Arith_Plus left: (ArithWord w:{($ VSub_Name "$TOTAL")}) right: (ArithWord w: { (CommandSubPart command_list: (C {(roundlen)} {(4)} { (CommandSubPart command_list: (C {(filelen)} {(DQ ($ VSub_Number "$3"))}) spids: [684 690] ) } ) spids: [679 691] ) } ) ) spids: [676 692] ) } spids: [675] ) ] spids: [675] ) ] ) spids: [668 694] ) (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LeftVar name:LENGTH) rhs: { (CommandSubPart command_list: (C {(roundlen)} {(4096)} {($ VSub_Name "$TOTAL")}) spids: [697 703] ) } spids: [696] ) ] spids: [696] ) (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LeftVar name:CRC32) rhs: { (CommandSubPart command_list: (Pipeline children: [ (Subshell children: [ (CommandList children: [ (C {(emit_header)} {(skip)}) (C {(zpad_file)} {(4)} {(DQ ($ VSub_Number "$1"))}) (C {(zpad_file)} {(4)} {(DQ ($ VSub_Number "$2"))}) (C {(zpad_file)} {(4)} {(DQ ($ VSub_Number "$3"))}) (C {(zpad)} { (CommandSubPart command_list: (C {(padlen)} {(4096)} {($ VSub_Name "$TOTAL")}) spids: [751 757] ) } ) ] ) ] spids: [714 760] ) (C {(cksum)} {(-NILP)}) ] negated: False ) spids: [711 768] ) } spids: [710] ) ] spids: [710] ) (C {(emit_header)}) (C {(zpad_file)} {(4)} {(DQ ($ VSub_Number "$1"))}) (C {(zpad_file)} {(4)} {(DQ ($ VSub_Number "$2"))}) (C {(zpad_file)} {(4)} {(DQ ($ VSub_Number "$3"))}) (C {(zpad)} { (CommandSubPart command_list: (C {(padlen)} {(4096)} {($ VSub_Name "$TOTAL")}) spids: [803 809] ) } ) ] )