#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__ prime(int);
int /*<<< orphan*/ printf(char *, int, int);
int main() {
  int i = 1, i2 = 0;
  for (i > 0; i <= 200; i++) {
    if (prime(i) == 0) {
      if (prime(i + 2) == 0) {
        printf("%d, %d\n", i, i + 2);
        i2++;
        if (i2 == 10) {
          break;
        }
      }
    }
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x1,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
cmpl   $0xc8,-0x8(%rbp)
jg     11bb <main+0x9b>
mov    -0x8(%rbp),%edi
call   1040 <prime@plt>
cmp    $0x0,%rax
jne    11a8 <main+0x88>
mov    -0x8(%rbp),%edi
add    $0x2,%edi
call   1040 <prime@plt>
cmp    $0x0,%rax
jne    11a3 <main+0x83>
mov    -0x8(%rbp),%esi
mov    -0x8(%rbp),%edx
add    $0x2,%edx
lea    0xe7f(%rip),%rdi
call   1030 <printf@plt>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
cmpl   $0xa,-0xc(%rbp)
jne    119e <main+0x7e>
jmp    11bb <main+0x9b>
jmp    11a3 <main+0x83>
jmp    11a8 <main+0x88>
jmp    11ad <main+0x8d>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    113d <main+0x1d>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
xor    %r15d,%r15d
mov    $0x3,%ebx
lea    0xeca(%rip),%r14
jmp    114b <main+0x2b>
nopl   0x0(%rax,%rax,1)
add    $0x1,%ebx
cmp    $0xcb,%ebx
je     117c <main+0x5c>
lea    -0x2(%rbx),%ebp
mov    %ebp,%edi
call   1040 <prime@plt>
test   %rax,%rax
jne    1140 <main+0x20>
mov    %ebx,%edi
call   1040 <prime@plt>
test   %rax,%rax
jne    1140 <main+0x20>
mov    %r14,%rdi
mov    %ebp,%esi
mov    %ebx,%edx
call   1030 <printf@plt>
add    $0x1,%r15d
cmp    $0xa,%r15d
jne    1140 <main+0x20>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

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

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