#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 *);
int main() {
  int i;
  int target;
  scanf("%d", &target);
  for (i = 2; i <= target; i++) {
    if (target % i == 0) {
      printf("%d", i);
      target /= i;
      break;
    }
  }
  while (target != 1) {
    for (i = 2; i <= target; i++) {
      if (target % i == 0) {
        printf("*%d", i);
        target /= i;
        break;
      }
    }
  }
  printf("\n");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xecb(%rip),%rdi
lea    -0xc(%rbp),%rsi
call   1040 <scanf@plt>
movl   $0x2,-0x8(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0xc(%rbp),%eax
jg     1197 <main+0x77>
mov    -0xc(%rbp),%eax
cltd
idivl  -0x8(%rbp)
cmp    $0x0,%edx
jne    1184 <main+0x64>
mov    -0x8(%rbp),%esi
lea    0xe95(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x8(%rbp),%ecx
mov    -0xc(%rbp),%eax
cltd
idiv   %ecx
mov    %eax,-0xc(%rbp)
jmp    1197 <main+0x77>
jmp    1189 <main+0x69>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1146 <main+0x26>
jmp    119c <main+0x7c>
cmpl   $0x1,-0xc(%rbp)
je     1203 <main+0xe3>
movl   $0x2,-0x8(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0xc(%rbp),%eax
jg     11fe <main+0xde>
mov    -0xc(%rbp),%eax
cltd
idivl  -0x8(%rbp)
cmp    $0x0,%edx
jne    11eb <main+0xcb>
mov    -0x8(%rbp),%esi
lea    0xe2d(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x8(%rbp),%ecx
mov    -0xc(%rbp),%eax
cltd
idiv   %ecx
mov    %eax,-0xc(%rbp)
jmp    11fe <main+0xde>
jmp    11f0 <main+0xd0>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    11ad <main+0x8d>
jmp    119c <main+0x7c>
lea    0xdfa(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
push   %rax
lea    0xec6(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1050 <scanf@plt>
mov    0x4(%rsp),%ecx
cmp    $0x2,%ecx
jl     117b <main+0x4b>
mov    %ecx,%esi
neg    %esi
mov    $0x2,%ebx
nopw   0x0(%rax,%rax,1)
mov    %ecx,%eax
cltd
idiv   %ebx
test   %edx,%edx
je     1182 <main+0x52>
lea    (%rsi,%rbx,1),%eax
add    $0x1,%eax
mov    %ebx,%edx
add    $0x1,%edx
mov    %edx,%ebx
cmp    $0x1,%eax
jne    1160 <main+0x30>
cmp    $0x1,%ecx
je     11a4 <main+0x74>
jmp    11b8 <main+0x88>
lea    0xe78(%rip),%rdi
mov    %ebx,%esi
xor    %eax,%eax
call   1040 <printf@plt>
mov    0x4(%rsp),%eax
cltd
idiv   %ebx
mov    %eax,%ecx
mov    %eax,0x4(%rsp)
cmp    $0x1,%ecx
jne    11b8 <main+0x88>
mov    $0xa,%edi
call   1030 <putchar@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret
lea    0xe41(%rip),%r14
jmp    11ee <main+0xbe>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    %r14,%rdi
mov    %ebx,%esi
xor    %eax,%eax
call   1040 <printf@plt>
mov    0x4(%rsp),%eax
cltd
idiv   %ebx
mov    %eax,%ecx
mov    %eax,0x4(%rsp)
cmp    $0x1,%ecx
je     11a4 <main+0x74>
cmp    $0x2,%ecx
jl     11e9 <main+0xb9>
mov    %ecx,%esi
neg    %esi
mov    $0x2,%ebx
nopl   0x0(%rax)
mov    %ecx,%eax
cltd
idiv   %ebx
test   %edx,%edx
je     11d0 <main+0xa0>
lea    (%rsi,%rbx,1),%eax
add    $0x1,%eax
mov    %ebx,%edx
add    $0x1,%edx
mov    %edx,%ebx
cmp    $0x1,%eax
jne    1200 <main+0xd0>
jmp    11e9 <main+0xb9>

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