#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 ack(int, int);
int /*<<< orphan*/ printf(char *, int, int, int);
int main(int argc, char **argv) {
  int i, j;
  for (i = 0; i < 6; i++)
    for (j = 0; j < 6; j++)
      printf("ackerman (%d, %d) is: %d\n", i, j, ack(i, j));
  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)
movl   $0x0,-0x14(%rbp)
cmpl   $0x6,-0x14(%rbp)
jge    11a4 <main+0x84>
movl   $0x0,-0x18(%rbp)
cmpl   $0x6,-0x18(%rbp)
jge    1191 <main+0x71>
mov    -0x14(%rbp),%eax
mov    %eax,-0x20(%rbp)
mov    -0x18(%rbp),%eax
mov    %eax,-0x1c(%rbp)
mov    -0x14(%rbp),%edi
mov    -0x18(%rbp),%esi
call   1030 <ack@plt>
mov    -0x20(%rbp),%esi
mov    -0x1c(%rbp),%edx
mov    %eax,%ecx
lea    0xe82(%rip),%rdi
call   1040 <printf@plt>
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    114e <main+0x2e>
jmp    1196 <main+0x76>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    113d <main+0x1d>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
push   %rax
xor    %ebx,%ebx
lea    0xed3(%rip),%r14
nopl   (%rax)
mov    %ebx,%edi
xor    %esi,%esi
call   1030 <ack@plt>
mov    %r14,%rdi
mov    %ebx,%esi
xor    %edx,%edx
mov    %eax,%ecx
call   1040 <printf@plt>
mov    %ebx,%edi
mov    $0x1,%esi
call   1030 <ack@plt>
mov    %r14,%rdi
mov    %ebx,%esi
mov    $0x1,%edx
mov    %eax,%ecx
call   1040 <printf@plt>
mov    %ebx,%edi
mov    $0x2,%esi
call   1030 <ack@plt>
mov    %r14,%rdi
mov    %ebx,%esi
mov    $0x2,%edx
mov    %eax,%ecx
call   1040 <printf@plt>
mov    %ebx,%edi
mov    $0x3,%esi
call   1030 <ack@plt>
mov    %r14,%rdi
mov    %ebx,%esi
mov    $0x3,%edx
mov    %eax,%ecx
call   1040 <printf@plt>
mov    %ebx,%edi
mov    $0x4,%esi
call   1030 <ack@plt>
mov    %r14,%rdi
mov    %ebx,%esi
mov    $0x4,%edx
mov    %eax,%ecx
call   1040 <printf@plt>
mov    %ebx,%edi
mov    $0x5,%esi
call   1030 <ack@plt>
mov    %r14,%rdi
mov    %ebx,%esi
mov    $0x5,%edx
mov    %eax,%ecx
call   1040 <printf@plt>
add    $0x1,%ebx
cmp    $0x6,%ebx
jne    1130 <main+0x10>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [26 x i8] c"ackerman (%d, %d) is: %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
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i32 0, i32* %6
br label %8
8: ; preds = %26, %2
%9 = load i32, i32* %6
%10 = icmp slt i32 %9, 6
br i1 %10, label %11, label %29
11: ; preds = %8
store i32 0, i32* %7
br label %12
12: ; preds = %22, %11
%13 = load i32, i32* %7
%14 = icmp slt i32 %13, 6
br i1 %14, label %15, label %25
15: ; preds = %12
%16 = load i32, i32* %6
%17 = load i32, i32* %7
%18 = load i32, i32* %6
%19 = load i32, i32* %7
%20 = call i32 @ack(i32 %18, i32 %19)
%21 = call i32 @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0), i32 %16, i32 %17, i32 %20)
br label %22
22: ; preds = %15
%23 = load i32, i32* %7
%24 = add nsw i32 %23, 1
store i32 %24, i32* %7
br label %12
25: ; preds = %12
br label %26
26: ; preds = %25
%27 = load i32, i32* %6
%28 = add nsw i32 %27, 1
store i32 %28, i32* %6
br label %8
29: ; preds = %8
ret i32 0
}

LLVM IR (-O2):
@.str = [26 x i8] c"ackerman (%d, %d) is: %d\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
br label %3
3: ; preds = %2, %3
%4 = phi i32 [ 0, %2 ], [ %17, %3 ]
%5 = tail call i32 @ack(i32 %4, i32 0)
%6 = tail call i32 @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0), i32 %4, i32 0, i32 %5)
%7 = tail call i32 @ack(i32 %4, i32 1)
%8 = tail call i32 @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0), i32 %4, i32 1, i32 %7)
%9 = tail call i32 @ack(i32 %4, i32 2)
%10 = tail call i32 @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0), i32 %4, i32 2, i32 %9)
%11 = tail call i32 @ack(i32 %4, i32 3)
%12 = tail call i32 @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0), i32 %4, i32 3, i32 %11)
%13 = tail call i32 @ack(i32 %4, i32 4)
%14 = tail call i32 @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0), i32 %4, i32 4, i32 %13)
%15 = tail call i32 @ack(i32 %4, i32 5)
%16 = tail call i32 @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0), i32 %4, i32 5, i32 %15)
%17 = add nuw nsw i32 %4, 1
%18 = icmp eq i32 %17, 6
br i1 %18, label %19, label %3
19: ; preds = %3
ret i32 0
}