#define NULL ((void *)0)
typedef unsigned long size_t; // Customize by platform.
typedef long intptr_t;
typedef unsigned long uintptr_t;
typedef long scalar_t__; // Either arithmetic or pointer type.
/* By default, we understand bool (as a convenience). */
typedef int bool;
#define false 0
#define true 1

/* Forward declarations */

/* Type definitions */

/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
void show_l2_counters_help(void) {
  int i = 1;
  printf("cpu l2 counter type can be one of the below, make sure no error is "
         "recieved\n");
  printf("%d: MV_CPU_L2_CNTRS_DATA_REQ\n", i++);
  printf("%d: MV_CPU_L2_CNTRS_DATA_MISS_REQ\n", i++);
  printf("%d: MV_CPU_L2_CNTRS_INST_REQ\n", i++);
  printf("%d: MV_CPU_L2_CNTRS_INST_MISS_REQ\n", i++);
  printf("%d: MV_CPU_L2_CNTRS_DATA_READ_REQ\n", i++);
  printf("%d: MV_CPU_L2_CNTRS_DATA_READ_MISS_REQ\n", i++);
  printf("%d: MV_CPU_L2_CNTRS_DATA_WRITE_REQ\n", i++);
  printf("%d: MV_CPU_L2_CNTRS_DATA_WRITE_MISS_REQ\n", i++);
  printf("%d: MV_CPU_L2_CNTRS_RESERVED\n", i++);
  printf("%d: MV_CPU_L2_CNTRS_DIRTY_EVICT_REQ\n", i++);
  printf("%d: MV_CPU_L2_CNTRS_EVICT_BUFF_STALL\n", i++);
  printf("%d: MV_CPU_L2_CNTRS_ACTIVE_CYCLES\n", i++);
}


x86 assembly (clang, -O0):
<show_l2_counters_help>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x1,-0x4(%rbp)
lea    0xeda(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x4(%rbp),%esi
mov    %esi,%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
lea    0xf0e(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x4(%rbp),%esi
mov    %esi,%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
lea    0xf13(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x4(%rbp),%esi
mov    %esi,%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
lea    0xf1d(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x4(%rbp),%esi
mov    %esi,%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
lea    0xf22(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x4(%rbp),%esi
mov    %esi,%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
lea    0xf2c(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x4(%rbp),%esi
mov    %esi,%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
lea    0xf36(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x4(%rbp),%esi
mov    %esi,%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
lea    0xf45(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x4(%rbp),%esi
mov    %esi,%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
lea    0xf50(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x4(%rbp),%esi
mov    %esi,%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
lea    0xf60(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x4(%rbp),%esi
mov    %esi,%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
lea    0xf65(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x4(%rbp),%esi
mov    %esi,%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
lea    0xf71(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x4(%rbp),%esi
mov    %esi,%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
lea    0xf7e(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<show_l2_counters_help>:
push   %rax
lea    0x107e(%rip),%rdi
call   1030 <puts@plt>
lea    0xecc(%rip),%rdi
mov    $0x1,%esi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xed7(%rip),%rdi
mov    $0x2,%esi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xee7(%rip),%rdi
mov    $0x3,%esi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xef2(%rip),%rdi
mov    $0x4,%esi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xf02(%rip),%rdi
mov    $0x5,%esi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xf12(%rip),%rdi
mov    $0x6,%esi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xf27(%rip),%rdi
mov    $0x7,%esi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xf38(%rip),%rdi
mov    $0x8,%esi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xf4e(%rip),%rdi
mov    $0x9,%esi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xf59(%rip),%rdi
mov    $0xa,%esi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xf6b(%rip),%rdi
mov    $0xb,%esi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xf7e(%rip),%rdi
mov    $0xc,%esi
xor    %eax,%eax
pop    %rcx
jmp    1040 <printf@plt>

LLVM IR (-O0):
@.str = [77 x i8] c"cpu l2 counter type can be one of the below, make sure no error is recieved\0A\00"
@.str.1 = [30 x i8] c"%d: MV_CPU_L2_CNTRS_DATA_REQ\0A\00"
@.str.2 = [35 x i8] c"%d: MV_CPU_L2_CNTRS_DATA_MISS_REQ\0A\00"
@.str.3 = [30 x i8] c"%d: MV_CPU_L2_CNTRS_INST_REQ\0A\00"
@.str.4 = [35 x i8] c"%d: MV_CPU_L2_CNTRS_INST_MISS_REQ\0A\00"
@.str.5 = [35 x i8] c"%d: MV_CPU_L2_CNTRS_DATA_READ_REQ\0A\00"
@.str.6 = [40 x i8] c"%d: MV_CPU_L2_CNTRS_DATA_READ_MISS_REQ\0A\00"
@.str.7 = [36 x i8] c"%d: MV_CPU_L2_CNTRS_DATA_WRITE_REQ\0A\00"
@.str.8 = [41 x i8] c"%d: MV_CPU_L2_CNTRS_DATA_WRITE_MISS_REQ\0A\00"
@.str.9 = [30 x i8] c"%d: MV_CPU_L2_CNTRS_RESERVED\0A\00"
@.str.10 = [37 x i8] c"%d: MV_CPU_L2_CNTRS_DIRTY_EVICT_REQ\0A\00"
@.str.11 = [38 x i8] c"%d: MV_CPU_L2_CNTRS_EVICT_BUFF_STALL\0A\00"
@.str.12 = [35 x i8] c"%d: MV_CPU_L2_CNTRS_ACTIVE_CYCLES\0A\00"
define void @show_l2_counters_help() {
%1 = alloca i32
store i32 1, i32* %1
%2 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([77 x i8], [77 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* %1
%4 = add nsw i32 %3, 1
store i32 %4, i32* %1
%5 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.1, i64 0, i64 0), i32 %3)
%6 = load i32, i32* %1
%7 = add nsw i32 %6, 1
store i32 %7, i32* %1
%8 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str.2, i64 0, i64 0), i32 %6)
%9 = load i32, i32* %1
%10 = add nsw i32 %9, 1
store i32 %10, i32* %1
%11 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.3, i64 0, i64 0), i32 %9)
%12 = load i32, i32* %1
%13 = add nsw i32 %12, 1
store i32 %13, i32* %1
%14 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str.4, i64 0, i64 0), i32 %12)
%15 = load i32, i32* %1
%16 = add nsw i32 %15, 1
store i32 %16, i32* %1
%17 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str.5, i64 0, i64 0), i32 %15)
%18 = load i32, i32* %1
%19 = add nsw i32 %18, 1
store i32 %19, i32* %1
%20 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str.6, i64 0, i64 0), i32 %18)
%21 = load i32, i32* %1
%22 = add nsw i32 %21, 1
store i32 %22, i32* %1
%23 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str.7, i64 0, i64 0), i32 %21)
%24 = load i32, i32* %1
%25 = add nsw i32 %24, 1
store i32 %25, i32* %1
%26 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str.8, i64 0, i64 0), i32 %24)
%27 = load i32, i32* %1
%28 = add nsw i32 %27, 1
store i32 %28, i32* %1
%29 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.9, i64 0, i64 0), i32 %27)
%30 = load i32, i32* %1
%31 = add nsw i32 %30, 1
store i32 %31, i32* %1
%32 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str.10, i64 0, i64 0), i32 %30)
%33 = load i32, i32* %1
%34 = add nsw i32 %33, 1
store i32 %34, i32* %1
%35 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str.11, i64 0, i64 0), i32 %33)
%36 = load i32, i32* %1
%37 = add nsw i32 %36, 1
store i32 %37, i32* %1
%38 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str.12, i64 0, i64 0), i32 %36)
ret void
}

