#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 slc_distance(double *, double *, double);
double slc_distance2(double lat1, double lng1, double lat2, double lng2,
                     double radius) {
  double a[2];
  double b[2];
  a[0] = lat1, a[1] = lng1;
  b[0] = lat2, b[1] = lng2;
  return slc_distance(a, b, radius);
}


x86 assembly (clang, -O0):
<slc_distance2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  %xmm2,-0x18(%rbp)
movsd  %xmm3,-0x20(%rbp)
movsd  %xmm4,-0x28(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x40(%rbp)
movsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x38(%rbp)
movsd  -0x18(%rbp),%xmm0
movsd  %xmm0,-0x50(%rbp)
movsd  -0x20(%rbp),%xmm0
movsd  %xmm0,-0x48(%rbp)
lea    -0x40(%rbp),%rdi
lea    -0x50(%rbp),%rsi
movsd  -0x28(%rbp),%xmm0
call   1030 <slc_distance@plt>
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<slc_distance2>:
sub    $0x28,%rsp
movsd  %xmm0,0x10(%rsp)
movsd  %xmm1,0x18(%rsp)
movsd  %xmm2,(%rsp)
movsd  %xmm3,0x8(%rsp)
lea    0x10(%rsp),%rdi
mov    %rsp,%rsi
movaps %xmm4,%xmm0
call   1030 <slc_distance@plt>
add    $0x28,%rsp
ret

LLVM IR (-O0):
define double @slc_distance2(double %0, double %1, double %2, double %3, double %4) {
%6 = alloca double
%7 = alloca double
%8 = alloca double
%9 = alloca double
%10 = alloca double
%11 = alloca [2 x double]
%12 = alloca [2 x double]
store double %0, double* %6
store double %1, double* %7
store double %2, double* %8
store double %3, double* %9
store double %4, double* %10
%13 = load double, double* %6
%14 = getelementptr inbounds [2 x double], [2 x double]* %11, i64 0, i64 0
store double %13, double* %14
%15 = load double, double* %7
%16 = getelementptr inbounds [2 x double], [2 x double]* %11, i64 0, i64 1
store double %15, double* %16
%17 = load double, double* %8
%18 = getelementptr inbounds [2 x double], [2 x double]* %12, i64 0, i64 0
store double %17, double* %18
%19 = load double, double* %9
%20 = getelementptr inbounds [2 x double], [2 x double]* %12, i64 0, i64 1
store double %19, double* %20
%21 = getelementptr inbounds [2 x double], [2 x double]* %11, i64 0, i64 0
%22 = getelementptr inbounds [2 x double], [2 x double]* %12, i64 0, i64 0
%23 = load double, double* %10
%24 = call double @slc_distance(double* %21, double* %22, double %23)
ret double %24
}

LLVM IR (-O2):
define double @slc_distance2(double %0, double %1, double %2, double %3, double %4) {
%6 = alloca [2 x double]
%7 = alloca [2 x double]
%8 = bitcast [2 x double]* %6 to i8*
%9 = bitcast [2 x double]* %7 to i8*
%10 = getelementptr inbounds [2 x double], [2 x double]* %6, i64 0, i64 0
store double %0, double* %10
%11 = getelementptr inbounds [2 x double], [2 x double]* %6, i64 0, i64 1
store double %1, double* %11
%12 = getelementptr inbounds [2 x double], [2 x double]* %7, i64 0, i64 0
store double %2, double* %12
%13 = getelementptr inbounds [2 x double], [2 x double]* %7, i64 0, i64 1
store double %3, double* %13
%14 = call double @slc_distance(double* %10, double* %12, double %4)
ret double %14
}