#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__ floor(int /*<<< orphan*/);
scalar_t__ ol(int);
int /*<<< orphan*/ printf(char *, int);
int /*<<< orphan*/ scanf(char *, int *);
int /*<<< orphan*/ sqrt(int);
int main() {
  int t, n, x, f, d;
  scanf("%d", &t);
  while (t--) {
    scanf("%d", &n);
    for (d = 0, f = 1, x = (int)floor(sqrt(n)) + 1; f < x; ++f)
      if (n % f == 0) {
        if (ol(f))
          d++;
        if (ol(n / f))
          d++;
      }
    printf("%d\n", d);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xe9a(%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     123a <main+0xea>
lea    0xe76(%rip),%rdi
lea    -0xc(%rbp),%rsi
call   1040 <scanf@plt>
movl   $0x0,-0x18(%rbp)
movl   $0x1,-0x14(%rbp)
mov    -0xc(%rbp),%edi
call   1060 <sqrt@plt>
mov    %eax,%edi
call   1070 <floor@plt>
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0x10(%rbp),%eax
jge    1226 <main+0xd6>
mov    -0xc(%rbp),%eax
cltd
idivl  -0x14(%rbp)
cmp    $0x0,%edx
jne    1213 <main+0xc3>
mov    -0x14(%rbp),%edi
call   1050 <ol@plt>
cmp    $0x0,%rax
je     11ed <main+0x9d>
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
mov    -0xc(%rbp),%eax
cltd
idivl  -0x14(%rbp)
mov    %eax,%edi
call   1050 <ol@plt>
cmp    $0x0,%rax
je     120e <main+0xbe>
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    1213 <main+0xc3>
jmp    1218 <main+0xc8>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    11b6 <main+0x66>
mov    -0x18(%rbp),%esi
lea    0xdd3(%rip),%rdi
call   1030 <printf@plt>
jmp    116f <main+0x1f>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
lea    0xe9e(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1040 <scanf@plt>
subl   $0x1,0x4(%rsp)
jae    1184 <main+0x34>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret
lea    0xe75(%rip),%r14
mov    %rsp,%r15
lea    0xe6e(%rip),%r12
jmp    11b3 <main+0x63>
nopw   0x0(%rax,%rax,1)
xor    %ebp,%ebp
mov    %r12,%rdi
mov    %ebp,%esi
call   1030 <printf@plt>
subl   $0x1,0x4(%rsp)
jb     1173 <main+0x23>
mov    %r14,%rdi
mov    %r15,%rsi
call   1040 <scanf@plt>
mov    (%rsp),%edi
call   1060 <sqrt@plt>
mov    %eax,%edi
call   1070 <floor@plt>
mov    %rax,%r13
test   %r13d,%r13d
jle    11a0 <main+0x50>
neg    %r13d
mov    $0x1,%ebx
xor    %ebp,%ebp
jmp    1203 <main+0xb3>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
lea    (%rbx,%r13,1),%eax
add    $0x1,%eax
mov    %ebx,%ecx
add    $0x1,%ecx
mov    %ecx,%ebx
cmp    $0x1,%eax
je     11a2 <main+0x52>
mov    (%rsp),%eax
cltd
idiv   %ebx
test   %edx,%edx
jne    11f0 <main+0xa0>
mov    %ebx,%edi
call   1050 <ol@plt>
cmp    $0x1,%rax
sbb    $0xffffffff,%ebp
mov    (%rsp),%eax
cltd
idiv   %ebx
mov    %eax,%edi
call   1050 <ol@plt>
cmp    $0x1,%rax
sbb    $0xffffffff,%ebp
jmp    11f0 <main+0xa0>

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
%6 = alloca i32
store i32 0, i32* %1
%7 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %2)
br label %8
8: ; preds = %49, %0
%9 = load i32, i32* %2
%10 = add nsw i32 %9, -1
store i32 %10, i32* %2
%11 = icmp ne i32 %9, 0
br i1 %11, label %12, label %52
12: ; preds = %8
%13 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %3)
store i32 0, i32* %6
store i32 1, i32* %5
%14 = load i32, i32* %3
%15 = call i32 @sqrt(i32 %14)
%16 = call i64 @floor(i32 %15)
%17 = trunc i64 %16 to i32
%18 = add nsw i32 %17, 1
store i32 %18, i32* %4
br label %19
19: ; preds = %46, %12
%20 = load i32, i32* %5
%21 = load i32, i32* %4
%22 = icmp slt i32 %20, %21
br i1 %22, label %23, label %49
23: ; preds = %19
%24 = load i32, i32* %3
%25 = load i32, i32* %5
%26 = srem i32 %24, %25
%27 = icmp eq i32 %26, 0
br i1 %27, label %28, label %45
28: ; preds = %23
%29 = load i32, i32* %5
%30 = call i64 @ol(i32 %29)
%31 = icmp ne i64 %30, 0
br i1 %31, label %32, label %35
32: ; preds = %28
%33 = load i32, i32* %6
%34 = add nsw i32 %33, 1
store i32 %34, i32* %6
br label %35
35: ; preds = %32, %28
%36 = load i32, i32* %3
%37 = load i32, i32* %5
%38 = sdiv i32 %36, %37
%39 = call i64 @ol(i32 %38)
%40 = icmp ne i64 %39, 0
br i1 %40, label %41, label %44
41: ; preds = %35
%42 = load i32, i32* %6
%43 = add nsw i32 %42, 1
store i32 %43, i32* %6
br label %44
44: ; preds = %41, %35
br label %45
45: ; preds = %44, %23
br label %46
46: ; preds = %45
%47 = load i32, i32* %5
%48 = add nsw i32 %47, 1
store i32 %48, i32* %5
br label %19
49: ; preds = %19
%50 = load i32, i32* %6
%51 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %50)
br label %8
52: ; preds = %8
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 %43, label %9
9: ; preds = %0, %37
%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 = call i32 @sqrt(i32 %11)
%13 = call i64 @floor(i32 %12)
%14 = trunc i64 %13 to i32
%15 = icmp slt i32 %14, 1
br i1 %15, label %37, label %16
16: ; preds = %9, %33
%17 = phi i32 [ %34, %33 ], [ 0, %9 ]
%18 = phi i32 [ %35, %33 ], [ 1, %9 ]
%19 = load i32, i32* %2
%20 = srem i32 %19, %18
%21 = icmp eq i32 %20, 0
br i1 %21, label %22, label %33
22: ; preds = %16
%23 = call i64 @ol(i32 %18)
%24 = icmp ne i64 %23, 0
%25 = zext i1 %24 to i32
%26 = add nsw i32 %17, %25
%27 = load i32, i32* %2
%28 = sdiv i32 %27, %18
%29 = call i64 @ol(i32 %28)
%30 = icmp ne i64 %29, 0
%31 = zext i1 %30 to i32
%32 = add nsw i32 %26, %31
br label %33
33: ; preds = %22, %16
%34 = phi i32 [ %17, %16 ], [ %32, %22 ]
%35 = add nuw i32 %18, 1
%36 = icmp eq i32 %18, %14
br i1 %36, label %37, label %16
37: ; preds = %33, %9
%38 = phi i32 [ 0, %9 ], [ %34, %33 ]
%39 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %38)
%40 = load i32, i32* %1
%41 = add nsw i32 %40, -1
store i32 %41, i32* %1
%42 = icmp eq i32 %40, 0
br i1 %42, label %43, label %9
43: ; preds = %37, %0
ret i32 0
}