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


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x90,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x90(%rbp)
movl   $0x1,-0x8c(%rbp)
movl   $0x2,-0x8(%rbp)
cmpl   $0x1e,-0x8(%rbp)
jg     119e <main+0x6e>
mov    -0x8(%rbp),%eax
sub    $0x1,%eax
cltq
mov    -0x90(%rbp,%rax,4),%ecx
mov    -0x8(%rbp),%eax
sub    $0x2,%eax
cltq
add    -0x90(%rbp,%rax,4),%ecx
movslq -0x8(%rbp),%rax
mov    %ecx,-0x90(%rbp,%rax,4)
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    115d <main+0x2d>
jmp    11a3 <main+0x73>
lea    0xe56(%rip),%rdi
lea    -0xc(%rbp),%rsi
call   1040 <scanf@plt>
mov    0x2e2e(%rip),%rcx
cmp    (%rcx),%rax
je     11df <main+0xaf>
movslq -0xc(%rbp),%rax
mov    -0x90(%rbp,%rax,4),%esi
lea    0xe2e(%rip),%rdi
call   1030 <printf@plt>
jmp    11a3 <main+0x73>
xor    %edi,%edi
call   1050 <exit@plt>

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %r12
push   %rbx
sub    $0x98,%rsp
movabs $0x100000000,%rax
mov    %rax,0x10(%rsp)
movl   $0x1,0x18(%rsp)
mov    $0x1,%eax
xor    %ecx,%ecx
nopl   0x0(%rax)
add    0x14(%rsp,%rcx,4),%eax
mov    %eax,0x1c(%rsp,%rcx,4)
mov    0x18(%rsp,%rcx,4),%edx
add    %eax,%edx
mov    %edx,0x20(%rsp,%rcx,4)
add    %edx,%eax
mov    %eax,0x24(%rsp,%rcx,4)
add    %edx,%eax
mov    %eax,0x28(%rsp,%rcx,4)
add    $0x4,%rcx
cmp    $0x1c,%rcx
jne    1160 <main+0x30>
lea    0xe71(%rip),%rdi
lea    0xc(%rsp),%rsi
call   1040 <scanf@plt>
mov    0x2e48(%rip),%r12
cmp    (%r12),%rax
je     11e2 <main+0xb2>
lea    0xe56(%rip),%r14
lea    0xe4c(%rip),%r15
lea    0xc(%rsp),%rbx
nopl   0x0(%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    11c0 <main+0x90>
xor    %edi,%edi
call   1050 <exit@plt>

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 i32
%4 = alloca [31 x i32]
store i32 0, i32* %1
%5 = getelementptr inbounds [31 x i32], [31 x i32]* %4, i64 0, i64 0
store i32 0, i32* %5
%6 = getelementptr inbounds [31 x i32], [31 x i32]* %4, i64 0, i64 1
store i32 1, i32* %6
store i32 2, i32* %2
br label %7
7: ; preds = %25, %0
%8 = load i32, i32* %2
%9 = icmp sle i32 %8, 30
br i1 %9, label %10, label %28
10: ; preds = %7
%11 = load i32, i32* %2
%12 = sub nsw i32 %11, 1
%13 = sext i32 %12 to i64
%14 = getelementptr inbounds [31 x i32], [31 x i32]* %4, i64 0, i64 %13
%15 = load i32, i32* %14
%16 = load i32, i32* %2
%17 = sub nsw i32 %16, 2
%18 = sext i32 %17 to i64
%19 = getelementptr inbounds [31 x i32], [31 x i32]* %4, i64 0, i64 %18
%20 = load i32, i32* %19
%21 = add nsw i32 %15, %20
%22 = load i32, i32* %2
%23 = sext i32 %22 to i64
%24 = getelementptr inbounds [31 x i32], [31 x i32]* %4, i64 0, i64 %23
store i32 %21, i32* %24
br label %25
25: ; preds = %10
%26 = load i32, i32* %2
%27 = add nsw i32 %26, 1
store i32 %27, i32* %2
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* %3)
%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* %3
%35 = sext i32 %34 to i64
%36 = getelementptr inbounds [31 x i32], [31 x i32]* %4, 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 = call i32 @exit(i32 0)
unreachable
}

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 [31 x i32]
%3 = bitcast i32* %1 to i8*
%4 = bitcast [31 x i32]* %2 to i8*
%5 = getelementptr inbounds [31 x i32], [31 x i32]* %2, i64 0, i64 0
store i32 0, i32* %5
%6 = getelementptr inbounds [31 x i32], [31 x i32]* %2, i64 0, i64 1
store i32 1, i32* %6
%7 = getelementptr inbounds [31 x i32], [31 x i32]* %2, i64 0, i64 2
store i32 1, i32* %7
br label %12
8: ; preds = %12
%9 = call i64 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %1)
%10 = load i64, i64* @EOF
%11 = icmp eq i64 %9, %10
br i1 %11, label %48, label %39
12: ; preds = %12, %0
%13 = phi i64 [ 3, %0 ], [ %37, %12 ]
%14 = phi i32 [ 1, %0 ], [ %35, %12 ]
%15 = phi i64 [ 2, %0 ], [ %32, %12 ]
%16 = add nsw i64 %15, -1
%17 = getelementptr inbounds [31 x i32], [31 x i32]* %2, i64 0, i64 %16
%18 = load i32, i32* %17
%19 = add nsw i32 %18, %14
%20 = getelementptr inbounds [31 x i32], [31 x i32]* %2, i64 0, i64 %13
store i32 %19, i32* %20
%21 = add nuw nsw i64 %13, 1
%22 = add nsw i64 %13, -1
%23 = getelementptr inbounds [31 x i32], [31 x i32]* %2, i64 0, i64 %22
%24 = load i32, i32* %23
%25 = add nsw i32 %24, %19
%26 = getelementptr inbounds [31 x i32], [31 x i32]* %2, i64 0, i64 %21
store i32 %25, i32* %26
%27 = add nuw nsw i64 %13, 2
%28 = getelementptr inbounds [31 x i32], [31 x i32]* %2, i64 0, i64 %13
%29 = load i32, i32* %28
%30 = add nsw i32 %29, %25
%31 = getelementptr inbounds [31 x i32], [31 x i32]* %2, i64 0, i64 %27
store i32 %30, i32* %31
%32 = add nuw nsw i64 %13, 3
%33 = getelementptr inbounds [31 x i32], [31 x i32]* %2, i64 0, i64 %21
%34 = load i32, i32* %33
%35 = add nsw i32 %34, %30
%36 = getelementptr inbounds [31 x i32], [31 x i32]* %2, i64 0, i64 %32
store i32 %35, i32* %36
%37 = add nuw nsw i64 %13, 4
%38 = icmp eq i64 %37, 31
br i1 %38, label %8, label %12
39: ; preds = %8, %39
%40 = load i32, i32* %1
%41 = sext i32 %40 to i64
%42 = getelementptr inbounds [31 x i32], [31 x i32]* %2, i64 0, i64 %41
%43 = load i32, i32* %42
%44 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %43)
%45 = call i64 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %1)
%46 = load i64, i64* @EOF
%47 = icmp eq i64 %45, %46
br i1 %47, label %48, label %39
48: ; preds = %39, %8
%49 = call i32 @exit(i32 0)
unreachable
}