user: Converte this assembly snippet into its equivalent C code:

```asm
<xyz2llh>:
  endbr64
  push   %rbp
  mov    %rdi,%rbp
  push   %rbx
  mov    %rsi,%rbx
  sub    $0x48,%rsp
  call   <normVect@plt>
  movsd  D79(%rip),%xmm9
  comisd %xmm0,%xmm9
  ja     L78
  movsd  0x0(%rbp),%xmm14
  movsd  0x8(%rbp),%xmm13
  pxor   %xmm6,%xmm6
  movsd  0x10(%rbp),%xmm10
  movsd  D5(%rip),%xmm7
  movapd %xmm14,%xmm1
  movapd %xmm13,%xmm2
  movsd  D69(%rip),%xmm15
  movsd  D149(%rip),%xmm12
  mulsd  %xmm14,%xmm1
  movapd %xmm10,%xmm3
  movq   D6(%rip),%xmm11
  mulsd  %xmm13,%xmm2
  mulsd  %xmm7,%xmm3
  addsd  %xmm2,%xmm1
  jmp    L86
  nopl   (%rax)
L93:
  movapd %xmm0,%xmm3
L86:
  movapd %xmm3,%xmm4
  addsd  %xmm10,%xmm4
  movapd %xmm4,%xmm2
  mulsd  %xmm4,%xmm2
  addsd  %xmm1,%xmm2
  ucomisd %xmm2,%xmm6
  ja     L61
  sqrtsd %xmm2,%xmm2
L62:
  movapd %xmm4,%xmm5
  movapd %xmm15,%xmm0
  divsd  %xmm2,%xmm5
  movapd %xmm5,%xmm8
  mulsd  %xmm7,%xmm8
  mulsd  %xmm5,%xmm8
  subsd  %xmm8,%xmm0
  ucomisd %xmm0,%xmm6
  ja     L81
  sqrtsd %xmm0,%xmm0
L80:
  movapd %xmm12,%xmm8
  divsd  %xmm0,%xmm8
  movapd %xmm8,%xmm0
  mulsd  %xmm7,%xmm0
  mulsd  %xmm5,%xmm0
  subsd  %xmm0,%xmm3
  andpd  %xmm11,%xmm3
  comisd %xmm3,%xmm9
  jbe    L93
  ucomisd %xmm1,%xmm6
  ja     L30
  sqrtsd %xmm1,%xmm1
L19:
  movapd %xmm4,%xmm0
  movsd  %xmm8,0x18(%rsp)
  movsd  %xmm2,0x10(%rsp)
  movsd  %xmm13,0x8(%rsp)
  movsd  %xmm14,(%rsp)
  call   <atan2@plt>
  movsd  (%rsp),%xmm14
  movsd  0x8(%rsp),%xmm13
  movsd  %xmm0,(%rbx)
  movapd %xmm14,%xmm1
  movapd %xmm13,%xmm0
  call   <atan2@plt>
  movsd  0x10(%rsp),%xmm2
  movsd  0x18(%rsp),%xmm8
  subsd  %xmm8,%xmm2
L58:
  movsd  %xmm0,0x8(%rbx)
  movsd  %xmm2,0x10(%rbx)
  add    $0x48,%rsp
  pop    %rbx
  pop    %rbp
  ret
  nopl   0x0(%rax)
L78:
  movq   $0x0,(%rbx)
  movsd  D150(%rip),%xmm2
  pxor   %xmm0,%xmm0
  jmp    L58
L81:
  movsd  %xmm5,0x38(%rsp)
  movsd  %xmm2,0x30(%rsp)
  movsd  %xmm4,0x28(%rsp)
  movsd  %xmm1,0x20(%rsp)
  movsd  %xmm10,0x18(%rsp)
  movsd  %xmm13,0x10(%rsp)
  movsd  %xmm14,0x8(%rsp)
  movsd  %xmm3,(%rsp)
  call   <sqrt@plt>
  mov    D149(%rip),%rax
  movsd  (%rsp),%xmm3
  pxor   %xmm6,%xmm6
  movq   D6(%rip),%xmm11
  movsd  0x38(%rsp),%xmm5
  movq   %rax,%xmm12
  mov    D69(%rip),%rax
  movsd  0x30(%rsp),%xmm2
  movsd  0x28(%rsp),%xmm4
  movsd  0x20(%rsp),%xmm1
  movq   %rax,%xmm15
  mov    D5(%rip),%rax
  movsd  0x18(%rsp),%xmm10
  movsd  0x10(%rsp),%xmm13
  movsd  0x8(%rsp),%xmm14
  movq   %rax,%xmm7
  mov    D79(%rip),%rax
  movq   %rax,%xmm9
  jmp    L80
L61:
  movapd %xmm2,%xmm0
  movsd  %xmm4,0x28(%rsp)
  movsd  %xmm1,0x20(%rsp)
  movsd  %xmm10,0x18(%rsp)
  movsd  %xmm13,0x10(%rsp)
  movsd  %xmm14,0x8(%rsp)
  movsd  %xmm3,(%rsp)
  call   <sqrt@plt>
  mov    D149(%rip),%rax
  pxor   %xmm6,%xmm6
  movq   D6(%rip),%xmm11
  movsd  0x28(%rsp),%xmm4
  movsd  0x20(%rsp),%xmm1
  movapd %xmm0,%xmm2
  movq   %rax,%xmm12
  mov    D69(%rip),%rax
  movsd  0x18(%rsp),%xmm10
  movsd  0x10(%rsp),%xmm13
  movsd  0x8(%rsp),%xmm14
  movq   %rax,%xmm15
  mov    D5(%rip),%rax
  movsd  (%rsp),%xmm3
  movq   %rax,%xmm7
  mov    D79(%rip),%rax
  movq   %rax,%xmm9
  jmp    L62
L30:
  movapd %xmm1,%xmm0
  movsd  %xmm8,0x20(%rsp)
  movsd  %xmm2,0x18(%rsp)
  movsd  %xmm4,0x10(%rsp)
  movsd  %xmm13,0x8(%rsp)
  movsd  %xmm14,(%rsp)
  call   <sqrt@plt>
  movsd  0x20(%rsp),%xmm8
  movsd  0x18(%rsp),%xmm2
  movsd  0x10(%rsp),%xmm4
  movsd  0x8(%rsp),%xmm13
  movapd %xmm0,%xmm1
  movsd  (%rsp),%xmm14
  jmp    L19
```

