#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 cos(float);
double sin(float);
float fder(float x) {
  return 4.0 * x * (x * x - 1.0) * sin(x) + x * x * (x * x - 2.0) * cos(x);
}


x86 assembly (clang, -O0):
<fder>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
cvtss2sd %xmm0,%xmm1
movsd  0xed2(%rip),%xmm0
mulsd  %xmm1,%xmm0
movss  -0x4(%rbp),%xmm1
mulss  -0x4(%rbp),%xmm1
cvtss2sd %xmm1,%xmm1
movsd  0xeb0(%rip),%xmm2
subsd  %xmm2,%xmm1
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x10(%rbp)
movss  -0x4(%rbp),%xmm0
call   1030 <sin@plt>
movsd  %xmm0,-0x18(%rbp)
movss  -0x4(%rbp),%xmm0
mulss  -0x4(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movss  -0x4(%rbp),%xmm1
mulss  -0x4(%rbp),%xmm1
cvtss2sd %xmm1,%xmm1
movsd  0xe68(%rip),%xmm2
subsd  %xmm2,%xmm1
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x20(%rbp)
movss  -0x4(%rbp),%xmm0
call   1040 <cos@plt>
movsd  -0x20(%rbp),%xmm1
movsd  -0x18(%rbp),%xmm2
movaps %xmm0,%xmm3
movsd  -0x10(%rbp),%xmm0
cvtss2sd %xmm3,%xmm3
mulsd  %xmm3,%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fder>:
sub    $0x28,%rsp
cvtss2sd %xmm0,%xmm2
mulsd  0xed0(%rip),%xmm2
movaps %xmm0,%xmm1
movss  %xmm0,0x14(%rsp)
mulss  %xmm0,%xmm1
cvtss2sd %xmm1,%xmm3
movsd  %xmm3,0x8(%rsp)
movsd  0xeb9(%rip),%xmm1
addsd  %xmm3,%xmm1
mulsd  %xmm2,%xmm1
movsd  %xmm1,0x20(%rsp)
call   1030 <sin@plt>
movsd  %xmm0,0x18(%rsp)
movsd  0xea0(%rip),%xmm1
movsd  0x8(%rsp),%xmm0
addsd  %xmm0,%xmm1
mulsd  %xmm0,%xmm1
movsd  %xmm1,0x8(%rsp)
movss  0x14(%rsp),%xmm0
call   1040 <cos@plt>
cvtss2sd %xmm0,%xmm0
mulsd  0x8(%rsp),%xmm0
movsd  0x18(%rsp),%xmm1
mulsd  0x20(%rsp),%xmm1
addsd  %xmm0,%xmm1
xorps  %xmm0,%xmm0
cvtsd2ss %xmm1,%xmm0
add    $0x28,%rsp
ret

LLVM IR (-O0):
define float @fder(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = fpext float %3 to double
%5 = fmul double 4.000000e+00, %4
%6 = load float, float* %2
%7 = load float, float* %2
%8 = fmul float %6, %7
%9 = fpext float %8 to double
%10 = fsub double %9, 1.000000e+00
%11 = fmul double %5, %10
%12 = load float, float* %2
%13 = call double @sin(float %12)
%14 = load float, float* %2
%15 = load float, float* %2
%16 = fmul float %14, %15
%17 = fpext float %16 to double
%18 = load float, float* %2
%19 = load float, float* %2
%20 = fmul float %18, %19
%21 = fpext float %20 to double
%22 = fsub double %21, 2.000000e+00
%23 = fmul double %17, %22
%24 = load float, float* %2
%25 = call float @cos(float %24)
%26 = fpext float %25 to double
%27 = fmul double %23, %26
%28 = call double @llvm.fmuladd.f64(double %11, double %13, double %27)
%29 = fptrunc double %28 to float
ret float %29
}

LLVM IR (-O2):
define float @fder(float %0) {
%2 = fpext float %0 to double
%3 = fmul double %2, 4.000000e+00
%4 = fmul float %0, %0
%5 = fpext float %4 to double
%6 = fadd double %5, -1.000000e+00
%7 = fmul double %3, %6
%8 = tail call double @sin(float %0)
%9 = fadd double %5, -2.000000e+00
%10 = fmul double %9, %5
%11 = tail call float @cos(float %0)
%12 = fpext float %11 to double
%13 = fmul double %10, %12
%14 = tail call double @llvm.fmuladd.f64(double %7, double %8, double %13)
%15 = fptrunc double %14 to float
ret float %15
}