(command.CommandList children: [ (command.If arms: [ (if_arm cond: (condition.Shell commands: [ (command.Sentence child: (C {<Id.Lit_LBracket '['>} {<Id.KW_Bang '!'>} {<-d>} {<py>} {<-o>} {<Id.KW_Bang '!'>} {<-d>} {<unix>} {<-o>} {<Id.KW_Bang '!'>} {<-d>} {<stmhal>} {<Id.Lit_RBracket ']'>} ) terminator: <Id.Op_Semi _> ) ] ) action: [ (C {<echo>} {(DQ <'script must be run from root of the repository'>)}) (command.ControlFlow token:<Id.ControlFlow_Exit exit> arg_word:{<1>}) ] spids: [31 60] ) ] ) (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:output) op: assign_op.Equal rhs: {<codestats.dat>} spids: [80] ) ] ) (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:RM) op: assign_op.Equal rhs: {<'/bin/rm'>} spids: [87] ) ] ) (command.ShAssignment pairs: [(assign_pair lhs:(sh_lhs_expr.Name name:AWK) op:assign_op.Equal rhs:{<awk>} spids:[90])] ) (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:MAKE) op: assign_op.Equal rhs: {(DQ <'make -j2'>)} spids: [93] ) ] ) (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:bin_unix) op: assign_op.Equal rhs: {<'unix/micropython'>} spids: [102] ) ] ) (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:bin_stmhal) op: assign_op.Equal rhs: {<'stmhal/build-PYBV10/firmware.elf'>} spids: [105] ) ] ) (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:bin_barearm_1) op: assign_op.Equal rhs: {<'bare-arm/build/flash.elf'>} spids: [108] ) ] ) (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:bin_barearm_2) op: assign_op.Equal rhs: {<'bare-arm/build/firmware.elf'>} spids: [111] ) ] ) (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:bin_minimal) op: assign_op.Equal rhs: {<'minimal/build/firmware.elf'>} spids: [114] ) ] ) (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:bin_cc3200_1) op: assign_op.Equal rhs: {<'cc3200/build/LAUNCHXL/application.axf'>} spids: [117] ) ] ) (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:bin_cc3200_2) op: assign_op.Equal rhs: {<'cc3200/build/LAUNCHXL/release/application.axf'>} spids: [121] ) ] ) (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:bin_cc3200_3) op: assign_op.Equal rhs: {<'cc3200/build/WIPY/release/application.axf'>} spids: [125] ) ] ) (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:size_unix) op: assign_op.Equal rhs: {(DQ <0>)} spids: [133] ) ] ) (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:size_stmhal) op: assign_op.Equal rhs: {(DQ <0>)} spids: [138] ) ] ) (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:size_barearm) op: assign_op.Equal rhs: {(DQ <0>)} spids: [143] ) ] ) (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:size_minimal) op: assign_op.Equal rhs: {(DQ <0>)} spids: [148] ) ] ) (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:size_cc3200) op: assign_op.Equal rhs: {(DQ <0>)} spids: [153] ) ] ) (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:pystones) op: assign_op.Equal rhs: {(DQ <0>)} spids: [162] ) ] ) (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:pystoneavg) op: assign_op.Equal rhs: {<'/tmp/pystoneavg.py'>} spids: [171] ) ] ) (command.Simple words: [{<cat>}] redirects: [ (redir op: <Id.Redir_Great '>'> loc: (redir_loc.Fd fd:1) arg: {($ Id.VSub_DollarName '$pystoneavg')} ) (redir op: <Id.Redir_DLess '<<'> loc: (redir_loc.Fd fd:0) arg: (redir_param.HereDoc here_begin: {<EOF>} here_end_span_id: 194 stdin_parts: [ <'import pystone\n'> <'samples = [pystone.pystones(300000)[1] for i in range(5)]\n'> <'samples.sort()\n'> < 'stones = sum(samples[1:-1]) / (len(samples) - 2) # exclude smallest and largest\n' > <'print('> <Id.Right_DoubleQuote '"'> <'stones %g'> <Id.Right_DoubleQuote '"'> <' % stones)\n'> ] ) ) ] do_fork: T ) (command.ShFunction name: get_size body: (BraceGroup children: [ (command.If arms: [ (if_arm cond: (condition.Shell commands: [ (command.Sentence child: (C {<Id.Lit_LBracket '['>} {<-r>} {($ Id.VSub_Number '$2')} {<Id.Lit_RBracket ']'>} ) terminator: <Id.Op_Semi _> ) ] ) action: [ (command.Pipeline children: [ (C {<size>} {($ Id.VSub_Number '$2')}) (C {<tail>} {<-n1>}) (C {($ Id.VSub_DollarName '$AWK')} {(SQ <'{print $1}'>)}) ] negated: F ) ] spids: [205 216] ) ] else_action: [(C {<echo>} {($ Id.VSub_Number '$1')})] ) ] ) ) (command.ShFunction name: get_size2 body: (BraceGroup children: [ (command.If arms: [ (if_arm cond: (condition.Shell commands: [ (command.Sentence child: (C {<Id.Lit_LBracket '['>} {<-r>} {($ Id.VSub_Number '$2')} {<Id.Lit_RBracket ']'>} ) terminator: <Id.Op_Semi _> ) ] ) action: [ (command.Pipeline children: [ (C {<size>} {($ Id.VSub_Number '$2')}) (C {<tail>} {<-n1>}) (C {($ Id.VSub_DollarName '$AWK')} {(SQ <'{print $1}'>)}) ] negated: F ) ] spids: [260 271] ) (if_arm cond: (condition.Shell commands: [ (command.Sentence child: (C {<Id.Lit_LBracket '['>} {<-r>} {($ Id.VSub_Number '$3')} {<Id.Lit_RBracket ']'>} ) terminator: <Id.Op_Semi _> ) ] ) action: [ (command.Pipeline children: [ (C {<size>} {($ Id.VSub_Number '$3')}) (C {<tail>} {<-n1>}) (C {($ Id.VSub_DollarName '$AWK')} {(SQ <'{print $1}'>)}) ] negated: F ) ] spids: [293 304] ) ] else_action: [(C {<echo>} {($ Id.VSub_Number '$1')})] ) ] ) ) (command.ShFunction name: get_size3 body: (BraceGroup children: [ (command.If arms: [ (if_arm cond: (condition.Shell commands: [ (command.Sentence child: (C {<Id.Lit_LBracket '['>} {<-r>} {($ Id.VSub_Number '$2')} {<Id.Lit_RBracket ']'>} ) terminator: <Id.Op_Semi _> ) ] ) action: [ (command.Pipeline children: [ (C {<size>} {($ Id.VSub_Number '$2')}) (C {<tail>} {<-n1>}) (C {($ Id.VSub_DollarName '$AWK')} {(SQ <'{print $1}'>)}) ] negated: F ) ] spids: [348 359] ) (if_arm cond: (condition.Shell commands: [ (command.Sentence child: (C {<Id.Lit_LBracket '['>} {<-r>} {($ Id.VSub_Number '$3')} {<Id.Lit_RBracket ']'>} ) terminator: <Id.Op_Semi _> ) ] ) action: [ (command.Pipeline children: [ (C {<size>} {($ Id.VSub_Number '$3')}) (C {<tail>} {<-n1>}) (C {($ Id.VSub_DollarName '$AWK')} {(SQ <'{print $1}'>)}) ] negated: F ) ] spids: [381 392] ) (if_arm cond: (condition.Shell commands: [ (command.Sentence child: (C {<Id.Lit_LBracket '['>} {<-r>} {($ Id.VSub_Number '$4')} {<Id.Lit_RBracket ']'>} ) terminator: <Id.Op_Semi _> ) ] ) action: [ (command.Pipeline children: [ (C {<size>} {($ Id.VSub_Number '$4')}) (C {<tail>} {<-n1>}) (C {($ Id.VSub_DollarName '$AWK')} {(SQ <'{print $1}'>)}) ] negated: F ) ] spids: [414 425] ) ] else_action: [(C {<echo>} {($ Id.VSub_Number '$1')})] ) ] ) ) (command.If arms: [ (if_arm cond: (condition.Shell commands: [ (command.Sentence child: (C {<Id.Lit_LBracket '['>} {<-r>} {($ Id.VSub_DollarName '$output')} {<Id.Lit_RBracket ']'>} ) terminator: <Id.Op_Semi _> ) ] ) action: [ (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:last_rev) op: assign_op.Equal rhs: { (command_sub left_token: <Id.Left_DollarParen '$('> child: (command.Pipeline children: [ (C {<tail>} {<-n1>} {($ Id.VSub_DollarName '$output')}) (C {($ Id.VSub_DollarName '$AWK')} {(SQ <'{print $1}'>)}) ] negated: F ) ) } spids: [477] ) ] ) ] spids: [463 474] ) ] else_action: [ (command.Simple words: [ {<echo>} {(DQ <'# hash size_unix size_stmhal size_barearm size_minimal size_cc3200 pystones'>)} ] redirects: [ (redir op: <Id.Redir_Great '>'> loc: (redir_loc.Fd fd:1) arg: {($ Id.VSub_DollarName '$output')} ) ] do_fork: T ) (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:last_rev) op: assign_op.Equal rhs: {(DQ <v1.0>)} spids: [508] ) ] ) ] ) (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:hashes) op: assign_op.Equal rhs: { (command_sub left_token: <Id.Left_DollarParen '$('> child: (C {<git>} {<log>} {<--format> <Id.Lit_Equals '='> <format> <Id.Lit_Colon ':'> (DQ <'%H'>)} {<--reverse>} {(${ Id.VSub_Name last_rev) <..master>} ) ) } spids: [519] ) ] ) (command.ForEach iter_name: hash iter_words: [{($ Id.VSub_DollarName '$hashes')}] do_arg_iter: F body: (command.DoGroup children: [ (C {<git>} {<checkout>} {($ Id.VSub_DollarName '$hash')}) (command.If arms: [ (if_arm cond: (condition.Shell commands: [ (command.Sentence child: (C {<Id.Lit_LBracket '['>} {($ Id.VSub_QMark '$?')} {<-ne>} {<0>} {<Id.Lit_RBracket ']'>} ) terminator: <Id.Op_Semi _> ) ] ) action: [ (C {<echo>} {(DQ <aborting>)}) (command.ControlFlow token: <Id.ControlFlow_Exit exit> arg_word: {<1>} ) ] spids: [570 583] ) ] ) (command.If arms: [ (if_arm cond: (condition.Shell commands: [ (command.Sentence child: (C {<grep>} {<-q>} { (SQ < '#if defined(MP_CLOCKS_PER_SEC) && (MP_CLOCKS_PER_SEC == 1000000) // POSIX' > ) } {<'unix/modtime.c'>} ) terminator: <Id.Op_Semi _> ) ] ) action: [ (C {<echo>} {<apply>} {<patch>}) (command.Simple words: [{<git>} {<apply>} {<->}] redirects: [ (redir op: <Id.Redir_DLess '<<'> loc: (redir_loc.Fd fd:0) arg: (redir_param.HereDoc here_begin: {<EOF>} here_end_span_id: 658 stdin_parts: [ <'diff --git a/unix/modtime.c b/unix/modtime.c\n'> <'index 77d2945..dae0644 100644\n'> <'--- a/unix/modtime.c\n'> <'+++ b/unix/modtime.c\n'> <'@@ -55,10 +55,8 @@ void msec_sleep_tv(struct timeval *tv) {\n'> <' #define MP_CLOCKS_PER_SEC CLOCKS_PER_SEC\n'> <' #endif\n'> <' \n'> < '-#if defined(MP_CLOCKS_PER_SEC) && (MP_CLOCKS_PER_SEC == 1000000) // POSIX\n' > <'-#define CLOCK_DIV 1000.0\n'> < '-#elif defined(MP_CLOCKS_PER_SEC) && (MP_CLOCKS_PER_SEC == 1000) // WIN32\n' > <'-#define CLOCK_DIV 1.0\n'> <'+#if defined(MP_CLOCKS_PER_SEC)\n'> <'+#define CLOCK_DIV (MP_CLOCKS_PER_SEC / 1000.0F)\n'> <' #else\n'> <' #error Unsupported clock() implementation\n'> <' #endif\n'> ] ) ) ] do_fork: T ) ] spids: [607 620] ) ] ) (C {($ Id.VSub_DollarName '$RM')} {($ Id.VSub_DollarName '$bin_unix')}) (C {($ Id.VSub_DollarName '$MAKE')} {<-C>} {<unix>} {<Id.Lit_VarLike 'CFLAGS_EXTRA='> <-DNDEBUG>} ) (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:size_unix) op: assign_op.Equal rhs: { (command_sub left_token: <Id.Left_DollarParen '$('> child: (C {<get_size>} {($ Id.VSub_DollarName '$size_unix')} {($ Id.VSub_DollarName '$bin_unix')} ) ) } spids: [684] ) ] ) (C {<git>} {<checkout>} {<'unix/modtime.c'>}) (C {($ Id.VSub_DollarName '$RM')} {($ Id.VSub_DollarName '$bin_stmhal')}) (C {($ Id.VSub_DollarName '$MAKE')} {<-C>} {<stmhal>} {<Id.Lit_VarLike 'board='> <PYBV10>}) (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:size_stmhal) op: assign_op.Equal rhs: { (command_sub left_token: <Id.Left_DollarParen '$('> child: (C {<get_size>} {($ Id.VSub_DollarName '$size_stmhal')} {($ Id.VSub_DollarName '$bin_stmhal')} ) ) } spids: [727] ) ] ) (C {($ Id.VSub_DollarName '$RM')} {($ Id.VSub_DollarName '$bin_barearm_1')} {($ Id.VSub_DollarName '$bin_barearm_2')} ) (C {($ Id.VSub_DollarName '$MAKE')} {<-C>} {<bare-arm>}) (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:size_barearm) op: assign_op.Equal rhs: { (command_sub left_token: <Id.Left_DollarParen '$('> child: (C {<get_size2>} {($ Id.VSub_DollarName '$size_barearm')} {($ Id.VSub_DollarName '$bin_barearm_1')} {($ Id.VSub_DollarName '$bin_barearm_2')} ) ) } spids: [757] ) ] ) (command.If arms: [ (if_arm cond: (condition.Shell commands: [ (command.Sentence child: (C {<Id.Lit_LBracket '['>} {<-r>} {<'minimal/Makefile'>} {<Id.Lit_RBracket ']'>} ) terminator: <Id.Op_Semi _> ) ] ) action: [ (C {($ Id.VSub_DollarName '$RM')} {($ Id.VSub_DollarName '$bin_minimal')}) (C {($ Id.VSub_DollarName '$MAKE')} {<-C>} {<minimal>} {<Id.Lit_VarLike 'CROSS='> <1>} ) (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:size_minimal) op: assign_op.Equal rhs: { (command_sub left_token: <Id.Left_DollarParen '$('> child: (C {<get_size>} {($ Id.VSub_DollarName '$size_minimal')} {($ Id.VSub_DollarName '$bin_minimal')} ) ) } spids: [804] ) ] ) ] spids: [775 786] ) ] ) (command.If arms: [ (if_arm cond: (condition.Shell commands: [ (command.Sentence child: (C {<Id.Lit_LBracket '['>} {<-r>} {<'cc3200/Makefile'>} {<Id.Lit_RBracket ']'>} ) terminator: <Id.Op_Semi _> ) ] ) action: [ (C {($ Id.VSub_DollarName '$RM')} {($ Id.VSub_DollarName '$bin_cc3200_1')} {($ Id.VSub_DollarName '$bin_cc3200_2')} {($ Id.VSub_DollarName '$bin_cc3200_3')} ) (C {($ Id.VSub_DollarName '$MAKE')} {<-C>} {<cc3200>} {<Id.Lit_VarLike 'BTARGET='> <application>} ) (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:size_cc3200) op: assign_op.Equal rhs: { (command_sub left_token: <Id.Left_DollarParen '$('> child: (C {<get_size3>} {($ Id.VSub_DollarName '$size_cc3200')} {($ Id.VSub_DollarName '$bin_cc3200_1')} {($ Id.VSub_DollarName '$bin_cc3200_2')} {($ Id.VSub_DollarName '$bin_cc3200_3')} ) ) } spids: [856] ) ] ) ] spids: [823 834] ) ] ) (command.If arms: [ (if_arm cond: (condition.Shell commands: [ (command.Sentence child: (C {<Id.Lit_LBracket '['>} {<-x>} {($ Id.VSub_DollarName '$bin_unix')} {<Id.Lit_RBracket ']'>} ) terminator: <Id.Op_Semi _> ) ] ) action: [ (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:new_pystones) op: assign_op.Equal rhs: { (command_sub left_token: <Id.Left_DollarParen '$('> child: (C {($ Id.VSub_DollarName '$bin_unix')} {($ Id.VSub_DollarName '$pystoneavg')} ) ) } spids: [893] ) ] ) (command.If arms: [ (if_arm cond: (condition.Shell commands: [ (command.Sentence child: (command.Pipeline children: [ (C {<echo>} {($ Id.VSub_DollarName '$new_pystones')}) (C {<grep>} {<-q>} {(DQ <'^stones'>)}) ] negated: F ) terminator: <Id.Op_Semi _> ) ] ) action: [ (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:pystones) op: assign_op.Equal rhs: { (command_sub left_token: <Id.Left_DollarParen '$('> child: (command.Pipeline children: [ (C {<echo>} {($ Id.VSub_DollarName '$new_pystones')}) (C {($ Id.VSub_DollarName '$AWK')} {(SQ <'{print $2}'>)}) ] negated: F ) ) } spids: [925] ) ] ) ] spids: [905 922] ) ] ) ] spids: [879 890] ) ] ) (command.Simple words: [ {<echo>} { (DQ ($ Id.VSub_DollarName '$hash') <' '> ($ Id.VSub_DollarName '$size_unix') <' '> ($ Id.VSub_DollarName '$size_stmhal') <' '> ($ Id.VSub_DollarName '$size_barearm') <' '> ($ Id.VSub_DollarName '$size_minimal') <' '> ($ Id.VSub_DollarName '$size_cc3200') <' '> ($ Id.VSub_DollarName '$pystones') ) } ] redirects: [ (redir op: <Id.Redir_DGreat '>>'> loc: (redir_loc.Fd fd:1) arg: {($ Id.VSub_DollarName '$output')} ) ] do_fork: T ) ] ) ) (C {<git>} {<checkout>} {<master>}) (C {($ Id.VSub_DollarName '$RM')} {($ Id.VSub_DollarName '$pystoneavg')}) ] )