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


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0xd0,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xec8(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1040 <scanf@plt>
movl   $0x0,-0xc0(%rbp)
movl   $0x1,-0xc4(%rbp)
mov    -0xc0(%rbp),%esi
lea    0xe9e(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x1,-0xc8(%rbp)
mov    -0xc8(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    11f1 <main+0xd1>
mov    -0xc8(%rbp),%eax
sub    $0x1,%eax
cltq
mov    -0xc0(%rbp,%rax,4),%ecx
add    -0xc4(%rbp),%ecx
movslq -0xc8(%rbp),%rax
mov    %ecx,-0xc0(%rbp,%rax,4)
mov    -0xc8(%rbp),%eax
sub    $0x1,%eax
cltq
mov    -0xc0(%rbp,%rax,4),%eax
mov    %eax,-0xc4(%rbp)
movslq -0xc8(%rbp),%rax
mov    -0xc0(%rbp,%rax,4),%esi
lea    0xe2a(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0xc8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc8(%rbp)
jmp    1174 <main+0x54>
lea    0xe0c(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0xd0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
lea    0xec3(%rip),%rbx
lea    0x4(%rsp),%rsi
mov    %rbx,%rdi
call   1050 <scanf@plt>
mov    %rbx,%rdi
xor    %esi,%esi
xor    %eax,%eax
call   1040 <printf@plt>
cmpl   $0x2,0x4(%rsp)
jl     11a4 <main+0x74>
mov    $0x1,%ebp
mov    $0x1,%ebx
lea    0xe91(%rip),%r14
xor    %eax,%eax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    %eax,%r15d
add    %eax,%ebp
mov    %r14,%rdi
mov    %ebp,%esi
xor    %eax,%eax
call   1040 <printf@plt>
add    $0x1,%rbx
movslq 0x4(%rsp),%rcx
mov    %ebp,%eax
mov    %r15d,%ebp
cmp    %rcx,%rbx
jl     1180 <main+0x50>
mov    $0xa,%edi
call   1030 <putchar@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

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

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
@.str.1 = [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 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 0)
%5 = load i32, i32* %1
%6 = icmp sgt i32 %5, 1
br i1 %6, label %9, label %7
7: ; preds = %9, %0
%8 = call i32 @putchar(i32 10)
ret i32 0
9: ; preds = %0, %9
%10 = phi i32 [ %13, %9 ], [ 0, %0 ]
%11 = phi i64 [ %15, %9 ], [ 1, %0 ]
%12 = phi i32 [ %10, %9 ], [ 1, %0 ]
%13 = add nsw i32 %10, %12
%14 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %13)
%15 = add nuw nsw i64 %11, 1
%16 = load i32, i32* %1
%17 = sext i32 %16 to i64
%18 = icmp slt i64 %15, %17
br i1 %18, label %9, label %7
}