#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*/ combi(int, int);
int /*<<< orphan*/ printf(char *, ...);
void combinator_main() {
  int n, r;
  for (n = 0; n <= 5; n++) {
    for (r = 0; r <= n; r++) {
      printf("%d C %d=%ld  ", n, r, combi(n, r));
    }
    printf("\n");
  }
}


x86 assembly (clang, -O0):
<combinator_main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
cmpl   $0x5,-0x4(%rbp)
jg     11a3 <combinator_main+0x83>
movl   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0x4(%rbp),%eax
jg     1187 <combinator_main+0x67>
mov    -0x4(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
call   1030 <combi@plt>
mov    -0x10(%rbp),%esi
mov    -0xc(%rbp),%edx
mov    %eax,%ecx
lea    0xe8e(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1140 <combinator_main+0x20>
lea    0xe80(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    112f <combinator_main+0xf>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<combinator_main>:
push   %rbx
xor    %edi,%edi
xor    %esi,%esi
call   1040 <combi@plt>
lea    0xebf(%rip),%rbx
mov    %rbx,%rdi
xor    %esi,%esi
xor    %edx,%edx
mov    %eax,%ecx
xor    %eax,%eax
call   1050 <printf@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
mov    $0x1,%edi
xor    %esi,%esi
call   1040 <combi@plt>
mov    %rbx,%rdi
mov    $0x1,%esi
xor    %edx,%edx
mov    %eax,%ecx
xor    %eax,%eax
call   1050 <printf@plt>
mov    $0x1,%edi
mov    $0x1,%esi
call   1040 <combi@plt>
mov    %rbx,%rdi
mov    $0x1,%esi
mov    $0x1,%edx
mov    %eax,%ecx
xor    %eax,%eax
call   1050 <printf@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
mov    $0x2,%edi
xor    %esi,%esi
call   1040 <combi@plt>
mov    %rbx,%rdi
mov    $0x2,%esi
xor    %edx,%edx
mov    %eax,%ecx
xor    %eax,%eax
call   1050 <printf@plt>
mov    $0x2,%edi
mov    $0x1,%esi
call   1040 <combi@plt>
mov    %rbx,%rdi
mov    $0x2,%esi
mov    $0x1,%edx
mov    %eax,%ecx
xor    %eax,%eax
call   1050 <printf@plt>
mov    $0x2,%edi
mov    $0x2,%esi
call   1040 <combi@plt>
mov    %rbx,%rdi
mov    $0x2,%esi
mov    $0x2,%edx
mov    %eax,%ecx
xor    %eax,%eax
call   1050 <printf@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
mov    $0x3,%edi
xor    %esi,%esi
call   1040 <combi@plt>
mov    %rbx,%rdi
mov    $0x3,%esi
xor    %edx,%edx
mov    %eax,%ecx
xor    %eax,%eax
call   1050 <printf@plt>
mov    $0x3,%edi
mov    $0x1,%esi
call   1040 <combi@plt>
mov    %rbx,%rdi
mov    $0x3,%esi
mov    $0x1,%edx
mov    %eax,%ecx
xor    %eax,%eax
call   1050 <printf@plt>
mov    $0x3,%edi
mov    $0x2,%esi
call   1040 <combi@plt>
mov    %rbx,%rdi
mov    $0x3,%esi
mov    $0x2,%edx
mov    %eax,%ecx
xor    %eax,%eax
call   1050 <printf@plt>
mov    $0x3,%edi
mov    $0x3,%esi
call   1040 <combi@plt>
mov    %rbx,%rdi
mov    $0x3,%esi
mov    $0x3,%edx
mov    %eax,%ecx
xor    %eax,%eax
call   1050 <printf@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
mov    $0x4,%edi
xor    %esi,%esi
call   1040 <combi@plt>
mov    %rbx,%rdi
mov    $0x4,%esi
xor    %edx,%edx
mov    %eax,%ecx
xor    %eax,%eax
call   1050 <printf@plt>
mov    $0x4,%edi
mov    $0x1,%esi
call   1040 <combi@plt>
mov    %rbx,%rdi
mov    $0x4,%esi
mov    $0x1,%edx
mov    %eax,%ecx
xor    %eax,%eax
call   1050 <printf@plt>
mov    $0x4,%edi
mov    $0x2,%esi
call   1040 <combi@plt>
mov    %rbx,%rdi
mov    $0x4,%esi
mov    $0x2,%edx
mov    %eax,%ecx
xor    %eax,%eax
call   1050 <printf@plt>
mov    $0x4,%edi
mov    $0x3,%esi
call   1040 <combi@plt>
mov    %rbx,%rdi
mov    $0x4,%esi
mov    $0x3,%edx
mov    %eax,%ecx
xor    %eax,%eax
call   1050 <printf@plt>
mov    $0x4,%edi
mov    $0x4,%esi
call   1040 <combi@plt>
mov    %rbx,%rdi
mov    $0x4,%esi
mov    $0x4,%edx
mov    %eax,%ecx
xor    %eax,%eax
call   1050 <printf@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
mov    $0x5,%edi
xor    %esi,%esi
call   1040 <combi@plt>
mov    %rbx,%rdi
mov    $0x5,%esi
xor    %edx,%edx
mov    %eax,%ecx
xor    %eax,%eax
call   1050 <printf@plt>
mov    $0x5,%edi
mov    $0x1,%esi
call   1040 <combi@plt>
mov    %rbx,%rdi
mov    $0x5,%esi
mov    $0x1,%edx
mov    %eax,%ecx
xor    %eax,%eax
call   1050 <printf@plt>
mov    $0x5,%edi
mov    $0x2,%esi
call   1040 <combi@plt>
mov    %rbx,%rdi
mov    $0x5,%esi
mov    $0x2,%edx
mov    %eax,%ecx
xor    %eax,%eax
call   1050 <printf@plt>
mov    $0x5,%edi
mov    $0x3,%esi
call   1040 <combi@plt>
mov    %rbx,%rdi
mov    $0x5,%esi
mov    $0x3,%edx
mov    %eax,%ecx
xor    %eax,%eax
call   1050 <printf@plt>
mov    $0x5,%edi
mov    $0x4,%esi
call   1040 <combi@plt>
mov    %rbx,%rdi
mov    $0x5,%esi
mov    $0x4,%edx
mov    %eax,%ecx
xor    %eax,%eax
call   1050 <printf@plt>
mov    $0x5,%edi
mov    $0x5,%esi
call   1040 <combi@plt>
mov    %rbx,%rdi
mov    $0x5,%esi
mov    $0x5,%edx
mov    %eax,%ecx
xor    %eax,%eax
call   1050 <printf@plt>
mov    $0xa,%edi
pop    %rbx
jmp    1030 <putchar@plt>

LLVM IR (-O0):
@.str = [14 x i8] c"%d C %d=%ld \00"
@.str.1 = [2 x i8] c"\0A\00"
define void @combinator_main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
br label %3
3: ; preds = %23, %0
%4 = load i32, i32* %1
%5 = icmp sle i32 %4, 5
br i1 %5, label %6, label %26
6: ; preds = %3
store i32 0, i32* %2
br label %7
7: ; preds = %18, %6
%8 = load i32, i32* %2
%9 = load i32, i32* %1
%10 = icmp sle i32 %8, %9
br i1 %10, label %11, label %21
11: ; preds = %7
%12 = load i32, i32* %1
%13 = load i32, i32* %2
%14 = load i32, i32* %1
%15 = load i32, i32* %2
%16 = call i32 @combi(i32 %14, i32 %15)
%17 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i32 %12, i32 %13, i32 %16)
br label %18
18: ; preds = %11
%19 = load i32, i32* %2
%20 = add nsw i32 %19, 1
store i32 %20, i32* %2
br label %7
21: ; preds = %7
%22 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
br label %23
23: ; preds = %21
%24 = load i32, i32* %1
%25 = add nsw i32 %24, 1
store i32 %25, i32* %1
br label %3
26: ; preds = %3
ret void
}

LLVM IR (-O2):
@.str = [14 x i8] c"%d C %d=%ld \00"
define void @combinator_main() {
%1 = tail call i32 @combi(i32 0, i32 0)
%2 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i32 0, i32 0, i32 %1)
%3 = tail call i32 @putchar(i32 10)
%4 = tail call i32 @combi(i32 1, i32 0)
%5 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i32 1, i32 0, i32 %4)
%6 = tail call i32 @combi(i32 1, i32 1)
%7 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i32 1, i32 1, i32 %6)
%8 = tail call i32 @putchar(i32 10)
%9 = tail call i32 @combi(i32 2, i32 0)
%10 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i32 2, i32 0, i32 %9)
%11 = tail call i32 @combi(i32 2, i32 1)
%12 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i32 2, i32 1, i32 %11)
%13 = tail call i32 @combi(i32 2, i32 2)
%14 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i32 2, i32 2, i32 %13)
%15 = tail call i32 @putchar(i32 10)
%16 = tail call i32 @combi(i32 3, i32 0)
%17 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i32 3, i32 0, i32 %16)
%18 = tail call i32 @combi(i32 3, i32 1)
%19 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i32 3, i32 1, i32 %18)
%20 = tail call i32 @combi(i32 3, i32 2)
%21 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i32 3, i32 2, i32 %20)
%22 = tail call i32 @combi(i32 3, i32 3)
%23 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i32 3, i32 3, i32 %22)
%24 = tail call i32 @putchar(i32 10)
%25 = tail call i32 @combi(i32 4, i32 0)
%26 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i32 4, i32 0, i32 %25)
%27 = tail call i32 @combi(i32 4, i32 1)
%28 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i32 4, i32 1, i32 %27)
%29 = tail call i32 @combi(i32 4, i32 2)
%30 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i32 4, i32 2, i32 %29)
%31 = tail call i32 @combi(i32 4, i32 3)
%32 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i32 4, i32 3, i32 %31)
%33 = tail call i32 @combi(i32 4, i32 4)
%34 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i32 4, i32 4, i32 %33)
%35 = tail call i32 @putchar(i32 10)
%36 = tail call i32 @combi(i32 5, i32 0)
%37 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i32 5, i32 0, i32 %36)
%38 = tail call i32 @combi(i32 5, i32 1)
%39 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i32 5, i32 1, i32 %38)
%40 = tail call i32 @combi(i32 5, i32 2)
%41 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i32 5, i32 2, i32 %40)
%42 = tail call i32 @combi(i32 5, i32 3)
%43 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i32 5, i32 3, i32 %42)
%44 = tail call i32 @combi(i32 5, i32 4)
%45 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i32 5, i32 4, i32 %44)
%46 = tail call i32 @combi(i32 5, i32 5)
%47 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i32 5, i32 5, i32 %46)
%48 = tail call i32 @putchar(i32 10)
ret void
}