#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 atoi(char *);
int find(int, int);
int powe(int, int);
int /*<<< orphan*/ printf(char *, int, ...);
int main(int argc, char *argv[]) {
  int i, k;
  if (argc != 2)
    return 0;
  else {
    k = atoi(argv[1]);
    printf("N = %d\n", powe(2, k));
    int tmp[k + 1];
    for (i = 0; i <= k; i++) {
      tmp[i] = find(k, i);
      printf("Round %d : %d\n", i, tmp[i]);
    }
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpl   $0x2,-0x8(%rbp)
je     116c <main+0x2c>
movl   $0x0,-0x4(%rbp)
jmp    121b <main+0xdb>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
call   1060 <atoi@plt>
mov    %eax,-0x18(%rbp)
mov    -0x18(%rbp),%esi
mov    $0x2,%edi
call   1050 <powe@plt>
mov    %eax,%esi
lea    0xe6e(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %rsp,%rcx
mov    %rcx,-0x20(%rbp)
lea    0xf(,%rax,4),%rdx
and    $0xfffffffffffffff0,%rdx
mov    %rsp,%rcx
sub    %rdx,%rcx
mov    %rcx,-0x30(%rbp)
mov    %rcx,%rsp
mov    %rax,-0x28(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0x18(%rbp),%eax
jg     1214 <main+0xd4>
mov    -0x18(%rbp),%edi
mov    -0x14(%rbp),%esi
call   1040 <find@plt>
mov    %eax,%edx
mov    -0x30(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    %edx,(%rax,%rcx,4)
mov    -0x14(%rbp),%esi
movslq -0x14(%rbp),%rcx
mov    (%rax,%rcx,4),%edx
lea    0xe09(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    11ca <main+0x8a>
mov    -0x20(%rbp),%rax
mov    %rax,%rsp
mov    -0x4(%rbp),%eax
mov    %rbp,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
cmp    $0x2,%edi
jne    11ba <main+0x7a>
push   %rbp
push   %r15
push   %r14
push   %r12
push   %rbx
mov    0x8(%rsi),%rdi
call   1060 <atoi@plt>
mov    %eax,%r12d
mov    $0x2,%edi
mov    %eax,%esi
call   1050 <powe@plt>
lea    0xe94(%rip),%rdi
mov    %eax,%esi
xor    %eax,%eax
call   1030 <printf@plt>
mov    %rsp,%r15
test   %r12d,%r12d
js     11af <main+0x6f>
mov    %r12d,%ebx
add    $0x1,%ebx
lea    0xe7e(%rip),%r14
xor    %ebp,%ebp
nopl   0x0(%rax)
mov    %r12d,%edi
mov    %ebp,%esi
call   1040 <find@plt>
mov    %r14,%rdi
mov    %ebp,%esi
mov    %eax,%edx
xor    %eax,%eax
call   1030 <printf@plt>
add    $0x1,%ebp
cmp    %ebp,%ebx
jne    1190 <main+0x50>
mov    %r15,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
pop    %rbp
xor    %eax,%eax
ret

LLVM IR (-O0):
@.str = [8 x i8] c"N = %d\0A\00"
@.str.1 = [15 x i8] c"Round %d : %d\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
%7 = alloca i32
%8 = alloca i8*
%9 = alloca i64
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%10 = load i32, i32* %4
%11 = icmp ne i32 %10, 2
br i1 %11, label %12, label %13
12: ; preds = %2
store i32 0, i32* %3
br label %48
13: ; preds = %2
%14 = load i8**, i8*** %5
%15 = getelementptr inbounds i8*, i8** %14, i64 1
%16 = load i8*, i8** %15
%17 = call i32 @atoi(i8* %16)
store i32 %17, i32* %7
%18 = load i32, i32* %7
%19 = call i32 @powe(i32 2, i32 %18)
%20 = call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i32 %19)
%21 = load i32, i32* %7
%22 = add nsw i32 %21, 1
%23 = zext i32 %22 to i64
%24 = call i8* @llvm.stacksave()
store i8* %24, i8** %8
%25 = alloca i32, i64 %23
store i64 %23, i64* %9
store i32 0, i32* %6
br label %26
26: ; preds = %43, %13
%27 = load i32, i32* %6
%28 = load i32, i32* %7
%29 = icmp sle i32 %27, %28
br i1 %29, label %30, label %46
30: ; preds = %26
%31 = load i32, i32* %7
%32 = load i32, i32* %6
%33 = call i32 @find(i32 %31, i32 %32)
%34 = load i32, i32* %6
%35 = sext i32 %34 to i64
%36 = getelementptr inbounds i32, i32* %25, i64 %35
store i32 %33, i32* %36
%37 = load i32, i32* %6
%38 = load i32, i32* %6
%39 = sext i32 %38 to i64
%40 = getelementptr inbounds i32, i32* %25, i64 %39
%41 = load i32, i32* %40
%42 = call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.1, i64 0, i64 0), i32 %37, i32 %41)
br label %43
43: ; preds = %30
%44 = load i32, i32* %6
%45 = add nsw i32 %44, 1
store i32 %45, i32* %6
br label %26
46: ; preds = %26
%47 = load i8*, i8** %8
br label %48
48: ; preds = %12, %46
%49 = load i32, i32* %3
ret i32 %49
}

LLVM IR (-O2):
@.str = [8 x i8] c"N = %d\0A\00"
@.str.1 = [15 x i8] c"Round %d : %d\0A\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = icmp eq i32 %0, 2
br i1 %3, label %4, label %19
4: ; preds = %2
%5 = getelementptr inbounds i8*, i8** %1, i64 1
%6 = load i8*, i8** %5
%7 = tail call i32 @atoi(i8* %6)
%8 = tail call i32 @powe(i32 2, i32 %7)
%9 = tail call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i32 %8)
%10 = tail call i8* @llvm.stacksave()
%11 = icmp slt i32 %7, 0
br i1 %11, label %18, label %12
12: ; preds = %4, %12
%13 = phi i32 [ %16, %12 ], [ 0, %4 ]
%14 = tail call i32 @find(i32 %7, i32 %13)
%15 = tail call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.1, i64 0, i64 0), i32 %13, i32 %14)
%16 = add nuw i32 %13, 1
%17 = icmp eq i32 %13, %7
br i1 %17, label %18, label %12
18: ; preds = %12, %4
tail call void @llvm.stackrestore(i8* %10)
br label %19
19: ; preds = %2, %18
ret i32 0
}