#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 *);
scalar_t__ sqrt(int);
int main() {
  int number;
  int sqrt_n;
  int i;
  printf("Input a number: ");
  scanf("%d", &number);
  if (number < 2) {
    printf("Input a number greater than two.\n");
    return -1;
  }
  printf("Factors: ");
  sqrt_n = (int)sqrt(number);
  for (i = 2; i <= sqrt_n; i++) {
    if ((number % i) == 0) {
      printf(" %d %d", i, number / i);
    }
  }
  printf("\n");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeba(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xeed(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1040 <scanf@plt>
cmpl   $0x2,-0x8(%rbp)
jge    1181 <main+0x51>
lea    0xea3(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0xffffffff,-0x4(%rbp)
jmp    11ff <main+0xcf>
lea    0xeab(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x8(%rbp),%edi
call   1050 <sqrt@plt>
mov    %eax,-0xc(%rbp)
movl   $0x2,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jg     11ea <main+0xba>
mov    -0x8(%rbp),%eax
cltd
idivl  -0x10(%rbp)
cmp    $0x0,%edx
jne    11d7 <main+0xa7>
mov    -0x10(%rbp),%esi
mov    -0x8(%rbp),%eax
cltd
idivl  -0x10(%rbp)
mov    %eax,%edx
lea    0xe6d(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    11dc <main+0xac>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    11a1 <main+0x71>
lea    0xe40(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
lea    0xea2(%rip),%rdi
xor    %eax,%eax
call   1050 <printf@plt>
lea    0xeb3(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1060 <scanf@plt>
cmpl   $0x1,0x4(%rsp)
jg     1191 <main+0x41>
lea    0xe9e(%rip),%rdi
call   1040 <puts@plt>
mov    $0xffffffff,%r14d
jmp    11bd <main+0x6d>
lea    0xe79(%rip),%rdi
xor    %r14d,%r14d
xor    %eax,%eax
call   1050 <printf@plt>
mov    0x4(%rsp),%edi
call   1070 <sqrt@plt>
mov    %rax,%rbx
cmp    $0x2,%ebx
jge    11cb <main+0x7b>
mov    $0xa,%edi
call   1030 <putchar@plt>
mov    %r14d,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret
neg    %ebx
mov    $0x2,%ebp
lea    0xe42(%rip),%r15
jmp    11f2 <main+0xa2>
nopl   0x0(%rax,%rax,1)
lea    (%rbx,%rbp,1),%eax
add    $0x1,%eax
mov    %ebp,%ecx
add    $0x1,%ecx
mov    %ecx,%ebp
cmp    $0x1,%eax
je     11b3 <main+0x63>
mov    0x4(%rsp),%eax
cltd
idiv   %ebp
test   %edx,%edx
jne    11e0 <main+0x90>
mov    %r15,%rdi
mov    %ebp,%esi
mov    %eax,%edx
xor    %eax,%eax
call   1050 <printf@plt>
jmp    11e0 <main+0x90>

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

LLVM IR (-O2):
@.str = [17 x i8] c"Input a number: \00"
@.str.1 = [3 x i8] c"%d\00"
@.str.3 = [10 x i8] c"Factors: \00"
@.str.4 = [7 x i8] c" %d %d\00"
@str = [33 x i8] c"Input a number greater than two.\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %1)
%5 = load i32, i32* %1
%6 = icmp slt i32 %5, 2
br i1 %6, label %7, label %9
7: ; preds = %0
%8 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([33 x i8], [33 x i8]* @str, i64 0, i64 0))
br label %28
9: ; preds = %0
%10 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @.str.3, i64 0, i64 0))
%11 = load i32, i32* %1
%12 = call i64 @sqrt(i32 %11)
%13 = trunc i64 %12 to i32
%14 = icmp slt i32 %13, 2
br i1 %14, label %26, label %15
15: ; preds = %9, %23
%16 = phi i32 [ %24, %23 ], [ 2, %9 ]
%17 = load i32, i32* %1
%18 = srem i32 %17, %16
%19 = sdiv i32 %17, %16
%20 = icmp eq i32 %18, 0
br i1 %20, label %21, label %23
21: ; preds = %15
%22 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @.str.4, i64 0, i64 0), i32 %16, i32 %19)
br label %23
23: ; preds = %15, %21
%24 = add nuw i32 %16, 1
%25 = icmp eq i32 %16, %13
br i1 %25, label %26, label %15
26: ; preds = %23, %9
%27 = call i32 @putchar(i32 10)
br label %28
28: ; preds = %26, %7
%29 = phi i32 [ -1, %7 ], [ 0, %26 ]
ret i32 %29
}