tool_calls: name: retrieve_data
arguments: data_tag: D79
data_type: byte[8]
name: retrieve_data
arguments: data_tag: D5
data_type: byte[8]
name: retrieve_data
arguments: data_tag: D69
data_type: f64
name: retrieve_data
arguments: data_tag: D149
data_type: f64
name: retrieve_data
arguments: data_tag: D6
data_type: qword
name: retrieve_data
arguments: data_tag: D150
data_type: byte[8]

tool: {"D79": [0xfc,0xa9,0xf1,0xd2,0x4d,0x62,0x50,0x3f]}

tool: {"D5": [0x1a,0x85,0xfe,0xf1,0x90,0x6b,0x7b,0x3f]}

tool: D69: 1

tool: D149: 6378137

tool: D6: 9223372036854775807

tool: {"D150": [0x00,0x00,0x00,0x40,0xa6,0x54,0x58,0xc1]}

assistant: ```c
void xyz2llh(const double *xyz, double *llh) {
  double a, eps, e, e2;
  double x, y, z;
  double rho2, dz, zdz, nh, slat, n, dz_new;
  a = 6378137.0;
  e = 0.0818191908426;
  eps = 1.0e-3;
  e2 = e * e;
  if (normVect(xyz) < eps) {
    llh[0] = 0.0;
    llh[1] = 0.0;
    llh[2] = -a;
    return;
  }
  x = xyz[0];
  y = xyz[1];
  z = xyz[2];
  rho2 = x * x + y * y;
  dz = e2 * z;
  while (1) {
    zdz = z + dz;
    nh = sqrt(rho2 + zdz * zdz);
    slat = zdz / nh;
    n = a / sqrt(1.0 - e2 * slat * slat);
    dz_new = n * e2 * slat;
    if (fabs(dz - dz_new) < eps)
      break;
    dz = dz_new;
  }
  llh[0] = atan2(zdz, sqrt(rho2));
  llh[1] = atan2(y, x);
  llh[2] = nh - n;
  return;
}
```