#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 /*<<< orphan*/ printf(char *, int);
int /*<<< orphan*/ scanf(char *, int *);
int main(int argc, char **argv) {
  int n, i, temu, j;
  scanf("%d", &n);
  for (i = 2; i <= n; i++) {
    temu = 0;
    for (j = 2; j < i; j++) {
      if (i % j == 0) {
        temu = 1;
        break;
      }
    }
    if (temu == 0) {
      printf("%d ", i);
    }
  }
  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)
lea    0xec3(%rip),%rdi
lea    -0x14(%rbp),%rsi
call   1040 <scanf@plt>
movl   $0x2,-0x18(%rbp)
mov    -0x18(%rbp),%eax
cmp    -0x14(%rbp),%eax
jg     11ce <main+0xae>
movl   $0x0,-0x1c(%rbp)
movl   $0x2,-0x20(%rbp)
mov    -0x20(%rbp),%eax
cmp    -0x18(%rbp),%eax
jge    11a2 <main+0x82>
mov    -0x18(%rbp),%eax
cltd
idivl  -0x20(%rbp)
cmp    $0x0,%edx
jne    118f <main+0x6f>
movl   $0x1,-0x1c(%rbp)
jmp    11a2 <main+0x82>
jmp    1194 <main+0x74>
mov    -0x20(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x20(%rbp)
jmp    1167 <main+0x47>
cmpl   $0x0,-0x1c(%rbp)
jne    11bb <main+0x9b>
mov    -0x18(%rbp),%esi
lea    0xe4d(%rip),%rdi
call   1030 <printf@plt>
jmp    11c0 <main+0xa0>
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    114d <main+0x2d>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %rbx
sub    $0x10,%rsp
lea    0xed0(%rip),%rdi
lea    0xc(%rsp),%rsi
call   1040 <scanf@plt>
mov    0xc(%rsp),%ecx
cmp    $0x2,%ecx
jge    114f <main+0x2f>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret
mov    $0x2,%ebx
xor    %r15d,%r15d
lea    0xea5(%rip),%r14
jmp    117b <main+0x5b>
mov    %r14,%rdi
mov    %ebx,%esi
call   1030 <printf@plt>
mov    0xc(%rsp),%ecx
lea    0x1(%rbx),%eax
add    $0xffffffff,%r15d
cmp    %ecx,%ebx
mov    %eax,%ebx
jge    1143 <main+0x23>
cmp    $0x3,%ebx
jb     1160 <main+0x40>
mov    $0x2,%esi
cs nopw 0x0(%rax,%rax,1)
nop
mov    %ebx,%eax
xor    %edx,%edx
div    %esi
test   %edx,%edx
je     116e <main+0x4e>
add    $0x1,%esi
lea    (%r15,%rsi,1),%eax
cmp    $0x2,%eax
jne    1190 <main+0x70>
jmp    1160 <main+0x40>

LLVM IR (-O0):
@.str = [3 x i8] c"%d\00"
@.str.1 = [4 x i8] c"%d \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
%9 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%10 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %6)
store i32 2, i32* %7
br label %11
11: ; preds = %37, %2
%12 = load i32, i32* %7
%13 = load i32, i32* %6
%14 = icmp sle i32 %12, %13
br i1 %14, label %15, label %40
15: ; preds = %11
store i32 0, i32* %8
store i32 2, i32* %9
br label %16
16: ; preds = %27, %15
%17 = load i32, i32* %9
%18 = load i32, i32* %7
%19 = icmp slt i32 %17, %18
br i1 %19, label %20, label %30
20: ; preds = %16
%21 = load i32, i32* %7
%22 = load i32, i32* %9
%23 = srem i32 %21, %22
%24 = icmp eq i32 %23, 0
br i1 %24, label %25, label %26
25: ; preds = %20
store i32 1, i32* %8
br label %30
26: ; preds = %20
br label %27
27: ; preds = %26
%28 = load i32, i32* %9
%29 = add nsw i32 %28, 1
store i32 %29, i32* %9
br label %16
30: ; preds = %25, %16
%31 = load i32, i32* %8
%32 = icmp eq i32 %31, 0
br i1 %32, label %33, label %36
33: ; preds = %30
%34 = load i32, i32* %7
%35 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %34)
br label %36
36: ; preds = %33, %30
br label %37
37: ; preds = %36
%38 = load i32, i32* %7
%39 = add nsw i32 %38, 1
store i32 %39, i32* %7
br label %11
40: ; preds = %11
ret i32 0
}

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
@.str.1 = [4 x i8] c"%d \00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca i32
%4 = bitcast i32* %3 to i8*
%5 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %3)
%6 = load i32, i32* %3
%7 = icmp slt i32 %6, 2
br i1 %7, label %26, label %8
8: ; preds = %2, %22
%9 = phi i32 [ %23, %22 ], [ %6, %2 ]
%10 = phi i32 [ %24, %22 ], [ 2, %2 ]
%11 = icmp ugt i32 %10, 2
br i1 %11, label %14, label %19
12: ; preds = %14
%13 = icmp eq i32 %18, %10
br i1 %13, label %19, label %14
14: ; preds = %8, %12
%15 = phi i32 [ %18, %12 ], [ 2, %8 ]
%16 = urem i32 %10, %15
%17 = icmp eq i32 %16, 0
%18 = add nuw nsw i32 %15, 1
br i1 %17, label %22, label %12
19: ; preds = %12, %8
%20 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %10)
%21 = load i32, i32* %3
br label %22
22: ; preds = %14, %19
%23 = phi i32 [ %21, %19 ], [ %9, %14 ]
%24 = add nuw nsw i32 %10, 1
%25 = icmp slt i32 %10, %23
br i1 %25, label %8, label %26
26: ; preds = %22, %2
ret i32 0
}