#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 /*<<< orphan*/ usage(char *);
int main(int argc, char *argv[]) {
  int n;
  int i;
  int f;
  if (argc < 2) {
    usage(argv[0]);
    return 1;
  }
  for (i = 1; i < argc; i++) {
    n = atoi(argv[i]);
    printf("%d: ", n);
    f = 2;
    while (n > 1) {
      if (0 == (n % f)) {
        n = n / f;
        printf("%d ", f);
      } else {
        f++;
      }
    }
    printf("\n");
  }
  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)
jge    1168 <main+0x38>
mov    -0x10(%rbp),%rax
mov    (%rax),%rdi
call   1040 <usage@plt>
movl   $0x1,-0x4(%rbp)
jmp    1213 <main+0xe3>
movl   $0x1,-0x18(%rbp)
mov    -0x18(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    120c <main+0xdc>
mov    -0x10(%rbp),%rax
movslq -0x18(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
call   1050 <atoi@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%esi
lea    0xe67(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x2,-0x1c(%rbp)
cmpl   $0x1,-0x14(%rbp)
jle    11f0 <main+0xc0>
mov    -0x14(%rbp),%eax
cltd
idivl  -0x1c(%rbp)
xor    %eax,%eax
cmp    %edx,%eax
jne    11e2 <main+0xb2>
mov    -0x14(%rbp),%eax
cltd
idivl  -0x1c(%rbp)
mov    %eax,-0x14(%rbp)
mov    -0x1c(%rbp),%esi
lea    0xe2f(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    11eb <main+0xbb>
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    11a7 <main+0x77>
lea    0xe12(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    116f <main+0x3f>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
mov    %rsi,%r15
cmp    $0x2,%edi
jge    1165 <main+0x25>
mov    (%r15),%rdi
call   1050 <usage@plt>
mov    $0x1,%eax
jmp    11ec <main+0xac>
mov    %edi,%eax
mov    %rax,(%rsp)
mov    $0x1,%r14d
lea    0xe8d(%rip),%r12
jmp    1194 <main+0x54>
nopw   0x0(%rax,%rax,1)
mov    $0xa,%edi
call   1030 <putchar@plt>
add    $0x1,%r14
cmp    (%rsp),%r14
je     11ea <main+0xaa>
mov    (%r15,%r14,8),%rdi
call   1060 <atoi@plt>
mov    %eax,%ebp
lea    0xe5a(%rip),%rdi
mov    %eax,%esi
xor    %eax,%eax
call   1040 <printf@plt>
cmp    $0x2,%ebp
jl     1180 <main+0x40>
mov    $0x2,%ebx
jmp    11c8 <main+0x88>
nopl   0x0(%rax,%rax,1)
add    $0x1,%ebx
cmp    $0x1,%ebp
jle    1180 <main+0x40>
mov    %ebp,%eax
cltd
idiv   %ebx
test   %edx,%edx
jne    11c0 <main+0x80>
mov    %eax,%r13d
mov    %r12,%rdi
mov    %ebx,%esi
xor    %eax,%eax
call   1040 <printf@plt>
mov    %r13d,%ebp
cmp    $0x1,%ebp
jg     11c8 <main+0x88>
jmp    1180 <main+0x40>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

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

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