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

```asm
<astrofuncs_y1lim>:
  endbr64
  comisd D48(%rip),%xmm1
  jae    L165
  movsd  D88(%rip),%xmm4
  comisd %xmm1,%xmm4
  jae    L165
  movapd %xmm1,%xmm4
  subsd  %xmm2,%xmm4
  comisd %xmm0,%xmm4
  jae    L165
  movq   D49(%rip),%xmm6
  movapd %xmm0,%xmm2
  pxor   %xmm5,%xmm5
  xorpd  %xmm6,%xmm2
  comisd %xmm4,%xmm2
  jae    L48
  mulsd  %xmm0,%xmm0
  sub    $0x28,%rsp
  movapd %xmm5,%xmm7
  mulsd  %xmm4,%xmm4
  movapd %xmm0,%xmm2
  subsd  %xmm4,%xmm2
  ucomisd %xmm2,%xmm5
  ja     L45
  movapd %xmm2,%xmm0
  sqrtsd %xmm0,%xmm0
L72:
  mulsd  %xmm1,%xmm1
  movsd  D48(%rip),%xmm4
  movapd %xmm3,%xmm8
  subsd  %xmm0,%xmm8
  subsd  %xmm1,%xmm4
  ucomisd %xmm4,%xmm7
  ja     L1
  movapd %xmm4,%xmm5
  sqrtsd %xmm5,%xmm5
  comisd %xmm5,%xmm8
  jae    L10
L14:
  ucomisd %xmm2,%xmm7
  ja     L113
  movapd %xmm2,%xmm0
  sqrtsd %xmm0,%xmm0
L27:
  ucomisd %xmm4,%xmm7
  movapd %xmm3,%xmm1
  subsd  %xmm0,%xmm1
  ja     L63
  sqrtsd %xmm4,%xmm4
  movapd %xmm4,%xmm0
  xorpd  %xmm6,%xmm0
  comisd %xmm1,%xmm0
  jae    L163
L66:
  ucomisd %xmm2,%xmm7
  ja     L0
  sqrtsd %xmm2,%xmm2
L131:
  movapd %xmm3,%xmm5
  subsd  %xmm2,%xmm5
L10:
  movapd %xmm5,%xmm0
  add    $0x28,%rsp
  ret
  cs nopw 0x0(%rax,%rax,1)
L165:
  pxor   %xmm5,%xmm5
L48:
  movapd %xmm5,%xmm0
  ret
L63:
  movapd %xmm4,%xmm0
  movsd  %xmm3,0x18(%rsp)
  movsd  %xmm1,0x10(%rsp)
  movsd  %xmm2,0x8(%rsp)
  movsd  %xmm4,(%rsp)
  call   <sqrt@plt>
  movsd  0x10(%rsp),%xmm1
  movsd  (%rsp),%xmm4
  pxor   %xmm7,%xmm7
  movq   D49(%rip),%xmm6
  movsd  0x8(%rsp),%xmm2
  movsd  0x18(%rsp),%xmm3
  xorpd  %xmm6,%xmm0
  comisd %xmm1,%xmm0
  jb     L66
  movapd %xmm4,%xmm0
  call   <sqrt@plt>
  movq   D49(%rip),%xmm6
  movapd %xmm0,%xmm4
  nopl   0x0(%rax,%rax,1)
L163:
  movapd %xmm4,%xmm5
  xorpd  %xmm6,%xmm5
  jmp    L10
L1:
  movapd %xmm4,%xmm0
  movsd  %xmm3,0x18(%rsp)
  movsd  %xmm8,0x10(%rsp)
  movsd  %xmm2,0x8(%rsp)
  movsd  %xmm4,(%rsp)
  call   <sqrt@plt>
  movsd  0x10(%rsp),%xmm8
  movsd  (%rsp),%xmm4
  pxor   %xmm7,%xmm7
  movsd  0x8(%rsp),%xmm2
  movsd  0x18(%rsp),%xmm3
  comisd %xmm0,%xmm8
  movq   D49(%rip),%xmm6
  jb     L14
  movapd %xmm4,%xmm0
  add    $0x28,%rsp
  jmp    1050 <sqrt@plt>
L45:
  movapd %xmm2,%xmm0
  movsd  %xmm3,0x10(%rsp)
  movsd  %xmm1,0x8(%rsp)
  movsd  %xmm2,(%rsp)
  call   <sqrt@plt>
  movsd  0x10(%rsp),%xmm3
  movsd  0x8(%rsp),%xmm1
  pxor   %xmm7,%xmm7
  movq   D49(%rip),%xmm6
  movsd  (%rsp),%xmm2
  jmp    L72
L0:
  movapd %xmm2,%xmm0
  movsd  %xmm3,(%rsp)
  call   <sqrt@plt>
  movsd  (%rsp),%xmm3
  movapd %xmm0,%xmm2
  jmp    L131
L113:
  movapd %xmm2,%xmm0
  movsd  %xmm3,0x10(%rsp)
  movsd  %xmm4,0x8(%rsp)
  movsd  %xmm2,(%rsp)
  call   <sqrt@plt>
  movsd  0x10(%rsp),%xmm3
  movsd  0x8(%rsp),%xmm4
  pxor   %xmm7,%xmm7
  movq   D49(%rip),%xmm6
  movsd  (%rsp),%xmm2
  jmp    L27
```

tool_calls: name: extract_symbolic_data
arguments: data_tag: D48
type: f64[2]
name: extract_symbolic_data
arguments: data_tag: D88
type: f32[2]
name: extract_symbolic_data
arguments: data_tag: D49
type: f32[2]

tool: {"D48": [1.0,-1.0]}

tool: {"D88": [0.0,-1.875]}

tool: {"D49": [0.0,-0.0]}

assistant: ```c
double astrofuncs_y1lim(double rprs, double delv, double vp, double yp) {
  if (delv >= 1.0 || delv <= -1.0)
    return 0.0;
  if (delv - vp >= rprs || delv - vp <= -rprs)
    return 0.0;
  if (yp - sqrt(rprs * rprs - (delv - vp) * (delv - vp)) >= sqrt(1.0 - delv * delv))
    return sqrt(1.0 - delv * delv);
  if (yp - sqrt(rprs * rprs - (delv - vp) * (delv - vp)) <= -sqrt(1.0 - delv * delv))
    return -sqrt(1.0 - delv * delv);
  return yp - sqrt(rprs * rprs - (delv - vp) * (delv - vp));
}
```