#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 */
float evaluar(float, float, float, float);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, ...);
float pedir_valor_float();
int /*<<< orphan*/ stdout;
int main() {
  float a, b, c, x, solucion;
  fprintf(stdout, "Evaluacion del polinomio f(x) = a*x*x+b*x+c\n");
  a = pedir_valor_float();
  b = pedir_valor_float();
  c = pedir_valor_float();
  x = pedir_valor_float();
  solucion = evaluar(a, b, c, x);
  fprintf(stdout, "El resultado es %f\n", solucion);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    0x2e9a(%rip),%rax
mov    (%rax),%edi
lea    0xeb1(%rip),%rsi
mov    $0x0,%al
call   1050 <fprintf@plt>
mov    $0x0,%al
call   1030 <pedir_valor_float@plt>
movss  %xmm0,-0x8(%rbp)
mov    $0x0,%al
call   1030 <pedir_valor_float@plt>
movss  %xmm0,-0xc(%rbp)
mov    $0x0,%al
call   1030 <pedir_valor_float@plt>
movss  %xmm0,-0x10(%rbp)
mov    $0x0,%al
call   1030 <pedir_valor_float@plt>
movss  %xmm0,-0x14(%rbp)
movss  -0x8(%rbp),%xmm0
movss  -0xc(%rbp),%xmm1
movss  -0x10(%rbp),%xmm2
movss  -0x14(%rbp),%xmm3
call   1040 <evaluar@plt>
movss  %xmm0,-0x18(%rbp)
mov    0x2e35(%rip),%rax
mov    (%rax),%edi
movss  -0x18(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
lea    0xe70(%rip),%rsi
mov    $0x1,%al
call   1050 <fprintf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x10,%rsp
mov    0x2ea4(%rip),%rbx
mov    (%rbx),%edi
lea    0xebb(%rip),%rsi
xor    %eax,%eax
call   1050 <fprintf@plt>
xor    %eax,%eax
call   1030 <pedir_valor_float@plt>
movss  %xmm0,0xc(%rsp)
xor    %eax,%eax
call   1030 <pedir_valor_float@plt>
movss  %xmm0,0x8(%rsp)
xor    %eax,%eax
call   1030 <pedir_valor_float@plt>
movss  %xmm0,0x4(%rsp)
xor    %eax,%eax
call   1030 <pedir_valor_float@plt>
movaps %xmm0,%xmm3
movss  0xc(%rsp),%xmm0
movss  0x8(%rsp),%xmm1
movss  0x4(%rsp),%xmm2
call   1040 <evaluar@plt>
mov    (%rbx),%edi
cvtss2sd %xmm0,%xmm0
lea    0xe8c(%rip),%rsi
mov    $0x1,%al
call   1050 <fprintf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@stdout = global i32 0
@.str = [45 x i8] c"Evaluacion del polinomio f(x) = a*x*x+b*x+c\0A\00"
@.str.1 = [20 x i8] c"El resultado es %f\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca float
%3 = alloca float
%4 = alloca float
%5 = alloca float
%6 = alloca float
store i32 0, i32* %1
%7 = load i32, i32* @stdout
%8 = call i32 (i32, i8*, ...) @fprintf(i32 %7, i8* getelementptr inbounds ([45 x i8], [45 x i8]* @.str, i64 0, i64 0))
%9 = call float (...) @pedir_valor_float()
store float %9, float* %2
%10 = call float (...) @pedir_valor_float()
store float %10, float* %3
%11 = call float (...) @pedir_valor_float()
store float %11, float* %4
%12 = call float (...) @pedir_valor_float()
store float %12, float* %5
%13 = load float, float* %2
%14 = load float, float* %3
%15 = load float, float* %4
%16 = load float, float* %5
%17 = call float @evaluar(float %13, float %14, float %15, float %16)
store float %17, float* %6
%18 = load i32, i32* @stdout
%19 = load float, float* %6
%20 = fpext float %19 to double
%21 = call i32 (i32, i8*, ...) @fprintf(i32 %18, i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.1, i64 0, i64 0), double %20)
ret i32 0
}

LLVM IR (-O2):
@stdout = global i32 0
@.str = [45 x i8] c"Evaluacion del polinomio f(x) = a*x*x+b*x+c\0A\00"
@.str.1 = [20 x i8] c"El resultado es %f\0A\00"
define i32 @main() {
%1 = load i32, i32* @stdout
%2 = tail call i32 (i32, i8*, ...) @fprintf(i32 %1, i8* getelementptr inbounds ([45 x i8], [45 x i8]* @.str, i64 0, i64 0))
%3 = tail call float (...) @pedir_valor_float()
%4 = tail call float (...) @pedir_valor_float()
%5 = tail call float (...) @pedir_valor_float()
%6 = tail call float (...) @pedir_valor_float()
%7 = tail call float @evaluar(float %3, float %4, float %5, float %6)
%8 = load i32, i32* @stdout
%9 = fpext float %7 to double
%10 = tail call i32 (i32, i8*, ...) @fprintf(i32 %8, i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.1, i64 0, i64 0), double %9)
ret i32 0
}