#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__ isPrime(int);
int /*<<< orphan*/ printf(char *, char *);
int /*<<< orphan*/ scanf(char *, int *);
int main() {
  int testCases, number;
  scanf("%d", &testCases);
  int i;
  for (i = 0; i < testCases; i++) {
    scanf("%d", &number);
    printf("%s\n", isPrime(number) ? "Prime" : "Not Prime");
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeba(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1050 <scanf@plt>
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    11ad <main+0x7d>
lea    0xe97(%rip),%rdi
lea    -0xc(%rbp),%rsi
call   1050 <scanf@plt>
mov    -0xc(%rbp),%edi
call   1040 <isPrime@plt>
mov    %rax,%rcx
lea    0xe83(%rip),%rsi
lea    0xe80(%rip),%rax
cmp    $0x0,%rcx
cmovne %rax,%rsi
lea    0xe69(%rip),%rdi
call   1030 <printf@plt>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1156 <main+0x26>
xor    %eax,%eax
add    $0x10,%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
mov    %rsp,%rsi
call   1050 <scanf@plt>
cmpl   $0x0,(%rsp)
jle    11ae <main+0x7e>
xor    %ebp,%ebp
lea    0xea7(%rip),%r14
lea    0x4(%rsp),%r15
lea    0xea2(%rip),%r12
lea    0xe9f(%rip),%r13
lea    0xe90(%rip),%rbx
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
mov    %r14,%rdi
mov    %r15,%rsi
call   1050 <scanf@plt>
mov    0x4(%rsp),%edi
call   1040 <isPrime@plt>
test   %rax,%rax
mov    %r13,%rsi
cmove  %r12,%rsi
mov    %rbx,%rdi
call   1030 <printf@plt>
add    $0x1,%ebp
cmp    (%rsp),%ebp
jl     1180 <main+0x50>
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 = [4 x i8] c"%s\0A\00"
@.str.2 = [6 x i8] c"Prime\00"
@.str.3 = [10 x i8] c"Not Prime\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 0, i32* %1
%5 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %2)
store i32 0, i32* %4
br label %6
6: ; preds = %18, %0
%7 = load i32, i32* %4
%8 = load i32, i32* %2
%9 = icmp slt i32 %7, %8
br i1 %9, label %10, label %21
10: ; preds = %6
%11 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %3)
%12 = load i32, i32* %3
%13 = call i64 @isPrime(i32 %12)
%14 = icmp ne i64 %13, 0
%15 = zext i1 %14 to i64
%16 = select i1 %14, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.3, i64 0, i64 0)
%17 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %16)
br label %18
18: ; preds = %10
%19 = load i32, i32* %4
%20 = add nsw i32 %19, 1
store i32 %20, i32* %4
br label %6
21: ; preds = %6
ret i32 0
}

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
@.str.1 = [4 x i8] c"%s\0A\00"
@.str.2 = [6 x i8] c"Prime\00"
@.str.3 = [10 x i8] c"Not Prime\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 = icmp sgt i32 %6, 0
br i1 %7, label %8, label %19
8: ; preds = %0, %8
%9 = phi i32 [ %16, %8 ], [ 0, %0 ]
%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 i64 @isPrime(i32 %11)
%13 = icmp eq i64 %12, 0
%14 = select i1 %13, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.3, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0)
%15 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %14)
%16 = add nuw nsw i32 %9, 1
%17 = load i32, i32* %1
%18 = icmp slt i32 %16, %17
br i1 %18, label %8, label %19
19: ; preds = %8, %0
ret i32 0
}