#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 next_mult(int);
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ scanf(char *, int *);
int /*<<< orphan*/ setbuf(int /*<<< orphan*/, int /*<<< orphan*/ *);
int /*<<< orphan*/ stdout;
int main(void) {
  setbuf(stdout, NULL);
  int number;
  printf("Input a number:\n");
  scanf("%d", &number);
  if (number < 1) {
    printf("Incorrect input data");
  } else {
    printf("Multipliers of the number:\n");
    while (number > 1) {
      number = next_mult(number);
    }
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    0x2e8a(%rip),%rax
mov    (%rax),%edi
xor    %eax,%eax
mov    %eax,%esi
call   1030 <setbuf@plt>
lea    0xe98(%rip),%rdi
call   1040 <printf@plt>
lea    0xe9d(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1060 <scanf@plt>
cmpl   $0x1,-0x8(%rbp)
jge    1198 <main+0x58>
lea    0xe86(%rip),%rdi
call   1040 <printf@plt>
jmp    11c3 <main+0x83>
lea    0xe8a(%rip),%rdi
call   1040 <printf@plt>
cmpl   $0x1,-0x8(%rbp)
jle    11be <main+0x7e>
mov    -0x8(%rbp),%edi
call   1050 <next_mult@plt>
mov    %eax,-0x8(%rbp)
jmp    11a4 <main+0x64>
jmp    11c3 <main+0x83>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    0x2e88(%rip),%rax
mov    (%rax),%edi
xor    %esi,%esi
call   1040 <setbuf@plt>
lea    0xeb0(%rip),%rdi
call   1030 <puts@plt>
lea    0xe8c(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1070 <scanf@plt>
cmpl   $0x0,0x4(%rsp)
jle    11b2 <main+0x62>
lea    0xe9c(%rip),%rdi
call   1030 <puts@plt>
mov    0x4(%rsp),%eax
cmp    $0x2,%eax
jl     11be <main+0x6e>
nopw   0x0(%rax,%rax,1)
mov    %eax,%edi
call   1060 <next_mult@plt>
mov    %eax,0x4(%rsp)
cmp    $0x1,%eax
jg     11a0 <main+0x50>
jmp    11be <main+0x6e>
lea    0xe4a(%rip),%rdi
call   1050 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@stdout = global i32 0
@.str = [17 x i8] c"Input a number:\0A\00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [21 x i8] c"Incorrect input data\00"
@.str.3 = [28 x i8] c"Multipliers of the number:\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
%3 = load i32, i32* @stdout
%4 = call i32 @setbuf(i32 %3, i32* null)
%5 = call i32 @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, 1
br i1 %8, label %9, label %11
9: ; preds = %0
%10 = call i32 @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.2, i64 0, i64 0))
br label %20
11: ; preds = %0
%12 = call i32 @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.3, i64 0, i64 0))
br label %13
13: ; preds = %16, %11
%14 = load i32, i32* %2
%15 = icmp sgt i32 %14, 1
br i1 %15, label %16, label %19
16: ; preds = %13
%17 = load i32, i32* %2
%18 = call i32 @next_mult(i32 %17)
store i32 %18, i32* %2
br label %13
19: ; preds = %13
br label %20
20: ; preds = %19, %9
ret i32 0
}

LLVM IR (-O2):
@stdout = global i32 0
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [21 x i8] c"Incorrect input data\00"
@str = [16 x i8] c"Input a number:\00"
@str.4 = [27 x i8] c"Multipliers of the number:\00"
define i32 @main() {
%1 = alloca i32
%2 = load i32, i32* @stdout
%3 = tail call i32 @setbuf(i32 %2, i32* null)
%4 = bitcast i32* %1 to i8*
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 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* %1)
%7 = load i32, i32* %1
%8 = icmp slt i32 %7, 1
br i1 %8, label %9, label %11
9: ; preds = %0
%10 = call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([21 x i8], [21 x i8]* @.str.2, i64 0, i64 0))
br label %19
11: ; preds = %0
%12 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([27 x i8], [27 x i8]* @str.4, i64 0, i64 0))
%13 = load i32, i32* %1
%14 = icmp sgt i32 %13, 1
br i1 %14, label %15, label %19
15: ; preds = %11, %15
%16 = phi i32 [ %17, %15 ], [ %13, %11 ]
%17 = call i32 @next_mult(i32 %16)
store i32 %17, i32* %1
%18 = icmp sgt i32 %17, 1
br i1 %18, label %15, label %19
19: ; preds = %15, %11, %9
ret i32 0
}