#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 M_PI;
double const cos(double);
double sin(double);
double sqrt(double);
int /*<<< orphan*/ transform(double, double, double *, double *);
void delta(double lat, double lng, double *dLat, double *dLng) {
  if ((dLat == NULL) || (dLng == NULL)) {
    return;
  }
  const double a = 6378245.0;
  const double ee = 0.00669342162296594323;
  transform(lng - 105.0, lat - 35.0, dLat, dLng);
  double radLat = lat / 180.0 * M_PI;
  double magic = sin(radLat);
  magic = 1 - ee * magic * magic;
  double sqrtMagic = sqrt(magic);
  *dLat = (*dLat * 180.0) / ((a * (1 - ee)) / (magic * sqrtMagic) * M_PI);
  *dLng = (*dLng * 180.0) / (a / sqrtMagic * cos(radLat) * M_PI);
}


x86 assembly (clang, -O0):
<delta>:
push   %rbp
mov    %rsp,%rbp
sub    $0x60,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
mov    %rdi,-0x18(%rbp)
mov    %rsi,-0x20(%rbp)
cmpq   $0x0,-0x18(%rbp)
je     1170 <delta+0x30>
cmpq   $0x0,-0x20(%rbp)
jne    1175 <delta+0x35>
jmp    12d1 <delta+0x191>
movsd  0xe83(%rip),%xmm0
movsd  %xmm0,-0x28(%rbp)
movsd  0xe96(%rip),%xmm0
movsd  %xmm0,-0x30(%rbp)
movsd  -0x10(%rbp),%xmm0
movsd  0xe94(%rip),%xmm1
subsd  %xmm1,%xmm0
movsd  -0x8(%rbp),%xmm1
movsd  0xe7b(%rip),%xmm2
subsd  %xmm2,%xmm1
mov    -0x18(%rbp),%rdi
mov    -0x20(%rbp),%rsi
call   1030 <transform@plt>
movsd  -0x8(%rbp),%xmm0
movsd  0xe3d(%rip),%xmm1
divsd  %xmm1,%xmm0
mov    0x2e12(%rip),%rax
mulsd  (%rax),%xmm0
movsd  %xmm0,-0x38(%rbp)
movsd  -0x38(%rbp),%xmm0
call   1040 <sin@plt>
movsd  %xmm0,-0x40(%rbp)
movsd  0xe2a(%rip),%xmm0
mulsd  -0x40(%rbp),%xmm0
movsd  -0x40(%rbp),%xmm1
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
mulsd  %xmm1,%xmm0
movsd  0xdf5(%rip),%xmm1
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x40(%rbp)
movsd  -0x40(%rbp),%xmm0
call   1060 <sqrt@plt>
movsd  %xmm0,-0x48(%rbp)
mov    -0x18(%rbp),%rax
movsd  0xdc1(%rip),%xmm0
mulsd  (%rax),%xmm0
movsd  -0x40(%rbp),%xmm2
mulsd  -0x48(%rbp),%xmm2
movsd  0xdb3(%rip),%xmm1
divsd  %xmm2,%xmm1
mov    0x2d80(%rip),%rax
mulsd  (%rax),%xmm1
divsd  %xmm1,%xmm0
mov    -0x18(%rbp),%rax
movsd  %xmm0,(%rax)
mov    -0x20(%rbp),%rax
movsd  0xd84(%rip),%xmm0
mulsd  (%rax),%xmm0
movsd  %xmm0,-0x50(%rbp)
movsd  0xd6b(%rip),%xmm0
divsd  -0x48(%rbp),%xmm0
movsd  %xmm0,-0x58(%rbp)
movsd  -0x38(%rbp),%xmm0
call   1050 <cos@plt>
movsd  -0x58(%rbp),%xmm1
movaps %xmm0,%xmm2
movsd  -0x50(%rbp),%xmm0
mulsd  %xmm2,%xmm1
mov    0x2d27(%rip),%rax
mulsd  (%rax),%xmm1
divsd  %xmm1,%xmm0
mov    -0x20(%rbp),%rax
movsd  %xmm0,(%rax)
add    $0x60,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<delta>:
push   %r15
push   %r14
push   %rbx
sub    $0x20,%rsp
test   %rdi,%rdi
je     1263 <delta+0x123>
mov    %rsi,%r14
test   %rsi,%rsi
je     1263 <delta+0x123>
mov    %rdi,%rbx
addsd  0xe97(%rip),%xmm1
movsd  0xe97(%rip),%xmm2
addsd  %xmm0,%xmm2
movsd  %xmm0,0x10(%rsp)
movapd %xmm1,%xmm0
movapd %xmm2,%xmm1
mov    %r14,%rsi
call   1030 <transform@plt>
movsd  0x10(%rsp),%xmm0
divsd  0xe77(%rip),%xmm0
mov    0x2e48(%rip),%r15
mulsd  (%r15),%xmm0
movsd  %xmm0,0x10(%rsp)
call   1040 <sin@plt>
movsd  0xe60(%rip),%xmm3
mulsd  %xmm0,%xmm3
mulsd  %xmm0,%xmm3
addsd  0xe58(%rip),%xmm3
xorpd  %xmm0,%xmm0
ucomisd %xmm0,%xmm3
jb     11db <delta+0x9b>
xorps  %xmm0,%xmm0
sqrtsd %xmm3,%xmm0
jmp    11f0 <delta+0xb0>
movapd %xmm3,%xmm0
movsd  %xmm3,0x8(%rsp)
call   1060 <sqrt@plt>
movsd  0x8(%rsp),%xmm3
movsd  0xe18(%rip),%xmm2
movsd  (%rbx),%xmm1
mulsd  %xmm2,%xmm1
movapd %xmm2,%xmm4
mulsd  %xmm0,%xmm3
movsd  0xe18(%rip),%xmm2
divsd  %xmm3,%xmm2
mulsd  (%r15),%xmm2
divsd  %xmm2,%xmm1
movsd  %xmm1,(%rbx)
mulsd  (%r14),%xmm4
movsd  %xmm4,0x8(%rsp)
movsd  0xdfc(%rip),%xmm1
divsd  %xmm0,%xmm1
movsd  %xmm1,0x18(%rsp)
movsd  0x10(%rsp),%xmm0
call   1050 <cos@plt>
mulsd  0x18(%rsp),%xmm0
mulsd  (%r15),%xmm0
movsd  0x8(%rsp),%xmm1
divsd  %xmm0,%xmm1
movsd  %xmm1,(%r14)
add    $0x20,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@M_PI = global double 0.000000e+00
define void @delta(double %0, double %1, double* %2, double* %3) {
%5 = alloca double
%6 = alloca double
%7 = alloca double*
%8 = alloca double*
%9 = alloca double
%10 = alloca double
%11 = alloca double
%12 = alloca double
%13 = alloca double
store double %0, double* %5
store double %1, double* %6
store double* %2, double** %7
store double* %3, double** %8
%14 = load double*, double** %7
%15 = icmp eq double* %14, null
br i1 %15, label %19, label %16
16: ; preds = %4
%17 = load double*, double** %8
%18 = icmp eq double* %17, null
br i1 %18, label %19, label %20
19: ; preds = %16, %4
br label %64
20: ; preds = %16
store double 0x415854C140000000, double* %9
store double 0x3F7B6A8FAF80EF0B, double* %10
%21 = load double, double* %6
%22 = fsub double %21, 1.050000e+02
%23 = load double, double* %5
%24 = fsub double %23, 3.500000e+01
%25 = load double*, double** %7
%26 = load double*, double** %8
%27 = call i32 @transform(double %22, double %24, double* %25, double* %26)
%28 = load double, double* %5
%29 = fdiv double %28, 1.800000e+02
%30 = load double, double* @M_PI
%31 = fmul double %29, %30
store double %31, double* %11
%32 = load double, double* %11
%33 = call double @sin(double %32)
store double %33, double* %12
%34 = load double, double* %12
%35 = fmul double 0x3F7B6A8FAF80EF0B, %34
%36 = load double, double* %12
%37 = fneg double %35
%38 = call double @llvm.fmuladd.f64(double %37, double %36, double 1.000000e+00)
store double %38, double* %12
%39 = load double, double* %12
%40 = call double @sqrt(double %39)
store double %40, double* %13
%41 = load double*, double** %7
%42 = load double, double* %41
%43 = fmul double %42, 1.800000e+02
%44 = load double, double* %12
%45 = load double, double* %13
%46 = fmul double %44, %45
%47 = fdiv double 0x41582B102DE355C1, %46
%48 = load double, double* @M_PI
%49 = fmul double %47, %48
%50 = fdiv double %43, %49
%51 = load double*, double** %7
store double %50, double* %51
%52 = load double*, double** %8
%53 = load double, double* %52
%54 = fmul double %53, 1.800000e+02
%55 = load double, double* %13
%56 = fdiv double 0x415854C140000000, %55
%57 = load double, double* %11
%58 = call double @cos(double %57)
%59 = fmul double %56, %58
%60 = load double, double* @M_PI
%61 = fmul double %59, %60
%62 = fdiv double %54, %61
%63 = load double*, double** %8
store double %62, double* %63
br label %64
64: ; preds = %20, %19
ret void
}

