#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(long);
int /*<<< orphan*/ printf(char *, long);
int /*<<< orphan*/ scanf(char *, long *);
long _main() {
  long EV_limit;
  long EV_a;
  scanf("%ld", &EV_limit);
  EV_a = 0;
  while ((EV_a <= EV_limit)) {
    if (_prime(EV_a)) {
      printf("%ld\n", (long)EV_a);
    }
    EV_a = (EV_a + 1);
  }
  return 0;
}


x86 assembly (clang, -O0):
<_main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xec1(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1040 <scanf@plt>
movq   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%rax
cmp    -0x8(%rbp),%rax
jg     1192 <_main+0x62>
mov    -0x10(%rbp),%rdi
call   1050 <_prime@plt>
cmp    $0x0,%rax
je     1181 <_main+0x51>
mov    -0x10(%rbp),%rsi
lea    0xe88(%rip),%rdi
call   1030 <printf@plt>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    1150 <_main+0x20>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_main>:
push   %r14
push   %rbx
push   %rax
lea    0xec5(%rip),%rdi
mov    %rsp,%rsi
call   1040 <scanf@plt>
cmpq   $0x0,(%rsp)
js     1184 <_main+0x54>
mov    $0xffffffffffffffff,%rbx
lea    0xeac(%rip),%r14
jmp    1166 <_main+0x36>
nopw   0x0(%rax,%rax,1)
cmp    (%rsp),%rbx
jge    1184 <_main+0x54>
add    $0x1,%rbx
mov    %rbx,%rdi
call   1050 <_prime@plt>
test   %rax,%rax
je     1160 <_main+0x30>
mov    %r14,%rdi
mov    %rbx,%rsi
call   1030 <printf@plt>
jmp    1160 <_main+0x30>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [4 x i8] c"%ld\00"
@.str.1 = [5 x i8] c"%ld\0A\00"
define i64 @_main() {
%1 = alloca i64
%2 = alloca i64
%3 = call i32 @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i64* %1)
store i64 0, i64* %2
br label %4
4: ; preds = %15, %0
%5 = load i64, i64* %2
%6 = load i64, i64* %1
%7 = icmp sle i64 %5, %6
br i1 %7, label %8, label %18
8: ; preds = %4
%9 = load i64, i64* %2
%10 = call i64 @_prime(i64 %9)
%11 = icmp ne i64 %10, 0
br i1 %11, label %12, label %15
12: ; preds = %8
%13 = load i64, i64* %2
%14 = call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i64 %13)
br label %15
15: ; preds = %12, %8
%16 = load i64, i64* %2
%17 = add nsw i64 %16, 1
store i64 %17, i64* %2
br label %4
18: ; preds = %4
ret i64 0
}

LLVM IR (-O2):
@.str = [4 x i8] c"%ld\00"
@.str.1 = [5 x i8] c"%ld\0A\00"
define i64 @_main() {
%1 = alloca i64
%2 = bitcast i64* %1 to i8*
%3 = call i32 @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i64* %1)
%4 = load i64, i64* %1
%5 = icmp slt i64 %4, 0
br i1 %5, label %16, label %6
6: ; preds = %0, %12
%7 = phi i64 [ %13, %12 ], [ 0, %0 ]
%8 = call i64 @_prime(i64 %7)
%9 = icmp eq i64 %8, 0
br i1 %9, label %12, label %10
10: ; preds = %6
%11 = call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i64 %7)
br label %12
12: ; preds = %10, %6
%13 = add nuw nsw i64 %7, 1
%14 = load i64, i64* %1
%15 = icmp slt i64 %7, %14
br i1 %15, label %6, label %16
16: ; preds = %12, %0
ret i64 0
}