#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 INT_MAX;
int atoi(char *);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, ...);
int /*<<< orphan*/ plot_exponent(int, int);
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ stderr;
int main(int argc, char **argv) {
  int q, n;
  printf("#Maximum integer is %d data incorrect is the argument is larger\n",
         INT_MAX);
  printf("#m\teven\todd\ttotal\n");
  fprintf(stderr,
          "Maximum integer is %d data incorrect is the argument is larger\n",
          INT_MAX);
  if (argc < 3) {
    fprintf(stderr, "usage: %s q n", argv[0]);
    return 1;
  }
  q = atoi(argv[1]);
  n = atoi(argv[2]);
  plot_exponent(q, n);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    0x2e8b(%rip),%rax
mov    (%rax),%esi
lea    0xe9a(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xecd(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    0x2e56(%rip),%rax
mov    (%rax),%edi
mov    0x2e5d(%rip),%rax
mov    (%rax),%edx
lea    0xe6d(%rip),%rsi
mov    $0x0,%al
call   1040 <fprintf@plt>
cmpl   $0x3,-0x8(%rbp)
jge    11cf <main+0x8f>
mov    0x2e2c(%rip),%rax
mov    (%rax),%edi
mov    -0x10(%rbp),%rax
mov    (%rax),%rdx
lea    0xe98(%rip),%rsi
mov    $0x0,%al
call   1040 <fprintf@plt>
movl   $0x1,-0x4(%rbp)
jmp    1201 <main+0xc1>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
call   1060 <atoi@plt>
mov    %eax,-0x14(%rbp)
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rdi
call   1060 <atoi@plt>
mov    %eax,-0x18(%rbp)
mov    -0x14(%rbp),%edi
mov    -0x18(%rbp),%esi
call   1050 <plot_exponent@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r12
push   %rbx
mov    %rsi,%rbx
mov    %edi,%ebp
mov    0x2e84(%rip),%r12
mov    (%r12),%esi
lea    0xe91(%rip),%rdi
xor    %r14d,%r14d
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xecf(%rip),%rdi
call   1030 <puts@plt>
mov    0x2e4c(%rip),%r15
mov    (%r15),%edi
mov    (%r12),%edx
lea    0xe67(%rip),%rsi
xor    %eax,%eax
call   1050 <fprintf@plt>
cmp    $0x2,%ebp
jg     11c2 <main+0x72>
mov    (%r15),%edi
mov    (%rbx),%rdx
lea    0xe8e(%rip),%rsi
xor    %eax,%eax
call   1050 <fprintf@plt>
mov    $0x1,%r14d
jmp    11df <main+0x8f>
mov    0x8(%rbx),%rdi
call   1070 <atoi@plt>
mov    %eax,%ebp
mov    0x10(%rbx),%rdi
call   1070 <atoi@plt>
mov    %ebp,%edi
mov    %eax,%esi
call   1060 <plot_exponent@plt>
mov    %r14d,%eax
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [65 x i8] c"#Maximum integer is %d data incorrect is the argument is larger\0A\00"
@INT_MAX = global i32 0
@.str.1 = [19 x i8] c"#m\09even\09odd\09total\0A\00"
@stderr = global i32 0
@.str.2 = [64 x i8] c"Maximum integer is %d data incorrect is the argument is larger\0A\00"
@.str.3 = [14 x i8] c"usage: %s q n\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
%7 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%8 = load i32, i32* @INT_MAX
%9 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([65 x i8], [65 x i8]* @.str, i64 0, i64 0), i32 %8)
%10 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.1, i64 0, i64 0))
%11 = load i32, i32* @stderr
%12 = load i32, i32* @INT_MAX
%13 = call i32 (i32, i8*, ...) @fprintf(i32 %11, i8* getelementptr inbounds ([64 x i8], [64 x i8]* @.str.2, i64 0, i64 0), i32 %12)
%14 = load i32, i32* %4
%15 = icmp slt i32 %14, 3
br i1 %15, label %16, label %22
16: ; preds = %2
%17 = load i32, i32* @stderr
%18 = load i8**, i8*** %5
%19 = getelementptr inbounds i8*, i8** %18, i64 0
%20 = load i8*, i8** %19
%21 = call i32 (i32, i8*, ...) @fprintf(i32 %17, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.3, i64 0, i64 0), i8* %20)
store i32 1, i32* %3
br label %34
22: ; preds = %2
%23 = load i8**, i8*** %5
%24 = getelementptr inbounds i8*, i8** %23, i64 1
%25 = load i8*, i8** %24
%26 = call i32 @atoi(i8* %25)
store i32 %26, i32* %6
%27 = load i8**, i8*** %5
%28 = getelementptr inbounds i8*, i8** %27, i64 2
%29 = load i8*, i8** %28
%30 = call i32 @atoi(i8* %29)
store i32 %30, i32* %7
%31 = load i32, i32* %6
%32 = load i32, i32* %7
%33 = call i32 @plot_exponent(i32 %31, i32 %32)
store i32 0, i32* %3
br label %34
34: ; preds = %22, %16
%35 = load i32, i32* %3
ret i32 %35
}

LLVM IR (-O2):
@.str = [65 x i8] c"#Maximum integer is %d data incorrect is the argument is larger\0A\00"
@INT_MAX = global i32 0
@stderr = global i32 0
@.str.2 = [64 x i8] c"Maximum integer is %d data incorrect is the argument is larger\0A\00"
@.str.3 = [14 x i8] c"usage: %s q n\00"
@str = [18 x i8] c"#m\09even\09odd\09total\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = load i32, i32* @INT_MAX
%4 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([65 x i8], [65 x i8]* @.str, i64 0, i64 0), i32 %3)
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @str, i64 0, i64 0))
%6 = load i32, i32* @stderr
%7 = load i32, i32* @INT_MAX
%8 = tail call i32 (i32, i8*, ...) @fprintf(i32 %6, i8* getelementptr inbounds ([64 x i8], [64 x i8]* @.str.2, i64 0, i64 0), i32 %7)
%9 = icmp slt i32 %0, 3
br i1 %9, label %10, label %14
10: ; preds = %2
%11 = load i32, i32* @stderr
%12 = load i8*, i8** %1
%13 = tail call i32 (i32, i8*, ...) @fprintf(i32 %11, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.3, i64 0, i64 0), i8* %12)
br label %22
14: ; preds = %2
%15 = getelementptr inbounds i8*, i8** %1, i64 1
%16 = load i8*, i8** %15
%17 = tail call i32 @atoi(i8* %16)
%18 = getelementptr inbounds i8*, i8** %1, i64 2
%19 = load i8*, i8** %18
%20 = tail call i32 @atoi(i8* %19)
%21 = tail call i32 @plot_exponent(i32 %17, i32 %20)
br label %22
22: ; preds = %14, %10
%23 = phi i32 [ 1, %10 ], [ 0, %14 ]
ret i32 %23
}