#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 *);
void is_prime(int num, int pom) {
  while (1) {
    if (num % 2 == 0) {
      pom = 1;
      break;
    } else
      pom = 0;
    if (num % 3 == 0) {
      pom = 1;
      break;
    } else
      pom = 0;
    if (num % 5 == 0) {
      pom = 1;
      break;
    } else
      pom = 0;
    if (num == 2 || num == 3 || num == 5)
      pom = 0;
    break;
  }
  if (pom == 0)
    printf("1\n");
  else
    printf("0\n");
}


x86 assembly (clang, -O0):
<is_prime>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
jne    113e <is_prime+0x2e>
movl   $0x1,-0x8(%rbp)
jmp    11bd <is_prime+0xad>
movl   $0x0,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    $0x3,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
jne    1165 <is_prime+0x55>
movl   $0x1,-0x8(%rbp)
jmp    11bd <is_prime+0xad>
movl   $0x0,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    $0x5,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
jne    118c <is_prime+0x7c>
movl   $0x1,-0x8(%rbp)
jmp    11bd <is_prime+0xad>
movl   $0x0,-0x8(%rbp)
cmpl   $0x2,-0x4(%rbp)
je     11b1 <is_prime+0xa1>
cmpl   $0x3,-0x4(%rbp)
je     11b1 <is_prime+0xa1>
cmpl   $0x5,-0x4(%rbp)
jne    11b8 <is_prime+0xa8>
movl   $0x0,-0x8(%rbp)
jmp    11bd <is_prime+0xad>
cmpl   $0x0,-0x8(%rbp)
jne    11d8 <is_prime+0xc8>
lea    0xe32(%rip),%rdi
call   1030 <printf@plt>
jmp    11e4 <is_prime+0xd4>
lea    0xe24(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_prime>:
imul   $0xaaaaaaab,%edi,%eax
add    $0x2aaaaaaa,%eax
imul   $0xcccccccd,%edi,%ecx
add    $0x19999999,%ecx
cmp    $0x55555555,%eax
lea    0xecd(%rip),%rdx
lea    0xec8(%rip),%rax
cmovb  %rdx,%rax
test   $0x1,%dil
cmove  %rdx,%rax
cmp    $0x33333333,%ecx
cmovb  %rdx,%rax
mov    %rax,%rdi
jmp    1030 <puts@plt>

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

LLVM IR (-O2):
@str = [2 x i8] c"0\00"
@str.2 = [2 x i8] c"1\00"
define void @is_prime(i32 %0, i32 %1) {
%3 = and i32 %0, 1
%4 = icmp eq i32 %3, 0
%5 = srem i32 %0, 3
%6 = icmp eq i32 %5, 0
%7 = or i1 %4, %6
%8 = srem i32 %0, 5
%9 = icmp eq i32 %8, 0
%10 = or i1 %9, %7
%11 = select i1 %10, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @str.2, i64 0, i64 0)
%12 = tail call i32 @puts(i8* dereferenceable(1) %11)
ret void
}