#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 *, float *);
main() {
  float x, p;
  printf("Introduzca el valor de 'x' para obtener el resultado de:\n"
         "\t 3x^5 - 5x^3 + 2x - 7\n");
  printf("\nValor de x = ");
  scanf("%f", &x);
  p = 3 * x * x * x * x * x - 5 * x * x * x + 2 * x - 7;
  printf("\nPara x = %g,  3x^5 - 5x^3 + 2x - 7 = %g\n", x, p);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xedd(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xf20(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xf21(%rip),%rdi
lea    -0x4(%rbp),%rsi
call   1040 <scanf@plt>
movss  0xeac(%rip),%xmm1
mulss  -0x4(%rbp),%xmm1
mulss  -0x4(%rbp),%xmm1
mulss  -0x4(%rbp),%xmm1
mulss  -0x4(%rbp),%xmm1
movss  -0x4(%rbp),%xmm2
movss  0xe87(%rip),%xmm0
mulss  -0x4(%rbp),%xmm0
mulss  -0x4(%rbp),%xmm0
mulss  -0x4(%rbp),%xmm0
movd   %xmm0,%eax
xor    $0x80000000,%eax
movd   %eax,%xmm0
mulss  %xmm2,%xmm1
addss  %xmm0,%xmm1
movss  -0x4(%rbp),%xmm0
addss  %xmm0,%xmm0
addss  %xmm1,%xmm0
movss  0xe4a(%rip),%xmm1
subss  %xmm1,%xmm0
movss  %xmm0,-0x8(%rbp)
movss  -0x4(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movss  -0x8(%rbp),%xmm1
cvtss2sd %xmm1,%xmm1
lea    0xe97(%rip),%rdi
mov    $0x2,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xf10(%rip),%rdi
call   1030 <puts@plt>
lea    0xec8(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xec9(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1050 <scanf@plt>
movss  0x4(%rsp),%xmm1
movss  0xe96(%rip),%xmm2
mulss  %xmm1,%xmm2
mulss  %xmm1,%xmm2
mulss  %xmm1,%xmm2
mulss  %xmm1,%xmm2
movss  0xe82(%rip),%xmm0
mulss  %xmm1,%xmm0
mulss  %xmm1,%xmm0
mulss  %xmm1,%xmm0
mulss  %xmm1,%xmm2
addss  %xmm0,%xmm2
xorps  %xmm0,%xmm0
cvtss2sd %xmm1,%xmm0
addss  %xmm1,%xmm1
addss  %xmm2,%xmm1
addss  0xe5b(%rip),%xmm1
cvtss2sd %xmm1,%xmm1
lea    0xe66(%rip),%rdi
mov    $0x2,%al
call   1040 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [81 x i8] c"Introduzca el valor de 'x' para obtener el resultado de:\0A\09 3x^5 - 5x^3 + 2x - 7\0A\00"
@.str.1 = [15 x i8] c"\0AValor de x = \00"
@.str.2 = [3 x i8] c"%f\00"
@.str.3 = [42 x i8] c"\0APara x = %g, 3x^5 - 5x^3 + 2x - 7 = %g\0A\00"
define i32 @main() {
%1 = alloca float
%2 = alloca float
%3 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([81 x i8], [81 x i8]* @.str, i64 0, i64 0))
%4 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.1, i64 0, i64 0))
%5 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), float* %1)
%6 = load float, float* %1
%7 = fmul float 3.000000e+00, %6
%8 = load float, float* %1
%9 = fmul float %7, %8
%10 = load float, float* %1
%11 = fmul float %9, %10
%12 = load float, float* %1
%13 = fmul float %11, %12
%14 = load float, float* %1
%15 = load float, float* %1
%16 = fmul float 5.000000e+00, %15
%17 = load float, float* %1
%18 = fmul float %16, %17
%19 = load float, float* %1
%20 = fmul float %18, %19
%21 = fneg float %20
%22 = call float @llvm.fmuladd.f32(float %13, float %14, float %21)
%23 = load float, float* %1
%24 = call float @llvm.fmuladd.f32(float 2.000000e+00, float %23, float %22)
%25 = fsub float %24, 7.000000e+00
store float %25, float* %2
%26 = load float, float* %1
%27 = fpext float %26 to double
%28 = load float, float* %2
%29 = fpext float %28 to double
%30 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str.3, i64 0, i64 0), double %27, double %29)
ret i32 0
}

LLVM IR (-O2):
@.str.1 = [15 x i8] c"\0AValor de x = \00"
@.str.2 = [3 x i8] c"%f\00"
@.str.3 = [42 x i8] c"\0APara x = %g, 3x^5 - 5x^3 + 2x - 7 = %g\0A\00"
@str = [80 x i8] c"Introduzca el valor de 'x' para obtener el resultado de:\0A\09 3x^5 - 5x^3 + 2x - 7\00"
define i32 @main() {
%1 = alloca float
%2 = bitcast float* %1 to i8*
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([80 x i8], [80 x i8]* @str, i64 0, i64 0))
%4 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @.str.1, i64 0, i64 0))
%5 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), float* %1)
%6 = load float, float* %1
%7 = fmul float %6, 3.000000e+00
%8 = fmul float %6, %7
%9 = fmul float %6, %8
%10 = fmul float %6, %9
%11 = fmul float %6, -5.000000e+00
%12 = fmul float %6, %11
%13 = fmul float %6, %12
%14 = call float @llvm.fmuladd.f32(float %10, float %6, float %13)
%15 = call float @llvm.fmuladd.f32(float %6, float 2.000000e+00, float %14)
%16 = fadd float %15, -7.000000e+00
%17 = fpext float %6 to double
%18 = fpext float %16 to double
%19 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([42 x i8], [42 x i8]* @.str.3, i64 0, i64 0), double %17, double %18)
ret i32 0
}