#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 cosine(double);
int fabs(double);
double floor(double);
double sine(double);
double sine_series_odd_mu(double phase, double n) {
  double s = sine(phase);
  if (fabs(s) < (1e-10)) {
    return s * n * n;
  }
  double floor_n = floor(n);
  double mu = n - floor_n;
  floor_n *= 2 * phase;
  return (0.5 - 0.5 * cosine(floor_n)) / s + sine(floor_n + phase) * mu;
}


x86 assembly (clang, -O0):
<sine_series_odd_mu>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
movsd  %xmm0,-0x10(%rbp)
movsd  %xmm1,-0x18(%rbp)
movsd  -0x10(%rbp),%xmm0
call   1050 <sine@plt>
movsd  %xmm0,-0x20(%rbp)
movsd  -0x20(%rbp),%xmm0
call   1040 <fabs@plt>
cvtsi2sd %eax,%xmm1
movsd  0xe89(%rip),%xmm0
ucomisd %xmm1,%xmm0
jbe    119a <sine_series_odd_mu+0x5a>
movsd  -0x20(%rbp),%xmm0
mulsd  -0x18(%rbp),%xmm0
mulsd  -0x18(%rbp),%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    1221 <sine_series_odd_mu+0xe1>
movsd  -0x18(%rbp),%xmm0
call   1060 <floor@plt>
movsd  %xmm0,-0x28(%rbp)
movsd  -0x18(%rbp),%xmm0
subsd  -0x28(%rbp),%xmm0
movsd  %xmm0,-0x30(%rbp)
movsd  0xe58(%rip),%xmm0
mulsd  -0x10(%rbp),%xmm0
mulsd  -0x28(%rbp),%xmm0
movsd  %xmm0,-0x28(%rbp)
movsd  -0x28(%rbp),%xmm0
call   1030 <cosine@plt>
movsd  0xe27(%rip),%xmm1
mulsd  %xmm1,%xmm0
movsd  0xe23(%rip),%xmm1
addsd  %xmm1,%xmm0
divsd  -0x20(%rbp),%xmm0
movsd  %xmm0,-0x38(%rbp)
movsd  -0x28(%rbp),%xmm0
addsd  -0x10(%rbp),%xmm0
call   1050 <sine@plt>
movsd  -0x38(%rbp),%xmm1
movsd  -0x30(%rbp),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sine_series_odd_mu>:
sub    $0x28,%rsp
movsd  %xmm1,0x8(%rsp)
movsd  %xmm0,0x18(%rsp)
call   1050 <sine@plt>
movsd  %xmm0,0x10(%rsp)
call   1040 <fabs@plt>
test   %eax,%eax
jle    11de <sine_series_odd_mu+0x9e>
movsd  0x8(%rsp),%xmm0
call   1060 <floor@plt>
movapd %xmm0,%xmm1
movsd  0x8(%rsp),%xmm0
subsd  %xmm1,%xmm0
movsd  %xmm0,0x8(%rsp)
movsd  0x18(%rsp),%xmm0
addsd  %xmm0,%xmm0
mulsd  %xmm0,%xmm1
movsd  %xmm1,0x20(%rsp)
movapd %xmm1,%xmm0
call   1030 <cosine@plt>
mulsd  0xe58(%rip),%xmm0
addsd  0xe58(%rip),%xmm0
divsd  0x10(%rsp),%xmm0
movsd  %xmm0,0x10(%rsp)
movsd  0x20(%rsp),%xmm0
addsd  0x18(%rsp),%xmm0
call   1050 <sine@plt>
mulsd  0x8(%rsp),%xmm0
addsd  0x10(%rsp),%xmm0
add    $0x28,%rsp
ret
movsd  0x8(%rsp),%xmm1
movsd  0x10(%rsp),%xmm0
mulsd  %xmm1,%xmm0
mulsd  %xmm1,%xmm0
add    $0x28,%rsp
ret

LLVM IR (-O0):
define double @sine_series_odd_mu(double %0, double %1) {
%3 = alloca double
%4 = alloca double
%5 = alloca double
%6 = alloca double
%7 = alloca double
%8 = alloca double
store double %0, double* %4
store double %1, double* %5
%9 = load double, double* %4
%10 = call double @sine(double %9)
store double %10, double* %6
%11 = load double, double* %6
%12 = call i32 @fabs(double %11)
%13 = sitofp i32 %12 to double
%14 = fcmp olt double %13, 1.000000e-10
br i1 %14, label %15, label %21
15: ; preds = %2
%16 = load double, double* %6
%17 = load double, double* %5
%18 = fmul double %16, %17
%19 = load double, double* %5
%20 = fmul double %18, %19
store double %20, double* %3
br label %42
21: ; preds = %2
%22 = load double, double* %5
%23 = call double @llvm.floor.f64(double %22)
store double %23, double* %7
%24 = load double, double* %5
%25 = load double, double* %7
%26 = fsub double %24, %25
store double %26, double* %8
%27 = load double, double* %4
%28 = fmul double 2.000000e+00, %27
%29 = load double, double* %7
%30 = fmul double %29, %28
store double %30, double* %7
%31 = load double, double* %7
%32 = call double @cosine(double %31)
%33 = call double @llvm.fmuladd.f64(double -5.000000e-01, double %32, double 5.000000e-01)
%34 = load double, double* %6
%35 = fdiv double %33, %34
%36 = load double, double* %7
%37 = load double, double* %4
%38 = fadd double %36, %37
%39 = call double @sine(double %38)
%40 = load double, double* %8
%41 = call double @llvm.fmuladd.f64(double %39, double %40, double %35)
store double %41, double* %3
br label %42
42: ; preds = %21, %15
%43 = load double, double* %3
ret double %43
}

LLVM IR (-O2):
define double @sine_series_odd_mu(double %0, double %1) {
%3 = tail call double @sine(double %0)
%4 = tail call i32 @fabs(double %3)
%5 = icmp slt i32 %4, 1
br i1 %5, label %6, label %9
6: ; preds = %2
%7 = fmul double %3, %1
%8 = fmul double %7, %1
br label %20
9: ; preds = %2
%10 = tail call double @llvm.floor.f64(double %1)
%11 = fsub double %1, %10
%12 = fmul double %0, 2.000000e+00
%13 = fmul double %12, %10
%14 = tail call double @cosine(double %13)
%15 = tail call double @llvm.fmuladd.f64(double %14, double -5.000000e-01, double 5.000000e-01)
%16 = fdiv double %15, %3
%17 = fadd double %13, %0
%18 = tail call double @sine(double %17)
%19 = tail call double @llvm.fmuladd.f64(double %18, double %11, double %16)
br label %20
20: ; preds = %9, %6
%21 = phi double [ %8, %6 ], [ %19, %9 ]
ret double %21
}