#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 */
scalar_t__ isPrime(int, int);
int /*<<< orphan*/ printf(char *);
int main() {
  int k = 3;
  isPrime(100, k) ? printf(" true\n") : printf(" false\n");
  isPrime(111, k) ? printf(" true\n") : printf(" false\n");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x3,-0x8(%rbp)
mov    -0x8(%rbp),%esi
mov    $0x64,%edi
call   1040 <isPrime@plt>
cmp    $0x0,%rax
je     115e <main+0x3e>
lea    0xeac(%rip),%rdi
call   1030 <printf@plt>
jmp    116a <main+0x4a>
lea    0xea2(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%esi
mov    $0x6f,%edi
call   1040 <isPrime@plt>
cmp    $0x0,%rax
je     1192 <main+0x72>
lea    0xe78(%rip),%rdi
call   1030 <printf@plt>
jmp    119e <main+0x7e>
lea    0xe6e(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
push   %rax
mov    $0x64,%edi
mov    $0x3,%esi
call   1040 <isPrime@plt>
test   %rax,%rax
lea    0xec3(%rip),%r14
lea    0xec3(%rip),%rbx
mov    %rbx,%rdi
cmove  %r14,%rdi
call   1030 <puts@plt>
mov    $0x6f,%edi
mov    $0x3,%esi
call   1040 <isPrime@plt>
test   %rax,%rax
cmove  %r14,%rbx
mov    %rbx,%rdi
call   1030 <puts@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [7 x i8] c" true\0A\00"
@.str.1 = [8 x i8] c" false\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
store i32 3, i32* %2
%3 = load i32, i32* %2
%4 = call i64 @isPrime(i32 100, i32 %3)
%5 = icmp ne i64 %4, 0
br i1 %5, label %6, label %8
6: ; preds = %0
%7 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
br label %10
8: ; preds = %0
%9 = call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0))
br label %10
10: ; preds = %8, %6
%11 = phi i32 [ %7, %6 ], [ %9, %8 ]
%12 = load i32, i32* %2
%13 = call i64 @isPrime(i32 111, i32 %12)
%14 = icmp ne i64 %13, 0
br i1 %14, label %15, label %17
15: ; preds = %10
%16 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
br label %19
17: ; preds = %10
%18 = call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0))
br label %19
19: ; preds = %17, %15
%20 = phi i32 [ %16, %15 ], [ %18, %17 ]
ret i32 0
}

LLVM IR (-O2):
@str.2 = [7 x i8] c" false\00"
@str.4 = [6 x i8] c" true\00"
define i32 @main() {
%1 = tail call i64 @isPrime(i32 100, i32 3)
%2 = icmp eq i64 %1, 0
%3 = select i1 %2, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @str.2, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @str.4, i64 0, i64 0)
%4 = tail call i32 @puts(i8* dereferenceable(1) %3)
%5 = tail call i64 @isPrime(i32 111, i32 3)
%6 = icmp eq i64 %5, 0
%7 = select i1 %6, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @str.2, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @str.4, i64 0, i64 0)
%8 = tail call i32 @puts(i8* dereferenceable(1) %7)
ret i32 0
}