user: Translate the below assembly code into C programming language:

```asm
<sv2uv>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x88,%rsp
  mov    %rdi,0x38(%rsp)
  mov    %rsi,0x50(%rsp)
  mov    %rdx,0x58(%rsp)
  mov    %ecx,0x64(%rsp)
  mov    %r8,0x68(%rsp)
  mov    %r9d,0x8(%rsp)
  cmp    %r9d,%ecx
  jl     L353
  mov    %rdi,%r13
  mov    %rsi,%r12
  mov    %ecx,%ebx
  mov    %r9d,%r15d
  mov    %ecx,%eax
  add    %r9d,%eax
  mov    %eax,%edi
  mov    $0x8,%esi
  call   <calloc@plt>
  mov    %rax,%rcx
  mov    %rax,0x10(%rsp)
  movslq %ebx,%rax
  shl    $0x3,%rax
  mov    %rax,0x78(%rsp)
  add    %rax,%rcx
  mov    %rcx,0x40(%rsp)
  mov    %r15d,%ecx
  test   %r15d,%r15d
  jle    L272
  movslq %r15d,%rax
  lea    0x0(,%rax,8),%r14
  lea    0x8(%r14),%rax
  mov    %rax,0x18(%rsp)
  lea    -0x1(%rbx),%ebp
  mov    %r13,%r15
  mov    %r13,0x70(%rsp)
  mov    %ecx,0xc(%rsp)
  jmp    L315
L465:
  mov    0x10(%rsp),%rdi
  lea    0x8(%rdi),%r13
  mov    %ebp,%eax
  lea    0x0(%r13,%rax,8),%rbx
  mov    %rdi,%rax
  mov    %r12,%rdx
  pxor   %xmm4,%xmm4
  movsd  %xmm4,(%rsp)
L680:
  movsd  (%rdx),%xmm0
  movsd  %xmm0,(%rax)
  mulsd  %xmm0,%xmm0
  addsd  (%rsp),%xmm0
  movsd  %xmm0,(%rsp)
  add    %r14,%rdx
  add    $0x8,%rax
  cmp    %rbx,%rax
  jne    L680
  movapd %xmm0,%xmm5
  comisd D163(%rip),%xmm0
  ja     L443
  pxor   %xmm3,%xmm3
  movsd  %xmm3,0x20(%rsp)
L150:
  movsd  %xmm3,(%r12)
  movsd  0x20(%rsp),%xmm0
  xorpd  D100(%rip),%xmm0
  movsd  %xmm0,(%r15)
L582:
  add    0x18(%rsp),%r12
  sub    $0x1,%ebp
  add    $0x8,%r15
  subl   $0x1,0xc(%rsp)
  je     L301
L315:
  lea    0x1(%rbp),%eax
  cmp    $0x1,%eax
  jg     L465
  jne    L582
  movsd  (%r12),%xmm0
  movsd  %xmm0,(%r15)
  jmp    L582
L443:
  pxor   %xmm0,%xmm0
  ucomisd %xmm5,%xmm0
  ja     L637
  sqrtsd %xmm5,%xmm5
  movsd  %xmm5,0x20(%rsp)
L251:
  movsd  (%r12),%xmm0
  pxor   %xmm1,%xmm1
  comisd %xmm0,%xmm1
  ja     L122
L266:
  movsd  0x20(%rsp),%xmm6
  mulsd  %xmm6,%xmm0
  addsd  (%rsp),%xmm0
  movsd  D119(%rip),%xmm5
  divsd  %xmm0,%xmm5
  movsd  %xmm5,(%rsp)
  mov    0x10(%rsp),%rax
  movapd %xmm6,%xmm0
  addsd  (%rax),%xmm0
  movsd  %xmm0,(%rax)
  movsd  D119(%rip),%xmm5
  divsd  %xmm0,%xmm5
  movsd  %xmm5,0x28(%rsp)
  movsd  (%r12),%xmm0
  divsd  %xmm6,%xmm0
  call   <fabs@plt>
  pxor   %xmm3,%xmm3
  cvtsi2sd %eax,%xmm3
  addsd  D119(%rip),%xmm3
  mov    0xc(%rsp),%edi
  cmp    $0x1,%edi
  jle    L191
  lea    0x8(%r12),%rsi
  lea    -0x2(%rdi),%eax
  lea    0x10(%r12,%rax,8),%rdi
  mov    0x10(%rsp),%r8
L613:
  mov    %rsi,%rdx
  mov    %r8,%rax
  mov    %rsi,%rcx
  pxor   %xmm1,%xmm1
L375:
  movsd  (%rax),%xmm0
  mulsd  (%rcx),%xmm0
  addsd  %xmm0,%xmm1
  add    %r14,%rcx
  add    $0x8,%rax
  cmp    %rbx,%rax
  jne    L375
  mulsd  (%rsp),%xmm1
  mov    %r8,%rax
L406:
  movapd %xmm1,%xmm2
  mulsd  (%rax),%xmm2
  movsd  (%rdx),%xmm0
  subsd  %xmm2,%xmm0
  movsd  %xmm0,(%rdx)
  add    %r14,%rdx
  add    $0x8,%rax
  cmp    %rbx,%rax
  jne    L406
  add    $0x8,%rsi
  cmp    %rdi,%rsi
  jne    L613
L191:
  lea    -0x1(%rbp),%eax
  mov    0x10(%rsp),%rdi
  lea    0x10(%rdi,%rax,8),%rdx
  mov    %r12,%rax
  movsd  0x28(%rsp),%xmm1
L144:
  add    %r14,%rax
  movapd %xmm1,%xmm0
  mulsd  0x0(%r13),%xmm0
  movsd  %xmm0,(%rax)
  add    $0x8,%r13
  cmp    %rdx,%r13
  jne    L144
  jmp    L150
L637:
  movsd  (%rsp),%xmm0
  call   <sqrt@plt>
  movsd  %xmm0,0x20(%rsp)
  jmp    L251
L122:
  movsd  0x20(%rsp),%xmm4
  xorpd  D100(%rip),%xmm4
  movsd  %xmm4,0x20(%rsp)
  jmp    L266
L355:
  je     L240
L502:
  lea    0x1(%rax),%rcx
  cmp    %rax,%r15
  je     L253
  mov    %rcx,%rax
L694:
  cmp    %edx,%eax
  jge    L355
  movq   $0x0,(%rsi,%rax,8)
  jmp    L502
L240:
  movsd  (%r9,%rdx,8),%xmm0
  movsd  %xmm0,(%rsi,%rax,8)
  jmp    L502
L253:
  add    %r8,%rsi
  lea    0x1(%rdx),%rax
  cmp    %rdx,%r15
  je     L244
  mov    %rax,%rdx
L429:
  mov    %rdi,%rax
  jmp    L694
L640:
  pxor   %xmm0,%xmm0
  ucomisd %xmm4,%xmm0
  ja     L176
  sqrtsd %xmm4,%xmm4
  movq   %xmm4,%r12
L227:
  movsd  0x0(%rbp),%xmm0
  pxor   %xmm1,%xmm1
  comisd %xmm0,%xmm1
  ja     L317
L257:
  movq   %r12,%xmm6
  mulsd  %xmm6,%xmm0
  addsd  (%rsp),%xmm0
  movsd  D119(%rip),%xmm6
  divsd  %xmm0,%xmm6
  movsd  %xmm6,(%rsp)
  mov    0x10(%rsp),%rax
  movq   %r12,%xmm0
  addsd  (%rax),%xmm0
  movsd  %xmm0,(%rax)
  movsd  0x0(%rbp),%xmm0
  movq   %r12,%xmm6
  divsd  %xmm6,%xmm0
  call   <fabs@plt>
  pxor   %xmm3,%xmm3
  cvtsi2sd %eax,%xmm3
  addsd  D119(%rip),%xmm3
  lea    0x8(%rbp),%rsi
  mov    0xc(%rsp),%eax
  lea    0x10(%rbp,%rax,8),%rdi
  mov    0x10(%rsp),%r8
L231:
  mov    %rsi,%rax
  mov    %r8,%r9
  mov    %rsi,%rcx
  mov    $0x0,%edx
  pxor   %xmm1,%xmm1
L170:
  add    $0x1,%edx
  movsd  (%r9),%xmm0
  mulsd  (%rcx),%xmm0
  addsd  %xmm0,%xmm1
  add    %r14,%rcx
  add    $0x8,%r9
  cmp    %ebx,%edx
  jl     L170
  mulsd  (%rsp),%xmm1
  mov    %r8,%rcx
  mov    $0x0,%edx
L688:
  add    $0x1,%edx
  movapd %xmm1,%xmm2
  mulsd  (%rcx),%xmm2
  movsd  (%rax),%xmm0
  subsd  %xmm2,%xmm0
  movsd  %xmm0,(%rax)
  add    %r14,%rax
  add    $0x8,%rcx
  cmp    %ebx,%edx
  jl     L688
  add    $0x8,%rsi
  cmp    %rsi,%rdi
  jne    L231
  mov    0x64(%rsp),%r11d
  test   %r11d,%r11d
  jle    L356
  mov    0x20(%rsp),%rdi
  mov    %rdi,%rsi
  neg    %rsi
  mov    $0x0,%r8d
  mov    0x10(%rsp),%r9
  mov    0x78(%rsp),%r10
L16:
  lea    (%rsi,%r9,1),%rax
  mov    %r9,%rdx
  mov    $0x0,%ecx
  pxor   %xmm1,%xmm1
L368:
  add    $0x1,%ecx
  movsd  (%rdx),%xmm0
  mulsd  (%rsi,%rdx,1),%xmm0
  addsd  %xmm0,%xmm1
  add    $0x8,%rdx
  cmp    %ebx,%ecx
  jl     L368
  mulsd  (%rsp),%xmm1
  mov    $0x0,%edx
L29:
  add    $0x1,%edx
  movapd %xmm1,%xmm2
  mulsd  (%rax,%rdi,1),%xmm2
  add    $0x8,%rax
  movsd  -0x8(%rax),%xmm0
  subsd  %xmm2,%xmm0
  movsd  %xmm0,-0x8(%rax)
  cmp    %ebx,%edx
  jl     L29
  add    $0x1,%r8d
  sub    %r10,%rdi
  add    %r10,%rsi
  cmp    %r8d,%r11d
  jne    L16
  jmp    L356
L176:
  movsd  (%rsp),%xmm0
  call   <sqrt@plt>
  movq   %xmm0,%r12
  jmp    L227
L317:
  movq   %r12,%xmm4
  xorpd  D100(%rip),%xmm4
  movq   %xmm4,%r12
  jmp    L257
L516:
  cmp    $0x1,%ebx
  je     L571
L91:
  mov    %ebx,0x60(%rsp)
  lea    -0x1(%rbx),%eax
  cmp    $0x1,%eax
  jg     L689
L143:
  cmp    $0x1,%eax
  je     L169
L304:
  add    0x28(%rsp),%rbp
  add    $0x1,%r13
  subl   $0x1,0xc(%rsp)
  mov    0x8(%rsp),%edi
  sub    %edi,0x18(%rsp)
  subq   $0x8,0x20(%rsp)
  sub    $0x1,%ebx
  je     L241
L519:
  test   %r13d,%r13d
  je     L516
  cmp    $0x1,%ebx
  jle    L516
  mov    0x10(%rsp),%rcx
  mov    %rbp,%rdx
  mov    $0x0,%eax
  pxor   %xmm5,%xmm5
  movsd  %xmm5,(%rsp)
L325:
  movsd  (%rdx),%xmm0
  movsd  %xmm0,(%rcx)
  mulsd  %xmm0,%xmm0
  addsd  (%rsp),%xmm0
  movsd  %xmm0,(%rsp)
  add    $0x1,%eax
  add    %r14,%rdx
  add    $0x8,%rcx
  cmp    %ebx,%eax
  jl     L325
  movapd %xmm0,%xmm4
  pxor   %xmm3,%xmm3
  movq   %xmm3,%r12
  comisd D163(%rip),%xmm0
  ja     L640
L356:
  movsd  %xmm3,0x0(%rbp)
  movq   %r12,%xmm0
  xorpd  D100(%rip),%xmm0
  mov    0x38(%rsp),%rax
  movsd  %xmm0,(%rax,%r13,8)
  jmp    L91
L571:
  movsd  0x0(%rbp),%xmm0
  mov    0x38(%rsp),%rax
  movsd  %xmm0,(%rax,%r13,8)
  lea    -0x1(%rbx),%eax
  jmp    L143
L689:
  mov    %rbp,0x48(%rsp)
  lea    0x8(%rbp),%rax
  mov    0xc(%rsp),%r12d
  lea    0x10(%rbp,%r12,8),%rdx
  pxor   %xmm6,%xmm6
  movsd  %xmm6,(%rsp)
L354:
  movsd  (%rax),%xmm0
  mulsd  %xmm0,%xmm0
  addsd  (%rsp),%xmm0
  movsd  %xmm0,(%rsp)
  add    $0x8,%rax
  cmp    %rax,%rdx
  jne    L354
  movapd %xmm0,%xmm7
  comisd D163(%rip),%xmm0
  ja     L612
  pxor   %xmm3,%xmm3
  movsd  %xmm3,0x30(%rsp)
L624:
  movsd  %xmm3,0x8(%rbp)
  movsd  0x30(%rsp),%xmm0
  xorpd  D100(%rip),%xmm0
  mov    0x40(%rsp),%rax
  movsd  %xmm0,(%rax,%r13,8)
  jmp    L304
L612:
  pxor   %xmm0,%xmm0
  ucomisd %xmm7,%xmm0
  ja     L141
  sqrtsd %xmm7,%xmm7
  movsd  %xmm7,0x30(%rsp)
L1:
  movsd  0x8(%rbp),%xmm0
  pxor   %xmm1,%xmm1
  comisd %xmm0,%xmm1
  ja     L48
L45:
  divsd  0x30(%rsp),%xmm0
  call   <fabs@plt>
  pxor   %xmm3,%xmm3
  cvtsi2sd %eax,%xmm3
  movsd  D119(%rip),%xmm4
  addsd  %xmm4,%xmm3
  movsd  0x8(%rbp),%xmm0
  movsd  0x30(%rsp),%xmm7
  movapd %xmm7,%xmm1
  mulsd  %xmm0,%xmm1
  addsd  (%rsp),%xmm1
  movapd %xmm4,%xmm5
  divsd  %xmm1,%xmm5
  addsd  %xmm7,%xmm0
  movsd  %xmm0,0x8(%rbp)
  divsd  %xmm0,%xmm4
  mov    0x18(%rsp),%eax
  mov    %eax,%r8d
  mov    0x8(%rsp),%esi
  cmp    %eax,%esi
  jge    L608
  mov    0x48(%rsp),%rax
  lea    0x8(%rax,%r14,1),%rdi
L377:
  mov    %rdi,%rdx
  mov    $0x0,%eax
  pxor   %xmm1,%xmm1
L278:
  movsd  0x8(%rbp,%rax,8),%xmm0
  mulsd  (%rdx,%rax,8),%xmm0
  addsd  %xmm0,%xmm1
  mov    %rax,%rcx
  add    $0x1,%rax
  cmp    %r12,%rcx
  jne    L278
  mulsd  %xmm5,%xmm1
  mov    $0x0,%eax
L183:
  movapd %xmm1,%xmm2
  mulsd  0x8(%rbp,%rax,8),%xmm2
  movsd  (%rdx,%rax,8),%xmm0
  subsd  %xmm2,%xmm0
  movsd  %xmm0,(%rdx,%rax,8)
  mov    %rax,%rcx
  add    $0x1,%rax
  cmp    %r12,%rcx
  jne    L183
  add    0x8(%rsp),%esi
  add    %r14,%rdi
  cmp    %r8d,%esi
  jl     L377
L608:
  mov    0x48(%rsp),%rax
  add    $0x10,%rax
  mov    0x60(%rsp),%edi
  lea    -0x3(%rdi),%edx
  lea    0x18(%rbp,%rdx,8),%rdx
L120:
  add    $0x8,%rax
  movapd %xmm4,%xmm0
  mulsd  -0x8(%rax),%xmm0
  movsd  %xmm0,-0x8(%rax)
  cmp    %rax,%rdx
  jne    L120
  jmp    L624
L141:
  movsd  (%rsp),%xmm0
  call   <sqrt@plt>
  movsd  %xmm0,0x30(%rsp)
  jmp    L1
L48:
  movsd  0x30(%rsp),%xmm7
  xorpd  D100(%rip),%xmm7
  movsd  %xmm7,0x30(%rsp)
  jmp    L45
L169:
  movsd  0x8(%rbp),%xmm0
  mov    0x40(%rsp),%rax
  movsd  %xmm0,(%rax,%r13,8)
  sub    $0x1,%ebx
  add    0x28(%rsp),%rbp
  add    $0x1,%r13
  subl   $0x1,0xc(%rsp)
  mov    0x8(%rsp),%edi
  sub    %edi,0x18(%rsp)
  subq   $0x8,0x20(%rsp)
  jmp    L519
L206:
  add    $0x8,%rdi
  add    $0x8,%rcx
  cmp    %rdi,%rsi
  je     L588
L605:
  movsd  (%rdi),%xmm0
  comisd %xmm0,%xmm2
  jbe    L206
  xorpd  D100(%rip),%xmm0
  movsd  %xmm0,(%rdi)
  mov    %rcx,%rax
  mov    %ebx,%edx
L671:
  movsd  (%rax),%xmm0
  xorpd  %xmm1,%xmm0
  movsd  %xmm0,(%rax)
  add    $0x1,%edx
  add    %r14,%rax
  cmp    %edx,%r8d
  jne    L671
  jmp    L206
L353:
  mov    $0xffffffff,%eax
  jmp    L469
L241:
  mov    0x8(%rsp),%r13d
  mov    %r13d,%edx
  mov    0x68(%rsp),%rbp
  mov    %rbp,%rsi
  mov    0x50(%rsp),%rdi
  call   <ldvmat@plt>
  mov    %r13d,%r9d
  mov    %rbp,%r8
  mov    0x64(%rsp),%ecx
  mov    0x58(%rsp),%rdx
  mov    0x40(%rsp),%rsi
  mov    0x38(%rsp),%r12
  mov    %r12,%rdi
  call   <qrbdv@plt>
  mov    %rbp,%rcx
  lea    0x8(%r12,%r15,8),%rsi
  pxor   %xmm2,%xmm2
  movq   D100(%rip),%xmm1
  mov    0x70(%rsp),%rdi
  mov    %r13d,%r8d
  jmp    L605
L244:
  lea    0x8(%r14),%rax
  mov    %rax,0x28(%rsp)
  mov    0x8(%rsp),%ebx
  lea    -0x2(%rbx),%eax
  mov    %eax,0xc(%rsp)
  mov    %ebx,%eax
  imul   %ebx,%eax
  mov    %eax,0x18(%rsp)
  mov    0x10(%rsp),%rax
  sub    0x58(%rsp),%rax
  mov    %rax,0x20(%rsp)
  mov    0x50(%rsp),%rbp
  mov    $0x0,%r13d
  jmp    L519
L272:
  mov    0x8(%rsp),%ebx
  mov    %ebx,%ecx
  mov    0x64(%rsp),%r13d
  mov    %r13d,%edx
  mov    0x58(%rsp),%rbp
  mov    %rbp,%rsi
  mov    0x50(%rsp),%r14
  mov    %r14,%rdi
  call   <ldumat@plt>
  mov    %ebx,%edx
  mov    0x68(%rsp),%r15
  mov    %r15,%rsi
  mov    %r14,%rdi
  call   <ldvmat@plt>
  mov    %ebx,%r9d
  mov    %r15,%r8
  mov    %r13d,%ecx
  mov    %rbp,%rdx
  mov    0x40(%rsp),%rsi
  mov    0x38(%rsp),%rdi
  call   <qrbdv@plt>
L588:
  mov    0x10(%rsp),%rdi
  call   <free@plt>
  mov    $0x0,%eax
L469:
  add    $0x88,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
L301:
  mov    0x8(%rsp),%ebx
  mov    %ebx,%ecx
  mov    0x64(%rsp),%edx
  mov    0x58(%rsp),%rsi
  mov    0x50(%rsp),%rbp
  mov    %rbp,%rdi
  call   <ldumat@plt>
  lea    -0x1(%rbx),%r15d
  lea    0x8(,%r15,8),%r8
  mov    %rbp,%rsi
  mov    $0x0,%edx
  mov    $0x0,%edi
  mov    0x38(%rsp),%r9
  jmp    L429
```

tool_calls: name: disassemble_data
arguments: data_tag: D163
data_type: f64[2]
name: disassemble_data
arguments: data_tag: D100
data_type: byte[16]
name: disassemble_data
arguments: data_tag: D119
data_type: f64

tool: {"D163": [0.0,1.0]}

tool: {"D100": [0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00]}

tool: D119: 1

assistant: ```c
int sv2uv(double *d, double *a, double *u, 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;
  }
  ldumat(a, u, m, n);
  for (i = 0, q = a; i < n; ++i) {
    for (j = 0; j < n; ++j, ++q) {
      if (j < i)
        *q = 0.;
      else if (j == i)
        *q = d[i];
    }
  }
  for (i = 0, mm = n, nm = n - 1, p = a; 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 = u + i; k < m; ++k, p1 += m) {
          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;
  }
  ldvmat(a, v, 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;
}
```