#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 atoi(char *);
int /*<<< orphan*/ printf(char *, ...);
int main(int argc, char **argv) {
  if (argc != 2) {
    printf("\n");
    return (0);
  }
  int nb;
  int i;
  nb = atoi(argv[1]);
  i = 2;
  while (i < nb) {
    if (nb % i == 0) {
      printf("%d*", i);
      nb = nb / i;
    } else {
      i++;
    }
  }
  printf("%d\n", nb);
  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)
cmpl   $0x2,-0x8(%rbp)
je     115a <main+0x3a>
lea    0xebf(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x0,-0x4(%rbp)
jmp    11d3 <main+0xb3>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
call   1040 <atoi@plt>
mov    %eax,-0x14(%rbp)
movl   $0x2,-0x18(%rbp)
mov    -0x18(%rbp),%eax
cmp    -0x14(%rbp),%eax
jge    11bb <main+0x9b>
mov    -0x14(%rbp),%eax
cltd
idivl  -0x18(%rbp)
cmp    $0x0,%edx
jne    11ad <main+0x8d>
mov    -0x18(%rbp),%esi
lea    0xe69(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x14(%rbp),%eax
cltd
idivl  -0x18(%rbp)
mov    %eax,-0x14(%rbp)
jmp    11b6 <main+0x96>
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    1171 <main+0x51>
mov    -0x14(%rbp),%esi
lea    0xe3f(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r14
push   %rbx
cmp    $0x2,%edi
jne    1194 <main+0x64>
mov    0x8(%rsi),%rdi
call   1050 <atoi@plt>
mov    %eax,%esi
cmp    $0x3,%eax
jl     1184 <main+0x54>
mov    $0x2,%ebx
lea    0xeab(%rip),%r14
jmp    1167 <main+0x37>
nopw   0x0(%rax,%rax,1)
add    $0x1,%ebx
cmp    %esi,%ebx
jge    1184 <main+0x54>
mov    %esi,%eax
cltd
idiv   %ebx
test   %edx,%edx
jne    1160 <main+0x30>
mov    %eax,%ebp
mov    %r14,%rdi
mov    %ebx,%esi
xor    %eax,%eax
call   1040 <printf@plt>
mov    %ebp,%esi
cmp    %esi,%ebx
jl     1167 <main+0x37>
lea    0xe79(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
jmp    119e <main+0x6e>
mov    $0xa,%edi
call   1030 <putchar@plt>
xor    %eax,%eax
pop    %rbx
pop    %r14
pop    %rbp
ret

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

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