#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__ is_prime(unsigned long long *);
int /*<<< orphan*/ printf(char *, unsigned long long);
void find_primes(unsigned long long start_x, unsigned long long end_x,
                 char verbose) {
  for (unsigned long long i = start_x; i <= end_x; ++i) {
    if (is_prime(&i)) {
      printf("%llu\n", i);
    } else {
      continue;
    }
  }
}


x86 assembly (clang, -O0):
<find_primes>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %dl,%al
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %al,-0x11(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rax
cmp    -0x10(%rbp),%rax
ja     118e <find_primes+0x6e>
lea    -0x20(%rbp),%rdi
call   1040 <is_prime@plt>
cmp    $0x0,%rax
je     1173 <find_primes+0x53>
mov    -0x20(%rbp),%rsi
lea    0xe97(%rip),%rdi
call   1030 <printf@plt>
jmp    1178 <find_primes+0x58>
jmp    117d <find_primes+0x5d>
jmp    117d <find_primes+0x5d>
mov    -0x20(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x20(%rbp)
jmp    113d <find_primes+0x1d>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<find_primes>:
push   %r15
push   %r14
push   %rbx
sub    $0x10,%rsp
mov    %rdi,0x8(%rsp)
cmp    %rsi,%rdi
jbe    113d <find_primes+0x1d>
add    $0x10,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret
mov    %rsi,%rbx
lea    0x8(%rsp),%r14
lea    0xeb4(%rip),%r15
jmp    1163 <find_primes+0x43>
xchg   %ax,%ax
mov    0x8(%rsp),%rax
add    $0x1,%rax
mov    %rax,0x8(%rsp)
cmp    %rbx,%rax
ja     1133 <find_primes+0x13>
mov    %r14,%rdi
call   1040 <is_prime@plt>
test   %rax,%rax
je     1150 <find_primes+0x30>
mov    0x8(%rsp),%rsi
mov    %r15,%rdi
call   1030 <printf@plt>
jmp    1150 <find_primes+0x30>

LLVM IR (-O0):
@.str = [6 x i8] c"%llu\0A\00"
define void @find_primes(i64 %0, i64 %1, i8 signext %2) {
%4 = alloca i64
%5 = alloca i64
%6 = alloca i8
%7 = alloca i64
store i64 %0, i64* %4
store i64 %1, i64* %5
store i8 %2, i8* %6
%8 = load i64, i64* %4
store i64 %8, i64* %7
br label %9
9: ; preds = %21, %3
%10 = load i64, i64* %7
%11 = load i64, i64* %5
%12 = icmp ule i64 %10, %11
br i1 %12, label %13, label %24
13: ; preds = %9
%14 = call i64 @is_prime(i64* %7)
%15 = icmp ne i64 %14, 0
br i1 %15, label %16, label %19
16: ; preds = %13
%17 = load i64, i64* %7
%18 = call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i64 %17)
br label %20
19: ; preds = %13
br label %21
20: ; preds = %16
br label %21
21: ; preds = %20, %19
%22 = load i64, i64* %7
%23 = add i64 %22, 1
store i64 %23, i64* %7
br label %9
24: ; preds = %9
ret void
}

LLVM IR (-O2):
@.str = [6 x i8] c"%llu\0A\00"
define void @find_primes(i64 %0, i64 %1, i8 signext %2) {
%4 = alloca i64
%5 = bitcast i64* %4 to i8*
store i64 %0, i64* %4
%6 = icmp ugt i64 %0, %1
br i1 %6, label %7, label %8
7: ; preds = %14, %3
ret void
8: ; preds = %3, %14
%9 = call i64 @is_prime(i64* %4)
%10 = icmp eq i64 %9, 0
br i1 %10, label %14, label %11
11: ; preds = %8
%12 = load i64, i64* %4
%13 = call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i64 %12)
br label %14
14: ; preds = %8, %11
%15 = load i64, i64* %4
%16 = add i64 %15, 1
store i64 %16, i64* %4
%17 = icmp ugt i64 %16, %1
br i1 %17, label %7, label %8
}