double calcGeomMeanLongSun(double t) {
  double L = 280.46646 + t * (36000.76983 + 0.0003032 * t);
  while ((int)L > 360) {
    L -= 360.0;
  }
  while (L < 0) {
    L += 360.0;
  }
  return L;
}


x86 assembly (clang, -O0):
<calcGeomMeanLongSun>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  -0x8(%rbp),%xmm1
movsd  0xeed(%rip),%xmm2
mulsd  %xmm2,%xmm1
movsd  0xee9(%rip),%xmm2
addsd  %xmm2,%xmm1
mulsd  %xmm1,%xmm0
movsd  0xec9(%rip),%xmm1
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x10(%rbp)
cvttsd2si -0x10(%rbp),%eax
cmp    $0x168,%eax
jle    116b <calcGeomMeanLongSun+0x6b>
movsd  -0x10(%rbp),%xmm0
movsd  0xebb(%rip),%xmm1
subsd  %xmm1,%xmm0
movsd  %xmm0,-0x10(%rbp)
jmp    1140 <calcGeomMeanLongSun+0x40>
jmp    1170 <calcGeomMeanLongSun+0x70>
xorps  %xmm0,%xmm0
ucomisd -0x10(%rbp),%xmm0
jbe    1195 <calcGeomMeanLongSun+0x95>
movsd  0xe92(%rip),%xmm0
addsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x10(%rbp)
jmp    1170 <calcGeomMeanLongSun+0x70>
movsd  -0x10(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<calcGeomMeanLongSun>:
movapd %xmm0,%xmm1
movsd  0xef4(%rip),%xmm0
mulsd  %xmm1,%xmm0
addsd  0xef0(%rip),%xmm0
mulsd  %xmm1,%xmm0
addsd  0xeec(%rip),%xmm0
cvttsd2si %xmm0,%eax
cmp    $0x169,%eax
jl     114f <calcGeomMeanLongSun+0x4f>
movsd  0xee1(%rip),%xmm1
nopw   0x0(%rax,%rax,1)
addsd  %xmm1,%xmm0
cvttsd2si %xmm0,%eax
cmp    $0x168,%eax
jg     1140 <calcGeomMeanLongSun+0x40>
xorpd  %xmm1,%xmm1
ucomisd %xmm0,%xmm1
jbe    117a <calcGeomMeanLongSun+0x7a>
movsd  0xebf(%rip),%xmm2
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
addsd  %xmm2,%xmm0
ucomisd %xmm0,%xmm1
ja     1170 <calcGeomMeanLongSun+0x70>
ret

LLVM IR (-O0):
define double @calcGeomMeanLongSun(double %0) {
%2 = alloca double
%3 = alloca double
store double %0, double* %2
%4 = load double, double* %2
%5 = load double, double* %2
%6 = call double @llvm.fmuladd.f64(double 3.032000e-04, double %5, double 0x40E19418A272862F)
%7 = call double @llvm.fmuladd.f64(double %4, double %6, double 0x407187769EC2CE46)
store double %7, double* %3
br label %8
8: ; preds = %12, %1
%9 = load double, double* %3
%10 = fptosi double %9 to i32
%11 = icmp sgt i32 %10, 360
br i1 %11, label %12, label %15
12: ; preds = %8
%13 = load double, double* %3
%14 = fsub double %13, 3.600000e+02
store double %14, double* %3
br label %8
15: ; preds = %8
br label %16
16: ; preds = %19, %15
%17 = load double, double* %3
%18 = fcmp olt double %17, 0.000000e+00
br i1 %18, label %19, label %22
19: ; preds = %16
%20 = load double, double* %3
%21 = fadd double %20, 3.600000e+02
store double %21, double* %3
br label %16
22: ; preds = %16
%23 = load double, double* %3
ret double %23
}

LLVM IR (-O2):
define double @calcGeomMeanLongSun(double %0) {
%2 = tail call double @llvm.fmuladd.f64(double %0, double 3.032000e-04, double 0x40E19418A272862F)
%3 = tail call double @llvm.fmuladd.f64(double %0, double %2, double 0x407187769EC2CE46)
%4 = fptosi double %3 to i32
%5 = icmp sgt i32 %4, 360
br i1 %5, label %9, label %6
6: ; preds = %9, %1
%7 = phi double [ %3, %1 ], [ %11, %9 ]
%8 = fcmp olt double %7, 0.000000e+00
br i1 %8, label %14, label %18
9: ; preds = %1, %9
%10 = phi double [ %11, %9 ], [ %3, %1 ]
%11 = fadd double %10, -3.600000e+02
%12 = fptosi double %11 to i32
%13 = icmp sgt i32 %12, 360
br i1 %13, label %9, label %6
14: ; preds = %6, %14
%15 = phi double [ %16, %14 ], [ %7, %6 ]
%16 = fadd double %15, 3.600000e+02
%17 = fcmp olt double %16, 0.000000e+00
br i1 %17, label %14, label %18
18: ; preds = %14, %6
%19 = phi double [ %7, %6 ], [ %16, %14 ]
ret double %19
}