#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 fact(int);
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ scanf(char *, int *);
int main() {
  int n, i, j;
  scanf("%d", &n);
  for (i = 0; i < n; i++) {
    for (j = 0; j <= n - i - 2; j++) {
      printf(" ");
    }
    for (j = 0; j <= i; j++) {
      printf("%d ", fact(i) / (fact(i - j) * fact(j)));
    }
    printf("\n");
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeba(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1050 <scanf@plt>
movl   $0x0,-0xc(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    1215 <main+0xe5>
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
mov    -0x8(%rbp),%ecx
sub    -0xc(%rbp),%ecx
sub    $0x2,%ecx
cmp    %ecx,%eax
jg     1199 <main+0x69>
lea    0xe81(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1169 <main+0x39>
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jg     11f9 <main+0xc9>
mov    -0xc(%rbp),%edi
call   1040 <fact@plt>
mov    %eax,-0x14(%rbp)
mov    -0xc(%rbp),%edi
sub    -0x10(%rbp),%edi
call   1040 <fact@plt>
mov    %eax,-0x18(%rbp)
mov    -0x10(%rbp),%edi
call   1040 <fact@plt>
mov    -0x18(%rbp),%ecx
mov    %eax,%edx
mov    -0x14(%rbp),%eax
imul   %edx,%ecx
cltd
idiv   %ecx
mov    %eax,%esi
lea    0xe1f(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    11a0 <main+0x70>
lea    0xe07(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1156 <main+0x26>
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
lea    0xeae(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1060 <scanf@plt>
mov    0x4(%rsp),%eax
test   %eax,%eax
jle    1217 <main+0xd7>
lea    0xe94(%rip),%r14
xor    %r15d,%r15d
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
mov    $0xfffffffe,%ebx
sub    %r15d,%ebx
add    %ebx,%eax
js     11b7 <main+0x77>
mov    $0xffffffff,%ebp
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    $0x20,%edi
call   1030 <putchar@plt>
mov    0x4(%rsp),%eax
add    %ebx,%eax
add    $0x1,%ebp
cmp    %eax,%ebp
jl     11a0 <main+0x60>
xor    %ebx,%ebx
mov    %r15d,%ebp
nopl   0x0(%rax)
mov    %r15d,%edi
call   1050 <fact@plt>
mov    %eax,%r12d
mov    %ebp,%edi
call   1050 <fact@plt>
mov    %eax,%r13d
mov    %ebx,%edi
call   1050 <fact@plt>
mov    %eax,%ecx
imul   %r13d,%ecx
mov    %r12d,%eax
cltd
idiv   %ecx
mov    %r14,%rdi
mov    %eax,%esi
xor    %eax,%eax
call   1040 <printf@plt>
add    $0x1,%ebx
add    $0xffffffff,%ebp
jb     11c0 <main+0x80>
mov    $0xa,%edi
call   1030 <putchar@plt>
add    $0x1,%r15d
mov    0x4(%rsp),%eax
cmp    %eax,%r15d
jl     1180 <main+0x40>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

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

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
@.str.2 = [4 x i8] c"%d \00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %1)
%4 = load i32, i32* %1
%5 = icmp sgt i32 %4, 0
br i1 %5, label %6, label %38
6: ; preds = %0, %32
%7 = phi i32 [ %35, %32 ], [ %4, %0 ]
%8 = phi i32 [ %37, %32 ], [ 1, %0 ]
%9 = phi i32 [ %34, %32 ], [ 0, %0 ]
%10 = sub nuw nsw i32 -2, %9
%11 = add i32 %10, %7
%12 = icmp slt i32 %11, 0
br i1 %12, label %20, label %13
13: ; preds = %6, %13
%14 = phi i32 [ %16, %13 ], [ 0, %6 ]
%15 = call i32 @putchar(i32 32)
%16 = add nuw nsw i32 %14, 1
%17 = load i32, i32* %1
%18 = add i32 %10, %17
%19 = icmp slt i32 %14, %18
br i1 %19, label %13, label %20
20: ; preds = %13, %6
br label %21
21: ; preds = %20, %21
%22 = phi i32 [ %30, %21 ], [ 0, %20 ]
%23 = call i32 @fact(i32 %9)
%24 = sub nsw i32 %9, %22
%25 = call i32 @fact(i32 %24)
%26 = call i32 @fact(i32 %22)
%27 = mul nsw i32 %26, %25
%28 = sdiv i32 %23, %27
%29 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), i32 %28)
%30 = add nuw nsw i32 %22, 1
%31 = icmp eq i32 %30, %8
br i1 %31, label %32, label %21
32: ; preds = %21
%33 = call i32 @putchar(i32 10)
%34 = add nuw nsw i32 %9, 1
%35 = load i32, i32* %1
%36 = icmp slt i32 %34, %35
%37 = add nuw i32 %8, 1
br i1 %36, label %6, label %38
38: ; preds = %32, %0
ret i32 0
}