#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);
int /*<<< orphan*/ scanf(char *, int *);
int main() {
  int p;
  scanf("%d", &p);
  int t;
  for (t = 0; t < p; t++) {
    int r;
    scanf("%d", &r);
    int licks = 0;
    int factor;
    for (factor = 2; r > 1; factor++) {
      while (r % factor == 0) {
        r /= factor;
        licks++;
      }
    }
    printf("Pop #%d: ", t + 1);
    if (licks <= 3)
      printf("%d licks? Your goose is cooked!\n", licks);
    else
      printf("A-one... A-two-HOO... A-%d.\n", licks);
  }
  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   $0x0,-0xc(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    120e <main+0xee>
lea    0xea7(%rip),%rdi
lea    -0x10(%rbp),%rsi
call   1040 <scanf@plt>
movl   $0x0,-0x14(%rbp)
movl   $0x2,-0x18(%rbp)
cmpl   $0x1,-0x10(%rbp)
jle    11bc <main+0x9c>
jmp    117f <main+0x5f>
mov    -0x10(%rbp),%eax
cltd
idivl  -0x18(%rbp)
cmp    $0x0,%edx
jne    11a9 <main+0x89>
mov    -0x18(%rbp),%ecx
mov    -0x10(%rbp),%eax
cltd
idiv   %ecx
mov    %eax,-0x10(%rbp)
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    117f <main+0x5f>
jmp    11ae <main+0x8e>
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    1170 <main+0x50>
mov    -0xc(%rbp),%esi
add    $0x1,%esi
lea    0xe3a(%rip),%rdi
call   1030 <printf@plt>
cmpl   $0x3,-0x14(%rbp)
jg     11ec <main+0xcc>
mov    -0x14(%rbp),%esi
lea    0xe2b(%rip),%rdi
call   1030 <printf@plt>
jmp    11fb <main+0xdb>
mov    -0x14(%rbp),%esi
lea    0xe38(%rip),%rdi
call   1030 <printf@plt>
jmp    1200 <main+0xe0>
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    0xece(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1040 <scanf@plt>
cmpl   $0x0,0x4(%rsp)
jle    1223 <main+0x103>
xor    %ebx,%ebx
lea    0xeb0(%rip),%r14
mov    %rsp,%r15
lea    0xea9(%rip),%r12
lea    0xeac(%rip),%rbp
jmp    1195 <main+0x75>
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
add    $0x1,%ebx
mov    %r12,%rdi
mov    %ebx,%esi
call   1030 <printf@plt>
xor    %r13d,%r13d
mov    %rbp,%rdi
mov    %r13d,%esi
call   1030 <printf@plt>
cmp    0x4(%rsp),%ebx
jge    1223 <main+0x103>
mov    %r14,%rdi
mov    %r15,%rsi
call   1040 <scanf@plt>
mov    (%rsp),%ecx
cmp    $0x2,%ecx
jl     1170 <main+0x50>
xor    %r13d,%r13d
mov    $0x2,%esi
jmp    11c8 <main+0xa8>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
add    $0x1,%esi
cmp    $0x1,%ecx
jle    1200 <main+0xe0>
mov    %ecx,%eax
cltd
idiv   %esi
test   %edx,%edx
jne    11c0 <main+0xa0>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    %ecx,%eax
cltd
idiv   %esi
add    $0x1,%r13d
mov    %eax,%ecx
cltd
idiv   %esi
test   %edx,%edx
je     11e0 <main+0xc0>
mov    %ecx,(%rsp)
jmp    11c0 <main+0xa0>
nopw   0x0(%rax,%rax,1)
add    $0x1,%ebx
mov    %r12,%rdi
mov    %ebx,%esi
call   1030 <printf@plt>
cmp    $0x3,%r13d
jle    1180 <main+0x60>
lea    0xe10(%rip),%rdi
jmp    1183 <main+0x63>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

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

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
@.str.1 = [10 x i8] c"Pop #%d: \00"
@.str.2 = [33 x i8] c"%d licks? Your goose is cooked!\0A\00"
@.str.3 = [29 x i8] c"A-one... A-two-HOO... A-%d.\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = bitcast i32* %1 to i8*
%4 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %1)
%5 = load i32, i32* %1
%6 = icmp sgt i32 %5, 0
br i1 %6, label %7, label %50
7: ; preds = %0
%8 = bitcast i32* %2 to i8*
br label %9
9: ; preds = %7, %46
%10 = phi i32 [ 0, %7 ], [ %47, %46 ]
%11 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %2)
%12 = load i32, i32* %2
%13 = icmp sgt i32 %12, 1
br i1 %13, label %17, label %14
14: ; preds = %9
%15 = add nuw nsw i32 %10, 1
%16 = call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0), i32 %15)
br label %40
17: ; preds = %9, %31
%18 = phi i32 [ %34, %31 ], [ 2, %9 ]
%19 = phi i32 [ %33, %31 ], [ 0, %9 ]
%20 = phi i32 [ %32, %31 ], [ %12, %9 ]
%21 = srem i32 %20, %18
%22 = icmp eq i32 %21, 0
br i1 %22, label %23, label %31
23: ; preds = %17, %23
%24 = phi i32 [ %27, %23 ], [ %19, %17 ]
%25 = phi i32 [ %26, %23 ], [ %20, %17 ]
%26 = sdiv i32 %25, %18
%27 = add nsw i32 %24, 1
%28 = srem i32 %26, %18
%29 = icmp eq i32 %28, 0
br i1 %29, label %23, label %30
30: ; preds = %23
store i32 %26, i32* %2
br label %31
31: ; preds = %30, %17
%32 = phi i32 [ %26, %30 ], [ %20, %17 ]
%33 = phi i32 [ %27, %30 ], [ %19, %17 ]
%34 = add nuw nsw i32 %18, 1
%35 = icmp sgt i32 %32, 1
br i1 %35, label %17, label %36
36: ; preds = %31
%37 = add nuw nsw i32 %10, 1
%38 = call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0), i32 %37)
%39 = icmp slt i32 %33, 4
br i1 %39, label %40, label %44
40: ; preds = %14, %36
%41 = phi i32 [ %15, %14 ], [ %37, %36 ]
%42 = phi i32 [ 0, %14 ], [ %33, %36 ]
%43 = call i32 @printf(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.2, i64 0, i64 0), i32 %42)
br label %46
44: ; preds = %36
%45 = call i32 @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.3, i64 0, i64 0), i32 %33)
br label %46
46: ; preds = %44, %40
%47 = phi i32 [ %37, %44 ], [ %41, %40 ]
%48 = load i32, i32* %1
%49 = icmp slt i32 %47, %48
br i1 %49, label %9, label %50
50: ; preds = %46, %0
ret i32 0
}