#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 */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
scalar_t__ EOF;
int /*<<< orphan*/ *fopen(char *, char *);
scalar_t__ fscanf(int /*<<< orphan*/ *, char *, int *);
int /*<<< orphan*/ printf(char *, ...);
int main(int argc, char *argv[]) {
  FILE *fp;
  int a;
  if (argc != 2) {
    printf("Usage: %s [FILE]\n", argv[0]);
    return 1;
  }
  fp = fopen(*++argv, "r");
  while (fscanf(fp, "%d", &a) != EOF) {
    int i;
    printf("1");
    for (i = 1; i < a; i++) {
      int j, r = 1;
      printf(" 1");
      for (j = 1; j <= i; j++) {
        r = (r * (i + 1 - j)) / j;
        printf(" %d", r);
      }
    }
    printf("\n");
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpl   $0x2,-0x8(%rbp)
je     1171 <main+0x41>
mov    -0x10(%rbp),%rax
mov    (%rax),%rsi
lea    0xea2(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x1,-0x4(%rbp)
jmp    1263 <main+0x133>
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x8,%rcx
mov    %rcx,-0x10(%rbp)
mov    0x8(%rax),%rdi
lea    0xe87(%rip),%rsi
call   1050 <fopen@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
lea    0xe79(%rip),%rsi
lea    -0x1c(%rbp),%rdx
call   1040 <fscanf@plt>
mov    0x2e39(%rip),%rcx
cmp    (%rcx),%rax
je     125c <main+0x12c>
lea    0xe56(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x1,-0x20(%rbp)
mov    -0x20(%rbp),%eax
cmp    -0x1c(%rbp),%eax
jge    1249 <main+0x119>
movl   $0x1,-0x28(%rbp)
lea    0xe2d(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x1,-0x24(%rbp)
mov    -0x24(%rbp),%eax
cmp    -0x20(%rbp),%eax
jg     1236 <main+0x106>
mov    -0x28(%rbp),%eax
mov    -0x20(%rbp),%ecx
add    $0x1,%ecx
sub    -0x24(%rbp),%ecx
imul   %ecx,%eax
cltd
idivl  -0x24(%rbp)
mov    %eax,-0x28(%rbp)
mov    -0x28(%rbp),%esi
lea    0xdf6(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x24(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x24(%rbp)
jmp    11f5 <main+0xc5>
jmp    123b <main+0x10b>
mov    -0x20(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x20(%rbp)
jmp    11cd <main+0x9d>
lea    0xdc0(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    1194 <main+0x64>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x18,%rsp
cmp    $0x2,%edi
jne    124e <main+0x10e>
mov    0x8(%rsi),%rdi
lea    0xeb0(%rip),%rsi
call   1060 <fopen@plt>
lea    0xeaa(%rip),%rsi
lea    0xc(%rsp),%rdx
mov    %rax,0x10(%rsp)
mov    %rax,%rdi
call   1050 <fscanf@plt>
mov    %rax,%rcx
mov    0x2e5e(%rip),%rdx
xor    %eax,%eax
cmp    (%rdx),%rcx
je     1268 <main+0x128>
lea    0xe78(%rip),%r15
lea    0xe74(%rip),%rbx
jmp    11e0 <main+0xa0>
cs nopw 0x0(%rax,%rax,1)
nop
mov    $0xa,%edi
call   1030 <putchar@plt>
mov    0x10(%rsp),%rdi
lea    0xe52(%rip),%rsi
lea    0xc(%rsp),%rdx
call   1050 <fscanf@plt>
mov    0x2e11(%rip),%rcx
cmp    (%rcx),%rax
je     1266 <main+0x126>
mov    $0x31,%edi
call   1030 <putchar@plt>
cmpl   $0x2,0xc(%rsp)
jl     11b0 <main+0x70>
mov    $0x1,%r12d
nopw   0x0(%rax,%rax,1)
mov    %r12d,%r13d
mov    %r15,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0x1(%r13),%r12d
mov    $0x1,%ebp
mov    $0x1,%r14d
nopl   0x0(%rax)
imul   %r13d,%ebp
mov    %ebp,%eax
cltd
idiv   %r14d
mov    %eax,%ebp
mov    %rbx,%rdi
mov    %eax,%esi
xor    %eax,%eax
call   1040 <printf@plt>
add    $0x1,%r14d
add    $0xffffffff,%r13d
jne    1220 <main+0xe0>
cmp    0xc(%rsp),%r12d
jl     1200 <main+0xc0>
jmp    11b0 <main+0x70>
mov    (%rsi),%rsi
lea    0xda8(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    $0x1,%eax
jmp    1268 <main+0x128>
xor    %eax,%eax
add    $0x18,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

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

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