user: Translate the below assembly code into C programming language:

```asm
<bessj>:
  endbr64
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x10,%rsp
  mov    %edi,%ebx
  movq   %xmm0,%r12
  cmp    $0x1,%edi
  jle    L183
L188:
  movq   %r12,%xmm5
  ucomisd D17(%rip),%xmm5
  jp     L84
  pxor   %xmm0,%xmm0
  je     L96
L84:
  movq   %r12,%xmm3
  andpd  D30(%rip),%xmm3
  movsd  %xmm3,0x8(%rsp)
  pxor   %xmm0,%xmm0
  cvtsi2sd %ebx,%xmm0
  comisd %xmm0,%xmm3
  jbe    L161
  movsd  D86(%rip),%xmm0
  divsd  %xmm3,%xmm0
  movsd  %xmm0,(%rsp)
  movapd %xmm3,%xmm0
  call   <bessj0@plt>
  movq   %xmm0,%rbp
  movsd  0x8(%rsp),%xmm0
  call   <bessj1@plt>
  movapd %xmm0,%xmm1
  cmp    $0x1,%ebx
  jle    L169
  mov    $0x1,%eax
  jmp    L28
L183:
  lea    D4(%rip),%rdi
  call   <nrerror@plt>
  jmp    L188
L165:
  movapd %xmm0,%xmm1
L28:
  pxor   %xmm0,%xmm0
  cvtsi2sd %eax,%xmm0
  mulsd  (%rsp),%xmm0
  mulsd  %xmm1,%xmm0
  movq   %rbp,%xmm7
  subsd  %xmm7,%xmm0
  add    $0x1,%eax
  movq   %xmm1,%rbp
  cmp    %eax,%ebx
  jne    L165
  jmp    L169
L161:
  movsd  D86(%rip),%xmm1
  divsd  0x8(%rsp),%xmm1
  movsd  %xmm1,(%rsp)
  mulsd  D51(%rip),%xmm0
  call   <sqrt@plt>
  lea    (%rbx,%rax,1),%edx
  mov    %edx,%eax
  shr    $0x1f,%eax
  add    %edx,%eax
  and    $0xfffffffe,%eax
  jle    L3
  pxor   %xmm0,%xmm0
  movapd %xmm0,%xmm3
  movapd %xmm0,%xmm4
  movsd  D107(%rip),%xmm2
  mov    $0x0,%edx
  movq   D30(%rip),%xmm7
  movsd  D33(%rip),%xmm6
  movsd  D38(%rip),%xmm5
  jmp    L93
L60:
  movapd %xmm2,%xmm4
  movapd %xmm1,%xmm2
L48:
  test   %edx,%edx
  je     L9
  addsd  %xmm2,%xmm3
L9:
  xor    $0x1,%edx
  cmp    %eax,%ebx
  je     L133
L143:
  sub    $0x1,%eax
  je     L186
L93:
  pxor   %xmm1,%xmm1
  cvtsi2sd %eax,%xmm1
  mulsd  (%rsp),%xmm1
  mulsd  %xmm2,%xmm1
  subsd  %xmm4,%xmm1
  movapd %xmm1,%xmm4
  andpd  %xmm7,%xmm4
  comisd %xmm6,%xmm4
  jbe    L60
  mulsd  %xmm5,%xmm2
  movapd %xmm2,%xmm4
  mulsd  %xmm5,%xmm0
  mulsd  %xmm5,%xmm3
  movapd %xmm1,%xmm2
  mulsd  %xmm5,%xmm2
  jmp    L48
L133:
  movapd %xmm4,%xmm0
  jmp    L143
L3:
  pxor   %xmm0,%xmm0
  movapd %xmm0,%xmm3
  movsd  D107(%rip),%xmm2
L186:
  addsd  %xmm3,%xmm3
  subsd  %xmm2,%xmm3
  divsd  %xmm3,%xmm0
L169:
  pxor   %xmm1,%xmm1
  movq   %r12,%xmm6
  comisd %xmm6,%xmm1
  ja     L164
L96:
  add    $0x10,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  ret
L164:
  test   $0x1,%bl
  je     L96
  xorpd  D75(%rip),%xmm0
  jmp    L96
```

tool_calls: name: disassemble_data
arguments: tag: D17
data_type: f64
name: disassemble_data
arguments: tag: D30
data_type: qword[2]
name: disassemble_data
arguments: tag: D86
data_type: f64
name: disassemble_data
arguments: tag: D4
data_type: string
name: disassemble_data
arguments: tag: D51
data_type: f64
name: disassemble_data
arguments: tag: D107
data_type: f64
name: disassemble_data
arguments: tag: D33
data_type: f64
name: disassemble_data
arguments: tag: D38
data_type: byte[8]
name: disassemble_data
arguments: tag: D75
data_type: byte[16]

tool: D17: 0

tool: {"D30": [0x7fffffffffffffff,0x0000000000000000]}

tool: D86: 2

tool: D4: Index n less than 2 in bessj

tool: D51: 40

tool: D107: 1

tool: D33: 10000000000

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

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

assistant: ```c
double bessj(int n, double x) {
  double bessj0(double x);
  double bessj1(double x);
  void nrerror(char error_text[]);
  int j, jsum, m;
  double ax, bj, bjm, bjp, sum, tox, ans;
  if (n < 2)
    nrerror("Index n less than 2 in bessj");
  ax = fabs(x);
  if (ax == 0.0)
    return 0.0;
  else if (ax > (double)n) {
    tox = 2.0 / ax;
    bjm = bessj0(ax);
    bj = bessj1(ax);
    for (j = 1; j < n; j++) {
      bjp = j * tox * bj - bjm;
      bjm = bj;
      bj = bjp;
    }
    ans = bj;
  } else {
    tox = 2.0 / ax;
    m = 2 * ((n + (int)sqrt(40.0 * n)) / 2);
    jsum = 0;
    bjp = ans = sum = 0.0;
    bj = 1.0;
    for (j = m; j > 0; j--) {
      bjm = j * tox * bj - bjp;
      bjp = bj;
      bj = bjm;
      if (fabs(bj) > 1.0e10) {
        bj *= 1.0e-10;
        bjp *= 1.0e-10;
        ans *= 1.0e-10;
        sum *= 1.0e-10;
      }
      if (jsum)
        sum += bj;
      jsum = !jsum;
      if (j == n)
        ans = bjp;
    }
    sum = 2.0 * sum - bj;
    ans /= sum;
  }
  return x < 0.0 && (n & 1) ? -ans : ans;
}
```