#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 */
typedef int /*<<< orphan*/ primes;

/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int /*<<< orphan*/ scanf(char *, int *);
int main() {
  int primes[] = {
      2,     3,     5,     7,      11,    101,   131,   151,   181,   191,
      313,   353,   373,   383,    727,   757,   787,   797,   919,   929,
      10301, 10501, 10601, 11311,  11411, 12421, 12721, 12821, 13331, 13831,
      13931, 14341, 14741, 15451,  15551, 16061, 16361, 16561, 16661, 17471,
      17971, 18181, 18481, 19391,  19891, 19991, 30103, 30203, 30403, 30703,
      30803, 31013, 31513, 32323,  32423, 33533, 34543, 34843, 35053, 35153,
      35353, 35753, 36263, 36563,  37273, 37573, 38083, 38183, 38783, 39293,
      70207, 70507, 70607, 71317,  71917, 72227, 72727, 73037, 73237, 73637,
      74047, 74747, 75557, 76367,  76667, 77377, 77477, 77977, 78487, 78787,
      78887, 79397, 79697, 79997,  90709, 91019, 93139, 93239, 93739, 94049,
      94349, 94649, 94849, 94949,  95959, 96269, 96469, 96769, 97379, 97579,
      97879, 98389, 98689, 1003001};
  register int i;
  int temp;
  scanf("%d", &temp);
  for (i = 0; i < sizeof(primes) / sizeof(int); i++)
    if (primes[i] >= temp) {
      printf("%d", primes[i]);
      break;
    }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x1e0,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x1d0(%rbp),%rdi
lea    0xeb0(%rip),%rsi
mov    $0x1c8,%edx
call   1040 <memcpy@plt>
lea    0x1067(%rip),%rdi
lea    -0x1d8(%rbp),%rsi
call   1050 <scanf@plt>
movl   $0x0,-0x1d4(%rbp)
movslq -0x1d4(%rbp),%rax
cmp    $0x72,%rax
jae    11da <main+0xaa>
movslq -0x1d4(%rbp),%rax
mov    -0x1d0(%rbp,%rax,4),%eax
cmp    -0x1d8(%rbp),%eax
jl     11c1 <main+0x91>
movslq -0x1d4(%rbp),%rax
mov    -0x1d0(%rbp,%rax,4),%esi
lea    0x1011(%rip),%rdi
call   1030 <printf@plt>
jmp    11da <main+0xaa>
jmp    11c6 <main+0x96>
mov    -0x1d4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1d4(%rbp)
jmp    1177 <main+0x47>
xor    %eax,%eax
add    $0x1e0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0x10a0(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1040 <scanf@plt>
mov    $0x2,%eax
mov    0x4(%rsp),%ecx
lea    0xebe(%rip),%rdx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
mov    -0x8(%rdx,%rax,4),%esi
cmp    %ecx,%esi
jge    1173 <main+0x53>
mov    -0x4(%rdx,%rax,4),%esi
cmp    %ecx,%esi
jge    1173 <main+0x53>
mov    (%rdx,%rax,4),%esi
cmp    %ecx,%esi
jge    1173 <main+0x53>
add    $0x3,%rax
cmp    $0x74,%rax
jne    1150 <main+0x30>
jmp    117f <main+0x5f>
lea    0x104e(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@__const.main.primes = [114 x i32] [i32 2, i32 3, i32 5, i32 7, i32 11, i32 101, i32 131, i32 151, i32 181, i32 191, i32 313, i32 353, i32 373, i32 383, i32 727, i32 757, i32 787, i32 797, i32 919, i32 929, i32 10301, i32 10501, i32 10601, i32 11311, i32 11411, i32 12421, i32 12721, i32 12821, i32 13331, i32 13831, i32 13931, i32 14341, i32 14741, i32 15451, i32 15551, i32 16061, i32 16361, i32 16561, i32 16661, i32 17471, i32 17971, i32 18181, i32 18481, i32 19391, i32 19891, i32 19991, i32 30103, i32 30203, i32 30403, i32 30703, i32 30803, i32 31013, i32 31513, i32 32323, i32 32423, i32 33533, i32 34543, i32 34843, i32 35053, i32 35153, i32 35353, i32 35753, i32 36263, i32 36563, i32 37273, i32 37573, i32 38083, i32 38183, i32 38783, i32 39293, i32 70207, i32 70507, i32 70607, i32 71317, i32 71917, i32 72227, i32 72727, i32 73037, i32 73237, i32 73637, i32 74047, i32 74747, i32 75557, i32 76367, i32 76667, i32 77377, i32 77477, i32 77977, i32 78487, i32 78787, i32 78887, i32 79397, i32 79697, i32 79997, i32 90709, i32 91019, i32 93139, i32 93239, i32 93739, i32 94049, i32 94349, i32 94649, i32 94849, i32 94949, i32 95959, i32 96269, i32 96469, i32 96769, i32 97379, i32 97579, i32 97879, i32 98389, i32 98689, i32 1003001]
@.str = [3 x i8] c"%d\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [114 x i32]
%3 = alloca i32
%4 = alloca i32
store i32 0, i32* %1
%5 = bitcast [114 x i32]* %2 to i8*
%6 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %4)
store i32 0, i32* %3
br label %7
7: ; preds = %25, %0
%8 = load i32, i32* %3
%9 = sext i32 %8 to i64
%10 = icmp ult i64 %9, 114
br i1 %10, label %11, label %28
11: ; preds = %7
%12 = load i32, i32* %3
%13 = sext i32 %12 to i64
%14 = getelementptr inbounds [114 x i32], [114 x i32]* %2, i64 0, i64 %13
%15 = load i32, i32* %14
%16 = load i32, i32* %4
%17 = icmp sge i32 %15, %16
br i1 %17, label %18, label %24
18: ; preds = %11
%19 = load i32, i32* %3
%20 = sext i32 %19 to i64
%21 = getelementptr inbounds [114 x i32], [114 x i32]* %2, i64 0, i64 %20
%22 = load i32, i32* %21
%23 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %22)
br label %28
24: ; preds = %11
br label %25
25: ; preds = %24
%26 = load i32, i32* %3
%27 = add nsw i32 %26, 1
store i32 %27, i32* %3
br label %7
28: ; preds = %18, %7
ret i32 0
}

