#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 /*<<< orphan*/ scanf(char *, int *);
int main() {
  int t, n, g, i;
  scanf("%d", &t);
  while (t--) {
    scanf("%d", &n);
    g = 1;
    for (i = 0; i < n; ++i)
      if (i & 0x1)
        g |= 1;
      else
        g <<= 1;
    printf("%d\n", g);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1040 <scanf@plt>
mov    -0x8(%rbp),%eax
mov    %eax,%ecx
add    $0xffffffff,%ecx
mov    %ecx,-0x8(%rbp)
cmp    $0x0,%eax
je     11ca <main+0xaa>
lea    0xea6(%rip),%rdi
lea    -0xc(%rbp),%rsi
call   1040 <scanf@plt>
movl   $0x1,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    11b6 <main+0x96>
mov    -0x14(%rbp),%eax
and    $0x1,%eax
cmp    $0x0,%eax
je     119a <main+0x7a>
mov    -0x10(%rbp),%eax
or     $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    11a3 <main+0x83>
mov    -0x10(%rbp),%eax
shl    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    11a8 <main+0x88>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1171 <main+0x51>
mov    -0x10(%rbp),%esi
lea    0xe43(%rip),%rdi
call   1030 <printf@plt>
jmp    113f <main+0x1f>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %rbx
sub    $0x10,%rsp
lea    0xed0(%rip),%rdi
lea    0x8(%rsp),%rsi
call   1040 <scanf@plt>
subl   $0x1,0x8(%rsp)
jae    114d <main+0x2d>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret
lea    0xeac(%rip),%r14
lea    0xc(%rsp),%r15
lea    0xea3(%rip),%rbx
jmp    1184 <main+0x64>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
mov    $0x1,%esi
mov    %rbx,%rdi
call   1030 <printf@plt>
subl   $0x1,0x8(%rsp)
jb     1141 <main+0x21>
mov    %r14,%rdi
mov    %r15,%rsi
call   1040 <scanf@plt>
mov    0xc(%rsp),%edx
test   %edx,%edx
jle    1170 <main+0x50>
lea    -0x1(%rdx),%ecx
mov    %edx,%eax
and    $0x3,%eax
cmp    $0x3,%ecx
jae    11b0 <main+0x90>
mov    $0x1,%esi
xor    %ecx,%ecx
jmp    11ce <main+0xae>
nopl   (%rax)
and    $0xfffffffc,%edx
mov    $0x1,%esi
xor    %ecx,%ecx
nopw   0x0(%rax,%rax,1)
lea    0x3(,%rsi,4),%esi
add    $0x4,%ecx
cmp    %ecx,%edx
jne    11c0 <main+0xa0>
test   %eax,%eax
je     1175 <main+0x55>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
mov    %esi,%edx
or     $0x1,%edx
add    %esi,%esi
test   $0x1,%cl
cmovne %edx,%esi
add    $0x1,%ecx
add    $0xffffffff,%eax
jne    11e0 <main+0xc0>
jmp    1175 <main+0x55>

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

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