#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*/ prime(int *, int);
int /*<<< orphan*/ printf(char *, int);
int /*<<< orphan*/ scanf(char *, int *);
int main(int argc, const char *argv[]) {
  int i = 1, m, flag = 1;
  scanf("%d", &m);
  int p[m - 1];
  prime(p, m - 1);
  for (i = 1; p[i] != 0; i++) {
    if (!(m % p[i])) {
      flag = 0;
      break;
    }
  }
  printf("%d", flag);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x1,-0x14(%rbp)
movl   $0x1,-0x1c(%rbp)
lea    0xea5(%rip),%rdi
lea    -0x18(%rbp),%rsi
call   1040 <scanf@plt>
mov    -0x18(%rbp),%eax
add    $0xffffffff,%eax
mov    %rsp,%rcx
mov    %rcx,-0x28(%rbp)
lea    0xf(,%rax,4),%rcx
and    $0xfffffffffffffff0,%rcx
mov    %rsp,%rdi
sub    %rcx,%rdi
mov    %rdi,-0x38(%rbp)
mov    %rdi,%rsp
mov    %rax,-0x30(%rbp)
mov    -0x18(%rbp),%esi
sub    $0x1,%esi
call   1050 <prime@plt>
movl   $0x1,-0x14(%rbp)
mov    -0x38(%rbp),%rax
movslq -0x14(%rbp),%rcx
cmpl   $0x0,(%rax,%rcx,4)
je     11e9 <main+0xb9>
mov    -0x38(%rbp),%rcx
mov    -0x18(%rbp),%eax
movslq -0x14(%rbp),%rsi
cltd
idivl  (%rcx,%rsi,4)
cmp    $0x0,%edx
jne    11d6 <main+0xa6>
movl   $0x0,-0x1c(%rbp)
jmp    11e9 <main+0xb9>
jmp    11db <main+0xab>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    11a0 <main+0x70>
mov    -0x1c(%rbp),%esi
lea    0xe0d(%rip),%rdi
call   1030 <printf@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x28(%rbp),%rax
mov    %rax,%rsp
mov    -0x4(%rbp),%eax
mov    %rbp,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
mov    %rsp,%rbp
push   %r15
push   %r14
push   %r12
push   %rbx
sub    $0x10,%rsp
lea    0xeba(%rip),%rdi
lea    -0x24(%rbp),%rsi
call   1040 <scanf@plt>
mov    %rsp,%r14
mov    -0x24(%rbp),%eax
add    $0xffffffff,%eax
mov    %rsp,%r15
lea    0xf(,%rax,4),%r12
and    $0xfffffffffffffff0,%r12
mov    %r15,%rbx
sub    %r12,%rbx
mov    %rbx,%rsp
mov    -0x24(%rbp),%esi
add    $0xffffffff,%esi
mov    %rbx,%rdi
call   1050 <prime@plt>
neg    %r12
mov    0x4(%r15,%r12,1),%edi
mov    $0x1,%esi
test   %edi,%edi
je     11b7 <main+0x87>
mov    -0x24(%rbp),%ecx
add    $0x8,%rbx
cs nopw 0x0(%rax,%rax,1)
mov    %ecx,%eax
cltd
idiv   %edi
test   %edx,%edx
je     11b5 <main+0x85>
mov    (%rbx),%edi
add    $0x4,%rbx
test   %edi,%edi
jne    11a0 <main+0x70>
jmp    11b7 <main+0x87>
xor    %esi,%esi
lea    0xe42(%rip),%rdi
call   1030 <printf@plt>
mov    %r14,%rsp
xor    %eax,%eax
lea    -0x20(%rbp),%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%d\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i8*
%10 = alloca i64
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i32 1, i32* %6
store i32 1, i32* %8
%11 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %7)
%12 = load i32, i32* %7
%13 = sub nsw i32 %12, 1
%14 = zext i32 %13 to i64
%15 = call i8* @llvm.stacksave()
store i8* %15, i8** %9
%16 = alloca i32, i64 %14
store i64 %14, i64* %10
%17 = load i32, i32* %7
%18 = sub nsw i32 %17, 1
%19 = call i32 @prime(i32* %16, i32 %18)
store i32 1, i32* %6
br label %20
20: ; preds = %36, %2
%21 = load i32, i32* %6
%22 = sext i32 %21 to i64
%23 = getelementptr inbounds i32, i32* %16, i64 %22
%24 = load i32, i32* %23
%25 = icmp ne i32 %24, 0
br i1 %25, label %26, label %39
26: ; preds = %20
%27 = load i32, i32* %7
%28 = load i32, i32* %6
%29 = sext i32 %28 to i64
%30 = getelementptr inbounds i32, i32* %16, i64 %29
%31 = load i32, i32* %30
%32 = srem i32 %27, %31
%33 = icmp ne i32 %32, 0
br i1 %33, label %35, label %34
34: ; preds = %26
store i32 0, i32* %8
br label %39
35: ; preds = %26
br label %36
36: ; preds = %35
%37 = load i32, i32* %6
%38 = add nsw i32 %37, 1
store i32 %38, i32* %6
br label %20
39: ; preds = %34, %20
%40 = load i32, i32* %8
%41 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %40)
store i32 0, i32* %3
%42 = load i8*, i8** %9
%43 = load i32, i32* %3
ret i32 %43
}

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca i32
%4 = bitcast i32* %3 to i8*
%5 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %3)
%6 = load i32, i32* %3
%7 = add nsw i32 %6, -1
%8 = zext i32 %7 to i64
%9 = call i8* @llvm.stacksave()
%10 = alloca i32, i64 %8
%11 = load i32, i32* %3
%12 = add nsw i32 %11, -1
%13 = call i32 @prime(i32* %10, i32 %12)
%14 = getelementptr inbounds i32, i32* %10, i64 1
%15 = load i32, i32* %14
%16 = icmp eq i32 %15, 0
br i1 %16, label %29, label %17
17: ; preds = %2
%18 = load i32, i32* %3
br label %23
19: ; preds = %23
%20 = getelementptr inbounds i32, i32* %10, i64 %28
%21 = load i32, i32* %20
%22 = icmp eq i32 %21, 0
br i1 %22, label %29, label %23
23: ; preds = %17, %19
%24 = phi i64 [ 1, %17 ], [ %28, %19 ]
%25 = phi i32 [ %15, %17 ], [ %21, %19 ]
%26 = srem i32 %18, %25
%27 = icmp eq i32 %26, 0
%28 = add nuw i64 %24, 1
br i1 %27, label %29, label %19
29: ; preds = %19, %23, %2
%30 = phi i32 [ 1, %2 ], [ 0, %23 ], [ 1, %19 ]
%31 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %30)
ret i32 0
}