#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*/);
int /*<<< orphan*/ scanf(char *, ...);
int /*<<< orphan*/ z(long long);
int main() {
  long int s = 0;
  long long int q;
  long long int num = 0;
  do {
    scanf("%ld", &s);
  } while (s <= 0 || s > 100000);
  for (q = 1; q <= s; q++) {
    do {
      scanf("%lld", &num);
    } while (num <= 0 || num > 1000000000);
    printf("%lld\n", z(num));
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
movq   $0x0,-0x10(%rbp)
movq   $0x0,-0x20(%rbp)
lea    0xeaa(%rip),%rdi
lea    -0x10(%rbp),%rsi
mov    $0x0,%al
call   1050 <scanf@plt>
mov    $0x1,%al
cmpq   $0x0,-0x10(%rbp)
mov    %al,-0x21(%rbp)
jle    117f <main+0x4f>
cmpq   $0x186a0,-0x10(%rbp)
setg   %al
mov    %al,-0x21(%rbp)
mov    -0x21(%rbp),%al
test   $0x1,%al
jne    114f <main+0x1f>
movq   $0x1,-0x18(%rbp)
mov    -0x18(%rbp),%rax
cmp    -0x10(%rbp),%rax
jg     1208 <main+0xd8>
jmp    11a5 <main+0x75>
lea    0xe58(%rip),%rdi
lea    -0x20(%rbp),%rsi
mov    $0x0,%al
call   1050 <scanf@plt>
mov    $0x1,%al
cmpq   $0x0,-0x20(%rbp)
mov    %al,-0x22(%rbp)
jle    11d5 <main+0xa5>
cmpq   $0x3b9aca00,-0x20(%rbp)
3b
setg   %al
mov    %al,-0x22(%rbp)
mov    -0x22(%rbp),%al
test   $0x1,%al
jne    11a5 <main+0x75>
mov    -0x20(%rbp),%rdi
call   1030 <z@plt>
mov    %eax,%esi
lea    0xe17(%rip),%rdi
call   1040 <printf@plt>
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
jmp    1192 <main+0x62>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %r12
push   %rbx
sub    $0x18,%rsp
movq   $0x0,0x8(%rsp)
movq   $0x0,0x10(%rsp)
lea    0xeac(%rip),%r14
lea    0x8(%rsp),%r15
mov    $0xfffffffffffe795f,%rbx
mov    %r14,%rdi
mov    %r15,%rsi
xor    %eax,%eax
call   1050 <scanf@plt>
mov    0x8(%rsp),%rax
add    %rbx,%rax
cmp    $0xfffffffffffe7960,%rax
jb     1160 <main+0x30>
mov    $0x1,%r12d
lea    0xe7a(%rip),%r14
lea    0x10(%rsp),%rbx
lea    0xe73(%rip),%r15
cs nopw 0x0(%rax,%rax,1)
mov    %r14,%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1050 <scanf@plt>
mov    0x10(%rsp),%rdi
lea    -0x3b9aca01(%rdi),%rax
cmp    $0xffffffffc4653600,%rax
jb     11a0 <main+0x70>
call   1030 <z@plt>
mov    %r15,%rdi
mov    %eax,%esi
call   1040 <printf@plt>
lea    0x1(%r12),%rax
cmp    0x8(%rsp),%r12
mov    %rax,%r12
jl     11a0 <main+0x70>
xor    %eax,%eax
add    $0x18,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
@.str = [4 x i8] c"%ld\00"
@.str.1 = [5 x i8] c"%lld\00"
@.str.2 = [6 x i8] c"%lld\0A\00"
define i32 @main() {
%1 = alloca i64
%2 = alloca i64
%3 = bitcast i64* %1 to i8*
store i64 0, i64* %1
%4 = bitcast i64* %2 to i8*
store i64 0, i64* %2
br label %5
5: ; preds = %5, %0
%6 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i64* %1)
%7 = load i64, i64* %1
%8 = add i64 %7, -100001
%9 = icmp ult i64 %8, -100000
br i1 %9, label %5, label %10
10: ; preds = %5, %17
%11 = phi i64 [ %20, %17 ], [ 1, %5 ]
br label %12
12: ; preds = %10, %12
%13 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i64* %2)
%14 = load i64, i64* %2
%15 = add i64 %14, -1000000001
%16 = icmp ult i64 %15, -1000000000
br i1 %16, label %12, label %17
17: ; preds = %12
%18 = call i32 @z(i64 %14)
%19 = call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0), i32 %18)
%20 = add nuw nsw i64 %11, 1
%21 = load i64, i64* %1
%22 = icmp slt i64 %11, %21
br i1 %22, label %10, label %23
23: ; preds = %17
ret i32 0
}