LLVM IR (-O2):
@__const.main.primes = [114 x i32] [i32 2, i32 3, i32 5, i32 7, i32 11, i32 101, i32 131, i32 151, i32 181, i32 191, i32 313, i32 353, i32 373, i32 383, i32 727, i32 757, i32 787, i32 797, i32 919, i32 929, i32 10301, i32 10501, i32 10601, i32 11311, i32 11411, i32 12421, i32 12721, i32 12821, i32 13331, i32 13831, i32 13931, i32 14341, i32 14741, i32 15451, i32 15551, i32 16061, i32 16361, i32 16561, i32 16661, i32 17471, i32 17971, i32 18181, i32 18481, i32 19391, i32 19891, i32 19991, i32 30103, i32 30203, i32 30403, i32 30703, i32 30803, i32 31013, i32 31513, i32 32323, i32 32423, i32 33533, i32 34543, i32 34843, i32 35053, i32 35153, i32 35353, i32 35753, i32 36263, i32 36563, i32 37273, i32 37573, i32 38083, i32 38183, i32 38783, i32 39293, i32 70207, i32 70507, i32 70607, i32 71317, i32 71917, i32 72227, i32 72727, i32 73037, i32 73237, i32 73637, i32 74047, i32 74747, i32 75557, i32 76367, i32 76667, i32 77377, i32 77477, i32 77977, i32 78487, i32 78787, i32 78887, i32 79397, i32 79697, i32 79997, i32 90709, i32 91019, i32 93139, i32 93239, i32 93739, i32 94049, i32 94349, i32 94649, i32 94849, i32 94949, i32 95959, i32 96269, i32 96469, i32 96769, i32 97379, i32 97579, i32 97879, i32 98389, i32 98689, i32 1003001]
@.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 %18
5: ; preds = %18
%6 = add nuw nsw i64 %19, 1
%7 = getelementptr inbounds [114 x i32], [114 x i32]* @__const.main.primes, i64 0, i64 %6
%8 = load i32, i32* %7
%9 = icmp slt i32 %8, %4
br i1 %9, label %10, label %23
10: ; preds = %5
%11 = add nuw nsw i64 %19, 2
%12 = getelementptr inbounds [114 x i32], [114 x i32]* @__const.main.primes, i64 0, i64 %11
%13 = load i32, i32* %12
%14 = icmp slt i32 %13, %4
br i1 %14, label %15, label %23
15: ; preds = %10
%16 = add nuw nsw i64 %19, 3
%17 = icmp eq i64 %16, 114
br i1 %17, label %26, label %18
18: ; preds = %15, %0
%19 = phi i64 [ 0, %0 ], [ %16, %15 ]
%20 = getelementptr inbounds [114 x i32], [114 x i32]* @__const.main.primes, i64 0, i64 %19
%21 = load i32, i32* %20
%22 = icmp slt i32 %21, %4
br i1 %22, label %5, label %23
23: ; preds = %10, %5, %18
%24 = phi i32 [ %21, %18 ], [ %8, %5 ], [ %13, %10 ]
%25 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %24)
br label %26
26: ; preds = %15, %23
ret i32 0
}