#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("usage: %s n\n", argv[0]);
  } else {
    int a, b;
    int c = atoi(argv[1]);
    for (b = 2; b <= c; b++) {
      if (c % b == 0) {
        printf("%d ", b);
        c = c / b;
        b = b - 1;
      }
    }
    printf("\n");
  }
}


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>
mov    -0x10(%rbp),%rax
mov    (%rax),%rsi
lea    0xeb2(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    11d2 <main+0xb2>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
call   1040 <atoi@plt>
mov    %eax,-0x1c(%rbp)
movl   $0x2,-0x18(%rbp)
mov    -0x18(%rbp),%eax
cmp    -0x1c(%rbp),%eax
jg     11c4 <main+0xa4>
mov    -0x1c(%rbp),%eax
cltd
idivl  -0x18(%rbp)
cmp    $0x0,%edx
jne    11b1 <main+0x91>
mov    -0x18(%rbp),%esi
lea    0xe76(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x1c(%rbp),%eax
cltd
idivl  -0x18(%rbp)
mov    %eax,-0x1c(%rbp)
mov    -0x18(%rbp),%eax
sub    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    11b6 <main+0x96>
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    1171 <main+0x51>
lea    0xe40(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
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    1153 <main+0x23>
mov    0x8(%rsi),%rdi
call   1050 <atoi@plt>
cmp    $0x2,%eax
jge    116b <main+0x3b>
mov    $0xa,%edi
call   1030 <putchar@plt>
jmp    1164 <main+0x34>
mov    (%rsi),%rsi
lea    0xea3(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
xor    %eax,%eax
pop    %rbx
pop    %r14
pop    %rbp
ret
mov    %eax,%ecx
mov    $0x2,%ebx
lea    0xe94(%rip),%r14
jmp    1189 <main+0x59>
nopl   0x0(%rax,%rax,1)
lea    0x1(%rbx),%eax
cmp    %ecx,%ebx
mov    %eax,%ebx
jge    1147 <main+0x17>
mov    %ecx,%eax
cltd
idiv   %ebx
test   %edx,%edx
jne    1180 <main+0x50>
mov    %eax,%ebp
mov    %r14,%rdi
mov    %ebx,%esi
xor    %eax,%eax
call   1040 <printf@plt>
add    $0xffffffff,%ebx
mov    %ebp,%ecx
jmp    1180 <main+0x50>

LLVM IR (-O0):
@.str = [13 x i8] c"usage: %s n\0A\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 ne 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 (i8*, ...) @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i8* %14)
br label %44
16: ; preds = %2
%17 = load i8**, i8*** %5
%18 = getelementptr inbounds i8*, i8** %17, i64 1
%19 = load i8*, i8** %18
%20 = call i32 @atoi(i8* %19)
store i32 %20, i32* %8
store i32 2, i32* %7
br label %21
21: ; preds = %39, %16
%22 = load i32, i32* %7
%23 = load i32, i32* %8
%24 = icmp sle i32 %22, %23
br i1 %24, label %25, label %42
25: ; preds = %21
%26 = load i32, i32* %8
%27 = load i32, i32* %7
%28 = srem i32 %26, %27
%29 = icmp eq i32 %28, 0
br i1 %29, label %30, label %38
30: ; preds = %25
%31 = load i32, i32* %7
%32 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %31)
%33 = load i32, i32* %8
%34 = load i32, i32* %7
%35 = sdiv i32 %33, %34
store i32 %35, i32* %8
%36 = load i32, i32* %7
%37 = sub nsw i32 %36, 1
store i32 %37, i32* %7
br label %38
38: ; preds = %30, %25
br label %39
39: ; preds = %38
%40 = load i32, i32* %7
%41 = add nsw i32 %40, 1
store i32 %41, i32* %7
br label %21
42: ; preds = %21
%43 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
br label %44
44: ; preds = %42, %11
%45 = load i32, i32* %3
ret i32 %45
}

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