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

```asm
<qrevec>:
  endbr64
  push   %r15
  lea    0x0(,%rcx,8),%eax
  mov    %ecx,%r9d
  pxor   %xmm5,%xmm5
  push   %r14
  and    $0xfffffffe,%r9d
  mov    %rdx,%r15
  movapd %xmm5,%xmm1
  push   %r13
  push   %r12
  mov    %rdi,%r12
  push   %rbp
  lea    -0x1(%rcx),%ebp
  push   %rbx
  movslq %ebp,%rbx
  sub    $0x88,%rsp
  movq   D53(%rip),%xmm3
  movsd  D5(%rip),%xmm4
  mov    %eax,0x78(%rsp)
  movslq %ecx,%rax
  movsd  D115(%rip),%xmm6
  mov    %rax,0x20(%rsp)
  lea    0x0(,%rax,8),%r14
  mov    %ecx,%eax
  shr    %eax
  movl   $0x0,0x14(%rsp)
  sub    $0x1,%eax
  mov    %rsi,0x8(%rsp)
  mov    %ecx,%esi
  shl    $0x4,%rax
  mov    %rax,(%rsp)
  mov    %r9d,%eax
  lea    0x0(,%rax,8),%r10
  mov    %ebp,%eax
  lea    0x8(,%rax,8),%rax
  mov    %rax,0x18(%rsp)
L342:
  shl    $0x3,%rbx
  jmp    L184
  nopl   0x0(%rax)
L198:
  movsd  (%r12,%rbx,1),%xmm8
  lea    -0x1(%rbp),%eax
  lea    -0x8(%rbx),%rdx
  mov    %r12,%r13
  movsd  -0x8(%r15,%rbx,1),%xmm2
  lea    (%rbx,%r12,1),%rcx
  movapd %xmm8,%xmm0
  andpd  %xmm3,%xmm0
  movapd %xmm2,%xmm7
  mulsd  %xmm4,%xmm0
  andpd  %xmm3,%xmm7
  comisd %xmm7,%xmm0
  jb     L57
  mov    %rdx,%rbx
  mov    %eax,%ebp
L184:
  test   %ebp,%ebp
  jg     L198
  xor    %eax,%eax
L104:
  add    $0x88,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
  nopl   0x0(%rax,%rax,1)
L57:
  add    %r12,%rdx
  movapd %xmm2,%xmm0
  movsd  (%rdx),%xmm10
  mulsd  %xmm2,%xmm0
  movapd %xmm10,%xmm7
  subsd  %xmm8,%xmm7
  mulsd  %xmm6,%xmm7
  movapd %xmm7,%xmm9
  mulsd  %xmm7,%xmm9
  addsd  %xmm0,%xmm9
  ucomisd %xmm9,%xmm5
  ja     L297
  sqrtsd %xmm9,%xmm9
L217:
  cmp    $0x1,%ebp
  je     L10
  andpd  %xmm3,%xmm10
  movsd  -0x10(%r15,%rbx,1),%xmm0
  mulsd  %xmm4,%xmm10
  andpd  %xmm3,%xmm0
  comisd %xmm10,%xmm0
  jbe    L10
  mov    0x78(%rsp),%edi
  cmp    %edi,0x14(%rsp)
  jg     L162
  comisd %xmm5,%xmm7
  addsd  %xmm7,%xmm8
  jbe    L235
  subsd  %xmm9,%xmm8
L316:
  movsd  (%r12),%xmm0
  lea    0x10(%r14),%rax
  xor    %edx,%edx
  xor    %ecx,%ecx
  mov    0x8(%rsp),%rbx
  mov    %r12,0x28(%rsp)
  movapd %xmm5,%xmm9
  subsd  %xmm8,%xmm0
  movsd  D134(%rip),%xmm7
  movsd  %xmm0,(%r12)
  mov    %rax,%r12
  nopl   0x0(%rax,%rax,1)
L266:
  movsd  0x0(%r13),%xmm10
  movsd  (%r15,%rcx,8),%xmm0
  mulsd  %xmm7,%xmm10
  subsd  %xmm9,%xmm10
  movapd %xmm0,%xmm9
  mulsd  %xmm0,%xmm0
  mulsd  %xmm7,%xmm9
  movapd %xmm10,%xmm2
  mulsd  %xmm10,%xmm2
  addsd  %xmm0,%xmm2
  ucomisd %xmm2,%xmm5
  ja     L1
  sqrtsd %xmm2,%xmm2
L151:
  test   %rcx,%rcx
  je     L52
  mulsd  %xmm2,%xmm1
  movsd  %xmm1,-0x8(%r15,%rcx,8)
L52:
  mulsd  %xmm2,%xmm7
  mov    %rbx,%rax
  movsd  %xmm7,0x0(%r13)
  movsd  (%r15,%rcx,8),%xmm1
  movapd %xmm7,%xmm0
  movapd %xmm10,%xmm7
  divsd  %xmm2,%xmm7
  divsd  %xmm2,%xmm1
  movsd  0x8(%r13),%xmm2
  subsd  %xmm8,%xmm2
  movapd %xmm2,%xmm10
  movsd  %xmm2,0x8(%r13)
  mulsd  %xmm1,%xmm9
  mulsd  %xmm1,%xmm10
  addsd  %xmm9,%xmm0
  mulsd  %xmm1,%xmm10
  mulsd  %xmm7,%xmm0
  addsd  %xmm10,%xmm0
  addsd  %xmm8,%xmm0
  movsd  %xmm0,0x0(%r13)
  test   %esi,%esi
  jle    L343
  lea    0x10(%rdx),%rdi
  lea    (%r14,%rdx,1),%r8
  cmp    %rdi,%r8
  lea    (%r12,%rdx,1),%r11
  setge  %dil
  cmp    %r11,%rdx
  setge  %dl
  or     %dil,%dl
  je     L107
  cmp    $0x1,%esi
  je     L107
  mov    (%rsp),%rax
  movapd %xmm7,%xmm11
  lea    (%r14,%rbx,1),%r11
  movapd %xmm1,%xmm10
  unpcklpd %xmm11,%xmm11
  mov    %r11,%rdx
  unpcklpd %xmm10,%xmm10
  lea    0x10(%rax,%rbx,1),%rdi
  mov    %rbx,%rax
  nopl   0x0(%rax)
L301:
  movupd (%rax),%xmm2
  movupd (%rdx),%xmm0
  add    $0x10,%rax
  add    $0x10,%rdx
  mulpd  %xmm10,%xmm0
  movapd %xmm2,%xmm12
  mulpd  %xmm11,%xmm12
  mulpd  %xmm10,%xmm2
  addpd  %xmm12,%xmm0
  movups %xmm0,-0x10(%rax)
  movupd -0x10(%rdx),%xmm0
  mulpd  %xmm11,%xmm0
  subpd  %xmm2,%xmm0
  movups %xmm0,-0x10(%rdx)
  cmp    %rax,%rdi
  jne    L301
  add    %r10,%rbx
  cmp    %r9d,%esi
  je     L226
  movsd  (%rbx),%xmm0
  lea    (%rbx,%r14,1),%rax
  movsd  (%rax),%xmm2
  movapd %xmm0,%xmm10
  mulsd  %xmm1,%xmm2
  mulsd  %xmm7,%xmm10
  mulsd  %xmm1,%xmm0
  addsd  %xmm10,%xmm2
  movsd  %xmm2,(%rbx)
  movsd  (%rax),%xmm2
  mulsd  %xmm7,%xmm2
  subsd  %xmm0,%xmm2
  movsd  %xmm2,(%rax)
L226:
  movsd  0x8(%r13),%xmm2
L333:
  add    $0x1,%rcx
  add    $0x8,%r13
  mov    %r11,%rbx
  mov    %r8,%rdx
  cmp    %ecx,%ebp
  jg     L266
  mulsd  %xmm7,%xmm2
  movslq %ebp,%rbx
  test   %ebp,%ebp
  mov    $0x8,%edx
  lea    0x0(,%rbx,8),%rax
  mov    0x28(%rsp),%r12
  cmovle %rdx,%rax
  addl   $0x1,0x14(%rsp)
  lea    (%r12,%rax,1),%rdx
  subsd  %xmm9,%xmm2
  movsd  %xmm2,(%rdx)
  mulsd  %xmm1,%xmm2
  movsd  %xmm2,-0x8(%r15,%rax,1)
  mulsd  (%rdx),%xmm7
  addsd  %xmm8,%xmm7
  movsd  %xmm7,(%rdx)
  jmp    L342
  nopl   (%rax)
L10:
  movapd %xmm7,%xmm0
  movsd  D134(%rip),%xmm1
  divsd  %xmm9,%xmm0
  addsd  %xmm1,%xmm0
  mulsd  %xmm6,%xmm0
  ucomisd %xmm0,%xmm5
  ja     L213
  sqrtsd %xmm0,%xmm0
L205:
  ucomisd %xmm5,%xmm0
  jp     L209
  je     L64
L209:
  movapd %xmm0,%xmm10
  movapd %xmm2,%xmm1
  addsd  %xmm0,%xmm10
  mulsd  %xmm9,%xmm10
  divsd  %xmm10,%xmm1
L64:
  imul   %esi,%eax
  addsd  %xmm8,%xmm7
  sub    $0x2,%ebp
  movapd %xmm7,%xmm2
  addsd  %xmm9,%xmm7
  cltq
  subsd  %xmm9,%xmm2
  lea    0x0(,%rax,8),%rdi
  movsd  %xmm2,(%rcx)
  mov    0x8(%rsp),%rcx
  movsd  %xmm7,(%rdx)
  lea    (%rcx,%rdi,1),%rdx
  test   %esi,%esi
  jle    L185
  mov    0x20(%rsp),%rcx
  lea    0x10(%rdi),%r8
  lea    0x2(%rax,%rcx,1),%rcx
  shl    $0x3,%rcx
  lea    -0x10(%rcx),%rax
  cmp    %rax,%r8
  setle  %r8b
  cmp    %rdi,%rcx
  setle  %cl
  or     %cl,%r8b
  je     L250
  cmp    $0x1,%esi
  je     L250
  mov    (%rsp),%rdi
  movapd %xmm0,%xmm9
  movapd %xmm1,%xmm8
  mov    %rdx,%rcx
  unpcklpd %xmm9,%xmm9
  unpcklpd %xmm8,%xmm8
  add    0x8(%rsp),%rax
  lea    0x10(%rdx,%rdi,1),%rdi
  nopl   (%rax)
L78:
  movupd (%rcx),%xmm7
  movupd (%rax),%xmm2
  add    $0x10,%rcx
  add    $0x10,%rax
  mulpd  %xmm8,%xmm2
  movapd %xmm7,%xmm10
  mulpd  %xmm9,%xmm10
  mulpd  %xmm8,%xmm7
  addpd  %xmm10,%xmm2
  movups %xmm2,-0x10(%rcx)
  movupd -0x10(%rax),%xmm2
  mulpd  %xmm9,%xmm2
  subpd  %xmm7,%xmm2
  movups %xmm2,-0x10(%rax)
  cmp    %rdi,%rcx
  jne    L78
  add    %r10,%rdx
  movslq %ebp,%rbx
  cmp    %r9d,%esi
  je     L342
  lea    (%rdx,%r14,1),%rax
  movsd  (%rdx),%xmm2
  movapd %xmm0,%xmm8
  movsd  (%rax),%xmm7
  mulsd  %xmm2,%xmm8
  mulsd  %xmm1,%xmm7
  mulsd  %xmm1,%xmm2
  addsd  %xmm8,%xmm7
  movsd  %xmm7,(%rdx)
  mulsd  (%rax),%xmm0
  subsd  %xmm2,%xmm0
  movsd  %xmm0,(%rax)
  jmp    L342
  nopl   0x0(%rax,%rax,1)
L107:
  mov    0x18(%rsp),%rdi
  lea    (%rdi,%rbx,1),%rdx
  nopl   0x0(%rax)
L111:
  movsd  (%rax),%xmm0
  movsd  (%rax,%r14,1),%xmm2
  movapd %xmm7,%xmm10
  add    $0x8,%rax
  mulsd  %xmm0,%xmm10
  mulsd  %xmm1,%xmm2
  mulsd  %xmm1,%xmm0
  addsd  %xmm10,%xmm2
  movsd  %xmm2,-0x8(%rax)
  movsd  -0x8(%rax,%r14,1),%xmm2
  mulsd  %xmm7,%xmm2
  subsd  %xmm0,%xmm2
  movsd  %xmm2,-0x8(%rax,%r14,1)
  cmp    %rdx,%rax
  jne    L111
  movsd  0x8(%r13),%xmm2
  lea    (%rbx,%r14,1),%r11
  jmp    L333
  nopl   0x0(%rax)
L343:
  lea    (%rbx,%r14,1),%r11
  lea    (%rdx,%r14,1),%r8
  jmp    L333
L235:
  addsd  %xmm9,%xmm8
  jmp    L316
L250:
  mov    0x18(%rsp),%rax
  add    %rdx,%rax
  nopw   0x0(%rax,%rax,1)
L137:
  movsd  (%rdx),%xmm2
  movsd  (%rdx,%r14,1),%xmm7
  movapd %xmm0,%xmm8
  add    $0x8,%rdx
  mulsd  %xmm2,%xmm8
  mulsd  %xmm1,%xmm7
  mulsd  %xmm1,%xmm2
  addsd  %xmm8,%xmm7
  movsd  %xmm7,-0x8(%rdx)
  movsd  -0x8(%rdx,%r14,1),%xmm7
  mulsd  %xmm0,%xmm7
  subsd  %xmm2,%xmm7
  movsd  %xmm7,-0x8(%rdx,%r14,1)
  cmp    %rdx,%rax
  jne    L137
L185:
  movslq %ebp,%rbx
  jmp    L342
L162:
  mov    $0xffffffff,%eax
  jmp    L104
L1:
  movapd %xmm2,%xmm0
  mov    %esi,0x7c(%rsp)
  mov    %r10,0x70(%rsp)
  mov    %r9d,0x68(%rsp)
  mov    %rcx,0x60(%rsp)
  mov    %rdx,0x58(%rsp)
  movsd  %xmm7,0x50(%rsp)
  movsd  %xmm9,0x48(%rsp)
  movsd  %xmm10,0x40(%rsp)
  movsd  %xmm8,0x38(%rsp)
  movsd  %xmm1,0x30(%rsp)
  call   <sqrt@plt>
  mov    D115(%rip),%rax
  mov    0x7c(%rsp),%esi
  pxor   %xmm5,%xmm5
  mov    0x70(%rsp),%r10
  mov    0x68(%rsp),%r9d
  movapd %xmm0,%xmm2
  movq   %rax,%xmm6
  mov    D5(%rip),%rax
  mov    0x60(%rsp),%rcx
  mov    0x58(%rsp),%rdx
  movq   D53(%rip),%xmm3
  movsd  0x50(%rsp),%xmm7
  movsd  0x48(%rsp),%xmm9
  movq   %rax,%xmm4
  movsd  0x40(%rsp),%xmm10
  movsd  0x38(%rsp),%xmm8
  movsd  0x30(%rsp),%xmm1
  jmp    L151
L297:
  movapd %xmm9,%xmm0
  mov    %esi,0x7c(%rsp)
  mov    %r10,0x70(%rsp)
  mov    %r9d,0x68(%rsp)
  mov    %rcx,0x60(%rsp)
  mov    %eax,0x50(%rsp)
  mov    %rdx,0x40(%rsp)
  movsd  %xmm7,0x58(%rsp)
  movsd  %xmm10,0x48(%rsp)
  movsd  %xmm1,0x38(%rsp)
  movsd  %xmm8,0x30(%rsp)
  movsd  %xmm2,0x28(%rsp)
  call   <sqrt@plt>
  mov    D115(%rip),%rax
  mov    0x7c(%rsp),%esi
  pxor   %xmm5,%xmm5
  mov    0x70(%rsp),%r10
  mov    0x68(%rsp),%r9d
  movapd %xmm0,%xmm9
  movq   %rax,%xmm6
  mov    0x60(%rsp),%rcx
  mov    D5(%rip),%rax
  movq   D53(%rip),%xmm3
  movsd  0x58(%rsp),%xmm7
  movq   %rax,%xmm4
  mov    0x40(%rsp),%rdx
  mov    0x50(%rsp),%eax
  movsd  0x48(%rsp),%xmm10
  movsd  0x38(%rsp),%xmm1
  movsd  0x30(%rsp),%xmm8
  movsd  0x28(%rsp),%xmm2
  jmp    L217
L213:
  mov    %esi,0x70(%rsp)
  mov    %r10,0x68(%rsp)
  mov    %r9d,0x60(%rsp)
  mov    %rcx,0x58(%rsp)
  mov    %eax,0x48(%rsp)
  mov    %rdx,0x38(%rsp)
  movsd  %xmm7,0x50(%rsp)
  movsd  %xmm9,0x40(%rsp)
  movsd  %xmm8,0x30(%rsp)
  movsd  %xmm2,0x28(%rsp)
  call   <sqrt@plt>
  mov    D115(%rip),%rax
  mov    0x70(%rsp),%esi
  pxor   %xmm5,%xmm5
  mov    0x68(%rsp),%r10
  mov    0x60(%rsp),%r9d
  movq   %rax,%xmm6
  mov    0x58(%rsp),%rcx
  mov    D5(%rip),%rax
  movq   D53(%rip),%xmm3
  movsd  0x50(%rsp),%xmm7
  movq   %rax,%xmm4
  mov    D134(%rip),%rax
  movsd  0x40(%rsp),%xmm9
  mov    0x38(%rsp),%rdx
  movsd  0x30(%rsp),%xmm8
  movq   %rax,%xmm1
  movsd  0x28(%rsp),%xmm2
  mov    0x48(%rsp),%eax
  jmp    L205
```

