#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 */
double cos(double);
double exp(double);
double sin(double);
double fxd2(double x, double a0, double a1, double a2, double a3, double a4,
            double a5) {
  double rec = -cos(a1 * x) * a0 * a1 * a1 - sin(a3 * x) * a2 * a3 * a3 +
               exp(a4 * x) * a4 * a4;
  return rec;
}


x86 assembly (clang, -O0):
<fxd2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x60,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  %xmm2,-0x18(%rbp)
movsd  %xmm3,-0x20(%rbp)
movsd  %xmm4,-0x28(%rbp)
movsd  %xmm5,-0x30(%rbp)
movsd  %xmm6,-0x38(%rbp)
movsd  -0x18(%rbp),%xmm0
mulsd  -0x8(%rbp),%xmm0
call   1050 <cos@plt>
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
mulsd  -0x10(%rbp),%xmm0
mulsd  -0x18(%rbp),%xmm0
movsd  %xmm0,-0x50(%rbp)
movsd  -0x18(%rbp),%xmm0
movsd  %xmm0,-0x58(%rbp)
movsd  -0x28(%rbp),%xmm0
mulsd  -0x8(%rbp),%xmm0
call   1030 <sin@plt>
movsd  -0x58(%rbp),%xmm2
movaps %xmm0,%xmm1
movsd  -0x50(%rbp),%xmm0
mulsd  -0x20(%rbp),%xmm1
mulsd  -0x28(%rbp),%xmm1
mulsd  -0x28(%rbp),%xmm1
movq   %xmm1,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x48(%rbp)
movsd  -0x30(%rbp),%xmm0
mulsd  -0x8(%rbp),%xmm0
call   1040 <exp@plt>
movsd  -0x48(%rbp),%xmm1
mulsd  -0x30(%rbp),%xmm0
movsd  -0x30(%rbp),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x40(%rbp)
movsd  -0x40(%rbp),%xmm0
add    $0x60,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fxd2>:
sub    $0x38,%rsp
movsd  %xmm5,0x28(%rsp)
movsd  %xmm4,0x18(%rsp)
movsd  %xmm3,0x30(%rsp)
movsd  %xmm2,0x10(%rsp)
movsd  %xmm1,(%rsp)
movsd  %xmm0,0x20(%rsp)
mulsd  %xmm2,%xmm0
call   1050 <cos@plt>
xorpd  0xe98(%rip),%xmm0
mulsd  (%rsp),%xmm0
mulsd  0x10(%rsp),%xmm0
movapd %xmm0,(%rsp)
movsd  0x20(%rsp),%xmm0
mulsd  0x18(%rsp),%xmm0
call   1030 <sin@plt>
mulsd  0x30(%rsp),%xmm0
movsd  0x18(%rsp),%xmm1
mulsd  %xmm1,%xmm0
mulsd  %xmm1,%xmm0
movapd (%rsp),%xmm1
mulsd  0x10(%rsp),%xmm1
subsd  %xmm0,%xmm1
movapd %xmm1,(%rsp)
movsd  0x20(%rsp),%xmm0
mulsd  0x28(%rsp),%xmm0
call   1040 <exp@plt>
movsd  0x28(%rsp),%xmm1
mulsd  %xmm1,%xmm0
mulsd  %xmm1,%xmm0
addsd  (%rsp),%xmm0
add    $0x38,%rsp
ret

LLVM IR (-O0):
define double @fxd2(double %0, double %1, double %2, double %3, double %4, double %5, double %6) {
%8 = alloca double
%9 = alloca double
%10 = alloca double
%11 = alloca double
%12 = alloca double
%13 = alloca double
%14 = alloca double
%15 = alloca double
store double %0, double* %8
store double %1, double* %9
store double %2, double* %10
store double %3, double* %11
store double %4, double* %12
store double %5, double* %13
store double %6, double* %14
%16 = load double, double* %10
%17 = load double, double* %8
%18 = fmul double %16, %17
%19 = call double @cos(double %18)
%20 = fneg double %19
%21 = load double, double* %9
%22 = fmul double %20, %21
%23 = load double, double* %10
%24 = fmul double %22, %23
%25 = load double, double* %10
%26 = load double, double* %12
%27 = load double, double* %8
%28 = fmul double %26, %27
%29 = call double @sin(double %28)
%30 = load double, double* %11
%31 = fmul double %29, %30
%32 = load double, double* %12
%33 = fmul double %31, %32
%34 = load double, double* %12
%35 = fmul double %33, %34
%36 = fneg double %35
%37 = call double @llvm.fmuladd.f64(double %24, double %25, double %36)
%38 = load double, double* %13
%39 = load double, double* %8
%40 = fmul double %38, %39
%41 = call double @exp(double %40)
%42 = load double, double* %13
%43 = fmul double %41, %42
%44 = load double, double* %13
%45 = call double @llvm.fmuladd.f64(double %43, double %44, double %37)
store double %45, double* %15
%46 = load double, double* %15
ret double %46
}

LLVM IR (-O2):
define double @fxd2(double %0, double %1, double %2, double %3, double %4, double %5, double %6) {
%8 = fmul double %0, %2
%9 = tail call double @cos(double %8)
%10 = fneg double %9
%11 = fmul double %10, %1
%12 = fmul double %11, %2
%13 = fmul double %0, %4
%14 = tail call double @sin(double %13)
%15 = fneg double %14
%16 = fmul double %15, %3
%17 = fmul double %16, %4
%18 = fmul double %17, %4
%19 = tail call double @llvm.fmuladd.f64(double %12, double %2, double %18)
%20 = fmul double %0, %5
%21 = tail call double @exp(double %20)
%22 = fmul double %21, %5
%23 = tail call double @llvm.fmuladd.f64(double %22, double %5, double %19)
ret double %23
}