#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 */
float _canonicalise_longitude(float);
int /*<<< orphan*/ assert(int);
int _longitude_is_left_of(float lon_a, float lon_b) {
  float deg_east;
  lon_a = _canonicalise_longitude(lon_a);
  lon_b = _canonicalise_longitude(lon_b);
  deg_east = lon_b - lon_a;
  if (deg_east < 0.f)
    deg_east += 360.f;
  if (deg_east >= 360.f)
    deg_east -= 360.f;
  assert((deg_east >= 0.f) && (deg_east < 360.f));
  return deg_east < 180.f;
}


x86 assembly (clang, -O0):
<_longitude_is_left_of>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  -0x4(%rbp),%xmm0
call   1030 <_canonicalise_longitude@plt>
movss  %xmm0,-0x4(%rbp)
movss  -0x8(%rbp),%xmm0
call   1030 <_canonicalise_longitude@plt>
movss  %xmm0,-0x8(%rbp)
movss  -0x8(%rbp),%xmm0
subss  -0x4(%rbp),%xmm0
movss  %xmm0,-0xc(%rbp)
xorps  %xmm0,%xmm0
ucomiss -0xc(%rbp),%xmm0
jbe    117e <_longitude_is_left_of+0x5e>
movss  0xe8c(%rip),%xmm0
addss  -0xc(%rbp),%xmm0
movss  %xmm0,-0xc(%rbp)
movss  -0xc(%rbp),%xmm0
movss  0xe75(%rip),%xmm1
ucomiss %xmm1,%xmm0
jb     11aa <_longitude_is_left_of+0x8a>
movss  -0xc(%rbp),%xmm0
movss  0xe5f(%rip),%xmm1
subss  %xmm1,%xmm0
movss  %xmm0,-0xc(%rbp)
movss  -0xc(%rbp),%xmm0
xor    %eax,%eax
xorps  %xmm1,%xmm1
ucomiss %xmm1,%xmm0
mov    %al,-0xd(%rbp)
jb     11d2 <_longitude_is_left_of+0xb2>
movss  0xe38(%rip),%xmm0
ucomiss -0xc(%rbp),%xmm0
seta   %al
mov    %al,-0xd(%rbp)
mov    -0xd(%rbp),%al
and    $0x1,%al
movzbl %al,%edi
call   1040 <assert@plt>
movss  0xe1d(%rip),%xmm0
ucomiss -0xc(%rbp),%xmm0
seta   %al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_longitude_is_left_of>:
sub    $0x28,%rsp
movss  %xmm1,0x10(%rsp)
call   1030 <_canonicalise_longitude@plt>
movss  %xmm0,0xc(%rsp)
movss  0x10(%rsp),%xmm0
call   1030 <_canonicalise_longitude@plt>
subss  0xc(%rsp),%xmm0
movss  0xeb2(%rip),%xmm1
movaps %xmm0,%xmm2
addss  %xmm1,%xmm2
xorps  %xmm3,%xmm3
movaps %xmm0,%xmm4
cmpltss %xmm3,%xmm4
andps  %xmm4,%xmm2
andnps %xmm0,%xmm4
orps   %xmm2,%xmm4
movaps %xmm1,%xmm2
cmpnless %xmm4,%xmm2
movaps %xmm2,%xmm0
andps  %xmm4,%xmm0
addss  0xe85(%rip),%xmm4
andnps %xmm4,%xmm2
orps   %xmm0,%xmm2
movaps %xmm2,0x10(%rsp)
ucomiss %xmm3,%xmm2
setae  %al
ucomiss %xmm2,%xmm1
seta   %cl
and    %al,%cl
movzbl %cl,%edi
call   1040 <assert@plt>
movss  0xe60(%rip),%xmm0
xor    %eax,%eax
ucomiss 0x10(%rsp),%xmm0
seta   %al
add    $0x28,%rsp
ret

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

LLVM IR (-O2):
define i32 @_longitude_is_left_of(float %0, float %1) {
%3 = tail call float @_canonicalise_longitude(float %0)
%4 = tail call float @_canonicalise_longitude(float %1)
%5 = fsub float %4, %3
%6 = fcmp olt float %5, 0.000000e+00
%7 = fadd float %5, 3.600000e+02
%8 = select i1 %6, float %7, float %5
%9 = fcmp ult float %8, 3.600000e+02
%10 = fadd float %8, -3.600000e+02
%11 = select i1 %9, float %8, float %10
%12 = fcmp oge float %11, 0.000000e+00
%13 = fcmp olt float %11, 3.600000e+02
%14 = and i1 %12, %13
%15 = zext i1 %14 to i32
%16 = tail call i32 @assert(i32 %15)
%17 = fcmp olt float %11, 1.800000e+02
%18 = zext i1 %17 to i32
ret i32 %18
}