#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*/ printf(char *, ...);
void printPascal(int n) {
  for (int line = 1; line <= n; line++) {
    int C = 1;
    for (int i = 1; i <= line; i++) {
      printf("%d ", C);
      C = C * (line - i) / i;
    }
    printf("\n");
  }
}


x86 assembly (clang, -O0):
<printPascal>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
movl   $0x1,-0x8(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0x4(%rbp),%eax
jg     1196 <printPascal+0x86>
movl   $0x1,-0xc(%rbp)
movl   $0x1,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0x8(%rbp),%eax
jg     117a <printPascal+0x6a>
mov    -0xc(%rbp),%esi
lea    0xeae(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0xc(%rbp),%eax
mov    -0x8(%rbp),%ecx
sub    -0x10(%rbp),%ecx
imul   %ecx,%eax
cltd
idivl  -0x10(%rbp)
mov    %eax,-0xc(%rbp)
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    113c <printPascal+0x2c>
lea    0xe83(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1122 <printPascal+0x12>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<printPascal>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
mov    %edi,0x4(%rsp)
test   %edi,%edi
jle    119c <printPascal+0x7c>
addl   $0x1,0x4(%rsp)
mov    $0x2,%r15d
lea    0xebb(%rip),%r13
xor    %r14d,%r14d
nopl   0x0(%rax,%rax,1)
mov    $0x1,%ebx
mov    %r14d,%r12d
mov    $0x1,%ebp
nopl   (%rax)
mov    %r13,%rdi
mov    %ebp,%esi
xor    %eax,%eax
call   1040 <printf@plt>
imul   %r12d,%ebp
mov    %ebp,%eax
cltd
idiv   %ebx
add    $0x1,%ebx
mov    %eax,%ebp
add    $0xffffffff,%r12d
jb     1160 <printPascal+0x40>
mov    $0xa,%edi
call   1030 <putchar@plt>
lea    0x1(%r15),%eax
add    $0x1,%r14d
cmp    0x4(%rsp),%r15d
mov    %eax,%r15d
jne    1150 <printPascal+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"%d \00"
@.str.1 = [2 x i8] c"\0A\00"
define void @printPascal(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 %0, i32* %2
store i32 1, i32* %3
br label %6
6: ; preds = %30, %1
%7 = load i32, i32* %3
%8 = load i32, i32* %2
%9 = icmp sle i32 %7, %8
br i1 %9, label %10, label %33
10: ; preds = %6
store i32 1, i32* %4
store i32 1, i32* %5
br label %11
11: ; preds = %25, %10
%12 = load i32, i32* %5
%13 = load i32, i32* %3
%14 = icmp sle i32 %12, %13
br i1 %14, label %15, label %28
15: ; preds = %11
%16 = load i32, i32* %4
%17 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %16)
%18 = load i32, i32* %4
%19 = load i32, i32* %3
%20 = load i32, i32* %5
%21 = sub nsw i32 %19, %20
%22 = mul nsw i32 %18, %21
%23 = load i32, i32* %5
%24 = sdiv i32 %22, %23
store i32 %24, i32* %4
br label %25
25: ; preds = %15
%26 = load i32, i32* %5
%27 = add nsw i32 %26, 1
store i32 %27, i32* %5
br label %11
28: ; preds = %11
%29 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
br label %30
30: ; preds = %28
%31 = load i32, i32* %3
%32 = add nsw i32 %31, 1
store i32 %32, i32* %3
br label %6
33: ; preds = %6
ret void
}

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