#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*/ DirectVincenty(double, double, double, double, double *,
                                  double *, double, double);
double atan(double);
void NCL_GetArrow_Coords(double ArrowCoords[4][2], double lat, double lon,
                         double length, double azimuth, double ArrowTipAngle,
                         double ArrowTipScale, double a, double f) {
  double d2r = atan(1.0) / 45.0;
  double r2d = 45.0 / atan(1.0);
  double tmpLat;
  double tmpLon;
  if (ArrowTipAngle == 0.0)
    ArrowTipAngle = 30.0;
  if (ArrowTipScale == 0.0)
    ArrowTipScale = 0.25;
  ArrowCoords[0][0] = lat;
  ArrowCoords[0][1] = lon;
  DirectVincenty(lat * d2r, lon * d2r, azimuth * d2r, length, &tmpLat, &tmpLon,
                 a, f);
  ArrowCoords[1][0] = tmpLat * r2d;
  ArrowCoords[1][1] = tmpLon * r2d;
  DirectVincenty(ArrowCoords[1][0] * d2r, ArrowCoords[1][1] * d2r,
                 (azimuth + 180 - ArrowTipAngle) * d2r, length * ArrowTipScale,
                 &tmpLat, &tmpLon, a, f);
  ArrowCoords[2][0] = tmpLat * r2d;
  ArrowCoords[2][1] = tmpLon * r2d;
  DirectVincenty(ArrowCoords[1][0] * d2r, ArrowCoords[1][1] * d2r,
                 (azimuth - 180 + ArrowTipAngle) * d2r, length * ArrowTipScale,
                 &tmpLat, &tmpLon, a, f);
  ArrowCoords[3][0] = tmpLat * r2d;
  ArrowCoords[3][1] = tmpLon * r2d;
}


