user: Demonstrate the C code that generates the assembly output below:

```asm
<sv2u1v>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x78,%rsp
  mov    %rdi,0x18(%rsp)
  mov    %rsi,0x28(%rsp)
  mov    %edx,0x3c(%rsp)
  mov    %rcx,0x30(%rsp)
  cmp    %r8d,%edx
  jl     L201
  mov    %rdi,%r12
  lea    (%rdx,%r8,1),%edi
  mov    %rsi,%r15
  mov    $0x8,%esi
  movslq %edi,%rdi
  mov    %edx,%ebx
  mov    %r8d,%r13d
  call   <calloc@plt>
  mov    %rax,%rbp
  movslq %ebx,%rax
  mov    %rax,%rcx
  lea    0x0(%rbp,%rax,8),%rax
  mov    %rax,0x20(%rsp)
  test   %r13d,%r13d
  jle    L513
  movslq %r13d,%rbx
  mov    %r15,%rdi
  mov    %r12,0x8(%rsp)
  lea    -0x1(%rcx),%r14d
  shl    $0x3,%rbx
  mov    %r13d,0x40(%rsp)
  mov    %r13d,%r8d
  mov    %r12,%r10
  lea    0x8(%rbx),%rax
  movq   D179(%rip),%xmm7
  pxor   %xmm2,%xmm2
  movsd  D45(%rip),%xmm5
  mov    %rax,0x10(%rsp)
  movq   D146(%rip),%xmm6
  mov    %rax,%r15
  jmp    L665
  xchg   %ax,%ax
L664:
  lea    -0x1(%r14),%r14d
  jne    L227
  movsd  (%rdi),%xmm0
  movsd  %xmm0,(%r10)
L227:
  add    %r15,%rdi
  add    $0x8,%r10
  sub    $0x1,%r8d
  je     L147
L665:
  lea    0x1(%r14),%eax
  cmp    $0x1,%eax
  jle    L664
  mov    %r14d,%eax
  lea    0x8(%rbp),%r13
  movapd %xmm2,%xmm1
  mov    %rdi,%rdx
  lea    0x0(%r13,%rax,8),%r12
  mov    %rbp,%rax
  nopl   0x0(%rax,%rax,1)
L535:
  movsd  (%rdx),%xmm0
  add    $0x8,%rax
  add    %rbx,%rdx
  movsd  %xmm0,-0x8(%rax)
  mulsd  %xmm0,%xmm0
  addsd  %xmm0,%xmm1
  cmp    %rax,%r12
  jne    L535
  comisd %xmm2,%xmm1
  ja     L753
  mov    D179(%rip),%rax
  movapd %xmm2,%xmm4
  sub    $0x1,%r14d
  movq   %rax,%xmm8
L634:
  movsd  %xmm4,(%rdi)
  add    $0x8,%r10
  add    %r15,%rdi
  movsd  %xmm8,-0x8(%r10)
  sub    $0x1,%r8d
  jne    L665
L147:
  mov    0x40(%rsp),%esi
  mov    0x8(%rsp),%r11
  xor    %edx,%edx
  mov    0x30(%rsp),%rcx
  mov    0x28(%rsp),%rdi
  lea    -0x1(%rsi),%eax
  mov    0x18(%rsp),%r9
  mov    %rsi,%r13
  lea    0x0(,%rsi,8),%r8
  mov    %rax,0x40(%rsp)
  nop
L616:
  xor    %eax,%eax
  jmp    L111
  nopl   0x0(%rax)
L142:
  movsd  (%rdi,%rax,8),%xmm0
L298:
  movsd  %xmm0,(%rcx,%rax,8)
  add    $0x1,%rax
  cmp    %rax,%rsi
  je     L50
L111:
  movapd %xmm2,%xmm0
  cmp    %eax,%edx
  jg     L298
  jne    L142
  movsd  (%r9,%rdx,8),%xmm0
  movsd  %xmm0,(%rcx,%rax,8)
  add    $0x1,%rax
  cmp    %rax,%rsi
  jne    L111
  nopl   0x0(%rax)
L50:
  add    $0x1,%rdx
  add    %r8,%rcx
  add    %r8,%rdi
  cmp    %rdx,%rsi
  jne    L616
  mov    0x28(%rsp),%rdi
  mov    0x3c(%rsp),%esi
  mov    %r13d,%edx
  xor    %eax,%eax
  mov    %r11,0x48(%rsp)
  mov    %r13d,%r12d
  xor    %r15d,%r15d
  call   <atou1@plt>
  lea    -0x2(%r13),%eax
  mov    %r13d,%edi
  pxor   %xmm2,%xmm2
  movq   D179(%rip),%xmm7
  movq   D146(%rip),%xmm6
  mov    %eax,0x8(%rsp)
  imul   %r13d,%edi
  mov    0x30(%rsp),%r14
  mov    0x48(%rsp),%r11
  movapd %xmm7,%xmm9
  movapd %xmm6,%xmm8
  nopl   0x0(%rax)
L8:
  cmp    %r12d,%r13d
  je     L319
  cmp    $0x1,%r12d
  jg     L226
L319:
  cmp    $0x1,%r12d
  je     L654
  lea    -0x1(%r12),%r8d
  cmp    $0x1,%r8d
  jg     L441
L83:
  mov    0x10(%rsp),%rax
  lea    (%r14,%rax,1),%r9
  jne    L207
  movsd  0x8(%r14),%xmm0
  mov    0x20(%rsp),%rax
  mov    %r9,%r14
  sub    %r13d,%edi
  mov    $0x1,%r12d
  subl   $0x1,0x8(%rsp)
  movsd  %xmm0,(%rax,%r15,1)
  add    $0x8,%r15
  cmp    %r12d,%r13d
  je     L319
  cmp    $0x1,%r12d
  jle    L319
L226:
  mov    %r14,%rdx
  xor    %eax,%eax
  movapd %xmm2,%xmm1
  nopl   (%rax)
L98:
  movsd  (%rdx),%xmm0
  add    %rbx,%rdx
  movsd  %xmm0,0x0(%rbp,%rax,8)
  mulsd  %xmm0,%xmm0
  add    $0x1,%rax
  addsd  %xmm0,%xmm1
  cmp    %eax,%r12d
  jg     L98
  comisd %xmm2,%xmm1
  movapd %xmm2,%xmm4
  movsd  D179(%rip),%xmm10
  ja     L20
L231:
  mov    0x18(%rsp),%rax
  lea    -0x1(%r12),%r8d
  movsd  %xmm4,(%r14)
  movsd  %xmm10,(%rax,%r15,1)
  cmp    $0x1,%r8d
  jle    L83
L441:
  mov    0x8(%rsp),%esi
  lea    0x8(%r14),%rax
  movapd %xmm2,%xmm1
  lea    0x10(%r14,%rsi,8),%rdx
  nopl   (%rax)
L405:
  movsd  (%rax),%xmm0
  add    $0x8,%rax
  mulsd  %xmm0,%xmm0
  addsd  %xmm0,%xmm1
  cmp    %rdx,%rax
  jne    L405
  comisd %xmm2,%xmm1
  ja     L279
  mov    0x10(%rsp),%rax
  movsd  D179(%rip),%xmm5
  movapd %xmm2,%xmm4
  lea    (%r14,%rax,1),%r9
L587:
  mov    0x20(%rsp),%rax
  movsd  %xmm4,0x8(%r14)
  movsd  %xmm5,(%rax,%r15,1)
L207:
  subl   $0x1,0x8(%rsp)
  mov    %r8d,%r12d
  mov    %r9,%r14
  sub    %r13d,%edi
  add    $0x8,%r15
  test   %r8d,%r8d
  jne    L8
  mov    0x30(%rsp),%r15
  mov    %r13d,%esi
  xor    %eax,%eax
  mov    %r11,0x8(%rsp)
  mov    %r15,%rdi
  call   <atovm@plt>
  mov    0x18(%rsp),%r14
  mov    0x3c(%rsp),%ecx
  xor    %eax,%eax
  mov    0x20(%rsp),%rsi
  mov    0x28(%rsp),%rdx
  mov    %r13d,%r9d
  mov    %r15,%r8
  mov    %r14,%rdi
  call   <qrbdu1@plt>
  mov    0x40(%rsp),%rdi
  mov    0x8(%rsp),%r11
  mov    %r15,%rcx
  movq   D179(%rip),%xmm1
  pxor   %xmm2,%xmm2
  lea    0x8(%r14,%rdi,8),%rsi
  jmp    L758
  nopw   0x0(%rax,%rax,1)
L309:
  add    $0x8,%r11
  add    $0x8,%rcx
  cmp    %r11,%rsi
  je     L340
L758:
  movsd  (%r11),%xmm0
  comisd %xmm0,%xmm2
  jbe    L309
  xorpd  %xmm1,%xmm0
  mov    %rcx,%rax
  xor    %edx,%edx
  movsd  %xmm0,(%r11)
  cs nopw 0x0(%rax,%rax,1)
L167:
  movsd  (%rax),%xmm0
  add    $0x1,%edx
  xorpd  %xmm1,%xmm0
  movsd  %xmm0,(%rax)
  add    %rbx,%rax
  cmp    %edx,%r13d
  jne    L167
  add    $0x8,%r11
  add    $0x8,%rcx
  cmp    %r11,%rsi
  jne    L758
  nopl   0x0(%rax)
L340:
  mov    %rbp,%rdi
  call   <free@plt>
  xor    %eax,%eax
L294:
  add    $0x78,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
  nopl   0x0(%rax)
L654:
  mov    0x18(%rsp),%rax
  movsd  (%r14),%xmm0
  xor    %r8d,%r8d
  movsd  %xmm0,(%rax,%r15,1)
  mov    0x10(%rsp),%rax
  lea    (%r14,%rax,1),%r9
  jmp    L207
L753:
  ucomisd %xmm1,%xmm2
  ja     L566
  movapd %xmm1,%xmm4
  sqrtsd %xmm4,%xmm4
L582:
  movsd  (%rdi),%xmm0
  movapd %xmm4,%xmm8
  xorpd  %xmm7,%xmm8
  comisd %xmm0,%xmm2
  ja     L430
L184:
  movapd %xmm0,%xmm3
  movapd %xmm5,%xmm10
  movapd %xmm5,%xmm9
  divsd  %xmm4,%xmm0
  mulsd  %xmm4,%xmm3
  addsd  %xmm3,%xmm1
  movsd  0x0(%rbp),%xmm3
  addsd  %xmm4,%xmm3
  movsd  %xmm3,0x0(%rbp)
  divsd  %xmm1,%xmm10
  movapd %xmm0,%xmm4
  andpd  %xmm6,%xmm4
  addsd  %xmm5,%xmm4
  divsd  %xmm3,%xmm9
  cmp    $0x1,%r8d
  je     L325
  lea    -0x2(%r8),%eax
  lea    0x8(%rdi),%r9
  lea    0x10(%rdi,%rax,8),%r11
  nopl   0x0(%rax,%rax,1)
L389:
  mov    %r9,%rdx
  mov    %r13,%rcx
  mov    %r13,%rax
  mov    %r9,%rsi
  movapd %xmm3,%xmm0
  movapd %xmm2,%xmm1
  jmp    L556
  cs nopw 0x0(%rax,%rax,1)
L130:
  movsd  (%rax),%xmm0
  add    $0x8,%rax
L556:
  mulsd  (%rsi),%xmm0
  add    %rbx,%rsi
  addsd  %xmm0,%xmm1
  cmp    %rax,%r12
  jne    L130
  mulsd  %xmm10,%xmm1
  movapd %xmm3,%xmm0
  movapd %xmm1,%xmm11
  jmp    L724
  nopl   0x0(%rax,%rax,1)
L52:
  movsd  (%rcx),%xmm0
  add    $0x8,%rcx
L724:
  mulsd  %xmm11,%xmm0
  movsd  (%rdx),%xmm1
  subsd  %xmm0,%xmm1
  movsd  %xmm1,(%rdx)
  add    %rbx,%rdx
  cmp    %rcx,%rax
  jne    L52
  add    $0x8,%r9
  cmp    %r9,%r11
  jne    L389
L325:
  lea    -0x1(%r14),%eax
  mov    %rax,%r14
  lea    0x10(%rbp,%rax,8),%rdx
  mov    %rdi,%rax
  nopl   0x0(%rax)
L233:
  movsd  0x0(%r13),%xmm0
  add    %rbx,%rax
  add    $0x8,%r13
  mulsd  %xmm9,%xmm0
  movsd  %xmm0,(%rax)
  cmp    %r13,%rdx
  jne    L233
  jmp    L634
L279:
  ucomisd %xmm1,%xmm2
  ja     L381
  movapd %xmm1,%xmm3
  sqrtsd %xmm3,%xmm3
L133:
  movsd  0x8(%r14),%xmm0
  movapd %xmm3,%xmm5
  xorpd  %xmm7,%xmm5
  comisd %xmm0,%xmm2
  ja     L492
L411:
  movapd %xmm0,%xmm4
  movapd %xmm0,%xmm10
  addsd  %xmm3,%xmm0
  mov    %r13d,%r10d
  divsd  %xmm3,%xmm4
  mov    0x10(%rsp),%rax
  shl    $0x3,%rsi
  movsd  D45(%rip),%xmm11
  mulsd  %xmm3,%xmm10
  lea    (%r14,%rax,1),%r9
  movsd  %xmm0,0x8(%r14)
  mov    %r9,%rcx
  addsd  %xmm10,%xmm1
  movapd %xmm11,%xmm10
  divsd  %xmm1,%xmm10
  andpd  %xmm6,%xmm4
  addsd  %xmm11,%xmm4
  divsd  %xmm0,%xmm11
  cmp    %edi,%r13d
  jge    L540
  nopl   0x0(%rax)
L284:
  movapd %xmm0,%xmm1
  xor    %edx,%edx
  movapd %xmm2,%xmm3
  jmp    L458
  nopl   0x0(%rax)
L479:
  movsd  0x10(%r14,%rdx,1),%xmm1
  add    $0x8,%rdx
L458:
  mulsd  (%rcx,%rdx,1),%xmm1
  addsd  %xmm1,%xmm3
  cmp    %rdx,%rsi
  jne    L479
  mulsd  %xmm10,%xmm3
  xor    %eax,%eax
  jmp    L302
  nopw   0x0(%rax,%rax,1)
L626:
  movsd  0x10(%r14,%rax,1),%xmm0
  add    $0x8,%rax
L302:
  mulsd  %xmm3,%xmm0
  movsd  (%rcx,%rax,1),%xmm1
  subsd  %xmm0,%xmm1
  movsd  %xmm1,(%rcx,%rax,1)
  cmp    %rax,%rdx
  jne    L626
  add    %r13d,%r10d
  add    %rbx,%rcx
  cmp    %edi,%r10d
  jge    L540
  movsd  0x8(%r14),%xmm0
  jmp    L284
L540:
  lea    -0x3(%r12),%edx
  lea    0x10(%r14),%rax
  lea    0x18(%r14,%rdx,8),%rdx
  nopl   0x0(%rax,%rax,1)
L456:
  movsd  (%rax),%xmm0
  add    $0x8,%rax
  mulsd  %xmm11,%xmm0
  movsd  %xmm0,-0x8(%rax)
  cmp    %rdx,%rax
  jne    L456
  jmp    L587
L492:
  movq   %xmm3,%rax
  movapd %xmm5,%xmm3
  movq   %rax,%xmm5
  jmp    L411
L430:
  movq   %xmm4,%rax
  movapd %xmm8,%xmm4
  movq   %rax,%xmm8
  jmp    L184
L20:
  ucomisd %xmm1,%xmm2
  ja     L474
  movapd %xmm1,%xmm4
  sqrtsd %xmm4,%xmm4
L710:
  movsd  (%r14),%xmm0
  movapd %xmm4,%xmm10
  xorpd  %xmm9,%xmm10
  comisd %xmm0,%xmm2
  jbe    L0
  movq   %xmm4,%rax
  movapd %xmm10,%xmm4
  movq   %rax,%xmm10
L0:
  movapd %xmm0,%xmm3
  mov    0x8(%rsp),%eax
  lea    0x8(%r14),%rcx
  movsd  D45(%rip),%xmm11
  mulsd  %xmm4,%xmm3
  divsd  %xmm4,%xmm0
  movapd %xmm11,%xmm5
  lea    0x10(%r14,%rax,8),%rsi
  addsd  %xmm3,%xmm1
  movsd  0x0(%rbp),%xmm3
  addsd  %xmm4,%xmm3
  movsd  %xmm3,0x0(%rbp)
  divsd  %xmm1,%xmm5
  movapd %xmm0,%xmm4
  andpd  %xmm8,%xmm4
  addsd  %xmm11,%xmm4
  nopl   0x0(%rax)
L106:
  mov    %rcx,%rax
  movapd %xmm3,%xmm0
  mov    %rcx,%r8
  xor    %edx,%edx
  movapd %xmm2,%xmm1
  jmp    L553
  nopw   0x0(%rax,%rax,1)
L742:
  movsd  0x0(%rbp,%rdx,8),%xmm0
L553:
  mulsd  (%r8),%xmm0
  add    $0x1,%rdx
  add    %rbx,%r8
  addsd  %xmm0,%xmm1
  cmp    %edx,%r12d
  jg     L742
  mulsd  %xmm5,%xmm1
  xor    %edx,%edx
  movapd %xmm1,%xmm11
  movapd %xmm3,%xmm1
  jmp    L335
  nopl   0x0(%rax)
L241:
  movsd  0x0(%rbp,%rdx,8),%xmm1
L335:
  mulsd  %xmm11,%xmm1
  movsd  (%rax),%xmm0
  add    $0x1,%rdx
  subsd  %xmm1,%xmm0
  movsd  %xmm0,(%rax)
  add    %rbx,%rax
  cmp    %edx,%r12d
  jg     L241
  add    $0x8,%rcx
  cmp    %rcx,%rsi
  jne    L106
  mov    0x28(%rsp),%rax
  mov    0x3c(%rsp),%esi
  xor    %ecx,%ecx
  lea    (%rax,%r15,1),%rdx
  mov    0x3c(%rsp),%eax
  test   %eax,%eax
  jle    L231
  nop
L580:
  movapd %xmm3,%xmm0
  xor    %eax,%eax
  movapd %xmm2,%xmm1
  jmp    L107
  nopl   0x0(%rax)
L162:
  movsd  0x0(%rbp,%rax,8),%xmm0
L107:
  mulsd  (%rdx,%rax,8),%xmm0
  add    $0x1,%rax
  addsd  %xmm0,%xmm1
  cmp    %eax,%r12d
  jg     L162
  mulsd  %xmm5,%xmm1
  xor    %eax,%eax
  movapd %xmm1,%xmm11
  movapd %xmm3,%xmm1
  jmp    L327
  nopl   0x0(%rax)
L127:
  movsd  0x0(%rbp,%rax,8),%xmm1
L327:
  mulsd  %xmm11,%xmm1
  movsd  (%rdx,%rax,8),%xmm0
  subsd  %xmm1,%xmm0
  movsd  %xmm0,(%rdx,%rax,8)
  add    $0x1,%rax
  cmp    %eax,%r12d
  jg     L127
  add    $0x1,%ecx
  add    %rbx,%rdx
  cmp    %ecx,%esi
  jne    L580
  jmp    L231
L513:
  mov    0x3c(%rsp),%r14d
  mov    0x28(%rsp),%r15
  mov    %r13d,%edx
  xor    %eax,%eax
  mov    %r14d,%esi
  mov    %r15,%rdi
  call   <atou1@plt>
  mov    0x30(%rsp),%rbx
  mov    %r13d,%esi
  xor    %eax,%eax
  mov    %rbx,%rdi
  call   <atovm@plt>
  mov    0x20(%rsp),%rsi
  mov    %r13d,%r9d
  mov    %rbx,%r8
  mov    0x18(%rsp),%rdi
  mov    %r14d,%ecx
  mov    %r15,%rdx
  xor    %eax,%eax
  call   <qrbdu1@plt>
  jmp    L340
L201:
  mov    $0xffffffff,%eax
  jmp    L294
L566:
  movapd %xmm1,%xmm0
  mov    %rdi,0x60(%rsp)
  mov    %r10,0x58(%rsp)
  mov    %r8d,0x50(%rsp)
  movsd  %xmm1,0x48(%rsp)
  call   <sqrt@plt>
  mov    D45(%rip),%rax
  mov    0x60(%rsp),%rdi
  pxor   %xmm2,%xmm2
  mov    0x58(%rsp),%r10
  mov    0x50(%rsp),%r8d
  movapd %xmm0,%xmm4
  movq   D146(%rip),%xmm6
  movsd  0x48(%rsp),%xmm1
  movq   %rax,%xmm5
  movq   D179(%rip),%xmm7
  jmp    L582
L474:
  movapd %xmm1,%xmm0
  mov    %r11,0x58(%rsp)
  mov    %edi,0x50(%rsp)
  movsd  %xmm1,0x48(%rsp)
  call   <sqrt@plt>
  mov    0x58(%rsp),%r11
  mov    0x50(%rsp),%edi
  pxor   %xmm2,%xmm2
  movq   D146(%rip),%xmm8
  movsd  0x48(%rsp),%xmm1
  movapd %xmm0,%xmm4
  movq   D179(%rip),%xmm9
  movapd %xmm8,%xmm6
  movapd %xmm9,%xmm7
  jmp    L710
L381:
  movapd %xmm1,%xmm0
  mov    %r11,0x68(%rsp)
  mov    %edi,0x60(%rsp)
  mov    %r8d,0x58(%rsp)
  mov    %rsi,0x50(%rsp)
  movsd  %xmm1,0x48(%rsp)
  call   <sqrt@plt>
  mov    0x68(%rsp),%r11
  mov    0x60(%rsp),%edi
  pxor   %xmm2,%xmm2
  mov    0x58(%rsp),%r8d
  mov    0x50(%rsp),%rsi
  movapd %xmm0,%xmm3
  movq   D146(%rip),%xmm8
  movsd  0x48(%rsp),%xmm1
  movq   D179(%rip),%xmm9
  movapd %xmm8,%xmm6
  movapd %xmm9,%xmm7
  jmp    L133
```

