#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 check, a, i;
  scanf("%d", &a);
  check = 1;
  for (i = 2; i < a; i++) {
    if (a % i == 0)
      check = 0;
  }
  if (check == 1)
    printf("Prime");
  else
    printf("Not Prime");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rdi
lea    -0xc(%rbp),%rsi
call   1040 <scanf@plt>
movl   $0x1,-0x8(%rbp)
movl   $0x2,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    1183 <main+0x63>
mov    -0xc(%rbp),%eax
cltd
idivl  -0x10(%rbp)
cmp    $0x0,%edx
jne    1170 <main+0x50>
movl   $0x0,-0x8(%rbp)
jmp    1175 <main+0x55>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    114d <main+0x2d>
cmpl   $0x1,-0x8(%rbp)
jne    119e <main+0x7e>
lea    0xe73(%rip),%rdi
call   1030 <printf@plt>
jmp    11aa <main+0x8a>
lea    0xe5e(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xed8(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1040 <scanf@plt>
mov    0x4(%rsp),%r9d
cmp    $0x3,%r9d
jl     114b <main+0x2b>
jne    1154 <main+0x34>
mov    $0x1,%edi
mov    $0x2,%esi
jmp    1197 <main+0x77>
lea    0xeb5(%rip),%rdi
jmp    11bd <main+0x9d>
lea    -0x2(%r9),%r8d
and    $0xfffffffe,%r8d
mov    $0x1,%edi
mov    $0x2,%esi
cs nopw 0x0(%rax,%rax,1)
mov    %esi,%ecx
mov    %r9d,%eax
cltd
idiv   %esi
mov    %edx,%esi
lea    0x1(%rcx),%r10d
mov    %r9d,%eax
cltd
idiv   %r10d
test   %esi,%esi
cmove  %esi,%edi
test   %edx,%edx
cmove  %edx,%edi
lea    0x2(%rcx),%esi
cmp    %r8d,%ecx
jne    1170 <main+0x50>
test   $0x1,%r9b
je     11a8 <main+0x88>
mov    %r9d,%eax
cltd
idiv   %esi
test   %edx,%edx
cmove  %edx,%edi
cmp    $0x1,%edi
lea    0xe55(%rip),%rax
lea    0xe4a(%rip),%rdi
cmove  %rax,%rdi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%d\00"
@.str.1 = [6 x i8] c"Prime\00"
@.str.2 = [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* %3)
store i32 1, i32* %2
store i32 2, i32* %4
br label %6
6: ; preds = %17, %0
%7 = load i32, i32* %4
%8 = load i32, i32* %3
%9 = icmp slt i32 %7, %8
br i1 %9, label %10, label %20
10: ; preds = %6
%11 = load i32, i32* %3
%12 = load i32, i32* %4
%13 = srem i32 %11, %12
%14 = icmp eq i32 %13, 0
br i1 %14, label %15, label %16
15: ; preds = %10
store i32 0, i32* %2
br label %16
16: ; preds = %15, %10
br label %17
17: ; preds = %16
%18 = load i32, i32* %4
%19 = add nsw i32 %18, 1
store i32 %19, i32* %4
br label %6
20: ; preds = %6
%21 = load i32, i32* %2
%22 = icmp eq i32 %21, 1
br i1 %22, label %23, label %25
23: ; preds = %20
%24 = call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0))
br label %27
25: ; preds = %20
%26 = call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.2, i64 0, i64 0))
br label %27
27: ; preds = %25, %23
ret i32 0
}

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