#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*/ compute_primes();
int /*<<< orphan*/ fastscan(int *);
int /*<<< orphan*/ printf(char *, unsigned long);
unsigned long solve(int);
int main() {
  compute_primes();
  int t;
  fastscan(&t);
  while (t--) {
    int n = 0;
    fastscan(&n);
    unsigned long res = solve(n);
    printf("%lu\n", res);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1040 <compute_primes@plt>
lea    -0x8(%rbp),%rdi
call   1060 <fastscan@plt>
mov    -0x8(%rbp),%eax
mov    %eax,%ecx
add    $0xffffffff,%ecx
mov    %ecx,-0x8(%rbp)
cmp    $0x0,%eax
je     11a4 <main+0x64>
movl   $0x0,-0xc(%rbp)
lea    -0xc(%rbp),%rdi
call   1060 <fastscan@plt>
mov    -0xc(%rbp),%edi
call   1030 <solve@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rsi
lea    0xe66(%rip),%rdi
call   1050 <printf@plt>
jmp    115f <main+0x1f>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
push   %rax
xor    %eax,%eax
call   1040 <compute_primes@plt>
lea    0x4(%rsp),%rdi
call   1060 <fastscan@plt>
subl   $0x1,0x4(%rsp)
jb     1199 <main+0x59>
mov    %rsp,%r14
lea    0xe9a(%rip),%rbx
cs nopw 0x0(%rax,%rax,1)
movl   $0x0,(%rsp)
mov    %r14,%rdi
call   1060 <fastscan@plt>
mov    (%rsp),%edi
call   1030 <solve@plt>
mov    %rbx,%rdi
mov    %rax,%rsi
call   1050 <printf@plt>
subl   $0x1,0x4(%rsp)
jae    1170 <main+0x30>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [5 x i8] c"%lu\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i64
store i32 0, i32* %1
%5 = call i32 (...) @compute_primes()
%6 = call i32 @fastscan(i32* %2)
br label %7
7: ; preds = %11, %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 %17
11: ; preds = %7
store i32 0, i32* %3
%12 = call i32 @fastscan(i32* %3)
%13 = load i32, i32* %3
%14 = call i64 @solve(i32 %13)
store i64 %14, i64* %4
%15 = load i64, i64* %4
%16 = call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i64 %15)
br label %7
17: ; preds = %7
ret i32 0
}

LLVM IR (-O2):
@.str = [5 x i8] c"%lu\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = tail call i32 (...) @compute_primes()
%4 = bitcast i32* %1 to i8*
%5 = call i32 @fastscan(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 %19, label %9
9: ; preds = %0
%10 = bitcast i32* %2 to i8*
br label %11
11: ; preds = %9, %11
store i32 0, i32* %2
%12 = call i32 @fastscan(i32* %2)
%13 = load i32, i32* %2
%14 = call i64 @solve(i32 %13)
%15 = call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i64 %14)
%16 = load i32, i32* %1
%17 = add nsw i32 %16, -1
store i32 %17, i32* %1
%18 = icmp eq i32 %16, 0
br i1 %18, label %19, label %11
19: ; preds = %11, %0
ret i32 0
}