#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(unsigned int);
int /*<<< orphan*/ printf(char *, unsigned int);
int main() {
  unsigned int i, n = 1000000, count = 0;
  for (i = 2; i <= n; i++) {
    if (isPrime(i) && i >= 928351) {
      printf("%lu ,", i);
      count++;
    }
  }
  printf("***-> %u", count);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0xf4240,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
movl   $0x2,-0x8(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0xc(%rbp),%eax
ja     119a <main+0x7a>
mov    -0x8(%rbp),%edi
call   1040 <isPrime@plt>
cmp    $0x0,%rax
je     1187 <main+0x67>
cmpl   $0xe2a5f,-0x8(%rbp)
jb     1187 <main+0x67>
mov    -0x8(%rbp),%esi
lea    0xe87(%rip),%rdi
call   1030 <printf@plt>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    118c <main+0x6c>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1144 <main+0x24>
mov    -0x10(%rbp),%esi
lea    0xe62(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r14
push   %rbx
mov    $0x2,%ebp
xor    %ebx,%ebx
lea    0xece(%rip),%r14
jmp    114b <main+0x2b>
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
add    $0x1,%ebp
cmp    $0xf4241,%ebp
je     116e <main+0x4e>
mov    %ebp,%edi
call   1040 <isPrime@plt>
test   %rax,%rax
je     1140 <main+0x20>
cmp    $0xe2a5f,%ebp
jb     1140 <main+0x20>
mov    %r14,%rdi
mov    %ebp,%esi
call   1030 <printf@plt>
add    $0x1,%ebx
jmp    1140 <main+0x20>
lea    0xe91(%rip),%rdi
mov    %ebx,%esi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rbx
pop    %r14
pop    %rbp
ret

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

LLVM IR (-O2):
@.str = [6 x i8] c"%lu ,\00"
@.str.1 = [9 x i8] c"***-> %u\00"
define i32 @main() {
br label %1
1: ; preds = %0, %11
%2 = phi i32 [ 0, %0 ], [ %12, %11 ]
%3 = phi i32 [ 2, %0 ], [ %13, %11 ]
%4 = tail call i64 @isPrime(i32 %3)
%5 = icmp ne i64 %4, 0
%6 = icmp ugt i32 %3, 928350
%7 = and i1 %5, %6
br i1 %7, label %8, label %11
8: ; preds = %1
%9 = tail call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32 %3)
%10 = add i32 %2, 1
br label %11
11: ; preds = %1, %8
%12 = phi i32 [ %10, %8 ], [ %2, %1 ]
%13 = add nuw nsw i32 %3, 1
%14 = icmp eq i32 %13, 1000001
br i1 %14, label %15, label %1
15: ; preds = %11
%16 = tail call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0), i32 %12)
ret i32 0
}