user: Please show me the C implementation that matches the assembly code listed below:

```asm
<qrbdi>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x78,%rsp
  mov    %edx,0x20(%rsp)
  movsd  (%rdi),%xmm2
  andpd  D97(%rip),%xmm2
  cmp    $0x1,%edx
  jle    L309
  mov    %rdi,%r15
  mov    %rsi,%r13
  mov    %edx,%edx
  mov    $0x1,%eax
  movq   D97(%rip),%xmm3
L134:
  movsd  (%r15,%rax,8),%xmm0
  andpd  %xmm3,%xmm0
  movsd  -0x8(%r13,%rax,8),%xmm1
  andpd  %xmm3,%xmm1
  addsd  %xmm1,%xmm0
  maxsd  %xmm2,%xmm0
  movapd %xmm0,%xmm2
  add    $0x1,%rax
  cmp    %rdx,%rax
  jne    L134
  mulsd  D12(%rip),%xmm2
  movsd  %xmm2,0x30(%rsp)
  imul   $0x64,0x20(%rsp),%eax
  mov    %eax,0x5c(%rsp)
  movl   $0x0,0x24(%rsp)
  mov    %r15,%r12
  jmp    L66
L196:
  mov    0x20(%rsp),%esi
  cmp    %eax,%esi
  jle    L222
  movslq %eax,%rcx
  lea    0x0(,%rcx,8),%rbp
  lea    -0x8(%r13,%rbp,1),%rbx
  add    %r12,%rbp
  lea    -0x1(%rsi),%edx
  sub    %eax,%edx
  lea    (%rdx,%rcx,1),%rax
  lea    0x0(%r13,%rax,8),%r15
  movsd  D0(%rip),%xmm2
  pxor   %xmm1,%xmm1
  mov    %r14d,0x8(%rsp)
  mov    %r12,0x10(%rsp)
L115:
  movsd  (%rbx),%xmm0
  movapd %xmm2,%xmm4
  mulsd  %xmm0,%xmm4
  movsd  %xmm4,(%rsp)
  mov    %rbp,%r14
  mov    0x0(%rbp),%r12
  mulsd  %xmm1,%xmm0
  movsd  %xmm0,(%rbx)
  movapd %xmm4,%xmm0
  mulsd  %xmm4,%xmm0
  movq   %r12,%xmm1
  mulsd  %xmm1,%xmm1
  addsd  %xmm1,%xmm0
  pxor   %xmm7,%xmm7
  ucomisd %xmm0,%xmm7
  ja     L136
  sqrtsd %xmm0,%xmm0
L12:
  movsd  %xmm0,(%r14)
  movsd  (%rsp),%xmm2
  divsd  %xmm0,%xmm2
  movq   %r12,%xmm1
  divsd  %xmm0,%xmm1
  add    $0x8,%rbx
  add    $0x8,%rbp
  cmp    %r15,%rbx
  jne    L115
  mov    0x8(%rsp),%r14d
  mov    0x10(%rsp),%r12
L222:
  movslq %r14d,%rbp
  lea    0x0(,%rbp,8),%rdi
  mov    %rdi,0x50(%rsp)
  lea    (%r12,%rdi,1),%r15
  movsd  (%r15),%xmm3
  movsd  %xmm3,0x8(%rsp)
  movslq 0x20(%rsp),%rax
  shl    $0x3,%rax
  lea    -0x8(%r12,%rax,1),%rcx
  mov    %rcx,0x38(%rsp)
  movsd  (%rcx),%xmm6
  movsd  %xmm6,0x18(%rsp)
  lea    -0x10(%r13,%rax,1),%rax
  mov    %rax,0x40(%rsp)
  movsd  (%rax),%xmm0
  movapd %xmm3,%xmm1
  addsd  %xmm6,%xmm1
  movapd %xmm3,%xmm2
  subsd  %xmm6,%xmm2
  mulsd  %xmm2,%xmm1
  mulsd  %xmm0,%xmm0
  movapd %xmm1,%xmm5
  subsd  %xmm0,%xmm5
  movsd  %xmm5,(%rsp)
  lea    0x0(%r13,%rdi,1),%rbx
  movsd  (%rbx),%xmm6
  movsd  %xmm6,0x10(%rsp)
  mulsd  %xmm3,%xmm6
  movsd  %xmm6,0x48(%rsp)
  movapd %xmm6,%xmm1
  addsd  %xmm6,%xmm1
  movapd %xmm5,%xmm0
  mulsd  %xmm5,%xmm0
  mulsd  %xmm1,%xmm1
  addsd  %xmm1,%xmm0
  pxor   %xmm1,%xmm1
  ucomisd %xmm0,%xmm1
  ja     L284
  sqrtsd %xmm0,%xmm0
  movsd  %xmm0,0x28(%rsp)
L273:
  movsd  0x28(%rsp),%xmm7
  comisd D79(%rip),%xmm7
  ja     L275
L316:
  mov    0x40(%rsp),%rax
  movsd  0x18(%rsp),%xmm7
  movsd  %xmm7,(%rax)
  mov    0x38(%rsp),%rax
  movsd  0x8(%rsp),%xmm6
  movsd  %xmm6,(%rax)
  andpd  D97(%rip),%xmm7
  movapd %xmm7,%xmm0
  movsd  0x30(%rsp),%xmm7
  ucomisd %xmm0,%xmm7
  mov    0x58(%rsp),%eax
  cmovbe 0x20(%rsp),%eax
  mov    %eax,%esi
  lea    0x1(%r14),%eax
  cmp    %esi,%eax
  sete   %al
  movzbl %al,%eax
  sub    %eax,%esi
  mov    %esi,0x20(%rsp)
  addl   $0x1,0x24(%rsp)
  mov    0x24(%rsp),%ecx
  cmp    $0x1,%esi
  jle    L149
  cmp    %ecx,0x5c(%rsp)
  jle    L149
L66:
  mov    0x20(%rsp),%eax
  sub    $0x1,%eax
  mov    %eax,0x58(%rsp)
  test   %eax,%eax
  jle    L185
  cltq
  movsd  0x30(%rsp),%xmm1
L11:
  mov    %eax,%r14d
  movsd  -0x8(%r13,%rax,8),%xmm0
  andpd  D97(%rip),%xmm0
  comisd %xmm0,%xmm1
  ja     L222
  movsd  -0x8(%r12,%rax,8),%xmm0
  andpd  D97(%rip),%xmm0
  comisd %xmm0,%xmm1
  ja     L196
  lea    -0x1(%rax),%r14d
  sub    $0x1,%rax
  test   %eax,%eax
  jg     L11
  jmp    L222
L136:
  call   <sqrt@plt>
  jmp    L12
L185:
  mov    0x58(%rsp),%r14d
  jmp    L222
L284:
  call   <sqrt@plt>
  movsd  %xmm0,0x28(%rsp)
  jmp    L273
L275:
  movsd  (%rsp),%xmm0
  movapd %xmm7,%xmm1
  addsd  %xmm7,%xmm0
  addsd  %xmm7,%xmm1
  divsd  %xmm1,%xmm0
  pxor   %xmm1,%xmm1
  ucomisd %xmm0,%xmm1
  ja     L107
  sqrtsd %xmm0,%xmm0
  movsd  %xmm0,(%rsp)
L109:
  movsd  (%rsp),%xmm5
  ucomisd D79(%rip),%xmm5
  jp     L256
  movsd  D0(%rip),%xmm0
  jne    L256
L205:
  cmp    %r14d,0x58(%rsp)
  jle    L316
  mov    0x20(%rsp),%eax
  sub    $0x1,%eax
  mov    %eax,0x28(%rsp)
  mov    %rbp,%rax
  neg    %rax
  shl    $0x3,%rax
  mov    %rax,0x48(%rsp)
  mov    %r14d,%ebp
  mov    %r12,0x60(%rsp)
  mov    %r13,0x68(%rsp)
  mov    0x50(%rsp),%r13
  jmp    L129
L107:
  call   <sqrt@plt>
  movsd  %xmm0,(%rsp)
  jmp    L109
L256:
  movsd  0x28(%rsp),%xmm1
  mulsd  (%rsp),%xmm1
  movsd  0x48(%rsp),%xmm0
  divsd  %xmm1,%xmm0
  jmp    L205
L118:
  movapd %xmm1,%xmm0
  call   <sqrt@plt>
  movapd %xmm0,%xmm1
L51:
  movsd  %xmm1,(%r12)
  movsd  0x18(%rsp),%xmm5
  divsd  %xmm1,%xmm5
  movsd  %xmm5,(%rsp)
  movsd  0x50(%rsp),%xmm0
  divsd  %xmm1,%xmm0
L78:
  add    $0x8,%r15
  add    $0x8,%rbx
L129:
  movsd  (%rsp),%xmm3
  movapd %xmm3,%xmm2
  movsd  0x8(%rsp),%xmm4
  mulsd  %xmm4,%xmm2
  movsd  0x10(%rsp),%xmm7
  movapd %xmm7,%xmm1
  mulsd  %xmm0,%xmm1
  movapd %xmm2,%xmm5
  addsd  %xmm1,%xmm5
  movsd  %xmm5,0x8(%rsp)
  mulsd  %xmm3,%xmm7
  movapd %xmm7,%xmm2
  mulsd  %xmm0,%xmm4
  subsd  %xmm4,%xmm2
  movsd  %xmm2,0x10(%rsp)
  mov    %r15,%r12
  movapd %xmm0,%xmm6
  mulsd  0x8(%r15),%xmm6
  movsd  %xmm6,0x18(%rsp)
  movapd %xmm5,%xmm1
  mulsd  %xmm5,%xmm1
  movapd %xmm6,%xmm0
  mulsd  %xmm6,%xmm0
  addsd  %xmm0,%xmm1
  pxor   %xmm5,%xmm5
  ucomisd %xmm1,%xmm5
  ja     L199
  sqrtsd %xmm1,%xmm1
L87:
  mov    0x48(%rsp),%rax
  add    %r15,%rax
  movsd  %xmm1,(%rax,%r13,1)
  movsd  (%rsp),%xmm2
  mulsd  0x8(%r12),%xmm2
  movsd  0x8(%rsp),%xmm7
  divsd  %xmm1,%xmm7
  movsd  %xmm7,(%rsp)
  movsd  0x18(%rsp),%xmm0
  divsd  %xmm1,%xmm0
  movsd  0x10(%rsp),%xmm5
  movapd %xmm5,%xmm3
  mulsd  %xmm7,%xmm3
  movapd %xmm2,%xmm1
  mulsd  %xmm0,%xmm1
  addsd  %xmm1,%xmm3
  movsd  %xmm3,0x18(%rsp)
  mulsd  %xmm7,%xmm2
  mulsd  %xmm0,%xmm5
  subsd  %xmm5,%xmm2
  movsd  %xmm2,0x8(%rsp)
  add    $0x1,%ebp
  cmp    0x28(%rsp),%ebp
  je     L197
  mov    %rbx,%r12
  movsd  0x8(%rbx),%xmm3
  movsd  %xmm3,0x10(%rsp)
  cmp    %r14d,%ebp
  jle    L78
  movapd %xmm0,%xmm4
  movapd %xmm3,%xmm5
  mulsd  %xmm3,%xmm4
  movsd  %xmm4,0x50(%rsp)
  mulsd  (%rsp),%xmm5
  movsd  %xmm5,0x10(%rsp)
  movapd %xmm4,%xmm0
  mulsd  %xmm4,%xmm0
  movsd  0x18(%rsp),%xmm3
  movapd %xmm3,%xmm1
  mulsd  %xmm3,%xmm1
  addsd  %xmm0,%xmm1
  pxor   %xmm4,%xmm4
  ucomisd %xmm1,%xmm4
  ja     L118
  sqrtsd %xmm1,%xmm1
  jmp    L51
L199:
  movapd %xmm1,%xmm0
  call   <sqrt@plt>
  movapd %xmm0,%xmm1
  jmp    L87
L197:
  mov    0x60(%rsp),%r12
  mov    0x68(%rsp),%r13
  jmp    L316
L309:
  movl   $0x0,0x24(%rsp)
L149:
  mov    0x24(%rsp),%eax
  add    $0x78,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
```

