#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 getPascal(int, int);
scalar_t__ pow(int, int);
int /*<<< orphan*/ printf(char *, ...);
void printPascal(int line) {
  for (int i = 0, n = line; i < line; i++, n--) {
    for (int j = 2 * n; j > 0; j--) {
      printf(" ");
    }
    for (int p = 0; p <= i; p++) {
      if (p > 1 && (getPascal(i, p - 1) > pow(10, 2)) &&
          (getPascal(i, p) > pow(10, 3)))
        printf(" ");
      printf("%4d", getPascal(i, p));
    }
    printf("\n");
  }
}


x86 assembly (clang, -O0):
<printPascal>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0x4(%rbp),%eax
jge    125f <printPascal+0x12f>
mov    -0xc(%rbp),%eax
shl    $0x1,%eax
mov    %eax,-0x10(%rbp)
cmpl   $0x0,-0x10(%rbp)
jle    1183 <printPascal+0x53>
lea    0xe92(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x10(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x10(%rbp)
jmp    115d <printPascal+0x2d>
movl   $0x0,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0x8(%rbp),%eax
jg     123a <printPascal+0x10a>
cmpl   $0x1,-0x14(%rbp)
jle    1211 <printPascal+0xe1>
mov    -0x8(%rbp),%edi
mov    -0x14(%rbp),%esi
sub    $0x1,%esi
call   1040 <getPascal@plt>
cltq
mov    %rax,-0x20(%rbp)
mov    $0xa,%edi
mov    $0x2,%esi
call   1050 <pow@plt>
mov    %rax,%rcx
mov    -0x20(%rbp),%rax
cmp    %rcx,%rax
jle    1211 <printPascal+0xe1>
mov    -0x8(%rbp),%edi
mov    -0x14(%rbp),%esi
call   1040 <getPascal@plt>
cltq
mov    %rax,-0x28(%rbp)
mov    $0xa,%edi
mov    $0x3,%esi
call   1050 <pow@plt>
mov    %rax,%rcx
mov    -0x28(%rbp),%rax
cmp    %rcx,%rax
jle    1211 <printPascal+0xe1>
lea    0xdf6(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x8(%rbp),%edi
mov    -0x14(%rbp),%esi
call   1040 <getPascal@plt>
mov    %eax,%esi
lea    0xddd(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    118a <printPascal+0x5a>
lea    0xdc5(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
mov    -0xc(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0xc(%rbp)
jmp    1148 <printPascal+0x18>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<printPascal>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x18,%rsp
mov    %rdi,0x10(%rsp)
test   %edi,%edi
jle    1296 <printPascal+0x156>
mov    0x10(%rsp),%rax
lea    (%rax,%rax,1),%ebx
add    $0x1,%ebx
mov    $0x1,%r13d
lea    0xe8d(%rip),%rbp
mov    %eax,%r14d
xor    %r12d,%r12d
jmp    11a8 <printPascal+0x68>
nopl   0x0(%rax,%rax,1)
mov    $0xa,%edi
call   1030 <putchar@plt>
add    $0x1,%r12d
add    $0xffffffff,%r14d
add    $0x1,%r13d
mov    0xc(%rsp),%ebx
add    $0xfffffffe,%ebx
cmp    0x10(%rsp),%r12d
je     1296 <printPascal+0x156>
mov    %ebx,0xc(%rsp)
test   %r14d,%r14d
jle    11d2 <printPascal+0x92>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    $0x20,%edi
call   1030 <putchar@plt>
add    $0xffffffff,%ebx
cmp    $0x1,%ebx
jg     11c0 <printPascal+0x80>
mov    %r12d,%edi
xor    %esi,%esi
call   1050 <getPascal@plt>
mov    %rbp,%rdi
mov    %eax,%esi
xor    %eax,%eax
call   1040 <printf@plt>
cmp    $0x1,%r13d
je     1180 <printPascal+0x40>
mov    %r12d,%edi
mov    $0x1,%esi
call   1050 <getPascal@plt>
mov    %rbp,%rdi
mov    %eax,%esi
xor    %eax,%eax
call   1040 <printf@plt>
cmp    $0x2,%r13d
je     1180 <printPascal+0x40>
mov    $0x1,%ebx
jmp    123f <printPascal+0xff>
nopl   0x0(%rax,%rax,1)
mov    %r12d,%edi
mov    %ebx,%esi
call   1050 <getPascal@plt>
mov    %rbp,%rdi
mov    %eax,%esi
xor    %eax,%eax
call   1040 <printf@plt>
cmp    %ebx,%r12d
je     1180 <printPascal+0x40>
mov    %ebx,%esi
lea    0x1(%rsi),%ebx
mov    %r12d,%edi
call   1050 <getPascal@plt>
movslq %eax,%r15
mov    $0xa,%edi
mov    $0x2,%esi
call   1060 <pow@plt>
cmp    %r15,%rax
jge    1220 <printPascal+0xe0>
mov    %r12d,%edi
mov    %ebx,%esi
call   1050 <getPascal@plt>
mov    %rbp,%r15
movslq %eax,%rbp
mov    $0xa,%edi
mov    $0x3,%esi
call   1060 <pow@plt>
cmp    %rbp,%rax
mov    %r15,%rbp
jge    1220 <printPascal+0xe0>
mov    $0x20,%edi
call   1030 <putchar@plt>
jmp    1220 <printPascal+0xe0>
add    $0x18,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [2 x i8] c" \00"
@.str.1 = [4 x i8] c"%4d\00"
@.str.2 = [2 x i8] c"\0A\00"
define void @printPascal(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32 %0, i32* %2
store i32 0, i32* %3
%7 = load i32, i32* %2
store i32 %7, i32* %4
br label %8
8: ; preds = %58, %1
%9 = load i32, i32* %3
%10 = load i32, i32* %2
%11 = icmp slt i32 %9, %10
br i1 %11, label %12, label %63
12: ; preds = %8
%13 = load i32, i32* %4
%14 = mul nsw i32 2, %13
store i32 %14, i32* %5
br label %15
15: ; preds = %20, %12
%16 = load i32, i32* %5
%17 = icmp sgt i32 %16, 0
br i1 %17, label %18, label %23
18: ; preds = %15
%19 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
br label %20
20: ; preds = %18
%21 = load i32, i32* %5
%22 = add nsw i32 %21, -1
store i32 %22, i32* %5
br label %15
23: ; preds = %15
store i32 0, i32* %6
br label %24
24: ; preds = %53, %23
%25 = load i32, i32* %6
%26 = load i32, i32* %3
%27 = icmp sle i32 %25, %26
br i1 %27, label %28, label %56
28: ; preds = %24
%29 = load i32, i32* %6
%30 = icmp sgt i32 %29, 1
br i1 %30, label %31, label %48
31: ; preds = %28
%32 = load i32, i32* %3
%33 = load i32, i32* %6
%34 = sub nsw i32 %33, 1
%35 = call i32 @getPascal(i32 %32, i32 %34)
%36 = sext i32 %35 to i64
%37 = call i64 @pow(i32 10, i32 2)
%38 = icmp sgt i64 %36, %37
br i1 %38, label %39, label %48
39: ; preds = %31
%40 = load i32, i32* %3
%41 = load i32, i32* %6
%42 = call i32 @getPascal(i32 %40, i32 %41)
%43 = sext i32 %42 to i64
%44 = call i64 @pow(i32 10, i32 3)
%45 = icmp sgt i64 %43, %44
br i1 %45, label %46, label %48
46: ; preds = %39
%47 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
br label %48
48: ; preds = %46, %39, %31, %28
%49 = load i32, i32* %3
%50 = load i32, i32* %6
%51 = call i32 @getPascal(i32 %49, i32 %50)
%52 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %51)
br label %53
53: ; preds = %48
%54 = load i32, i32* %6
%55 = add nsw i32 %54, 1
store i32 %55, i32* %6
br label %24
56: ; preds = %24
%57 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
br label %58
58: ; preds = %56
%59 = load i32, i32* %3
%60 = add nsw i32 %59, 1
store i32 %60, i32* %3
%61 = load i32, i32* %4
%62 = add nsw i32 %61, -1
store i32 %62, i32* %4
br label %8
63: ; preds = %8
ret void
}

LLVM IR (-O2):
@.str.1 = [4 x i8] c"%4d\00"
define void @printPascal(i32 %0) {
%2 = icmp sgt i32 %0, 0
br i1 %2, label %4, label %3
3: ; preds = %24, %1
ret void
4: ; preds = %1, %24
%5 = phi i32 [ %28, %24 ], [ 1, %1 ]
%6 = phi i32 [ %27, %24 ], [ %0, %1 ]
%7 = phi i32 [ %26, %24 ], [ 0, %1 ]
%8 = icmp sgt i32 %6, 0
br i1 %8, label %9, label %11
9: ; preds = %4
%10 = shl nuw nsw i32 %6, 1
br label %19
11: ; preds = %19, %4
%12 = tail call i32 @getPascal(i32 %7, i32 0)
%13 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %12)
%14 = icmp eq i32 %5, 1
br i1 %14, label %24, label %15
15: ; preds = %11
%16 = tail call i32 @getPascal(i32 %7, i32 1)
%17 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %16)
%18 = icmp eq i32 %5, 2
br i1 %18, label %24, label %30
19: ; preds = %9, %19
%20 = phi i32 [ %22, %19 ], [ %10, %9 ]
%21 = tail call i32 @putchar(i32 32)
%22 = add nsw i32 %20, -1
%23 = icmp sgt i32 %20, 1
br i1 %23, label %19, label %11
24: ; preds = %44, %15, %11
%25 = tail call i32 @putchar(i32 10)
%26 = add nuw nsw i32 %7, 1
%27 = add nsw i32 %6, -1
%28 = add nuw i32 %5, 1
%29 = icmp eq i32 %26, %0
br i1 %29, label %3, label %4
30: ; preds = %15, %44
%31 = phi i32 [ %47, %44 ], [ 2, %15 ]
%32 = add nsw i32 %31, -1
%33 = tail call i32 @getPascal(i32 %7, i32 %32)
%34 = sext i32 %33 to i64
%35 = tail call i64 @pow(i32 10, i32 2)
%36 = icmp slt i64 %35, %34
br i1 %36, label %37, label %44
37: ; preds = %30
%38 = tail call i32 @getPascal(i32 %7, i32 %31)
%39 = sext i32 %38 to i64
%40 = tail call i64 @pow(i32 10, i32 3)
%41 = icmp slt i64 %40, %39
br i1 %41, label %42, label %44
42: ; preds = %37
%43 = tail call i32 @putchar(i32 32)
br label %44
44: ; preds = %42, %37, %30
%45 = tail call i32 @getPascal(i32 %7, i32 %31)
%46 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %45)
%47 = add nuw nsw i32 %31, 1
%48 = icmp eq i32 %47, %5
br i1 %48, label %24, label %30
}