#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 /*<<< orphan*/ scanf(char *, long *);
int main() {
  long t, n, a = 0, b = 1, c, j;
  bool isFibo = false;
  scanf("%ld", &t);
  for (j = 0; j < t; j++) {
    scanf("%ld", &n);
    a = 0;
    b = 1;
    c = a + b;
    isFibo = false;
    while (c <= n) {
      if (c == n) {
        isFibo = true;
        break;
      } else {
        a = b;
        b = c;
        c = a + b;
      }
    }
    if (isFibo) {
      printf("IsFibo\n");
    } else {
      printf("IsNotFibo\n");
    }
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
movl   $0x0,-0x4(%rbp)
movq   $0x0,-0x20(%rbp)
movq   $0x1,-0x28(%rbp)
movl   $0x0,-0x3c(%rbp)
lea    0xeb3(%rip),%rdi
lea    -0x10(%rbp),%rsi
call   1040 <scanf@plt>
movq   $0x0,-0x38(%rbp)
mov    -0x38(%rbp),%rax
cmp    -0x10(%rbp),%rax
jge    1225 <main+0x105>
lea    0xe8d(%rip),%rdi
lea    -0x18(%rbp),%rsi
call   1040 <scanf@plt>
movq   $0x0,-0x20(%rbp)
movq   $0x1,-0x28(%rbp)
mov    -0x20(%rbp),%rax
add    -0x28(%rbp),%rax
mov    %rax,-0x30(%rbp)
movl   $0x0,-0x3c(%rbp)
mov    -0x30(%rbp),%rax
cmp    -0x18(%rbp),%rax
jg     11e8 <main+0xc8>
mov    -0x30(%rbp),%rax
cmp    -0x18(%rbp),%rax
jne    11c7 <main+0xa7>
movl   $0x1,-0x3c(%rbp)
jmp    11e8 <main+0xc8>
mov    -0x28(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x30(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0x20(%rbp),%rax
add    -0x28(%rbp),%rax
mov    %rax,-0x30(%rbp)
jmp    119f <main+0x7f>
cmpl   $0x0,-0x3c(%rbp)
je     1203 <main+0xe3>
lea    0xe0b(%rip),%rdi
call   1030 <printf@plt>
jmp    120f <main+0xef>
lea    0xe02(%rip),%rdi
call   1030 <printf@plt>
jmp    1214 <main+0xf4>
mov    -0x38(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x38(%rbp)
jmp    115e <main+0x3e>
xor    %eax,%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x10,%rsp
lea    0xecc(%rip),%rdi
mov    %rsp,%rsi
call   1040 <scanf@plt>
cmpq   $0x0,(%rsp)
jle    11cb <main+0xab>
xor    %ebx,%ebx
lea    0xeb0(%rip),%r14
lea    0x8(%rsp),%r15
lea    0xea8(%rip),%r12
lea    0xeab(%rip),%r13
jmp    1182 <main+0x62>
cs nopw 0x0(%rax,%rax,1)
nop
mov    %r13,%rdi
call   1030 <puts@plt>
add    $0x1,%rbx
cmp    (%rsp),%rbx
jge    11cb <main+0xab>
mov    %r14,%rdi
mov    %r15,%rsi
call   1040 <scanf@plt>
mov    0x8(%rsp),%rax
mov    %r12,%rdi
test   %rax,%rax
jle    1173 <main+0x53>
mov    $0x1,%edx
mov    $0x1,%ecx
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
cmp    %rax,%rdx
je     1170 <main+0x50>
mov    %rdx,%rsi
add    %rdx,%rcx
mov    %rcx,%rdx
cmp    %rax,%rcx
mov    %rsi,%rcx
jle    11b0 <main+0x90>
mov    %r12,%rdi
jmp    1173 <main+0x53>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
@.str = [4 x i8] c"%ld\00"
@str = [10 x i8] c"IsNotFibo\00"
@str.3 = [7 x i8] c"IsFibo\00"
define i32 @main() {
%1 = alloca i64
%2 = alloca i64
%3 = bitcast i64* %1 to i8*
%4 = bitcast i64* %2 to i8*
%5 = call i32 @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i64* %1)
%6 = load i64, i64* %1
%7 = icmp sgt i64 %6, 0
br i1 %7, label %8, label %26
8: ; preds = %0, %20
%9 = phi i64 [ %23, %20 ], [ 0, %0 ]
%10 = call i32 @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i64* %2)
%11 = load i64, i64* %2
%12 = icmp slt i64 %11, 1
br i1 %12, label %20, label %15
13: ; preds = %15
%14 = icmp sgt i64 %19, %11
br i1 %14, label %20, label %15
15: ; preds = %8, %13
%16 = phi i64 [ %19, %13 ], [ 1, %8 ]
%17 = phi i64 [ %16, %13 ], [ 1, %8 ]
%18 = icmp eq i64 %16, %11
%19 = add nsw i64 %16, %17
br i1 %18, label %20, label %13
20: ; preds = %13, %15, %8
%21 = phi i8* [ getelementptr inbounds ([10 x i8], [10 x i8]* @str, i64 0, i64 0), %8 ], [ getelementptr inbounds ([7 x i8], [7 x i8]* @str.3, i64 0, i64 0), %15 ], [ getelementptr inbounds ([10 x i8], [10 x i8]* @str, i64 0, i64 0), %13 ]
%22 = call i32 @puts(i8* dereferenceable(1) %21)
%23 = add nuw nsw i64 %9, 1
%24 = load i64, i64* %1
%25 = icmp slt i64 %23, %24
br i1 %25, label %8, label %26
26: ; preds = %20, %0
ret i32 0
}