(command.CommandList
  children: [
    (command.CommandList
      children: [
        (command.Sentence
          child: 
            (command.ShAssignment
              pairs: [
                (assign_pair
                  lhs: (sh_lhs_expr.Name name:opt_buckets)
                  op: assign_op.Equal
                  rhs: {<0>}
                  spids: [124]
                )
              ]
            )
          terminator: <Id.Op_Semi _>
        )
        (command.Sentence
          child: 
            (command.ShAssignment
              pairs: [
                (assign_pair
                  lhs: (sh_lhs_expr.Name name:buckets)
                  op: assign_op.Equal
                  rhs: (word.Empty)
                  spids: [128]
                )
              ]
            )
          terminator: <Id.Op_Semi _>
        )
        (command.Sentence
          child: 
            (command.ShAssignment
              pairs: [
                (assign_pair
                  lhs: (sh_lhs_expr.Name name:opt_power)
                  op: assign_op.Equal
                  rhs: {<0>}
                  spids: [131]
                )
              ]
            )
          terminator: <Id.Op_Semi _>
        )
        (command.Sentence
          child: 
            (command.ShAssignment
              pairs: [
                (assign_pair
                  lhs: (sh_lhs_expr.Name name:power)
                  op: assign_op.Equal
                  rhs: {<4>}
                  spids: [135]
                )
              ]
            )
          terminator: <Id.Op_Semi _>
        )
        (command.Sentence
          child: 
            (command.ShAssignment
              pairs: [
                (assign_pair
                  lhs: (sh_lhs_expr.Name name:opt_max)
                  op: assign_op.Equal
                  rhs: {<0>}
                  spids: [139]
                )
              ]
            )
          terminator: <Id.Op_Semi _>
        )
        (command.ShAssignment
          pairs: [
            (assign_pair
              lhs: (sh_lhs_expr.Name name:max)
              op: assign_op.Equal
              rhs: 
                {
                  (word_part.ArithSub
                    anode: 
                      (arith_expr.Binary
                        op_id: Id.Arith_Star
                        left: {<Id.Lit_Digits 1024>}
                        right: {<Id.Lit_Digits 1024>}
                      )
                  )
                }
              spids: [143]
            )
          ]
        )
      ]
    )
    (command.CommandList
      children: [
        (command.Sentence
          child: 
            (command.ShAssignment
              pairs: [
                (assign_pair
                  lhs: (sh_lhs_expr.Name name:opt_filter)
                  op: assign_op.Equal
                  rhs: {<0>}
                  spids: [153]
                )
              ]
            )
          terminator: <Id.Op_Semi _>
        )
        (command.Sentence
          child: 
            (command.ShAssignment
              pairs: [
                (assign_pair
                  lhs: (sh_lhs_expr.Name name:filter)
                  op: assign_op.Equal
                  rhs: (word.Empty)
                  spids: [157]
                )
              ]
            )
          terminator: <Id.Op_Semi _>
        )
        (command.Sentence
          child: 
            (command.ShAssignment
              pairs: [
                (assign_pair
                  lhs: (sh_lhs_expr.Name name:duration)
                  op: assign_op.Equal
                  rhs: {<0>}
                  spids: [160]
                )
              ]
            )
          terminator: <Id.Op_Semi _>
        )
        (command.ShAssignment
          pairs: [
            (assign_pair
              lhs: (sh_lhs_expr.Name name:debug)
              op: assign_op.Equal
              rhs: {<0>}
              spids: [164]
            )
          ]
        )
      ]
    )
    (C {<trap>} {(SQ <':'>)} {<INT>} {<QUIT>} {<TERM>} {<PIPE>} {<HUP>})
    (command.ShFunction
      name: usage
      body: 
        (BraceGroup
          children: [
            (command.Simple
              words: [{<cat>}]
              redirects: [
                (redir
                  op: <Id.Redir_DLessDash '<<-'>
                  loc: (redir_loc.Fd fd:0)
                  arg: 
                    (redir_param.HereDoc
                      here_begin: {<END>}
                      here_end_span_id: 232
                      stdin_parts: [
                        <'USAGE: perf-stat-hist [-h] [-b buckets|-P power] [-m max] [-f filter]\n'>
                        <'                      tracepoint variable [seconds]\n'>
                        <'                 -b buckets      # specify histogram bucket points\n'>
                        <'                 -P power        # power-of (default is 4)\n'>
                        <'                 -m max          # max value for power-of\n'>
                        <'                 -f filter       # specify a filter \n'>
                        <'                 -h              # this usage message\n'>
                        <'   eg,\n'>
                        <'       perf-stat-hist syscalls:sys_enter_read count 5\n'>
                        <'                 # read() request histogram, 5 seconds\n'>
                        <'       perf-stat-hist syscalls:sys_exit_read ret 5\n'>
                        <'                 # read() return histogram, 5 seconds\n'>
                        <'       perf-stat-hist -P 10 syscalls:sys_exit_read ret 5\n'>
                        <'                 # ... use power-of-10\n'>
                        <'       perf-stat-hist -P 2 -m 1024 syscalls:sys_exit_read ret 5\n'>
                        <'                 # ... use power-of-2, max 1024\n'>
                        <'       perf-stat-hist -b '>
                        <Id.Right_DoubleQuote '"'>
                        <'10 50 100 500'>
                        <Id.Right_DoubleQuote '"'>
                        <' syscalls:sys_exit_read ret 5\n'>
                        <'                 # ... histogram based on these bucket ranges\n'>
                        <'       perf-stat-hist -b 10 syscalls:sys_exit_read ret 5\n'>
                        <'                 # ... bifurcate by the value 10 (lowest overhead)\n'>
                        <'       perf-stat-hist -f \'rwbs == '>
                        <Id.Right_DoubleQuote '"'>
                        <WS>
                        <Id.Right_DoubleQuote '"'>
                        <'\' block:block_rq_complete nr_sector 5\n'>
                        <'                 # ... synchronous writes histogram, 5 seconds\n'>
                        <'\n'>
                        <'See the man page and example file for more info.\n'>
                      ]
                    )
                )
                (redir op:<Id.Redir_GreatAnd '>&'> loc:(redir_loc.Fd fd:1) arg:{<2>})
              ]
              do_fork: T
            )
            (command.ControlFlow token:<Id.ControlFlow_Exit exit>)
          ]
        )
    )
    (command.ShFunction
      name: die
      body: 
        (BraceGroup
          children: [
            (command.Simple
              words: [{<echo>} {(DQ ($ Id.VSub_At '$@'))}]
              redirects: [(redir op:<Id.Redir_GreatAnd '>&'> loc:(redir_loc.Fd fd:1) arg:{<2>})]
              do_fork: T
            )
            (command.ControlFlow token:<Id.ControlFlow_Exit exit> arg_word:{<1>})
          ]
        )
    )
    (command.WhileUntil
      keyword: <Id.KW_While while>
      cond: 
        (condition.Shell
          commands: [
            (C {<getopts>} 
              {<b> <Id.Lit_Colon ':'> <hm> <Id.Lit_Colon ':'> <P> <Id.Lit_Colon ':'> <f> <Id.Lit_Colon ':'>} {<opt>}
            )
          ]
        )
      body: 
        (command.DoGroup
          children: [
            (command.Case
              to_match: {($ Id.VSub_DollarName '$opt')}
              arms: [
                (case_arm
                  pat_list: [{<b>}]
                  action: [
                    (command.Sentence
                      child: 
                        (command.ShAssignment
                          pairs: [
                            (assign_pair
                              lhs: (sh_lhs_expr.Name name:opt_buckets)
                              op: assign_op.Equal
                              rhs: {<1>}
                              spids: [294]
                            )
                          ]
                        )
                      terminator: <Id.Op_Semi _>
                    )
                    (command.ShAssignment
                      pairs: [
                        (assign_pair
                          lhs: (sh_lhs_expr.Name name:buckets)
                          op: assign_op.Equal
                          rhs: 
                            {
                              (sh_array_literal
                                left: <Id.Op_LParen _>
                                words: [{($ Id.VSub_DollarName '$OPTARG')}]
                              )
                            }
                          spids: [298]
                        )
                      ]
                    )
                  ]
                  spids: [291 292 303 -1]
                )
                (case_arm
                  pat_list: [{<P>}]
                  action: [
                    (command.Sentence
                      child: 
                        (command.ShAssignment
                          pairs: [
                            (assign_pair
                              lhs: (sh_lhs_expr.Name name:opt_power)
                              op: assign_op.Equal
                              rhs: {<1>}
                              spids: [309]
                            )
                          ]
                        )
                      terminator: <Id.Op_Semi _>
                    )
                    (command.ShAssignment
                      pairs: [
                        (assign_pair
                          lhs: (sh_lhs_expr.Name name:power)
                          op: assign_op.Equal
                          rhs: {($ Id.VSub_DollarName '$OPTARG')}
                          spids: [313]
                        )
                      ]
                    )
                  ]
                  spids: [306 307 316 -1]
                )
                (case_arm
                  pat_list: [{<m>}]
                  action: [
                    (command.Sentence
                      child: 
                        (command.ShAssignment
                          pairs: [
                            (assign_pair
                              lhs: (sh_lhs_expr.Name name:opt_max)
                              op: assign_op.Equal
                              rhs: {<1>}
                              spids: [322]
                            )
                          ]
                        )
                      terminator: <Id.Op_Semi _>
                    )
                    (command.ShAssignment
                      pairs: [
                        (assign_pair
                          lhs: (sh_lhs_expr.Name name:max)
                          op: assign_op.Equal
                          rhs: {($ Id.VSub_DollarName '$OPTARG')}
                          spids: [326]
                        )
                      ]
                    )
                  ]
                  spids: [319 320 329 -1]
                )
                (case_arm
                  pat_list: [{<f>}]
                  action: [
                    (command.Sentence
                      child: 
                        (command.ShAssignment
                          pairs: [
                            (assign_pair
                              lhs: (sh_lhs_expr.Name name:opt_filter)
                              op: assign_op.Equal
                              rhs: {<1>}
                              spids: [335]
                            )
                          ]
                        )
                      terminator: <Id.Op_Semi _>
                    )
                    (command.ShAssignment
                      pairs: [
                        (assign_pair
                          lhs: (sh_lhs_expr.Name name:filter)
                          op: assign_op.Equal
                          rhs: {(DQ ($ Id.VSub_DollarName '$OPTARG') <' && '>)}
                          spids: [339]
                        )
                      ]
                    )
                  ]
                  spids: [332 333 345 -1]
                )
                (case_arm
                  pat_list: [{<h>} {<Id.Lit_QMark '?'>}]
                  action: [(C {<usage>})]
                  spids: [348 351 355 -1]
                )
              ]
            )
          ]
        )
    )
    (C {<shift>} 
      {
        (word_part.ArithSub
          anode: 
            (arith_expr.Binary
              op_id: Id.Arith_Minus
              left: {($ Id.VSub_DollarName '$OPTIND')}
              right: {<Id.Lit_Digits 1>}
            )
        )
      }
    )
    (command.AndOr
      ops: [Id.Op_DAmp]
      children: [
        (command.DParen
          child: 
            (arith_expr.Binary
              op_id: Id.Arith_Less
              left: {($ Id.VSub_Pound '$#')}
              right: {<Id.Lit_Digits 2>}
            )
        )
        (C {<usage>})
      ]
    )
    (command.ShAssignment
      pairs: [
        (assign_pair
          lhs: (sh_lhs_expr.Name name:tpoint)
          op: assign_op.Equal
          rhs: {($ Id.VSub_Number '$1')}
          spids: [390]
        )
      ]
    )
    (command.ShAssignment
      pairs: [
        (assign_pair
          lhs: (sh_lhs_expr.Name name:var)
          op: assign_op.Equal
          rhs: {($ Id.VSub_Number '$2')}
          spids: [396]
        )
      ]
    )
    (command.ShAssignment
      pairs: [
        (assign_pair
          lhs: (sh_lhs_expr.Name name:duration)
          op: assign_op.Equal
          rhs: {(${ Id.VSub_Number 3)}
          spids: [402]
        )
      ]
    )
    (command.AndOr
      ops: [Id.Op_DAmp]
      children: [
        (command.DParen
          child: 
            (arith_expr.Binary
              op_id: Id.Arith_DAmp
              left: <Id.Lit_ArithVarLike opt_buckets>
              right: <Id.Lit_ArithVarLike opt_power>
            )
        )
        (C {<die>} {(DQ <'ERROR: use either -b or -P'>)})
      ]
    )
    (command.AndOr
      ops: [Id.Op_DAmp]
      children: [
        (command.DParen
          child: 
            (arith_expr.Binary
              op_id: Id.Arith_DAmp
              left: <Id.Lit_ArithVarLike opt_power>
              right: 
                (arith_expr.Binary
                  op_id: Id.Arith_Less
                  left: <Id.Lit_ArithVarLike power>
                  right: {<Id.Lit_Digits 2>}
                )
            )
        )
        (C {<die>} {(DQ <'ERROR: -P power must be 2 or higher'>)})
      ]
    )
    (command.If
      arms: [
        (if_arm
          cond: 
            (condition.Shell
              commands: [
                (command.Pipeline
                  children: [
                    (command.Simple
                      words: [
                        {<grep>}
                        {
                          (DQ <'^'> ($ Id.VSub_DollarName '$tpoint') 
                            (word_part.EscapedLiteral
                              token: <Id.Lit_EscapedChar '\\$'>
                            )
                          )
                        }
                        {<'/sys/kernel/debug/tracing/available_events'>}
                      ]
                      redirects: [
                        (redir
                          op: <Id.Redir_Great '>'>
                          loc: (redir_loc.Fd fd:1)
                          arg: {<'/dev/null'>}
                        )
                      ]
                      do_fork: T
                    )
                  ]
                  negated: T
                )
              ]
            )
          action: [
            (command.Simple
              words: [
                {<echo>}
                {
                  (DQ <'ERROR: tracepoint '> 
                    (word_part.EscapedLiteral token:<Id.Lit_EscapedChar '\\"'>) ($ Id.VSub_DollarName '$tpoint') (word_part.EscapedLiteral token:<Id.Lit_EscapedChar '\\"'>) 
                    <' not found. Exiting...'>
                  )
                }
              ]
              redirects: [(redir op:<Id.Redir_GreatAnd '>&'> loc:(redir_loc.Fd fd:1) arg:{<2>})]
              do_fork: T
            )
            (command.AndOr
              ops: [Id.Op_DAmp]
              children: [
                (command.DBracket
                  expr: 
                    (bool_expr.Binary
                      op_id: Id.BoolBinary_GlobNEqual
                      left: {(DQ ($ Id.VSub_DollarName '$USER'))}
                      right: {(DQ <root>)}
                    )
                )
                (command.Simple
                  words: [{<echo>} {(DQ <'Not root user?'>)}]
                  redirects: [(redir op:<Id.Redir_GreatAnd '>&'> loc:(redir_loc.Fd fd:1) arg:{<2>})]
                  do_fork: T
                )
              ]
            )
            (command.ControlFlow token:<Id.ControlFlow_Exit exit> arg_word:{<1>})
          ]
          spids: [457 475]
        )
      ]
    )
    (command.If
      arms: [
        (if_arm
          cond: 
            (condition.Shell
              commands: [
                (command.Sentence
                  child: 
                    (command.DParen
                      child: 
                        (arith_expr.Unary
                          op_id: Id.Arith_Bang
                          child: <Id.Lit_ArithVarLike opt_buckets>
                        )
                    )
                  terminator: <Id.Op_Semi _>
                )
              ]
            )
          action: [
            (command.ShAssignment
              pairs: [
                (assign_pair
                  lhs: (sh_lhs_expr.Name name:b)
                  op: assign_op.Equal
                  rhs: {<0>}
                  spids: [542]
                )
              ]
            )
            (command.ShAssignment
              pairs: [
                (assign_pair
                  lhs: (sh_lhs_expr.Name name:s)
                  op: assign_op.Equal
                  rhs: {<1>}
                  spids: [546]
                )
              ]
            )
            (command.WhileUntil
              keyword: <Id.KW_While while>
              cond: 
                (condition.Shell
                  commands: [
                    (command.Sentence
                      child: 
                        (command.DParen
                          child: 
                            (arith_expr.Binary
                              op_id: Id.Arith_LessEqual
                              left: <Id.Lit_ArithVarLike s>
                              right: <Id.Lit_ArithVarLike max>
                            )
                        )
                      terminator: <Id.Op_Semi _>
                    )
                  ]
                )
              body: 
                (command.DoGroup
                  children: [
                    (command.ShAssignment
                      pairs: [
                        (assign_pair
                          lhs: (sh_lhs_expr.Name name:b)
                          op: assign_op.Equal
                          rhs: {(DQ ($ Id.VSub_DollarName '$b') <' '> ($ Id.VSub_DollarName '$s'))}
                          spids: [567]
                        )
                      ]
                    )
                    (command.DParen
                      child: 
                        (arith_expr.BinaryAssign
                          op_id: Id.Arith_StarEqual
                          left: <Id.Lit_ArithVarLike s>
                          right: <Id.Lit_ArithVarLike power>
                        )
                    )
                  ]
                )
            )
            (command.ShAssignment
              pairs: [
                (assign_pair
                  lhs: (sh_lhs_expr.Name name:buckets)
                  op: assign_op.Equal
                  rhs: 
                    {(sh_array_literal left:<Id.Op_LParen _> words:[{($ Id.VSub_DollarName '$b')}])}
                  spids: [590]
                )
              ]
            )
          ]
          spids: [528 539]
        )
      ]
    )
    (command.ShAssignment
      pairs: [
        (assign_pair
          lhs: (sh_lhs_expr.Name name:max)
          op: assign_op.Equal
          rhs: 
            {
              (braced_var_sub
                token: <Id.VSub_Name buckets>
                bracket_op: 
                  (bracket_op.ArrayIndex
                    expr: 
                      (arith_expr.Binary
                        op_id: Id.Arith_Minus
                        left: 
                          {
                            (braced_var_sub
                              token: <Id.VSub_Name buckets>
                              prefix_op: (Id.VSub_Pound)
                              bracket_op: (bracket_op.WholeArray op_id:Id.Lit_At)
                            )
                          }
                        right: {<Id.Lit_Digits 1>}
                      )
                  )
              )
            }
          spids: [601]
        )
      ]
    )
    (command.DParen
      child: 
        (arith_expr.BinaryAssign
          op_id: Id.Arith_Equal
          left: <Id.Lit_ArithVarLike max_i>
          right: 
            (arith_expr.Binary
              op_id: Id.Arith_Minus
              left: 
                {
                  (braced_var_sub
                    token: <Id.VSub_Name buckets>
                    prefix_op: (Id.VSub_Pound)
                    bracket_op: (bracket_op.WholeArray op_id:Id.Arith_Star)
                  )
                }
              right: {<Id.Lit_Digits 1>}
            )
        )
    )
    (command.ShAssignment
      pairs: [
        (assign_pair
          lhs: (sh_lhs_expr.Name name:tpoints)
          op: assign_op.Equal
          rhs: 
            {
              (DQ <'-e '> ($ Id.VSub_DollarName '$tpoint') <' --filter '> 
                (word_part.EscapedLiteral token:<Id.Lit_EscapedChar '\\"'>) ($ Id.VSub_DollarName '$filter') <' '> ($ Id.VSub_DollarName '$var') <' < '> 
                (braced_var_sub
                  token: <Id.VSub_Name buckets>
                  bracket_op: (bracket_op.ArrayIndex expr:{<Id.Lit_Digits 0>})
                ) (word_part.EscapedLiteral token:<Id.Lit_EscapedChar '\\"'>)
              )
            }
          spids: [641]
        )
      ]
    )
    (command.ShAssignment
      pairs: [
        (assign_pair
          lhs: (sh_lhs_expr.Name name:awkarray)
          op: assign_op.Equal
          rhs: (word.Empty)
          spids: [660]
        )
      ]
    )
    (command.ShAssignment
      pairs: [(assign_pair lhs:(sh_lhs_expr.Name name:i) op:assign_op.Equal rhs:{<0>} spids:[662])]
    )
    (command.WhileUntil
      keyword: <Id.KW_While while>
      cond: 
        (condition.Shell
          commands: [
            (command.Sentence
              child: 
                (command.DParen
                  child: 
                    (arith_expr.Binary
                      op_id: Id.Arith_Less
                      left: <Id.Lit_ArithVarLike i>
                      right: <Id.Lit_ArithVarLike max_i>
                    )
                )
              terminator: <Id.Op_Semi _>
            )
          ]
        )
      body: 
        (command.DoGroup
          children: [
            (command.If
              arms: [
                (if_arm
                  cond: 
                    (condition.Shell
                      commands: [
                        (command.Sentence
                          child: 
                            (command.DParen
                              child: 
                                (arith_expr.Binary
                                  op_id: Id.Arith_DAmp
                                  left: <Id.Lit_ArithVarLike i>
                                  right: 
                                    (arith_expr.Binary
                                      op_id: Id.Arith_LessEqual
                                      left: 
                                        {
                                          (braced_var_sub
                                            token: <Id.VSub_Name buckets>
                                            bracket_op: 
                                              (bracket_op.ArrayIndex
                                                expr: {($ Id.VSub_DollarName '$i')}
                                              )
                                          )
                                        }
                                      right: 
                                        {
                                          (braced_var_sub
                                            token: <Id.VSub_Name buckets>
                                            bracket_op: 
                                              (bracket_op.ArrayIndex
                                                expr: 
                                                  (arith_expr.Binary
                                                    op_id: Id.Arith_Minus
                                                    left: {($ Id.VSub_DollarName '$i')}
                                                    right: {<Id.Lit_Digits 1>}
                                                  )
                                              )
                                          )
                                        }
                                    )
                                )
                            )
                          terminator: <Id.Op_Semi _>
                        )
                      ]
                    )
                  action: [(C {<die>} {(DQ <'ERROR: bucket list must increase in size.'>)})]
                  spids: [682 714]
                )
              ]
            )
            (command.ShAssignment
              pairs: [
                (assign_pair
                  lhs: (sh_lhs_expr.Name name:tpoints)
                  op: assign_op.Equal
                  rhs: 
                    {
                      (DQ ($ Id.VSub_DollarName '$tpoints') <' -e '> ($ Id.VSub_DollarName '$tpoint') 
                        <' --filter '> (word_part.EscapedLiteral token:<Id.Lit_EscapedChar '\\"'>) ($ Id.VSub_DollarName '$filter') <' '> 
                        ($ Id.VSub_DollarName '$var') <' >= '> 
                        (braced_var_sub
                          token: <Id.VSub_Name buckets>
                          bracket_op: (bracket_op.ArrayIndex expr:{($ Id.VSub_DollarName '$i')})
                        ) <' && '>
                      )
                    }
                  spids: [727]
                )
              ]
            )
            (command.ShAssignment
              pairs: [
                (assign_pair
                  lhs: (sh_lhs_expr.Name name:tpoints)
                  op: assign_op.Equal
                  rhs: 
                    {
                      (DQ ($ Id.VSub_DollarName '$tpoints') <' '> ($ Id.VSub_DollarName '$var') <' < '> 
                        (braced_var_sub
                          token: <Id.VSub_Name buckets>
                          bracket_op: 
                            (bracket_op.ArrayIndex
                              expr: 
                                (arith_expr.Binary
                                  op_id: Id.Arith_Plus
                                  left: {($ Id.VSub_DollarName '$i')}
                                  right: {<Id.Lit_Digits 1>}
                                )
                            )
                        ) (word_part.EscapedLiteral token:<Id.Lit_EscapedChar '\\"'>)
                      )
                    }
                  spids: [748]
                )
              ]
            )
            (command.ShAssignment
              pairs: [
                (assign_pair
                  lhs: (sh_lhs_expr.Name name:awkarray)
                  op: assign_op.Equal
                  rhs: 
                    {
                      (DQ ($ Id.VSub_DollarName '$awkarray') <' buckets['> ($ Id.VSub_DollarName '$i') 
                        <']='> 
                        (braced_var_sub
                          token: <Id.VSub_Name buckets>
                          bracket_op: (bracket_op.ArrayIndex expr:{($ Id.VSub_DollarName '$i')})
                        ) <';'>
                      )
                    }
                  spids: [768]
                )
              ]
            )
            (command.DParen
              child: (arith_expr.UnaryAssign op_id:Id.Node_PostDPlus child:<Id.Lit_ArithVarLike i>)
            )
          ]
        )
    )
    (command.ShAssignment
      pairs: [
        (assign_pair
          lhs: (sh_lhs_expr.Name name:awkarray)
          op: assign_op.Equal
          rhs: 
            {
              (DQ ($ Id.VSub_DollarName '$awkarray') <' buckets['> ($ Id.VSub_DollarName '$max_i') 
                <']='> 
                (braced_var_sub
                  token: <Id.VSub_Name buckets>
                  bracket_op: (bracket_op.ArrayIndex expr:{($ Id.VSub_DollarName '$max_i')})
                ) <';'>
              )
            }
          spids: [794]
        )
      ]
    )
    (command.ShAssignment
      pairs: [
        (assign_pair
          lhs: (sh_lhs_expr.Name name:tpoints)
          op: assign_op.Equal
          rhs: 
            {
              (DQ ($ Id.VSub_DollarName '$tpoints') <' -e '> ($ Id.VSub_DollarName '$tpoint') 
                <' --filter '> (word_part.EscapedLiteral token:<Id.Lit_EscapedChar '\\"'>) ($ Id.VSub_DollarName '$filter') <' '> 
                ($ Id.VSub_DollarName '$var') <' >= '> 
                (braced_var_sub
                  token: <Id.VSub_Name buckets>
                  bracket_op: (bracket_op.ArrayIndex expr:{($ Id.VSub_DollarName '$max_i')})
                ) (word_part.EscapedLiteral token:<Id.Lit_EscapedChar '\\"'>)
              )
            }
          spids: [809]
        )
      ]
    )
    (command.If
      arms: [
        (if_arm
          cond: 
            (condition.Shell
              commands: [
                (command.Sentence
                  child: (command.DParen child:<Id.Lit_ArithVarLike debug>)
                  terminator: <Id.Op_Semi _>
                )
              ]
            )
          action: [
            (C {<echo>} {<buckets> <Id.Lit_Colon ':'>} 
              {
                (braced_var_sub
                  token: <Id.VSub_Name buckets>
                  bracket_op: (bracket_op.WholeArray op_id:Id.Arith_Star)
                )
              }
            )
            (C {<echo>} {<tracepoints> <Id.Lit_Colon ':'>} {($ Id.VSub_DollarName '$tpoints')})
            (C {<echo>} {<awkarray> <Id.Lit_Colon ':'>} 
              {
                (braced_var_sub
                  token: <Id.VSub_Name awkarray>
                  bracket_op: (bracket_op.WholeArray op_id:Id.Arith_Star)
                )
              }
            )
          ]
          spids: [830 840]
        )
      ]
    )
    (command.If
      arms: [
        (if_arm
          cond: 
            (condition.Shell
              commands: [
                (command.Sentence
                  child: (command.DParen child:<Id.Lit_ArithVarLike duration>)
                  terminator: <Id.Op_Semi _>
                )
              ]
            )
          action: [
            (command.ShAssignment
              pairs: [
                (assign_pair
                  lhs: (sh_lhs_expr.Name name:etext)
                  op: assign_op.Equal
                  rhs: {(DQ <'for '> ($ Id.VSub_DollarName '$duration') <' seconds'>)}
                  spids: [895]
                )
              ]
            )
            (command.ShAssignment
              pairs: [
                (assign_pair
                  lhs: (sh_lhs_expr.Name name:cmd)
                  op: assign_op.Equal
                  rhs: {(DQ <'sleep '> ($ Id.VSub_DollarName '$duration'))}
                  spids: [903]
                )
              ]
            )
          ]
          spids: [882 892]
        )
      ]
      else_action: [
        (command.ShAssignment
          pairs: [
            (assign_pair
              lhs: (sh_lhs_expr.Name name:etext)
              op: assign_op.Equal
              rhs: {(DQ <'until Ctrl-C'>)}
              spids: [912]
            )
          ]
        )
        (command.ShAssignment
          pairs: [
            (assign_pair
              lhs: (sh_lhs_expr.Name name:cmd)
              op: assign_op.Equal
              rhs: {(DQ <'sleep 999999'>)}
              spids: [918]
            )
          ]
        )
      ]
    )
    (command.ShAssignment
      pairs: [
        (assign_pair
          lhs: (sh_lhs_expr.Name name:p_tpoint)
          op: assign_op.Equal
          rhs: {($ Id.VSub_DollarName '$tpoint')}
          spids: [926]
        )
      ]
    )
    (command.If
      arms: [
        (if_arm
          cond: 
            (condition.Shell
              commands: [
                (command.Sentence
                  child: 
                    (C {<Id.Lit_LBracket '['>} {<-n>} {(DQ ($ Id.VSub_DollarName '$filter'))} 
                      {<Id.Lit_RBracket ']'>}
                    )
                  terminator: <Id.Op_Semi _>
                )
              ]
            )
          action: [
            (command.ShAssignment
              pairs: [
                (assign_pair
                  lhs: (sh_lhs_expr.Name name:p_tpoint)
                  op: assign_op.Equal
                  rhs: 
                    {
                      (DQ ($ Id.VSub_DollarName '$tpoint') <' (Filter: '> 
                        (braced_var_sub
                          token: <Id.VSub_Name filter>
                          suffix_op: 
                            (suffix_op.Unary
                              tok: <Id.VOp1_Percent '%'>
                              arg_word: 
                                {<Id.Lit_Other '?'> <Id.Lit_Other '?'> <Id.Lit_Other '?'> 
                                  <Id.Lit_Other '?'>
                                }
                            )
                        ) <')'>
                      )
                    }
                  spids: [946]
                )
              ]
            )
          ]
          spids: [929 942]
        )
      ]
    )
    (command.If
      arms: [
        (if_arm
          cond: 
            (condition.Shell
              commands: [
                (command.Sentence
                  child: (command.DParen child:<Id.Lit_ArithVarLike opt_buckets>)
                  terminator: <Id.Op_Semi _>
                )
              ]
            )
          action: [
            (C {<echo>} 
              {
                (DQ <'Tracing '> ($ Id.VSub_DollarName '$p_tpoint') <', specified buckets, '> 
                  ($ Id.VSub_DollarName '$etext') <...>
                )
              }
            )
          ]
          spids: [964 974]
        )
      ]
      else_action: [
        (C {<echo>} 
          {
            (DQ <'Tracing '> ($ Id.VSub_DollarName '$p_tpoint') <', power-of-'> 
              ($ Id.VSub_DollarName '$power') <', max '> ($ Id.VSub_DollarName '$max') <', '> ($ Id.VSub_DollarName '$etext') <...>
            )
          }
        )
      ]
    )
    (command.ShAssignment
      pairs: [
        (assign_pair
          lhs: (sh_lhs_expr.Name name:out)
          op: assign_op.Equal
          rhs: {(DQ <'-o /dev/stdout'>)}
          spids: [1010]
        )
      ]
    )
    (command.ShAssignment
      pairs: [
        (assign_pair
          lhs: (sh_lhs_expr.Name name:stat)
          op: assign_op.Equal
          rhs: 
            {
              (command_sub
                left_token: <Id.Left_DollarParen '$('>
                child: 
                  (command.Simple
                    words: [
                      {<eval>}
                      {<perf>}
                      {<stat>}
                      {($ Id.VSub_DollarName '$tpoints')}
                      {<-a>}
                      {($ Id.VSub_DollarName '$out')}
                      {($ Id.VSub_DollarName '$cmd')}
                    ]
                    redirects: [(redir op:<Id.Redir_GreatAnd '2>&'> loc:(redir_loc.Fd fd:2) arg:{<1>})]
                    do_fork: T
                  )
              )
            }
          spids: [1018]
        )
      ]
    )
    (command.If
      arms: [
        (if_arm
          cond: 
            (condition.Shell
              commands: [
                (command.Sentence
                  child: 
                    (command.DParen
                      child: 
                        (arith_expr.Binary
                          op_id: Id.Arith_NEqual
                          left: {($ Id.VSub_QMark '$?')}
                          right: {<Id.Lit_Digits 0>}
                        )
                    )
                  terminator: <Id.Op_Semi _>
                )
              ]
            )
          action: [
            (command.Simple
              words: [{<echo>} {(DQ <'ERROR running perf:'>)}]
              redirects: [(redir op:<Id.Redir_GreatAnd '>&'> loc:(redir_loc.Fd fd:1) arg:{<2>})]
              do_fork: T
            )
            (command.Simple
              words: [{<echo>} {(DQ ($ Id.VSub_DollarName '$stat'))}]
              redirects: [(redir op:<Id.Redir_GreatAnd '>&'> loc:(redir_loc.Fd fd:1) arg:{<2>})]
              do_fork: T
            )
            (command.ControlFlow token:<Id.ControlFlow_Exit exit>)
          ]
          spids: [1038 1052]
        )
      ]
    )
    (command.If
      arms: [
        (if_arm
          cond: 
            (condition.Shell
              commands: [
                (command.Sentence
                  child: (command.DParen child:<Id.Lit_ArithVarLike debug>)
                  terminator: <Id.Op_Semi _>
                )
              ]
            )
          action: [
            (C {<echo>} {<raw>} {<output> <Id.Lit_Colon ':'>})
            (C {<echo>} {(DQ ($ Id.VSub_DollarName '$stat'))})
            (C {<echo>})
          ]
          spids: [1080 1090]
        )
      ]
    )
    (command.ShAssignment
      pairs: [
        (assign_pair
          lhs: (sh_lhs_expr.Name name:most)
          op: assign_op.Equal
          rhs: 
            {
              (command_sub
                left_token: <Id.Left_DollarParen '$('>
                child: 
                  (command.Pipeline
                    children: [
                      (C {<echo>} {(DQ ($ Id.VSub_DollarName '$stat'))})
                      (C {<awk>} {<-v>} {<Id.Lit_VarLike 'tpoint='> ($ Id.VSub_DollarName '$tpoint')} 
                        {
                          (SQ <'\n'> <'\t$2 == tpoint { gsub(/,/, ""); if ($1 > m) { m = $1 } }\n'> 
                            <'\tEND { print m }'>
                          )
                        }
                      )
                    ]
                    negated: F
                  )
              )
            }
          spids: [1116]
        )
      ]
    )
    (C {<echo>})
    (command.Pipeline
      children: [
        (C {<echo>} {(DQ ($ Id.VSub_DollarName '$stat'))})
        (C {<awk>} {<-v>} {<Id.Lit_VarLike 'tpoint='> ($ Id.VSub_DollarName '$tpoint')} {<-v>} 
          {<Id.Lit_VarLike 'max_i='> ($ Id.VSub_DollarName '$max_i')} {<-v>} {<Id.Lit_VarLike 'most='> ($ Id.VSub_DollarName '$most')} 
          {
            (SQ <'\n'> <'\tfunction star(sval, smax, swidth) {\n'> <'\t\tstars = ""\n'> 
              <'\t\tif (smax == 0) return ""\n'> <'\t\tfor (si = 0; si < (swidth * sval / smax); si++) {\n'> <'\t\t\tstars = stars "#"\n'> <'\t\t}\n'> 
              <'\t\treturn stars\n'> <'\t}\n'> <'\tBEGIN {\n'> <'\t\t'>
            ) (DQ ($ Id.VSub_DollarName '$awkarray')) 
            (SQ <'\n'> <'\t\tprintf("            %-15s: %-8s %s\\n", "Range", "Count",\n'> 
              <'\t\t    "Distribution")\n'> <'\t}\n'> <'\t/Performance counter stats/ { i = -1 }\n'> 
              <'\t# reverse order of rule set is important\n'> <'\t{ ok = 0 }\n'> <'\t$2 == tpoint { num = $1; gsub(/,/, "", num); ok = 1 }\n'> 
              <'\tok && i >= max_i {\n'> <'\t\tprintf("   %10d -> %-10s: %-8s |%-38s|\\n", buckets[i],\n'> 
              <'\t\t    "", num, star(num, most, 38))\n'> <'\t\tnext\n'> <'\t}\n'> <'\tok && i >= 0 && i < max_i {\n'> 
              <'\t\tprintf("   %10d -> %-10d: %-8s |%-38s|\\n", buckets[i],\n'> <'\t\t    buckets[i+1] - 1, num, star(num, most, 38))\n'> <'\t\ti++\n'> <'\t\tnext\n'> <'\t}\n'> 
              <'\tok && i == -1 {\n'> <'\t\tprintf("   %10s -> %-10d: %-8s |%-38s|\\n", "",\n'> 
              <'\t\t    buckets[0] - 1, num, star(num, most, 38))\n'> <'\t\ti++\n'> <'\t}\n'>
            )
          }
        )
      ]
      negated: F
    )
  ]
)