tool_calls: name: retrieve_data
arguments: label: D179
type: f32[2]
name: retrieve_data
arguments: label: D45
type: f64
name: retrieve_data
arguments: label: D146
type: qword

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

tool: D45: 1

tool: D146: 9223372036854775807

assistant: ```c
int sv2u1v(double *d, double *a, int m, double *v, int n) {
  double *p, *p1, *q, *pp, *w, *e;
  double s, t, h, r, 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, p = a; i < n; ++i, --mm, 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 = 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) = w[j++] * t;
      }
      *p = sv;
      d[i] = -h;
    }
    if (mm == 1)
      d[i] = *p;
  }
  for (i = 0, q = v, p = a; i < n; ++i) {
    for (j = 0; j < n; ++j, ++q, ++p) {
      if (j < i)
        *q = 0.;
      else if (j == i)
        *q = d[i];
      else
        *q = *p;
    }
  }
  atou1(a, m, n);
  for (i = 0, mm = n, nm = n - 1, p = v; i < n; ++i, --mm, --nm, p += n + 1) {
    if (i && 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;
          for (j = 0, q = p + k, r *= s; j < mm; q += n)
            *q -= r * w[j++];
        }
        for (k = 0, p1 = a + i; k < m; ++k, p1 += n) {
          for (j = 0, q = p1, r = 0.; j < mm;)
            r += w[j++] * *q++;
          for (j = 0, q = p1, r *= s; j < mm;)
            *q++ -= r * w[j++];
        }
      }
      *p = sv;
      d[i] = -h;
    }
    if (mm == 1)
      d[i] = *p;
    p1 = p + 1;
    if (nm > 1) {
      sv = h = 0.;
      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 * (n - i); k < ms; k += n) {
          for (j = 0, q = p1, pp = p1 + k, r = 0.; j < nm; ++j)
            r += *q++ * *pp++;
          for (j = 0, q = p1, pp = p1 + k, r *= s; 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;
  }
  atovm(v, n);
  qrbdu1(d, e, a, 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;
}
```