tool_calls: name: disassemble_data
arguments: label: D97
type_infered: qword[2]
name: disassemble_data
arguments: label: D12
type_infered: byte[8]
name: disassemble_data
arguments: label: D0
type_infered: f64
name: disassemble_data
arguments: label: D79
type_infered: f64

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

tool: {"D12": [0x16,0x56,0xe7,0x9e,0xaf,0x03,0xd2,0x3c]}

tool: D0: 1

tool: D79: 0

assistant: ```c
int qrbdi(double *dm, double *em, int m) {
  int i, j, k, n;
  double u, x, y, a, b, c, s, t;
  for (j = 1, t = fabs(dm[0]); j < m; ++j)
    if ((s = fabs(dm[j]) + fabs(em[j - 1])) > t)
      t = s;
  t *= 1.e-15;
  n = 100 * m;
  for (j = 0; m > 1 && j < n; ++j) {
    for (k = m - 1; k > 0; --k) {
      if (fabs(em[k - 1]) < t)
        break;
      if (fabs(dm[k - 1]) < t) {
        for (i = k, s = 1., c = 0.; i < m; ++i) {
          a = s * em[i - 1];
          b = dm[i];
          em[i - 1] *= c;
          dm[i] = u = sqrt(a * a + b * b);
          s = -a / u;
          c = b / u;
        }
        break;
      }
    }
    y = dm[k];
    x = dm[m - 1];
    u = em[m - 2];
    a = (y + x) * (y - x) - u * u;
    s = y * em[k];
    b = s + s;
    u = sqrt(a * a + b * b);
    if (u > 0.) {
      c = sqrt((u + a) / (u + u));
      if (c != 0.)
        s /= (c * u);
      else
        s = 1.;
      for (i = k; i < m - 1; ++i) {
        b = em[i];
        if (i > k) {
          a = s * em[i];
          b *= c;
          em[i - 1] = u = sqrt(x * x + a * a);
          c = x / u;
          s = a / u;
        }
        a = c * y + s * b;
        b = c * b - s * y;
        s *= dm[i + 1];
        dm[i] = u = sqrt(a * a + s * s);
        y = c * dm[i + 1];
        c = a / u;
        s /= u;
        x = c * b + s * y;
        y = c * y - s * b;
      }
    }
    em[m - 2] = x;
    dm[m - 1] = y;
    if (fabs(x) < t)
      --m;
    if (m == k + 1)
      --m;
  }
  return j;
}
```