#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*/ scanf(char *, long long *);
long long sqrt(long long);
int main() {
  long long n, t, i;
  scanf("%lld", &t);
  for (i = 1; i <= t; i++) {
    scanf("%lld", &n);
    long long p, q, root = sqrt(n), c = 0;
    printf("Case #%lld: %lld", i, n);
    for (p = 2; p <= root; p++) {
      if (n % p == 0 && p != n / p) {
        printf(" = %lld * %lld", n / p, p);
        c++;
      }
      if (c == 2)
        break;
    }
    printf("\n");
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xed5(%rip),%rdi
lea    -0x18(%rbp),%rsi
call   1040 <scanf@plt>
movq   $0x1,-0x20(%rbp)
mov    -0x20(%rbp),%rax
cmp    -0x18(%rbp),%rax
jg     125c <main+0x12c>
lea    0xeaf(%rip),%rdi
lea    -0x10(%rbp),%rsi
call   1040 <scanf@plt>
mov    -0x10(%rbp),%rdi
call   1050 <sqrt@plt>
mov    %rax,-0x38(%rbp)
movq   $0x0,-0x40(%rbp)
mov    -0x20(%rbp),%rsi
mov    -0x10(%rbp),%rdx
lea    0xe67(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movq   $0x2,-0x28(%rbp)
mov    -0x28(%rbp),%rax
cmp    -0x38(%rbp),%rax
jg     123d <main+0x10d>
mov    -0x10(%rbp),%rax
cqto
idivq  -0x28(%rbp)
cmp    $0x0,%rdx
jne    1217 <main+0xe7>
mov    -0x28(%rbp),%rax
mov    %rax,-0x48(%rbp)
mov    -0x10(%rbp),%rax
cqto
idivq  -0x28(%rbp)
mov    %rax,%rcx
mov    -0x48(%rbp),%rax
cmp    %rcx,%rax
je     1217 <main+0xe7>
mov    -0x10(%rbp),%rax
cqto
idivq  -0x28(%rbp)
mov    %rax,%rsi
mov    -0x28(%rbp),%rdx
lea    0xe0d(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x40(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x40(%rbp)
cmpq   $0x2,-0x40(%rbp)
jne    1227 <main+0xf7>
jmp    123d <main+0x10d>
jmp    122c <main+0xfc>
mov    -0x28(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x28(%rbp)
jmp    11a8 <main+0x78>
lea    0xddc(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x20(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x20(%rbp)
jmp    1157 <main+0x27>
xor    %eax,%eax
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x18,%rsp
lea    0xec6(%rip),%rdi
lea    0x10(%rsp),%rsi
call   1050 <scanf@plt>
cmpq   $0x0,0x10(%rsp)
jle    125d <main+0x11d>
mov    $0x1,%ebx
lea    0xe89(%rip),%r12
lea    0xe93(%rip),%r13
jmp    119c <main+0x5c>
mov    $0xa,%edi
call   1030 <putchar@plt>
lea    0x1(%rbx),%rax
cmp    0x10(%rsp),%rbx
mov    %rax,%rbx
jge    125d <main+0x11d>
lea    0xe78(%rip),%rdi
lea    0x8(%rsp),%rsi
call   1050 <scanf@plt>
mov    0x8(%rsp),%rdi
call   1060 <sqrt@plt>
mov    %rax,%rbp
mov    0x8(%rsp),%rdx
mov    %r12,%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1040 <printf@plt>
cmp    $0x2,%rbp
jl     1180 <main+0x40>
mov    $0x1,%r14d
sub    %rbp,%r14
mov    $0x2,%ebp
xor    %r15d,%r15d
jmp    1206 <main+0xc6>
cs nopw 0x0(%rax,%rax,1)
nop
lea    (%r14,%rbp,1),%rax
add    $0x1,%rax
add    $0x1,%rbp
cmp    $0x2,%rax
je     1180 <main+0x40>
mov    0x8(%rsp),%rax
mov    %rax,%rcx
or     %rbp,%rcx
shr    $0x20,%rcx
je     1230 <main+0xf0>
cqto
idiv   %rbp
test   %rdx,%rdx
je     1239 <main+0xf9>
jmp    11f0 <main+0xb0>
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
xor    %edx,%edx
div    %ebp
test   %rdx,%rdx
jne    11f0 <main+0xb0>
cmp    %rax,%rbp
je     11f0 <main+0xb0>
mov    %r13,%rdi
mov    %rax,%rsi
mov    %rbp,%rdx
xor    %eax,%eax
call   1040 <printf@plt>
add    $0x1,%r15
cmp    $0x2,%r15
jne    11f0 <main+0xb0>
jmp    1180 <main+0x40>
xor    %eax,%eax
add    $0x18,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [5 x i8] c"%lld\00"
@.str.1 = [17 x i8] c"Case #%lld: %lld\00"
@.str.2 = [15 x i8] c" = %lld * %lld\00"
@.str.3 = [2 x i8] c"\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i64
%3 = alloca i64
%4 = alloca i64
%5 = alloca i64
%6 = alloca i64
%7 = alloca i64
%8 = alloca i64
store i32 0, i32* %1
%9 = call i32 @scanf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i64* %3)
store i64 1, i64* %4
br label %10
10: ; preds = %54, %0
%11 = load i64, i64* %4
%12 = load i64, i64* %3
%13 = icmp sle i64 %11, %12
br i1 %13, label %14, label %57
14: ; preds = %10
%15 = call i32 @scanf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i64* %2)
%16 = load i64, i64* %2
%17 = call i64 @sqrt(i64 %16)
store i64 %17, i64* %7
store i64 0, i64* %8
%18 = load i64, i64* %4
%19 = load i64, i64* %2
%20 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.1, i64 0, i64 0), i64 %18, i64 %19)
store i64 2, i64* %5
br label %21
21: ; preds = %49, %14
%22 = load i64, i64* %5
%23 = load i64, i64* %7
%24 = icmp sle i64 %22, %23
br i1 %24, label %25, label %52
25: ; preds = %21
%26 = load i64, i64* %2
%27 = load i64, i64* %5
%28 = srem i64 %26, %27
%29 = icmp eq i64 %28, 0
br i1 %29, label %30, label %44
30: ; preds = %25
%31 = load i64, i64* %5
%32 = load i64, i64* %2
%33 = load i64, i64* %5
%34 = sdiv i64 %32, %33
%35 = icmp ne i64 %31, %34
br i1 %35, label %36, label %44
36: ; preds = %30
%37 = load i64, i64* %2
%38 = load i64, i64* %5
%39 = sdiv i64 %37, %38
%40 = load i64, i64* %5
%41 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.2, i64 0, i64 0), i64 %39, i64 %40)
%42 = load i64, i64* %8
%43 = add nsw i64 %42, 1
store i64 %43, i64* %8
br label %44
44: ; preds = %36, %30, %25
%45 = load i64, i64* %8
%46 = icmp eq i64 %45, 2
br i1 %46, label %47, label %48
47: ; preds = %44
br label %52
48: ; preds = %44
br label %49
49: ; preds = %48
%50 = load i64, i64* %5
%51 = add nsw i64 %50, 1
store i64 %51, i64* %5
br label %21
52: ; preds = %47, %21
%53 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0))
br label %54
54: ; preds = %52
%55 = load i64, i64* %4
%56 = add nsw i64 %55, 1
store i64 %56, i64* %4
br label %10
57: ; preds = %10
ret i32 0
}

