#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 */
scalar_t__ EOF;
int /*<<< orphan*/ printf(char *, int);
scalar_t__ scanf(char *, int *);
int main() {
  int N, num[20], i;
  num[1] = 1;
  num[2] = 2;
  for (i = 3; i < 20; i++)
    num[i] = num[i - 1] + num[i - 2];
  while (scanf("%d", &N) != EOF) {
    printf("%d\n", num[N]);
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x70,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x1,-0x5c(%rbp)
movl   $0x2,-0x58(%rbp)
movl   $0x3,-0x64(%rbp)
cmpl   $0x14,-0x64(%rbp)
jge    117c <main+0x5c>
mov    -0x64(%rbp),%eax
sub    $0x1,%eax
cltq
mov    -0x60(%rbp,%rax,4),%ecx
mov    -0x64(%rbp),%eax
sub    $0x2,%eax
cltq
add    -0x60(%rbp,%rax,4),%ecx
movslq -0x64(%rbp),%rax
mov    %ecx,-0x60(%rbp,%rax,4)
mov    -0x64(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x64(%rbp)
jmp    1144 <main+0x24>
jmp    1181 <main+0x61>
lea    0xe78(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1040 <scanf@plt>
mov    0x2e50(%rip),%rcx
cmp    (%rcx),%rax
je     11ba <main+0x9a>
movslq -0x8(%rbp),%rax
mov    -0x60(%rbp,%rax,4),%esi
lea    0xe53(%rip),%rdi
call   1030 <printf@plt>
jmp    1181 <main+0x61>
mov    -0x4(%rbp),%eax
add    $0x70,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %r12
push   %rbx
sub    $0x68,%rsp
movaps 0xece(%rip),%xmm0
movups %xmm0,0x14(%rsp)
movaps 0xed2(%rip),%xmm0
movups %xmm0,0x24(%rsp)
movaps 0xed6(%rip),%xmm0
movups %xmm0,0x34(%rsp)
movaps 0xeda(%rip),%xmm0
movups %xmm0,0x44(%rsp)
movabs $0x105500000a18,%rax
mov    %rax,0x54(%rsp)
movl   $0x1a6d,0x5c(%rsp)
lea    0xec7(%rip),%rdi
lea    0xc(%rsp),%rsi
call   1040 <scanf@plt>
mov    0x2e5e(%rip),%r12
cmp    (%r12),%rax
je     11d2 <main+0xb2>
lea    0xeac(%rip),%r14
lea    0xea2(%rip),%r15
lea    0xc(%rsp),%rbx
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
movslq 0xc(%rsp),%rax
mov    0x10(%rsp,%rax,4),%esi
mov    %r14,%rdi
call   1030 <printf@plt>
mov    %r15,%rdi
mov    %rbx,%rsi
call   1040 <scanf@plt>
cmp    (%r12),%rax
jne    11b0 <main+0x90>
xor    %eax,%eax
add    $0x68,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
@EOF = global i64 0
@.str.1 = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [20 x i32]
%3 = bitcast i32* %1 to i8*
%4 = bitcast [20 x i32]* %2 to i8*
%5 = getelementptr inbounds [20 x i32], [20 x i32]* %2, i64 0, i64 1
%6 = bitcast i32* %5 to <4 x i32>*
store <4 x i32> <i32 1, i32 2, i32 3, i32 5>, <4 x i32>* %6
%7 = getelementptr inbounds [20 x i32], [20 x i32]* %2, i64 0, i64 5
%8 = bitcast i32* %7 to <4 x i32>*
store <4 x i32> <i32 8, i32 13, i32 21, i32 34>, <4 x i32>* %8
%9 = getelementptr inbounds [20 x i32], [20 x i32]* %2, i64 0, i64 9
%10 = bitcast i32* %9 to <4 x i32>*
store <4 x i32> <i32 55, i32 89, i32 144, i32 233>, <4 x i32>* %10
%11 = getelementptr inbounds [20 x i32], [20 x i32]* %2, i64 0, i64 13
%12 = bitcast i32* %11 to <4 x i32>*
store <4 x i32> <i32 377, i32 610, i32 987, i32 1597>, <4 x i32>* %12
%13 = getelementptr inbounds [20 x i32], [20 x i32]* %2, i64 0, i64 17
store i32 2584, i32* %13
%14 = getelementptr inbounds [20 x i32], [20 x i32]* %2, i64 0, i64 18
store i32 4181, i32* %14
%15 = getelementptr inbounds [20 x i32], [20 x i32]* %2, i64 0, i64 19
store i32 6765, i32* %15
%16 = call i64 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %1)
%17 = load i64, i64* @EOF
%18 = icmp eq i64 %16, %17
br i1 %18, label %28, label %19
19: ; preds = %0, %19
%20 = load i32, i32* %1
%21 = sext i32 %20 to i64
%22 = getelementptr inbounds [20 x i32], [20 x i32]* %2, i64 0, i64 %21
%23 = load i32, i32* %22
%24 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %23)
%25 = call i64 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %1)
%26 = load i64, i64* @EOF
%27 = icmp eq i64 %25, %26
br i1 %27, label %28, label %19
28: ; preds = %19, %0
ret i32 0
}