#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 cos(double);
int exp(double);
int sin(double);
int tan(double);
double f(int p, int q, int r, int s, int t, int u, double x) {
  return p * exp(-x) + q * sin(x) + r * cos(x) + s * tan(x) + t * x * x + u;
}


x86 assembly (clang, -O0):
<f>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %ecx,-0x10(%rbp)
mov    %r8d,-0x14(%rbp)
mov    %r9d,-0x18(%rbp)
movsd  %xmm0,-0x20(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x3c(%rbp)
movsd  -0x20(%rbp),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
call   1040 <exp@plt>
mov    %eax,%ecx
mov    -0x3c(%rbp),%eax
imul   %ecx,%eax
mov    %eax,-0x34(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0x38(%rbp)
movsd  -0x20(%rbp),%xmm0
call   1030 <sin@plt>
mov    -0x38(%rbp),%ecx
mov    %eax,%edx
mov    -0x34(%rbp),%eax
imul   %edx,%ecx
add    %ecx,%eax
mov    %eax,-0x2c(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x30(%rbp)
movsd  -0x20(%rbp),%xmm0
call   1060 <cos@plt>
mov    -0x30(%rbp),%ecx
mov    %eax,%edx
mov    -0x2c(%rbp),%eax
imul   %edx,%ecx
add    %ecx,%eax
mov    %eax,-0x24(%rbp)
mov    -0x10(%rbp),%eax
mov    %eax,-0x28(%rbp)
movsd  -0x20(%rbp),%xmm0
call   1050 <tan@plt>
mov    -0x28(%rbp),%ecx
mov    %eax,%edx
mov    -0x24(%rbp),%eax
imul   %edx,%ecx
add    %ecx,%eax
cvtsi2sd %eax,%xmm1
cvtsi2sdl -0x14(%rbp),%xmm0
mulsd  -0x20(%rbp),%xmm0
movsd  -0x20(%rbp),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
cvtsi2sdl -0x18(%rbp),%xmm1
addsd  %xmm1,%xmm0
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<f>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x28,%rsp
movaps %xmm0,%xmm1
movaps %xmm0,0x10(%rsp)
mov    %r9d,0xc(%rsp)
mov    %r8d,%r15d
mov    %ecx,%r12d
mov    %edx,%r13d
mov    %esi,%ebx
mov    %edi,%ebp
movaps 0xe91(%rip),%xmm0
xorps  %xmm1,%xmm0
call   1040 <exp@plt>
mov    %eax,%r14d
imul   %ebp,%r14d
movaps 0x10(%rsp),%xmm0
call   1030 <sin@plt>
mov    %eax,%ebp
imul   %ebx,%ebp
add    %r14d,%ebp
movaps 0x10(%rsp),%xmm0
call   1060 <cos@plt>
mov    %eax,%ebx
imul   %r13d,%ebx
add    %ebp,%ebx
movaps 0x10(%rsp),%xmm0
call   1050 <tan@plt>
imul   %r12d,%eax
add    %ebx,%eax
xorps  %xmm0,%xmm0
cvtsi2sd %eax,%xmm0
xorps  %xmm1,%xmm1
cvtsi2sd %r15d,%xmm1
movapd 0x10(%rsp),%xmm2
mulsd  %xmm2,%xmm1
mulsd  %xmm2,%xmm1
addsd  %xmm0,%xmm1
xorps  %xmm0,%xmm0
cvtsi2sdl 0xc(%rsp),%xmm0
addsd  %xmm1,%xmm0
add    $0x28,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

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

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