#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__ check_prime(int);
int /*<<< orphan*/ printf(char *, int);
int /*<<< orphan*/ scanf(char *, int *);
int main() {
  int n, x;
  scanf("%d", &n);
  for (x = n; x >= n; x++) {
    if (check_prime(x)) {
      break;
    } else {
      continue;
    }
  }
  printf("%d", x);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeba(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1050 <scanf@plt>
mov    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x8(%rbp),%eax
jl     118b <main+0x5b>
mov    -0xc(%rbp),%edi
call   1030 <check_prime@plt>
cmp    $0x0,%rax
je     1178 <main+0x48>
jmp    118b <main+0x5b>
jmp    117d <main+0x4d>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1155 <main+0x25>
mov    -0xc(%rbp),%esi
lea    0xe6b(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x10,%rsp
lea    0xec4(%rip),%rdi
lea    0xc(%rsp),%rsi
call   1050 <scanf@plt>
mov    0xc(%rsp),%ebx
nopw   0x0(%rax,%rax,1)
mov    %ebx,%edi
call   1030 <check_prime@plt>
test   %rax,%rax
jne    1165 <main+0x35>
add    $0x1,%ebx
cmp    0xc(%rsp),%ebx
jge    1150 <main+0x20>
lea    0xe94(%rip),%rdi
mov    %ebx,%esi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
ret

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

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