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

```asm
<mp_lmpar>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  mov    %r9,%r13
  push   %r12
  mov    %r8,%r12
  push   %rbp
  mov    %edi,%ebp
  push   %rbx
  sub    $0x68,%rsp
  mov    %rsi,0x28(%rsp)
  mov    0xc0(%rsp),%rbx
  mov    %edx,0x3c(%rsp)
  mov    0xc8(%rsp),%r15
  mov    %rcx,0x20(%rsp)
  movsd  %xmm0,0x18(%rsp)
  test   %edi,%edi
  jle    L120
  lea    0x1(%rdx),%edi
  pxor   %xmm3,%xmm3
  movslq %ebp,%rdx
  mov    %ebp,%r8d
  movslq %edi,%rdi
  mov    0xa0(%rsp),%r10
  xor    %eax,%eax
  xor    %r9d,%r9d
  shl    $0x3,%rdi
  movsd  %xmm3,(%rsp)
  jmp    L357
  xchg   %ax,%ax
L324:
  add    $0x1,%rax
  add    %rdi,%rsi
  cmp    %rax,%rdx
  je     L493
L357:
  movsd  (%r10,%rax,8),%xmm0
  movsd  (%rsp),%xmm7
  movsd  %xmm0,(%rbx,%rax,8)
  ucomisd (%rsi),%xmm7
  setnp  %cl
  cmovne %r9d,%ecx
  test   %cl,%cl
  je     L381
  cmp    %r8d,%ebp
  je     L253
L381:
  cmp    %r8d,%ebp
  jle    L324
  movq   $0x0,(%rbx,%rax,8)
L122:
  add    $0x1,%rax
  add    %rdi,%rsi
  cmp    %rax,%rdx
  jne    L357
L493:
  test   %r8d,%r8d
  je     L26
  mov    0x3c(%rsp),%r11d
  mov    0x28(%rsp),%r9
  movslq %r8d,%rcx
  lea    -0x2(%r8),%edi
  lea    (%rbx,%rcx,8),%rsi
  mov    %r11d,%eax
  not    %eax
  cltq
  lea    0x0(,%rax,8),%r14
  lea    -0x1(%r8),%eax
  imul   %r11d,%eax
  neg    %r11d
  movslq %r11d,%r11
  shl    $0x3,%r11
  cltq
  add    %rax,%rcx
  lea    (%r9,%rcx,8),%r10
  lea    (%r9,%rax,8),%rcx
  nopl   (%rax)
L393:
  movsd  -0x8(%rsi),%xmm1
  divsd  -0x8(%r10),%xmm1
  movsd  %xmm1,-0x8(%rsi)
  cmp    $0xffffffff,%edi
  jne    L491
L26:
  mov    0x20(%rsp),%rsi
  mov    0xb0(%rsp),%rdi
  xor    %eax,%eax
L280:
  movsd  (%rbx,%rax,8),%xmm0
  movslq (%rsi,%rax,4),%rcx
  add    $0x1,%rax
  movsd  %xmm0,(%rdi,%rcx,8)
  cmp    %rax,%rdx
  jne    L280
  mov    0xb0(%rsp),%rsi
  xor    %eax,%eax
  nopl   0x0(%rax)
L401:
  movslq (%r12,%rax,4),%rcx
  movsd  0x0(%r13,%rcx,8),%xmm0
  mulsd  (%rsi,%rax,8),%xmm0
  movsd  %xmm0,(%r15,%rax,8)
  add    $0x1,%rax
  cmp    %rax,%rdx
  jne    L401
  mov    %r15,%rsi
  mov    %ebp,%edi
  mov    %r8d,0x8(%rsp)
  call   <mp_enorm@plt>
  movsd  0x18(%rsp),%xmm4
  mov    0x8(%rsp),%r8d
  movsd  D39(%rip),%xmm1
  movapd %xmm0,%xmm7
  movapd %xmm0,%xmm3
  subsd  %xmm4,%xmm7
  mulsd  %xmm1,%xmm4
  movsd  %xmm7,0x30(%rsp)
  comisd %xmm7,%xmm4
  movsd  %xmm4,0x40(%rsp)
  jae    L284
  movsd  (%rsp),%xmm6
  movslq 0x3c(%rsp),%r14
  movsd  %xmm6,0x10(%rsp)
  cmp    %r8d,%ebp
  jle    L379
L179:
  test   %ebp,%ebp
  jle    L145
  mov    0x20(%rsp),%rdi
  lea    -0x1(%rbp),%eax
  mov    0x28(%rsp),%rcx
  lea    0x0(,%r14,8),%r8
  mov    0xa0(%rsp),%r9
  mov    $0x8,%edx
  mov    %rdi,%rsi
  lea    0x4(%rdi,%rax,4),%rdi
  nopw   0x0(%rax,%rax,1)
L443:
  xor    %eax,%eax
  pxor   %xmm2,%xmm2
  cs nopw 0x0(%rax,%rax,1)
L288:
  movsd  (%rcx,%rax,1),%xmm0
  mulsd  (%r9,%rax,1),%xmm0
  add    $0x8,%rax
  addsd  %xmm0,%xmm2
  cmp    %rax,%rdx
  jne    L288
  movslq (%rsi),%rax
  add    $0x4,%rsi
  add    %r8,%rcx
  movslq (%r12,%rax,4),%rax
  divsd  0x0(%r13,%rax,8),%xmm2
  movsd  %xmm2,-0x8(%rbx,%rdx,1)
  add    $0x8,%rdx
  cmp    %rsi,%rdi
  jne    L443
L145:
  mov    %rbx,%rsi
  mov    %ebp,%edi
  movsd  %xmm3,0x8(%rsp)
  movsd  %xmm1,0x50(%rsp)
  call   <mp_enorm@plt>
  movsd  0x8(%rsp),%xmm3
  movapd %xmm0,%xmm6
  divsd  0x18(%rsp),%xmm6
  ucomisd (%rsp),%xmm6
  movapd %xmm0,%xmm2
  movsd  %xmm6,0x48(%rsp)
  jp     L423
  movsd  0x50(%rsp),%xmm1
  je     L526
L423:
  mov    0xa8(%rsp),%rax
  movsd  0x10(%rsp),%xmm1
  movsd  %xmm2,0x50(%rsp)
  movsd  %xmm3,0x8(%rsp)
  movsd  (%rax),%xmm0
  call   <mp_dmax1@plt>
  mov    0xa8(%rsp),%rax
  movsd  0x48(%rsp),%xmm1
  movsd  %xmm0,(%rax)
  call   <mp_dmin1@plt>
  ucomisd (%rsp),%xmm0
  jp     L66
  movsd  0x8(%rsp),%xmm3
  movsd  0x50(%rsp),%xmm2
  jne    L66
  divsd  %xmm3,%xmm2
  movapd %xmm2,%xmm0
L66:
  mov    0xa8(%rsp),%rax
  movl   $0xa,0x50(%rsp)
  mov    %r15,0xc8(%rsp)
  mov    %ebp,%r15d
  movsd  %xmm0,(%rax)
  lea    0x0(,%r14,8),%rax
  movslq %ebp,%r14
  mov    %rbx,%rbp
  mov    %rax,0x58(%rsp)
  mov    0xc8(%rsp),%rbx
L553:
  ucomisd (%rsp),%xmm0
  jp     L388
  je     L19
L388:
  movsd  (%rsp),%xmm3
  ucomisd %xmm0,%xmm3
  ja     L83
  sqrtsd %xmm0,%xmm0
L431:
  test   %r15d,%r15d
  jle    L21
  xor    %eax,%eax
  nopl   0x0(%rax,%rax,1)
L566:
  movslq (%r12,%rax,4),%rdx
  movsd  0x0(%r13,%rdx,8),%xmm1
  mulsd  %xmm0,%xmm1
  movsd  %xmm1,0x0(%rbp,%rax,8)
  add    $0x1,%rax
  cmp    %rax,%r14
  jne    L566
  sub    $0x8,%rsp
  mov    %rbp,%r8
  mov    %r15d,%edi
  push   %rbx
  push   0xc8(%rsp)
  push   0xc8(%rsp)
  mov    0xc0(%rsp),%r9
  mov    0x40(%rsp),%rcx
  mov    0x5c(%rsp),%edx
  mov    0x48(%rsp),%rsi
  call   <mp_qrsolv@plt>
  mov    0xd0(%rsp),%rcx
  add    $0x20,%rsp
  xor    %eax,%eax
L548:
  movslq (%r12,%rax,4),%rdx
  movsd  0x0(%r13,%rdx,8),%xmm0
  mulsd  (%rcx,%rax,8),%xmm0
  movsd  %xmm0,(%rbx,%rax,8)
  add    $0x1,%rax
  cmp    %rax,%r14
  jne    L548
L112:
  mov    %rbx,%rsi
  mov    %r15d,%edi
  call   <mp_enorm@plt>
  movsd  0x40(%rsp),%xmm3
  movapd %xmm0,%xmm6
  subsd  0x18(%rsp),%xmm6
  movapd %xmm0,%xmm1
  movapd %xmm6,%xmm0
  andpd  D18(%rip),%xmm0
  movsd  %xmm6,0x8(%rsp)
  comisd %xmm0,%xmm3
  jae    L318
  movsd  0x10(%rsp),%xmm7
  movsd  (%rsp),%xmm3
  ucomisd %xmm3,%xmm7
  jp     L527
  jne    L527
  movsd  0x30(%rsp),%xmm5
  comisd %xmm6,%xmm5
  jb     L527
  comisd %xmm5,%xmm3
  ja     L318
L527:
  subl   $0x1,0x50(%rsp)
  je     L318
  mov    0x20(%rsp),%rsi
  xor    %eax,%eax
  test   %r15d,%r15d
  jle    L269
  nopl   0x0(%rax)
L64:
  movslq (%rsi,%rax,4),%rdx
  movsd  (%rbx,%rdx,8),%xmm0
  movslq (%r12,%rdx,4),%rcx
  divsd  %xmm1,%xmm0
  mulsd  0x0(%r13,%rcx,8),%xmm0
  movsd  %xmm0,0x0(%rbp,%rax,8)
  add    $0x1,%rax
  cmp    %rax,%r14
  jne    L64
  mov    0x28(%rsp),%rax
  mov    0x58(%rsp),%rdi
  mov    $0x1,%edx
  mov    0xb8(%rsp),%rsi
  lea    0x8(%rax),%rcx
  nopw   0x0(%rax,%rax,1)
L60:
  movsd  -0x8(%rbp,%rdx,8),%xmm1
  divsd  -0x8(%rsi,%rdx,8),%xmm1
  movsd  %xmm1,-0x8(%rbp,%rdx,8)
  cmp    %rdx,%r14
  jne    L169
L269:
  mov    %rbp,%rsi
  mov    %r15d,%edi
  call   <mp_enorm@plt>
  movsd  0x8(%rsp),%xmm4
  comisd (%rsp),%xmm4
  movapd %xmm0,%xmm2
  ja     L195
L197:
  movsd  (%rsp),%xmm4
  comisd 0x8(%rsp),%xmm4
  ja     L436
L531:
  movsd  0x8(%rsp),%xmm1
  divsd  0x18(%rsp),%xmm1
  divsd  %xmm2,%xmm1
  mov    0xa8(%rsp),%rax
  movsd  0x10(%rsp),%xmm0
  divsd  %xmm2,%xmm1
  addsd  (%rax),%xmm1
  call   <mp_dmax1@plt>
  mov    0xa8(%rsp),%rax
  movsd  0x8(%rsp),%xmm1
  movsd  %xmm0,(%rax)
  movsd  %xmm1,0x30(%rsp)
  jmp    L553
  nopl   0x0(%rax)
L253:
  movq   $0x0,(%rbx,%rax,8)
  mov    %eax,%r8d
  jmp    L122
L284:
  mov    0xa8(%rsp),%rax
  movq   $0x0,(%rax)
L318:
  add    $0x68,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
  xchg   %ax,%ax
L491:
  lea    0x1(%rdi),%r9d
  xor    %eax,%eax
  cs nopw 0x0(%rax,%rax,1)
L533:
  movsd  (%rcx,%rax,8),%xmm2
  movsd  (%rbx,%rax,8),%xmm0
  mulsd  %xmm1,%xmm2
  subsd  %xmm2,%xmm0
  movsd  %xmm0,(%rbx,%rax,8)
  add    $0x1,%rax
  cmp    %rax,%r9
  jne    L533
  sub    $0x8,%rsi
  add    %r14,%r10
  sub    $0x1,%edi
  add    %r11,%rcx
  jmp    L393
  nopw   0x0(%rax,%rax,1)
L169:
  mov    %rdx,%rax
  nopl   0x0(%rax,%rax,1)
L38:
  movsd  -0x8(%rcx,%rax,8),%xmm2
  movsd  0x0(%rbp,%rax,8),%xmm0
  mulsd  %xmm1,%xmm2
  subsd  %xmm2,%xmm0
  movsd  %xmm0,0x0(%rbp,%rax,8)
  add    $0x1,%rax
  cmp    %eax,%r15d
  jg     L38
  add    $0x1,%rdx
  add    %rdi,%rcx
  jmp    L60
  nop
L19:
  movsd  D12(%rip),%xmm1
  mulsd  0x48(%rsp),%xmm1
  mov    D6(%rip),%rax
  movq   %rax,%xmm0
  call   <mp_dmax1@plt>
  mov    0xa8(%rsp),%rax
  movsd  %xmm0,(%rax)
  jmp    L388
L436:
  mov    0xa8(%rsp),%rax
  movsd  0x48(%rsp),%xmm0
  movsd  %xmm2,0x30(%rsp)
  movsd  (%rax),%xmm1
  call   <mp_dmin1@plt>
  movsd  0x30(%rsp),%xmm2
  movsd  %xmm0,0x48(%rsp)
  jmp    L531
  xchg   %ax,%ax
L195:
  mov    0xa8(%rsp),%rax
  movsd  %xmm0,0x30(%rsp)
  movsd  0x10(%rsp),%xmm0
  movsd  (%rax),%xmm1
  call   <mp_dmax1@plt>
  movsd  0x30(%rsp),%xmm2
  movsd  %xmm0,0x10(%rsp)
  jmp    L197
L21:
  sub    $0x8,%rsp
  mov    %rbp,%r8
  mov    %r15d,%edi
  push   %rbx
  push   0xc8(%rsp)
  push   0xc8(%rsp)
  mov    0xc0(%rsp),%r9
  mov    0x40(%rsp),%rcx
  mov    0x5c(%rsp),%edx
  mov    0x48(%rsp),%rsi
  call   <mp_qrsolv@plt>
  add    $0x20,%rsp
  jmp    L112
L120:
  mov    %r15,%rsi
  call   <mp_enorm@plt>
  movsd  0x18(%rsp),%xmm6
  movsd  D39(%rip),%xmm1
  movapd %xmm0,%xmm7
  movapd %xmm0,%xmm3
  subsd  %xmm6,%xmm7
  mulsd  %xmm1,%xmm6
  movsd  %xmm7,0x30(%rsp)
  comisd %xmm7,%xmm6
  movsd  %xmm6,0x40(%rsp)
  jae    L284
  pxor   %xmm6,%xmm6
  movsd  %xmm6,(%rsp)
L379:
  mov    0x20(%rsp),%rdi
  lea    -0x1(%rbp),%r10d
  mov    %ebp,%edx
  xor    %eax,%eax
  test   %ebp,%ebp
  jle    L451
  nopl   (%rax)
L181:
  movslq (%rdi,%rax,4),%rcx
  movsd  (%r15,%rcx,8),%xmm0
  movslq (%r12,%rcx,4),%rsi
  divsd  %xmm3,%xmm0
  mulsd  0x0(%r13,%rsi,8),%xmm0
  movsd  %xmm0,(%rbx,%rax,8)
  add    $0x1,%rax
  cmp    %rax,%rdx
  jne    L181
  movslq 0x3c(%rsp),%r14
  mov    0x28(%rsp),%rcx
  mov    %rbx,%rsi
  mov    $0xffffffff,%edx
  lea    0x8(,%r14,8),%r8
  mov    %rcx,%rdi
  lea    0x0(,%r14,8),%r9
  nopl   0x0(%rax)
L385:
  pxor   %xmm2,%xmm2
  cmp    $0xffffffff,%edx
  je     L494
  xor    %eax,%eax
  nopl   0x0(%rax,%rax,1)
L150:
  movsd  (%rcx,%rax,8),%xmm0
  mulsd  (%rbx,%rax,8),%xmm0
  add    $0x1,%rax
  addsd  %xmm0,%xmm2
  cmp    %eax,%edx
  jge    L150
L494:
  movsd  (%rsi),%xmm0
  add    $0x1,%edx
  add    $0x8,%rsi
  add    %r9,%rcx
  subsd  %xmm2,%xmm0
  divsd  (%rdi),%xmm0
  add    %r8,%rdi
  movsd  %xmm0,-0x8(%rsi)
  cmp    %edx,%r10d
  jne    L385
L362:
  mov    %rbx,%rsi
  mov    %ebp,%edi
  movsd  %xmm1,0x48(%rsp)
  movsd  %xmm3,0x8(%rsp)
  call   <mp_enorm@plt>
  movsd  0x8(%rsp),%xmm3
  movsd  0x48(%rsp),%xmm1
  movapd %xmm0,%xmm2
  movsd  0x30(%rsp),%xmm0
  divsd  0x18(%rsp),%xmm0
  divsd  %xmm2,%xmm0
  divsd  %xmm2,%xmm0
  movsd  %xmm0,0x10(%rsp)
  jmp    L179
L526:
  movsd  %xmm0,0x50(%rsp)
  movsd  0x18(%rsp),%xmm0
  movsd  %xmm3,0x8(%rsp)
  call   <mp_dmin1@plt>
  movsd  D6(%rip),%xmm1
  movsd  0x50(%rsp),%xmm2
  movsd  0x8(%rsp),%xmm3
  divsd  %xmm0,%xmm1
  movsd  %xmm1,0x48(%rsp)
  jmp    L423
L451:
  movslq 0x3c(%rsp),%r14
  jmp    L362
L83:
  call   <sqrt@plt>
  jmp    L431
```