LLVM IR (-O2):
@.str.1 = [30 x i8] c"%d: MV_CPU_L2_CNTRS_DATA_REQ\0A\00"
@.str.2 = [35 x i8] c"%d: MV_CPU_L2_CNTRS_DATA_MISS_REQ\0A\00"
@.str.3 = [30 x i8] c"%d: MV_CPU_L2_CNTRS_INST_REQ\0A\00"
@.str.4 = [35 x i8] c"%d: MV_CPU_L2_CNTRS_INST_MISS_REQ\0A\00"
@.str.5 = [35 x i8] c"%d: MV_CPU_L2_CNTRS_DATA_READ_REQ\0A\00"
@.str.6 = [40 x i8] c"%d: MV_CPU_L2_CNTRS_DATA_READ_MISS_REQ\0A\00"
@.str.7 = [36 x i8] c"%d: MV_CPU_L2_CNTRS_DATA_WRITE_REQ\0A\00"
@.str.8 = [41 x i8] c"%d: MV_CPU_L2_CNTRS_DATA_WRITE_MISS_REQ\0A\00"
@.str.9 = [30 x i8] c"%d: MV_CPU_L2_CNTRS_RESERVED\0A\00"
@.str.10 = [37 x i8] c"%d: MV_CPU_L2_CNTRS_DIRTY_EVICT_REQ\0A\00"
@.str.11 = [38 x i8] c"%d: MV_CPU_L2_CNTRS_EVICT_BUFF_STALL\0A\00"
@.str.12 = [35 x i8] c"%d: MV_CPU_L2_CNTRS_ACTIVE_CYCLES\0A\00"
@str = [76 x i8] c"cpu l2 counter type can be one of the below, make sure no error is recieved\00"
define void @show_l2_counters_help() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([76 x i8], [76 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([30 x i8], [30 x i8]* @.str.1, i64 0, i64 0), i32 1)
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([35 x i8], [35 x i8]* @.str.2, i64 0, i64 0), i32 2)
%4 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([30 x i8], [30 x i8]* @.str.3, i64 0, i64 0), i32 3)
%5 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([35 x i8], [35 x i8]* @.str.4, i64 0, i64 0), i32 4)
%6 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([35 x i8], [35 x i8]* @.str.5, i64 0, i64 0), i32 5)
%7 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([40 x i8], [40 x i8]* @.str.6, i64 0, i64 0), i32 6)
%8 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([36 x i8], [36 x i8]* @.str.7, i64 0, i64 0), i32 7)
%9 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([41 x i8], [41 x i8]* @.str.8, i64 0, i64 0), i32 8)
%10 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([30 x i8], [30 x i8]* @.str.9, i64 0, i64 0), i32 9)
%11 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([37 x i8], [37 x i8]* @.str.10, i64 0, i64 0), i32 10)
%12 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([38 x i8], [38 x i8]* @.str.11, i64 0, i64 0), i32 11)
%13 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([35 x i8], [35 x i8]* @.str.12, i64 0, i64 0), i32 12)
ret void
}