#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 *, ...);
void solutDivisor(int n) {
  int i = 2;
  printf("%d=", n);
  while (n != 1) {
    if (n % i == 0) {
      n /= i;
      printf("%d", i);
      if (n != 1) {
        printf("x");
      }
      continue;
    }
    i++;
  }
}


x86 assembly (clang, -O0):
<solutDivisor>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
movl   $0x2,-0x8(%rbp)
mov    -0x4(%rbp),%esi
lea    0xed4(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
cmpl   $0x1,-0x4(%rbp)
je     1195 <solutDivisor+0x85>
mov    -0x4(%rbp),%eax
cltd
idivl  -0x8(%rbp)
cmp    $0x0,%edx
jne    1187 <solutDivisor+0x77>
mov    -0x8(%rbp),%ecx
mov    -0x4(%rbp),%eax
cltd
idiv   %ecx
mov    %eax,-0x4(%rbp)
mov    -0x8(%rbp),%esi
lea    0xea1(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
cmpl   $0x1,-0x4(%rbp)
je     1182 <solutDivisor+0x72>
lea    0xe8c(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    1133 <solutDivisor+0x23>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1133 <solutDivisor+0x23>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<solutDivisor>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    %edi,%r15d
lea    0xecf(%rip),%rdi
mov    %r15d,%esi
xor    %eax,%eax
call   1040 <printf@plt>
cmp    $0x1,%r15d
jne    114c <solutDivisor+0x2c>
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret
mov    $0x2,%ebx
lea    0xeac(%rip),%r14
nopl   0x0(%rax,%rax,1)
mov    %r15d,%eax
cltd
idiv   %ebx
add    $0x1,%ebx
test   %edx,%edx
jne    1160 <solutDivisor+0x40>
mov    %eax,%ebp
add    $0xffffffff,%ebx
mov    %r14,%rdi
mov    %ebx,%esi
xor    %eax,%eax
call   1040 <printf@plt>
cmp    $0x1,%ebp
je     1141 <solutDivisor+0x21>
mov    $0x78,%edi
call   1030 <putchar@plt>
mov    %ebp,%r15d
jmp    1160 <solutDivisor+0x40>

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

LLVM IR (-O2):
@.str = [4 x i8] c"%d=\00"
@.str.1 = [3 x i8] c"%d\00"
define void @solutDivisor(i32 %0) {
%2 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %0)
%3 = icmp eq i32 %0, 1
br i1 %3, label %18, label %4
4: ; preds = %1, %16
%5 = phi i32 [ %8, %16 ], [ 2, %1 ]
%6 = phi i32 [ %10, %16 ], [ %0, %1 ]
br label %7
7: ; preds = %7, %4
%8 = phi i32 [ %5, %4 ], [ %12, %7 ]
%9 = srem i32 %6, %8
%10 = sdiv i32 %6, %8
%11 = icmp eq i32 %9, 0
%12 = add nsw i32 %8, 1
br i1 %11, label %13, label %7
13: ; preds = %7
%14 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32 %8)
%15 = icmp eq i32 %10, 1
br i1 %15, label %18, label %16
16: ; preds = %13
%17 = tail call i32 @putchar(i32 120)
br label %4
18: ; preds = %13, %1
ret void
}