#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_s(char *, int *);
int /*<<< orphan*/ system(char *);
main() {
  int number, i, flag = 0;
  printf("Enter a number : ");
  scanf_s("%d", &number);
  if (number == 0 || number == 1 || number < 0) {
    flag = 1;
  } else {
    for (i = 2; i <= number / i; i++) {
      if (number % i == 0) {
        flag = 1;
        break;
      }
    }
  }
  if (flag == 1) {
    printf("%d is not private.\n", number);
  } else
    printf("%d is private\n", number);
  system("pause");
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x10(%rbp)
lea    0xeb3(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xeb7(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1050 <scanf_s@plt>
cmpl   $0x0,-0x8(%rbp)
je     1182 <main+0x52>
cmpl   $0x1,-0x8(%rbp)
je     1182 <main+0x52>
cmpl   $0x0,-0x8(%rbp)
jge    118e <main+0x5e>
movl   $0x1,-0x10(%rbp)
jmp    11e3 <main+0xb3>
movl   $0x2,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%eax
cltd
idivl  -0xc(%rbp)
mov    %eax,%ecx
mov    -0x14(%rbp),%eax
cmp    %ecx,%eax
jg     11de <main+0xae>
mov    -0x8(%rbp),%eax
cltd
idivl  -0xc(%rbp)
cmp    $0x0,%edx
jne    11cb <main+0x9b>
movl   $0x1,-0x10(%rbp)
jmp    11de <main+0xae>
jmp    11d0 <main+0xa0>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1195 <main+0x65>
jmp    11e3 <main+0xb3>
cmpl   $0x1,-0x10(%rbp)
jne    1203 <main+0xd3>
mov    -0x8(%rbp),%esi
lea    0xe1e(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
jmp    1214 <main+0xe4>
mov    -0x8(%rbp),%esi
lea    0xe1c(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xe1d(%rip),%rdi
call   1030 <system@plt>
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xec8(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xecc(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1050 <scanf_s@plt>
mov    0x4(%rsp),%r9d
lea    0xeb9(%rip),%rdi
cmp    $0x2,%r9d
jl     119c <main+0x6c>
lea    0xec0(%rip),%r8
cmp    $0x4,%r9d
jb     1199 <main+0x69>
mov    $0x2,%ecx
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
mov    %r9d,%eax
cltd
idiv   %ecx
test   %edx,%edx
je     119c <main+0x6c>
lea    0x1(%rcx),%esi
mov    %r9d,%eax
cltd
idiv   %esi
cmp    %eax,%ecx
mov    %esi,%ecx
jl     1180 <main+0x50>
mov    %r8,%rdi
mov    %r9d,%esi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xe8b(%rip),%rdi
call   1030 <system@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [18 x i8] c"Enter a number : \00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [20 x i8] c"%d is not private.\0A\00"
@.str.3 = [15 x i8] c"%d is private\0A\00"
@.str.4 = [6 x i8] c"pause\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 0, i32* %1
store i32 0, i32* %4
%5 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0))
%6 = call i32 @scanf_s(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %2)
%7 = load i32, i32* %2
%8 = icmp eq i32 %7, 0
br i1 %8, label %15, label %9
9: ; preds = %0
%10 = load i32, i32* %2
%11 = icmp eq i32 %10, 1
br i1 %11, label %15, label %12
12: ; preds = %9
%13 = load i32, i32* %2
%14 = icmp slt i32 %13, 0
br i1 %14, label %15, label %16
15: ; preds = %12, %9, %0
store i32 1, i32* %4
br label %34
16: ; preds = %12
store i32 2, i32* %3
br label %17
17: ; preds = %30, %16
%18 = load i32, i32* %3
%19 = load i32, i32* %2
%20 = load i32, i32* %3
%21 = sdiv i32 %19, %20
%22 = icmp sle i32 %18, %21
br i1 %22, label %23, label %33
23: ; preds = %17
%24 = load i32, i32* %2
%25 = load i32, i32* %3
%26 = srem i32 %24, %25
%27 = icmp eq i32 %26, 0
br i1 %27, label %28, label %29
28: ; preds = %23
store i32 1, i32* %4
br label %33
29: ; preds = %23
br label %30
30: ; preds = %29
%31 = load i32, i32* %3
%32 = add nsw i32 %31, 1
store i32 %32, i32* %3
br label %17
33: ; preds = %28, %17
br label %34
34: ; preds = %33, %15
%35 = load i32, i32* %4
%36 = icmp eq i32 %35, 1
br i1 %36, label %37, label %40
37: ; preds = %34
%38 = load i32, i32* %2
%39 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.2, i64 0, i64 0), i32 %38)
br label %43
40: ; preds = %34
%41 = load i32, i32* %2
%42 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.3, i64 0, i64 0), i32 %41)
br label %43
43: ; preds = %40, %37
%44 = call i32 @system(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.4, i64 0, i64 0))
%45 = load i32, i32* %1
ret i32 %45
}

LLVM IR (-O2):
@.str = [18 x i8] c"Enter a number : \00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [20 x i8] c"%d is not private.\0A\00"
@.str.3 = [15 x i8] c"%d is private\0A\00"
@.str.4 = [6 x i8] c"pause\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @scanf_s(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %1)
%5 = load i32, i32* %1
%6 = icmp slt i32 %5, 2
br i1 %6, label %17, label %7
7: ; preds = %0
%8 = icmp ult i32 %5, 4
br i1 %8, label %17, label %12
9: ; preds = %12
%10 = sdiv i32 %5, %16
%11 = icmp slt i32 %13, %10
br i1 %11, label %12, label %17
12: ; preds = %7, %9
%13 = phi i32 [ %16, %9 ], [ 2, %7 ]
%14 = srem i32 %5, %13
%15 = icmp eq i32 %14, 0
%16 = add nuw nsw i32 %13, 1
br i1 %15, label %17, label %9
17: ; preds = %9, %12, %7, %0
%18 = phi i8* [ getelementptr inbounds ([20 x i8], [20 x i8]* @.str.2, i64 0, i64 0), %0 ], [ getelementptr inbounds ([15 x i8], [15 x i8]* @.str.3, i64 0, i64 0), %7 ], [ getelementptr inbounds ([20 x i8], [20 x i8]* @.str.2, i64 0, i64 0), %12 ], [ getelementptr inbounds ([15 x i8], [15 x i8]* @.str.3, i64 0, i64 0), %9 ]
%19 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) %18, i32 %5)
%20 = call i32 @system(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.4, i64 0, i64 0))
ret i32 0
}