#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 sqrt(int);
int is_prime_number(int count) {
  if (0 == count % 2)
    return (2 == count);
  if (0 == count % 3)
    return (3 == count);
  if (0 == count % 5)
    return (5 == count);
  if (0 == count % 7)
    return (7 == count);
  int i;
  int root = sqrt(count);
  for (i = 11; i <= root; i += 2) {
    if (0 == count % i)
      return 0;
  }
  return 1;
}


x86 assembly (clang, -O0):
<is_prime_number>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
xor    %eax,%eax
cmp    %edx,%eax
jne    1148 <is_prime_number+0x38>
mov    $0x2,%eax
cmp    -0x8(%rbp),%eax
sete   %al
and    $0x1,%al
movzbl %al,%eax
mov    %eax,-0x4(%rbp)
jmp    1224 <is_prime_number+0x114>
mov    -0x8(%rbp),%eax
mov    $0x3,%ecx
cltd
idiv   %ecx
xor    %eax,%eax
cmp    %edx,%eax
jne    1175 <is_prime_number+0x65>
mov    $0x3,%eax
cmp    -0x8(%rbp),%eax
sete   %al
and    $0x1,%al
movzbl %al,%eax
mov    %eax,-0x4(%rbp)
jmp    1224 <is_prime_number+0x114>
mov    -0x8(%rbp),%eax
mov    $0x5,%ecx
cltd
idiv   %ecx
xor    %eax,%eax
cmp    %edx,%eax
jne    11a2 <is_prime_number+0x92>
mov    $0x5,%eax
cmp    -0x8(%rbp),%eax
sete   %al
and    $0x1,%al
movzbl %al,%eax
mov    %eax,-0x4(%rbp)
jmp    1224 <is_prime_number+0x114>
mov    -0x8(%rbp),%eax
mov    $0x7,%ecx
cltd
idiv   %ecx
xor    %eax,%eax
cmp    %edx,%eax
jne    11cf <is_prime_number+0xbf>
mov    $0x7,%eax
cmp    -0x8(%rbp),%eax
sete   %al
and    $0x1,%al
movzbl %al,%eax
mov    %eax,-0x4(%rbp)
jmp    1224 <is_prime_number+0x114>
mov    -0x8(%rbp),%edi
call   1030 <sqrt@plt>
mov    %eax,-0x10(%rbp)
movl   $0xb,-0xc(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x10(%rbp),%eax
jg     121d <is_prime_number+0x10d>
mov    -0x8(%rbp),%eax
cltd
idivl  -0xc(%rbp)
xor    %eax,%eax
cmp    %edx,%eax
jne    120a <is_prime_number+0xfa>
movl   $0x0,-0x4(%rbp)
jmp    1224 <is_prime_number+0x114>
jmp    120f <is_prime_number+0xff>
mov    -0xc(%rbp),%eax
add    $0x2,%eax
mov    %eax,-0xc(%rbp)
jmp    11e1 <is_prime_number+0xd1>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_prime_number>:
push   %rbx
mov    %edi,%ebx
test   $0x1,%bl
jne    111d <is_prime_number+0xd>
cmp    $0x2,%ebx
jmp    1199 <is_prime_number+0x89>
imul   $0xaaaaaaab,%ebx,%eax
add    $0x2aaaaaaa,%eax
cmp    $0x55555554,%eax
jbe    118c <is_prime_number+0x7c>
imul   $0xcccccccd,%ebx,%eax
add    $0x19999999,%eax
cmp    $0x33333332,%eax
jbe    1191 <is_prime_number+0x81>
imul   $0xb6db6db7,%ebx,%eax
add    $0x12492492,%eax
cmp    $0x24924924,%eax
jbe    1196 <is_prime_number+0x86>
mov    %ebx,%edi
call   1030 <sqrt@plt>
mov    %eax,%ecx
mov    $0x1,%al
cmp    $0xb,%ecx
jl     119c <is_prime_number+0x8c>
mov    $0xd,%esi
nopl   0x0(%rax,%rax,1)
lea    -0x2(%rsi),%edi
mov    %ebx,%eax
cltd
idiv   %edi
test   %edx,%edx
je     1185 <is_prime_number+0x75>
lea    0x2(%rsi),%eax
cmp    %ecx,%esi
mov    %eax,%esi
jle    1170 <is_prime_number+0x60>
test   %edx,%edx
setne  %al
jmp    119c <is_prime_number+0x8c>
cmp    $0x3,%ebx
jmp    1199 <is_prime_number+0x89>
cmp    $0x5,%ebx
jmp    1199 <is_prime_number+0x89>
cmp    $0x7,%ebx
sete   %al
movzbl %al,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @is_prime_number(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 %0, i32* %3
%6 = load i32, i32* %3
%7 = srem i32 %6, 2
%8 = icmp eq i32 0, %7
br i1 %8, label %9, label %13
9: ; preds = %1
%10 = load i32, i32* %3
%11 = icmp eq i32 2, %10
%12 = zext i1 %11 to i32
store i32 %12, i32* %2
br label %55
13: ; preds = %1
%14 = load i32, i32* %3
%15 = srem i32 %14, 3
%16 = icmp eq i32 0, %15
br i1 %16, label %17, label %21
17: ; preds = %13
%18 = load i32, i32* %3
%19 = icmp eq i32 3, %18
%20 = zext i1 %19 to i32
store i32 %20, i32* %2
br label %55
21: ; preds = %13
%22 = load i32, i32* %3
%23 = srem i32 %22, 5
%24 = icmp eq i32 0, %23
br i1 %24, label %25, label %29
25: ; preds = %21
%26 = load i32, i32* %3
%27 = icmp eq i32 5, %26
%28 = zext i1 %27 to i32
store i32 %28, i32* %2
br label %55
29: ; preds = %21
%30 = load i32, i32* %3
%31 = srem i32 %30, 7
%32 = icmp eq i32 0, %31
br i1 %32, label %33, label %37
33: ; preds = %29
%34 = load i32, i32* %3
%35 = icmp eq i32 7, %34
%36 = zext i1 %35 to i32
store i32 %36, i32* %2
br label %55
37: ; preds = %29
%38 = load i32, i32* %3
%39 = call i32 @sqrt(i32 %38)
store i32 %39, i32* %5
store i32 11, i32* %4
br label %40
40: ; preds = %51, %37
%41 = load i32, i32* %4
%42 = load i32, i32* %5
%43 = icmp sle i32 %41, %42
br i1 %43, label %44, label %54
44: ; preds = %40
%45 = load i32, i32* %3
%46 = load i32, i32* %4
%47 = srem i32 %45, %46
%48 = icmp eq i32 0, %47
br i1 %48, label %49, label %50
49: ; preds = %44
store i32 0, i32* %2
br label %55
50: ; preds = %44
br label %51
51: ; preds = %50
%52 = load i32, i32* %4
%53 = add nsw i32 %52, 2
store i32 %53, i32* %4
br label %40
54: ; preds = %40
store i32 1, i32* %2
br label %55
55: ; preds = %54, %49, %33, %25, %17, %9
%56 = load i32, i32* %2
ret i32 %56
}

LLVM IR (-O2):
define i32 @is_prime_number(i32 %0) {
%2 = and i32 %0, 1
%3 = icmp eq i32 %2, 0
br i1 %3, label %4, label %6
4: ; preds = %1
%5 = icmp eq i32 %0, 2
br label %33
6: ; preds = %1
%7 = srem i32 %0, 3
%8 = icmp eq i32 %7, 0
br i1 %8, label %9, label %11
9: ; preds = %6
%10 = icmp eq i32 %0, 3
br label %33
11: ; preds = %6
%12 = srem i32 %0, 5
%13 = icmp eq i32 %12, 0
br i1 %13, label %14, label %16
14: ; preds = %11
%15 = icmp eq i32 %0, 5
br label %33
16: ; preds = %11
%17 = srem i32 %0, 7
%18 = icmp eq i32 %17, 0
br i1 %18, label %19, label %21
19: ; preds = %16
%20 = icmp eq i32 %0, 7
br label %33
21: ; preds = %16
%22 = tail call i32 @sqrt(i32 %0)
%23 = icmp slt i32 %22, 11
br i1 %23, label %33, label %24
24: ; preds = %21, %24
%25 = phi i32 [ %28, %24 ], [ 11, %21 ]
%26 = srem i32 %0, %25
%27 = icmp eq i32 %26, 0
%28 = add nuw nsw i32 %25, 2
%29 = icmp sgt i32 %28, %22
%30 = select i1 %27, i1 true, i1 %29
br i1 %30, label %31, label %24
31: ; preds = %24
%32 = xor i1 %27, true
br label %33
33: ; preds = %31, %21, %19, %14, %9, %4
%34 = phi i1 [ %5, %4 ], [ %10, %9 ], [ %15, %14 ], [ %20, %19 ], [ true, %21 ], [ %32, %31 ]
%35 = zext i1 %34 to i32
ret i32 %35
}