#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 *, double *);
main() {
  double a = 0, b = 0, c = 0, x = 0, p = 0;
  printf("Introduzca los coeficientes y el valor de x para obtener el "
         "resultado de:\n"
         "\tax^5 - bx^3 + cx - 7\n\n");
  printf("a = ");
  scanf("%lf", &a);
  printf("b = ");
  scanf("%lf", &b);
  printf("c = ");
  scanf("%lf", &c);
  printf("x = ");
  scanf("%lf", &x);
  p = a * x * x * x * x * x - b * x * x * x + c * x - 7;
  printf("\nPara x = %g,  %gx^5 - %gx^3 + %gx - 7 = %g\n", x, a, b, c, p);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x8(%rbp)
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x10(%rbp)
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x18(%rbp)
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x20(%rbp)
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x28(%rbp)
lea    0xeb1(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xf05(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xefc(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1040 <scanf@plt>
lea    0xef0(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xede(%rip),%rdi
lea    -0x10(%rbp),%rsi
call   1040 <scanf@plt>
lea    0xed7(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xec0(%rip),%rdi
lea    -0x18(%rbp),%rsi
call   1040 <scanf@plt>
lea    0xebe(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xea2(%rip),%rdi
lea    -0x20(%rbp),%rsi
call   1040 <scanf@plt>
movsd  -0x8(%rbp),%xmm1
mulsd  -0x20(%rbp),%xmm1
mulsd  -0x20(%rbp),%xmm1
mulsd  -0x20(%rbp),%xmm1
mulsd  -0x20(%rbp),%xmm1
movsd  -0x20(%rbp),%xmm2
movsd  -0x10(%rbp),%xmm0
mulsd  -0x20(%rbp),%xmm0
mulsd  -0x20(%rbp),%xmm0
mulsd  -0x20(%rbp),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
mulsd  %xmm2,%xmm1
addsd  %xmm0,%xmm1
movsd  -0x18(%rbp),%xmm0
movsd  -0x20(%rbp),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  0xdbf(%rip),%xmm1
subsd  %xmm1,%xmm0
movsd  %xmm0,-0x28(%rbp)
movsd  -0x20(%rbp),%xmm0
movsd  -0x8(%rbp),%xmm1
movsd  -0x10(%rbp),%xmm2
movsd  -0x18(%rbp),%xmm3
movsd  -0x28(%rbp),%xmm4
lea    0xe18(%rip),%rdi
mov    $0x5,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x20,%rsp
movq   $0x0,0x18(%rsp)
movq   $0x0,0x10(%rsp)
movq   $0x0,0x8(%rsp)
movq   $0x0,(%rsp)
lea    0xeee(%rip),%rdi
call   1030 <puts@plt>
lea    0xe9d(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xe94(%rip),%rbx
lea    0x18(%rsp),%rsi
mov    %rbx,%rdi
call   1050 <scanf@plt>
lea    0xe84(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0x10(%rsp),%rsi
mov    %rbx,%rdi
call   1050 <scanf@plt>
lea    0xe6e(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0x8(%rsp),%rsi
mov    %rbx,%rdi
call   1050 <scanf@plt>
lea    0xe58(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    %rsp,%rsi
mov    %rbx,%rdi
call   1050 <scanf@plt>
movsd  0x18(%rsp),%xmm1
movsd  (%rsp),%xmm0
movapd %xmm1,%xmm5
mulsd  %xmm0,%xmm5
mulsd  %xmm0,%xmm5
mulsd  %xmm0,%xmm5
mulsd  %xmm0,%xmm5
movsd  0x10(%rsp),%xmm2
movapd %xmm0,%xmm3
mulsd  %xmm2,%xmm3
mulsd  %xmm0,%xmm3
mulsd  %xmm0,%xmm3
mulsd  %xmm0,%xmm5
subsd  %xmm3,%xmm5
movsd  0x8(%rsp),%xmm3
movapd %xmm3,%xmm4
mulsd  %xmm0,%xmm4
addsd  %xmm5,%xmm4
addsd  0xdd4(%rip),%xmm4
lea    0xded(%rip),%rdi
mov    $0x5,%al
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [98 x i8] c"Introduzca los coeficientes y el valor de x para obtener el resultado de:\0A\09ax^5 - bx^3 + cx - 7\0A\0A\00"
@.str.1 = [5 x i8] c"a = \00"
@.str.2 = [4 x i8] c"%lf\00"
@.str.3 = [5 x i8] c"b = \00"
@.str.4 = [5 x i8] c"c = \00"
@.str.5 = [5 x i8] c"x = \00"
@.str.6 = [45 x i8] c"\0APara x = %g, %gx^5 - %gx^3 + %gx - 7 = %g\0A\00"
define i32 @main() {
%1 = alloca double
%2 = alloca double
%3 = alloca double
%4 = alloca double
%5 = alloca double
store double 0.000000e+00, double* %1
store double 0.000000e+00, double* %2
store double 0.000000e+00, double* %3
store double 0.000000e+00, double* %4
store double 0.000000e+00, double* %5
%6 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([98 x i8], [98 x i8]* @.str, i64 0, i64 0))
%7 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0))
%8 = call i32 @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), double* %1)
%9 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.3, i64 0, i64 0))
%10 = call i32 @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), double* %2)
%11 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.4, i64 0, i64 0))
%12 = call i32 @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), double* %3)
%13 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.5, i64 0, i64 0))
%14 = call i32 @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), double* %4)
%15 = load double, double* %1
%16 = load double, double* %4
%17 = fmul double %15, %16
%18 = load double, double* %4
%19 = fmul double %17, %18
%20 = load double, double* %4
%21 = fmul double %19, %20
%22 = load double, double* %4
%23 = fmul double %21, %22
%24 = load double, double* %4
%25 = load double, double* %2
%26 = load double, double* %4
%27 = fmul double %25, %26
%28 = load double, double* %4
%29 = fmul double %27, %28
%30 = load double, double* %4
%31 = fmul double %29, %30
%32 = fneg double %31
%33 = call double @llvm.fmuladd.f64(double %23, double %24, double %32)
%34 = load double, double* %3
%35 = load double, double* %4
%36 = call double @llvm.fmuladd.f64(double %34, double %35, double %33)
%37 = fsub double %36, 7.000000e+00
store double %37, double* %5
%38 = load double, double* %4
%39 = load double, double* %1
%40 = load double, double* %2
%41 = load double, double* %3
%42 = load double, double* %5
%43 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([45 x i8], [45 x i8]* @.str.6, i64 0, i64 0), double %38, double %39, double %40, double %41, double %42)
ret i32 0
}

