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


x86 assembly (clang, -O0):
<stony2hpl>:
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  0xe9a(%rip),%xmm1
ucomisd %xmm1,%xmm0
jne    117b <stony2hpl+0x4b>
jp     117b <stony2hpl+0x4b>
jmp    1198 <stony2hpl+0x68>
movsd  -0x10(%rbp),%xmm0
movsd  0xe78(%rip),%xmm1
ucomisd %xmm1,%xmm0
jne    11bd <stony2hpl+0x8d>
jp     11bd <stony2hpl+0x8d>
mov    -0x30(%rbp),%rax
movsd  0xe64(%rip),%xmm0
movsd  %xmm0,(%rax)
mov    -0x38(%rbp),%rax
movsd  0xe54(%rip),%xmm0
movsd  %xmm0,(%rax)
jmp    121a <stony2hpl+0xea>
movsd  -0x8(%rbp),%xmm0
movsd  -0x10(%rbp),%xmm1
movsd  -0x20(%rbp),%xmm2
movsd  -0x28(%rbp),%xmm3
lea    -0x50(%rbp),%rdi
lea    -0x58(%rbp),%rsi
lea    -0x60(%rbp),%rdx
call   1030 <stony2hcc@plt>
movsd  -0x50(%rbp),%xmm0
movsd  -0x58(%rbp),%xmm1
movsd  -0x60(%rbp),%xmm2
movsd  -0x18(%rbp),%xmm3
lea    -0x40(%rbp),%rdi
lea    -0x48(%rbp),%rsi
call   1040 <hcc2hpc@plt>
movsd  -0x40(%rbp),%xmm0
movsd  -0x48(%rbp),%xmm1
mov    -0x30(%rbp),%rdi
mov    -0x38(%rbp),%rsi
call   1050 <hpc2hpl@plt>
add    $0x60,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<stony2hpl>:
push   %r14
push   %rbx
sub    $0x38,%rsp
mov    %rsi,%r14
mov    %rdi,%rbx
ucomisd 0xebb(%rip),%xmm0
jne    1149 <stony2hpl+0x19>
jnp    11b5 <stony2hpl+0x85>
ucomisd 0xeaf(%rip),%xmm1
jne    1155 <stony2hpl+0x25>
jnp    11b5 <stony2hpl+0x85>
lea    0x20(%rsp),%rdi
lea    0x18(%rsp),%rsi
lea    0x10(%rsp),%rdx
movsd  %xmm2,0x8(%rsp)
movaps %xmm3,%xmm2
movaps %xmm4,%xmm3
call   1030 <stony2hcc@plt>
movsd  0x20(%rsp),%xmm0
movsd  0x18(%rsp),%xmm1
movsd  0x10(%rsp),%xmm2
lea    0x30(%rsp),%rdi
lea    0x28(%rsp),%rsi
movsd  0x8(%rsp),%xmm3
call   1040 <hcc2hpc@plt>
movsd  0x30(%rsp),%xmm0
movsd  0x28(%rsp),%xmm1
mov    %rbx,%rdi
mov    %r14,%rsi
call   1050 <hpc2hpl@plt>
jmp    11c5 <stony2hpl+0x95>
movabs $0xc0c3880000000000,%rax
88 c3 c0
mov    %rax,(%rbx)
mov    %rax,(%r14)
add    $0x38,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define void @stony2hpl(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 = fcmp oeq double %0, -1.000000e+03
%19 = fcmp oeq double %1, -1.000000e+03
%20 = or i1 %18, %19
br i1 %20, label %21, label %22
21: ; preds = %7
store double -1.000000e+04, double* %5
store double -1.000000e+04, double* %6
br label %31
22: ; preds = %7
%23 = call i32 @stony2hcc(double %0, double %1, double %3, double %4, double* %10, double* %11, double* %12)
%24 = load double, double* %10
%25 = load double, double* %11
%26 = load double, double* %12
%27 = call i32 @hcc2hpc(double %24, double %25, double %26, double %2, double* %8, double* %9)
%28 = load double, double* %8
%29 = load double, double* %9
%30 = call i32 @hpc2hpl(double %28, double %29, double* %5, double* %6)
br label %31
31: ; preds = %22, %21
ret void
}