tool_calls: name: parse_data
arguments: data_label: D39
type: f64
name: parse_data
arguments: data_label: D18
type: qword[2]
name: parse_data
arguments: data_label: D12
type: f64
name: parse_data
arguments: data_label: D6
type: byte[8]

tool: D39: 0.1

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

tool: D12: 0.001

tool: {"D6": [0xca,0x49,0xe5,0x3c,0xf8,0xff,0x0f,0x38]}

assistant: ```c
void mp_lmpar(int n, double *r, int ldr, int *ipvt, int *ifree, double *diag, double *qtb, double delta, double *par, double *x, double *sdiag, double *wa1, double *wa2) {
  int i, iter, ij, jj, j, jm1, jp1, k, l, nsing;
  double dxnorm, fp, gnorm, parc, parl, paru;
  double sum, temp;
  static double zero = 0.0;
  static double p1 = 0.1;
  static double p001 = 0.001;
  nsing = n;
  jj = 0;
  for (j = 0; j < n; j++) {
    wa1[j] = qtb[j];
    if ((r[jj] == zero) && (nsing == n))
      nsing = j;
    if (nsing < n)
      wa1[j] = zero;
    jj += ldr + 1;
  }
  if (nsing >= 1) {
    for (k = 0; k < nsing; k++) {
      j = nsing - k - 1;
      wa1[j] = wa1[j] / r[j + ldr * j];
      temp = wa1[j];
      jm1 = j - 1;
      if (jm1 >= 0) {
        ij = ldr * j;
        for (i = 0; i <= jm1; i++) {
          wa1[i] -= r[ij] * temp;
          ij += 1;
        }
      }
    }
  }
  for (j = 0; j < n; j++) {
    l = ipvt[j];
    x[l] = wa1[j];
  }
  iter = 0;
  for (j = 0; j < n; j++)
    wa2[j] = diag[ifree[j]] * x[j];
  dxnorm = mp_enorm(n, wa2);
  fp = dxnorm - delta;
  if (fp <= p1 * delta) {
    goto L220;
  }
  parl = zero;
  if (nsing >= n) {
    for (j = 0; j < n; j++) {
      l = ipvt[j];
      wa1[j] = diag[ifree[l]] * (wa2[l] / dxnorm);
    }
    jj = 0;
    for (j = 0; j < n; j++) {
      sum = zero;
      jm1 = j - 1;
      if (jm1 >= 0) {
        ij = jj;
        for (i = 0; i <= jm1; i++) {
          sum += r[ij] * wa1[i];
          ij += 1;
        }
      }
      wa1[j] = (wa1[j] - sum) / r[j + ldr * j];
      jj += ldr;
    }
    temp = mp_enorm(n, wa1);
    parl = ((fp / delta) / temp) / temp;
  }
  jj = 0;
  for (j = 0; j < n; j++) {
    sum = zero;
    ij = jj;
    for (i = 0; i <= j; i++) {
      sum += r[ij] * qtb[i];
      ij += 1;
    }
    l = ipvt[j];
    wa1[j] = sum / diag[ifree[l]];
    jj += ldr;
  }
  gnorm = mp_enorm(n, wa1);
  paru = gnorm / delta;
  if (paru == zero)
    paru = 1.17549e-38 / mp_dmin1(delta, p1);
  *par = mp_dmax1(*par, parl);
  *par = mp_dmin1(*par, paru);
  if (*par == zero)
    *par = gnorm / dxnorm;
L150:
  iter += 1;
  if (*par == zero)
    *par = mp_dmax1(1.17549e-38, p001 * paru);
  temp = sqrt(*par);
  for (j = 0; j < n; j++)
    wa1[j] = temp * diag[ifree[j]];
  mp_qrsolv(n, r, ldr, ipvt, wa1, qtb, x, sdiag, wa2);
  for (j = 0; j < n; j++)
    wa2[j] = diag[ifree[j]] * x[j];
  dxnorm = mp_enorm(n, wa2);
  temp = fp;
  fp = dxnorm - delta;
  if ((fabs(fp) <= p1 * delta) || ((parl == zero) && (fp <= temp) && (temp < zero)) || (iter == 10))
    goto L220;
  for (j = 0; j < n; j++) {
    l = ipvt[j];
    wa1[j] = diag[ifree[l]] * (wa2[l] / dxnorm);
  }
  jj = 0;
  for (j = 0; j < n; j++) {
    wa1[j] = wa1[j] / sdiag[j];
    temp = wa1[j];
    jp1 = j + 1;
    if (jp1 < n) {
      ij = jp1 + jj;
      for (i = jp1; i < n; i++) {
        wa1[i] -= r[ij] * temp;
        ij += 1;
      }
    }
    jj += ldr;
  }
  temp = mp_enorm(n, wa1);
  parc = ((fp / delta) / temp) / temp;
  if (fp > zero)
    parl = mp_dmax1(parl, *par);
  if (fp < zero)
    paru = mp_dmin1(paru, *par);
  *par = mp_dmax1(parl, *par + parc);
  goto L150;
L220:
  if (iter == 0)
    *par = zero;
}
```