#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 *);
int main(void) {
  float x, polynomial;
  printf("Enter the value of X: ");
  scanf("%f", &x);
  polynomial = 3 * (x * x * x * x * x) + 2 * (x * x * x * x) - 5 * (x * x * x) -
               (x * x) + 7 * x - 6;
  printf("The value of the polynomial is %.2f\n", polynomial);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xee5(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xeee(%rip),%rdi
lea    -0x4(%rbp),%rsi
call   1040 <scanf@plt>
movss  -0x4(%rbp),%xmm1
mulss  -0x4(%rbp),%xmm1
mulss  -0x4(%rbp),%xmm1
mulss  -0x4(%rbp),%xmm1
mulss  -0x4(%rbp),%xmm1
movss  -0x4(%rbp),%xmm2
mulss  -0x4(%rbp),%xmm2
mulss  -0x4(%rbp),%xmm2
mulss  -0x4(%rbp),%xmm2
movss  0xe95(%rip),%xmm0
mulss  %xmm2,%xmm0
movss  0xe85(%rip),%xmm2
mulss  %xmm2,%xmm1
addss  %xmm0,%xmm1
movss  -0x4(%rbp),%xmm0
mulss  -0x4(%rbp),%xmm0
mulss  -0x4(%rbp),%xmm0
movss  0xe62(%rip),%xmm2
mulss  %xmm2,%xmm0
addss  %xmm1,%xmm0
movss  -0x4(%rbp),%xmm1
movss  -0x4(%rbp),%xmm2
movd   %xmm1,%eax
xor    $0x80000000,%eax
movd   %eax,%xmm1
mulss  %xmm2,%xmm1
addss  %xmm0,%xmm1
movss  -0x4(%rbp),%xmm0
movss  0xe2a(%rip),%xmm2
mulss  %xmm2,%xmm0
addss  %xmm1,%xmm0
movss  0xe16(%rip),%xmm1
subss  %xmm1,%xmm0
movss  %xmm0,-0x8(%rbp)
movss  -0x8(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
lea    0xe2b(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xee8(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xef1(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1040 <scanf@plt>
movss  0x4(%rsp),%xmm0
movaps %xmm0,%xmm1
mulss  %xmm0,%xmm1
movaps %xmm0,%xmm2
mulss  %xmm1,%xmm2
movaps %xmm0,%xmm3
mulss  %xmm2,%xmm3
movaps %xmm0,%xmm4
mulss  %xmm3,%xmm4
mulss  0xe96(%rip),%xmm4
addss  %xmm3,%xmm3
addss  %xmm3,%xmm4
mulss  0xe8a(%rip),%xmm2
addss  %xmm4,%xmm2
subss  %xmm1,%xmm2
mulss  0xe7e(%rip),%xmm0
addss  %xmm2,%xmm0
addss  0xe76(%rip),%xmm0
cvtss2sd %xmm0,%xmm0
lea    0xe89(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [23 x i8] c"Enter the value of X: \00"
@.str.1 = [3 x i8] c"%f\00"
@.str.2 = [37 x i8] c"The value of the polynomial is %.2f\0A\00"
define i32 @main() {
%1 = alloca float
%2 = alloca float
%3 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), float* %1)
%5 = load float, float* %1
%6 = load float, float* %1
%7 = fmul float %5, %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 %14, %15
%17 = load float, float* %1
%18 = fmul float %16, %17
%19 = load float, float* %1
%20 = fmul float %18, %19
%21 = fmul float 2.000000e+00, %20
%22 = call float @llvm.fmuladd.f32(float 3.000000e+00, float %13, float %21)
%23 = load float, float* %1
%24 = load float, float* %1
%25 = fmul float %23, %24
%26 = load float, float* %1
%27 = fmul float %25, %26
%28 = call float @llvm.fmuladd.f32(float -5.000000e+00, float %27, float %22)
%29 = load float, float* %1
%30 = load float, float* %1
%31 = fneg float %29
%32 = call float @llvm.fmuladd.f32(float %31, float %30, float %28)
%33 = load float, float* %1
%34 = call float @llvm.fmuladd.f32(float 7.000000e+00, float %33, float %32)
%35 = fsub float %34, 6.000000e+00
store float %35, float* %2
%36 = load float, float* %2
%37 = fpext float %36 to double
%38 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str.2, i64 0, i64 0), double %37)
ret i32 0
}

LLVM IR (-O2):
@.str = [23 x i8] c"Enter the value of X: \00"
@.str.1 = [3 x i8] c"%f\00"
@.str.2 = [37 x i8] c"The value of the polynomial is %.2f\0A\00"
define i32 @main() {
%1 = alloca float
%2 = bitcast float* %1 to i8*
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), float* %1)
%5 = load float, float* %1
%6 = fmul float %5, %5
%7 = fmul float %5, %6
%8 = fmul float %5, %7
%9 = fmul float %5, %8
%10 = fmul float %8, 2.000000e+00
%11 = call float @llvm.fmuladd.f32(float %9, float 3.000000e+00, float %10)
%12 = call float @llvm.fmuladd.f32(float %7, float -5.000000e+00, float %11)
%13 = fneg float %5
%14 = call float @llvm.fmuladd.f32(float %13, float %5, float %12)
%15 = call float @llvm.fmuladd.f32(float %5, float 7.000000e+00, float %14)
%16 = fadd float %15, -6.000000e+00
%17 = fpext float %16 to double
%18 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([37 x i8], [37 x i8]* @.str.2, i64 0, i64 0), double %17)
ret i32 0
}