#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*/ fflush(int /*<<< orphan*/);
scalar_t__ isprime(int);
int /*<<< orphan*/ printf(char *, int);
int /*<<< orphan*/ stdout;
int main(int argc, char **argv) {
  int i;
  for (i = 79000; i < 81000; i++)
    if (isprime(i)) {
      printf("%d ", i);
      fflush(stdout);
    }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x13498,-0x14(%rbp)
cmpl   $0x13c68,-0x14(%rbp)
jge    119c <main+0x6c>
mov    -0x14(%rbp),%edi
call   1040 <isprime@plt>
cmp    $0x0,%rax
je     1189 <main+0x59>
mov    -0x14(%rbp),%esi
lea    0xe8a(%rip),%rdi
call   1030 <printf@plt>
mov    0x2e5e(%rip),%rax
mov    (%rax),%edi
call   1050 <fflush@plt>
jmp    118e <main+0x5e>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    114d <main+0x1d>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %rbx
mov    $0x13498,%ebx
lea    0xebf(%rip),%r14
mov    0x2e98(%rip),%r15
jmp    115b <main+0x2b>
nopw   0x0(%rax,%rax,1)
add    $0x1,%ebx
cmp    $0x13c68,%ebx
je     117b <main+0x4b>
mov    %ebx,%edi
call   1040 <isprime@plt>
test   %rax,%rax
je     1150 <main+0x20>
mov    %r14,%rdi
mov    %ebx,%esi
call   1030 <printf@plt>
mov    (%r15),%edi
call   1050 <fflush@plt>
jmp    1150 <main+0x20>
xor    %eax,%eax
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [4 x i8] c"%d \00"
@stdout = global i32 0
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i32 79000, i32* %6
br label %7
7: ; preds = %20, %2
%8 = load i32, i32* %6
%9 = icmp slt i32 %8, 81000
br i1 %9, label %10, label %23
10: ; preds = %7
%11 = load i32, i32* %6
%12 = call i64 @isprime(i32 %11)
%13 = icmp ne i64 %12, 0
br i1 %13, label %14, label %19
14: ; preds = %10
%15 = load i32, i32* %6
%16 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %15)
%17 = load i32, i32* @stdout
%18 = call i32 @fflush(i32 %17)
br label %19
19: ; preds = %14, %10
br label %20
20: ; preds = %19
%21 = load i32, i32* %6
%22 = add nsw i32 %21, 1
store i32 %22, i32* %6
br label %7
23: ; preds = %7
ret i32 0
}

LLVM IR (-O2):
@.str = [4 x i8] c"%d \00"
@stdout = global i32 0
define i32 @main(i32 %0, i8** nocapture readnone %1) {
br label %3
3: ; preds = %2, %11
%4 = phi i32 [ 79000, %2 ], [ %12, %11 ]
%5 = tail call i64 @isprime(i32 %4)
%6 = icmp eq i64 %5, 0
br i1 %6, label %11, label %7
7: ; preds = %3
%8 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %4)
%9 = load i32, i32* @stdout
%10 = tail call i32 @fflush(i32 %9)
br label %11
11: ; preds = %3, %7
%12 = add nuw nsw i32 %4, 1
%13 = icmp eq i32 %12, 81000
br i1 %13, label %14, label %3
14: ; preds = %11
ret i32 0
}