#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 */
long EOF;
int /*<<< orphan*/ factorizacionPrimo(long);
int /*<<< orphan*/ fflush(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ scanf(char *, long *);
int /*<<< orphan*/ stdin;
void init() {
  long p;
  do {
    printf("%s", "Factorizacion en primo de p = ");
    scanf("%ld", &p);
    factorizacionPrimo(p);
    printf("\n");
    fflush(stdin);
  } while (p != EOF);
}


x86 assembly (clang, -O0):
<init>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xeb1(%rip),%rdi
lea    0xead(%rip),%rsi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xebe(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1060 <scanf@plt>
mov    -0x8(%rbp),%rdi
call   1050 <factorizacionPrimo@plt>
lea    0xea9(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    0x2e5d(%rip),%rax
mov    (%rax),%edi
call   1040 <fflush@plt>
mov    -0x8(%rbp),%rax
mov    0x2e43(%rip),%rcx
cmp    (%rcx),%rax
jne    1148 <init+0x8>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<init>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
lea    0xe9e(%rip),%r14
lea    0xe9a(%rip),%r15
lea    0xeb2(%rip),%r12
mov    %rsp,%r13
mov    0x2e6e(%rip),%rbx
mov    0x2e5f(%rip),%rbp
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    %r14,%rdi
mov    %r15,%rsi
xor    %eax,%eax
call   1040 <printf@plt>
mov    %r12,%rdi
mov    %r13,%rsi
call   1070 <scanf@plt>
mov    (%rsp),%rdi
call   1060 <factorizacionPrimo@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
mov    (%rbx),%edi
call   1050 <fflush@plt>
mov    (%rsp),%rax
cmp    0x0(%rbp),%rax
jne    1190 <init+0x40>
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%s\00"
@.str.1 = [31 x i8] c"Factorizacion en primo de p = \00"
@.str.2 = [4 x i8] c"%ld\00"
@.str.3 = [2 x i8] c"\0A\00"
@stdin = global i32 0
@EOF = global i64 0
define void @init() {
%1 = alloca i64
br label %2
2: ; preds = %10, %0
%3 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.1, i64 0, i64 0))
%4 = call i32 @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), i64* %1)
%5 = load i64, i64* %1
%6 = call i32 @factorizacionPrimo(i64 %5)
%7 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0))
%8 = load i32, i32* @stdin
%9 = call i32 @fflush(i32 %8)
br label %10
10: ; preds = %2
%11 = load i64, i64* %1
%12 = load i64, i64* @EOF
%13 = icmp ne i64 %11, %12
br i1 %13, label %2, label %14
14: ; preds = %10
ret void
}

LLVM IR (-O2):
@.str = [3 x i8] c"%s\00"
@.str.1 = [31 x i8] c"Factorizacion en primo de p = \00"
@.str.2 = [4 x i8] c"%ld\00"
@stdin = global i32 0
@EOF = global i64 0
define void @init() {
%1 = alloca i64
%2 = bitcast i64* %1 to i8*
br label %3
3: ; preds = %3, %0
%4 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.1, i64 0, i64 0))
%5 = call i32 @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), i64* %1)
%6 = load i64, i64* %1
%7 = call i32 @factorizacionPrimo(i64 %6)
%8 = call i32 @putchar(i32 10)
%9 = load i32, i32* @stdin
%10 = call i32 @fflush(i32 %9)
%11 = load i64, i64* %1
%12 = load i64, i64* @EOF
%13 = icmp eq i64 %11, %12
br i1 %13, label %14, label %3
14: ; preds = %3
ret void
}