user: 请将这段汇编代码片段转换成等效的C代码：

```asm
<mp_lmpar>:
  endbr64
  push   %r15
  mov    %r8,%r15
  push   %r14
  mov    %rsi,%r14
  push   %r13
  push   %r12
  mov    %r9,%r12
  push   %rbp
  mov    %edi,%ebp
  push   %rbx
  sub    $0x78,%rsp
  mov    %edx,0x68(%rsp)
  mov    0xd0(%rsp),%rbx
  mov    %rcx,0x48(%rsp)
  movsd  %xmm0,0x40(%rsp)
  test   %edi,%edi
  jle    L79
  lea    0x1(%rdx),%edi
  pxor   %xmm4,%xmm4
  movslq %ebp,%rdx
  mov    %ebp,%r13d
  movslq %edi,%rdi
  mov    0xb0(%rsp),%r9
  xor    %eax,%eax
  xor    %r8d,%r8d
  shl    $0x3,%rdi
  movsd  %xmm4,0x8(%rsp)
  jmp    L26
  nopl   (%rax)
L396:
  add    $0x1,%rax
  add    %rdi,%rsi
  cmp    %rax,%rdx
  je     L687
L26:
  movsd  (%r9,%rax,8),%xmm0
  movsd  0x8(%rsp),%xmm6
  movsd  %xmm0,(%rbx,%rax,8)
  ucomisd (%rsi),%xmm6
  setnp  %cl
  cmovne %r8d,%ecx
  test   %cl,%cl
  je     L523
  cmp    %r13d,%ebp
  je     L47
L523:
  cmp    %r13d,%ebp
  jle    L396
  movq   $0x0,(%rbx,%rax,8)
L24:
  add    $0x1,%rax
  add    %rdi,%rsi
  cmp    %rax,%rdx
  jne    L26
L687:
  test   %r13d,%r13d
  je     L69
  mov    0x68(%rsp),%r9d
  movslq %r13d,%rdi
  lea    (%rbx,%rdi,8),%rsi
  mov    %r9d,%eax
  not    %eax
  cltq
  shl    $0x3,%rax
  mov    %rax,0x18(%rsp)
  lea    -0x1(%r13),%eax
  imul   %r9d,%eax
  movslq %eax,%rcx
  mov    %eax,%r11d
  mov    %r9d,%eax
  neg    %eax
  add    %rcx,%rdi
  lea    (%r14,%rcx,8),%rcx
  cltq
  lea    (%r14,%rdi,8),%r8
  lea    -0x2(%r13),%edi
  shl    $0x3,%rax
  mov    %rax,0x10(%rsp)
  nopl   0x0(%rax)
L62:
  movsd  -0x8(%rsi),%xmm0
  divsd  -0x8(%r8),%xmm0
  movsd  %xmm0,-0x8(%rsi)
  cmp    $0xffffffff,%edi
  jne    L413
L69:
  mov    0x48(%rsp),%rsi
  mov    0xc0(%rsp),%rdi
  xor    %eax,%eax
L311:
  movsd  (%rbx,%rax,8),%xmm0
  movslq (%rsi,%rax,4),%rcx
  add    $0x1,%rax
  movsd  %xmm0,(%rdi,%rcx,8)
  cmp    %rdx,%rax
  jne    L311
  mov    0xc0(%rsp),%rsi
  mov    0xd8(%rsp),%rdi
  xor    %eax,%eax
  nopl   0x0(%rax)
L284:
  movslq (%r15,%rax,4),%rcx
  movsd  (%r12,%rcx,8),%xmm0
  mulsd  (%rsi,%rax,8),%xmm0
  movsd  %xmm0,(%rdi,%rax,8)
  add    $0x1,%rax
  cmp    %rax,%rdx
  jne    L284
  mov    0xd8(%rsp),%rsi
  mov    %ebp,%edi
  call   <mp_enorm@plt>
  movsd  0x40(%rsp),%xmm7
  movsd  D54(%rip),%xmm1
  movapd %xmm0,%xmm5
  movapd %xmm0,%xmm4
  subsd  %xmm7,%xmm5
  mulsd  %xmm1,%xmm7
  movsd  %xmm5,0x18(%rsp)
  comisd %xmm5,%xmm7
  movsd  %xmm7,0x58(%rsp)
  jae    L673
  movsd  0x8(%rsp),%xmm6
  movslq 0x68(%rsp),%rax
  movsd  %xmm6,0x38(%rsp)
  mov    %rax,0x10(%rsp)
  cmp    %r13d,%ebp
  jle    L424
L289:
  test   %ebp,%ebp
  jle    L548
  mov    0x10(%rsp),%rax
  mov    %ebp,0x20(%rsp)
  lea    0x1(%rbp),%r10d
  mov    %r14,%rcx
  mov    0x68(%rsp),%r11d
  mov    0x48(%rsp),%rbp
  mov    $0x1,%edx
  xor    %esi,%esi
  mov    0xb0(%rsp),%rdi
  lea    0x0(,%rax,8),%r9
  nopl   0x0(%rax,%rax,1)
L696:
  mov    %edx,%r8d
  cmp    $0x1,%rdx
  je     L415
  mov    %edx,%r13d
  xor    %eax,%eax
  pxor   %xmm0,%xmm0
  shr    %r13d
  shl    $0x4,%r13
  nopl   (%rax)
L92:
  movupd (%rdi,%rax,1),%xmm3
  movupd (%rcx,%rax,1),%xmm5
  add    $0x10,%rax
  mulpd  %xmm5,%xmm3
  addsd  %xmm3,%xmm0
  unpckhpd %xmm3,%xmm3
  addsd  %xmm3,%xmm0
  cmp    %rax,%r13
  jne    L92
  mov    %r8d,%eax
  and    $0xfffffffe,%eax
  lea    (%rsi,%rax,1),%r13d
  cmp    %eax,%r8d
  je     L654
L362:
  cltq
  movslq %r13d,%r13
  movsd  (%rdi,%rax,8),%xmm2
  mulsd  (%r14,%r13,8),%xmm2
  addsd  %xmm2,%xmm0
L654:
  movslq -0x4(%rbp,%rdx,4),%rax
  add    %r11d,%esi
  add    %r9,%rcx
  movslq (%r15,%rax,4),%rax
  divsd  (%r12,%rax,8),%xmm0
  movsd  %xmm0,-0x8(%rbx,%rdx,8)
  add    $0x1,%rdx
  cmp    %r10,%rdx
  jne    L696
  mov    0x20(%rsp),%ebp
L548:
  mov    %rbx,%rsi
  mov    %ebp,%edi
  movsd  %xmm4,0x20(%rsp)
  movsd  %xmm1,0x28(%rsp)
  call   <mp_enorm@plt>
  movapd %xmm0,%xmm4
  divsd  0x40(%rsp),%xmm4
  ucomisd 0x8(%rsp),%xmm4
  movsd  %xmm4,0x60(%rsp)
  movq   %xmm0,%r13
  movsd  0x20(%rsp),%xmm4
  jp     L356
  movsd  0x28(%rsp),%xmm1
  je     L342
L356:
  mov    0xb8(%rsp),%rax
  movsd  0x38(%rsp),%xmm1
  movsd  %xmm4,0x20(%rsp)
  movsd  (%rax),%xmm0
  call   <mp_dmax1@plt>
  mov    0xb8(%rsp),%rax
  movsd  0x60(%rsp),%xmm1
  movsd  %xmm0,(%rax)
  call   <mp_dmin1@plt>
  ucomisd 0x8(%rsp),%xmm0
  jp     L372
  movsd  0x20(%rsp),%xmm4
  jne    L372
  movq   %r13,%xmm0
  divsd  %xmm4,%xmm0
L372:
  mov    0xb8(%rsp),%rax
  movl   $0xa,0x6c(%rsp)
  mov    %r14,0x50(%rsp)
  mov    0xd8(%rsp),%r14
  movsd  %xmm0,(%rax)
  mov    0x10(%rsp),%rax
  lea    0x8(,%rax,8),%rdi
  shl    $0x3,%rax
  mov    %rdi,0x28(%rsp)
  mov    %rax,0x20(%rsp)
L360:
  ucomisd 0x8(%rsp),%xmm0
  jp     L164
  je     L568
L164:
  movsd  0x8(%rsp),%xmm5
  ucomisd %xmm0,%xmm5
  ja     L624
  sqrtsd %xmm0,%xmm0
L332:
  test   %ebp,%ebp
  jle    L245
  movslq %ebp,%r13
  xor    %eax,%eax
  nop
L252:
  movslq (%r15,%rax,4),%rdx
  movsd  (%r12,%rdx,8),%xmm1
  mulsd  %xmm0,%xmm1
  movsd  %xmm1,(%rbx,%rax,8)
  add    $0x1,%rax
  cmp    %r13,%rax
  jne    L252
  sub    $0x8,%rsp
  mov    %rbx,%r8
  mov    %ebp,%edi
  push   %r14
  push   0xd8(%rsp)
  push   0xd8(%rsp)
  mov    0xd0(%rsp),%r9
  mov    0x68(%rsp),%rcx
  mov    0x88(%rsp),%edx
  mov    0x70(%rsp),%rsi
  call   <mp_qrsolv@plt>
  mov    0xe0(%rsp),%rcx
  add    $0x20,%rsp
  xor    %eax,%eax
  nopl   0x0(%rax)
L613:
  movslq (%r15,%rax,4),%rdx
  movsd  (%r12,%rdx,8),%xmm0
  mulsd  (%rcx,%rax,8),%xmm0
  movsd  %xmm0,(%r14,%rax,8)
  add    $0x1,%rax
  cmp    %r13,%rax
  jne    L613
L37:
  mov    %r14,%rsi
  mov    %ebp,%edi
  call   <mp_enorm@plt>
  movsd  0x58(%rsp),%xmm5
  movapd %xmm0,%xmm4
  subsd  0x40(%rsp),%xmm4
  movapd %xmm0,%xmm1
  movapd %xmm4,%xmm0
  andpd  D10(%rip),%xmm0
  movsd  %xmm4,0x10(%rsp)
  comisd %xmm0,%xmm5
  jae    L560
  movsd  0x38(%rsp),%xmm6
  movsd  0x8(%rsp),%xmm7
  ucomisd %xmm7,%xmm6
  jp     L642
  jne    L642
  movsd  0x18(%rsp),%xmm6
  comisd %xmm4,%xmm6
  jb     L642
  comisd %xmm6,%xmm7
  ja     L560
L642:
  subl   $0x1,0x6c(%rsp)
  je     L560
  mov    0x48(%rsp),%rdi
  movslq %ebp,%rdx
  xor    %eax,%eax
  test   %ebp,%ebp
  jle    L664
  nopl   0x0(%rax,%rax,1)
L337:
  movslq (%rdi,%rax,4),%rcx
  movsd  (%r14,%rcx,8),%xmm0
  movslq (%r15,%rcx,4),%rsi
  divsd  %xmm1,%xmm0
  mulsd  (%r12,%rsi,8),%xmm0
  movsd  %xmm0,(%rbx,%rax,8)
  add    $0x1,%rax
  cmp    %rdx,%rax
  jne    L337
  mov    0xc8(%rsp),%rax
  movsd  (%rbx),%xmm0
  divsd  (%rax),%xmm0
  movsd  %xmm0,(%rbx)
  cmp    $0x1,%ebp
  jne    L1
  nopl   0x0(%rax,%rax,1)
L664:
  mov    %rbx,%rsi
  mov    %ebp,%edi
  call   <mp_enorm@plt>
  movsd  0x10(%rsp),%xmm6
  comisd 0x8(%rsp),%xmm6
  movapd %xmm0,%xmm2
  ja     L222
L114:
  movsd  0x8(%rsp),%xmm4
  comisd 0x10(%rsp),%xmm4
  ja     L77
L533:
  movsd  0x10(%rsp),%xmm1
  divsd  0x40(%rsp),%xmm1
  divsd  %xmm2,%xmm1
  mov    0xb8(%rsp),%rax
  movsd  0x38(%rsp),%xmm0
  divsd  %xmm2,%xmm1
  addsd  (%rax),%xmm1
  call   <mp_dmax1@plt>
  mov    0xb8(%rsp),%rax
  movsd  0x10(%rsp),%xmm1
  movsd  %xmm0,(%rax)
  movsd  %xmm1,0x18(%rsp)
  jmp    L360
  nopw   0x0(%rax,%rax,1)
L47:
  movq   $0x0,(%rbx,%rax,8)
  mov    %eax,%r13d
  jmp    L24
L673:
  mov    0xb8(%rsp),%rax
  movq   $0x0,(%rax)
L560:
  add    $0x78,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
  xchg   %ax,%ax
L413:
  lea    0x8(%rcx),%rax
  cmp    %rax,%rbx
  je     L484
  test   %edi,%edi
  je     L484
  lea    0x1(%rdi),%r9d
  movapd %xmm0,%xmm3
  xor    %eax,%eax
  mov    %r9d,%r10d
  unpcklpd %xmm3,%xmm3
  shr    %r10d
  shl    $0x4,%r10
  nopl   (%rax)
L422:
  movupd (%rcx,%rax,1),%xmm2
  movupd (%rbx,%rax,1),%xmm1
  mulpd  %xmm3,%xmm2
  subpd  %xmm2,%xmm1
  movups %xmm1,(%rbx,%rax,1)
  add    $0x10,%rax
  cmp    %r10,%rax
  jne    L422
  mov    %r9d,%eax
  and    $0xfffffffe,%eax
  lea    (%rax,%r11,1),%r10d
  cmp    %r9d,%eax
  je     L139
  movslq %r10d,%r10
  lea    (%rbx,%rax,8),%rax
  mulsd  (%r14,%r10,8),%xmm0
  movsd  (%rax),%xmm1
  subsd  %xmm0,%xmm1
  movsd  %xmm1,(%rax)
L139:
  sub    $0x8,%rsi
  add    0x18(%rsp),%r8
  sub    $0x1,%edi
  sub    0x68(%rsp),%r11d
  add    0x10(%rsp),%rcx
  jmp    L62
  nopw   0x0(%rax,%rax,1)
L568:
  movsd  D50(%rip),%xmm1
  mulsd  0x60(%rsp),%xmm1
  mov    D6(%rip),%rax
  movq   %rax,%xmm0
  call   <mp_dmax1@plt>
  mov    0xb8(%rsp),%rax
  movsd  %xmm0,(%rax)
  jmp    L164
  nopl   0x0(%rax,%rax,1)
L1:
  mov    0x68(%rsp),%eax
  mov    0x50(%rsp),%rdi
  mov    %r12,0x30(%rsp)
  mov    $0x1,%r13d
  mov    %r14,0xd8(%rsp)
  mov    $0x1,%edx
  lea    0x1(%rax),%esi
  lea    -0x2(%rbp),%eax
  mov    %rdi,%r9
  mov    %rdi,%r14
  add    $0x2,%rax
  lea    0x10(%rdi),%r8
  mov    %esi,%r12d
  mov    %rax,0x18(%rsp)
  nopl   (%rax)
L579:
  mov    %ebp,%r10d
  mov    %edx,%ecx
  lea    (%rbx,%rdx,8),%rsi
  sub    %edx,%r10d
  cmp    %edx,%ebp
  setg   %dil
  cmp    $0x1,%r10d
  setne  %al
  test   %al,%dil
  je     L738
  cmp    %r8,%rsi
  je     L738
  cmp    %edx,%ebp
  movapd %xmm0,%xmm3
  lea    -0x8(%r8),%r11
  mov    $0x1,%eax
  cmovle %eax,%r10d
  unpcklpd %xmm3,%xmm3
  xor    %eax,%eax
  mov    %r10d,%edi
  shr    %edi
  shl    $0x4,%rdi
  nopl   (%rax)
L224:
  movupd (%r11,%rax,1),%xmm2
  movupd (%rsi,%rax,1),%xmm1
  mulpd  %xmm3,%xmm2
  subpd  %xmm2,%xmm1
  movups %xmm1,(%rsi,%rax,1)
  add    $0x10,%rax
  cmp    %rdi,%rax
  jne    L224
  mov    %r10d,%eax
  and    $0xfffffffe,%eax
  add    %eax,%ecx
  lea    0x0(%r13,%rax,1),%esi
  cmp    %r10d,%eax
  je     L142
  movslq %esi,%rsi
  movslq %ecx,%rcx
  mulsd  (%r14,%rsi,8),%xmm0
  lea    (%rbx,%rcx,8),%rax
  movsd  (%rax),%xmm1
  subsd  %xmm0,%xmm1
  movsd  %xmm1,(%rax)
L142:
  mov    0xc8(%rsp),%rax
  movsd  (%rbx,%rdx,8),%xmm0
  add    %r12d,%r13d
  add    0x28(%rsp),%r8
  add    0x20(%rsp),%r9
  divsd  (%rax,%rdx,8),%xmm0
  movsd  %xmm0,(%rbx,%rdx,8)
  add    $0x1,%rdx
  cmp    0x18(%rsp),%rdx
  jne    L579
  mov    0x30(%rsp),%r12
  mov    0xd8(%rsp),%r14
  jmp    L664
  nopl   0x0(%rax,%rax,1)
L738:
  mov    %rdx,%rax
  nopl   0x0(%rax,%rax,1)
L195:
  movsd  (%r9,%rax,8),%xmm2
  movsd  (%rbx,%rax,8),%xmm1
  mulsd  %xmm0,%xmm2
  subsd  %xmm2,%xmm1
  movsd  %xmm1,(%rbx,%rax,8)
  add    $0x1,%rax
  cmp    %eax,%ebp
  jg     L195
  jmp    L142
  nopw   0x0(%rax,%rax,1)
L77:
  mov    0xb8(%rsp),%rax
  movsd  0x60(%rsp),%xmm0
  movsd  %xmm2,0x18(%rsp)
  movsd  (%rax),%xmm1
  call   <mp_dmin1@plt>
  movsd  0x18(%rsp),%xmm2
  movsd  %xmm0,0x60(%rsp)
  jmp    L533
  cs nopw 0x0(%rax,%rax,1)
L222:
  mov    0xb8(%rsp),%rax
  movsd  %xmm0,0x18(%rsp)
  movsd  0x38(%rsp),%xmm0
  movsd  (%rax),%xmm1
  call   <mp_dmax1@plt>
  movsd  0x18(%rsp),%xmm2
  movsd  %xmm0,0x38(%rsp)
  jmp    L114
L415:
  mov    %esi,%r13d
  pxor   %xmm0,%xmm0
  xor    %eax,%eax
  jmp    L362
L245:
  sub    $0x8,%rsp
  mov    %rbx,%r8
  mov    %ebp,%edi
  push   %r14
  push   0xd8(%rsp)
  push   0xd8(%rsp)
  mov    0xd0(%rsp),%r9
  mov    0x68(%rsp),%rcx
  mov    0x88(%rsp),%edx
  mov    0x70(%rsp),%rsi
  call   <mp_qrsolv@plt>
  add    $0x20,%rsp
  jmp    L37
L484:
  lea    0x1(%rdi),%r9d
  xor    %eax,%eax
  nopw   0x0(%rax,%rax,1)
L637:
  movsd  (%rcx,%rax,8),%xmm2
  movsd  (%rbx,%rax,8),%xmm1
  mulsd  %xmm0,%xmm2
  subsd  %xmm2,%xmm1
  movsd  %xmm1,(%rbx,%rax,8)
  add    $0x1,%rax
  cmp    %r9,%rax
  jne    L637
  jmp    L139
L79:
  mov    0xd8(%rsp),%rsi
  call   <mp_enorm@plt>
  movsd  0x40(%rsp),%xmm5
  movsd  D54(%rip),%xmm1
  movapd %xmm0,%xmm7
  movapd %xmm0,%xmm4
  subsd  %xmm5,%xmm7
  mulsd  %xmm1,%xmm5
  movsd  %xmm7,0x18(%rsp)
  comisd %xmm7,%xmm5
  movsd  %xmm5,0x58(%rsp)
  jae    L673
  pxor   %xmm6,%xmm6
  movsd  %xmm6,0x8(%rsp)
L424:
  movslq %ebp,%r10
  xor    %eax,%eax
  test   %ebp,%ebp
  jle    L353
  mov    0x48(%rsp),%rsi
  mov    0xd8(%rsp),%rdi
  nopw   0x0(%rax,%rax,1)
L249:
  movslq (%rsi,%rax,4),%rdx
  movsd  (%rdi,%rdx,8),%xmm0
  movslq (%r15,%rdx,4),%rcx
  divsd  %xmm4,%xmm0
  mulsd  (%r12,%rcx,8),%xmm0
  movsd  %xmm0,(%rbx,%rax,8)
  add    $0x1,%rax
  cmp    %r10,%rax
  jne    L249
  movslq 0x68(%rsp),%rax
  mov    %ebp,0x20(%rsp)
  mov    %r14,%rsi
  mov    %r14,%rcx
  xor    %edx,%edx
  xor    %r9d,%r9d
  mov    %rax,0x10(%rsp)
  mov    %rax,%r8
  lea    0x8(,%rax,8),%r11
  lea    0x0(,%rax,8),%r13
  nopl   0x0(%rax)
L715:
  pxor   %xmm0,%xmm0
  test   %rdx,%rdx
  je     L465
  test   %edx,%edx
  mov    $0x1,%edi
  cmovg  %edx,%edi
  cmp    $0x1,%rdx
  jbe    L160
  mov    %edi,%ebp
  xor    %eax,%eax
  shr    %ebp
  shl    $0x4,%rbp
  nopw   0x0(%rax,%rax,1)
L339:
  movupd (%rbx,%rax,1),%xmm3
  movupd (%rcx,%rax,1),%xmm7
  add    $0x10,%rax
  mulpd  %xmm7,%xmm3
  addsd  %xmm3,%xmm0
  unpckhpd %xmm3,%xmm3
  addsd  %xmm3,%xmm0
  cmp    %rax,%rbp
  jne    L339
  mov    %edi,%eax
  and    $0xfffffffe,%eax
  lea    (%r9,%rax,1),%ebp
  cmp    %edi,%eax
  je     L465
L226:
  cltq
  movslq %ebp,%rbp
  movsd  (%rbx,%rax,8),%xmm2
  mulsd  (%r14,%rbp,8),%xmm2
  addsd  %xmm2,%xmm0
L465:
  movsd  (%rbx,%rdx,8),%xmm2
  add    %r8d,%r9d
  add    %r13,%rcx
  subsd  %xmm0,%xmm2
  divsd  (%rsi),%xmm2
  movsd  %xmm2,(%rbx,%rdx,8)
  add    %r11,%rsi
  add    $0x1,%rdx
  cmp    %r10,%rdx
  jne    L715
  mov    0x20(%rsp),%ebp
L452:
  mov    %rbx,%rsi
  mov    %ebp,%edi
  movsd  %xmm1,0x28(%rsp)
  movsd  %xmm4,0x20(%rsp)
  call   <mp_enorm@plt>
  movsd  0x20(%rsp),%xmm4
  movsd  0x28(%rsp),%xmm1
  movapd %xmm0,%xmm2
  movsd  0x18(%rsp),%xmm0
  divsd  0x40(%rsp),%xmm0
  divsd  %xmm2,%xmm0
  divsd  %xmm2,%xmm0
  movsd  %xmm0,0x38(%rsp)
  jmp    L289
L342:
  movsd  0x40(%rsp),%xmm0
  movsd  %xmm4,0x20(%rsp)
  call   <mp_dmin1@plt>
  movsd  D6(%rip),%xmm1
  movsd  0x20(%rsp),%xmm4
  divsd  %xmm0,%xmm1
  movsd  %xmm1,0x60(%rsp)
  jmp    L356
L160:
  mov    %r9d,%ebp
  xor    %eax,%eax
  jmp    L226
L353:
  movslq 0x68(%rsp),%rax
  mov    %rax,0x10(%rsp)
  jmp    L452
L624:
  call   <sqrt@plt>
  jmp    L332
```

tool_calls: name: extract_symbolic_data
arguments: tag: D54
type_infered: f64
name: extract_symbolic_data
arguments: tag: D10
type_infered: qword[2]
name: extract_symbolic_data
arguments: tag: D50
type_infered: f64
name: extract_symbolic_data
arguments: tag: D6
type_infered: byte[8]

tool: D54: 0.1

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

tool: D50: 0.001

tool: {"D6": [0x17,0x78,0x01,0x05,0x00,0x00,0x10,0x00]}

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 = 2.2250739e-308 / 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(2.2250739e-308, 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;
}
```