#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*/ printf(char *, int);
int main() {
  int broi = 0;
  int x;
  int pred_number = 2;
  int number = 2;
  int f;
  while (broi < 10) {
    f = 0;
    for (x = 2; x <= number / 2; x++) {
      if (number % x == 0) {
        f = 1;
        break;
      }
    }
    if (f == 0) {
      if (number == pred_number + 2) {
        printf("%d - ", pred_number);
        printf("%d\n", number);
        broi++;
      }
      pred_number = number;
    }
    number++;
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
movl   $0x2,-0x10(%rbp)
movl   $0x2,-0x14(%rbp)
cmpl   $0xa,-0x8(%rbp)
jge    11ef <main+0xdf>
movl   $0x0,-0x18(%rbp)
movl   $0x2,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x1c(%rbp)
mov    -0x14(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    %eax,%ecx
mov    -0x1c(%rbp),%eax
cmp    %ecx,%eax
jg     1199 <main+0x89>
mov    -0x14(%rbp),%eax
cltd
idivl  -0xc(%rbp)
cmp    $0x0,%edx
jne    1186 <main+0x76>
movl   $0x1,-0x18(%rbp)
jmp    1199 <main+0x89>
jmp    118b <main+0x7b>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    114c <main+0x3c>
cmpl   $0x0,-0x18(%rbp)
jne    11e1 <main+0xd1>
mov    -0x14(%rbp),%eax
mov    -0x10(%rbp),%ecx
add    $0x2,%ecx
cmp    %ecx,%eax
jne    11db <main+0xcb>
mov    -0x10(%rbp),%esi
lea    0xe42(%rip),%rdi
call   1030 <printf@plt>
mov    -0x14(%rbp),%esi
lea    0xe39(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
mov    -0x14(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1134 <main+0x24>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r12
push   %rbx
xor    %ebx,%ebx
mov    $0x2,%r12d
lea    0xed9(%rip),%r14
lea    0xed8(%rip),%r15
mov    $0x2,%ebp
mov    $0x2,%esi
jmp    114a <main+0x3a>
nopw   0x0(%rax,%rax,1)
mov    %ebp,%esi
add    $0x1,%ebp
cmp    $0xa,%ebx
jge    11aa <main+0x9a>
mov    %ebp,%ecx
shr    %ecx
cmp    $0x3,%ecx
cmovb  %r12d,%ecx
cmp    $0x4,%ebp
jb     118c <main+0x7c>
neg    %ecx
mov    $0x2,%edi
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    %ebp,%eax
xor    %edx,%edx
div    %edi
test   %edx,%edx
je     1142 <main+0x32>
lea    (%rcx,%rdi,1),%eax
add    $0x1,%eax
mov    %edi,%edx
add    $0x1,%edx
mov    %edx,%edi
cmp    $0x1,%eax
jne    1170 <main+0x60>
lea    0x2(%rsi),%eax
cmp    %eax,%ebp
jne    1140 <main+0x30>
mov    %r14,%rdi
call   1030 <printf@plt>
mov    %r15,%rdi
mov    %ebp,%esi
call   1030 <printf@plt>
add    $0x1,%ebx
jmp    1140 <main+0x30>
xor    %eax,%eax
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
pop    %rbp
ret

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

LLVM IR (-O2):
@.str = [6 x i8] c"%d - \00"
@.str.1 = [4 x i8] c"%d\0A\00"
define i32 @main() {
br label %1
1: ; preds = %0, %22
%2 = phi i32 [ 2, %0 ], [ %25, %22 ]
%3 = phi i32 [ 2, %0 ], [ %24, %22 ]
%4 = phi i32 [ 0, %0 ], [ %23, %22 ]
%5 = lshr i32 %2, 1
%6 = call i32 @llvm.umax.i32(i32 %5, i32 2)
%7 = icmp ult i32 %2, 4
br i1 %7, label %15, label %11
8: ; preds = %11
%9 = add nuw nsw i32 %12, 1
%10 = icmp eq i32 %12, %6
br i1 %10, label %15, label %11
11: ; preds = %1, %8
%12 = phi i32 [ %9, %8 ], [ 2, %1 ]
%13 = urem i32 %2, %12
%14 = icmp eq i32 %13, 0
br i1 %14, label %22, label %8
15: ; preds = %8, %1
%16 = add nsw i32 %3, 2
%17 = icmp eq i32 %2, %16
br i1 %17, label %18, label %22
18: ; preds = %15
%19 = tail call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32 %3)
%20 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %2)
%21 = add nsw i32 %4, 1
br label %22
22: ; preds = %11, %15, %18
%23 = phi i32 [ %21, %18 ], [ %4, %15 ], [ %4, %11 ]
%24 = phi i32 [ %2, %18 ], [ %2, %15 ], [ %3, %11 ]
%25 = add nuw nsw i32 %2, 1
%26 = icmp slt i32 %23, 10
br i1 %26, label %1, label %27
27: ; preds = %22
ret i32 0
}