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

```asm
<bessi>:
  endbr64
  push   %rbx
  cvttsd2si %xmm0,%ebx
  sub    $0x20,%rsp
  test   %ebx,%ebx
  je     L10
  cmp    $0x1,%ebx
  je     L38
  pxor   %xmm6,%xmm6
  ucomisd %xmm6,%xmm1
  jp     L98
  movapd %xmm6,%xmm0
  jne    L98
L46:
  add    $0x20,%rsp
  pop    %rbx
  ret
  nopl   0x0(%rax)
L98:
  movq   D44(%rip),%xmm9
  movapd %xmm1,%xmm0
  movsd  %xmm1,0x8(%rsp)
  movsd  D80(%rip),%xmm8
  andpd  %xmm9,%xmm0
  divsd  %xmm0,%xmm8
  pxor   %xmm0,%xmm0
  cvtsi2sd %ebx,%xmm0
  mulsd  D21(%rip),%xmm0
  movsd  %xmm8,0x10(%rsp)
  call   <sqrt@plt>
  pxor   %xmm6,%xmm6
  movsd  0x8(%rsp),%xmm1
  add    %ebx,%eax
  movapd %xmm6,%xmm7
  add    %eax,%eax
  test   %eax,%eax
  jle    L6
  movsd  D52(%rip),%xmm3
  movsd  0x10(%rsp),%xmm8
  movapd %xmm6,%xmm4
  movsd  D10(%rip),%xmm0
  movsd  D56(%rip),%xmm5
  movq   D44(%rip),%xmm9
  jmp    L8
  nopw   0x0(%rax,%rax,1)
L16:
  sub    $0x1,%eax
  je     L51
L66:
  movapd %xmm3,%xmm4
  movapd %xmm2,%xmm3
L8:
  pxor   %xmm2,%xmm2
  cvtsi2sd %eax,%xmm2
  mulsd  %xmm8,%xmm2
  mulsd  %xmm3,%xmm2
  addsd  %xmm4,%xmm2
  movapd %xmm2,%xmm4
  andpd  %xmm9,%xmm4
  comisd %xmm0,%xmm4
  jbe    L90
  mulsd  %xmm5,%xmm7
  mulsd  %xmm5,%xmm2
  mulsd  %xmm5,%xmm3
L90:
  cmp    %eax,%ebx
  jne    L16
  lea    -0x1(%rbx),%eax
  movapd %xmm3,%xmm7
  jmp    L66
  nopw   0x0(%rax,%rax,1)
L6:
  movsd  D52(%rip),%xmm2
L51:
  movapd %xmm1,%xmm0
  movsd  %xmm2,0x18(%rsp)
  movsd  %xmm7,0x10(%rsp)
  movsd  %xmm1,0x8(%rsp)
  call   <bessi0@plt>
  movsd  0x18(%rsp),%xmm2
  pxor   %xmm6,%xmm6
  movsd  0x8(%rsp),%xmm1
  movsd  0x10(%rsp),%xmm7
  divsd  %xmm2,%xmm0
  comisd %xmm1,%xmm6
  mulsd  %xmm7,%xmm0
  jbe    L46
  and    $0x1,%ebx
  je     L46
  xorpd  D11(%rip),%xmm0
  jmp    L46
  nopl   0x0(%rax)
L10:
  add    $0x20,%rsp
  movapd %xmm1,%xmm0
  pop    %rbx
  jmp    1080 <bessi0@plt>
  xchg   %ax,%ax
L38:
  add    $0x20,%rsp
  movapd %xmm1,%xmm0
  pop    %rbx
  jmp    1090 <bessi1@plt>
```

tool_calls: name: read_data
arguments: label: D44
type_guessed: qword
name: read_data
arguments: label: D80
type_guessed: f64
name: read_data
arguments: label: D21
type_guessed: f64
name: read_data
arguments: label: D52
type_guessed: f64
name: read_data
arguments: label: D10
type_guessed: f64
name: read_data
arguments: label: D56
type_guessed: byte[8]
name: read_data
arguments: label: D11
type_guessed: f32[4]

tool: D44: 9223372036854775807

tool: D80: 2

tool: D21: 40

tool: D52: 1

tool: D10: 10000000000

tool: {"D56": [0xbb,0xbd,0xd7,0xd9,0xdf,0x7c,0xdb,0x3d]}

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

assistant: ```c
double bessi(double nn, double x) {
  int j, n;
  double bi, bim, bip, tox, ans;
  n = (int)nn;
  if (n == 0)
    return bessi0(x);
  if (n == 1)
    return bessi1(x);
  if (x == 0.0)
    return 0.0;
  else {
    tox = 2.0 / fabs(x);
    bip = ans = 0.0;
    bi = 1.0;
    for (j = 2 * (n + (int)sqrt(40.0 * n)); j > 0; j--) {
      bim = bip + j * tox * bi;
      bip = bi;
      bi = bim;
      if (fabs(bi) > 1.0e10) {
        ans *= 1.0e-10;
        bi *= 1.0e-10;
        bip *= 1.0e-10;
      }
      if (j == n)
        ans = bip;
    }
    ans *= bessi0(x) / bi;
    return x < 0.0 && (n & 1) ? -ans : ans;
  }
}
```