#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 */
long Convert_Geodetic_To_Lambert(double, double, double *, double *);
long Convert_Geodetic_To_Neys(double Latitude, double Longitude,
                              double *Easting, double *Northing) {
  long temp_Error = 0;
  long Error_Code = 0x0000;
  if ((Latitude < -(3.14159265358979323e0 / 2.0)) ||
      (Latitude > (3.14159265358979323e0 / 2.0))) {
    Error_Code |= 0x0001;
  }
  if ((Longitude < -3.14159265358979323e0) ||
      (Longitude > (2.0 * 3.14159265358979323e0))) {
    Error_Code |= 0x0002;
  }
  if (!Error_Code) {
    temp_Error =
        Convert_Geodetic_To_Lambert(Latitude, Longitude, Easting, Northing);
    if (temp_Error & 0x0001)
      Error_Code |= 0x0001;
  }
  return (Error_Code);
}


x86 assembly (clang, -O0):
<Convert_Geodetic_To_Neys>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
mov    %rdi,-0x18(%rbp)
mov    %rsi,-0x20(%rbp)
movq   $0x0,-0x28(%rbp)
movq   $0x0,-0x30(%rbp)
movsd  0xebe(%rip),%xmm0
ucomisd -0x8(%rbp),%xmm0
ja     1164 <Convert_Geodetic_To_Neys+0x54>
movsd  -0x8(%rbp),%xmm0
movsd  0xeae(%rip),%xmm1
ucomisd %xmm1,%xmm0
jbe    1170 <Convert_Geodetic_To_Neys+0x60>
mov    -0x30(%rbp),%rax
or     $0x1,%rax
mov    %rax,-0x30(%rbp)
movsd  0xe98(%rip),%xmm0
ucomisd -0x10(%rbp),%xmm0
ja     119a <Convert_Geodetic_To_Neys+0x8a>
movsd  -0x10(%rbp),%xmm0
movsd  0xe88(%rip),%xmm1
ucomisd %xmm1,%xmm0
jbe    11a6 <Convert_Geodetic_To_Neys+0x96>
mov    -0x30(%rbp),%rax
or     $0x2,%rax
mov    %rax,-0x30(%rbp)
cmpq   $0x0,-0x30(%rbp)
jne    11ef <Convert_Geodetic_To_Neys+0xdf>
movsd  -0x8(%rbp),%xmm0
movsd  -0x10(%rbp),%xmm1
mov    -0x18(%rbp),%rdi
mov    -0x20(%rbp),%rsi
call   1030 <Convert_Geodetic_To_Lambert@plt>
mov    %rax,-0x28(%rbp)
mov    -0x28(%rbp),%rax
and    $0x1,%rax
cmp    $0x0,%rax
je     11ea <Convert_Geodetic_To_Neys+0xda>
mov    -0x30(%rbp),%rax
or     $0x1,%rax
mov    %rax,-0x30(%rbp)
jmp    11ef <Convert_Geodetic_To_Neys+0xdf>
mov    -0x30(%rbp),%rax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Convert_Geodetic_To_Neys>:
push   %rax
movsd  0xee7(%rip),%xmm2
ucomisd %xmm0,%xmm2
seta   %al
ucomisd 0xee0(%rip),%xmm0
seta   %cl
or     %al,%cl
movzbl %cl,%eax
ucomisd 0xed8(%rip),%xmm1
lea    0x2(%rax),%rcx
cmova  %rcx,%rax
movsd  0xed0(%rip),%xmm2
ucomisd %xmm1,%xmm2
cmova  %rcx,%rax
test   %rax,%rax
je     1157 <Convert_Geodetic_To_Neys+0x47>
pop    %rcx
ret
call   1030 <Convert_Geodetic_To_Lambert@plt>
and    $0x1,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i64 @Convert_Geodetic_To_Neys(double %0, double %1, double* %2, double* %3) {
%5 = alloca double
%6 = alloca double
%7 = alloca double*
%8 = alloca double*
%9 = alloca i64
%10 = alloca i64
store double %0, double* %5
store double %1, double* %6
store double* %2, double** %7
store double* %3, double** %8
store i64 0, i64* %9
store i64 0, i64* %10
%11 = load double, double* %5
%12 = fcmp olt double %11, 0xBFF921FB54442D18
br i1 %12, label %16, label %13
13: ; preds = %4
%14 = load double, double* %5
%15 = fcmp ogt double %14, 0x3FF921FB54442D18
br i1 %15, label %16, label %19
16: ; preds = %13, %4
%17 = load i64, i64* %10
%18 = or i64 %17, 1
store i64 %18, i64* %10
br label %19
19: ; preds = %16, %13
%20 = load double, double* %6
%21 = fcmp olt double %20, 0xC00921FB54442D18
br i1 %21, label %25, label %22
22: ; preds = %19
%23 = load double, double* %6
%24 = fcmp ogt double %23, 0x401921FB54442D18
br i1 %24, label %25, label %28
25: ; preds = %22, %19
%26 = load i64, i64* %10
%27 = or i64 %26, 2
store i64 %27, i64* %10
br label %28
28: ; preds = %25, %22
%29 = load i64, i64* %10
%30 = icmp ne i64 %29, 0
br i1 %30, label %44, label %31
31: ; preds = %28
%32 = load double, double* %5
%33 = load double, double* %6
%34 = load double*, double** %7
%35 = load double*, double** %8
%36 = call i64 @Convert_Geodetic_To_Lambert(double %32, double %33, double* %34, double* %35)
store i64 %36, i64* %9
%37 = load i64, i64* %9
%38 = and i64 %37, 1
%39 = icmp ne i64 %38, 0
br i1 %39, label %40, label %43
40: ; preds = %31
%41 = load i64, i64* %10
%42 = or i64 %41, 1
store i64 %42, i64* %10
br label %43
43: ; preds = %40, %31
br label %44
44: ; preds = %43, %28
%45 = load i64, i64* %10
ret i64 %45
}

LLVM IR (-O2):
define i64 @Convert_Geodetic_To_Neys(double %0, double %1, double* %2, double* %3) {
%5 = fcmp olt double %0, 0xBFF921FB54442D18
%6 = fcmp ogt double %0, 0x3FF921FB54442D18
%7 = or i1 %5, %6
%8 = zext i1 %7 to i64
%9 = fcmp olt double %1, 0xC00921FB54442D18
%10 = fcmp ogt double %1, 0x401921FB54442D18
%11 = or i1 %9, %10
%12 = or i64 %8, 2
%13 = select i1 %11, i64 %12, i64 %8
%14 = icmp eq i64 %13, 0
br i1 %14, label %15, label %18
15: ; preds = %4
%16 = tail call i64 @Convert_Geodetic_To_Lambert(double %0, double %1, double* %2, double* %3)
%17 = and i64 %16, 1
br label %18
18: ; preds = %15, %4
%19 = phi i64 [ %13, %4 ], [ %17, %15 ]
ret i64 %19
}