#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*/ naive_printf(char *, int /*<<< orphan*/);
int /*<<< orphan*/ naive_scanf(char *, int *);
int /*<<< orphan*/ solve(int);
int program_main() {
  int i;
  int N, T;
  naive_scanf("%d", &T);
  for (i = 0; i < T; i++) {
    naive_scanf("%d", &N);
    naive_printf("%d\n", solve(N));
  }
  return 0;
}


x86 assembly (clang, -O0):
<program_main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xec1(%rip),%rdi
lea    -0xc(%rbp),%rsi
call   1040 <naive_scanf@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    118f <program_main+0x5f>
lea    0xe9e(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1040 <naive_scanf@plt>
mov    -0x8(%rbp),%edi
call   1030 <solve@plt>
mov    %eax,%esi
lea    0xe87(%rip),%rdi
call   1050 <naive_printf@plt>
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    114f <program_main+0x1f>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<program_main>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
lea    0xec2(%rip),%rdi
mov    %rsp,%rsi
call   1040 <naive_scanf@plt>
cmpl   $0x0,(%rsp)
jle    1196 <program_main+0x66>
xor    %ebp,%ebp
lea    0xeab(%rip),%r14
lea    0x4(%rsp),%r15
lea    0xea2(%rip),%rbx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    %r14,%rdi
mov    %r15,%rsi
call   1040 <naive_scanf@plt>
mov    0x4(%rsp),%edi
call   1030 <solve@plt>
mov    %rbx,%rdi
mov    %eax,%esi
call   1050 <naive_printf@plt>
add    $0x1,%ebp
cmp    (%rsp),%ebp
jl     1170 <program_main+0x40>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%d\00"
@.str.1 = [4 x i8] c"%d\0A\00"
define i32 @program_main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = call i32 @naive_scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %3)
store i32 0, i32* %1
br label %5
5: ; preds = %14, %0
%6 = load i32, i32* %1
%7 = load i32, i32* %3
%8 = icmp slt i32 %6, %7
br i1 %8, label %9, label %17
9: ; preds = %5
%10 = call i32 @naive_scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %2)
%11 = load i32, i32* %2
%12 = call i32 @solve(i32 %11)
%13 = call i32 @naive_printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %12)
br label %14
14: ; preds = %9
%15 = load i32, i32* %1
%16 = add nsw i32 %15, 1
store i32 %16, i32* %1
br label %5
17: ; preds = %5
ret i32 0
}

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
@.str.1 = [4 x i8] c"%d\0A\00"
define i32 @program_main() {
%1 = alloca i32
%2 = alloca i32
%3 = bitcast i32* %1 to i8*
%4 = bitcast i32* %2 to i8*
%5 = call i32 @naive_scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %2)
%6 = load i32, i32* %2
%7 = icmp sgt i32 %6, 0
br i1 %7, label %8, label %17
8: ; preds = %0, %8
%9 = phi i32 [ %14, %8 ], [ 0, %0 ]
%10 = call i32 @naive_scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %1)
%11 = load i32, i32* %1
%12 = call i32 @solve(i32 %11)
%13 = call i32 @naive_printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %12)
%14 = add nuw nsw i32 %9, 1
%15 = load i32, i32* %2
%16 = icmp slt i32 %14, %15
br i1 %16, label %8, label %17
17: ; preds = %8, %0
ret i32 0
}