#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 result;
  int i = 0;
  int testCases, cycles;
  scanf("%d", &testCases);
  while (testCases--) {
    result = 1;
    scanf("%d", &cycles);
    for (i = 0; i < cycles; i++) {
      if (i % 2 == 0)
        result *= 2;
      else
        result++;
    }
    printf("%d\n", result);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0xc(%rbp)
lea    0xec3(%rip),%rdi
lea    -0x10(%rbp),%rsi
call   1040 <scanf@plt>
mov    -0x10(%rbp),%eax
mov    %eax,%ecx
add    $0xffffffff,%ecx
mov    %ecx,-0x10(%rbp)
cmp    $0x0,%eax
je     11d6 <main+0xb6>
movl   $0x1,-0x8(%rbp)
lea    0xe98(%rip),%rdi
lea    -0x14(%rbp),%rsi
call   1040 <scanf@plt>
movl   $0x0,-0xc(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x14(%rbp),%eax
jge    11c2 <main+0xa2>
mov    -0xc(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
jne    11a6 <main+0x86>
mov    -0x8(%rbp),%eax
shl    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    11af <main+0x8f>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    11b4 <main+0x94>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1178 <main+0x58>
mov    -0x8(%rbp),%esi
lea    0xe37(%rip),%rdi
call   1030 <printf@plt>
jmp    1146 <main+0x26>
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)
lea    (%rsi,%rsi,1),%edx
add    $0x1,%esi
test   $0x1,%cl
cmove  %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
store i32 0, i32* %3
%6 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %4)
br label %7
7: ; preds = %31, %0
%8 = load i32, i32* %4
%9 = add nsw i32 %8, -1
store i32 %9, i32* %4
%10 = icmp ne i32 %8, 0
br i1 %10, label %11, label %34
11: ; preds = %7
store i32 1, i32* %2
%12 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %5)
store i32 0, i32* %3
br label %13
13: ; preds = %28, %11
%14 = load i32, i32* %3
%15 = load i32, i32* %5
%16 = icmp slt i32 %14, %15
br i1 %16, label %17, label %31
17: ; preds = %13
%18 = load i32, i32* %3
%19 = srem i32 %18, 2
%20 = icmp eq i32 %19, 0
br i1 %20, label %21, label %24
21: ; preds = %17
%22 = load i32, i32* %2
%23 = mul nsw i32 %22, 2
store i32 %23, i32* %2
br label %27
24: ; preds = %17
%25 = load i32, i32* %2
%26 = add nsw i32 %25, 1
store i32 %26, i32* %2
br label %27
27: ; preds = %24, %21
br label %28
28: ; preds = %27
%29 = load i32, i32* %3
%30 = add nsw i32 %29, 1
store i32 %30, i32* %3
br label %13
31: ; preds = %13
%32 = load i32, i32* %2
%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 = shl nsw i32 %35, 1
%40 = add nsw i32 %35, 1
%41 = select i1 %38, i32 %39, i32 %40
%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
}