user: 请从给定的汇编指令推导出C源代码:

```asm
<svduv>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x98,%rsp
  mov    %rdi,(%rsp)
  mov    %rsi,0x30(%rsp)
  mov    %rdx,0x38(%rsp)
  mov    %ecx,0x50(%rsp)
  cmp    %r9d,%ecx
  jl     L499
  lea    (%rcx,%r9,1),%edi
  mov    %rsi,%rbp
  mov    $0x8,%esi
  mov    %ecx,%ebx
  mov    %r9d,%r15d
  mov    %r8,%r14
  call   <calloc@plt>
  mov    %rax,%r11
  movslq %ebx,%rax
  mov    %rax,%rdi
  lea    (%r11,%rax,8),%rax
  mov    %rax,0x20(%rsp)
  lea    -0x1(%r15),%eax
  mov    %eax,0x54(%rsp)
  mov    %eax,%r13d
  test   %r15d,%r15d
  jle    L622
  movslq %r15d,%rax
  lea    -0x1(%rdi),%r12d
  mov    %r14,0x40(%rsp)
  xor    %r10d,%r10d
  imul   %r15d,%edi
  lea    0x0(,%rax,8),%rbx
  shl    $0x4,%rax
  lea    0x8(%rbx),%rcx
  mov    %rax,0x48(%rsp)
  pxor   %xmm3,%xmm3
  mov    %rcx,0x18(%rsp)
  lea    0x0(%rbp,%rbx,1),%rcx
  mov    %rcx,0x10(%rsp)
  mov    %edi,0x8(%rsp)
  xchg   %ax,%ax
L26:
  lea    0x1(%r12),%eax
  cmp    $0x1,%eax
  jg     L351
  lea    -0x1(%r12),%r8d
  jne    L508
  movsd  0x0(%rbp),%xmm0
  mov    (%rsp),%rax
  movsd  %xmm0,(%rax,%r10,1)
L508:
  cmp    $0x1,%r13d
  jg     L618
  lea    -0x1(%r13),%edx
  je     L436
L486:
  mov    0x18(%rsp),%rdi
  sub    %r15d,0x8(%rsp)
  mov    %edx,%r13d
  mov    %r8d,%r12d
  add    %rdi,0x10(%rsp)
  add    $0x8,%r10
  add    %rdi,%rbp
  cmp    $0xffffffff,%edx
  jne    L26
  mov    0x40(%rsp),%r14
  mov    0x30(%rsp),%r12
  mov    %r15d,%edx
  mov    %r11,0x8(%rsp)
  mov    %r14,%rsi
  mov    %r12,%rdi
  call   <ldvmat@plt>
  mov    0x50(%rsp),%r13d
  mov    %r15d,%ecx
  mov    %r12,%rdi
  mov    0x38(%rsp),%rbp
  mov    %r13d,%edx
  mov    %rbp,%rsi
  call   <ldumat@plt>
  mov    0x20(%rsp),%rsi
  mov    %r15d,%r9d
  mov    %r14,%r8
  mov    (%rsp),%rdi
  mov    %r13d,%ecx
  mov    %rbp,%rdx
  call   <qrbdv@plt>
  cmp    $0x1,%r15d
  mov    0x8(%rsp),%r11
  pxor   %xmm3,%xmm3
  jne    L44
  mov    (%rsp),%rax
  movsd  (%rax),%xmm0
  comisd %xmm0,%xmm3
  jbe    L403
  movq   D96(%rip),%xmm1
  xorpd  %xmm1,%xmm0
  movsd  %xmm0,(%rax)
  movsd  (%r14),%xmm0
  xorpd  %xmm1,%xmm0
  movsd  %xmm0,(%r14)
L403:
  mov    %r11,%rdi
  call   <free@plt>
  xor    %eax,%eax
L664:
  add    $0x98,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
  cs nopw 0x0(%rax,%rax,1)
L618:
  mov    %r13d,%esi
  lea    0x8(%rbp),%rax
  movapd %xmm3,%xmm1
  shr    %esi
  mov    %rax,%r12
  lea    -0x1(%rsi),%edx
  shl    $0x4,%rdx
  lea    0x18(%rbp,%rdx,1),%rdx
  nopl   0x0(%rax)
L617:
  movupd (%rax),%xmm0
  add    $0x10,%rax
  mulpd  %xmm0,%xmm0
  addsd  %xmm0,%xmm1
  unpckhpd %xmm0,%xmm0
  addsd  %xmm0,%xmm1
  cmp    %rax,%rdx
  jne    L617
  mov    %r13d,%r14d
  and    $0xfffffffe,%r14d
  mov    %r14d,%r9d
  lea    0x0(,%r9,8),%rax
  mov    %rax,0x28(%rsp)
  add    %rax,%r12
  cmp    %r13d,%r14d
  je     L611
  movsd  (%r12),%xmm0
  mulsd  %xmm0,%xmm0
  addsd  %xmm0,%xmm1
L611:
  comisd %xmm3,%xmm1
  ja     L526
  movsd  D96(%rip),%xmm6
  movapd %xmm3,%xmm5
  lea    -0x1(%r13),%edx
L646:
  mov    0x20(%rsp),%rax
  movsd  %xmm5,0x8(%rbp)
  movsd  %xmm6,(%rax,%r10,1)
  jmp    L486
  nopl   0x0(%rax)
L351:
  lea    0x8(%r11),%r14
  mov    %r12d,%edi
  mov    %r11,%rax
  mov    %rbp,%rdx
  lea    (%r14,%rdi,8),%rcx
  movapd %xmm3,%xmm1
  cmp    $0x1,%r15d
  jne    L404
  nopl   0x0(%rax,%rax,1)
L50:
  movsd  (%rdx),%xmm0
  add    $0x8,%rax
  add    %rbx,%rdx
  movsd  %xmm0,-0x8(%rax)
  mulsd  %xmm0,%xmm0
  addsd  %xmm0,%xmm1
  cmp    %rcx,%rax
  jne    L50
L104:
  comisd %xmm3,%xmm1
  ja     L326
  mov    D96(%rip),%rax
  movapd %xmm3,%xmm5
  lea    -0x1(%r12),%r8d
  movq   %rax,%xmm7
L466:
  mov    (%rsp),%rax
  movsd  %xmm5,0x0(%rbp)
  movsd  %xmm7,(%rax,%r10,1)
  jmp    L508
L404:
  movsd  (%rdx),%xmm0
  add    $0x8,%rax
  add    %rbx,%rdx
  movsd  %xmm0,-0x8(%rax)
  mulsd  %xmm0,%xmm0
  addsd  %xmm0,%xmm1
  cmp    %rcx,%rax
  jne    L404
  jmp    L104
  nop
L436:
  movsd  0x8(%rbp),%xmm0
  mov    0x18(%rsp),%rdi
  mov    %r8d,%r12d
  xor    %r13d,%r13d
  mov    0x20(%rsp),%rax
  add    %rdi,0x10(%rsp)
  sub    %r15d,0x8(%rsp)
  add    %rdi,%rbp
  movsd  %xmm0,(%rax,%r10,1)
  add    $0x8,%r10
  jmp    L26
  nopl   0x0(%rax)
L526:
  ucomisd %xmm1,%xmm3
  ja     L73
  movapd %xmm1,%xmm2
  sqrtsd %xmm2,%xmm2
L268:
  movsd  0x8(%rbp),%xmm0
  movapd %xmm2,%xmm6
  xorpd  D96(%rip),%xmm6
  comisd %xmm0,%xmm3
  ja     L208
L696:
  divsd  %xmm2,%xmm0
  mov    %r10,0x88(%rsp)
  mov    %r11,0x80(%rsp)
  mov    %r8d,0x78(%rsp)
  mov    %esi,0x70(%rsp)
  movsd  %xmm6,0x68(%rsp)
  movsd  %xmm1,0x60(%rsp)
  movsd  %xmm2,0x58(%rsp)
  call   <fabs@plt>
  movsd  0x8(%rbp),%xmm0
  movsd  0x58(%rsp),%xmm2
  pxor   %xmm5,%xmm5
  movsd  0x60(%rsp),%xmm1
  cvtsi2sd %eax,%xmm5
  cmp    0x8(%rsp),%r15d
  pxor   %xmm3,%xmm3
  movapd %xmm0,%xmm7
  movsd  D11(%rip),%xmm4
  addsd  %xmm2,%xmm0
  mov    0x70(%rsp),%esi
  mulsd  %xmm2,%xmm7
  movsd  0x68(%rsp),%xmm6
  mov    0x78(%rsp),%r8d
  mov    0x80(%rsp),%r11
  mov    0x88(%rsp),%r10
  addsd  %xmm4,%xmm5
  movsd  %xmm0,0x8(%rbp)
  addsd  %xmm7,%xmm1
  movapd %xmm4,%xmm7
  divsd  %xmm0,%xmm4
  divsd  %xmm1,%xmm7
  jge    L251
  mov    0x10(%rsp),%rax
  mov    %r8d,0x60(%rsp)
  shl    $0x4,%rsi
  mov    %r15d,%edi
  mov    0x18(%rsp),%r9
  mov    0x8(%rsp),%r8d
  mov    %r11,0x58(%rsp)
  lea    0x8(%rax),%rdx
  movslq %r13d,%rax
  mov    0x28(%rsp),%r11
  mov    %r10,0x28(%rsp)
  mov    %rax,%r10
  nopl   0x0(%rax)
L369:
  xor    %eax,%eax
  movapd %xmm3,%xmm0
  xchg   %ax,%ax
L675:
  movupd 0x8(%rbp,%rax,1),%xmm2
  movupd (%rdx,%rax,1),%xmm1
  add    $0x10,%rax
  mulpd  %xmm1,%xmm2
  addsd  %xmm2,%xmm0
  unpckhpd %xmm2,%xmm2
  addsd  %xmm2,%xmm0
  cmp    %rsi,%rax
  jne    L675
  lea    (%rdx,%r11,1),%rcx
  cmp    %r13d,%r14d
  je     L652
  movsd  (%r12),%xmm1
  mulsd  (%rcx),%xmm1
  addsd  %xmm1,%xmm0
L652:
  mulsd  %xmm7,%xmm0
  cmp    $0x10,%r9
  je     L319
  movapd %xmm0,%xmm8
  xor    %eax,%eax
  unpcklpd %xmm8,%xmm8
  nopl   (%rax)
L589:
  movupd 0x8(%rbp,%rax,1),%xmm2
  movupd (%rdx,%rax,1),%xmm1
  mulpd  %xmm8,%xmm2
  subpd  %xmm2,%xmm1
  movups %xmm1,(%rdx,%rax,1)
  add    $0x10,%rax
  cmp    %rsi,%rax
  jne    L589
  cmp    %r13d,%r14d
  je     L201
  mulsd  (%r12),%xmm0
  movsd  (%rcx),%xmm1
  subsd  %xmm0,%xmm1
  movsd  %xmm1,(%rcx)
L201:
  add    %r15d,%edi
  add    %rbx,%rdx
  add    %rbx,%r9
  cmp    %r8d,%edi
  jl     L369
  mov    0x58(%rsp),%r11
  mov    0x28(%rsp),%r10
  mov    0x60(%rsp),%r8d
L251:
  lea    0x10(%rbp),%rax
  lea    -0x1(%r13),%edx
  mov    %rax,%rcx
  cmp    $0x2,%r13d
  je     L237
  mov    %edx,%esi
  movapd %xmm4,%xmm1
  shr    %esi
  unpcklpd %xmm1,%xmm1
  sub    $0x1,%esi
  shl    $0x4,%rsi
  lea    0x20(%rbp,%rsi,1),%rsi
  nopw   0x0(%rax,%rax,1)
L300:
  movupd (%rax),%xmm0
  add    $0x10,%rax
  mulpd  %xmm1,%xmm0
  movups %xmm0,-0x10(%rax)
  cmp    %rax,%rsi
  jne    L300
  mov    %edx,%eax
  and    $0xfffffffe,%eax
  mov    %eax,%esi
  lea    (%rcx,%rsi,8),%rcx
  cmp    %edx,%eax
  je     L646
L237:
  mulsd  (%rcx),%xmm4
  movsd  %xmm4,(%rcx)
  jmp    L646
  nopl   (%rax)
L319:
  xor    %eax,%eax
  nopw   0x0(%rax,%rax,1)
L603:
  movsd  0x8(%rbp,%rax,8),%xmm2
  movsd  (%rdx,%rax,8),%xmm1
  mulsd  %xmm0,%xmm2
  subsd  %xmm2,%xmm1
  movsd  %xmm1,(%rdx,%rax,8)
  add    $0x1,%rax
  cmp    %r10,%rax
  jne    L603
  jmp    L201
  cs nopw 0x0(%rax,%rax,1)
L326:
  ucomisd %xmm1,%xmm3
  ja     L206
  movapd %xmm1,%xmm2
  sqrtsd %xmm2,%xmm2
L242:
  movsd  0x0(%rbp),%xmm0
  movapd %xmm2,%xmm7
  xorpd  D96(%rip),%xmm7
  comisd %xmm0,%xmm3
  ja     L558
L489:
  mulsd  %xmm2,%xmm0
  movsd  D11(%rip),%xmm6
  mov    %r10,0x78(%rsp)
  movsd  D11(%rip),%xmm4
  mov    %rdi,0x70(%rsp)
  mov    %r11,0x58(%rsp)
  movsd  %xmm7,0x68(%rsp)
  addsd  %xmm1,%xmm0
  divsd  %xmm0,%xmm6
  movsd  (%r11),%xmm0
  addsd  %xmm2,%xmm0
  movsd  %xmm0,(%r11)
  divsd  %xmm0,%xmm4
  movsd  0x0(%rbp),%xmm0
  movsd  %xmm6,0x60(%rsp)
  divsd  %xmm2,%xmm0
  movsd  %xmm4,0x28(%rsp)
  call   <fabs@plt>
  pxor   %xmm5,%xmm5
  mov    0x58(%rsp),%r11
  movsd  0x28(%rsp),%xmm4
  cvtsi2sd %eax,%xmm5
  lea    0x1(%r13),%eax
  movsd  0x60(%rsp),%xmm6
  movsd  0x68(%rsp),%xmm7
  cmp    $0x1,%eax
  mov    0x70(%rsp),%rdi
  mov    0x78(%rsp),%r10
  pxor   %xmm3,%xmm3
  addsd  D11(%rip),%xmm5
  jle    L317
  lea    -0x1(%r13),%eax
  lea    0x8(%rbp),%r8
  lea    0x10(%rbp,%rax,8),%r9
  lea    (%r14,%rdi,8),%rsi
  cmp    $0x1,%r15d
  jne    L685
  nopw   0x0(%rax,%rax,1)
L522:
  mov    %r8,%rdx
  mov    %r11,%rax
  movapd %xmm3,%xmm1
  mov    %r8,%rcx
  nopl   (%rax)
L228:
  movsd  (%rcx),%xmm0
  mulsd  (%rax),%xmm0
  add    $0x8,%rax
  add    %rbx,%rcx
  addsd  %xmm0,%xmm1
  cmp    %rax,%rsi
  jne    L228
  mulsd  %xmm6,%xmm1
  mov    %r11,%rax
  nop
L248:
  movsd  (%rax),%xmm2
  movsd  (%rdx),%xmm0
  add    $0x8,%rax
  mulsd  %xmm1,%xmm2
  subsd  %xmm2,%xmm0
  movsd  %xmm0,(%rdx)
  add    %rbx,%rdx
  cmp    %rax,%rsi
  jne    L248
  add    $0x8,%r8
  cmp    %r9,%r8
  jne    L522
L154:
  sub    $0x1,%rdi
  mov    %rbx,%rax
  lea    -0x1(%r12),%r8d
  xor    %edx,%edx
  imul   %rdi,%rax
  test   %rbx,%rbx
  lea    0xf(%r11,%rdi,8),%rcx
  cmovs  %rax,%rdx
  add    %rbx,%rdx
  add    %rbp,%rdx
  cmp    %rdx,%rcx
  mov    $0x7,%ecx
  setb   %dl
  add    $0x7,%rax
  test   %rbx,%rbx
  cmovs  %rcx,%rax
  add    %rbx,%rax
  add    %rbp,%rax
  cmp    %r14,%rax
  setb   %al
  or     %dl,%al
  je     L479
  cmp    $0x8,%r8d
  jbe    L479
  mov    %r12d,%eax
  movapd %xmm4,%xmm1
  mov    0x48(%rsp),%rcx
  shr    %eax
  unpcklpd %xmm1,%xmm1
  sub    $0x1,%eax
  shl    $0x4,%rax
  lea    0x18(%r11,%rax,1),%rdx
  mov    0x10(%rsp),%rax
  nopl   0x0(%rax)
L441:
  movupd (%r14),%xmm0
  add    $0x10,%r14
  mulpd  %xmm1,%xmm0
  movlpd %xmm0,(%rax)
  movhpd %xmm0,(%rax,%rbx,1)
  add    %rcx,%rax
  cmp    %rdx,%r14
  jne    L441
L504:
  mov    %r12d,%eax
  or     $0x1,%eax
  and    $0x1,%r12d
  je     L466
  mov    %eax,%edx
  cltq
  mulsd  (%r11,%rax,8),%xmm4
  imul   %rbx,%rdx
  movsd  %xmm4,0x0(%rbp,%rdx,1)
  jmp    L466
  nop
L333:
  mulsd  %xmm6,%xmm1
  mov    %r11,%rax
  nopw   0x0(%rax,%rax,1)
L697:
  movsd  (%rax),%xmm2
  movsd  (%rdx),%xmm0
  add    $0x8,%rax
  mulsd  %xmm1,%xmm2
  subsd  %xmm2,%xmm0
  movsd  %xmm0,(%rdx)
  add    %rbx,%rdx
  cmp    %rsi,%rax
  jne    L697
  add    $0x8,%r8
  cmp    %r9,%r8
  je     L114
L685:
  mov    %r8,%rdx
  mov    %r11,%rax
  movapd %xmm3,%xmm1
  mov    %r8,%rcx
  cs nopw 0x0(%rax,%rax,1)
L389:
  movsd  (%rax),%xmm0
  mulsd  (%rcx),%xmm0
  add    $0x8,%rax
  add    %rbx,%rcx
  addsd  %xmm0,%xmm1
  cmp    %rax,%rsi
  jne    L389
  jmp    L333
L558:
  movq   %xmm2,%rax
  movapd %xmm7,%xmm2
  movq   %rax,%xmm7
  jmp    L489
L208:
  movq   %xmm2,%rax
  movapd %xmm6,%xmm2
  movq   %rax,%xmm6
  jmp    L696
L317:
  cmp    $0x1,%r15d
  je     L154
L114:
  sub    $0x1,%rdi
  mov    %rbx,%rax
  lea    -0x1(%r12),%r8d
  xor    %edx,%edx
  imul   %rdi,%rax
  test   %rbx,%rbx
  lea    0xf(%r11,%rdi,8),%rcx
  cmovs  %rax,%rdx
  add    %rbx,%rdx
  add    %rbp,%rdx
  cmp    %rdx,%rcx
  mov    $0x7,%ecx
  setb   %dl
  add    $0x7,%rax
  test   %rbx,%rbx
  cmovs  %rcx,%rax
  add    %rbx,%rax
  add    %rbp,%rax
  cmp    %r14,%rax
  setb   %al
  or     %dl,%al
  je     L701
  cmp    $0x8,%r8d
  jbe    L701
  mov    %r12d,%eax
  movapd %xmm4,%xmm1
  mov    0x48(%rsp),%rcx
  shr    %eax
  unpcklpd %xmm1,%xmm1
  sub    $0x1,%eax
  shl    $0x4,%rax
  lea    0x18(%r11,%rax,1),%rdx
  mov    0x10(%rsp),%rax
  nopl   (%rax)
L349:
  movupd (%r14),%xmm0
  add    $0x10,%r14
  mulpd  %xmm1,%xmm0
  movlpd %xmm0,(%rax)
  movhpd %xmm0,(%rax,%rbx,1)
  add    %rcx,%rax
  cmp    %r14,%rdx
  jne    L349
  jmp    L504
L44:
  mov    (%rsp),%rcx
  mov    0x54(%rsp),%eax
  movq   D96(%rip),%xmm1
  lea    0x8(%rcx,%rax,8),%rsi
  jmp    L190
  nopw   0x0(%rax,%rax,1)
L305:
  add    $0x8,%rcx
  add    $0x8,%r14
  cmp    %rsi,%rcx
  je     L403
L190:
  movsd  (%rcx),%xmm0
  comisd %xmm0,%xmm3
  jbe    L305
  xorpd  %xmm1,%xmm0
  mov    %r14,%rax
  xor    %edx,%edx
  movsd  %xmm0,(%rcx)
L65:
  movsd  (%rax),%xmm0
  add    $0x1,%edx
  xorpd  %xmm1,%xmm0
  movsd  %xmm0,(%rax)
  add    %rbx,%rax
  cmp    %edx,%r15d
  jne    L65
  jmp    L305
L622:
  mov    0x30(%rsp),%r13
  mov    %r15d,%edx
  mov    %r14,%rsi
  mov    %r11,0x8(%rsp)
  mov    %r13,%rdi
  call   <ldvmat@plt>
  mov    0x50(%rsp),%ebp
  mov    %r15d,%ecx
  mov    %r13,%rdi
  mov    0x38(%rsp),%rbx
  mov    %ebp,%edx
  mov    %rbx,%rsi
  call   <ldumat@plt>
  mov    0x20(%rsp),%rsi
  mov    (%rsp),%rdi
  mov    %ebp,%ecx
  mov    %r15d,%r9d
  mov    %r14,%r8
  mov    %rbx,%rdx
  call   <qrbdv@plt>
  mov    0x8(%rsp),%r11
  jmp    L403
L479:
  mov    %r8d,%eax
  lea    0x10(%r11,%rax,8),%rdx
  mov    %rbp,%rax
  nopl   0x0(%rax,%rax,1)
L658:
  movsd  (%r14),%xmm0
  add    %rbx,%rax
  add    $0x8,%r14
  mulsd  %xmm4,%xmm0
  movsd  %xmm0,(%rax)
  cmp    %r14,%rdx
  jne    L658
  jmp    L466
L701:
  mov    %r8d,%eax
  lea    0x10(%r11,%rax,8),%rdx
  mov    %rbp,%rax
L363:
  movsd  (%r14),%xmm0
  add    %rbx,%rax
  add    $0x8,%r14
  mulsd  %xmm4,%xmm0
  movsd  %xmm0,(%rax)
  cmp    %rdx,%r14
  jne    L363
  jmp    L466
L499:
  mov    $0xffffffff,%eax
  jmp    L664
L206:
  movapd %xmm1,%xmm0
  mov    %r10,0x68(%rsp)
  mov    %r11,0x60(%rsp)
  mov    %rdi,0x58(%rsp)
  movsd  %xmm1,0x28(%rsp)
  call   <sqrt@plt>
  mov    0x68(%rsp),%r10
  mov    0x60(%rsp),%r11
  pxor   %xmm3,%xmm3
  mov    0x58(%rsp),%rdi
  movsd  0x28(%rsp),%xmm1
  movapd %xmm0,%xmm2
  jmp    L242
L73:
  movapd %xmm1,%xmm0
  mov    %r10,0x78(%rsp)
  mov    %r11,0x70(%rsp)
  mov    %r8d,0x68(%rsp)
  mov    %esi,0x60(%rsp)
  movsd  %xmm1,0x58(%rsp)
  call   <sqrt@plt>
  mov    0x78(%rsp),%r10
  mov    0x70(%rsp),%r11
  pxor   %xmm3,%xmm3
  mov    0x68(%rsp),%r8d
  mov    0x60(%rsp),%esi
  movapd %xmm0,%xmm2
  movsd  0x58(%rsp),%xmm1
  jmp    L268
```

