#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, unsigned long long);
int /*<<< orphan*/ scanf(char *, int *);
int main() {
  int t, i, n;
  unsigned long long int Fib[60];
  for (i = 0; i <= 60; i++)
    if (i == 0)
      Fib[0] = 0;
    else if (i == 1)
      Fib[1] = 1;
    else
      Fib[i] = Fib[i - 2] + Fib[i - 1];
  scanf("%d", &t);
  for (i = 0; i < t; i++) {
    scanf("%d", &n);
    printf("Fib(%d) = %lld\n", n, Fib[n]);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x1f0,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0xc(%rbp)
cmpl   $0x3c,-0xc(%rbp)
jg     11bb <main+0x9b>
cmpl   $0x0,-0xc(%rbp)
jne    115d <main+0x3d>
movq   $0x0,-0x1f0(%rbp)
jmp    11a8 <main+0x88>
cmpl   $0x1,-0xc(%rbp)
jne    1177 <main+0x57>
movq   $0x1,-0x1e8(%rbp)
jmp    11a3 <main+0x83>
mov    -0xc(%rbp),%eax
sub    $0x2,%eax
cltq
mov    -0x1f0(%rbp,%rax,8),%rcx
ff
mov    -0xc(%rbp),%eax
sub    $0x1,%eax
cltq
add    -0x1f0(%rbp,%rax,8),%rcx
ff
movslq -0xc(%rbp),%rax
mov    %rcx,-0x1f0(%rbp,%rax,8)
ff
jmp    11a8 <main+0x88>
jmp    11ad <main+0x8d>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1139 <main+0x19>
lea    0xe3e(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1040 <scanf@plt>
movl   $0x0,-0xc(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    1217 <main+0xf7>
lea    0xe1b(%rip),%rdi
lea    -0x10(%rbp),%rsi
call   1040 <scanf@plt>
mov    -0x10(%rbp),%esi
movslq -0x10(%rbp),%rax
mov    -0x1f0(%rbp,%rax,8),%rdx
ff
lea    0xdff(%rip),%rdi
call   1030 <printf@plt>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    11d2 <main+0xb2>
xor    %eax,%eax
add    $0x1f0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %rbx
sub    $0x1f8,%rsp
mov    $0xffffffff,%eax
xor    %ecx,%ecx
jmp    1162 <main+0x42>
cs nopw 0x0(%rax,%rax,1)
lea    -0x1(%rax),%edx
mov    %eax,%esi
mov    0x10(%rsp,%rsi,8),%rsi
add    0x10(%rsp,%rdx,8),%rsi
mov    %rsi,0x10(%rsp,%rcx,8)
add    $0x1,%rcx
add    $0x1,%rax
cmp    $0x3d,%rcx
je     118b <main+0x6b>
cmp    $0x1,%ecx
je     1180 <main+0x60>
test   %ecx,%ecx
jne    1140 <main+0x20>
movq   $0x0,0x10(%rsp)
jmp    1154 <main+0x34>
cs nopw 0x0(%rax,%rax,1)
movq   $0x1,0x18(%rsp)
jmp    1154 <main+0x34>
lea    0xe6e(%rip),%rdi
lea    0x8(%rsp),%rsi
call   1040 <scanf@plt>
cmpl   $0x0,0x8(%rsp)
jle    11e6 <main+0xc6>
xor    %ebp,%ebp
lea    0xe54(%rip),%r14
lea    0xc(%rsp),%r15
lea    0xe4b(%rip),%rbx
nopl   0x0(%rax,%rax,1)
mov    %r14,%rdi
mov    %r15,%rsi
call   1040 <scanf@plt>
movslq 0xc(%rsp),%rsi
mov    0x10(%rsp,%rsi,8),%rdx
mov    %rbx,%rdi
call   1030 <printf@plt>
add    $0x1,%ebp
cmp    0x8(%rsp),%ebp
jl     11c0 <main+0xa0>
xor    %eax,%eax
add    $0x1f8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%d\00"
@.str.1 = [16 x i8] c"Fib(%d) = %lld\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca [60 x i64]
store i32 0, i32* %1
store i32 0, i32* %3
br label %6
6: ; preds = %36, %0
%7 = load i32, i32* %3
%8 = icmp sle i32 %7, 60
br i1 %8, label %9, label %39
9: ; preds = %6
%10 = load i32, i32* %3
%11 = icmp eq i32 %10, 0
br i1 %11, label %12, label %14
12: ; preds = %9
%13 = getelementptr inbounds [60 x i64], [60 x i64]* %5, i64 0, i64 0
store i64 0, i64* %13
br label %35
14: ; preds = %9
%15 = load i32, i32* %3
%16 = icmp eq i32 %15, 1
br i1 %16, label %17, label %19
17: ; preds = %14
%18 = getelementptr inbounds [60 x i64], [60 x i64]* %5, i64 0, i64 1
store i64 1, i64* %18
br label %34
19: ; preds = %14
%20 = load i32, i32* %3
%21 = sub nsw i32 %20, 2
%22 = sext i32 %21 to i64
%23 = getelementptr inbounds [60 x i64], [60 x i64]* %5, i64 0, i64 %22
%24 = load i64, i64* %23
%25 = load i32, i32* %3
%26 = sub nsw i32 %25, 1
%27 = sext i32 %26 to i64
%28 = getelementptr inbounds [60 x i64], [60 x i64]* %5, i64 0, i64 %27
%29 = load i64, i64* %28
%30 = add i64 %24, %29
%31 = load i32, i32* %3
%32 = sext i32 %31 to i64
%33 = getelementptr inbounds [60 x i64], [60 x i64]* %5, i64 0, i64 %32
store i64 %30, i64* %33
br label %34
34: ; preds = %19, %17
br label %35
35: ; preds = %34, %12
br label %36
36: ; preds = %35
%37 = load i32, i32* %3
%38 = add nsw i32 %37, 1
store i32 %38, i32* %3
br label %6
39: ; preds = %6
%40 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %2)
store i32 0, i32* %3
br label %41
41: ; preds = %53, %39
%42 = load i32, i32* %3
%43 = load i32, i32* %2
%44 = icmp slt i32 %42, %43
br i1 %44, label %45, label %56
45: ; preds = %41
%46 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %4)
%47 = load i32, i32* %4
%48 = load i32, i32* %4
%49 = sext i32 %48 to i64
%50 = getelementptr inbounds [60 x i64], [60 x i64]* %5, i64 0, i64 %49
%51 = load i64, i64* %50
%52 = call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.1, i64 0, i64 0), i32 %47, i64 %51)
br label %53
53: ; preds = %45
%54 = load i32, i32* %3
%55 = add nsw i32 %54, 1
store i32 %55, i32* %3
br label %41
56: ; preds = %41
ret i32 0
}

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
@.str.1 = [16 x i8] c"Fib(%d) = %lld\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca [60 x i64]
%4 = bitcast i32* %1 to i8*
%5 = bitcast i32* %2 to i8*
%6 = bitcast [60 x i64]* %3 to i8*
%7 = getelementptr inbounds [60 x i64], [60 x i64]* %3, i64 0, i64 1
%8 = getelementptr inbounds [60 x i64], [60 x i64]* %3, i64 0, i64 0
br label %9
9: ; preds = %0, %25
%10 = phi i64 [ 0, %0 ], [ %26, %25 ]
%11 = trunc i64 %10 to i32
switch i32 %11, label %14 [
i32 0, label %12
i32 1, label %13
]
12: ; preds = %9
store i64 0, i64* %8
br label %25
13: ; preds = %9
store i64 1, i64* %7
br label %25
14: ; preds = %9
%15 = add nuw i64 %10, 4294967294
%16 = and i64 %15, 4294967295
%17 = getelementptr inbounds [60 x i64], [60 x i64]* %3, i64 0, i64 %16
%18 = load i64, i64* %17
%19 = add nuw i64 %10, 4294967295
%20 = and i64 %19, 4294967295
%21 = getelementptr inbounds [60 x i64], [60 x i64]* %3, i64 0, i64 %20
%22 = load i64, i64* %21
%23 = add i64 %22, %18
%24 = getelementptr inbounds [60 x i64], [60 x i64]* %3, i64 0, i64 %10
store i64 %23, i64* %24
br label %25
25: ; preds = %12, %14, %13
%26 = add nuw nsw i64 %10, 1
%27 = icmp eq i64 %26, 61
br i1 %27, label %28, label %9
28: ; preds = %25
%29 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %1)
%30 = load i32, i32* %1
%31 = icmp sgt i32 %30, 0
br i1 %31, label %32, label %43
32: ; preds = %28, %32
%33 = phi i32 [ %40, %32 ], [ 0, %28 ]
%34 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %2)
%35 = load i32, i32* %2
%36 = sext i32 %35 to i64
%37 = getelementptr inbounds [60 x i64], [60 x i64]* %3, i64 0, i64 %36
%38 = load i64, i64* %37
%39 = call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.1, i64 0, i64 0), i32 %35, i64 %38)
%40 = add nuw nsw i32 %33, 1
%41 = load i32, i32* %1
%42 = icmp slt i32 %40, %41
br i1 %42, label %32, label %43
43: ; preds = %32, %28
ret i32 0
}