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

```asm
<levnsn>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x10,%rsp
  mov    %edi,-0x64(%rbp)
  mov    %rsi,-0x70(%rbp)
  mov    %rdx,-0x78(%rbp)
  mov    %rcx,-0x80(%rbp)
  mov    %r8,-0x88(%rbp)
  movl   $0x0,-0x58(%rbp)
  jmp    L91
L103:
  mov    -0x58(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x78(%rbp),%rax
  add    %rdx,%rax
  pxor   %xmm0,%xmm0
  movsd  %xmm0,(%rax)
  mov    -0x58(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x80(%rbp),%rax
  add    %rdx,%rax
  pxor   %xmm0,%xmm0
  movsd  %xmm0,(%rax)
  mov    -0x58(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x88(%rbp),%rax
  add    %rdx,%rax
  pxor   %xmm0,%xmm0
  movsd  %xmm0,(%rax)
  addl   $0x1,-0x58(%rbp)
L91:
  mov    -0x58(%rbp),%eax
  cmp    -0x64(%rbp),%eax
  jl     L103
  mov    -0x70(%rbp),%rax
  movsd  (%rax),%xmm0
  movsd  %xmm0,-0x20(%rbp)
  mov    -0x80(%rbp),%rax
  movsd  -0x20(%rbp),%xmm0
  movsd  %xmm0,(%rax)
  movsd  -0x20(%rbp),%xmm0
  movsd  %xmm0,-0x48(%rbp)
  mov    -0x70(%rbp),%rax
  add    $0x8,%rax
  movsd  (%rax),%xmm0
  movq   D14(%rip),%xmm1
  xorpd  %xmm1,%xmm0
  divsd  -0x48(%rbp),%xmm0
  movsd  %xmm0,-0x18(%rbp)
  movsd  -0x18(%rbp),%xmm0
  movapd %xmm0,%xmm1
  mulsd  %xmm0,%xmm1
  movsd  D31(%rip),%xmm0
  subsd  %xmm1,%xmm0
  movsd  -0x48(%rbp),%xmm1
  mulsd  %xmm1,%xmm0
  movsd  %xmm0,-0x48(%rbp)
  mov    -0x80(%rbp),%rax
  add    $0x8,%rax
  movsd  -0x48(%rbp),%xmm0
  movsd  %xmm0,(%rax)
  mov    -0x78(%rbp),%rax
  add    $0x8,%rax
  movsd  -0x18(%rbp),%xmm0
  movsd  %xmm0,(%rax)
  mov    -0x88(%rbp),%rax
  add    $0x8,%rax
  movsd  -0x18(%rbp),%xmm0
  movsd  %xmm0,(%rax)
  movsd  D47(%rip),%xmm0
  comisd -0x48(%rbp),%xmm0
  jbe    L7
  mov    $0x0,%eax
  jmp    L84
L7:
  movl   $0x2,-0x5c(%rbp)
  jmp    L100
L141:
  pxor   %xmm0,%xmm0
  movsd  %xmm0,-0x38(%rbp)
  mov    -0x78(%rbp),%rax
  add    $0x8,%rax
  mov    %rax,-0x30(%rbp)
  mov    -0x5c(%rbp),%eax
  cltq
  shl    $0x3,%rax
  lea    -0x8(%rax),%rdx
  mov    -0x70(%rbp),%rax
  add    %rdx,%rax
  mov    %rax,-0x28(%rbp)
  movl   $0x1,-0x54(%rbp)
  jmp    L9
L147:
  mov    -0x30(%rbp),%rax
  lea    0x8(%rax),%rdx
  mov    %rdx,-0x30(%rbp)
  movsd  (%rax),%xmm1
  mov    -0x28(%rbp),%rax
  lea    -0x8(%rax),%rdx
  mov    %rdx,-0x28(%rbp)
  movsd  (%rax),%xmm0
  mulsd  %xmm1,%xmm0
  movsd  -0x38(%rbp),%xmm1
  addsd  %xmm1,%xmm0
  movsd  %xmm0,-0x38(%rbp)
  addl   $0x1,-0x54(%rbp)
L9:
  mov    -0x54(%rbp),%eax
  cmp    -0x5c(%rbp),%eax
  jl     L147
  mov    -0x5c(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x70(%rbp),%rax
  add    %rdx,%rax
  movsd  (%rax),%xmm0
  addsd  -0x38(%rbp),%xmm0
  movq   D14(%rip),%xmm1
  xorpd  %xmm1,%xmm0
  divsd  -0x48(%rbp),%xmm0
  movsd  %xmm0,-0x18(%rbp)
  mov    -0x5c(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x88(%rbp),%rax
  add    %rdx,%rax
  movsd  -0x18(%rbp),%xmm0
  movsd  %xmm0,(%rax)
  mov    -0x5c(%rbp),%eax
  mov    %eax,%edx
  shr    $0x1f,%edx
  add    %edx,%eax
  sar    %eax
  mov    %eax,-0x50(%rbp)
  movl   $0x1,-0x54(%rbp)
  jmp    L105
L96:
  mov    -0x5c(%rbp),%eax
  sub    -0x54(%rbp),%eax
  mov    %eax,-0x4c(%rbp)
  mov    -0x54(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x78(%rbp),%rax
  add    %rdx,%rax
  movsd  (%rax),%xmm0
  movsd  %xmm0,-0x10(%rbp)
  mov    -0x4c(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x78(%rbp),%rax
  add    %rdx,%rax
  movsd  (%rax),%xmm0
  movsd  %xmm0,-0x8(%rbp)
  movsd  -0x18(%rbp),%xmm0
  mulsd  -0x8(%rbp),%xmm0
  mov    -0x54(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x78(%rbp),%rax
  add    %rdx,%rax
  addsd  -0x10(%rbp),%xmm0
  movsd  %xmm0,(%rax)
  mov    -0x58(%rbp),%eax
  cmp    -0x4c(%rbp),%eax
  je     L4
  movsd  -0x18(%rbp),%xmm0
  mulsd  -0x10(%rbp),%xmm0
  mov    -0x4c(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x78(%rbp),%rax
  add    %rdx,%rax
  addsd  -0x8(%rbp),%xmm0
  movsd  %xmm0,(%rax)
  addl   $0x1,-0x54(%rbp)
L105:
  mov    -0x54(%rbp),%eax
  cmp    -0x50(%rbp),%eax
  jle    L96
  jmp    L36
L4:
  nop
L36:
  mov    -0x5c(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x78(%rbp),%rax
  add    %rdx,%rax
  movsd  -0x18(%rbp),%xmm0
  movsd  %xmm0,(%rax)
  movsd  -0x18(%rbp),%xmm0
  movapd %xmm0,%xmm1
  mulsd  %xmm0,%xmm1
  movsd  D31(%rip),%xmm0
  subsd  %xmm1,%xmm0
  movsd  -0x48(%rbp),%xmm1
  mulsd  %xmm1,%xmm0
  movsd  %xmm0,-0x40(%rbp)
  mov    -0x5c(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x80(%rbp),%rax
  add    %rdx,%rax
  movsd  -0x40(%rbp),%xmm0
  movsd  %xmm0,(%rax)
  pxor   %xmm0,%xmm0
  comisd -0x40(%rbp),%xmm0
  jbe    L78
  movsd  -0x40(%rbp),%xmm0
  movq   D14(%rip),%xmm1
  xorpd  %xmm1,%xmm0
  movsd  %xmm0,-0x40(%rbp)
L78:
  movsd  D47(%rip),%xmm0
  comisd -0x40(%rbp),%xmm0
  jbe    L25
  mov    $0x0,%eax
  jmp    L84
L25:
  movsd  -0x40(%rbp),%xmm0
  movsd  %xmm0,-0x48(%rbp)
  addl   $0x1,-0x5c(%rbp)
L100:
  mov    -0x5c(%rbp),%eax
  cmp    -0x64(%rbp),%eax
  jl     L141
  mov    $0x0,%eax
L84:
  leave
  ret
```