tool_calls: name: retrieve_data
arguments: label: D53
type: qword
name: retrieve_data
arguments: label: D5
type: byte[8]
name: retrieve_data
arguments: label: D115
type: f32[2]
name: retrieve_data
arguments: label: D134
type: f64

tool: D53: 9223372036854775807

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

tool: {"D115": [0.0,1.75]}

tool: D134: 1

assistant: ```c
int qrevec(double *ev, double *evec, double *dp, int n) {
  double cc, sc = 0.0, d, x, y, h, tzr = 1.e-15;
  int i, j, k, m, mqr = 8 * n;
  double *p;
  for (j = 0, m = n - 1;; ++j) {
    while (1) {
      if (m < 1)
        return 0;
      k = m - 1;
      if (fabs(dp[k]) <= fabs(ev[m]) * tzr)
        --m;
      else {
        x = (ev[k] - ev[m]) / 2.;
        h = sqrt(x * x + dp[k] * dp[k]);
        if (m > 1 && fabs(dp[m - 2]) > fabs(ev[k]) * tzr)
          break;
        if ((cc = sqrt((1. + x / h) / 2.)) != 0.)
          sc = dp[k] / (2. * cc * h);
        else
          sc = 1.;
        x += ev[m];
        ev[m--] = x - h;
        ev[m--] = x + h;
        for (i = 0, p = evec + n * (m + 1); i < n; ++i, ++p) {
          h = p[0];
          p[0] = cc * h + sc * p[n];
          p[n] = cc * p[n] - sc * h;
        }
      }
    }
    if (j > mqr)
      return -1;
    if (x > 0.)
      d = ev[m] + x - h;
    else
      d = ev[m] + x + h;
    cc = 1.;
    y = 0.;
    ev[0] -= d;
    for (k = 0; k < m; ++k) {
      x = ev[k] * cc - y;
      y = dp[k] * cc;
      h = sqrt(x * x + dp[k] * dp[k]);
      if (k > 0)
        dp[k - 1] = sc * h;
      ev[k] = cc * h;
      cc = x / h;
      sc = dp[k] / h;
      ev[k + 1] -= d;
      y *= sc;
      ev[k] = cc * (ev[k] + y) + ev[k + 1] * sc * sc + d;
      for (i = 0, p = evec + n * k; i < n; ++i, ++p) {
        h = p[0];
        p[0] = cc * h + sc * p[n];
        p[n] = cc * p[n] - sc * h;
      }
    }
    ev[k] = ev[k] * cc - y;
    dp[k - 1] = ev[k] * sc;
    ev[k] = ev[k] * cc + d;
  }
  return 0;
}
```