#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 a[55] = {1, 1};
  int n;
  scanf("%d", &n);
  int i;
  printf("1");
  for (i = 1; i < n; i++) {
    if (i >= 2)
      printf(" %d", a[i] = a[i - 1] + a[i - 2]);
    else
      printf(" %d", a[i]);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0xf0,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0xe0(%rbp),%rdi
xor    %esi,%esi
mov    $0xdc,%edx
call   1040 <memset@plt>
movl   $0x1,-0xe0(%rbp)
movl   $0x1,-0xdc(%rbp)
lea    0xe93(%rip),%rdi
lea    -0xe4(%rbp),%rsi
call   1050 <scanf@plt>
lea    0xe7d(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x1,-0xe8(%rbp)
mov    -0xe8(%rbp),%eax
cmp    -0xe4(%rbp),%eax
jge    122d <main+0xfd>
cmpl   $0x2,-0xe8(%rbp)
jl     11f8 <main+0xc8>
mov    -0xe8(%rbp),%eax
sub    $0x1,%eax
cltq
mov    -0xe0(%rbp,%rax,4),%esi
mov    -0xe8(%rbp),%eax
sub    $0x2,%eax
cltq
add    -0xe0(%rbp,%rax,4),%esi
movslq -0xe8(%rbp),%rax
mov    %esi,-0xe0(%rbp,%rax,4)
lea    0xe16(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    1214 <main+0xe4>
movslq -0xe8(%rbp),%rax
mov    -0xe0(%rbp,%rax,4),%esi
lea    0xdf5(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    1219 <main+0xe9>
mov    -0xe8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xe8(%rbp)
jmp    1194 <main+0x64>
xor    %eax,%eax
add    $0xf0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r14
push   %rbx
sub    $0xf0,%rsp
xorps  %xmm0,%xmm0
movaps %xmm0,0x10(%rsp)
movups %xmm0,0xdc(%rsp)
movaps %xmm0,0xd0(%rsp)
movaps %xmm0,0xc0(%rsp)
movaps %xmm0,0xb0(%rsp)
movaps %xmm0,0xa0(%rsp)
movaps %xmm0,0x90(%rsp)
movaps %xmm0,0x80(%rsp)
movaps %xmm0,0x70(%rsp)
movaps %xmm0,0x60(%rsp)
movaps %xmm0,0x50(%rsp)
movaps %xmm0,0x40(%rsp)
movaps %xmm0,0x30(%rsp)
movaps %xmm0,0x20(%rsp)
movabs $0x100000001,%rax
mov    %rax,0x10(%rsp)
lea    0xe52(%rip),%rdi
lea    0xc(%rsp),%rsi
call   1050 <scanf@plt>
mov    $0x31,%edi
call   1030 <putchar@plt>
cmpl   $0x2,0xc(%rsp)
jl     1222 <main+0xf2>
lea    0xe2f(%rip),%rdi
mov    $0x1,%ebp
mov    $0x1,%esi
xor    %eax,%eax
call   1040 <printf@plt>
cmpl   $0x3,0xc(%rsp)
jl     1222 <main+0xf2>
mov    $0x2,%ebx
lea    0xe0b(%rip),%r14
cs nopw 0x0(%rax,%rax,1)
nop
add    0x8(%rsp,%rbx,4),%ebp
mov    %ebp,0x10(%rsp,%rbx,4)
mov    %r14,%rdi
mov    %ebp,%esi
xor    %eax,%eax
call   1040 <printf@plt>
movslq 0xc(%rsp),%rax
add    $0x1,%rbx
cmp    %rax,%rbx
jl     1200 <main+0xd0>
xor    %eax,%eax
add    $0xf0,%rsp
pop    %rbx
pop    %r14
pop    %rbp
ret

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

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
@.str.2 = [4 x i8] c" %d\00"
define i32 @main() {
%1 = alloca [55 x i32]
%2 = alloca i32
%3 = bitcast [55 x i32]* %1 to i8*
%4 = getelementptr inbounds [55 x i32], [55 x i32]* %1, i64 0, i64 0
store i32 1, i32* %4
%5 = getelementptr inbounds [55 x i32], [55 x i32]* %1, i64 0, i64 1
store i32 1, i32* %5
%6 = bitcast i32* %2 to i8*
%7 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %2)
%8 = call i32 @putchar(i32 49)
%9 = load i32, i32* %2
%10 = icmp sgt i32 %9, 1
br i1 %10, label %11, label %29
11: ; preds = %0
%12 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), i32 1)
%13 = load i32, i32* %2
%14 = icmp sgt i32 %13, 2
br i1 %14, label %15, label %29
15: ; preds = %11, %15
%16 = phi i32 [ %22, %15 ], [ 1, %11 ]
%17 = phi i64 [ %26, %15 ], [ 2, %11 ]
%18 = add nuw i64 %17, 4294967294
%19 = and i64 %18, 4294967295
%20 = getelementptr inbounds [55 x i32], [55 x i32]* %1, i64 0, i64 %19
%21 = load i32, i32* %20
%22 = add nsw i32 %21, %16
%23 = getelementptr inbounds [55 x i32], [55 x i32]* %1, i64 0, i64 %17
store i32 %22, i32* %23
%24 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), i32 %22)
%25 = load i32, i32* %2
%26 = add nuw nsw i64 %17, 1
%27 = sext i32 %25 to i64
%28 = icmp slt i64 %26, %27
br i1 %28, label %15, label %29
29: ; preds = %15, %11, %0
ret i32 0
}