#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 *, int *);
int main() {
  int num_cases;
  int count, turn, num;
  int i;
  scanf("%d\n", &num_cases);
  for (count = 1; count <= num_cases; count++) {
    scanf("%d\n", &num);
    printf("Case #%d: %d", count, num);
    for (turn = 0, i = 2; i < num && turn < 2; i++) {
      if (num % i == 0) {
        printf(" = %d * %d", i, num / i);
        ++turn;
      }
    }
    printf("\n");
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1040 <scanf@plt>
movl   $0x1,-0xc(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x8(%rbp),%eax
jg     1211 <main+0xf1>
lea    0xea7(%rip),%rdi
lea    -0x14(%rbp),%rsi
call   1040 <scanf@plt>
mov    -0xc(%rbp),%esi
mov    -0x14(%rbp),%edx
lea    0xe95(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x0,-0x10(%rbp)
movl   $0x2,-0x18(%rbp)
mov    -0x18(%rbp),%ecx
xor    %eax,%eax
cmp    -0x14(%rbp),%ecx
mov    %al,-0x19(%rbp)
jge    119f <main+0x7f>
cmpl   $0x2,-0x10(%rbp)
setl   %al
mov    %al,-0x19(%rbp)
mov    -0x19(%rbp),%al
test   $0x1,%al
jne    11af <main+0x8f>
jmp    11f5 <main+0xd5>
mov    -0x14(%rbp),%eax
cltd
idivl  -0x18(%rbp)
cmp    $0x0,%edx
jne    11e2 <main+0xc2>
mov    -0x18(%rbp),%esi
mov    -0x14(%rbp),%eax
cltd
idivl  -0x18(%rbp)
mov    %eax,%edx
lea    0xe3f(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    11e7 <main+0xc7>
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    1184 <main+0x64>
lea    0xe06(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1146 <main+0x26>
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    0xebe(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1050 <scanf@plt>
cmpl   $0x0,0x4(%rsp)
jle    11ef <main+0xbf>
mov    $0x1,%ebx
mov    %rsp,%r15
lea    0xe9e(%rip),%r12
lea    0xea4(%rip),%r13
jmp    1185 <main+0x55>
nop
mov    $0xa,%edi
call   1030 <putchar@plt>
lea    0x1(%rbx),%eax
cmp    0x4(%rsp),%ebx
mov    %eax,%ebx
jge    11ef <main+0xbf>
lea    0xe74(%rip),%rdi
mov    %r15,%rsi
call   1050 <scanf@plt>
mov    (%rsp),%edx
mov    %r12,%rdi
mov    %ebx,%esi
xor    %eax,%eax
call   1040 <printf@plt>
mov    (%rsp),%ecx
cmp    $0x3,%ecx
jl     1170 <main+0x40>
xor    %ebp,%ebp
mov    $0x3,%r14d
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
lea    -0x1(%r14),%esi
mov    %ecx,%eax
cltd
idiv   %esi
test   %edx,%edx
jne    11df <main+0xaf>
mov    %r13,%rdi
mov    %eax,%edx
xor    %eax,%eax
call   1040 <printf@plt>
add    $0x1,%ebp
mov    (%rsp),%ecx
cmp    %ecx,%r14d
jge    1170 <main+0x40>
add    $0x1,%r14d
cmp    $0x2,%ebp
jl     11c0 <main+0x90>
jmp    1170 <main+0x40>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [4 x i8] c"%d\0A\00"
@.str.1 = [13 x i8] c"Case #%d: %d\00"
@.str.2 = [11 x i8] c" = %d * %d\00"
@.str.3 = [2 x i8] c"\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 ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32* %2)
store i32 1, i32* %3
br label %8
8: ; preds = %45, %0
%9 = load i32, i32* %3
%10 = load i32, i32* %2
%11 = icmp sle i32 %9, %10
br i1 %11, label %12, label %48
12: ; preds = %8
%13 = call i32 @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32* %5)
%14 = load i32, i32* %3
%15 = load i32, i32* %5
%16 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.1, i64 0, i64 0), i32 %14, i32 %15)
store i32 0, i32* %4
store i32 2, i32* %6
br label %17
17: ; preds = %40, %12
%18 = load i32, i32* %6
%19 = load i32, i32* %5
%20 = icmp slt i32 %18, %19
br i1 %20, label %21, label %24
21: ; preds = %17
%22 = load i32, i32* %4
%23 = icmp slt i32 %22, 2
br label %24
24: ; preds = %21, %17
%25 = phi i1 [ false, %17 ], [ %23, %21 ]
br i1 %25, label %26, label %43
26: ; preds = %24
%27 = load i32, i32* %5
%28 = load i32, i32* %6
%29 = srem i32 %27, %28
%30 = icmp eq i32 %29, 0
br i1 %30, label %31, label %39
31: ; preds = %26
%32 = load i32, i32* %6
%33 = load i32, i32* %5
%34 = load i32, i32* %6
%35 = sdiv i32 %33, %34
%36 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.2, i64 0, i64 0), i32 %32, i32 %35)
%37 = load i32, i32* %4
%38 = add nsw i32 %37, 1
store i32 %38, i32* %4
br label %39
39: ; preds = %31, %26
br label %40
40: ; preds = %39
%41 = load i32, i32* %6
%42 = add nsw i32 %41, 1
store i32 %42, i32* %6
br label %17
43: ; preds = %24
%44 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0))
br label %45
45: ; preds = %43
%46 = load i32, i32* %3
%47 = add nsw i32 %46, 1
store i32 %47, i32* %3
br label %8
48: ; preds = %8
ret i32 0
}

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
@.str.1 = [13 x i8] c"Case #%d: %d\00"
@.str.2 = [11 x i8] c" = %d * %d\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 ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32* %1)
%6 = load i32, i32* %1
%7 = icmp slt i32 %6, 1
br i1 %7, label %38, label %8
8: ; preds = %0, %33
%9 = phi i32 [ %35, %33 ], [ 1, %0 ]
%10 = call i32 @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32* %2)
%11 = load i32, i32* %2
%12 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @.str.1, i64 0, i64 0), i32 %9, i32 %11)
%13 = load i32, i32* %2
%14 = icmp sgt i32 %13, 2
br i1 %14, label %15, label %33
15: ; preds = %8, %26
%16 = phi i32 [ %27, %26 ], [ %13, %8 ]
%17 = phi i32 [ %29, %26 ], [ 2, %8 ]
%18 = phi i32 [ %28, %26 ], [ 0, %8 ]
%19 = srem i32 %16, %17
%20 = sdiv i32 %16, %17
%21 = icmp eq i32 %19, 0
br i1 %21, label %22, label %26
22: ; preds = %15
%23 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @.str.2, i64 0, i64 0), i32 %17, i32 %20)
%24 = add nsw i32 %18, 1
%25 = load i32, i32* %2
br label %26
26: ; preds = %15, %22
%27 = phi i32 [ %25, %22 ], [ %16, %15 ]
%28 = phi i32 [ %24, %22 ], [ %18, %15 ]
%29 = add nuw nsw i32 %17, 1
%30 = icmp slt i32 %29, %27
%31 = icmp slt i32 %28, 2
%32 = select i1 %30, i1 %31, i1 false
br i1 %32, label %15, label %33
33: ; preds = %26, %8
%34 = call i32 @putchar(i32 10)
%35 = add nuw nsw i32 %9, 1
%36 = load i32, i32* %1
%37 = icmp slt i32 %9, %36
br i1 %37, label %8, label %38
38: ; preds = %33, %0
ret i32 0
}