#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 atan(double);
float cos(double);
float sin(double);
double sqrt(double);
double tan(float);
void set_ne(float *elon, float *elat, float *slon, float *slat, float *sn,
            float *se) {
  float kperd_n, kperd_e;
  double e2, den, g2, lat0;
  float cosA, sinA;
  double rperd = 0.017453293;
  double radius = 6378.139;
  double f = 298.256;
  f = 1.0 / f;
  e2 = 2.0 * f - f * f;
  g2 = e2 / ((1.0 - f) * (1.0 - f));
  lat0 = atan((1.0 - f) * tan((*elat) * rperd));
  cosA = cos(lat0);
  sinA = sin(lat0);
  den = sqrt(1.0 / (1.0 + g2 * sinA * sinA));
  kperd_e = rperd * radius * cosA * den;
  kperd_n = rperd * radius * (sqrt(1.0 + g2 * sinA * sinA * (2.0 + g2))) * den *
            den * den;
  *sn = ((*slat) - (*elat)) * kperd_n;
  *se = ((*slon) - (*elon)) * kperd_e;
}


x86 assembly (clang, -O0):
<set_ne>:
push   %rbp
mov    %rsp,%rbp
sub    $0x90,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
mov    %r9,-0x30(%rbp)
movsd  0xea5(%rip),%xmm0
movsd  %xmm0,-0x68(%rbp)
movsd  0xe90(%rip),%xmm0
movsd  %xmm0,-0x70(%rbp)
movsd  0xe7b(%rip),%xmm0
movsd  %xmm0,-0x78(%rbp)
movsd  0xe5e(%rip),%xmm0
divsd  -0x78(%rbp),%xmm0
movsd  %xmm0,-0x78(%rbp)
movsd  -0x78(%rbp),%xmm0
movsd  -0x78(%rbp),%xmm1
mulsd  -0x78(%rbp),%xmm1
movq   %xmm1,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm1
addsd  %xmm0,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x40(%rbp)
movsd  -0x40(%rbp),%xmm0
movsd  0xe14(%rip),%xmm1
subsd  -0x78(%rbp),%xmm1
movsd  0xe07(%rip),%xmm2
subsd  -0x78(%rbp),%xmm2
mulsd  %xmm2,%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x50(%rbp)
movsd  0xded(%rip),%xmm0
subsd  -0x78(%rbp),%xmm0
movsd  %xmm0,-0x88(%rbp)
ff
mov    -0x10(%rbp),%rax
movss  (%rax),%xmm0
cvtss2sd %xmm0,%xmm0
mulsd  -0x68(%rbp),%xmm0
cvtsd2ss %xmm0,%xmm0
call   1050 <tan@plt>
movaps %xmm0,%xmm1
movsd  -0x88(%rbp),%xmm0
ff
mulsd  %xmm1,%xmm0
call   1040 <atan@plt>
movsd  %xmm0,-0x58(%rbp)
movsd  -0x58(%rbp),%xmm0
call   1060 <cos@plt>
movss  %xmm0,-0x5c(%rbp)
movsd  -0x58(%rbp),%xmm0
call   1030 <sin@plt>
movss  %xmm0,-0x60(%rbp)
movsd  -0x50(%rbp),%xmm1
movss  -0x60(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
mulsd  %xmm0,%xmm1
movss  -0x60(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
mulsd  %xmm0,%xmm1
movsd  0xd68(%rip),%xmm0
addsd  %xmm0,%xmm1
movsd  0xd5c(%rip),%xmm0
divsd  %xmm1,%xmm0
call   1070 <sqrt@plt>
movsd  %xmm0,-0x48(%rbp)
movsd  -0x68(%rbp),%xmm0
mulsd  -0x70(%rbp),%xmm0
movss  -0x5c(%rbp),%xmm1
cvtss2sd %xmm1,%xmm1
mulsd  %xmm1,%xmm0
mulsd  -0x48(%rbp),%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,-0x38(%rbp)
movsd  -0x68(%rbp),%xmm0
mulsd  -0x70(%rbp),%xmm0
movsd  %xmm0,-0x80(%rbp)
movsd  -0x50(%rbp),%xmm0
movss  -0x60(%rbp),%xmm1
cvtss2sd %xmm1,%xmm1
mulsd  %xmm1,%xmm0
movss  -0x60(%rbp),%xmm1
cvtss2sd %xmm1,%xmm1
mulsd  %xmm1,%xmm0
movsd  0xcfb(%rip),%xmm1
addsd  -0x50(%rbp),%xmm1
mulsd  %xmm1,%xmm0
movsd  0xce2(%rip),%xmm1
addsd  %xmm1,%xmm0
call   1070 <sqrt@plt>
movaps %xmm0,%xmm1
movsd  -0x80(%rbp),%xmm0
mulsd  %xmm1,%xmm0
mulsd  -0x48(%rbp),%xmm0
mulsd  -0x48(%rbp),%xmm0
mulsd  -0x48(%rbp),%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,-0x34(%rbp)
mov    -0x20(%rbp),%rax
movss  (%rax),%xmm0
mov    -0x10(%rbp),%rax
subss  (%rax),%xmm0
mulss  -0x34(%rbp),%xmm0
mov    -0x28(%rbp),%rax
movss  %xmm0,(%rax)
mov    -0x18(%rbp),%rax
movss  (%rax),%xmm0
mov    -0x8(%rbp),%rax
subss  (%rax),%xmm0
mulss  -0x38(%rbp),%xmm0
mov    -0x30(%rbp),%rax
movss  %xmm0,(%rax)
add    $0x90,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<set_ne>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x18,%rsp
mov    %r9,%r14
mov    %r8,%r15
mov    %rcx,%rbp
mov    %rdx,%r12
mov    %rsi,%rbx
mov    %rdi,%r13
movss  (%rsi),%xmm0
cvtss2sd %xmm0,%xmm0
mulsd  0xe80(%rip),%xmm0
cvtsd2ss %xmm0,%xmm0
call   1050 <tan@plt>
mulsd  0xe77(%rip),%xmm0
call   1040 <atan@plt>
movsd  %xmm0,0x8(%rsp)
call   1060 <cos@plt>
movss  %xmm0,0x10(%rsp)
movsd  0x8(%rsp),%xmm0
call   1030 <sin@plt>
cvtss2sd %xmm0,%xmm0
movsd  0xe52(%rip),%xmm2
mulsd  %xmm0,%xmm2
mulsd  %xmm0,%xmm2
movsd  0xe4a(%rip),%xmm0
movapd %xmm2,%xmm1
addsd  %xmm0,%xmm1
divsd  %xmm1,%xmm0
xorpd  %xmm4,%xmm4
ucomisd %xmm4,%xmm0
jb     11ed <set_ne+0x9d>
xorps  %xmm1,%xmm1
sqrtsd %xmm0,%xmm1
jmp    1206 <set_ne+0xb6>
movsd  %xmm2,0x8(%rsp)
call   1070 <sqrt@plt>
xorpd  %xmm4,%xmm4
movsd  0x8(%rsp),%xmm2
movapd %xmm0,%xmm1
movss  0x10(%rsp),%xmm0
cvtss2sd %xmm0,%xmm0
mulsd  0xe08(%rip),%xmm0
mulsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm3
mulsd  0xe00(%rip),%xmm2
addsd  0xde8(%rip),%xmm2
ucomisd %xmm4,%xmm2
jb     123f <set_ne+0xef>
xorps  %xmm0,%xmm0
sqrtsd %xmm2,%xmm0
jmp    1260 <set_ne+0x110>
movapd %xmm2,%xmm0
movsd  %xmm1,0x10(%rsp)
movss  %xmm3,0x8(%rsp)
call   1070 <sqrt@plt>
movss  0x8(%rsp),%xmm3
movsd  0x10(%rsp),%xmm1
mulsd  0xdb8(%rip),%xmm0
mulsd  %xmm1,%xmm0
mulsd  %xmm1,%xmm0
mulsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
movss  0x0(%rbp),%xmm1
subss  (%rbx),%xmm1
mulss  %xmm0,%xmm1
movss  %xmm1,(%r15)
movss  (%r12),%xmm0
subss  0x0(%r13),%xmm0
mulss  %xmm3,%xmm0
movss  %xmm0,(%r14)
add    $0x18,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
define void @set_ne(float* %0, float* %1, float* %2, float* %3, float* %4, float* %5) {
%7 = alloca float*
%8 = alloca float*
%9 = alloca float*
%10 = alloca float*
%11 = alloca float*
%12 = alloca float*
%13 = alloca float
%14 = alloca float
%15 = alloca double
%16 = alloca double
%17 = alloca double
%18 = alloca double
%19 = alloca float
%20 = alloca float
%21 = alloca double
%22 = alloca double
%23 = alloca double
store float* %0, float** %7
store float* %1, float** %8
store float* %2, float** %9
store float* %3, float** %10
store float* %4, float** %11
store float* %5, float** %12
store double 0x3F91DF46AA91ED06, double* %21
store double 0x40B8EA2395810625, double* %22
store double 2.982560e+02, double* %23
%24 = load double, double* %23
%25 = fdiv double 1.000000e+00, %24
store double %25, double* %23
%26 = load double, double* %23
%27 = load double, double* %23
%28 = load double, double* %23
%29 = fmul double %27, %28
%30 = fneg double %29
%31 = call double @llvm.fmuladd.f64(double 2.000000e+00, double %26, double %30)
store double %31, double* %15
%32 = load double, double* %15
%33 = load double, double* %23
%34 = fsub double 1.000000e+00, %33
%35 = load double, double* %23
%36 = fsub double 1.000000e+00, %35
%37 = fmul double %34, %36
%38 = fdiv double %32, %37
store double %38, double* %17
%39 = load double, double* %23
%40 = fsub double 1.000000e+00, %39
%41 = load float*, float** %8
%42 = load float, float* %41
%43 = fpext float %42 to double
%44 = load double, double* %21
%45 = fmul double %43, %44
%46 = fptrunc double %45 to float
%47 = call double @tan(float %46)
%48 = fmul double %40, %47
%49 = call double @atan(double %48)
store double %49, double* %18
%50 = load double, double* %18
%51 = call float @cos(double %50)
store float %51, float* %19
%52 = load double, double* %18
%53 = call float @sin(double %52)
store float %53, float* %20
%54 = load double, double* %17
%55 = load float, float* %20
%56 = fpext float %55 to double
%57 = fmul double %54, %56
%58 = load float, float* %20
%59 = fpext float %58 to double
%60 = call double @llvm.fmuladd.f64(double %57, double %59, double 1.000000e+00)
%61 = fdiv double 1.000000e+00, %60
%62 = call double @sqrt(double %61)
store double %62, double* %16
%63 = load double, double* %21
%64 = load double, double* %22
%65 = fmul double %63, %64
%66 = load float, float* %19
%67 = fpext float %66 to double
%68 = fmul double %65, %67
%69 = load double, double* %16
%70 = fmul double %68, %69
%71 = fptrunc double %70 to float
store float %71, float* %14
%72 = load double, double* %21
%73 = load double, double* %22
%74 = fmul double %72, %73
%75 = load double, double* %17
%76 = load float, float* %20
%77 = fpext float %76 to double
%78 = fmul double %75, %77
%79 = load float, float* %20
%80 = fpext float %79 to double
%81 = fmul double %78, %80
%82 = load double, double* %17
%83 = fadd double 2.000000e+00, %82
%84 = call double @llvm.fmuladd.f64(double %81, double %83, double 1.000000e+00)
%85 = call double @sqrt(double %84)
%86 = fmul double %74, %85
%87 = load double, double* %16
%88 = fmul double %86, %87
%89 = load double, double* %16
%90 = fmul double %88, %89
%91 = load double, double* %16
%92 = fmul double %90, %91
%93 = fptrunc double %92 to float
store float %93, float* %13
%94 = load float*, float** %10
%95 = load float, float* %94
%96 = load float*, float** %8
%97 = load float, float* %96
%98 = fsub float %95, %97
%99 = load float, float* %13
%100 = fmul float %98, %99
%101 = load float*, float** %11
store float %100, float* %101
%102 = load float*, float** %9
%103 = load float, float* %102
%104 = load float*, float** %7
%105 = load float, float* %104
%106 = fsub float %103, %105
%107 = load float, float* %14
%108 = fmul float %106, %107
%109 = load float*, float** %12
store float %108, float* %109
ret void
}

LLVM IR (-O2):
define void @set_ne(float* nocapture %0, float* nocapture %1, float* nocapture %2, float* nocapture %3, float* nocapture writeonly %4, float* nocapture writeonly %5) {
%7 = load float, float* %1
%8 = fpext float %7 to double
%9 = fmul double %8, 0x3F91DF46AA91ED06
%10 = fptrunc double %9 to float
%11 = tail call double @tan(float %10)
%12 = fmul double %11, 0x3FEFE4889E18A326
%13 = tail call double @atan(double %12)
%14 = tail call float @cos(double %13)
%15 = tail call float @sin(double %13)
%16 = fpext float %15 to double
%17 = fmul double %16, 0x3F7B9AE75725652C
%18 = tail call double @llvm.fmuladd.f64(double %17, double %16, double 1.000000e+00)
%19 = fdiv double 1.000000e+00, %18
%20 = tail call double @sqrt(double %19)
%21 = fpext float %14 to double
%22 = fmul double %21, 0x405BD47328C36FEE
%23 = fmul double %22, %20
%24 = fptrunc double %23 to float
%25 = fmul double %17, %16
%26 = tail call double @llvm.fmuladd.f64(double %25, double 0x40000DCD73AB92B3, double 1.000000e+00)
%27 = tail call double @sqrt(double %26)
%28 = fmul double %27, 0x405BD47328C36FEE
%29 = fmul double %20, %28
%30 = fmul double %20, %29
%31 = fmul double %20, %30
%32 = fptrunc double %31 to float
%33 = load float, float* %3
%34 = load float, float* %1
%35 = fsub float %33, %34
%36 = fmul float %35, %32
store float %36, float* %4
%37 = load float, float* %2
%38 = load float, float* %0
%39 = fsub float %37, %38
%40 = fmul float %39, %24
store float %40, float* %5
ret void
}