LLVM IR (-O2):
@M_PI = global double 0.000000e+00
define void @delta(double %0, double %1, double* %2, double* %3) {
%5 = icmp eq double* %2, null
%6 = icmp eq double* %3, null
%7 = or i1 %5, %6
br i1 %7, label %34, label %8
8: ; preds = %4
%9 = fadd double %1, -1.050000e+02
%10 = fadd double %0, -3.500000e+01
%11 = tail call i32 @transform(double %9, double %10, double* %2, double* %3)
%12 = fdiv double %0, 1.800000e+02
%13 = load double, double* @M_PI
%14 = fmul double %12, %13
%15 = tail call double @sin(double %14)
%16 = fmul double %15, 0xBF7B6A8FAF80EF0B
%17 = tail call double @llvm.fmuladd.f64(double %16, double %15, double 1.000000e+00)
%18 = tail call double @sqrt(double %17)
%19 = load double, double* %2
%20 = fmul double %19, 1.800000e+02
%21 = fmul double %18, %17
%22 = fdiv double 0x41582B102DE355C1, %21
%23 = load double, double* @M_PI
%24 = fmul double %23, %22
%25 = fdiv double %20, %24
store double %25, double* %2
%26 = load double, double* %3
%27 = fmul double %26, 1.800000e+02
%28 = fdiv double 0x415854C140000000, %18
%29 = tail call double @cos(double %14)
%30 = fmul double %28, %29
%31 = load double, double* @M_PI
%32 = fmul double %30, %31
%33 = fdiv double %27, %32
store double %33, double* %3
br label %34
34: ; preds = %4, %8
ret void
}