#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*/ assert(int);
int is_prime(int);
int main() {
  int primes[] = {2, 3, 7, 11, 13, 17};
  int non_primes[] = {4, 6, 8, 12, 14, 15};
  for (int i = 0; i < 6; i++) {
    assert(is_prime(primes[i]));
    assert(is_prime(non_primes[i]) == false);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
movl   $0x0,-0x4(%rbp)
mov    0xeca(%rip),%rax
mov    %rax,-0x20(%rbp)
mov    0xec7(%rip),%rax
mov    %rax,-0x18(%rbp)
mov    0xec4(%rip),%rax
mov    %rax,-0x10(%rbp)
mov    0xec9(%rip),%rax
mov    %rax,-0x40(%rbp)
mov    0xec6(%rip),%rax
mov    %rax,-0x38(%rbp)
mov    0xec3(%rip),%rax
mov    %rax,-0x30(%rbp)
movl   $0x0,-0x44(%rbp)
cmpl   $0x6,-0x44(%rbp)
jge    11c1 <main+0xa1>
movslq -0x44(%rbp),%rax
mov    -0x20(%rbp,%rax,4),%edi
call   1040 <is_prime@plt>
mov    %eax,%edi
call   1030 <assert@plt>
movslq -0x44(%rbp),%rax
mov    -0x40(%rbp,%rax,4),%edi
call   1040 <is_prime@plt>
cmp    $0x0,%eax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
mov    -0x44(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x44(%rbp)
jmp    1178 <main+0x58>
xor    %eax,%eax
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x2,%edi
call   1040 <is_prime@plt>
mov    %eax,%edi
call   1030 <assert@plt>
mov    $0x4,%edi
call   1040 <is_prime@plt>
xor    %edi,%edi
test   %eax,%eax
sete   %dil
call   1030 <assert@plt>
mov    $0x3,%edi
call   1040 <is_prime@plt>
mov    %eax,%edi
call   1030 <assert@plt>
mov    $0x6,%edi
call   1040 <is_prime@plt>
xor    %edi,%edi
test   %eax,%eax
sete   %dil
call   1030 <assert@plt>
mov    $0x7,%edi
call   1040 <is_prime@plt>
mov    %eax,%edi
call   1030 <assert@plt>
mov    $0x8,%edi
call   1040 <is_prime@plt>
xor    %edi,%edi
test   %eax,%eax
sete   %dil
call   1030 <assert@plt>
mov    $0xb,%edi
call   1040 <is_prime@plt>
mov    %eax,%edi
call   1030 <assert@plt>
mov    $0xc,%edi
call   1040 <is_prime@plt>
xor    %edi,%edi
test   %eax,%eax
sete   %dil
call   1030 <assert@plt>
mov    $0xd,%edi
call   1040 <is_prime@plt>
mov    %eax,%edi
call   1030 <assert@plt>
mov    $0xe,%edi
call   1040 <is_prime@plt>
xor    %edi,%edi
test   %eax,%eax
sete   %dil
call   1030 <assert@plt>
mov    $0x11,%edi
call   1040 <is_prime@plt>
mov    %eax,%edi
call   1030 <assert@plt>
mov    $0xf,%edi
call   1040 <is_prime@plt>
xor    %edi,%edi
test   %eax,%eax
sete   %dil
call   1030 <assert@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@__const.main.primes = [6 x i32] [i32 2, i32 3, i32 7, i32 11, i32 13, i32 17]
@__const.main.non_primes = [6 x i32] [i32 4, i32 6, i32 8, i32 12, i32 14, i32 15]
define i32 @main() {
%1 = alloca i32
%2 = alloca [6 x i32]
%3 = alloca [6 x i32]
%4 = alloca i32
store i32 0, i32* %1
%5 = bitcast [6 x i32]* %2 to i8*
%6 = bitcast [6 x i32]* %3 to i8*
store i32 0, i32* %4
br label %7
7: ; preds = %25, %0
%8 = load i32, i32* %4
%9 = icmp slt i32 %8, 6
br i1 %9, label %10, label %28
10: ; preds = %7
%11 = load i32, i32* %4
%12 = sext i32 %11 to i64
%13 = getelementptr inbounds [6 x i32], [6 x i32]* %2, i64 0, i64 %12
%14 = load i32, i32* %13
%15 = call i32 @is_prime(i32 %14)
%16 = call i32 @assert(i32 %15)
%17 = load i32, i32* %4
%18 = sext i32 %17 to i64
%19 = getelementptr inbounds [6 x i32], [6 x i32]* %3, i64 0, i64 %18
%20 = load i32, i32* %19
%21 = call i32 @is_prime(i32 %20)
%22 = icmp eq i32 %21, 0
%23 = zext i1 %22 to i32
%24 = call i32 @assert(i32 %23)
br label %25
25: ; preds = %10
%26 = load i32, i32* %4
%27 = add nsw i32 %26, 1
store i32 %27, i32* %4
br label %7
28: ; preds = %7
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @is_prime(i32 2)
%2 = tail call i32 @assert(i32 %1)
%3 = tail call i32 @is_prime(i32 4)
%4 = icmp eq i32 %3, 0
%5 = zext i1 %4 to i32
%6 = tail call i32 @assert(i32 %5)
%7 = tail call i32 @is_prime(i32 3)
%8 = tail call i32 @assert(i32 %7)
%9 = tail call i32 @is_prime(i32 6)
%10 = icmp eq i32 %9, 0
%11 = zext i1 %10 to i32
%12 = tail call i32 @assert(i32 %11)
%13 = tail call i32 @is_prime(i32 7)
%14 = tail call i32 @assert(i32 %13)
%15 = tail call i32 @is_prime(i32 8)
%16 = icmp eq i32 %15, 0
%17 = zext i1 %16 to i32
%18 = tail call i32 @assert(i32 %17)
%19 = tail call i32 @is_prime(i32 11)
%20 = tail call i32 @assert(i32 %19)
%21 = tail call i32 @is_prime(i32 12)
%22 = icmp eq i32 %21, 0
%23 = zext i1 %22 to i32
%24 = tail call i32 @assert(i32 %23)
%25 = tail call i32 @is_prime(i32 13)
%26 = tail call i32 @assert(i32 %25)
%27 = tail call i32 @is_prime(i32 14)
%28 = icmp eq i32 %27, 0
%29 = zext i1 %28 to i32
%30 = tail call i32 @assert(i32 %29)
%31 = tail call i32 @is_prime(i32 17)
%32 = tail call i32 @assert(i32 %31)
%33 = tail call i32 @is_prime(i32 15)
%34 = icmp eq i32 %33, 0
%35 = zext i1 %34 to i32
%36 = tail call i32 @assert(i32 %35)
ret i32 0
}