#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 pascal() {
  int n, r, t;
  int N = 12;
  for (n = 0; n <= N; n++) {
    for (t = 0; t < (N - n); t++)
      printf("   ");
    for (r = 0; r <= n; r++)
      printf("%3ld   ", combi(n, r));
    printf("\n");
  }
}


x86 assembly (clang, -O0):
<pascal>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0xc,-0x10(%rbp)
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
cmp    -0x10(%rbp),%eax
jg     11ce <pascal+0xae>
movl   $0x0,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    -0x10(%rbp),%ecx
sub    -0x4(%rbp),%ecx
cmp    %ecx,%eax
jge    1176 <pascal+0x56>
lea    0xea3(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1149 <pascal+0x29>
movl   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0x4(%rbp),%eax
jg     11b2 <pascal+0x92>
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
call   1030 <combi@plt>
mov    %eax,%esi
lea    0xe63(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    117d <pascal+0x5d>
lea    0xe4f(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    1136 <pascal+0x16>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<pascal>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
mov    $0xc,%r12d
mov    $0x1,%r13d
lea    0xeb6(%rip),%r14
lea    0xeab(%rip),%r15
xor    %ebp,%ebp
nopw   0x0(%rax,%rax,1)
cmp    $0x2,%r12d
mov    $0x1,%ebx
cmovge %r12d,%ebx
cmp    $0xb,%ebp
ja     118f <pascal+0x5f>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
mov    %r14,%rdi
xor    %eax,%eax
call   1050 <printf@plt>
add    $0xffffffff,%ebx
jne    1180 <pascal+0x50>
xor    %ebx,%ebx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    %ebp,%edi
mov    %ebx,%esi
call   1040 <combi@plt>
mov    %r15,%rdi
mov    %eax,%esi
xor    %eax,%eax
call   1050 <printf@plt>
add    $0x1,%ebx
cmp    %ebx,%r13d
jne    11a0 <pascal+0x70>
mov    $0xa,%edi
call   1030 <putchar@plt>
add    $0x1,%ebp
add    $0xffffffff,%r12d
add    $0x1,%r13d
cmp    $0xd,%ebp
jne    1160 <pascal+0x30>
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [4 x i8] c" \00"
@.str.1 = [8 x i8] c"%3ld \00"
@.str.2 = [2 x i8] c"\0A\00"
define void @pascal() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 12, i32* %4
store i32 0, i32* %1
br label %5
5: ; preds = %36, %0
%6 = load i32, i32* %1
%7 = load i32, i32* %4
%8 = icmp sle i32 %6, %7
br i1 %8, label %9, label %39
9: ; preds = %5
store i32 0, i32* %3
br label %10
10: ; preds = %18, %9
%11 = load i32, i32* %3
%12 = load i32, i32* %4
%13 = load i32, i32* %1
%14 = sub nsw i32 %12, %13
%15 = icmp slt i32 %11, %14
br i1 %15, label %16, label %21
16: ; preds = %10
%17 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
br label %18
18: ; preds = %16
%19 = load i32, i32* %3
%20 = add nsw i32 %19, 1
store i32 %20, i32* %3
br label %10
21: ; preds = %10
store i32 0, i32* %2
br label %22
22: ; preds = %31, %21
%23 = load i32, i32* %2
%24 = load i32, i32* %1
%25 = icmp sle i32 %23, %24
br i1 %25, label %26, label %34
26: ; preds = %22
%27 = load i32, i32* %1
%28 = load i32, i32* %2
%29 = call i32 @combi(i32 %27, i32 %28)
%30 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0), i32 %29)
br label %31
31: ; preds = %26
%32 = load i32, i32* %2
%33 = add nsw i32 %32, 1
store i32 %33, i32* %2
br label %22
34: ; preds = %22
%35 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
br label %36
36: ; preds = %34
%37 = load i32, i32* %1
%38 = add nsw i32 %37, 1
store i32 %38, i32* %1
br label %5
39: ; preds = %5
ret void
}

LLVM IR (-O2):
@.str = [4 x i8] c" \00"
@.str.1 = [8 x i8] c"%3ld \00"
define void @pascal() {
br label %1
1: ; preds = %0, %19
%2 = phi i32 [ 1, %0 ], [ %23, %19 ]
%3 = phi i32 [ 12, %0 ], [ %22, %19 ]
%4 = phi i32 [ 0, %0 ], [ %21, %19 ]
%5 = call i32 @llvm.smax.i32(i32 %3, i32 1)
%6 = icmp ult i32 %4, 12
br i1 %6, label %7, label %12
7: ; preds = %1, %7
%8 = phi i32 [ %10, %7 ], [ 0, %1 ]
%9 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
%10 = add nuw nsw i32 %8, 1
%11 = icmp eq i32 %10, %5
br i1 %11, label %12, label %7
12: ; preds = %7, %1
br label %13
13: ; preds = %12, %13
%14 = phi i32 [ %17, %13 ], [ 0, %12 ]
%15 = tail call i32 @combi(i32 %4, i32 %14)
%16 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0), i32 %15)
%17 = add nuw nsw i32 %14, 1
%18 = icmp eq i32 %17, %2
br i1 %18, label %19, label %13
19: ; preds = %13
%20 = tail call i32 @putchar(i32 10)
%21 = add nuw nsw i32 %4, 1
%22 = add nsw i32 %3, -1
%23 = add nuw nsw i32 %2, 1
%24 = icmp eq i32 %21, 13
br i1 %24, label %25, label %1
25: ; preds = %19
ret void
}