#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 */
scalar_t__ EOF;
int /*<<< orphan*/ printf(char *, int);
scalar_t__ scanf(char *, int *);
int main() {
  int n, i, i2, i3, j;
  int a[128];
  for (i = 1; i <= 10; i++) {
    i2 = i * i;
    i3 = i2 + 2 * i + 1;
    for (j = i2; j < i3; a[j++] = i)
      ;
  }
  scanf("%d", &n);
  while (n--) {
    if ((scanf("%d", &i) != EOF) && (i > 0))
      printf("%d\n", a[i]);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x220,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x1,-0xc(%rbp)
cmpl   $0xa,-0xc(%rbp)
jg     11a4 <main+0x84>
mov    -0xc(%rbp),%eax
imul   -0xc(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
mov    -0xc(%rbp),%ecx
shl    $0x1,%ecx
add    %ecx,%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
mov    -0x10(%rbp),%eax
mov    %eax,-0x18(%rbp)
mov    -0x18(%rbp),%eax
cmp    -0x14(%rbp),%eax
jge    1191 <main+0x71>
jmp    1175 <main+0x55>
mov    -0xc(%rbp),%ecx
mov    -0x18(%rbp),%eax
mov    %eax,%edx
add    $0x1,%edx
mov    %edx,-0x18(%rbp)
cltq
mov    %ecx,-0x220(%rbp,%rax,4)
jmp    1164 <main+0x44>
jmp    1196 <main+0x76>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1139 <main+0x19>
lea    0xe55(%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     120e <main+0xee>
lea    0xe31(%rip),%rdi
lea    -0xc(%rbp),%rsi
call   1040 <scanf@plt>
mov    0x2e09(%rip),%rcx
cmp    (%rcx),%rax
je     1209 <main+0xe9>
cmpl   $0x0,-0xc(%rbp)
jle    1209 <main+0xe9>
movslq -0xc(%rbp),%rax
mov    -0x220(%rbp,%rax,4),%esi
lea    0xdff(%rip),%rdi
call   1030 <printf@plt>
jmp    11b4 <main+0x94>
xor    %eax,%eax
add    $0x220,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %r12
push   %rbx
sub    $0x218,%rsp
movaps 0xecb(%rip),%xmm0
movups %xmm0,0x14(%rsp)
movaps 0xecf(%rip),%xmm0
movups %xmm0,0x24(%rsp)
movaps 0xed3(%rip),%xmm0
movups %xmm0,0x34(%rsp)
movaps 0xed7(%rip),%xmm0
movups %xmm0,0x44(%rsp)
movaps 0xedb(%rip),%xmm0
movups %xmm0,0x54(%rsp)
movups %xmm0,0x64(%rsp)
movaps 0xeda(%rip),%xmm0
movups %xmm0,0x74(%rsp)
movups %xmm0,0x84(%rsp)
movaps 0xed6(%rip),%xmm0
movups %xmm0,0x94(%rsp)
movaps 0xed7(%rip),%xmm0
movups %xmm0,0xa4(%rsp)
movups %xmm0,0xb4(%rsp)
movups %xmm0,0xc4(%rsp)
movaps 0xec8(%rip),%xmm0
movups %xmm0,0xd4(%rsp)
movups %xmm0,0xe4(%rsp)
movups %xmm0,0xf4(%rsp)
movaps 0xeb9(%rip),%xmm0
movups %xmm0,0x104(%rsp)
movaps 0xeba(%rip),%xmm0
movups %xmm0,0x114(%rsp)
movups %xmm0,0x124(%rsp)
movups %xmm0,0x134(%rsp)
movups %xmm0,0x144(%rsp)
movaps 0xea3(%rip),%xmm0
movups %xmm0,0x154(%rsp)
movups %xmm0,0x164(%rsp)
movups %xmm0,0x174(%rsp)
movups %xmm0,0x184(%rsp)
movaps 0xe8c(%rip),%xmm0
movups %xmm0,0x194(%rsp)
movaps 0xe8d(%rip),%xmm0
movups %xmm0,0x1a4(%rsp)
movups %xmm0,0x1b4(%rsp)
movups %xmm0,0x1c4(%rsp)
movups %xmm0,0x1d4(%rsp)
movups %xmm0,0x1e4(%rsp)
movl   $0xb,0x8(%rsp)
lea    0xe66(%rip),%rdi
lea    0xc(%rsp),%rsi
call   1040 <scanf@plt>
subl   $0x1,0xc(%rsp)
jae    129c <main+0x17c>
xor    %eax,%eax
add    $0x218,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret
lea    0xe3d(%rip),%r14
lea    0x8(%rsp),%r12
mov    0x2d39(%rip),%rbx
lea    0xe2d(%rip),%r15
jmp    12c7 <main+0x1a7>
nopl   0x0(%rax,%rax,1)
subl   $0x1,0xc(%rsp)
jb     128b <main+0x16b>
mov    %r14,%rdi
mov    %r12,%rsi
call   1040 <scanf@plt>
cmp    (%rbx),%rax
je     12c0 <main+0x1a0>
mov    0x8(%rsp),%eax
test   %eax,%eax
jle    12c0 <main+0x1a0>
mov    0x10(%rsp,%rax,4),%esi
mov    %r15,%rdi
call   1030 <printf@plt>
jmp    12c0 <main+0x1a0>

LLVM IR (-O0):
@.str = [3 x i8] c"%d\00"
@EOF = global i64 0
@.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
%6 = alloca i32
%7 = alloca [128 x i32]
store i32 0, i32* %1
store i32 1, i32* %3
br label %8
8: ; preds = %33, %0
%9 = load i32, i32* %3
%10 = icmp sle i32 %9, 10
br i1 %10, label %11, label %36
11: ; preds = %8
%12 = load i32, i32* %3
%13 = load i32, i32* %3
%14 = mul nsw i32 %12, %13
store i32 %14, i32* %4
%15 = load i32, i32* %4
%16 = load i32, i32* %3
%17 = mul nsw i32 2, %16
%18 = add nsw i32 %15, %17
%19 = add nsw i32 %18, 1
store i32 %19, i32* %5
%20 = load i32, i32* %4
store i32 %20, i32* %6
br label %21
21: ; preds = %26, %11
%22 = load i32, i32* %6
%23 = load i32, i32* %5
%24 = icmp slt i32 %22, %23
br i1 %24, label %25, label %32
25: ; preds = %21
br label %26
26: ; preds = %25
%27 = load i32, i32* %3
%28 = load i32, i32* %6
%29 = add nsw i32 %28, 1
store i32 %29, i32* %6
%30 = sext i32 %28 to i64
%31 = getelementptr inbounds [128 x i32], [128 x i32]* %7, i64 0, i64 %30
store i32 %27, i32* %31
br label %21
32: ; preds = %21
br label %33
33: ; preds = %32
%34 = load i32, i32* %3
%35 = add nsw i32 %34, 1
store i32 %35, i32* %3
br label %8
36: ; preds = %8
%37 = call i64 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %2)
br label %38
38: ; preds = %55, %36
%39 = load i32, i32* %2
%40 = add nsw i32 %39, -1
store i32 %40, i32* %2
%41 = icmp ne i32 %39, 0
br i1 %41, label %42, label %56
42: ; preds = %38
%43 = call i64 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %3)
%44 = load i64, i64* @EOF
%45 = icmp ne i64 %43, %44
br i1 %45, label %46, label %55
46: ; preds = %42
%47 = load i32, i32* %3
%48 = icmp sgt i32 %47, 0
br i1 %48, label %49, label %55
49: ; preds = %46
%50 = load i32, i32* %3
%51 = sext i32 %50 to i64
%52 = getelementptr inbounds [128 x i32], [128 x i32]* %7, i64 0, i64 %51
%53 = load i32, i32* %52
%54 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %53)
br label %55
55: ; preds = %49, %46, %42
br label %38
56: ; preds = %38
ret i32 0
}

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
@EOF = global i64 0
@.str.1 = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca [128 x i32]
%4 = bitcast i32* %1 to i8*
%5 = bitcast i32* %2 to i8*
%6 = bitcast [128 x i32]* %3 to i8*
%7 = getelementptr inbounds [128 x i32], [128 x i32]* %3, i64 0, i64 1
%8 = bitcast i32* %7 to <4 x i32>*
store <4 x i32> <i32 1, i32 1, i32 1, i32 2>, <4 x i32>* %8
%9 = getelementptr inbounds [128 x i32], [128 x i32]* %3, i64 0, i64 5
%10 = bitcast i32* %9 to <4 x i32>*
store <4 x i32> <i32 2, i32 2, i32 2, i32 2>, <4 x i32>* %10
%11 = getelementptr inbounds [128 x i32], [128 x i32]* %3, i64 0, i64 9
%12 = bitcast i32* %11 to <4 x i32>*
store <4 x i32> <i32 3, i32 3, i32 3, i32 3>, <4 x i32>* %12
%13 = getelementptr inbounds [128 x i32], [128 x i32]* %3, i64 0, i64 13
%14 = bitcast i32* %13 to <4 x i32>*
store <4 x i32> <i32 3, i32 3, i32 3, i32 4>, <4 x i32>* %14
%15 = getelementptr inbounds [128 x i32], [128 x i32]* %3, i64 0, i64 17
%16 = bitcast i32* %15 to <4 x i32>*
store <4 x i32> <i32 4, i32 4, i32 4, i32 4>, <4 x i32>* %16
%17 = getelementptr inbounds [128 x i32], [128 x i32]* %3, i64 0, i64 21
%18 = bitcast i32* %17 to <4 x i32>*
store <4 x i32> <i32 4, i32 4, i32 4, i32 4>, <4 x i32>* %18
%19 = getelementptr inbounds [128 x i32], [128 x i32]* %3, i64 0, i64 25
%20 = bitcast i32* %19 to <4 x i32>*
store <4 x i32> <i32 5, i32 5, i32 5, i32 5>, <4 x i32>* %20
%21 = getelementptr inbounds [128 x i32], [128 x i32]* %3, i64 0, i64 29
%22 = bitcast i32* %21 to <4 x i32>*
store <4 x i32> <i32 5, i32 5, i32 5, i32 5>, <4 x i32>* %22
%23 = getelementptr inbounds [128 x i32], [128 x i32]* %3, i64 0, i64 33
%24 = bitcast i32* %23 to <4 x i32>*
store <4 x i32> <i32 5, i32 5, i32 5, i32 6>, <4 x i32>* %24
%25 = getelementptr inbounds [128 x i32], [128 x i32]* %3, i64 0, i64 37
%26 = bitcast i32* %25 to <4 x i32>*
store <4 x i32> <i32 6, i32 6, i32 6, i32 6>, <4 x i32>* %26
%27 = getelementptr inbounds [128 x i32], [128 x i32]* %3, i64 0, i64 41
%28 = bitcast i32* %27 to <4 x i32>*
store <4 x i32> <i32 6, i32 6, i32 6, i32 6>, <4 x i32>* %28
%29 = getelementptr inbounds [128 x i32], [128 x i32]* %3, i64 0, i64 45
%30 = bitcast i32* %29 to <4 x i32>*
store <4 x i32> <i32 6, i32 6, i32 6, i32 6>, <4 x i32>* %30
%31 = getelementptr inbounds [128 x i32], [128 x i32]* %3, i64 0, i64 49
%32 = bitcast i32* %31 to <4 x i32>*
store <4 x i32> <i32 7, i32 7, i32 7, i32 7>, <4 x i32>* %32
%33 = getelementptr inbounds [128 x i32], [128 x i32]* %3, i64 0, i64 53
%34 = bitcast i32* %33 to <4 x i32>*
store <4 x i32> <i32 7, i32 7, i32 7, i32 7>, <4 x i32>* %34
%35 = getelementptr inbounds [128 x i32], [128 x i32]* %3, i64 0, i64 57
%36 = bitcast i32* %35 to <4 x i32>*
store <4 x i32> <i32 7, i32 7, i32 7, i32 7>, <4 x i32>* %36
%37 = getelementptr inbounds [128 x i32], [128 x i32]* %3, i64 0, i64 61
%38 = bitcast i32* %37 to <4 x i32>*
store <4 x i32> <i32 7, i32 7, i32 7, i32 8>, <4 x i32>* %38
%39 = getelementptr inbounds [128 x i32], [128 x i32]* %3, i64 0, i64 65
%40 = bitcast i32* %39 to <4 x i32>*
store <4 x i32> <i32 8, i32 8, i32 8, i32 8>, <4 x i32>* %40
%41 = getelementptr inbounds [128 x i32], [128 x i32]* %3, i64 0, i64 69
%42 = bitcast i32* %41 to <4 x i32>*
store <4 x i32> <i32 8, i32 8, i32 8, i32 8>, <4 x i32>* %42
%43 = getelementptr inbounds [128 x i32], [128 x i32]* %3, i64 0, i64 73
%44 = bitcast i32* %43 to <4 x i32>*
store <4 x i32> <i32 8, i32 8, i32 8, i32 8>, <4 x i32>* %44
%45 = getelementptr inbounds [128 x i32], [128 x i32]* %3, i64 0, i64 77
%46 = bitcast i32* %45 to <4 x i32>*
store <4 x i32> <i32 8, i32 8, i32 8, i32 8>, <4 x i32>* %46
%47 = getelementptr inbounds [128 x i32], [128 x i32]* %3, i64 0, i64 81
%48 = bitcast i32* %47 to <4 x i32>*
store <4 x i32> <i32 9, i32 9, i32 9, i32 9>, <4 x i32>* %48
%49 = getelementptr inbounds [128 x i32], [128 x i32]* %3, i64 0, i64 85
%50 = bitcast i32* %49 to <4 x i32>*
store <4 x i32> <i32 9, i32 9, i32 9, i32 9>, <4 x i32>* %50
%51 = getelementptr inbounds [128 x i32], [128 x i32]* %3, i64 0, i64 89
%52 = bitcast i32* %51 to <4 x i32>*
store <4 x i32> <i32 9, i32 9, i32 9, i32 9>, <4 x i32>* %52
%53 = getelementptr inbounds [128 x i32], [128 x i32]* %3, i64 0, i64 93
%54 = bitcast i32* %53 to <4 x i32>*
store <4 x i32> <i32 9, i32 9, i32 9, i32 9>, <4 x i32>* %54
%55 = getelementptr inbounds [128 x i32], [128 x i32]* %3, i64 0, i64 97
%56 = bitcast i32* %55 to <4 x i32>*
store <4 x i32> <i32 9, i32 9, i32 9, i32 10>, <4 x i32>* %56
%57 = getelementptr inbounds [128 x i32], [128 x i32]* %3, i64 0, i64 101
%58 = bitcast i32* %57 to <4 x i32>*
store <4 x i32> <i32 10, i32 10, i32 10, i32 10>, <4 x i32>* %58
%59 = getelementptr inbounds [128 x i32], [128 x i32]* %3, i64 0, i64 105
%60 = bitcast i32* %59 to <4 x i32>*
store <4 x i32> <i32 10, i32 10, i32 10, i32 10>, <4 x i32>* %60
%61 = getelementptr inbounds [128 x i32], [128 x i32]* %3, i64 0, i64 109
%62 = bitcast i32* %61 to <4 x i32>*
store <4 x i32> <i32 10, i32 10, i32 10, i32 10>, <4 x i32>* %62
%63 = getelementptr inbounds [128 x i32], [128 x i32]* %3, i64 0, i64 113
%64 = bitcast i32* %63 to <4 x i32>*
store <4 x i32> <i32 10, i32 10, i32 10, i32 10>, <4 x i32>* %64
%65 = getelementptr inbounds [128 x i32], [128 x i32]* %3, i64 0, i64 117
%66 = bitcast i32* %65 to <4 x i32>*
store <4 x i32> <i32 10, i32 10, i32 10, i32 10>, <4 x i32>* %66
store i32 11, i32* %2
%67 = call i64 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %1)
%68 = load i32, i32* %1
%69 = add nsw i32 %68, -1
store i32 %69, i32* %1
%70 = icmp eq i32 %68, 0
br i1 %70, label %87, label %71
71: ; preds = %0, %83
%72 = call i64 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %2)
%73 = load i64, i64* @EOF
%74 = icmp ne i64 %72, %73
%75 = load i32, i32* %2
%76 = icmp sgt i32 %75, 0
%77 = select i1 %74, i1 %76, i1 false
br i1 %77, label %78, label %83
78: ; preds = %71
%79 = zext i32 %75 to i64
%80 = getelementptr inbounds [128 x i32], [128 x i32]* %3, i64 0, i64 %79
%81 = load i32, i32* %80
%82 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %81)
br label %83
83: ; preds = %78, %71
%84 = load i32, i32* %1
%85 = add nsw i32 %84, -1
store i32 %85, i32* %1
%86 = icmp eq i32 %84, 0
br i1 %86, label %87, label %71
87: ; preds = %83, %0
ret i32 0
}