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

```asm
<palAopqk>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x98,%rsp
  mov    %rdi,%rbx
  mov    %rsi,%r13
  mov    %rdx,%r12
  mov    %rcx,0x28(%rsp)
  mov    %r8,0x30(%rsp)
  mov    %r9,0x38(%rsp)
  mov    %fs:0x28,%rax
  mov    %rax,0x88(%rsp)
  xor    %eax,%eax
  movsd  0x8(%rdi),%xmm6
  movsd  %xmm6,0x8(%rsp)
  movsd  0x10(%rdi),%xmm7
  movsd  %xmm7,0x10(%rsp)
  movsd  0x68(%rdi),%xmm3
  movsd  %xmm3,0x20(%rsp)
  lea    0x70(%rsp),%rdi
  subsd  %xmm3,%xmm0
  call   <palDcs2c@plt>
  movsd  0x78(%rsp),%xmm2
  movsd  0x18(%rbx),%xmm3
  movapd %xmm2,%xmm1
  mulsd  %xmm3,%xmm1
  movsd  D36(%rip),%xmm0
  subsd  %xmm1,%xmm0
  movapd %xmm0,%xmm1
  mulsd  0x70(%rsp),%xmm1
  addsd  %xmm3,%xmm2
  mulsd  %xmm0,%xmm2
  movapd %xmm2,%xmm5
  movsd  %xmm2,(%rsp)
  mulsd  0x80(%rsp),%xmm0
  movsd  0x8(%rsp),%xmm6
  movapd %xmm6,%xmm3
  mulsd  %xmm1,%xmm3
  movsd  0x10(%rsp),%xmm7
  movapd %xmm7,%xmm2
  mulsd  %xmm0,%xmm2
  movapd %xmm3,%xmm4
  subsd  %xmm2,%xmm4
  movsd  %xmm4,0x18(%rsp)
  mulsd  %xmm7,%xmm1
  mulsd  %xmm6,%xmm0
  addsd  %xmm0,%xmm1
  movq   %xmm1,%rbp
  ucomisd D13(%rip),%xmm4
  setnp  %al
  mov    $0x0,%edx
  cmovne %edx,%eax
  test   %al,%al
  je     L23
  ucomisd D13(%rip),%xmm5
  setnp  %al
  cmovne %edx,%eax
  mov    D13(%rip),%r14
  test   %al,%al
  je     L23
L6:
  movsd  0x18(%rsp),%xmm0
  mulsd  %xmm0,%xmm0
  movsd  (%rsp),%xmm1
  mulsd  %xmm1,%xmm1
  addsd  %xmm1,%xmm0
  pxor   %xmm1,%xmm1
  ucomisd %xmm0,%xmm1
  ja     L34
  sqrtsd %xmm0,%xmm0
L14:
  movq   %rbp,%xmm1
  call   <atan2@plt>
  movsd  %xmm0,(%rsp)
  lea    0x50(%rsp),%rdi
  movsd  0x58(%rbx),%xmm2
  movsd  0x50(%rbx),%xmm1
  call   <palRefz@plt>
  movsd  0x50(%rsp),%xmm0
  call   <cos@plt>
  movsd  D34(%rip),%xmm1
  comisd %xmm0,%xmm1
  ja     L89
L99:
  lea    0x48(%rsp),%rbp
  lea    0x40(%rsp),%r15
  mov    %r15,%rsi
  mov    %rbp,%rdi
  movq   %r14,%xmm0
  call   <sincos@plt>
  mov    0x40(%rsp),%rbx
  movsd  0x48(%rsp),%xmm7
  movsd  %xmm7,(%rsp)
  mov    %r15,%rsi
  mov    %rbp,%rdi
  movsd  0x50(%rsp),%xmm0
  call   <sincos@plt>
  movsd  0x40(%rsp),%xmm2
  movsd  0x48(%rsp),%xmm3
  movq   %rbx,%xmm0
  xorpd  D70(%rip),%xmm0
  mulsd  %xmm3,%xmm0
  movsd  0x8(%rsp),%xmm5
  movapd %xmm5,%xmm1
  mulsd  %xmm0,%xmm1
  movsd  0x10(%rsp),%xmm6
  movapd %xmm6,%xmm4
  mulsd  %xmm2,%xmm4
  addsd  %xmm4,%xmm1
  movsd  %xmm1,0x70(%rsp)
  mulsd  (%rsp),%xmm3
  movsd  %xmm3,0x78(%rsp)
  mulsd  %xmm0,%xmm6
  mulsd  %xmm2,%xmm5
  movapd %xmm5,%xmm0
  subsd  %xmm6,%xmm0
  movsd  %xmm0,0x80(%rsp)
  lea    0x68(%rsp),%rdx
  lea    0x60(%rsp),%rsi
  lea    0x70(%rsp),%rdi
  call   <palDcc2s@plt>
  movsd  0x20(%rsp),%xmm0
  addsd  0x60(%rsp),%xmm0
  call   <palDranrm@plt>
  movapd %xmm0,%xmm1
  mov    %r14,0x0(%r13)
  movsd  0x50(%rsp),%xmm0
  movsd  %xmm0,(%r12)
  movsd  0x60(%rsp),%xmm0
  xorpd  D70(%rip),%xmm0
  mov    0x28(%rsp),%rax
  movsd  %xmm0,(%rax)
  movsd  0x68(%rsp),%xmm0
  mov    0x30(%rsp),%rax
  movsd  %xmm0,(%rax)
  mov    0x38(%rsp),%rax
  movsd  %xmm1,(%rax)
  mov    0x88(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L90
  add    $0x98,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
L23:
  movsd  0x18(%rsp),%xmm1
  xorpd  D70(%rip),%xmm1
  movsd  (%rsp),%xmm0
  call   <atan2@plt>
  movq   %xmm0,%r14
  jmp    L6
L34:
  call   <sqrt@plt>
  jmp    L14
L89:
  movsd  D12(%rip),%xmm0
  mov    $0x1,%ebp
  lea    0x58(%rsp),%r15
L37:
  call   <fabs@plt>
  cmp    $0xa,%ebp
  jg     L99
  test   %eax,%eax
  jle    L99
  mov    %r15,%rsi
  mov    $0x0,%edi
  movsd  0x48(%rbx),%xmm7
  movsd  (%rbx),%xmm6
  movsd  0x40(%rbx),%xmm5
  movsd  0x38(%rbx),%xmm4
  movsd  0x30(%rbx),%xmm3
  movsd  0x28(%rbx),%xmm2
  movsd  0x20(%rbx),%xmm1
  movsd  0x50(%rsp),%xmm0
  call   <palRefro@plt>
  movsd  0x50(%rsp),%xmm1
  movapd %xmm1,%xmm0
  addsd  0x58(%rsp),%xmm0
  subsd  (%rsp),%xmm0
  subsd  %xmm0,%xmm1
  movsd  %xmm1,0x50(%rsp)
  add    $0x1,%ebp
  jmp    L37
L90:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: unpack_data
arguments: data_label: D36
datatype: f64
name: unpack_data
arguments: data_label: D13
datatype: f64
name: unpack_data
arguments: data_label: D34
datatype: f64
name: unpack_data
arguments: data_label: D70
datatype: byte[16]
name: unpack_data
arguments: data_label: D12
datatype: f64

tool: D36: 1

tool: D13: 0

tool: D34: 0.242535625

tool: {"D70": [0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00]}

tool: D12: 10

assistant: ```c
void palAopqk(double rap, double dap, const double aoprms[14], double *aob, double *zob, double *hob, double *dob, double *rob) {
  const double zbreak = 0.242535625;
  int i;
  double sphi, cphi, st, v[3], xhd, yhd, zhd, diurab, f, xhdt, yhdt, zhdt, xaet, yaet, zaet, azobs, zdt, refa, refb, zdobs, dzd, dref, ce, xaeo, yaeo, zaeo, hmobs, dcobs, raobs;
  sphi = aoprms[1];
  cphi = aoprms[2];
  st = aoprms[13];
  palDcs2c(rap - st, dap, v);
  xhd = v[0];
  yhd = v[1];
  zhd = v[2];
  diurab = aoprms[3];
  f = (1.0 - diurab * yhd);
  xhdt = f * xhd;
  yhdt = f * (yhd + diurab);
  zhdt = f * zhd;
  xaet = sphi * xhdt - cphi * zhdt;
  yaet = yhdt;
  zaet = cphi * xhdt + sphi * zhdt;
  if (xaet == 0.0 && yaet == 0.0) {
    azobs = 0.0;
  } else {
    azobs = atan2(yaet, -xaet);
  }
  zdt = atan2(sqrt(xaet * xaet + yaet * yaet), zaet);
  refa = aoprms[10];
  refb = aoprms[11];
  palRefz(zdt, refa, refb, &zdobs);
  if (cos(zdobs) < zbreak) {
    i = 1;
    dzd = 1.0e1;
    while (fabs(dzd) > 1e-10 && i <= 10) {
      palRefro(zdobs, aoprms[4], aoprms[5], aoprms[6], aoprms[7], aoprms[8], aoprms[0], aoprms[9], 1e-8, &dref);
      dzd = zdobs + dref - zdt;
      zdobs = zdobs - dzd;
      i++;
    }
  }
  ce = sin(zdobs);
  xaeo = -cos(azobs) * ce;
  yaeo = sin(azobs) * ce;
  zaeo = cos(zdobs);
  v[0] = sphi * xaeo + cphi * zaeo;
  v[1] = yaeo;
  v[2] = -cphi * xaeo + sphi * zaeo;
  palDcc2s(v, &hmobs, &dcobs);
  raobs = palDranrm(st + hmobs);
  *aob = azobs;
  *zob = zdobs;
  *hob = -hmobs;
  *dob = dcobs;
  *rob = raobs;
}
```