(CommandList
  children: [
    (If
      arms: [
        (if_arm
          cond: [
            (Sentence
              child: 
                (C {(Lit_Other '[')} {(KW_Bang '!')} {(-d)} {(py)} {(-o)} {(KW_Bang '!')} {(-d)} {(unix)} 
                  {(-o)} {(KW_Bang '!')} {(-d)} {(stmhal)} {(Lit_Other ']')}
                )
              terminator: <Op_Semi ';'>
            )
          ]
          action: [
            (C {(echo)} {(DQ ('script must be run from root of the repository'))})
            (ControlFlow token:<ControlFlow_Exit exit> arg_word:{(1)})
          ]
          spids: [16777215 60]
        )
      ]
      spids: [16777215 74]
    )
    (Assignment
      keyword: Assign_None
      pairs: [(assign_pair lhs:(LhsName name:output) op:Equal rhs:{(codestats.dat)} spids:[80])]
      spids: [80]
    )
    (Assignment
      keyword: Assign_None
      pairs: [(assign_pair lhs:(LhsName name:RM) op:Equal rhs:{(/bin/rm)} spids:[87])]
      spids: [87]
    )
    (Assignment
      keyword: Assign_None
      pairs: [(assign_pair lhs:(LhsName name:AWK) op:Equal rhs:{(awk)} spids:[90])]
      spids: [90]
    )
    (Assignment
      keyword: Assign_None
      pairs: [(assign_pair lhs:(LhsName name:MAKE) op:Equal rhs:{(DQ ('make -j2'))} spids:[93])]
      spids: [93]
    )
    (Assignment
      keyword: Assign_None
      pairs: [(assign_pair lhs:(LhsName name:bin_unix) op:Equal rhs:{(unix/micropython)} spids:[102])]
      spids: [102]
    )
    (Assignment
      keyword: Assign_None
      pairs: [
        (assign_pair
          lhs: (LhsName name:bin_stmhal)
          op: Equal
          rhs: {(stmhal/build-PYBV10/firmware.elf)}
          spids: [105]
        )
      ]
      spids: [105]
    )
    (Assignment
      keyword: Assign_None
      pairs: [
        (assign_pair
          lhs: (LhsName name:bin_barearm_1)
          op: Equal
          rhs: {(bare-arm/build/flash.elf)}
          spids: [108]
        )
      ]
      spids: [108]
    )
    (Assignment
      keyword: Assign_None
      pairs: [
        (assign_pair
          lhs: (LhsName name:bin_barearm_2)
          op: Equal
          rhs: {(bare-arm/build/firmware.elf)}
          spids: [111]
        )
      ]
      spids: [111]
    )
    (Assignment
      keyword: Assign_None
      pairs: [
        (assign_pair
          lhs: (LhsName name:bin_minimal)
          op: Equal
          rhs: {(minimal/build/firmware.elf)}
          spids: [114]
        )
      ]
      spids: [114]
    )
    (Assignment
      keyword: Assign_None
      pairs: [
        (assign_pair
          lhs: (LhsName name:bin_cc3200_1)
          op: Equal
          rhs: {(cc3200/build/LAUNCHXL/application.axf)}
          spids: [117]
        )
      ]
      spids: [117]
    )
    (Assignment
      keyword: Assign_None
      pairs: [
        (assign_pair
          lhs: (LhsName name:bin_cc3200_2)
          op: Equal
          rhs: {(cc3200/build/LAUNCHXL/release/application.axf)}
          spids: [121]
        )
      ]
      spids: [121]
    )
    (Assignment
      keyword: Assign_None
      pairs: [
        (assign_pair
          lhs: (LhsName name:bin_cc3200_3)
          op: Equal
          rhs: {(cc3200/build/WIPY/release/application.axf)}
          spids: [125]
        )
      ]
      spids: [125]
    )
    (Assignment
      keyword: Assign_None
      pairs: [(assign_pair lhs:(LhsName name:size_unix) op:Equal rhs:{(DQ (0))} spids:[133])]
      spids: [133]
    )
    (Assignment
      keyword: Assign_None
      pairs: [(assign_pair lhs:(LhsName name:size_stmhal) op:Equal rhs:{(DQ (0))} spids:[138])]
      spids: [138]
    )
    (Assignment
      keyword: Assign_None
      pairs: [(assign_pair lhs:(LhsName name:size_barearm) op:Equal rhs:{(DQ (0))} spids:[143])]
      spids: [143]
    )
    (Assignment
      keyword: Assign_None
      pairs: [(assign_pair lhs:(LhsName name:size_minimal) op:Equal rhs:{(DQ (0))} spids:[148])]
      spids: [148]
    )
    (Assignment
      keyword: Assign_None
      pairs: [(assign_pair lhs:(LhsName name:size_cc3200) op:Equal rhs:{(DQ (0))} spids:[153])]
      spids: [153]
    )
    (Assignment
      keyword: Assign_None
      pairs: [(assign_pair lhs:(LhsName name:pystones) op:Equal rhs:{(DQ (0))} spids:[162])]
      spids: [162]
    )
    (Assignment
      keyword: Assign_None
      pairs: [
        (assign_pair
          lhs: (LhsName name:pystoneavg)
          op: Equal
          rhs: {(/tmp/pystoneavg.py)}
          spids: [171]
        )
      ]
      spids: [171]
    )
    (SimpleCommand
      words: [{(cat)}]
      redirects: [
        (Redir op:<Redir_Great '>'> fd:16777215 arg_word:{($ VSub_Name '$pystoneavg')})
        (HereDoc
          op: <Redir_DLess '<<'>
          fd: 16777215
          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(')
            (Right_DoubleQuote '"')
            ('stones %g')
            (Right_DoubleQuote '"')
            (' % stones)\n')
          ]
        )
      ]
    )
    (FuncDef
      name: get_size
      body: 
        (BraceGroup
          children: [
            (If
              arms: [
                (if_arm
                  cond: [
                    (Sentence
                      child: (C {(Lit_Other '[')} {(-r)} {($ VSub_Number '$2')} {(Lit_Other ']')})
                      terminator: <Op_Semi ';'>
                    )
                  ]
                  action: [
                    (Pipeline
                      children: [
                        (C {(size)} {($ VSub_Number '$2')})
                        (C {(tail)} {(-n1)})
                        (C {($ VSub_Name '$AWK')} {(SQ <'{print $1}'>)})
                      ]
                      negated: F
                    )
                  ]
                  spids: [16777215 216]
                )
              ]
              else_action: [(C {(echo)} {($ VSub_Number '$1')})]
              spids: [238 246]
            )
          ]
          spids: [202]
        )
      spids: [196 201]
    )
    (FuncDef
      name: get_size2
      body: 
        (BraceGroup
          children: [
            (If
              arms: [
                (if_arm
                  cond: [
                    (Sentence
                      child: (C {(Lit_Other '[')} {(-r)} {($ VSub_Number '$2')} {(Lit_Other ']')})
                      terminator: <Op_Semi ';'>
                    )
                  ]
                  action: [
                    (Pipeline
                      children: [
                        (C {(size)} {($ VSub_Number '$2')})
                        (C {(tail)} {(-n1)})
                        (C {($ VSub_Name '$AWK')} {(SQ <'{print $1}'>)})
                      ]
                      negated: F
                    )
                  ]
                  spids: [16777215 271]
                )
                (if_arm
                  cond: [
                    (Sentence
                      child: (C {(Lit_Other '[')} {(-r)} {($ VSub_Number '$3')} {(Lit_Other ']')})
                      terminator: <Op_Semi ';'>
                    )
                  ]
                  action: [
                    (Pipeline
                      children: [
                        (C {(size)} {($ VSub_Number '$3')})
                        (C {(tail)} {(-n1)})
                        (C {($ VSub_Name '$AWK')} {(SQ <'{print $1}'>)})
                      ]
                      negated: F
                    )
                  ]
                  spids: [293 304]
                )
              ]
              else_action: [(C {(echo)} {($ VSub_Number '$1')})]
              spids: [326 334]
            )
          ]
          spids: [257]
        )
      spids: [251 256]
    )
    (FuncDef
      name: get_size3
      body: 
        (BraceGroup
          children: [
            (If
              arms: [
                (if_arm
                  cond: [
                    (Sentence
                      child: (C {(Lit_Other '[')} {(-r)} {($ VSub_Number '$2')} {(Lit_Other ']')})
                      terminator: <Op_Semi ';'>
                    )
                  ]
                  action: [
                    (Pipeline
                      children: [
                        (C {(size)} {($ VSub_Number '$2')})
                        (C {(tail)} {(-n1)})
                        (C {($ VSub_Name '$AWK')} {(SQ <'{print $1}'>)})
                      ]
                      negated: F
                    )
                  ]
                  spids: [16777215 359]
                )
                (if_arm
                  cond: [
                    (Sentence
                      child: (C {(Lit_Other '[')} {(-r)} {($ VSub_Number '$3')} {(Lit_Other ']')})
                      terminator: <Op_Semi ';'>
                    )
                  ]
                  action: [
                    (Pipeline
                      children: [
                        (C {(size)} {($ VSub_Number '$3')})
                        (C {(tail)} {(-n1)})
                        (C {($ VSub_Name '$AWK')} {(SQ <'{print $1}'>)})
                      ]
                      negated: F
                    )
                  ]
                  spids: [381 392]
                )
                (if_arm
                  cond: [
                    (Sentence
                      child: (C {(Lit_Other '[')} {(-r)} {($ VSub_Number '$4')} {(Lit_Other ']')})
                      terminator: <Op_Semi ';'>
                    )
                  ]
                  action: [
                    (Pipeline
                      children: [
                        (C {(size)} {($ VSub_Number '$4')})
                        (C {(tail)} {(-n1)})
                        (C {($ VSub_Name '$AWK')} {(SQ <'{print $1}'>)})
                      ]
                      negated: F
                    )
                  ]
                  spids: [414 425]
                )
              ]
              else_action: [(C {(echo)} {($ VSub_Number '$1')})]
              spids: [447 455]
            )
          ]
          spids: [345]
        )
      spids: [339 344]
    )
    (If
      arms: [
        (if_arm
          cond: [
            (Sentence
              child: (C {(Lit_Other '[')} {(-r)} {($ VSub_Name '$output')} {(Lit_Other ']')})
              terminator: <Op_Semi ';'>
            )
          ]
          action: [
            (Assignment
              keyword: Assign_None
              pairs: [
                (assign_pair
                  lhs: (LhsName name:last_rev)
                  op: Equal
                  rhs: 
                    {
                      (CommandSubPart
                        command_list: 
                          (CommandList
                            children: [
                              (Pipeline
                                children: [
                                  (C {(tail)} {(-n1)} {($ VSub_Name '$output')})
                                  (C {($ VSub_Name '$AWK')} {(SQ <'{print $1}'>)})
                                ]
                                negated: F
                              )
                            ]
                          )
                        left_token: <Left_CommandSub '$('>
                        spids: [478 492]
                      )
                    }
                  spids: [477]
                )
              ]
              spids: [477]
            )
          ]
          spids: [16777215 474]
        )
      ]
      else_action: [
        (SimpleCommand
          words: [
            {(echo)}
            {(DQ ('# hash size_unix size_stmhal size_barearm size_minimal size_cc3200 pystones'))}
          ]
          redirects: [(Redir op:<Redir_Great '>'> fd:16777215 arg_word:{($ VSub_Name '$output')})]
        )
        (Assignment
          keyword: Assign_None
          pairs: [(assign_pair lhs:(LhsName name:last_rev) op:Equal rhs:{(DQ (v1.0))} spids:[508])]
          spids: [508]
        )
      ]
      spids: [494 513]
    )
    (Assignment
      keyword: Assign_None
      pairs: [
        (assign_pair
          lhs: (LhsName name:hashes)
          op: Equal
          rhs: 
            {
              (CommandSubPart
                command_list: 
                  (CommandList
                    children: [
                      (C {(git)} {(log)} 
                        {(--format) (Lit_Other '=') (format) (Lit_Other ':') (DQ ('%H'))} {(--reverse)} {(${ VSub_Name last_rev) (..master)}
                      )
                    ]
                  )
                left_token: <Left_CommandSub '$('>
                spids: [520 539]
              )
            }
          spids: [519]
        )
      ]
      spids: [519]
    )
    (ForEach
      iter_name: hash
      iter_words: [{($ VSub_Name '$hashes')}]
      do_arg_iter: F
      body: 
        (DoGroup
          children: [
            (C {(git)} {(checkout)} {($ VSub_Name '$hash')})
            (If
              arms: [
                (if_arm
                  cond: [
                    (Sentence
                      child: 
                        (C {(Lit_Other '[')} {($ VSub_QMark '$?')} {(-ne)} {(0)} {(Lit_Other ']')})
                      terminator: <Op_Semi ';'>
                    )
                  ]
                  action: [
                    (C {(echo)} {(DQ (aborting))})
                    (ControlFlow token:<ControlFlow_Exit exit> arg_word:{(1)})
                  ]
                  spids: [16777215 583]
                )
              ]
              spids: [16777215 598]
            )
            (If
              arms: [
                (if_arm
                  cond: [
                    (Sentence
                      child: 
                        (C {(grep)} {(-q)} 
                          {
                            (SQ 
                              <
'#if defined(MP_CLOCKS_PER_SEC) && (MP_CLOCKS_PER_SEC == 1000000) // POSIX'
                              >
                            )
                          } {(unix/modtime.c)}
                        )
                      terminator: <Op_Semi ';'>
                    )
                  ]
                  action: [
                    (C {(echo)} {(apply)} {(patch)})
                    (SimpleCommand
                      words: [{(git)} {(apply)} {(-)}]
                      redirects: [
                        (HereDoc
                          op: <Redir_DLess '<<'>
                          fd: 16777215
                          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')
                          ]
                        )
                      ]
                    )
                  ]
                  spids: [16777215 620]
                )
              ]
              spids: [16777215 660]
            )
            (C {($ VSub_Name '$RM')} {($ VSub_Name '$bin_unix')})
            (C {($ VSub_Name '$MAKE')} {(-C)} {(unix)} {(Lit_VarLike 'CFLAGS_EXTRA=') (-DNDEBUG)})
            (Assignment
              keyword: Assign_None
              pairs: [
                (assign_pair
                  lhs: (LhsName name:size_unix)
                  op: Equal
                  rhs: 
                    {
                      (CommandSubPart
                        command_list: 
                          (CommandList
                            children: [
                              (C {(get_size)} {($ VSub_Name '$size_unix')} {($ VSub_Name '$bin_unix')})
                            ]
                          )
                        left_token: <Left_CommandSub '$('>
                        spids: [685 691]
                      )
                    }
                  spids: [684]
                )
              ]
              spids: [684]
            )
            (C {(git)} {(checkout)} {(unix/modtime.c)})
            (C {($ VSub_Name '$RM')} {($ VSub_Name '$bin_stmhal')})
            (C {($ VSub_Name '$MAKE')} {(-C)} {(stmhal)} {(Lit_VarLike 'board=') (PYBV10)})
            (Assignment
              keyword: Assign_None
              pairs: [
                (assign_pair
                  lhs: (LhsName name:size_stmhal)
                  op: Equal
                  rhs: 
                    {
                      (CommandSubPart
                        command_list: 
                          (CommandList
                            children: [
                              (C {(get_size)} {($ VSub_Name '$size_stmhal')} 
                                {($ VSub_Name '$bin_stmhal')}
                              )
                            ]
                          )
                        left_token: <Left_CommandSub '$('>
                        spids: [728 734]
                      )
                    }
                  spids: [727]
                )
              ]
              spids: [727]
            )
            (C {($ VSub_Name '$RM')} {($ VSub_Name '$bin_barearm_1')} {($ VSub_Name '$bin_barearm_2')})
            (C {($ VSub_Name '$MAKE')} {(-C)} {(bare-arm)})
            (Assignment
              keyword: Assign_None
              pairs: [
                (assign_pair
                  lhs: (LhsName name:size_barearm)
                  op: Equal
                  rhs: 
                    {
                      (CommandSubPart
                        command_list: 
                          (CommandList
                            children: [
                              (C {(get_size2)} {($ VSub_Name '$size_barearm')} 
                                {($ VSub_Name '$bin_barearm_1')} {($ VSub_Name '$bin_barearm_2')}
                              )
                            ]
                          )
                        left_token: <Left_CommandSub '$('>
                        spids: [758 766]
                      )
                    }
                  spids: [757]
                )
              ]
              spids: [757]
            )
            (If
              arms: [
                (if_arm
                  cond: [
                    (Sentence
                      child: (C {(Lit_Other '[')} {(-r)} {(minimal/Makefile)} {(Lit_Other ']')})
                      terminator: <Op_Semi ';'>
                    )
                  ]
                  action: [
                    (C {($ VSub_Name '$RM')} {($ VSub_Name '$bin_minimal')})
                    (C {($ VSub_Name '$MAKE')} {(-C)} {(minimal)} {(Lit_VarLike 'CROSS=') (1)})
                    (Assignment
                      keyword: Assign_None
                      pairs: [
                        (assign_pair
                          lhs: (LhsName name:size_minimal)
                          op: Equal
                          rhs: 
                            {
                              (CommandSubPart
                                command_list: 
                                  (CommandList
                                    children: [
                                      (C {(get_size)} {($ VSub_Name '$size_minimal')} 
                                        {($ VSub_Name '$bin_minimal')}
                                      )
                                    ]
                                  )
                                left_token: <Left_CommandSub '$('>
                                spids: [805 811]
                              )
                            }
                          spids: [804]
                        )
                      ]
                      spids: [804]
                    )
                  ]
                  spids: [16777215 786]
                )
              ]
              spids: [16777215 814]
            )
            (If
              arms: [
                (if_arm
                  cond: [
                    (Sentence
                      child: (C {(Lit_Other '[')} {(-r)} {(cc3200/Makefile)} {(Lit_Other ']')})
                      terminator: <Op_Semi ';'>
                    )
                  ]
                  action: [
                    (C {($ VSub_Name '$RM')} {($ VSub_Name '$bin_cc3200_1')} 
                      {($ VSub_Name '$bin_cc3200_2')} {($ VSub_Name '$bin_cc3200_3')}
                    )
                    (C {($ VSub_Name '$MAKE')} {(-C)} {(cc3200)} {(Lit_VarLike 'BTARGET=') (application)})
                    (Assignment
                      keyword: Assign_None
                      pairs: [
                        (assign_pair
                          lhs: (LhsName name:size_cc3200)
                          op: Equal
                          rhs: 
                            {
                              (CommandSubPart
                                command_list: 
                                  (CommandList
                                    children: [
                                      (C {(get_size3)} {($ VSub_Name '$size_cc3200')} 
                                        {($ VSub_Name '$bin_cc3200_1')} {($ VSub_Name '$bin_cc3200_2')} {($ VSub_Name '$bin_cc3200_3')}
                                      )
                                    ]
                                  )
                                left_token: <Left_CommandSub '$('>
                                spids: [857 867]
                              )
                            }
                          spids: [856]
                        )
                      ]
                      spids: [856]
                    )
                  ]
                  spids: [16777215 834]
                )
              ]
              spids: [16777215 870]
            )
            (If
              arms: [
                (if_arm
                  cond: [
                    (Sentence
                      child: (C {(Lit_Other '[')} {(-x)} {($ VSub_Name '$bin_unix')} {(Lit_Other ']')})
                      terminator: <Op_Semi ';'>
                    )
                  ]
                  action: [
                    (Assignment
                      keyword: Assign_None
                      pairs: [
                        (assign_pair
                          lhs: (LhsName name:new_pystones)
                          op: Equal
                          rhs: 
                            {
                              (CommandSubPart
                                command_list: 
                                  (CommandList
                                    children: [
                                      (C {($ VSub_Name '$bin_unix')} {($ VSub_Name '$pystoneavg')})
                                    ]
                                  )
                                left_token: <Left_CommandSub '$('>
                                spids: [894 898]
                              )
                            }
                          spids: [893]
                        )
                      ]
                      spids: [893]
                    )
                    (If
                      arms: [
                        (if_arm
                          cond: [
                            (Sentence
                              child: 
                                (Pipeline
                                  children: [
                                    (C {(echo)} {($ VSub_Name '$new_pystones')})
                                    (C {(grep)} {(-q)} {(DQ ('^stones'))})
                                  ]
                                  negated: F
                                )
                              terminator: <Op_Semi ';'>
                            )
                          ]
                          action: [
                            (Assignment
                              keyword: Assign_None
                              pairs: [
                                (assign_pair
                                  lhs: (LhsName name:pystones)
                                  op: Equal
                                  rhs: 
                                    {
                                      (CommandSubPart
                                        command_list: 
                                          (CommandList
                                            children: [
                                              (Pipeline
                                                children: [
                                                  (C {(echo)} {($ VSub_Name '$new_pystones')})
                                                  (C {($ VSub_Name '$AWK')} {(SQ <'{print $2}'>)})
                                                ]
                                                negated: F
                                              )
                                            ]
                                          )
                                        left_token: <Left_CommandSub '$('>
                                        spids: [926 938]
                                      )
                                    }
                                  spids: [925]
                                )
                              ]
                              spids: [925]
                            )
                          ]
                          spids: [16777215 922]
                        )
                      ]
                      spids: [16777215 941]
                    )
                  ]
                  spids: [16777215 890]
                )
              ]
              spids: [16777215 944]
            )
            (SimpleCommand
              words: [
                {(echo)}
                {
                  (DQ ($ VSub_Name '$hash') (' ') ($ VSub_Name '$size_unix') (' ') 
                    ($ VSub_Name '$size_stmhal') (' ') ($ VSub_Name '$size_barearm') (' ') ($ VSub_Name '$size_minimal') (' ') ($ VSub_Name '$size_cc3200') 
                    (' ') ($ VSub_Name '$pystones')
                  )
                }
              ]
              redirects: [(Redir op:<Redir_DGreat '>>'> fd:16777215 arg_word:{($ VSub_Name '$output')})]
            )
          ]
          spids: [554 976]
        )
      spids: [550 552]
    )
    (C {(git)} {(checkout)} {(master)})
    (C {($ VSub_Name '$RM')} {($ VSub_Name '$pystoneavg')})
  ]
)