#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 /*<<< orphan*/ scanf(char *, int *);
main() {
  int n;
  int i, x;
  int div;
  printf("Input a number, Please ?\n");
  scanf("%d", &n);
  printf("  pn\n");
  for (i = 2; i <= n; i++) {
    div = 0;
    for (x = 1; x <= i; x++) {
      if (i % x == 0)
        div++;
    }
    if (div == 2)
      printf("  %d", i);
  }
  printf("\n");
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xede(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1040 <scanf@plt>
lea    0xec6(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x2,-0xc(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x8(%rbp),%eax
jg     11e2 <main+0xc2>
movl   $0x0,-0x14(%rbp)
movl   $0x1,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jg     11b4 <main+0x94>
mov    -0xc(%rbp),%eax
cltd
idivl  -0x10(%rbp)
cmp    $0x0,%edx
jne    11a1 <main+0x81>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    11a6 <main+0x86>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    117c <main+0x5c>
cmpl   $0x2,-0x14(%rbp)
jne    11cf <main+0xaf>
mov    -0xc(%rbp),%esi
lea    0xe58(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    11d4 <main+0xb4>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1162 <main+0x42>
lea    0xe2f(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
lea    0xeb7(%rip),%rdi
call   1040 <puts@plt>
lea    0xea8(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1060 <scanf@plt>
lea    0xeb3(%rip),%rdi
call   1040 <puts@plt>
mov    0x4(%rsp),%r8d
cmp    $0x2,%r8d
jge    1192 <main+0x52>
mov    $0xa,%edi
call   1030 <putchar@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret
mov    $0x2,%ebx
lea    0xe62(%rip),%r14
xor    %r9d,%r9d
xor    %r15d,%r15d
jmp    11bd <main+0x7d>
cs nopw 0x0(%rax,%rax,1)
lea    0x1(%rbx),%eax
mov    %r15d,%r9d
cmp    %r8d,%ebx
mov    %eax,%ebx
jge    117b <main+0x3b>
mov    $0x1,%esi
mov    $0x0,%edi
inc    %r15d
je     120d <main+0xcd>
mov    %ebx,%ecx
and    $0xfffffffe,%ecx
neg    %ecx
mov    $0x1,%ebp
xor    %edi,%edi
nopw   0x0(%rax,%rax,1)
mov    %ebx,%eax
xor    %edx,%edx
div    %ebp
cmp    $0x1,%edx
adc    $0x0,%edi
lea    0x1(%rbp),%esi
mov    %ebx,%eax
xor    %edx,%edx
div    %esi
cmp    $0x1,%edx
adc    $0x0,%edi
mov    %ebp,%esi
add    $0x2,%esi
lea    (%rcx,%rbp,1),%eax
add    $0x2,%eax
mov    %esi,%ebp
cmp    $0x1,%eax
jne    11e0 <main+0xa0>
test   $0x1,%r9b
je     121f <main+0xdf>
mov    %ebx,%eax
xor    %edx,%edx
div    %esi
cmp    $0x1,%edx
adc    $0x0,%edi
cmp    $0x2,%edi
jne    11b0 <main+0x70>
mov    %r14,%rdi
mov    %ebx,%esi
xor    %eax,%eax
call   1050 <printf@plt>
mov    0x4(%rsp),%r8d
jmp    11b0 <main+0x70>

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

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