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


x86 assembly (clang, -O0):
<fx>:
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  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x50(%rbp)
movsd  -0x18(%rbp),%xmm0
mulsd  -0x8(%rbp),%xmm0
call   1050 <cos@plt>
movsd  %xmm0,-0x58(%rbp)
movsd  -0x20(%rbp),%xmm0
movsd  %xmm0,-0x60(%rbp)
movsd  -0x28(%rbp),%xmm0
mulsd  -0x8(%rbp),%xmm0
call   1030 <sin@plt>
movsd  -0x60(%rbp),%xmm1
movsd  -0x58(%rbp),%xmm2
movaps %xmm0,%xmm3
movsd  -0x50(%rbp),%xmm0
mulsd  %xmm3,%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x48(%rbp)
movsd  -0x30(%rbp),%xmm0
mulsd  -0x8(%rbp),%xmm0
call   1040 <exp@plt>
movaps %xmm0,%xmm1
movsd  -0x48(%rbp),%xmm0
addsd  %xmm1,%xmm0
addsd  -0x38(%rbp),%xmm0
movsd  %xmm0,-0x40(%rbp)
movsd  -0x40(%rbp),%xmm0
add    $0x60,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define double @fx(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* %9
%17 = load double, double* %10
%18 = load double, double* %8
%19 = fmul double %17, %18
%20 = call double @cos(double %19)
%21 = load double, double* %11
%22 = load double, double* %12
%23 = load double, double* %8
%24 = fmul double %22, %23
%25 = call double @sin(double %24)
%26 = fmul double %21, %25
%27 = call double @llvm.fmuladd.f64(double %16, double %20, double %26)
%28 = load double, double* %13
%29 = load double, double* %8
%30 = fmul double %28, %29
%31 = call double @exp(double %30)
%32 = fadd double %27, %31
%33 = load double, double* %14
%34 = fadd double %32, %33
store double %34, double* %15
%35 = load double, double* %15
ret double %35
}

LLVM IR (-O2):
define double @fx(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 = fmul double %0, %4
%11 = tail call double @sin(double %10)
%12 = fmul double %11, %3
%13 = tail call double @llvm.fmuladd.f64(double %1, double %9, double %12)
%14 = fmul double %0, %5
%15 = tail call double @exp(double %14)
%16 = fadd double %15, %13
%17 = fadd double %16, %6
ret double %17
}