LLVM IR (-O2):
@.str.1 = [5 x i8] c"a = \00"
@.str.2 = [4 x i8] c"%lf\00"
@.str.3 = [5 x i8] c"b = \00"
@.str.4 = [5 x i8] c"c = \00"
@.str.5 = [5 x i8] c"x = \00"
@.str.6 = [45 x i8] c"\0APara x = %g, %gx^5 - %gx^3 + %gx - 7 = %g\0A\00"
@str = [97 x i8] c"Introduzca los coeficientes y el valor de x para obtener el resultado de:\0A\09ax^5 - bx^3 + cx - 7\0A\00"
define i32 @main() {
%1 = alloca double
%2 = alloca double
%3 = alloca double
%4 = alloca double
%5 = bitcast double* %1 to i8*
store double 0.000000e+00, double* %1
%6 = bitcast double* %2 to i8*
store double 0.000000e+00, double* %2
%7 = bitcast double* %3 to i8*
store double 0.000000e+00, double* %3
%8 = bitcast double* %4 to i8*
store double 0.000000e+00, double* %4
%9 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([97 x i8], [97 x i8]* @str, i64 0, i64 0))
%10 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0))
%11 = call i32 @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), double* %1)
%12 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.3, i64 0, i64 0))
%13 = call i32 @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), double* %2)
%14 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.4, i64 0, i64 0))
%15 = call i32 @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), double* %3)
%16 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.5, i64 0, i64 0))
%17 = call i32 @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), double* %4)
%18 = load double, double* %1
%19 = load double, double* %4
%20 = fmul double %18, %19
%21 = fmul double %19, %20
%22 = fmul double %19, %21
%23 = fmul double %19, %22
%24 = load double, double* %2
%25 = fneg double %24
%26 = fmul double %19, %25
%27 = fmul double %19, %26
%28 = fmul double %19, %27
%29 = call double @llvm.fmuladd.f64(double %23, double %19, double %28)
%30 = load double, double* %3
%31 = call double @llvm.fmuladd.f64(double %30, double %19, double %29)
%32 = fadd double %31, -7.000000e+00
%33 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([45 x i8], [45 x i8]* @.str.6, i64 0, i64 0), double %19, double %18, double %24, double %30, double %32)
ret i32 0
}