#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 is_prime(int);
int main() {
  if (is_prime(0) == 1)
    goto error;
  if (is_prime(1) == 1)
    goto error;
  if (is_prime(2) == 0)
    goto error;
  if (is_prime(3) == 0)
    goto error;
  if (is_prime(4) == 1)
    goto error;
  if (is_prime(38183) == 0)
    goto error;
  if (is_prime(1234321237) == 0)
    goto error;
  if (is_prime(1234321232134323) == 1)
    goto error;
  if (is_prime(1234321232134387) == 0)
    goto error;
  if (is_prime(1234321287765432169) == 0)
    goto error;
  return 0;
error:
  return 1;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
xor    %edi,%edi
call   1030 <is_prime@plt>
cmp    $0x1,%eax
jne    1134 <main+0x24>
jmp    1218 <main+0x108>
mov    $0x1,%edi
call   1030 <is_prime@plt>
cmp    $0x1,%eax
jne    114c <main+0x3c>
jmp    1218 <main+0x108>
mov    $0x2,%edi
call   1030 <is_prime@plt>
cmp    $0x0,%eax
jne    1164 <main+0x54>
jmp    1218 <main+0x108>
mov    $0x3,%edi
call   1030 <is_prime@plt>
cmp    $0x0,%eax
jne    117c <main+0x6c>
jmp    1218 <main+0x108>
mov    $0x4,%edi
call   1030 <is_prime@plt>
cmp    $0x1,%eax
jne    1194 <main+0x84>
jmp    1218 <main+0x108>
mov    $0x9527,%edi
call   1030 <is_prime@plt>
cmp    $0x0,%eax
jne    11ac <main+0x9c>
jmp    1218 <main+0x108>
mov    $0x49923f55,%edi
call   1030 <is_prime@plt>
cmp    $0x0,%eax
jne    11c4 <main+0xb4>
jmp    1218 <main+0x108>
mov    $0xce9480b3,%edi
call   1030 <is_prime@plt>
cmp    $0x1,%eax
jne    11dc <main+0xcc>
jmp    1218 <main+0x108>
mov    $0xce9480f3,%edi
call   1030 <is_prime@plt>
cmp    $0x0,%eax
jne    11f4 <main+0xe4>
jmp    1218 <main+0x108>
mov    $0xe7f61769,%edi
call   1030 <is_prime@plt>
cmp    $0x0,%eax
jne    120c <main+0xfc>
jmp    1218 <main+0x108>
movl   $0x0,-0x4(%rbp)
jmp    121f <main+0x10f>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %edi,%edi
call   1030 <is_prime@plt>
cmp    $0x1,%eax
je     11a6 <main+0x96>
mov    $0x1,%edi
call   1030 <is_prime@plt>
cmp    $0x1,%eax
je     11a6 <main+0x96>
mov    $0x2,%edi
call   1030 <is_prime@plt>
test   %eax,%eax
je     11a6 <main+0x96>
mov    $0x3,%edi
call   1030 <is_prime@plt>
test   %eax,%eax
je     11a6 <main+0x96>
mov    $0x4,%edi
call   1030 <is_prime@plt>
cmp    $0x1,%eax
je     11a6 <main+0x96>
mov    $0x9527,%edi
call   1030 <is_prime@plt>
test   %eax,%eax
je     11a6 <main+0x96>
mov    $0x49923f55,%edi
call   1030 <is_prime@plt>
test   %eax,%eax
je     11a6 <main+0x96>
mov    $0xce9480b3,%edi
call   1030 <is_prime@plt>
cmp    $0x1,%eax
je     11a6 <main+0x96>
mov    $0xce9480f3,%edi
call   1030 <is_prime@plt>
test   %eax,%eax
je     11a6 <main+0x96>
mov    $0xe7f61769,%edi
call   1030 <is_prime@plt>
mov    %eax,%ecx
xor    %eax,%eax
test   %ecx,%ecx
jne    11ab <main+0x9b>
mov    $0x1,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @is_prime(i32 0)
%3 = icmp eq i32 %2, 1
br i1 %3, label %4, label %5
4: ; preds = %0
br label %42
5: ; preds = %0
%6 = call i32 @is_prime(i32 1)
%7 = icmp eq i32 %6, 1
br i1 %7, label %8, label %9
8: ; preds = %5
br label %42
9: ; preds = %5
%10 = call i32 @is_prime(i32 2)
%11 = icmp eq i32 %10, 0
br i1 %11, label %12, label %13
12: ; preds = %9
br label %42
13: ; preds = %9
%14 = call i32 @is_prime(i32 3)
%15 = icmp eq i32 %14, 0
br i1 %15, label %16, label %17
16: ; preds = %13
br label %42
17: ; preds = %13
%18 = call i32 @is_prime(i32 4)
%19 = icmp eq i32 %18, 1
br i1 %19, label %20, label %21
20: ; preds = %17
br label %42
21: ; preds = %17
%22 = call i32 @is_prime(i32 38183)
%23 = icmp eq i32 %22, 0
br i1 %23, label %24, label %25
24: ; preds = %21
br label %42
25: ; preds = %21
%26 = call i32 @is_prime(i32 1234321237)
%27 = icmp eq i32 %26, 0
br i1 %27, label %28, label %29
28: ; preds = %25
br label %42
29: ; preds = %25
%30 = call i32 @is_prime(i32 -829128525)
%31 = icmp eq i32 %30, 1
br i1 %31, label %32, label %33
32: ; preds = %29
br label %42
33: ; preds = %29
%34 = call i32 @is_prime(i32 -829128461)
%35 = icmp eq i32 %34, 0
br i1 %35, label %36, label %37
36: ; preds = %33
br label %42
37: ; preds = %33
%38 = call i32 @is_prime(i32 -403302551)
%39 = icmp eq i32 %38, 0
br i1 %39, label %40, label %41
40: ; preds = %37
br label %42
41: ; preds = %37
store i32 0, i32* %1
br label %43
42: ; preds = %40, %36, %32, %28, %24, %20, %16, %12, %8, %4
store i32 1, i32* %1
br label %43
43: ; preds = %42, %41
%44 = load i32, i32* %1
ret i32 %44
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @is_prime(i32 0)
%2 = icmp eq i32 %1, 1
br i1 %2, label %30, label %3
3: ; preds = %0
%4 = tail call i32 @is_prime(i32 1)
%5 = icmp eq i32 %4, 1
br i1 %5, label %30, label %6
6: ; preds = %3
%7 = tail call i32 @is_prime(i32 2)
%8 = icmp eq i32 %7, 0
br i1 %8, label %30, label %9
9: ; preds = %6
%10 = tail call i32 @is_prime(i32 3)
%11 = icmp eq i32 %10, 0
br i1 %11, label %30, label %12
12: ; preds = %9
%13 = tail call i32 @is_prime(i32 4)
%14 = icmp eq i32 %13, 1
br i1 %14, label %30, label %15
15: ; preds = %12
%16 = tail call i32 @is_prime(i32 38183)
%17 = icmp eq i32 %16, 0
br i1 %17, label %30, label %18
18: ; preds = %15
%19 = tail call i32 @is_prime(i32 1234321237)
%20 = icmp eq i32 %19, 0
br i1 %20, label %30, label %21
21: ; preds = %18
%22 = tail call i32 @is_prime(i32 -829128525)
%23 = icmp eq i32 %22, 1
br i1 %23, label %30, label %24
24: ; preds = %21
%25 = tail call i32 @is_prime(i32 -829128461)
%26 = icmp eq i32 %25, 0
br i1 %26, label %30, label %27
27: ; preds = %24
%28 = tail call i32 @is_prime(i32 -403302551)
%29 = icmp eq i32 %28, 0
br i1 %29, label %30, label %31
30: ; preds = %27, %24, %21, %18, %15, %12, %9, %6, %3, %0
br label %31
31: ; preds = %27, %30
%32 = phi i32 [ 1, %30 ], [ 0, %27 ]
ret i32 %32
}