#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 d, n;
  scanf("%d", &n);
  for (d = 2; d * d <= n; d++) {
    if (n % d == 0)
      break;
  }
  if (d * d <= n)
    printf("divisible\n");
  else
    printf("prime\n");
  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   $0x2,-0x8(%rbp)
mov    -0x8(%rbp),%eax
imul   -0x8(%rbp),%eax
cmp    -0xc(%rbp),%eax
jg     117e <main+0x5e>
mov    -0xc(%rbp),%eax
cltd
idivl  -0x8(%rbp)
cmp    $0x0,%edx
jne    116b <main+0x4b>
jmp    117e <main+0x5e>
jmp    1170 <main+0x50>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1146 <main+0x26>
mov    -0x8(%rbp),%eax
imul   -0x8(%rbp),%eax
cmp    -0xc(%rbp),%eax
jg     119f <main+0x7f>
lea    0xe6e(%rip),%rdi
call   1030 <printf@plt>
jmp    11ab <main+0x8b>
lea    0xe68(%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),%ecx
lea    0xec6(%rip),%rdi
cmp    $0x4,%ecx
jl     116a <main+0x4a>
mov    $0x2,%esi
lea    0xebb(%rip),%r8
xchg   %ax,%ax
mov    %ecx,%eax
cltd
idiv   %esi
test   %edx,%edx
je     1167 <main+0x47>
add    $0x1,%esi
mov    %esi,%eax
imul   %esi,%eax
cmp    %ecx,%eax
jle    1150 <main+0x30>
jmp    116a <main+0x4a>
mov    %r8,%rdi
call   1030 <puts@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
@str = [6 x i8] c"prime\00"
@str.3 = [10 x i8] c"divisible\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 slt i32 %4, 4
br i1 %5, label %14, label %9
6: ; preds = %9
%7 = mul nsw i32 %13, %13
%8 = icmp sgt i32 %7, %4
br i1 %8, label %14, label %9
9: ; preds = %0, %6
%10 = phi i32 [ %13, %6 ], [ 2, %0 ]
%11 = srem i32 %4, %10
%12 = icmp eq i32 %11, 0
%13 = add nuw nsw i32 %10, 1
br i1 %12, label %14, label %6
14: ; preds = %6, %9, %0
%15 = phi i8* [ getelementptr inbounds ([6 x i8], [6 x i8]* @str, i64 0, i64 0), %0 ], [ getelementptr inbounds ([10 x i8], [10 x i8]* @str.3, i64 0, i64 0), %9 ], [ getelementptr inbounds ([6 x i8], [6 x i8]* @str, i64 0, i64 0), %6 ]
%16 = call i32 @puts(i8* dereferenceable(1) %15)
ret i32 0
}