#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 sin(double);
double sphtmd(double ap, double bp, double cp, double dp, double ep,
              double sphi) {
  return (ap * sphi) - (bp * sin(2.0 * sphi)) + (cp * sin(4.0 * sphi)) -
         (dp * sin(6.0 * sphi)) + (ep * sin(8.0 * sphi));
}


x86 assembly (clang, -O0):
<sphtmd>:
push   %rbp
mov    %rsp,%rbp
sub    $0x80,%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  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x68(%rbp)
movsd  -0x30(%rbp),%xmm0
movsd  %xmm0,-0x70(%rbp)
movsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x78(%rbp)
movsd  0xeb9(%rip),%xmm0
mulsd  -0x30(%rbp),%xmm0
call   1030 <sin@plt>
movsd  -0x78(%rbp),%xmm1
movsd  -0x70(%rbp),%xmm2
movaps %xmm0,%xmm3
movsd  -0x68(%rbp),%xmm0
mulsd  %xmm3,%xmm1
movq   %xmm1,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x60(%rbp)
movsd  -0x18(%rbp),%xmm0
movsd  %xmm0,-0x58(%rbp)
movsd  0xe5b(%rip),%xmm0
mulsd  -0x30(%rbp),%xmm0
call   1030 <sin@plt>
movsd  -0x60(%rbp),%xmm1
movaps %xmm0,%xmm2
movsd  -0x58(%rbp),%xmm0
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x50(%rbp)
movsd  -0x20(%rbp),%xmm0
movsd  %xmm0,-0x48(%rbp)
movsd  0xe1d(%rip),%xmm0
mulsd  -0x30(%rbp),%xmm0
call   1030 <sin@plt>
movsd  -0x50(%rbp),%xmm1
movaps %xmm0,%xmm2
movsd  -0x48(%rbp),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x40(%rbp)
movsd  -0x28(%rbp),%xmm0
movsd  %xmm0,-0x38(%rbp)
movsd  0xdc8(%rip),%xmm0
mulsd  -0x30(%rbp),%xmm0
call   1030 <sin@plt>
movsd  -0x40(%rbp),%xmm1
movaps %xmm0,%xmm2
movsd  -0x38(%rbp),%xmm0
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
add    $0x80,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sphtmd>:
sub    $0x38,%rsp
movsd  %xmm5,0x10(%rsp)
movsd  %xmm4,0x30(%rsp)
movsd  %xmm3,0x28(%rsp)
movsd  %xmm2,0x20(%rsp)
movsd  %xmm1,0x18(%rsp)
movsd  %xmm0,0x8(%rsp)
movapd %xmm5,%xmm0
addsd  %xmm5,%xmm0
call   1030 <sin@plt>
mulsd  0x18(%rsp),%xmm0
movsd  0x10(%rsp),%xmm1
movsd  0x8(%rsp),%xmm2
mulsd  %xmm1,%xmm2
subsd  %xmm0,%xmm2
movsd  %xmm2,0x8(%rsp)
movsd  0xe93(%rip),%xmm0
mulsd  %xmm1,%xmm0
call   1030 <sin@plt>
mulsd  0x20(%rsp),%xmm0
addsd  0x8(%rsp),%xmm0
movsd  %xmm0,0x8(%rsp)
movsd  0xe78(%rip),%xmm0
mulsd  0x10(%rsp),%xmm0
call   1030 <sin@plt>
mulsd  0x28(%rsp),%xmm0
movsd  0x8(%rsp),%xmm1
subsd  %xmm0,%xmm1
movsd  %xmm1,0x8(%rsp)
movsd  0x10(%rsp),%xmm0
mulsd  0xe51(%rip),%xmm0
call   1030 <sin@plt>
mulsd  0x30(%rsp),%xmm0
addsd  0x8(%rsp),%xmm0
add    $0x38,%rsp
ret

LLVM IR (-O0):
define double @sphtmd(double %0, double %1, double %2, double %3, double %4, double %5) {
%7 = alloca double
%8 = alloca double
%9 = alloca double
%10 = alloca double
%11 = alloca double
%12 = alloca double
store double %0, double* %7
store double %1, double* %8
store double %2, double* %9
store double %3, double* %10
store double %4, double* %11
store double %5, double* %12
%13 = load double, double* %7
%14 = load double, double* %12
%15 = load double, double* %8
%16 = load double, double* %12
%17 = fmul double 2.000000e+00, %16
%18 = call double @sin(double %17)
%19 = fmul double %15, %18
%20 = fneg double %19
%21 = call double @llvm.fmuladd.f64(double %13, double %14, double %20)
%22 = load double, double* %9
%23 = load double, double* %12
%24 = fmul double 4.000000e+00, %23
%25 = call double @sin(double %24)
%26 = call double @llvm.fmuladd.f64(double %22, double %25, double %21)
%27 = load double, double* %10
%28 = load double, double* %12
%29 = fmul double 6.000000e+00, %28
%30 = call double @sin(double %29)
%31 = fneg double %27
%32 = call double @llvm.fmuladd.f64(double %31, double %30, double %26)
%33 = load double, double* %11
%34 = load double, double* %12
%35 = fmul double 8.000000e+00, %34
%36 = call double @sin(double %35)
%37 = call double @llvm.fmuladd.f64(double %33, double %36, double %32)
ret double %37
}

LLVM IR (-O2):
define double @sphtmd(double %0, double %1, double %2, double %3, double %4, double %5) {
%7 = fmul double %5, 2.000000e+00
%8 = tail call double @sin(double %7)
%9 = fneg double %8
%10 = fmul double %9, %1
%11 = tail call double @llvm.fmuladd.f64(double %0, double %5, double %10)
%12 = fmul double %5, 4.000000e+00
%13 = tail call double @sin(double %12)
%14 = tail call double @llvm.fmuladd.f64(double %2, double %13, double %11)
%15 = fmul double %5, 6.000000e+00
%16 = tail call double @sin(double %15)
%17 = fneg double %3
%18 = tail call double @llvm.fmuladd.f64(double %17, double %16, double %14)
%19 = fmul double %5, 8.000000e+00
%20 = tail call double @sin(double %19)
%21 = tail call double @llvm.fmuladd.f64(double %4, double %20, double %18)
ret double %21
}