#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*/ hcc2stony(double, double, double, double, double, double *,
                             double *);
int /*<<< orphan*/ hpc2hcc(double, double, double, double *, double *,
                           double *);
int /*<<< orphan*/ hpl2hpc(double, double, double *, double *);
void hpl2stony(double x, double y, double dsun_obs, double P0, double B0,
               double *lat, double *lon) {
  double tx, ty;
  double true_x, true_y, true_z;
  hpl2hpc(x, y, &tx, &ty);
  hpc2hcc(tx, ty, dsun_obs, &true_x, &true_y, &true_z);
  if ((true_x == -1000) || (true_y == -1000) || (true_z == -1000)) {
    *lat = *lon = -1000;
  } else {
    hcc2stony(true_x, true_y, true_z, P0, B0, lat, lon);
  }
  return;
}


x86 assembly (clang, -O0):
<hpl2stony>:
push   %rbp
mov    %rsp,%rbp
sub    $0x60,%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  -0x10(%rbp),%xmm1
lea    -0x40(%rbp),%rdi
lea    -0x48(%rbp),%rsi
call   1030 <hpl2hpc@plt>
movsd  -0x40(%rbp),%xmm0
movsd  -0x48(%rbp),%xmm1
movsd  -0x18(%rbp),%xmm2
lea    -0x50(%rbp),%rdi
lea    -0x58(%rbp),%rsi
lea    -0x60(%rbp),%rdx
call   1040 <hpc2hcc@plt>
movsd  -0x50(%rbp),%xmm0
movsd  0xe63(%rip),%xmm1
ucomisd %xmm1,%xmm0
jne    11b2 <hpl2stony+0x82>
jp     11b2 <hpl2stony+0x82>
jmp    11f1 <hpl2stony+0xc1>
movsd  -0x58(%rbp),%xmm0
movsd  0xe41(%rip),%xmm1
ucomisd %xmm1,%xmm0
jne    11d4 <hpl2stony+0xa4>
jp     11d4 <hpl2stony+0xa4>
jmp    11f1 <hpl2stony+0xc1>
movsd  -0x60(%rbp),%xmm0
movsd  0xe1f(%rip),%xmm1
ucomisd %xmm1,%xmm0
jne    1216 <hpl2stony+0xe6>
jp     1216 <hpl2stony+0xe6>
mov    -0x38(%rbp),%rax
movsd  0xe03(%rip),%xmm0
movsd  %xmm0,(%rax)
mov    -0x30(%rbp),%rax
movsd  0xdf3(%rip),%xmm0
movsd  %xmm0,(%rax)
jmp    123c <hpl2stony+0x10c>
movsd  -0x50(%rbp),%xmm0
movsd  -0x58(%rbp),%xmm1
movsd  -0x60(%rbp),%xmm2
movsd  -0x20(%rbp),%xmm3
movsd  -0x28(%rbp),%xmm4
mov    -0x30(%rbp),%rdi
mov    -0x38(%rbp),%rsi
call   1050 <hcc2stony@plt>
add    $0x60,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<hpl2stony>:
push   %r14
push   %rbx
sub    $0x48,%rsp
mov    %rsi,%r14
mov    %rdi,%rbx
movsd  %xmm4,0x10(%rsp)
movsd  %xmm3,0x8(%rsp)
movsd  %xmm2,0x18(%rsp)
lea    0x40(%rsp),%rdi
lea    0x38(%rsp),%rsi
call   1030 <hpl2hpc@plt>
movsd  0x40(%rsp),%xmm0
movsd  0x38(%rsp),%xmm1
lea    0x30(%rsp),%rdi
lea    0x28(%rsp),%rsi
lea    0x20(%rsp),%rdx
movsd  0x18(%rsp),%xmm2
call   1040 <hpc2hcc@plt>
movsd  0x30(%rsp),%xmm0
ucomisd 0xe6e(%rip),%xmm0
jne    1196 <hpl2stony+0x66>
jnp    11d3 <hpl2stony+0xa3>
movsd  0x28(%rsp),%xmm1
ucomisd 0xe5c(%rip),%xmm1
jne    11a8 <hpl2stony+0x78>
jnp    11d3 <hpl2stony+0xa3>
movsd  0x20(%rsp),%xmm2
ucomisd 0xe4a(%rip),%xmm2
jne    11ba <hpl2stony+0x8a>
jnp    11d3 <hpl2stony+0xa3>
movsd  0x8(%rsp),%xmm3
movsd  0x10(%rsp),%xmm4
mov    %rbx,%rdi
mov    %r14,%rsi
call   1050 <hcc2stony@plt>
jmp    11e3 <hpl2stony+0xb3>
movabs $0xc08f400000000000,%rax
40 8f c0
mov    %rax,(%r14)
mov    %rax,(%rbx)
add    $0x48,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define void @hpl2stony(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
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
%20 = load double, double* %8
%21 = load double, double* %9
%22 = call i32 @hpl2hpc(double %20, double %21, double* %15, double* %16)
%23 = load double, double* %15
%24 = load double, double* %16
%25 = load double, double* %10
%26 = call i32 @hpc2hcc(double %23, double %24, double %25, double* %17, double* %18, double* %19)
%27 = load double, double* %17
%28 = fcmp oeq double %27, -1.000000e+03
br i1 %28, label %35, label %29
29: ; preds = %7
%30 = load double, double* %18
%31 = fcmp oeq double %30, -1.000000e+03
br i1 %31, label %35, label %32
32: ; preds = %29
%33 = load double, double* %19
%34 = fcmp oeq double %33, -1.000000e+03
br i1 %34, label %35, label %38
35: ; preds = %32, %29, %7
%36 = load double*, double** %14
store double -1.000000e+03, double* %36
%37 = load double*, double** %13
store double -1.000000e+03, double* %37
br label %47
38: ; preds = %32
%39 = load double, double* %17
%40 = load double, double* %18
%41 = load double, double* %19
%42 = load double, double* %11
%43 = load double, double* %12
%44 = load double*, double** %13
%45 = load double*, double** %14
%46 = call i32 @hcc2stony(double %39, double %40, double %41, double %42, double %43, double* %44, double* %45)
br label %47
47: ; preds = %38, %35
ret void
}

LLVM IR (-O2):
define void @hpl2stony(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 = bitcast double* %8 to i8*
%14 = bitcast double* %9 to i8*
%15 = bitcast double* %10 to i8*
%16 = bitcast double* %11 to i8*
%17 = bitcast double* %12 to i8*
%18 = call i32 @hpl2hpc(double %0, double %1, double* %8, double* %9)
%19 = load double, double* %8
%20 = load double, double* %9
%21 = call i32 @hpc2hcc(double %19, double %20, double %2, double* %10, double* %11, double* %12)
%22 = load double, double* %10
%23 = fcmp oeq double %22, -1.000000e+03
%24 = load double, double* %11
%25 = fcmp oeq double %24, -1.000000e+03
%26 = select i1 %23, i1 true, i1 %25
%27 = load double, double* %12
%28 = fcmp oeq double %27, -1.000000e+03
%29 = select i1 %26, i1 true, i1 %28
br i1 %29, label %30, label %31
30: ; preds = %7
store double -1.000000e+03, double* %6
store double -1.000000e+03, double* %5
br label %33
31: ; preds = %7
%32 = call i32 @hcc2stony(double %22, double %24, double %27, double %3, double %4, double* %5, double* %6)
br label %33
33: ; preds = %31, %30
ret void
}