#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*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *, int);
int main() {
  int i, j, mark;
#pragma omp parallel for private(j, mark)
  for (i = 30000000; i <= 30000200; i++) {
    mark = 1;
    for (j = 2; j < i / 2; j++) {
      if (i % j == 0) {
        mark = 0;
        break;
      }
    }
    if (mark)
      printf("%d is a primer.\n", i);
  }
  exit(0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x1c9c380,-0x8(%rbp)
cmpl   $0x1c9c448,-0x8(%rbp)
jg     11ca <main+0xaa>
movl   $0x1,-0x10(%rbp)
movl   $0x2,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    %eax,%ecx
mov    -0x14(%rbp),%eax
cmp    %ecx,%eax
jge    119e <main+0x7e>
mov    -0x8(%rbp),%eax
cltd
idivl  -0xc(%rbp)
cmp    $0x0,%edx
jne    118b <main+0x6b>
movl   $0x0,-0x10(%rbp)
jmp    119e <main+0x7e>
jmp    1190 <main+0x70>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1151 <main+0x31>
cmpl   $0x0,-0x10(%rbp)
je     11b7 <main+0x97>
mov    -0x8(%rbp),%esi
lea    0xe4e(%rip),%rdi
call   1030 <printf@plt>
jmp    11bc <main+0x9c>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1136 <main+0x16>
xor    %edi,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
push   %rax
mov    $0x1c9c380,%ebx
lea    0xed0(%rip),%r14
jmp    114b <main+0x2b>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
add    $0x1,%ebx
cmp    $0x1c9c449,%ebx
je     117d <main+0x5d>
mov    %ebx,%ecx
shr    %ecx
mov    $0x2,%esi
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
mov    %ebx,%eax
xor    %edx,%edx
div    %esi
test   %edx,%edx
je     1140 <main+0x20>
add    $0x1,%esi
cmp    %esi,%ecx
jne    1160 <main+0x40>
mov    %r14,%rdi
mov    %ebx,%esi
call   1030 <printf@plt>
jmp    1140 <main+0x20>
xor    %edi,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [17 x i8] c"%d is a primer.\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 0, i32* %1
store i32 30000000, i32* %2
br label %5
5: ; preds = %31, %0
%6 = load i32, i32* %2
%7 = icmp sle i32 %6, 30000200
br i1 %7, label %8, label %34
8: ; preds = %5
store i32 1, i32* %4
store i32 2, i32* %3
br label %9
9: ; preds = %21, %8
%10 = load i32, i32* %3
%11 = load i32, i32* %2
%12 = sdiv i32 %11, 2
%13 = icmp slt i32 %10, %12
br i1 %13, label %14, label %24
14: ; preds = %9
%15 = load i32, i32* %2
%16 = load i32, i32* %3
%17 = srem i32 %15, %16
%18 = icmp eq i32 %17, 0
br i1 %18, label %19, label %20
19: ; preds = %14
store i32 0, i32* %4
br label %24
20: ; preds = %14
br label %21
21: ; preds = %20
%22 = load i32, i32* %3
%23 = add nsw i32 %22, 1
store i32 %23, i32* %3
br label %9
24: ; preds = %19, %9
%25 = load i32, i32* %4
%26 = icmp ne i32 %25, 0
br i1 %26, label %27, label %30
27: ; preds = %24
%28 = load i32, i32* %2
%29 = call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i32 %28)
br label %30
30: ; preds = %27, %24
br label %31
31: ; preds = %30
%32 = load i32, i32* %2
%33 = add nsw i32 %32, 1
store i32 %33, i32* %2
br label %5
34: ; preds = %5
%35 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
@.str = [17 x i8] c"%d is a primer.\0A\00"
define i32 @main() {
br label %1
1: ; preds = %13, %0
%2 = phi i32 [ 30000000, %0 ], [ %14, %13 ]
%3 = lshr i32 %2, 1
br label %6
4: ; preds = %6
%5 = icmp eq i32 %10, %3
br i1 %5, label %11, label %6
6: ; preds = %1, %4
%7 = phi i32 [ %10, %4 ], [ 2, %1 ]
%8 = urem i32 %2, %7
%9 = icmp eq i32 %8, 0
%10 = add nuw nsw i32 %7, 1
br i1 %9, label %13, label %4
11: ; preds = %4
%12 = tail call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i32 %2)
br label %13
13: ; preds = %6, %11
%14 = add nuw nsw i32 %2, 1
%15 = icmp eq i32 %14, 30000201
br i1 %15, label %16, label %1
16: ; preds = %13
%17 = tail call i32 @exit(i32 0)
unreachable
}