#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, int);
int /*<<< orphan*/ scanf(char *, int *);
int main(void) {
  int fib[2][41];
  int i, j;
  fib[0][0] = fib[1][1] = 1;
  fib[1][0] = fib[0][1] = 0;
  for (i = 2; i < 41; i++) {
    fib[0][i] = fib[0][i - 1] + fib[0][i - 2];
    fib[1][i] = fib[1][i - 1] + fib[1][i - 2];
  }
  for (scanf("%d", &i); i--;) {
    scanf("%d", &j);
    printf("%d %d\n", fib[0][j], fib[1][j]);
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x160,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x1,-0xa8(%rbp)
movl   $0x1,-0x150(%rbp)
movl   $0x0,-0x14c(%rbp)
movl   $0x0,-0xac(%rbp)
movl   $0x2,-0x154(%rbp)
cmpl   $0x29,-0x154(%rbp)
jge    11e9 <main+0xc9>
mov    -0x154(%rbp),%eax
sub    $0x1,%eax
cltq
mov    -0x150(%rbp,%rax,4),%ecx
mov    -0x154(%rbp),%eax
sub    $0x2,%eax
cltq
add    -0x150(%rbp,%rax,4),%ecx
movslq -0x154(%rbp),%rax
mov    %ecx,-0x150(%rbp,%rax,4)
mov    -0x154(%rbp),%eax
sub    $0x1,%eax
cltq
mov    -0xac(%rbp,%rax,4),%ecx
mov    -0x154(%rbp),%eax
sub    $0x2,%eax
cltq
add    -0xac(%rbp,%rax,4),%ecx
movslq -0x154(%rbp),%rax
mov    %ecx,-0xac(%rbp,%rax,4)
mov    -0x154(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x154(%rbp)
jmp    1164 <main+0x44>
lea    0xe10(%rip),%rdi
lea    -0x154(%rbp),%rsi
call   1040 <scanf@plt>
mov    -0x154(%rbp),%eax
mov    %eax,%ecx
add    $0xffffffff,%ecx
mov    %ecx,-0x154(%rbp)
cmp    $0x0,%eax
je     1256 <main+0x136>
lea    0xde3(%rip),%rdi
lea    -0x158(%rbp),%rsi
call   1040 <scanf@plt>
movslq -0x158(%rbp),%rax
mov    -0x150(%rbp,%rax,4),%esi
movslq -0x158(%rbp),%rax
mov    -0xac(%rbp,%rax,4),%edx
lea    0xdb7(%rip),%rdi
call   1030 <printf@plt>
jmp    11fc <main+0xdc>
mov    -0x4(%rbp),%eax
add    $0x160,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %rbx
sub    $0x160,%rsp
movq   $0x1,0x10(%rsp)
movabs $0x100000000,%rax
mov    %rax,0xb4(%rsp)
movl   $0x1,0x18(%rsp)
movl   $0x1,0xbc(%rsp)
mov    $0x1,%eax
xor    %ecx,%ecx
mov    $0x1,%edx
cs nopw 0x0(%rax,%rax,1)
add    0x14(%rsp,%rcx,4),%edx
add    0xb8(%rsp,%rcx,4),%eax
mov    %edx,0x1c(%rsp,%rcx,4)
mov    %eax,0xc0(%rsp,%rcx,4)
add    0x18(%rsp,%rcx,4),%edx
add    0xbc(%rsp,%rcx,4),%eax
mov    %edx,0x20(%rsp,%rcx,4)
mov    %eax,0xc4(%rsp,%rcx,4)
add    $0x2,%rcx
cmp    $0x26,%rcx
jne    1170 <main+0x50>
movl   $0x29,0x8(%rsp)
lea    0xe4b(%rip),%rdi
lea    0x8(%rsp),%rsi
call   1040 <scanf@plt>
subl   $0x1,0x8(%rsp)
jb     120a <main+0xea>
lea    0xe33(%rip),%r14
lea    0xc(%rsp),%r15
lea    0xe2a(%rip),%rbx
nopl   0x0(%rax)
mov    %r14,%rdi
mov    %r15,%rsi
call   1040 <scanf@plt>
movslq 0xc(%rsp),%rax
mov    0x10(%rsp,%rax,4),%esi
mov    0xb4(%rsp,%rax,4),%edx
mov    %rbx,%rdi
call   1030 <printf@plt>
subl   $0x1,0x8(%rsp)
jae    11e0 <main+0xc0>
xor    %eax,%eax
add    $0x160,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret

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

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