user: 请将这段汇编代码片段转换成等效的C代码:

```asm
<get_dist>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  add    $0xffffffffffffff80,%rsp
  movsd  %xmm0,-0x58(%rbp)
  movsd  %xmm1,-0x60(%rbp)
  movsd  %xmm2,-0x68(%rbp)
  movsd  %xmm3,-0x70(%rbp)
  movsd  D1(%rip),%xmm0
  movsd  %xmm0,-0x50(%rbp)
  movsd  -0x50(%rbp),%xmm0
  mulsd  -0x60(%rbp),%xmm0
  movsd  %xmm0,-0x48(%rbp)
  movsd  -0x50(%rbp),%xmm0
  mulsd  -0x58(%rbp),%xmm0
  movsd  %xmm0,-0x40(%rbp)
  movsd  -0x50(%rbp),%xmm0
  mulsd  -0x70(%rbp),%xmm0
  movsd  %xmm0,-0x38(%rbp)
  movsd  -0x50(%rbp),%xmm0
  mulsd  -0x68(%rbp),%xmm0
  movsd  %xmm0,-0x30(%rbp)
  mov    -0x40(%rbp),%rax
  movq   %rax,%xmm0
  call   <cos@plt>
  movsd  %xmm0,-0x78(%rbp)
  mov    -0x48(%rbp),%rax
  movq   %rax,%xmm0
  call   <cos@plt>
  movapd %xmm0,%xmm4
  mulsd  -0x78(%rbp),%xmm4
  movsd  %xmm4,-0x78(%rbp)
  mov    -0x30(%rbp),%rax
  movq   %rax,%xmm0
  call   <cos@plt>
  mulsd  -0x78(%rbp),%xmm0
  movsd  %xmm0,-0x78(%rbp)
  mov    -0x38(%rbp),%rax
  movq   %rax,%xmm0
  call   <cos@plt>
  mulsd  -0x78(%rbp),%xmm0
  movsd  %xmm0,-0x28(%rbp)
  mov    -0x40(%rbp),%rax
  movq   %rax,%xmm0
  call   <cos@plt>
  movsd  %xmm0,-0x78(%rbp)
  mov    -0x48(%rbp),%rax
  movq   %rax,%xmm0
  call   <sin@plt>
  movapd %xmm0,%xmm6
  mulsd  -0x78(%rbp),%xmm6
  movsd  %xmm6,-0x78(%rbp)
  mov    -0x30(%rbp),%rax
  movq   %rax,%xmm0
  call   <cos@plt>
  mulsd  -0x78(%rbp),%xmm0
  movsd  %xmm0,-0x78(%rbp)
  mov    -0x38(%rbp),%rax
  movq   %rax,%xmm0
  call   <sin@plt>
  mulsd  -0x78(%rbp),%xmm0
  movsd  %xmm0,-0x20(%rbp)
  mov    -0x40(%rbp),%rax
  movq   %rax,%xmm0
  call   <sin@plt>
  movsd  %xmm0,-0x78(%rbp)
  mov    -0x30(%rbp),%rax
  movq   %rax,%xmm0
  call   <sin@plt>
  mulsd  -0x78(%rbp),%xmm0
  movsd  %xmm0,-0x18(%rbp)
  movsd  -0x28(%rbp),%xmm0
  addsd  -0x20(%rbp),%xmm0
  movsd  -0x18(%rbp),%xmm1
  addsd  %xmm1,%xmm0
  movsd  %xmm0,-0x10(%rbp)
  movsd  -0x10(%rbp),%xmm0
  movsd  D2(%rip),%xmm1
  comisd %xmm1,%xmm0
  jbe    L17
  movsd  D2(%rip),%xmm0
  jmp    L12
L17:
  movsd  -0x10(%rbp),%xmm0
L12:
  movsd  %xmm0,-0x10(%rbp)
  mov    -0x10(%rbp),%rax
  movq   %rax,%xmm0
  call   <acos@plt>
  pxor   %xmm1,%xmm1
  cvtsi2sd %eax,%xmm1
  movsd  D38(%rip),%xmm0
  mulsd  %xmm1,%xmm0
  movsd  %xmm0,-0x8(%rbp)
  movsd  -0x8(%rbp),%xmm0
  movq   %xmm0,%rax
  movq   %rax,%xmm0
  leave
  ret
```

tool_calls: name: parse_data
arguments: data_tag: D1
type: byte[8]
name: parse_data
arguments: data_tag: D2
type: f64
name: parse_data
arguments: data_tag: D38
type: f64

tool: {"D1": [0x05,0xa1,0x1e,0x17,0x24,0xdf,0x91,0x3f]}

tool: D2: 1

tool: D38: 6371228

assistant: ```c
double get_dist(double lat1, double long1, double lat2, double long2) {
  double theta1;
  double phi1;
  double theta2;
  double phi2;
  double dtor;
  double term1;
  double term2;
  double term3;
  double temp;
  double dist;
  dtor = 2.0 * 3.1415 / 360.0;
  theta1 = dtor * long1;
  phi1 = dtor * lat1;
  theta2 = dtor * long2;
  phi2 = dtor * lat2;
  term1 = cos(phi1) * cos(theta1) * cos(phi2) * cos(theta2);
  term2 = cos(phi1) * sin(theta1) * cos(phi2) * sin(theta2);
  term3 = sin(phi1) * sin(phi2);
  temp = term1 + term2 + term3;
  temp = (double)(1.0 < temp) ? 1.0 : temp;
  dist = 6371228. * acos(temp);
  return dist;
}
```