#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 num, i = 2;
  int temp;
  int flag = 1;
  scanf("%d", &num);
  temp = num;
  while (flag) {
    for (i = 2; i <= temp; i++) {
      if ((0 == temp % i)) {
        printf("%d ", i);
        if (i == temp) {
          flag = 0;
          break;
        }
        temp = temp / i;
        break;
      }
    }
    i = 2;
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x2,-0xc(%rbp)
movl   $0x1,-0x14(%rbp)
lea    0xebc(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1040 <scanf@plt>
mov    -0x8(%rbp),%eax
mov    %eax,-0x10(%rbp)
cmpl   $0x0,-0x14(%rbp)
je     11d6 <main+0xb6>
movl   $0x2,-0xc(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x10(%rbp),%eax
jg     11ca <main+0xaa>
mov    -0x10(%rbp),%eax
cltd
idivl  -0xc(%rbp)
xor    %eax,%eax
cmp    %edx,%eax
jne    11b7 <main+0x97>
mov    -0xc(%rbp),%esi
lea    0xe78(%rip),%rdi
call   1030 <printf@plt>
mov    -0xc(%rbp),%eax
cmp    -0x10(%rbp),%eax
jne    11a8 <main+0x88>
movl   $0x0,-0x14(%rbp)
jmp    11ca <main+0xaa>
mov    -0x10(%rbp),%eax
cltd
idivl  -0xc(%rbp)
mov    %eax,-0x10(%rbp)
jmp    11ca <main+0xaa>
jmp    11bc <main+0x9c>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1164 <main+0x44>
movl   $0x2,-0xc(%rbp)
jmp    1153 <main+0x33>
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    0xed2(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1040 <scanf@plt>
mov    0x4(%rsp),%r15d
lea    0xebf(%rip),%r14
jmp    1164 <main+0x44>
cs nopw 0x0(%rax,%rax,1)
mov    %eax,%ebp
mov    %r14,%rdi
mov    %ebx,%esi
call   1030 <printf@plt>
cmp    %r15d,%ebx
mov    %ebp,%r15d
je     119e <main+0x7e>
mov    %r15d,%ecx
neg    %ecx
cmp    $0x2,%r15d
jl     1169 <main+0x49>
mov    $0x2,%ebx
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
mov    %r15d,%eax
cltd
idiv   %ebx
test   %edx,%edx
je     1150 <main+0x30>
lea    (%rcx,%rbx,1),%eax
add    $0x1,%eax
mov    %ebx,%edx
add    $0x1,%edx
mov    %edx,%ebx
cmp    $0x1,%eax
jne    1180 <main+0x60>
jmp    1169 <main+0x49>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

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

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
@.str.1 = [4 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 %5
5: ; preds = %15, %0
%6 = phi i32 [ %4, %0 ], [ %13, %15 ]
%7 = icmp slt i32 %6, 2
br label %8
8: ; preds = %9, %5
br i1 %7, label %9, label %10
9: ; preds = %18, %8
br label %8
10: ; preds = %8, %18
%11 = phi i32 [ %19, %18 ], [ 2, %8 ]
%12 = srem i32 %6, %11
%13 = sdiv i32 %6, %11
%14 = icmp eq i32 %12, 0
br i1 %14, label %15, label %18
15: ; preds = %10
%16 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %11)
%17 = icmp eq i32 %11, %6
br i1 %17, label %21, label %5
18: ; preds = %10
%19 = add nuw i32 %11, 1
%20 = icmp eq i32 %11, %6
br i1 %20, label %9, label %10
21: ; preds = %15
ret i32 0
}