(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"))})
            (C {(exit)} {(1)})
          ]
          spids: [-1 60]
        )
      ]
      spids: [-1 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_id:Redir_Great fd:-1 arg_word:{($ VSub_Name "$pystoneavg")} spids:[176])
        (HereDoc
          op_id: Redir_DLess
          fd: -1
          body: 
            {
              (DQ ("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")
              )
            }
          do_expansion: True
          here_end: EOF
          was_filled: True
          spids: [180]
        )
      ]
    )
    (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: False
                    )
                  ]
                  spids: [-1 214]
                )
              ]
              else_action: [(C {(echo)} {($ VSub_Number "$1")})]
              spids: [236 244]
            )
          ]
          spids: [200]
        )
      spids: [194 199]
    )
    (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: False
                    )
                  ]
                  spids: [-1 269]
                )
                (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: False
                    )
                  ]
                  spids: [291 302]
                )
              ]
              else_action: [(C {(echo)} {($ VSub_Number "$1")})]
              spids: [324 332]
            )
          ]
          spids: [255]
        )
      spids: [249 254]
    )
    (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: False
                    )
                  ]
                  spids: [-1 357]
                )
                (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: False
                    )
                  ]
                  spids: [379 390]
                )
                (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: False
                    )
                  ]
                  spids: [412 423]
                )
              ]
              else_action: [(C {(echo)} {($ VSub_Number "$1")})]
              spids: [445 453]
            )
          ]
          spids: [343]
        )
      spids: [337 342]
    )
    (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: False
                              )
                            ]
                          )
                        left_token: <Left_CommandSub "$(">
                        spids: [476 490]
                      )
                    }
                  spids: [475]
                )
              ]
              spids: [475]
            )
          ]
          spids: [-1 472]
        )
      ]
      else_action: [
        (SimpleCommand
          words: [
            {(echo)}
            {(DQ ("# hash size_unix size_stmhal size_barearm size_minimal size_cc3200 pystones"))}
          ]
          redirects: [(Redir op_id:Redir_Great fd:-1 arg_word:{($ VSub_Name "$output")} spids:[501])]
        )
        (Assignment
          keyword: Assign_None
          pairs: [(assign_pair lhs:(LhsName name:last_rev) op:Equal rhs:{(DQ (v1.0))} spids:[506])]
          spids: [506]
        )
      ]
      spids: [492 511]
    )
    (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: [518 537]
              )
            }
          spids: [517]
        )
      ]
      spids: [517]
    )
    (ForEach
      iter_name: hash
      iter_words: [{($ VSub_Name "$hashes")}]
      do_arg_iter: False
      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))}) (C {(exit)} {(1)})]
                  spids: [-1 581]
                )
              ]
              spids: [-1 596]
            )
            (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_id: Redir_DLess
                          fd: -1
                          body: 
                            {
                              (DQ ("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_expansion: True
                          here_end: EOF
                          was_filled: True
                          spids: [634]
                        )
                      ]
                    )
                  ]
                  spids: [-1 618]
                )
              ]
              spids: [-1 656]
            )
            (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: [681 687]
                      )
                    }
                  spids: [680]
                )
              ]
              spids: [680]
            )
            (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: [724 730]
                      )
                    }
                  spids: [723]
                )
              ]
              spids: [723]
            )
            (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: [754 762]
                      )
                    }
                  spids: [753]
                )
              ]
              spids: [753]
            )
            (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: [801 807]
                              )
                            }
                          spids: [800]
                        )
                      ]
                      spids: [800]
                    )
                  ]
                  spids: [-1 782]
                )
              ]
              spids: [-1 810]
            )
            (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: [853 863]
                              )
                            }
                          spids: [852]
                        )
                      ]
                      spids: [852]
                    )
                  ]
                  spids: [-1 830]
                )
              ]
              spids: [-1 866]
            )
            (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: [890 894]
                              )
                            }
                          spids: [889]
                        )
                      ]
                      spids: [889]
                    )
                    (If
                      arms: [
                        (if_arm
                          cond: [
                            (Sentence
                              child: 
                                (Pipeline
                                  children: [
                                    (C {(echo)} {($ VSub_Name "$new_pystones")})
                                    (C {(grep)} {(-q)} {(DQ ("^stones"))})
                                  ]
                                  negated: False
                                )
                              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: False
                                              )
                                            ]
                                          )
                                        left_token: <Left_CommandSub "$(">
                                        spids: [922 934]
                                      )
                                    }
                                  spids: [921]
                                )
                              ]
                              spids: [921]
                            )
                          ]
                          spids: [-1 918]
                        )
                      ]
                      spids: [-1 937]
                    )
                  ]
                  spids: [-1 886]
                )
              ]
              spids: [-1 940]
            )
            (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_id: Redir_DGreat
                  fd: -1
                  arg_word: {($ VSub_Name "$output")}
                  spids: [967]
                )
              ]
            )
          ]
          spids: [552 972]
        )
      spids: [548 550]
    )
    (C {(git)} {(checkout)} {(master)})
    (C {($ VSub_Name "$RM")} {($ VSub_Name "$pystoneavg")})
  ]
)