#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*/ freopen(char *, char *, int /*<<< orphan*/);
scalar_t__ isPrime(unsigned long);
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ scanf(char *, unsigned long *);
int /*<<< orphan*/ stdin;
int main() {
  unsigned long t, num;
  freopen("primeNumberTestCase.test", "r", stdin);
  scanf("%lu", &t);
  while (t-- > 0) {
    scanf("%lu", &num);
    if (isPrime(num)) {
      printf("Prime\n");
    } else {
      printf("Not prime\n");
    }
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    0x2e92(%rip),%rax
mov    (%rax),%edx
lea    0xea1(%rip),%rdi
lea    0xeb3(%rip),%rsi
call   1040 <freopen@plt>
lea    0xea9(%rip),%rdi
lea    -0x10(%rbp),%rsi
call   1060 <scanf@plt>
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0xffffffffffffffff,%rcx
mov    %rcx,-0x10(%rbp)
cmp    $0x0,%rax
jbe    11d9 <main+0x99>
lea    0xe80(%rip),%rdi
lea    -0x18(%rbp),%rsi
call   1060 <scanf@plt>
mov    -0x18(%rbp),%rdi
call   1050 <isPrime@plt>
cmp    $0x0,%rax
je     11c8 <main+0x88>
lea    0xe61(%rip),%rdi
call   1030 <printf@plt>
jmp    11d4 <main+0x94>
lea    0xe57(%rip),%rdi
call   1030 <printf@plt>
jmp    117b <main+0x3b>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %r12
push   %rbx
sub    $0x18,%rsp
mov    0x2e96(%rip),%rax
mov    (%rax),%edx
lea    0xea5(%rip),%rdi
lea    0xeb7(%rip),%rsi
call   1040 <freopen@plt>
lea    0xead(%rip),%rdi
lea    0x8(%rsp),%rsi
call   1060 <scanf@plt>
subq   $0x1,0x8(%rsp)
jb     11cc <main+0x8c>
lea    0xe94(%rip),%r14
lea    0x10(%rsp),%r15
lea    0xe8c(%rip),%r12
lea    0xe8f(%rip),%rbx
nopw   0x0(%rax,%rax,1)
mov    %r14,%rdi
mov    %r15,%rsi
call   1060 <scanf@plt>
mov    0x10(%rsp),%rdi
call   1050 <isPrime@plt>
test   %rax,%rax
mov    %rbx,%rdi
cmove  %r12,%rdi
call   1030 <puts@plt>
subq   $0x1,0x8(%rsp)
jae    11a0 <main+0x60>
xor    %eax,%eax
add    $0x18,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [25 x i8] c"primeNumberTestCase.test\00"
@.str.1 = [2 x i8] c"r\00"
@stdin = global i32 0
@.str.2 = [4 x i8] c"%lu\00"
@.str.3 = [7 x i8] c"Prime\0A\00"
@.str.4 = [11 x i8] c"Not prime\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i64
%3 = alloca i64
store i32 0, i32* %1
%4 = load i32, i32* @stdin
%5 = call i32 @freopen(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0), i32 %4)
%6 = call i32 @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), i64* %2)
br label %7
7: ; preds = %20, %0
%8 = load i64, i64* %2
%9 = add i64 %8, -1
store i64 %9, i64* %2
%10 = icmp ugt i64 %8, 0
br i1 %10, label %11, label %21
11: ; preds = %7
%12 = call i32 @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), i64* %3)
%13 = load i64, i64* %3
%14 = call i64 @isPrime(i64 %13)
%15 = icmp ne i64 %14, 0
br i1 %15, label %16, label %18
16: ; preds = %11
%17 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.3, i64 0, i64 0))
br label %20
18: ; preds = %11
%19 = call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.4, i64 0, i64 0))
br label %20
20: ; preds = %18, %16
br label %7
21: ; preds = %7
ret i32 0
}

LLVM IR (-O2):
@.str = [25 x i8] c"primeNumberTestCase.test\00"
@.str.1 = [2 x i8] c"r\00"
@stdin = global i32 0
@.str.2 = [4 x i8] c"%lu\00"
@str = [10 x i8] c"Not prime\00"
@str.5 = [6 x i8] c"Prime\00"
define i32 @main() {
%1 = alloca i64
%2 = alloca i64
%3 = bitcast i64* %1 to i8*
%4 = bitcast i64* %2 to i8*
%5 = load i32, i32* @stdin
%6 = tail call i32 @freopen(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0), i32 %5)
%7 = call i32 @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), i64* %1)
%8 = load i64, i64* %1
%9 = add i64 %8, -1
store i64 %9, i64* %1
%10 = icmp eq i64 %8, 0
br i1 %10, label %21, label %11
11: ; preds = %0, %11
%12 = call i32 @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), i64* %2)
%13 = load i64, i64* %2
%14 = call i64 @isPrime(i64 %13)
%15 = icmp eq i64 %14, 0
%16 = select i1 %15, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @str, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @str.5, i64 0, i64 0)
%17 = call i32 @puts(i8* dereferenceable(1) %16)
%18 = load i64, i64* %1
%19 = add i64 %18, -1
store i64 %19, i64* %1
%20 = icmp eq i64 %18, 0
br i1 %20, label %21, label %11
21: ; preds = %11, %0
ret i32 0
}