#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 */
int /*<<< orphan*/ GreatCircle(double, double, double, double, double *,
                               double *);
void MyCalDistance(double a_lat, double a_log, double b_lat, double b_log,
                   double angleDiff, double *dDistance, double *dBearing) {
  double a_dlat, a_dlog, b_dlat, b_dlog;
  double distance, bearing;
  a_dlat = a_lat / 180.0 * 3.14159265358979323846;
  a_dlog = a_log / 180.0 * 3.14159265358979323846;
  b_dlat = b_lat / 180.0 * 3.14159265358979323846;
  b_dlog = b_log / 180.0 * 3.14159265358979323846;
  GreatCircle(a_dlat, a_dlog, b_dlat, b_dlog, &distance, &bearing);
  *dDistance =
      ((distance * 180.0 * 60.0 / 3.14159265358979323846) * 1852.0 / 1000.0) *
      1000.0;
  *dBearing = bearing * 180.0 / 3.14159265358979323846 + angleDiff;
}


x86 assembly (clang, -O0):
<MyCalDistance>:
push   %rbp
mov    %rsp,%rbp
sub    $0x70,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  %xmm2,-0x18(%rbp)
movsd  %xmm3,-0x20(%rbp)
movsd  %xmm4,-0x28(%rbp)
mov    %rdi,-0x30(%rbp)
mov    %rsi,-0x38(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  0xec2(%rip),%xmm1
divsd  %xmm1,%xmm0
movsd  0xeae(%rip),%xmm1
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x40(%rbp)
movsd  -0x10(%rbp),%xmm0
movsd  0xea0(%rip),%xmm1
divsd  %xmm1,%xmm0
movsd  0xe8c(%rip),%xmm1
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x48(%rbp)
movsd  -0x18(%rbp),%xmm0
movsd  0xe7e(%rip),%xmm1
divsd  %xmm1,%xmm0
movsd  0xe6a(%rip),%xmm1
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x50(%rbp)
movsd  -0x20(%rbp),%xmm0
movsd  0xe5c(%rip),%xmm1
divsd  %xmm1,%xmm0
movsd  0xe48(%rip),%xmm1
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x58(%rbp)
movsd  -0x40(%rbp),%xmm0
movsd  -0x48(%rbp),%xmm1
movsd  -0x50(%rbp),%xmm2
movsd  -0x58(%rbp),%xmm3
lea    -0x60(%rbp),%rdi
lea    -0x68(%rbp),%rsi
call   1030 <GreatCircle@plt>
movsd  0xe1e(%rip),%xmm0
mulsd  -0x60(%rbp),%xmm0
movsd  0xe29(%rip),%xmm1
mulsd  %xmm1,%xmm0
movsd  0xdfd(%rip),%xmm1
divsd  %xmm1,%xmm0
movsd  0xe09(%rip),%xmm1
mulsd  %xmm1,%xmm0
movsd  0xdf5(%rip),%xmm1
divsd  %xmm1,%xmm0
movsd  0xde9(%rip),%xmm1
mulsd  %xmm1,%xmm0
mov    -0x30(%rbp),%rax
movsd  %xmm0,(%rax)
movsd  0xdcd(%rip),%xmm0
mulsd  -0x68(%rbp),%xmm0
movsd  0xdb8(%rip),%xmm1
divsd  %xmm1,%xmm0
addsd  -0x28(%rbp),%xmm0
mov    -0x38(%rbp),%rax
movsd  %xmm0,(%rax)
add    $0x70,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<MyCalDistance>:
push   %r14
push   %rbx
sub    $0x18,%rsp
mov    %rsi,%r14
mov    %rdi,%rbx
movsd  %xmm4,(%rsp)
movsd  0xed6(%rip),%xmm4
divsd  %xmm4,%xmm0
movsd  0xed2(%rip),%xmm5
mulsd  %xmm5,%xmm0
divsd  %xmm4,%xmm1
mulsd  %xmm5,%xmm1
divsd  %xmm4,%xmm2
mulsd  %xmm5,%xmm2
divsd  %xmm4,%xmm3
mulsd  %xmm5,%xmm3
lea    0x10(%rsp),%rdi
lea    0x8(%rsp),%rsi
call   1030 <GreatCircle@plt>
movsd  0x10(%rsp),%xmm0
movsd  0xe91(%rip),%xmm3
mulsd  %xmm3,%xmm0
mulsd  0xe95(%rip),%xmm0
movsd  0xe85(%rip),%xmm2
divsd  %xmm2,%xmm0
mulsd  0xe89(%rip),%xmm0
movsd  0xe89(%rip),%xmm1
divsd  %xmm1,%xmm0
mulsd  %xmm1,%xmm0
movsd  %xmm0,(%rbx)
movapd %xmm3,%xmm0
mulsd  0x8(%rsp),%xmm0
divsd  %xmm2,%xmm0
addsd  (%rsp),%xmm0
movsd  %xmm0,(%r14)
add    $0x18,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define void @MyCalDistance(double %0, double %1, double %2, double %3, double %4, double* %5, double* %6) {
%8 = alloca double
%9 = alloca double
%10 = alloca double
%11 = alloca double
%12 = alloca double
%13 = alloca double*
%14 = alloca double*
%15 = alloca double
%16 = alloca double
%17 = alloca double
%18 = alloca double
%19 = alloca double
%20 = alloca double
store double %0, double* %8
store double %1, double* %9
store double %2, double* %10
store double %3, double* %11
store double %4, double* %12
store double* %5, double** %13
store double* %6, double** %14
%21 = load double, double* %8
%22 = fdiv double %21, 1.800000e+02
%23 = fmul double %22, 0x400921FB54442D18
store double %23, double* %15
%24 = load double, double* %9
%25 = fdiv double %24, 1.800000e+02
%26 = fmul double %25, 0x400921FB54442D18
store double %26, double* %16
%27 = load double, double* %10
%28 = fdiv double %27, 1.800000e+02
%29 = fmul double %28, 0x400921FB54442D18
store double %29, double* %17
%30 = load double, double* %11
%31 = fdiv double %30, 1.800000e+02
%32 = fmul double %31, 0x400921FB54442D18
store double %32, double* %18
%33 = load double, double* %15
%34 = load double, double* %16
%35 = load double, double* %17
%36 = load double, double* %18
%37 = call i32 @GreatCircle(double %33, double %34, double %35, double %36, double* %19, double* %20)
%38 = load double, double* %19
%39 = fmul double %38, 1.800000e+02
%40 = fmul double %39, 6.000000e+01
%41 = fdiv double %40, 0x400921FB54442D18
%42 = fmul double %41, 1.852000e+03
%43 = fdiv double %42, 1.000000e+03
%44 = fmul double %43, 1.000000e+03
%45 = load double*, double** %13
store double %44, double* %45
%46 = load double, double* %20
%47 = fmul double %46, 1.800000e+02
%48 = fdiv double %47, 0x400921FB54442D18
%49 = load double, double* %12
%50 = fadd double %48, %49
%51 = load double*, double** %14
store double %50, double* %51
ret void
}

LLVM IR (-O2):
define void @MyCalDistance(double %0, double %1, double %2, double %3, double %4, double* nocapture writeonly %5, double* nocapture writeonly %6) {
%8 = alloca double
%9 = alloca double
%10 = bitcast double* %8 to i8*
%11 = bitcast double* %9 to i8*
%12 = fdiv double %0, 1.800000e+02
%13 = fmul double %12, 0x400921FB54442D18
%14 = fdiv double %1, 1.800000e+02
%15 = fmul double %14, 0x400921FB54442D18
%16 = fdiv double %2, 1.800000e+02
%17 = fmul double %16, 0x400921FB54442D18
%18 = fdiv double %3, 1.800000e+02
%19 = fmul double %18, 0x400921FB54442D18
%20 = call i32 @GreatCircle(double %13, double %15, double %17, double %19, double* %8, double* %9)
%21 = load double, double* %8
%22 = fmul double %21, 1.800000e+02
%23 = fmul double %22, 6.000000e+01
%24 = fdiv double %23, 0x400921FB54442D18
%25 = fmul double %24, 1.852000e+03
%26 = fdiv double %25, 1.000000e+03
%27 = fmul double %26, 1.000000e+03
store double %27, double* %5
%28 = load double, double* %9
%29 = fmul double %28, 1.800000e+02
%30 = fdiv double %29, 0x400921FB54442D18
%31 = fadd double %30, %4
store double %31, double* %6
ret void
}