user: What is the c source code of the assembly code below?

```asm
<distance>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0xa0,%rsp
  movsd  %xmm0,-0x68(%rbp)
  movsd  %xmm1,-0x70(%rbp)
  movsd  %xmm2,-0x78(%rbp)
  movsd  %xmm3,-0x80(%rbp)
  mov    %edi,-0x84(%rbp)
  mov    %fs:0x28,%rax
  mov    %rax,-0x8(%rbp)
  xor    %eax,%eax
  movsd  D20(%rip),%xmm0
  movsd  %xmm0,-0x20(%rbp)
  movsd  D103(%rip),%xmm0
  movsd  %xmm0,-0x18(%rbp)
  movsd  D98(%rip),%xmm0
  movsd  %xmm0,-0x60(%rbp)
  movsd  -0x60(%rbp),%xmm0
  movsd  D5(%rip),%xmm1
  divsd  %xmm1,%xmm0
  movsd  %xmm0,-0x58(%rbp)
  movsd  D5(%rip),%xmm0
  divsd  -0x60(%rbp),%xmm0
  movsd  %xmm0,-0x50(%rbp)
  cmpl   $0x0,-0x84(%rbp)
  js     L8
  cmpl   $0x1,-0x84(%rbp)
  jle    L30
L8:
  movl   $0x0,-0x84(%rbp)
L30:
  movsd  -0x68(%rbp),%xmm0
  comisd D54(%rip),%xmm0
  jbe    L47
  movsd  -0x68(%rbp),%xmm0
  movsd  D5(%rip),%xmm1
  subsd  %xmm1,%xmm0
  movsd  %xmm0,-0x68(%rbp)
L47:
  movsd  -0x78(%rbp),%xmm0
  comisd D54(%rip),%xmm0
  jbe    L43
  movsd  -0x78(%rbp),%xmm0
  movsd  D5(%rip),%xmm1
  subsd  %xmm1,%xmm0
  movsd  %xmm0,-0x78(%rbp)
L43:
  movsd  -0x68(%rbp),%xmm0
  mulsd  -0x58(%rbp),%xmm0
  movsd  %xmm0,-0x48(%rbp)
  movsd  -0x78(%rbp),%xmm0
  mulsd  -0x58(%rbp),%xmm0
  movsd  %xmm0,-0x40(%rbp)
  movsd  -0x70(%rbp),%xmm0
  subsd  -0x80(%rbp),%xmm0
  movq   D88(%rip),%xmm1
  andpd  %xmm1,%xmm0
  movsd  -0x58(%rbp),%xmm1
  mulsd  %xmm1,%xmm0
  movsd  %xmm0,-0x38(%rbp)
  mov    -0x48(%rbp),%rax
  movq   %rax,%xmm0
  call   <sin@plt>
  movsd  %xmm0,-0x90(%rbp)
  mov    -0x40(%rbp),%rax
  movq   %rax,%xmm0
  call   <sin@plt>
  movapd %xmm0,%xmm4
  mulsd  -0x90(%rbp),%xmm4
  movsd  %xmm4,-0x90(%rbp)
  mov    -0x48(%rbp),%rax
  movq   %rax,%xmm0
  call   <cos@plt>
  movsd  %xmm0,-0x98(%rbp)
  mov    -0x40(%rbp),%rax
  movq   %rax,%xmm0
  call   <cos@plt>
  movapd %xmm0,%xmm5
  mulsd  -0x98(%rbp),%xmm5
  movsd  %xmm5,-0x98(%rbp)
  mov    -0x38(%rbp),%rax
  movq   %rax,%xmm0
  call   <cos@plt>
  mulsd  -0x98(%rbp),%xmm0
  addsd  -0x90(%rbp),%xmm0
  movsd  %xmm0,-0x30(%rbp)
  mov    -0x30(%rbp),%rax
  movq   %rax,%xmm0
  call   <acos@plt>
  movsd  -0x50(%rbp),%xmm1
  mulsd  %xmm1,%xmm0
  movsd  %xmm0,-0x30(%rbp)
  movsd  -0x30(%rbp),%xmm0
  movapd %xmm0,%xmm1
  mulsd  -0x60(%rbp),%xmm1
  mov    -0x84(%rbp),%eax
  cltq
  movsd  -0x20(%rbp,%rax,8),%xmm0
  mulsd  %xmm1,%xmm0
  movsd  D5(%rip),%xmm1
  divsd  %xmm1,%xmm0
  movsd  %xmm0,-0x28(%rbp)
  pxor   %xmm0,%xmm0
  cvtsd2ss -0x28(%rbp),%xmm0
  mov    -0x8(%rbp),%rax
  sub    %fs:0x28,%rax
  je     L11
  call   <__stack_chk_fail@plt>
L11:
  leave
  ret
```

tool_calls: name: unpack_data
arguments: data_tag: D20
type: f64
name: unpack_data
arguments: data_tag: D103
type: f64
name: unpack_data
arguments: data_tag: D98
type: f64
name: unpack_data
arguments: data_tag: D5
type: f64
name: unpack_data
arguments: data_tag: D54
type: f64[2]
name: unpack_data
arguments: data_tag: D88
type: qword

tool: D20: 3958.754

tool: D103: 6370.997

tool: D98: 3.141592654

tool: D5: 180

tool: {"D54": [90.0,0.0]}

tool: D88: 9223372036854775807

assistant: ```c
float distance(double lat1, double lon1, double lat2, double lon2, int units) {
  double a, b, p, dtheta, d;
  double R[2] = {3958.754, 6370.997}, PI = 3.141592654;
  double DEG2RAD = (PI / 180.0), RAD2DEG = (180.0 / PI);
  if ((units < 0) || (units > 1))
    units = 0;
  if (lat1 > 90.0)
    lat1 -= 180.0;
  if (lat2 > 90.0)
    lat2 -= 180.0;
  a = lat1 * DEG2RAD;
  b = lat2 * DEG2RAD;
  p = fabs(lon1 - lon2) * DEG2RAD;
  dtheta = (sin(a) * sin(b)) + (cos(a) * cos(b) * cos(p));
  dtheta = acos(dtheta) * RAD2DEG;
  d = (dtheta * PI * R[units]) / 180.0;
  return (float)d;
}
```