x86 assembly (clang, -O0):
<NCL_GetArrow_Coords>:
push   %rbp
mov    %rsp,%rbp
sub    $0x70,%rsp
mov    %rdi,-0x8(%rbp)
movsd  %xmm0,-0x10(%rbp)
movsd  %xmm1,-0x18(%rbp)
movsd  %xmm2,-0x20(%rbp)
movsd  %xmm3,-0x28(%rbp)
movsd  %xmm4,-0x30(%rbp)
movsd  %xmm5,-0x38(%rbp)
movsd  %xmm6,-0x40(%rbp)
movsd  %xmm7,-0x48(%rbp)
movsd  0xeac(%rip),%xmm0
call   1030 <atan@plt>
movsd  0xe97(%rip),%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x50(%rbp)
movsd  0xe8e(%rip),%xmm0
call   1030 <atan@plt>
movaps %xmm0,%xmm1
movsd  0xe76(%rip),%xmm0
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x58(%rbp)
movsd  -0x30(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jne    11b8 <NCL_GetArrow_Coords+0x98>
jp     11b8 <NCL_GetArrow_Coords+0x98>
movsd  0xe5d(%rip),%xmm0
movsd  %xmm0,-0x30(%rbp)
movsd  -0x38(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jne    11dd <NCL_GetArrow_Coords+0xbd>
jp     11dd <NCL_GetArrow_Coords+0xbd>
movsd  0xe40(%rip),%xmm0
movsd  %xmm0,-0x38(%rbp)
movsd  -0x10(%rbp),%xmm0
mov    -0x8(%rbp),%rax
movsd  %xmm0,(%rax)
movsd  -0x18(%rbp),%xmm0
mov    -0x8(%rbp),%rax
movsd  %xmm0,0x8(%rax)
movsd  -0x10(%rbp),%xmm0
mulsd  -0x50(%rbp),%xmm0
movsd  -0x18(%rbp),%xmm1
mulsd  -0x50(%rbp),%xmm1
movsd  -0x28(%rbp),%xmm2
mulsd  -0x50(%rbp),%xmm2
movsd  -0x20(%rbp),%xmm3
movsd  -0x40(%rbp),%xmm4
movsd  -0x48(%rbp),%xmm5
lea    -0x60(%rbp),%rdi
lea    -0x68(%rbp),%rsi
call   1040 <DirectVincenty@plt>
movsd  -0x60(%rbp),%xmm0
mulsd  -0x58(%rbp),%xmm0
mov    -0x8(%rbp),%rax
movsd  %xmm0,0x10(%rax)
movsd  -0x68(%rbp),%xmm0
mulsd  -0x58(%rbp),%xmm0
mov    -0x8(%rbp),%rax
movsd  %xmm0,0x18(%rax)
mov    -0x8(%rbp),%rax
movsd  0x10(%rax),%xmm0
mulsd  -0x50(%rbp),%xmm0
mov    -0x8(%rbp),%rax
movsd  0x18(%rax),%xmm1
mulsd  -0x50(%rbp),%xmm1
movsd  0xda4(%rip),%xmm2
addsd  -0x28(%rbp),%xmm2
subsd  -0x30(%rbp),%xmm2
mulsd  -0x50(%rbp),%xmm2
movsd  -0x20(%rbp),%xmm3
mulsd  -0x38(%rbp),%xmm3
movsd  -0x40(%rbp),%xmm4
movsd  -0x48(%rbp),%xmm5
lea    -0x60(%rbp),%rdi
lea    -0x68(%rbp),%rsi
call   1040 <DirectVincenty@plt>
movsd  -0x60(%rbp),%xmm0
mulsd  -0x58(%rbp),%xmm0
mov    -0x8(%rbp),%rax
movsd  %xmm0,0x20(%rax)
movsd  -0x68(%rbp),%xmm0
mulsd  -0x58(%rbp),%xmm0
mov    -0x8(%rbp),%rax
movsd  %xmm0,0x28(%rax)
mov    -0x8(%rbp),%rax
movsd  0x10(%rax),%xmm0
mulsd  -0x50(%rbp),%xmm0
mov    -0x8(%rbp),%rax
movsd  0x18(%rax),%xmm1
mulsd  -0x50(%rbp),%xmm1
movsd  -0x28(%rbp),%xmm2
movsd  0xd25(%rip),%xmm3
subsd  %xmm3,%xmm2
addsd  -0x30(%rbp),%xmm2
mulsd  -0x50(%rbp),%xmm2
movsd  -0x20(%rbp),%xmm3
mulsd  -0x38(%rbp),%xmm3
movsd  -0x40(%rbp),%xmm4
movsd  -0x48(%rbp),%xmm5
lea    -0x60(%rbp),%rdi
lea    -0x68(%rbp),%rsi
call   1040 <DirectVincenty@plt>
movsd  -0x60(%rbp),%xmm0
mulsd  -0x58(%rbp),%xmm0
mov    -0x8(%rbp),%rax
movsd  %xmm0,0x30(%rax)
movsd  -0x68(%rbp),%xmm0
mulsd  -0x58(%rbp),%xmm0
mov    -0x8(%rbp),%rax
movsd  %xmm0,0x38(%rax)
add    $0x70,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<NCL_GetArrow_Coords>:
push   %r15
push   %r14
push   %rbx
sub    $0x70,%rsp
movsd  %xmm7,0x18(%rsp)
movsd  %xmm6,0x10(%rsp)
movaps %xmm5,0x30(%rsp)
movaps %xmm4,0x50(%rsp)
movsd  %xmm3,0x8(%rsp)
movsd  %xmm2,0x48(%rsp)
movsd  %xmm1,0x68(%rsp)
movsd  %xmm0,0x60(%rsp)
mov    %rdi,%rbx
movsd  0xe9e(%rip),%xmm0
call   1030 <atan@plt>
movsd  0xe91(%rip),%xmm0
call   1030 <atan@plt>
xorpd  %xmm1,%xmm1
movapd 0x50(%rsp),%xmm3
movapd %xmm3,%xmm2
cmpeqsd %xmm1,%xmm2
movsd  0xe79(%rip),%xmm0
andpd  %xmm2,%xmm0
andnpd %xmm3,%xmm2
orpd   %xmm0,%xmm2
movapd %xmm2,0x50(%rsp)
movapd 0x30(%rsp),%xmm2
cmpeqsd %xmm2,%xmm1
movsd  0xe5c(%rip),%xmm0
andpd  %xmm1,%xmm0
andnpd %xmm2,%xmm1
orpd   %xmm0,%xmm1
movapd %xmm1,0x30(%rsp)
movsd  0x60(%rsp),%xmm0
movsd  %xmm0,(%rbx)
movsd  0x68(%rsp),%xmm1
movsd  %xmm1,0x8(%rbx)
movsd  0xe35(%rip),%xmm3
mulsd  %xmm3,%xmm0
mulsd  %xmm3,%xmm1
movsd  0x8(%rsp),%xmm2
mulsd  %xmm3,%xmm2
lea    0x28(%rsp),%r14
lea    0x20(%rsp),%r15
movsd  0x48(%rsp),%xmm3
mov    %r14,%rdi
mov    %r15,%rsi
movsd  0x10(%rsp),%xmm4
movsd  0x18(%rsp),%xmm5
call   1040 <DirectVincenty@plt>
movsd  0x28(%rsp),%xmm1
movhpd 0x20(%rsp),%xmm1
mulpd  0xe00(%rip),%xmm1
movupd %xmm1,0x10(%rbx)
movapd %xmm1,%xmm0
movsd  0xdd7(%rip),%xmm3
mulsd  %xmm3,%xmm0
unpckhpd %xmm1,%xmm1
mulsd  %xmm3,%xmm1
movsd  0xdcb(%rip),%xmm2
addsd  0x8(%rsp),%xmm2
subsd  0x50(%rsp),%xmm2
mulsd  %xmm3,%xmm2
movapd 0x30(%rsp),%xmm3
mulsd  0x48(%rsp),%xmm3
movapd %xmm3,0x30(%rsp)
mov    %r14,%rdi
mov    %r15,%rsi
movsd  0x10(%rsp),%xmm4
movsd  0x18(%rsp),%xmm5
call   1040 <DirectVincenty@plt>
movsd  0x28(%rsp),%xmm0
movhpd 0x20(%rsp),%xmm0
mulpd  0xd8e(%rip),%xmm0
movupd %xmm0,0x20(%rbx)
movsd  0x10(%rbx),%xmm0
movsd  0xd64(%rip),%xmm2
mulsd  %xmm2,%xmm0
movsd  0x18(%rbx),%xmm1
mulsd  %xmm2,%xmm1
movapd %xmm2,%xmm3
movsd  0x8(%rsp),%xmm2
addsd  0xd55(%rip),%xmm2
addsd  0x50(%rsp),%xmm2
mulsd  %xmm3,%xmm2
movaps 0x30(%rsp),%xmm3
mov    %r14,%rdi
mov    %r15,%rsi
movsd  0x10(%rsp),%xmm4
movsd  0x18(%rsp),%xmm5
call   1040 <DirectVincenty@plt>
movsd  0x28(%rsp),%xmm0
movhpd 0x20(%rsp),%xmm0
mulpd  0xd23(%rip),%xmm0
movupd %xmm0,0x30(%rbx)
add    $0x70,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define void @NCL_GetArrow_Coords([2 x double]* %0, double %1, double %2, double %3, double %4, double %5, double %6, double %7, double %8) {
%10 = alloca [2 x 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
%20 = alloca double
%21 = alloca double
%22 = alloca double
store [2 x double]* %0, [2 x double]** %10
store double %1, double* %11
store double %2, double* %12
store double %3, double* %13
store double %4, double* %14
store double %5, double* %15
store double %6, double* %16
store double %7, double* %17
store double %8, double* %18
%23 = call double @atan(double 1.000000e+00)
%24 = fdiv double %23, 4.500000e+01
store double %24, double* %19
%25 = call double @atan(double 1.000000e+00)
%26 = fdiv double 4.500000e+01, %25
store double %26, double* %20
%27 = load double, double* %15
%28 = fcmp oeq double %27, 0.000000e+00
br i1 %28, label %29, label %30
29: ; preds = %9
store double 3.000000e+01, double* %15
br label %30
30: ; preds = %29, %9
%31 = load double, double* %16
%32 = fcmp oeq double %31, 0.000000e+00
br i1 %32, label %33, label %34
33: ; preds = %30
store double 2.500000e-01, double* %16
br label %34
34: ; preds = %33, %30
%35 = load double, double* %11
%36 = load [2 x double]*, [2 x double]** %10
%37 = getelementptr inbounds [2 x double], [2 x double]* %36, i64 0
%38 = getelementptr inbounds [2 x double], [2 x double]* %37, i64 0, i64 0
store double %35, double* %38
%39 = load double, double* %12
%40 = load [2 x double]*, [2 x double]** %10
%41 = getelementptr inbounds [2 x double], [2 x double]* %40, i64 0
%42 = getelementptr inbounds [2 x double], [2 x double]* %41, i64 0, i64 1
store double %39, double* %42
%43 = load double, double* %11
%44 = load double, double* %19
%45 = fmul double %43, %44
%46 = load double, double* %12
%47 = load double, double* %19
%48 = fmul double %46, %47
%49 = load double, double* %14
%50 = load double, double* %19
%51 = fmul double %49, %50
%52 = load double, double* %13
%53 = load double, double* %17
%54 = load double, double* %18
%55 = call i32 @DirectVincenty(double %45, double %48, double %51, double %52, double* %21, double* %22, double %53, double %54)
%56 = load double, double* %21
%57 = load double, double* %20
%58 = fmul double %56, %57
%59 = load [2 x double]*, [2 x double]** %10
%60 = getelementptr inbounds [2 x double], [2 x double]* %59, i64 1
%61 = getelementptr inbounds [2 x double], [2 x double]* %60, i64 0, i64 0
store double %58, double* %61
%62 = load double, double* %22
%63 = load double, double* %20
%64 = fmul double %62, %63
%65 = load [2 x double]*, [2 x double]** %10
%66 = getelementptr inbounds [2 x double], [2 x double]* %65, i64 1
%67 = getelementptr inbounds [2 x double], [2 x double]* %66, i64 0, i64 1
store double %64, double* %67
%68 = load [2 x double]*, [2 x double]** %10
%69 = getelementptr inbounds [2 x double], [2 x double]* %68, i64 1
%70 = getelementptr inbounds [2 x double], [2 x double]* %69, i64 0, i64 0
%71 = load double, double* %70
%72 = load double, double* %19
%73 = fmul double %71, %72
%74 = load [2 x double]*, [2 x double]** %10
%75 = getelementptr inbounds [2 x double], [2 x double]* %74, i64 1
%76 = getelementptr inbounds [2 x double], [2 x double]* %75, i64 0, i64 1
%77 = load double, double* %76
%78 = load double, double* %19
%79 = fmul double %77, %78
%80 = load double, double* %14
%81 = fadd double %80, 1.800000e+02
%82 = load double, double* %15
%83 = fsub double %81, %82
%84 = load double, double* %19
%85 = fmul double %83, %84
%86 = load double, double* %13
%87 = load double, double* %16
%88 = fmul double %86, %87
%89 = load double, double* %17
%90 = load double, double* %18
%91 = call i32 @DirectVincenty(double %73, double %79, double %85, double %88, double* %21, double* %22, double %89, double %90)
%92 = load double, double* %21
%93 = load double, double* %20
%94 = fmul double %92, %93
%95 = load [2 x double]*, [2 x double]** %10
%96 = getelementptr inbounds [2 x double], [2 x double]* %95, i64 2
%97 = getelementptr inbounds [2 x double], [2 x double]* %96, i64 0, i64 0
store double %94, double* %97
%98 = load double, double* %22
%99 = load double, double* %20
%100 = fmul double %98, %99
%101 = load [2 x double]*, [2 x double]** %10
%102 = getelementptr inbounds [2 x double], [2 x double]* %101, i64 2
%103 = getelementptr inbounds [2 x double], [2 x double]* %102, i64 0, i64 1
store double %100, double* %103
%104 = load [2 x double]*, [2 x double]** %10
%105 = getelementptr inbounds [2 x double], [2 x double]* %104, i64 1
%106 = getelementptr inbounds [2 x double], [2 x double]* %105, i64 0, i64 0
%107 = load double, double* %106
%108 = load double, double* %19
%109 = fmul double %107, %108
%110 = load [2 x double]*, [2 x double]** %10
%111 = getelementptr inbounds [2 x double], [2 x double]* %110, i64 1
%112 = getelementptr inbounds [2 x double], [2 x double]* %111, i64 0, i64 1
%113 = load double, double* %112
%114 = load double, double* %19
%115 = fmul double %113, %114
%116 = load double, double* %14
%117 = fsub double %116, 1.800000e+02
%118 = load double, double* %15
%119 = fadd double %117, %118
%120 = load double, double* %19
%121 = fmul double %119, %120
%122 = load double, double* %13
%123 = load double, double* %16
%124 = fmul double %122, %123
%125 = load double, double* %17
%126 = load double, double* %18
%127 = call i32 @DirectVincenty(double %109, double %115, double %121, double %124, double* %21, double* %22, double %125, double %126)
%128 = load double, double* %21
%129 = load double, double* %20
%130 = fmul double %128, %129
%131 = load [2 x double]*, [2 x double]** %10
%132 = getelementptr inbounds [2 x double], [2 x double]* %131, i64 3
%133 = getelementptr inbounds [2 x double], [2 x double]* %132, i64 0, i64 0
store double %130, double* %133
%134 = load double, double* %22
%135 = load double, double* %20
%136 = fmul double %134, %135
%137 = load [2 x double]*, [2 x double]** %10
%138 = getelementptr inbounds [2 x double], [2 x double]* %137, i64 3
%139 = getelementptr inbounds [2 x double], [2 x double]* %138, i64 0, i64 1
store double %136, double* %139
ret void
}

LLVM IR (-O2):
define void @NCL_GetArrow_Coords([2 x double]* nocapture %0, double %1, double %2, double %3, double %4, double %5, double %6, double %7, double %8) {
%10 = alloca double
%11 = alloca double
%12 = tail call double @atan(double 1.000000e+00)
%13 = tail call double @atan(double 1.000000e+00)
%14 = bitcast double* %10 to i8*
%15 = bitcast double* %11 to i8*
%16 = fcmp oeq double %5, 0.000000e+00
%17 = select i1 %16, double 3.000000e+01, double %5
%18 = fcmp oeq double %6, 0.000000e+00
%19 = select i1 %18, double 2.500000e-01, double %6
%20 = getelementptr inbounds [2 x double], [2 x double]* %0, i64 0, i64 0
store double %1, double* %20
%21 = getelementptr inbounds [2 x double], [2 x double]* %0, i64 0, i64 1
store double %2, double* %21
%22 = fmul double %1, 0x3F91DF46A2529D39
%23 = fmul double %2, 0x3F91DF46A2529D39
%24 = fmul double %4, 0x3F91DF46A2529D39
%25 = call i32 @DirectVincenty(double %22, double %23, double %24, double %3, double* %10, double* %11, double %7, double %8)
%26 = load double, double* %10
%27 = getelementptr inbounds [2 x double], [2 x double]* %0, i64 1, i64 0
%28 = load double, double* %11
%29 = insertelement <2 x double> poison, double %26, i64 0
%30 = insertelement <2 x double> %29, double %28, i64 1
%31 = fmul <2 x double> %30, <double 0x404CA5DC1A63C1F8, double 0x404CA5DC1A63C1F8>
%32 = getelementptr inbounds [2 x double], [2 x double]* %0, i64 1, i64 1
%33 = bitcast double* %27 to <2 x double>*
store <2 x double> %31, <2 x double>* %33
%34 = extractelement <2 x double> %31, i64 0
%35 = fmul double %34, 0x3F91DF46A2529D39
%36 = extractelement <2 x double> %31, i64 1
%37 = fmul double %36, 0x3F91DF46A2529D39
%38 = fadd double %4, 1.800000e+02
%39 = fsub double %38, %17
%40 = fmul double %39, 0x3F91DF46A2529D39
%41 = fmul double %19, %3
%42 = call i32 @DirectVincenty(double %35, double %37, double %40, double %41, double* %10, double* %11, double %7, double %8)
%43 = load double, double* %10
%44 = getelementptr inbounds [2 x double], [2 x double]* %0, i64 2, i64 0
%45 = load double, double* %11
%46 = insertelement <2 x double> poison, double %43, i64 0
%47 = insertelement <2 x double> %46, double %45, i64 1
%48 = fmul <2 x double> %47, <double 0x404CA5DC1A63C1F8, double 0x404CA5DC1A63C1F8>
%49 = bitcast double* %44 to <2 x double>*
store <2 x double> %48, <2 x double>* %49
%50 = load double, double* %27
%51 = fmul double %50, 0x3F91DF46A2529D39
%52 = load double, double* %32
%53 = fmul double %52, 0x3F91DF46A2529D39
%54 = fadd double %4, -1.800000e+02
%55 = fadd double %54, %17
%56 = fmul double %55, 0x3F91DF46A2529D39
%57 = call i32 @DirectVincenty(double %51, double %53, double %56, double %41, double* %10, double* %11, double %7, double %8)
%58 = load double, double* %10
%59 = getelementptr inbounds [2 x double], [2 x double]* %0, i64 3, i64 0
%60 = load double, double* %11
%61 = insertelement <2 x double> poison, double %58, i64 0
%62 = insertelement <2 x double> %61, double %60, i64 1
%63 = fmul <2 x double> %62, <double 0x404CA5DC1A63C1F8, double 0x404CA5DC1A63C1F8>
%64 = bitcast double* %59 to <2 x double>*
store <2 x double> %63, <2 x double>* %64
ret void
}