#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 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 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) / ((6378137.0 * (1 - ee)) / (magic * sqrtMagic) * M_PI);
  *dLng = (*dLng * 180.0) / (6378137.0 / sqrtMagic * cos(radLat) * M_PI);
}


x86 assembly (clang, -O0):
<delta>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%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    12c4 <delta+0x184>
movsd  0xea3(%rip),%xmm0
movsd  %xmm0,-0x28(%rbp)
movsd  -0x10(%rbp),%xmm0
movsd  0xea1(%rip),%xmm1
subsd  %xmm1,%xmm0
movsd  -0x8(%rbp),%xmm1
movsd  0xe88(%rip),%xmm2
subsd  %xmm2,%xmm1
mov    -0x18(%rbp),%rdi
mov    -0x20(%rbp),%rsi
call   1030 <transform@plt>
movsd  -0x8(%rbp),%xmm0
movsd  0xe4a(%rip),%xmm1
divsd  %xmm1,%xmm0
mov    0x2e1f(%rip),%rax
mulsd  (%rax),%xmm0
movsd  %xmm0,-0x30(%rbp)
movsd  -0x30(%rbp),%xmm0
call   1040 <sin@plt>
movsd  %xmm0,-0x38(%rbp)
movsd  0xe37(%rip),%xmm0
mulsd  -0x38(%rbp),%xmm0
movsd  -0x38(%rbp),%xmm1
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
mulsd  %xmm1,%xmm0
movsd  0xe02(%rip),%xmm1
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x38(%rbp)
movsd  -0x38(%rbp),%xmm0
call   1060 <sqrt@plt>
movsd  %xmm0,-0x40(%rbp)
mov    -0x18(%rbp),%rax
movsd  0xdce(%rip),%xmm0
mulsd  (%rax),%xmm0
movsd  -0x38(%rbp),%xmm2
mulsd  -0x40(%rbp),%xmm2
movsd  0xdc0(%rip),%xmm1
divsd  %xmm2,%xmm1
mov    0x2d8d(%rip),%rax
mulsd  (%rax),%xmm1
divsd  %xmm1,%xmm0
mov    -0x18(%rbp),%rax
movsd  %xmm0,(%rax)
mov    -0x20(%rbp),%rax
movsd  0xd91(%rip),%xmm0
mulsd  (%rax),%xmm0
movsd  %xmm0,-0x48(%rbp)
movsd  0xd78(%rip),%xmm0
divsd  -0x40(%rbp),%xmm0
movsd  %xmm0,-0x50(%rbp)
movsd  -0x30(%rbp),%xmm0
call   1050 <cos@plt>
movsd  -0x50(%rbp),%xmm1
movaps %xmm0,%xmm2
movsd  -0x48(%rbp),%xmm0
mulsd  %xmm2,%xmm1
mov    0x2d34(%rip),%rax
mulsd  (%rax),%xmm1
divsd  %xmm1,%xmm0
mov    -0x20(%rbp),%rax
movsd  %xmm0,(%rax)
add    $0x50,%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
store double %0, double* %5
store double %1, double* %6
store double* %2, double** %7
store double* %3, double** %8
%13 = load double*, double** %7
%14 = icmp eq double* %13, null
br i1 %14, label %18, label %15
15: ; preds = %4
%16 = load double*, double** %8
%17 = icmp eq double* %16, null
br i1 %17, label %18, label %19
18: ; preds = %15, %4
br label %63
19: ; preds = %15
store double 0x3F7B6A8FAF80EF0B, double* %9
%20 = load double, double* %6
%21 = fsub double %20, 1.050000e+02
%22 = load double, double* %5
%23 = fsub double %22, 3.500000e+01
%24 = load double*, double** %7
%25 = load double*, double** %8
%26 = call i32 @transform(double %21, double %23, double* %24, double* %25)
%27 = load double, double* %5
%28 = fdiv double %27, 1.800000e+02
%29 = load double, double* @M_PI
%30 = fmul double %28, %29
store double %30, double* %10
%31 = load double, double* %10
%32 = call double @sin(double %31)
store double %32, double* %11
%33 = load double, double* %11
%34 = fmul double 0x3F7B6A8FAF80EF0B, %33
%35 = load double, double* %11
%36 = fneg double %34
%37 = call double @llvm.fmuladd.f64(double %36, double %35, double 1.000000e+00)
store double %37, double* %11
%38 = load double, double* %11
%39 = call double @sqrt(double %38)
store double %39, double* %12
%40 = load double*, double** %7
%41 = load double, double* %40
%42 = fmul double %41, 1.800000e+02
%43 = load double, double* %11
%44 = load double, double* %12
%45 = fmul double %43, %44
%46 = fdiv double 0x41582AF55C272839, %45
%47 = load double, double* @M_PI
%48 = fmul double %46, %47
%49 = fdiv double %42, %48
%50 = load double*, double** %7
store double %49, double* %50
%51 = load double*, double** %8
%52 = load double, double* %51
%53 = fmul double %52, 1.800000e+02
%54 = load double, double* %12
%55 = fdiv double 0x415854A640000000, %54
%56 = load double, double* %10
%57 = call double @cos(double %56)
%58 = fmul double %55, %57
%59 = load double, double* @M_PI
%60 = fmul double %58, %59
%61 = fdiv double %53, %60
%62 = load double*, double** %8
store double %61, double* %62
br label %63
63: ; preds = %19, %18
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 0x41582AF55C272839, %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 0x415854A640000000, %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
}