#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 fmod(double const, double);
double GeogLonR(const double l, const double r) {
  double l1 = fmod(l, 2.0 * 3.141592653589793238462);
  l1 = (l1 < r - 3.141592653589793238462) ? l1 + 2.0 * 3.141592653589793238462
       : (l1 >= r + 3.141592653589793238462)
           ? l1 - 2.0 * 3.141592653589793238462
           : l1;
  return (l1 == -0.0) ? 0.0 : l1;
}


x86 assembly (clang, -O0):
<GeogLonR>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  0xed9(%rip),%xmm1
call   1030 <fmod@plt>
movsd  %xmm0,-0x18(%rbp)
movsd  -0x18(%rbp),%xmm1
movsd  -0x10(%rbp),%xmm0
movsd  0xeb5(%rip),%xmm2
subsd  %xmm2,%xmm0
ucomisd %xmm1,%xmm0
jbe    1170 <GeogLonR+0x60>
movsd  0xea7(%rip),%xmm0
addsd  -0x18(%rbp),%xmm0
movsd  %xmm0,-0x20(%rbp)
jmp    11bb <GeogLonR+0xab>
movsd  -0x18(%rbp),%xmm0
movsd  0xe83(%rip),%xmm1
addsd  -0x10(%rbp),%xmm1
ucomisd %xmm1,%xmm0
jb     11a7 <GeogLonR+0x97>
movsd  -0x18(%rbp),%xmm0
movsd  0xe6f(%rip),%xmm1
subsd  %xmm1,%xmm0
movsd  %xmm0,-0x28(%rbp)
jmp    11b1 <GeogLonR+0xa1>
movsd  -0x18(%rbp),%xmm0
movsd  %xmm0,-0x28(%rbp)
movsd  -0x28(%rbp),%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  -0x20(%rbp),%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x18(%rbp),%xmm0
movsd  0xe3e(%rip),%xmm1
ucomisd %xmm1,%xmm0
jne    11ef <GeogLonR+0xdf>
jp     11ef <GeogLonR+0xdf>
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x30(%rbp)
jmp    11f9 <GeogLonR+0xe9>
movsd  -0x18(%rbp),%xmm0
movsd  %xmm0,-0x30(%rbp)
movsd  -0x30(%rbp),%xmm0
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<GeogLonR>:
sub    $0x18,%rsp
movaps %xmm1,(%rsp)
movsd  0xee0(%rip),%xmm1
call   1030 <fmod@plt>
movapd (%rsp),%xmm2
movsd  0xed6(%rip),%xmm1
addsd  %xmm2,%xmm1
ucomisd %xmm0,%xmm1
jbe    1146 <GeogLonR+0x36>
addsd  0xebc(%rip),%xmm0
jmp    116f <GeogLonR+0x5f>
addsd  0xec2(%rip),%xmm2
movsd  0xec2(%rip),%xmm1
addsd  %xmm0,%xmm1
cmplesd %xmm0,%xmm2
andpd  %xmm2,%xmm1
andnpd %xmm0,%xmm2
orpd   %xmm1,%xmm2
movapd %xmm2,%xmm0
xorpd  %xmm1,%xmm1
cmpeqsd %xmm0,%xmm1
andnpd %xmm0,%xmm1
movapd %xmm1,%xmm0
add    $0x18,%rsp
ret

LLVM IR (-O0):
define double @GeogLonR(double %0, double %1) {
%3 = alloca double
%4 = alloca double
%5 = alloca double
store double %0, double* %3
store double %1, double* %4
%6 = load double, double* %3
%7 = call double @fmod(double %6, double 0x401921FB54442D18)
store double %7, double* %5
%8 = load double, double* %5
%9 = load double, double* %4
%10 = fsub double %9, 0x400921FB54442D18
%11 = fcmp olt double %8, %10
br i1 %11, label %12, label %15
12: ; preds = %2
%13 = load double, double* %5
%14 = fadd double %13, 0x401921FB54442D18
br label %27
15: ; preds = %2
%16 = load double, double* %5
%17 = load double, double* %4
%18 = fadd double %17, 0x400921FB54442D18
%19 = fcmp oge double %16, %18
br i1 %19, label %20, label %23
20: ; preds = %15
%21 = load double, double* %5
%22 = fsub double %21, 0x401921FB54442D18
br label %25
23: ; preds = %15
%24 = load double, double* %5
br label %25
25: ; preds = %23, %20
%26 = phi double [ %22, %20 ], [ %24, %23 ]
br label %27
27: ; preds = %25, %12
%28 = phi double [ %14, %12 ], [ %26, %25 ]
store double %28, double* %5
%29 = load double, double* %5
%30 = fcmp oeq double %29, -0.000000e+00
br i1 %30, label %31, label %32
31: ; preds = %27
br label %34
32: ; preds = %27
%33 = load double, double* %5
br label %34
34: ; preds = %32, %31
%35 = phi double [ 0.000000e+00, %31 ], [ %33, %32 ]
ret double %35
}

LLVM IR (-O2):
define double @GeogLonR(double %0, double %1) {
%3 = tail call double @fmod(double %0, double 0x401921FB54442D18)
%4 = fadd double %1, 0xC00921FB54442D18
%5 = fcmp olt double %3, %4
br i1 %5, label %6, label %8
6: ; preds = %2
%7 = fadd double %3, 0x401921FB54442D18
br label %13
8: ; preds = %2
%9 = fadd double %1, 0x400921FB54442D18
%10 = fcmp oge double %3, %9
%11 = fadd double %3, 0xC01921FB54442D18
%12 = select i1 %10, double %11, double %3
br label %13
13: ; preds = %8, %6
%14 = phi double [ %7, %6 ], [ %12, %8 ]
%15 = fcmp oeq double %14, 0.000000e+00
%16 = select i1 %15, double 0.000000e+00, double %14
ret double %16
}