#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 asalmi(int);
int /*<<< orphan*/ printf(char *, int);
int main(int argc, char **argv) {
  int gerekenasal = 30;
  int i;
  int sayac = 0;
  while (1) {
    for (i = 2; sayac <= gerekenasal; i++) {
      if (asalmi(i) == 1) {
        printf("%d \n", i);
        sayac++;
      }
    }
  }
  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   $0x1e,-0x14(%rbp)
movl   $0x0,-0x1c(%rbp)
movl   $0x2,-0x18(%rbp)
mov    -0x1c(%rbp),%eax
cmp    -0x14(%rbp),%eax
jg     1193 <main+0x73>
mov    -0x18(%rbp),%edi
call   1040 <asalmi@plt>
cmp    $0x1,%eax
jne    1180 <main+0x60>
mov    -0x18(%rbp),%esi
lea    0xe8e(%rip),%rdi
call   1030 <printf@plt>
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    1185 <main+0x65>
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    114b <main+0x2b>
jmp    1144 <main+0x24>

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r14
push   %rbx
xor    %eax,%eax
lea    0xed3(%rip),%r14
xor    %ebx,%ebx
jmp    1140 <main+0x20>
mov    $0x1f,%ebx
mov    $0x1,%al
nopl   0x0(%rax,%rax,1)
test   $0x1,%al
jne    1140 <main+0x20>
mov    $0x2,%ebp
jmp    1158 <main+0x38>
nopl   0x0(%rax,%rax,1)
add    $0x1,%ebp
cmp    $0x1f,%ebx
jge    1131 <main+0x11>
mov    %ebp,%edi
call   1040 <asalmi@plt>
cmp    $0x1,%eax
jne    1150 <main+0x30>
mov    %r14,%rdi
mov    %ebp,%esi
call   1030 <printf@plt>
add    $0x1,%ebx
jmp    1150 <main+0x30>

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

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