#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);
int /*<<< orphan*/ scanf(char *, int *);
int main() {
  int n, i, f = 0, s = 1, sum;
  scanf("%d", &n);
  for (i = 0; i < n - 1; i++) {
    if (i <= 1) {
      sum = i;
    } else {
      sum = f + s;
      f = s;
      s = sum;
    }
    printf("%d ", sum);
  }
  printf("%d\n", f + s);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x10(%rbp)
movl   $0x1,-0x14(%rbp)
lea    0xebc(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1040 <scanf@plt>
movl   $0x0,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    -0x8(%rbp),%ecx
sub    $0x1,%ecx
cmp    %ecx,%eax
jge    11ac <main+0x8c>
cmpl   $0x1,-0xc(%rbp)
jg     117a <main+0x5a>
mov    -0xc(%rbp),%eax
mov    %eax,-0x18(%rbp)
jmp    118f <main+0x6f>
mov    -0x10(%rbp),%eax
add    -0x14(%rbp),%eax
mov    %eax,-0x18(%rbp)
mov    -0x14(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x18(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x18(%rbp),%esi
lea    0xe6a(%rip),%rdi
call   1030 <printf@plt>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1154 <main+0x34>
mov    -0x10(%rbp),%esi
add    -0x14(%rbp),%esi
lea    0xe4e(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
lea    0xed2(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1040 <scanf@plt>
mov    $0x1,%ebx
cmpl   $0x2,0x4(%rsp)
jl     118a <main+0x6a>
xor    %r15d,%r15d
mov    $0x1,%ebx
lea    0xeb0(%rip),%r14
xor    %ebp,%ebp
cs nopw 0x0(%rax,%rax,1)
nop
lea    (%rbx,%r15,1),%esi
cmp    $0x2,%ebp
cmovae %ebx,%r15d
cmovae %esi,%ebx
cmovb  %ebp,%esi
mov    %r14,%rdi
call   1030 <printf@plt>
add    $0x1,%ebp
mov    0x4(%rsp),%eax
add    $0xffffffff,%eax
cmp    %eax,%ebp
jl     1160 <main+0x40>
add    %r15d,%ebx
lea    0xe76(%rip),%rdi
mov    %ebx,%esi
call   1030 <printf@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 = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32 0, i32* %1
store i32 0, i32* %4
store i32 1, i32* %5
%7 = 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 %8
8: ; preds = %27, %0
%9 = load i32, i32* %3
%10 = load i32, i32* %2
%11 = sub nsw i32 %10, 1
%12 = icmp slt i32 %9, %11
br i1 %12, label %13, label %30
13: ; preds = %8
%14 = load i32, i32* %3
%15 = icmp sle i32 %14, 1
br i1 %15, label %16, label %18
16: ; preds = %13
%17 = load i32, i32* %3
store i32 %17, i32* %6
br label %24
18: ; preds = %13
%19 = load i32, i32* %4
%20 = load i32, i32* %5
%21 = add nsw i32 %19, %20
store i32 %21, i32* %6
%22 = load i32, i32* %5
store i32 %22, i32* %4
%23 = load i32, i32* %6
store i32 %23, i32* %5
br label %24
24: ; preds = %18, %16
%25 = load i32, i32* %6
%26 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %25)
br label %27
27: ; preds = %24
%28 = load i32, i32* %3
%29 = add nsw i32 %28, 1
store i32 %29, i32* %3
br label %8
30: ; preds = %8
%31 = load i32, i32* %4
%32 = load i32, i32* %5
%33 = add nsw i32 %31, %32
%34 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), i32 %33)
ret i32 0
}

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