#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, l[41] = {0,        1,        2,        3,         5,        8,
                  13,       21,       34,       55,        89,       144,
                  233,      377,      610,      987,       1597,     2584,
                  4181,     6765,     10946,    17711,     28657,    46368,
                  75025,    121393,   196418,   317811,    514229,   832040,
                  1346269,  2178309,  3524578,  5702887,   9227465,  14930352,
                  24157817, 39088169, 63245986, 102334155, 165580141};
  while (scanf("%i", &N) != EOF)
    if (!N)
      break;
    else
      printf("%i\n", l[N]);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0xb0,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0xb0(%rbp),%rdi
lea    0xeb0(%rip),%rsi
mov    $0xa4,%edx
call   1040 <memcpy@plt>
lea    0xf43(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1050 <scanf@plt>
mov    0x2e77(%rip),%rcx
cmp    (%rcx),%rax
je     11a5 <main+0x75>
cmpl   $0x0,-0x8(%rbp)
jne    1189 <main+0x59>
jmp    11a5 <main+0x75>
movslq -0x8(%rbp),%rax
mov    -0xb0(%rbp,%rax,4),%esi
lea    0xf0c(%rip),%rdi
call   1030 <printf@plt>
jmp    115a <main+0x2a>
xor    %eax,%eax
add    $0xb0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x10,%rsp
lea    0xf70(%rip),%rdi
lea    0xc(%rsp),%rsi
call   1040 <scanf@plt>
mov    0x2ea3(%rip),%r12
cmp    (%r12),%rax
je     1198 <main+0x78>
mov    0xc(%rsp),%eax
test   %eax,%eax
je     1198 <main+0x78>
lea    0xea6(%rip),%r13
lea    0xf46(%rip),%r14
lea    0xf3c(%rip),%r15
lea    0xc(%rsp),%rbx
nopl   (%rax)
cltq
mov    0x0(%r13,%rax,4),%esi
mov    %r14,%rdi
call   1030 <printf@plt>
mov    %r15,%rdi
mov    %rbx,%rsi
call   1040 <scanf@plt>
cmp    (%r12),%rax
je     1198 <main+0x78>
mov    0xc(%rsp),%eax
test   %eax,%eax
jne    1170 <main+0x50>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@__const.main.l = [41 x i32] [i32 0, i32 1, i32 2, i32 3, i32 5, i32 8, i32 13, i32 21, i32 34, i32 55, i32 89, i32 144, i32 233, i32 377, i32 610, i32 987, i32 1597, i32 2584, i32 4181, i32 6765, i32 10946, i32 17711, i32 28657, i32 46368, i32 75025, i32 121393, i32 196418, i32 317811, i32 514229, i32 832040, i32 1346269, i32 2178309, i32 3524578, i32 5702887, i32 9227465, i32 14930352, i32 24157817, i32 39088169, i32 63245986, i32 102334155, i32 165580141]
@.str = [3 x i8] c"%i\00"
@EOF = global i64 0
@.str.1 = [4 x i8] c"%i\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca [41 x i32]
store i32 0, i32* %1
%4 = bitcast [41 x i32]* %3 to i8*
br label %5
5: ; preds = %19, %0
%6 = call i64 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %2)
%7 = load i64, i64* @EOF
%8 = icmp ne i64 %6, %7
br i1 %8, label %9, label %20
9: ; preds = %5
%10 = load i32, i32* %2
%11 = icmp ne i32 %10, 0
br i1 %11, label %13, label %12
12: ; preds = %9
br label %20
13: ; preds = %9
%14 = load i32, i32* %2
%15 = sext i32 %14 to i64
%16 = getelementptr inbounds [41 x i32], [41 x i32]* %3, i64 0, i64 %15
%17 = load i32, i32* %16
%18 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %17)
br label %19
19: ; preds = %13
br label %5
20: ; preds = %12, %5
ret i32 0
}

LLVM IR (-O2):
@__const.main.l = [41 x i32] [i32 0, i32 1, i32 2, i32 3, i32 5, i32 8, i32 13, i32 21, i32 34, i32 55, i32 89, i32 144, i32 233, i32 377, i32 610, i32 987, i32 1597, i32 2584, i32 4181, i32 6765, i32 10946, i32 17711, i32 28657, i32 46368, i32 75025, i32 121393, i32 196418, i32 317811, i32 514229, i32 832040, i32 1346269, i32 2178309, i32 3524578, i32 5702887, i32 9227465, i32 14930352, i32 24157817, i32 39088169, i32 63245986, i32 102334155, i32 165580141]
@.str = [3 x i8] c"%i\00"
@EOF = global i64 0
@.str.1 = [4 x i8] c"%i\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = call i64 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %1)
%4 = load i64, i64* @EOF
%5 = icmp ne i64 %3, %4
%6 = load i32, i32* %1
%7 = icmp ne i32 %6, 0
%8 = select i1 %5, i1 %7, i1 false
br i1 %8, label %9, label %21
9: ; preds = %0, %9
%10 = phi i32 [ %18, %9 ], [ %6, %0 ]
%11 = sext i32 %10 to i64
%12 = getelementptr inbounds [41 x i32], [41 x i32]* @__const.main.l, i64 0, i64 %11
%13 = load i32, i32* %12
%14 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %13)
%15 = call i64 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %1)
%16 = load i64, i64* @EOF
%17 = icmp ne i64 %15, %16
%18 = load i32, i32* %1
%19 = icmp ne i32 %18, 0
%20 = select i1 %17, i1 %19, i1 false
br i1 %20, label %9, label %21
21: ; preds = %9, %0
ret i32 0
}