#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 seq[31], i;
  seq[0] = 0;
  seq[1] = 1;
  for (i = 2; i < 31; i++)
    seq[i] = seq[i - 1] + seq[i - 2];
  while (scanf("%d", &i) != EOF) {
    printf("%d\n", seq[i]);
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x90,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x80(%rbp)
movl   $0x1,-0x7c(%rbp)
movl   $0x2,-0x84(%rbp)
cmpl   $0x1f,-0x84(%rbp)
jge    1194 <main+0x74>
mov    -0x84(%rbp),%eax
sub    $0x1,%eax
cltq
mov    -0x80(%rbp,%rax,4),%ecx
mov    -0x84(%rbp),%eax
sub    $0x2,%eax
cltq
add    -0x80(%rbp,%rax,4),%ecx
movslq -0x84(%rbp),%rax
mov    %ecx,-0x80(%rbp,%rax,4)
mov    -0x84(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x84(%rbp)
jmp    114a <main+0x2a>
jmp    1199 <main+0x79>
lea    0xe60(%rip),%rdi
lea    -0x84(%rbp),%rsi
call   1040 <scanf@plt>
mov    0x2e35(%rip),%rcx
cmp    (%rcx),%rax
je     11d8 <main+0xb8>
movslq -0x84(%rbp),%rax
mov    -0x80(%rbp,%rax,4),%esi
lea    0xe35(%rip),%rdi
call   1030 <printf@plt>
jmp    1199 <main+0x79>
mov    -0x4(%rbp),%eax
add    $0x90,%rsp
pop    %rbp
ret

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    1150 <main+0x30>
movl   $0x1f,0xc(%rsp)
lea    0xe79(%rip),%rdi
lea    0xc(%rsp),%rsi
call   1040 <scanf@plt>
mov    0x2e50(%rip),%r12
cmp    (%r12),%rax
je     11e2 <main+0xc2>
lea    0xe5e(%rip),%r14
lea    0xe54(%rip),%r15
lea    0xc(%rsp),%rbx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
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+0xa0>
xor    %eax,%eax
add    $0x98,%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 [31 x i32]
%3 = alloca i32
store i32 0, i32* %1
%4 = getelementptr inbounds [31 x i32], [31 x i32]* %2, i64 0, i64 0
store i32 0, i32* %4
%5 = getelementptr inbounds [31 x i32], [31 x i32]* %2, i64 0, i64 1
store i32 1, i32* %5
store i32 2, i32* %3
br label %6
6: ; preds = %24, %0
%7 = load i32, i32* %3
%8 = icmp slt i32 %7, 31
br i1 %8, label %9, label %27
9: ; preds = %6
%10 = load i32, i32* %3
%11 = sub nsw i32 %10, 1
%12 = sext i32 %11 to i64
%13 = getelementptr inbounds [31 x i32], [31 x i32]* %2, i64 0, i64 %12
%14 = load i32, i32* %13
%15 = load i32, i32* %3
%16 = sub nsw i32 %15, 2
%17 = sext i32 %16 to i64
%18 = getelementptr inbounds [31 x i32], [31 x i32]* %2, i64 0, i64 %17
%19 = load i32, i32* %18
%20 = add nsw i32 %14, %19
%21 = load i32, i32* %3
%22 = sext i32 %21 to i64
%23 = getelementptr inbounds [31 x i32], [31 x i32]* %2, i64 0, i64 %22
store i32 %20, i32* %23
br label %24
24: ; preds = %9
%25 = load i32, i32* %3
%26 = add nsw i32 %25, 1
store i32 %26, i32* %3
br label %6
27: ; preds = %6
br label %28
28: ; preds = %32, %27
%29 = call i64 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %3)
%30 = load i64, i64* @EOF
%31 = icmp ne i64 %29, %30
br i1 %31, label %32, label %38
32: ; preds = %28
%33 = load i32, i32* %3
%34 = sext i32 %33 to i64
%35 = getelementptr inbounds [31 x i32], [31 x i32]* %2, i64 0, i64 %34
%36 = load i32, i32* %35
%37 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %36)
br label %28
38: ; preds = %28
%39 = load i32, i32* %1
ret i32 %39
}

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