#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 main() {
  int i = 0;
  int n = 0;
  while (1) {
    int m = i;
    while (m > -1) {
      printf("%i\n", ack(m, n));
      m--;
      n++;
    }
    i++;
    n = 0;
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0x10(%rbp)
cmpl   $0xffffffff,-0x10(%rbp)
jle    117d <main+0x5d>
mov    -0x10(%rbp),%edi
mov    -0xc(%rbp),%esi
call   1030 <ack@plt>
mov    %eax,%esi
lea    0xe9f(%rip),%rdi
call   1040 <printf@plt>
mov    -0x10(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x10(%rbp)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1143 <main+0x23>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
jmp    113d <main+0x1d>

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
xor    %r15d,%r15d
lea    0xecf(%rip),%r14
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    %r15d,%ebp
xor    %ebx,%ebx
cs nopw 0x0(%rax,%rax,1)
nop
mov    %ebp,%edi
mov    %ebx,%esi
call   1030 <ack@plt>
mov    %r14,%rdi
mov    %eax,%esi
call   1040 <printf@plt>
add    $0x1,%ebx
add    $0xffffffff,%ebp
jb     1150 <main+0x30>
add    $0x1,%r15d
jmp    1140 <main+0x20>

LLVM IR (-O0):
@.str = [4 x i8] c"%i\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 0, i32* %1
store i32 0, i32* %2
store i32 0, i32* %3
br label %5
5: ; preds = %0, %19
%6 = load i32, i32* %2
store i32 %6, i32* %4
br label %7
7: ; preds = %10, %5
%8 = load i32, i32* %4
%9 = icmp sgt i32 %8, -1
br i1 %9, label %10, label %19
10: ; preds = %7
%11 = load i32, i32* %4
%12 = load i32, i32* %3
%13 = call i32 @ack(i32 %11, i32 %12)
%14 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %13)
%15 = load i32, i32* %4
%16 = add nsw i32 %15, -1
store i32 %16, i32* %4
%17 = load i32, i32* %3
%18 = add nsw i32 %17, 1
store i32 %18, i32* %3
br label %7
19: ; preds = %7
%20 = load i32, i32* %2
%21 = add nsw i32 %20, 1
store i32 %21, i32* %2
store i32 0, i32* %3
br label %5
}

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