#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 *, ...);
int main() {
  long int a = 0, b, c;
  int test, i;
  long int number;
  scanf("%d", &test);
  for (i = 0; i < test; i++) {
    scanf("%ld", &number);
    a = 0;
    b = 1;
    c = 1;
    while (c < number) {
      a = b;
      b = c;
      c = a + b;
    }
    if (c == number) {
      printf("IsFibo\n");
    } else {
      printf("IsNotFibo\n");
    }
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
movq   $0x0,-0x10(%rbp)
lea    0xec2(%rip),%rdi
lea    -0x24(%rbp),%rsi
mov    $0x0,%al
call   1040 <scanf@plt>
movl   $0x0,-0x28(%rbp)
mov    -0x28(%rbp),%eax
cmp    -0x24(%rbp),%eax
jge    11f3 <main+0xd3>
lea    0xea0(%rip),%rdi
lea    -0x30(%rbp),%rsi
mov    $0x0,%al
call   1040 <scanf@plt>
movq   $0x0,-0x10(%rbp)
movq   $0x1,-0x18(%rbp)
movq   $0x1,-0x20(%rbp)
mov    -0x20(%rbp),%rax
cmp    -0x30(%rbp),%rax
jge    11b5 <main+0x95>
mov    -0x18(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x20(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rax
add    -0x18(%rbp),%rax
mov    %rax,-0x20(%rbp)
jmp    1186 <main+0x66>
mov    -0x20(%rbp),%rax
cmp    -0x30(%rbp),%rax
jne    11d4 <main+0xb4>
lea    0xe3d(%rip),%rdi
call   1030 <printf@plt>
jmp    11e0 <main+0xc0>
lea    0xe34(%rip),%rdi
call   1030 <printf@plt>
jmp    11e5 <main+0xc5>
mov    -0x28(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x28(%rbp)
jmp    1150 <main+0x30>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r12
push   %rbx
sub    $0x10,%rsp
lea    0xecd(%rip),%rdi
lea    0x4(%rsp),%rsi
xor    %eax,%eax
call   1040 <scanf@plt>
cmpl   $0x0,0x4(%rsp)
jle    11b6 <main+0x96>
lea    0xeb6(%rip),%r14
lea    0x8(%rsp),%r15
lea    0xeb8(%rip),%r12
lea    0xea7(%rip),%rbx
xor    %ebp,%ebp
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
mov    %r14,%rdi
mov    %r15,%rsi
xor    %eax,%eax
call   1040 <scanf@plt>
mov    $0x1,%ecx
mov    0x8(%rsp),%rax
mov    $0x1,%edx
nopl   0x0(%rax)
mov    %rcx,%rsi
add    %rdx,%rsi
mov    %rdx,%rcx
cmp    %rax,%rdx
mov    %rsi,%rdx
jl     1190 <main+0x70>
mov    %rbx,%rdi
cmove  %r12,%rdi
call   1030 <puts@plt>
add    $0x1,%ebp
cmp    0x4(%rsp),%ebp
jl     1170 <main+0x50>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
pop    %rbp
ret

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

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