void newgp(double latobs, double lonobs, double az, double dist, double *lat,
           double *lon) {
  double phipri, alampr;
  void direct(double, double, double, double, double *, double *);
  double azNtoS(double);
  if (latobs == 0.0 && (az == 90.0 || az == 270.0))
    latobs += 1.0e-37;
  direct(3600.0 * latobs, 3600.0 * lonobs, 3600.0 * azNtoS(az), dist, &phipri,
         &alampr);
  *lat = phipri / 3600.0;
  *lon = alampr / 3600.0;
}


x86 assembly (clang, -O0):
<newgp>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  %xmm2,-0x18(%rbp)
movsd  %xmm3,-0x20(%rbp)
mov    %rdi,-0x28(%rbp)
mov    %rsi,-0x30(%rbp)
movsd  -0x8(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jne    11ad <newgp+0x8d>
jp     11ad <newgp+0x8d>
movsd  -0x18(%rbp),%xmm0
movsd  0xe97(%rip),%xmm1
ucomisd %xmm1,%xmm0
jne    117e <newgp+0x5e>
jp     117e <newgp+0x5e>
jmp    119b <newgp+0x7b>
movsd  -0x18(%rbp),%xmm0
movsd  0xe7d(%rip),%xmm1
ucomisd %xmm1,%xmm0
jne    11ad <newgp+0x8d>
jp     11ad <newgp+0x8d>
movsd  0xe6d(%rip),%xmm0
addsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x8(%rbp)
movsd  0xe63(%rip),%xmm0
mulsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x48(%rbp)
movsd  0xe51(%rip),%xmm0
mulsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x50(%rbp)
movsd  -0x18(%rbp),%xmm0
call   1040 <azNtoS@plt>
movsd  -0x50(%rbp),%xmm1
movaps %xmm0,%xmm3
movsd  -0x48(%rbp),%xmm0
movsd  0xe28(%rip),%xmm2
mulsd  %xmm3,%xmm2
movsd  -0x20(%rbp),%xmm3
lea    -0x38(%rbp),%rdi
lea    -0x40(%rbp),%rsi
call   1030 <direct@plt>
movsd  -0x38(%rbp),%xmm0
movsd  0xe05(%rip),%xmm1
divsd  %xmm1,%xmm0
mov    -0x28(%rbp),%rax
movsd  %xmm0,(%rax)
movsd  -0x40(%rbp),%xmm0
movsd  0xdec(%rip),%xmm1
divsd  %xmm1,%xmm0
mov    -0x30(%rbp),%rax
movsd  %xmm0,(%rax)
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<newgp>:
push   %r14
push   %rbx
sub    $0x38,%rsp
mov    %rsi,%r14
mov    %rdi,%rbx
movsd  %xmm3,0x8(%rsp)
xorpd  %xmm3,%xmm3
ucomisd %xmm3,%xmm0
jne    1185 <newgp+0x65>
jp     1185 <newgp+0x65>
movsd  0xeb9(%rip),%xmm5
addsd  %xmm0,%xmm5
movsd  0xeb5(%rip),%xmm4
cmpeqsd %xmm2,%xmm4
movapd %xmm4,%xmm3
andpd  %xmm5,%xmm3
andnpd %xmm0,%xmm4
orpd   %xmm3,%xmm4
movsd  0xea0(%rip),%xmm0
cmpeqsd %xmm2,%xmm0
movapd %xmm0,%xmm3
andnpd %xmm4,%xmm3
andpd  %xmm5,%xmm0
orpd   %xmm3,%xmm0
movsd  0xe8b(%rip),%xmm3
mulsd  %xmm3,%xmm0
movapd %xmm0,0x20(%rsp)
mulsd  %xmm3,%xmm1
movsd  %xmm1,(%rsp)
movapd %xmm2,%xmm0
call   1040 <azNtoS@plt>
movapd %xmm0,%xmm2
mulsd  0xe63(%rip),%xmm2
lea    0x18(%rsp),%rdi
lea    0x10(%rsp),%rsi
movaps 0x20(%rsp),%xmm0
movsd  (%rsp),%xmm1
movsd  0x8(%rsp),%xmm3
call   1030 <direct@plt>
movsd  0x18(%rsp),%xmm0
movsd  0xe36(%rip),%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,(%rbx)
movsd  0x10(%rsp),%xmm0
divsd  %xmm1,%xmm0
movsd  %xmm0,(%r14)
add    $0x38,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define void @newgp(double %0, double %1, double %2, double %3, double* %4, double* %5) {
%7 = alloca double
%8 = alloca double
%9 = alloca double
%10 = alloca double
%11 = alloca double*
%12 = alloca double*
%13 = alloca double
%14 = alloca double
store double %0, double* %7
store double %1, double* %8
store double %2, double* %9
store double %3, double* %10
store double* %4, double** %11
store double* %5, double** %12
%15 = load double, double* %7
%16 = fcmp oeq double %15, 0.000000e+00
br i1 %16, label %17, label %26
17: ; preds = %6
%18 = load double, double* %9
%19 = fcmp oeq double %18, 9.000000e+01
br i1 %19, label %23, label %20
20: ; preds = %17
%21 = load double, double* %9
%22 = fcmp oeq double %21, 2.700000e+02
br i1 %22, label %23, label %26
23: ; preds = %20, %17
%24 = load double, double* %7
%25 = fadd double %24, 1.000000e-37
store double %25, double* %7
br label %26
26: ; preds = %23, %20, %6
%27 = load double, double* %7
%28 = fmul double 3.600000e+03, %27
%29 = load double, double* %8
%30 = fmul double 3.600000e+03, %29
%31 = load double, double* %9
%32 = call double @azNtoS(double %31)
%33 = fmul double 3.600000e+03, %32
%34 = load double, double* %10
%35 = load double, double* %13
%36 = fdiv double %35, 3.600000e+03
%37 = load double*, double** %11
store double %36, double* %37
%38 = load double, double* %14
%39 = fdiv double %38, 3.600000e+03
%40 = load double*, double** %12
store double %39, double* %40
ret void
}

LLVM IR (-O2):
define void @newgp(double %0, double %1, double %2, double %3, double* nocapture writeonly %4, double* nocapture writeonly %5) {
%7 = alloca double
%8 = alloca double
%9 = bitcast double* %7 to i8*
%10 = bitcast double* %8 to i8*
%11 = fcmp oeq double %0, 0.000000e+00
br i1 %11, label %12, label %18
12: ; preds = %6
%13 = fcmp oeq double %2, 9.000000e+01
%14 = fcmp oeq double %2, 2.700000e+02
%15 = or i1 %13, %14
%16 = fadd double %0, 1.000000e-37
%17 = select i1 %15, double %16, double %0
br label %18
18: ; preds = %12, %6
%19 = phi double [ %0, %6 ], [ %17, %12 ]
%20 = fmul double %19, 3.600000e+03
%21 = fmul double %1, 3.600000e+03
%22 = tail call double @azNtoS(double %2)
%23 = fmul double %22, 3.600000e+03
%24 = load double, double* %7
%25 = fdiv double %24, 3.600000e+03
store double %25, double* %4
%26 = load double, double* %8
%27 = fdiv double %26, 3.600000e+03
store double %27, double* %5
ret void
}