double gcgeodist(const double lat1, const double lon1, const double lat2,
                 const double lon2) {
  double res;
  res = radtometers(gcdist(((lat1)*3.14159265358979323846 / 180.0),
                           ((lon1)*3.14159265358979323846 / 180.0),
                           ((lat2)*3.14159265358979323846 / 180.0),
                           ((lon2)*3.14159265358979323846 / 180.0)));
  if (res < 0.1)
    res = 0;
  return res;
}


x86 assembly (clang, -O0):
<gcgeodist>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  %xmm2,-0x18(%rbp)
movsd  %xmm3,-0x20(%rbp)
movsd  0xecc(%rip),%xmm0
mulsd  -0x8(%rbp),%xmm0
movsd  0xeb7(%rip),%xmm1
divsd  %xmm1,%xmm0
movsd  0xeb3(%rip),%xmm1
mulsd  -0x10(%rbp),%xmm1
movsd  0xe9e(%rip),%xmm2
divsd  %xmm2,%xmm1
movsd  0xe9a(%rip),%xmm2
mulsd  -0x18(%rbp),%xmm2
movsd  0xe85(%rip),%xmm3
divsd  %xmm3,%xmm2
movsd  0xe81(%rip),%xmm3
mulsd  -0x20(%rbp),%xmm3
movsd  0xe6c(%rip),%xmm4
divsd  %xmm4,%xmm3
mov    $0x4,%al
call   1030 <gcdist@plt>
mov    %eax,%edi
mov    $0x0,%al
call   1040 <radtometers@plt>
cvtsi2sd %eax,%xmm0
movsd  %xmm0,-0x28(%rbp)
movsd  0xe3f(%rip),%xmm0
ucomisd -0x28(%rbp),%xmm0
jbe    11d4 <gcgeodist+0xb4>
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x28(%rbp)
movsd  -0x28(%rbp),%xmm0
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<gcgeodist>:
push   %rax
movsd  0xed7(%rip),%xmm4
mulsd  %xmm4,%xmm0
movsd  0xed3(%rip),%xmm5
divsd  %xmm5,%xmm0
mulsd  %xmm4,%xmm1
divsd  %xmm5,%xmm1
mulsd  %xmm4,%xmm2
divsd  %xmm5,%xmm2
mulsd  %xmm4,%xmm3
divsd  %xmm5,%xmm3
mov    $0x4,%al
call   1030 <gcdist@plt>
mov    %eax,%edi
xor    %eax,%eax
call   1040 <radtometers@plt>
xorpd  %xmm0,%xmm0
test   %eax,%eax
jle    1170 <gcgeodist+0x50>
xorps  %xmm0,%xmm0
cvtsi2sd %eax,%xmm0
pop    %rax
ret

LLVM IR (-O0):
define double @gcgeodist(double %0, double %1, double %2, double %3) {
%5 = alloca double
%6 = alloca double
%7 = alloca double
%8 = alloca double
%9 = alloca double
store double %0, double* %5
store double %1, double* %6
store double %2, double* %7
store double %3, double* %8
%10 = load double, double* %5
%11 = fmul double %10, 0x400921FB54442D18
%12 = fdiv double %11, 1.800000e+02
%13 = load double, double* %6
%14 = fmul double %13, 0x400921FB54442D18
%15 = fdiv double %14, 1.800000e+02
%16 = load double, double* %7
%17 = fmul double %16, 0x400921FB54442D18
%18 = fdiv double %17, 1.800000e+02
%19 = load double, double* %8
%20 = fmul double %19, 0x400921FB54442D18
%21 = fdiv double %20, 1.800000e+02
%22 = call i32 (double, double, double, double, ...) bitcast (i32 (...)* @gcdist to i32 (double, double, double, double, ...)*)(double %12, double %15, double %18, double %21)
%23 = call i32 (i32, ...) bitcast (i32 (...)* @radtometers to i32 (i32, ...)*)(i32 %22)
%24 = sitofp i32 %23 to double
store double %24, double* %9
%25 = load double, double* %9
%26 = fcmp olt double %25, 1.000000e-01
br i1 %26, label %27, label %28
27: ; preds = %4
store double 0.000000e+00, double* %9
br label %28
28: ; preds = %27, %4
%29 = load double, double* %9
ret double %29
}

LLVM IR (-O2):
define double @gcgeodist(double %0, double %1, double %2, double %3) {
%5 = fmul double %0, 0x400921FB54442D18
%6 = fdiv double %5, 1.800000e+02
%7 = fmul double %1, 0x400921FB54442D18
%8 = fdiv double %7, 1.800000e+02
%9 = fmul double %2, 0x400921FB54442D18
%10 = fdiv double %9, 1.800000e+02
%11 = fmul double %3, 0x400921FB54442D18
%12 = fdiv double %11, 1.800000e+02
%13 = tail call i32 (double, double, double, double, ...) bitcast (i32 (...)* @gcdist to i32 (double, double, double, double, ...)*)(double %6, double %8, double %10, double %12)
%14 = tail call i32 (i32, ...) bitcast (i32 (...)* @radtometers to i32 (i32, ...)*)(i32 %13)
%15 = sitofp i32 %14 to double
%16 = icmp slt i32 %14, 1
%17 = select i1 %16, double 0.000000e+00, double %15
ret double %17
}