#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, const char *argv[]) {
  int x, i, first = 1;
  scanf("%i", &x);
  for (i = 2; i <= x; ++i) {
    while (!(x % i)) {
      x /= i;
      printf(first ? "%i" : " %i", i);
      first = 0;
    }
  }
  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)
movl   $0x1,-0x1c(%rbp)
lea    0xebd(%rip),%rdi
lea    -0x14(%rbp),%rsi
call   1040 <scanf@plt>
movl   $0x2,-0x18(%rbp)
mov    -0x18(%rbp),%eax
cmp    -0x14(%rbp),%eax
jg     11cc <main+0xac>
jmp    1165 <main+0x45>
mov    -0x14(%rbp),%eax
cltd
idivl  -0x18(%rbp)
cmp    $0x0,%edx
setne  %al
xor    $0xff,%al
test   $0x1,%al
jne    1181 <main+0x61>
jmp    11b9 <main+0x99>
mov    -0x18(%rbp),%ecx
mov    -0x14(%rbp),%eax
cltd
idiv   %ecx
mov    %eax,-0x14(%rbp)
mov    -0x1c(%rbp),%ecx
lea    0xe69(%rip),%rdi
lea    0xe63(%rip),%rax
cmp    $0x0,%ecx
cmovne %rax,%rdi
mov    -0x18(%rbp),%esi
call   1030 <printf@plt>
movl   $0x0,-0x1c(%rbp)
jmp    1165 <main+0x45>
jmp    11be <main+0x9e>
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    1154 <main+0x34>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
lea    0xed3(%rip),%r14
lea    0x4(%rsp),%rsi
mov    %r14,%rdi
call   1040 <scanf@plt>
mov    0x4(%rsp),%ecx
cmp    $0x2,%ecx
jge    1151 <main+0x31>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret
mov    $0x2,%ebx
mov    $0x1,%ebp
lea    0xe9e(%rip),%r15
jmp    1179 <main+0x59>
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
lea    0x1(%rbx),%eax
cmp    %ecx,%ebx
mov    %eax,%ebx
jge    1144 <main+0x24>
mov    %ecx,%eax
cltd
idiv   %ebx
test   %edx,%edx
jne    1170 <main+0x50>
mov    %eax,0x4(%rsp)
test   %ebp,%ebp
mov    %r14,%rdi
cmove  %r15,%rdi
mov    %ebx,%esi
call   1030 <printf@plt>
mov    0x4(%rsp),%ecx
mov    %ecx,%eax
cltd
idiv   %ebx
xor    %ebp,%ebp
test   %edx,%edx
jne    1170 <main+0x50>
cs nopw 0x0(%rax,%rax,1)
nop
mov    %ecx,%eax
cltd
idiv   %ebx
mov    %eax,0x4(%rsp)
mov    %r15,%rdi
mov    %ebx,%esi
call   1030 <printf@plt>
mov    0x4(%rsp),%ecx
mov    %ecx,%eax
cltd
idiv   %ebx
test   %edx,%edx
je     11b0 <main+0x90>
jmp    1170 <main+0x50>

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

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