tool_calls: name: parse_data
arguments: tag: D96
data_type: f32[4]
name: parse_data
arguments: tag: D11
data_type: f64

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

tool: D11: 1

assistant: ```c
int svduv(double *d, double *a, double *u, int m, double *v, int n) {
  double *p, *p1, *q, *pp, *w, *e;
  double s, h, r, t, sv;
  int i, j, k, mm, nm, ms;
  if (m < n)
    return -1;
  w = (double *)calloc(m + n, sizeof(double));
  e = w + m;
  for (i = 0, mm = m, nm = n - 1, p = a; i < n; ++i, --mm, --nm, p += n + 1) {
    if (mm > 1) {
      sv = h = 0.;
      for (j = 0, q = p, s = 0.; j < mm; ++j, q += n) {
        w[j] = *q;
        s += *q * *q;
      }
      if (s > 0.) {
        h = sqrt(s);
        if (*p < 0.)
          h = -h;
        s += *p * h;
        s = 1. / s;
        t = 1. / (w[0] += h);
        sv = 1. + fabs(*p / h);
        for (k = 1, ms = n - i; k < ms; ++k) {
          for (j = 0, q = p + k, r = 0.; j < mm; q += n)
            r += w[j++] * *q;
          r *= s;
          for (j = 0, q = p + k; j < mm; q += n)
            *q -= r * w[j++];
        }
        for (j = 1, q = p; j < mm;)
          *(q += n) = t * w[j++];
      }
      *p = sv;
      d[i] = -h;
    }
    if (mm == 1)
      d[i] = *p;
    p1 = p + 1;
    sv = h = 0.;
    if (nm > 1) {
      for (j = 0, q = p1, s = 0.; j < nm; ++j, ++q)
        s += *q * *q;
      if (s > 0.) {
        h = sqrt(s);
        if (*p1 < 0.)
          h = -h;
        sv = 1. + fabs(*p1 / h);
        s += *p1 * h;
        s = 1. / s;
        t = 1. / (*p1 += h);
        for (k = n, ms = n * (m - i); k < ms; k += n) {
          for (j = 0, q = p1, pp = p1 + k, r = 0.; j < nm; ++j)
            r += *q++ * *pp++;
          r *= s;
          for (j = 0, q = p1, pp = p1 + k; j < nm; ++j)
            *pp++ -= r * *q++;
        }
        for (j = 1, q = p1 + 1; j < nm; ++j)
          *q++ *= t;
      }
      *p1 = sv;
      e[i] = -h;
    }
    if (nm == 1)
      e[i] = *p1;
  }
  ldvmat(a, v, n);
  ldumat(a, u, m, n);
  qrbdv(d, e, u, m, v, n);
  for (i = 0; i < n; ++i) {
    if (d[i] < 0.) {
      d[i] = -d[i];
      for (j = 0, p = v + i; j < n; ++j, p += n)
        *p = -*p;
    }
  }
  free(w);
  return 0;
}
```