#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 is_prime(int);
int /*<<< orphan*/ printf(char *, int);
int /*<<< orphan*/ scanf(char *, int *);
int main() {
  int x = -1, arr[9], array_num = 0;
  while (x <= 0 || x >= 10)
    scanf("%d", &x);
  for (int i = 0; array_num < 10; i++) {
    if (is_prime(i) == 1) {
      if (i % 10 == x) {
        arr[array_num] = i;
        array_num++;
      }
    }
  }
  for (int i = 0; i < 10; ++i)
    printf("%d\n", arr[i]);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0xffffffff,-0x8(%rbp)
movl   $0x0,-0x34(%rbp)
mov    $0x1,%al
cmpl   $0x0,-0x8(%rbp)
mov    %al,-0x3d(%rbp)
jle    1166 <main+0x36>
cmpl   $0xa,-0x8(%rbp)
setge  %al
mov    %al,-0x3d(%rbp)
mov    -0x3d(%rbp),%al
test   $0x1,%al
jne    1176 <main+0x46>
jmp    118b <main+0x5b>
lea    0xe83(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1050 <scanf@plt>
jmp    114d <main+0x1d>
movl   $0x0,-0x38(%rbp)
cmpl   $0xa,-0x34(%rbp)
jge    11ed <main+0xbd>
mov    -0x38(%rbp),%edi
call   1040 <is_prime@plt>
cmp    $0x1,%eax
jne    11da <main+0xaa>
mov    -0x38(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
cmp    -0x8(%rbp),%edx
jne    11d5 <main+0xa5>
mov    -0x38(%rbp),%ecx
movslq -0x34(%rbp),%rax
mov    %ecx,-0x30(%rbp,%rax,4)
mov    -0x34(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x34(%rbp)
jmp    11da <main+0xaa>
jmp    11df <main+0xaf>
mov    -0x38(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x38(%rbp)
jmp    1192 <main+0x62>
movl   $0x0,-0x3c(%rbp)
cmpl   $0xa,-0x3c(%rbp)
jge    1220 <main+0xf0>
movslq -0x3c(%rbp),%rax
mov    -0x30(%rbp,%rax,4),%esi
lea    0xdf6(%rip),%rdi
call   1030 <printf@plt>
mov    -0x3c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x3c(%rbp)
jmp    11f4 <main+0xc4>
xor    %eax,%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %rbx
sub    $0x40,%rsp
movl   $0xffffffff,0xc(%rsp)
ff
lea    0xeb8(%rip),%r14
lea    0xc(%rsp),%rbx
nopl   (%rax)
mov    %r14,%rdi
mov    %rbx,%rsi
call   1050 <scanf@plt>
mov    0xc(%rsp),%eax
add    $0xfffffff6,%eax
cmp    $0xfffffff7,%eax
jb     1150 <main+0x20>
xor    %ebx,%ebx
mov    $0xcccccccd,%r14d
xor    %r15d,%r15d
jmp    1189 <main+0x59>
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
add    $0x1,%ebx
cmp    $0xa,%r15d
jge    11bc <main+0x8c>
mov    %ebx,%edi
call   1040 <is_prime@plt>
cmp    $0x1,%eax
jne    1180 <main+0x50>
mov    %ebx,%eax
imul   %r14,%rax
shr    $0x23,%rax
add    %eax,%eax
lea    (%rax,%rax,4),%eax
neg    %eax
add    %ebx,%eax
cmp    0xc(%rsp),%eax
jne    1180 <main+0x50>
movslq %r15d,%r15
mov    %ebx,0x10(%rsp,%r15,4)
add    $0x1,%r15d
jmp    1180 <main+0x50>
mov    0x10(%rsp),%esi
lea    0xe3c(%rip),%rbx
mov    %rbx,%rdi
call   1030 <printf@plt>
mov    0x14(%rsp),%esi
mov    %rbx,%rdi
call   1030 <printf@plt>
mov    0x18(%rsp),%esi
mov    %rbx,%rdi
call   1030 <printf@plt>
mov    0x1c(%rsp),%esi
mov    %rbx,%rdi
call   1030 <printf@plt>
mov    0x20(%rsp),%esi
mov    %rbx,%rdi
call   1030 <printf@plt>
mov    0x24(%rsp),%esi
mov    %rbx,%rdi
call   1030 <printf@plt>
mov    0x28(%rsp),%esi
mov    %rbx,%rdi
call   1030 <printf@plt>
mov    0x2c(%rsp),%esi
mov    %rbx,%rdi
call   1030 <printf@plt>
mov    0x30(%rsp),%esi
mov    %rbx,%rdi
call   1030 <printf@plt>
mov    0x34(%rsp),%esi
mov    %rbx,%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x40,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [3 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 [9 x i32]
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32 0, i32* %1
store i32 -1, i32* %2
store i32 0, i32* %4
br label %7
7: ; preds = %15, %0
%8 = load i32, i32* %2
%9 = icmp sle i32 %8, 0
br i1 %9, label %13, label %10
10: ; preds = %7
%11 = load i32, i32* %2
%12 = icmp sge i32 %11, 10
br label %13
13: ; preds = %10, %7
%14 = phi i1 [ true, %7 ], [ %12, %10 ]
br i1 %14, label %15, label %17
15: ; preds = %13
%16 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %2)
br label %7
17: ; preds = %13
store i32 0, i32* %5
br label %18
18: ; preds = %39, %17
%19 = load i32, i32* %4
%20 = icmp slt i32 %19, 10
br i1 %20, label %21, label %42
21: ; preds = %18
%22 = load i32, i32* %5
%23 = call i32 @is_prime(i32 %22)
%24 = icmp eq i32 %23, 1
br i1 %24, label %25, label %38
25: ; preds = %21
%26 = load i32, i32* %5
%27 = srem i32 %26, 10
%28 = load i32, i32* %2
%29 = icmp eq i32 %27, %28
br i1 %29, label %30, label %37
30: ; preds = %25
%31 = load i32, i32* %5
%32 = load i32, i32* %4
%33 = sext i32 %32 to i64
%34 = getelementptr inbounds [9 x i32], [9 x i32]* %3, i64 0, i64 %33
store i32 %31, i32* %34
%35 = load i32, i32* %4
%36 = add nsw i32 %35, 1
store i32 %36, i32* %4
br label %37
37: ; preds = %30, %25
br label %38
38: ; preds = %37, %21
br label %39
39: ; preds = %38
%40 = load i32, i32* %5
%41 = add nsw i32 %40, 1
store i32 %41, i32* %5
br label %18
42: ; preds = %18
store i32 0, i32* %6
br label %43
43: ; preds = %52, %42
%44 = load i32, i32* %6
%45 = icmp slt i32 %44, 10
br i1 %45, label %46, label %55
46: ; preds = %43
%47 = load i32, i32* %6
%48 = sext i32 %47 to i64
%49 = getelementptr inbounds [9 x i32], [9 x i32]* %3, i64 0, i64 %48
%50 = load i32, i32* %49
%51 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %50)
br label %52
52: ; preds = %46
%53 = load i32, i32* %6
%54 = add nsw i32 %53, 1
store i32 %54, i32* %6
br label %43
55: ; preds = %43
ret i32 0
}

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
@.str.1 = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [9 x i32]
%3 = bitcast i32* %1 to i8*
store i32 -1, i32* %1
%4 = bitcast [9 x i32]* %2 to i8*
br label %5
5: ; preds = %0, %5
%6 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %1)
%7 = load i32, i32* %1
%8 = add i32 %7, -10
%9 = icmp ult i32 %8, -9
br i1 %9, label %5, label %10
10: ; preds = %5, %23
%11 = phi i32 [ %25, %23 ], [ 0, %5 ]
%12 = phi i32 [ %24, %23 ], [ 0, %5 ]
%13 = call i32 @is_prime(i32 %11)
%14 = icmp eq i32 %13, 1
br i1 %14, label %15, label %23
15: ; preds = %10
%16 = urem i32 %11, 10
%17 = load i32, i32* %1
%18 = icmp eq i32 %16, %17
br i1 %18, label %19, label %23
19: ; preds = %15
%20 = sext i32 %12 to i64
%21 = getelementptr inbounds [9 x i32], [9 x i32]* %2, i64 0, i64 %20
store i32 %11, i32* %21
%22 = add nsw i32 %12, 1
br label %23
23: ; preds = %10, %19, %15
%24 = phi i32 [ %22, %19 ], [ %12, %15 ], [ %12, %10 ]
%25 = add nuw nsw i32 %11, 1
%26 = icmp slt i32 %24, 10
br i1 %26, label %10, label %27
27: ; preds = %23
%28 = getelementptr inbounds [9 x i32], [9 x i32]* %2, i64 0, i64 0
%29 = load i32, i32* %28
%30 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %29)
%31 = getelementptr inbounds [9 x i32], [9 x i32]* %2, i64 0, i64 1
%32 = load i32, i32* %31
%33 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %32)
%34 = getelementptr inbounds [9 x i32], [9 x i32]* %2, i64 0, i64 2
%35 = load i32, i32* %34
%36 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %35)
%37 = getelementptr inbounds [9 x i32], [9 x i32]* %2, i64 0, i64 3
%38 = load i32, i32* %37
%39 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %38)
%40 = getelementptr inbounds [9 x i32], [9 x i32]* %2, i64 0, i64 4
%41 = load i32, i32* %40
%42 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %41)
%43 = getelementptr inbounds [9 x i32], [9 x i32]* %2, i64 0, i64 5
%44 = load i32, i32* %43
%45 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %44)
%46 = getelementptr inbounds [9 x i32], [9 x i32]* %2, i64 0, i64 6
%47 = load i32, i32* %46
%48 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %47)
%49 = getelementptr inbounds [9 x i32], [9 x i32]* %2, i64 0, i64 7
%50 = load i32, i32* %49
%51 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %50)
%52 = getelementptr inbounds [9 x i32], [9 x i32]* %2, i64 0, i64 8
%53 = load i32, i32* %52
%54 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %53)
%55 = getelementptr inbounds [9 x i32], [9 x i32]* %2, i64 0, i64 9
%56 = load i32, i32* %55
%57 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %56)
ret i32 0
}