tool_calls: name: disassemble_data
arguments: tag: D14
type_infered: f32[2]
name: disassemble_data
arguments: tag: D31
type_infered: f64
name: disassemble_data
arguments: tag: D47
type_infered: byte[8]

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

tool: D31: 1

tool: {"D47": [0x7b,0x14,0xae,0x47,0xe1,0x7a,0x84,0x3f]}

assistant: ```c
int levnsn(n, r, a, e, refl)
int n;
double r[], a[], e[], refl[];
{
  int k, km1, i, kmi, j;
  double ai, akk, err, err1, r0, t, akmi;
  double *pa, *pr;
  for (i = 0; i < n; i++) {
    a[i] = 0.0;
    e[i] = 0.0;
    refl[i] = 0.0;
  }
  r0 = r[0];
  e[0] = r0;
  err = r0;
  akk = -r[1] / err;
  err = (1.0 - akk * akk) * err;
  e[1] = err;
  a[1] = akk;
  refl[1] = akk;
  if (err < 1.0e-2)
    return 0;
  for (k = 2; k < n; k++) {
    t = 0.0;
    pa = &a[1];
    pr = &r[k - 1];
    for (j = 1; j < k; j++)
      t += *pa++ * *pr--;
    akk = -(r[k] + t) / err;
    refl[k] = akk;
    km1 = k / 2;
    for (j = 1; j <= km1; j++) {
      kmi = k - j;
      ai = a[j];
      akmi = a[kmi];
      a[j] = ai + akk * akmi;
      if (i == kmi)
        goto nxtk;
      a[kmi] = akmi + akk * ai;
    }
  nxtk:
    a[k] = akk;
    err1 = (1.0 - akk * akk) * err;
    e[k] = err1;
    if (err1 < 0)
      err1 = -err1;
    if (err1 < 1.0e-2)
      return 0;
    err = err1;
  }
  return 0;
}
```