LLVM IR (-O2):
@.str = [5 x i8] c"%lld\00"
@.str.1 = [17 x i8] c"Case #%lld: %lld\00"
@.str.2 = [15 x i8] c" = %lld * %lld\00"
define i32 @main() {
%1 = alloca i64
%2 = alloca i64
%3 = bitcast i64* %1 to i8*
%4 = bitcast i64* %2 to i8*
%5 = call i32 @scanf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i64* %2)
%6 = load i64, i64* %2
%7 = icmp slt i64 %6, 1
br i1 %7, label %38, label %8
8: ; preds = %0, %33
%9 = phi i64 [ %35, %33 ], [ 1, %0 ]
%10 = call i32 @scanf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i64* %1)
%11 = load i64, i64* %1
%12 = call i64 @sqrt(i64 %11)
%13 = load i64, i64* %1
%14 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @.str.1, i64 0, i64 0), i64 %9, i64 %13)
%15 = icmp slt i64 %12, 2
br i1 %15, label %33, label %16
16: ; preds = %8, %29
%17 = phi i64 [ %30, %29 ], [ 0, %8 ]
%18 = phi i64 [ %31, %29 ], [ 2, %8 ]
%19 = load i64, i64* %1
%20 = srem i64 %19, %18
%21 = sdiv i64 %19, %18
%22 = icmp ne i64 %20, 0
%23 = icmp eq i64 %18, %21
%24 = or i1 %22, %23
br i1 %24, label %29, label %25
25: ; preds = %16
%26 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @.str.2, i64 0, i64 0), i64 %21, i64 %18)
%27 = add nsw i64 %17, 1
%28 = icmp eq i64 %27, 2
br i1 %28, label %33, label %29
29: ; preds = %16, %25
%30 = phi i64 [ %27, %25 ], [ %17, %16 ]
%31 = add nuw i64 %18, 1
%32 = icmp eq i64 %18, %12
br i1 %32, label %33, label %16
33: ; preds = %29, %25, %8
%34 = call i32 @putchar(i32 10)
%35 = add nuw nsw i64 %9, 1
%36 = load i64, i64* %2
%37 = icmp slt i64 %9, %36
br i1 %37, label %8, label %38
38: ; preds = %33, %0
ret i32 0
}