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

```asm
<svdval>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x48,%rsp
  mov    %rdi,0x8(%rsp)
  cmp    %ecx,%edx
  jl     L110
  mov    %ecx,%r15d
  mov    %edx,%edi
  mov    %rsi,%r14
  mov    $0x8,%esi
  mov    %edx,%ebp
  call   <calloc@plt>
  lea    -0x1(%r15),%edi
  mov    %rax,(%rsp)
  mov    %edi,0x14(%rsp)
  test   %r15d,%r15d
  jle    L158
  movq   D60(%rip),%xmm3
  movslq %r15d,%rbx
  mov    %ebp,%esi
  lea    -0x1(%rbp),%edi
  shl    $0x3,%rbx
  imul   %r15d,%esi
  mov    %r14,0x18(%rsp)
  mov    %r14,%rbp
  lea    0x8(%rbx),%r9
  lea    -0x2(%r15),%r13d
  pxor   %xmm2,%xmm2
  mov    %rax,%r10
  movsd  D4(%rip),%xmm4
  movapd %xmm3,%xmm5
  jmp    L71
  nopl   (%rax)
L218:
  lea    0x1(%r13),%eax
  lea    0x0(%rbp,%r9,1),%r11
  cmp    $0x1,%eax
  ja     L6
L342:
  sub    $0x1,%r13d
  mov    %r11,%rbp
  sub    $0x1,%edi
  sub    %r15d,%esi
  cmp    $0xfffffffe,%r13d
  je     L93
L71:
  lea    0x1(%rdi),%eax
  cmp    $0x1,%eax
  jle    L218
  mov    %edi,%edx
  lea    0x8(%r10),%r14
  movapd %xmm2,%xmm1
  mov    %r10,%rax
  lea    (%r14,%rdx,8),%r12
  mov    %rbp,%rdx
  nopl   (%rax)
L368:
  movsd  (%rdx),%xmm0
  add    $0x8,%rax
  add    %rbx,%rdx
  movsd  %xmm0,-0x8(%rax)
  mulsd  %xmm0,%xmm0
  addsd  %xmm0,%xmm1
  cmp    %rax,%r12
  jne    L368
  comisd %xmm2,%xmm1
  jbe    L218
  ucomisd %xmm1,%xmm2
  ja     L297
  movapd %xmm1,%xmm0
  sqrtsd %xmm0,%xmm0
L353:
  movsd  0x0(%rbp),%xmm6
  movapd %xmm0,%xmm8
  xorpd  %xmm3,%xmm8
  comisd %xmm6,%xmm2
  ja     L307
L155:
  mulsd  %xmm0,%xmm6
  addsd  (%r10),%xmm0
  movapd %xmm4,%xmm7
  movsd  %xmm0,(%r10)
  addsd  %xmm1,%xmm6
  divsd  %xmm6,%xmm7
  cmp    $0xffffffff,%r13d
  je     L275
  mov    %r13d,%eax
  lea    0x8(%rbp),%r8
  lea    0x10(%rbp,%rax,8),%r11
  xchg   %ax,%ax
L151:
  mov    %r8,%rdx
  mov    %r14,%rax
  movapd %xmm0,%xmm1
  mov    %r8,%rcx
  movapd %xmm2,%xmm6
  jmp    L30
  nopl   0x0(%rax,%rax,1)
L311:
  movsd  (%rax),%xmm1
  add    $0x8,%rax
L30:
  mulsd  (%rcx),%xmm1
  add    %rbx,%rcx
  addsd  %xmm1,%xmm6
  cmp    %rax,%r12
  jne    L311
  mulsd  %xmm7,%xmm6
  mov    %r14,%rcx
  jmp    L159
  nopl   0x0(%rax)
L144:
  movsd  (%rcx),%xmm0
  add    $0x8,%rcx
L159:
  mulsd  %xmm6,%xmm0
  movsd  (%rdx),%xmm1
  subsd  %xmm0,%xmm1
  movsd  %xmm1,(%rdx)
  add    %rbx,%rdx
  cmp    %rcx,%rax
  jne    L144
  add    $0x8,%r8
  cmp    %r8,%r11
  je     L275
  movsd  (%r10),%xmm0
  jmp    L151
  nopl   0x0(%rax)
L6:
  mov    %r13d,%r12d
  lea    0x8(%rbp),%rax
  movapd %xmm2,%xmm1
  lea    0x10(%rbp,%r12,8),%rdx
  nopl   0x0(%rax,%rax,1)
L405:
  movsd  (%rax),%xmm0
  add    $0x8,%rax
  mulsd  %xmm0,%xmm0
  addsd  %xmm0,%xmm1
  cmp    %rdx,%rax
  jne    L405
  comisd %xmm2,%xmm1
  ja     L196
  lea    0x0(%rbp,%r9,1),%r11
  jmp    L342
  nopl   0x0(%rax)
L93:
  mov    (%rsp),%rdi
  mov    0x8(%rsp),%rcx
  xor    %eax,%eax
  mov    0x18(%rsp),%r14
  mov    0x14(%rsp),%esi
  mov    %rdi,%rdx
  sub    %rdi,%rcx
  nopw   0x0(%rax,%rax,1)
L370:
  movsd  (%r14),%xmm0
  movsd  %xmm0,(%rcx,%rdx,1)
  movapd %xmm2,%xmm0
  cmp    %esi,%eax
  je     L121
  movsd  0x8(%r14),%xmm0
L121:
  add    $0x1,%eax
  movsd  %xmm0,(%rdx)
  add    %r9,%r14
  add    $0x8,%rdx
  cmp    %eax,%r15d
  jne    L370
  mov    0x8(%rsp),%rbx
  mov    (%rsp),%rsi
  mov    %r15d,%edx
  mov    %rbx,%rdi
  call   <qrbdi@plt>
  mov    0x14(%rsp),%edx
  mov    %rbx,%rax
  pxor   %xmm2,%xmm2
  movq   D60(%rip),%xmm1
  lea    0x8(%rbx,%rdx,8),%rdx
  nopw   0x0(%rax,%rax,1)
L309:
  movsd  (%rax),%xmm0
  comisd %xmm0,%xmm2
  jbe    L106
  xorpd  %xmm1,%xmm0
  movsd  %xmm0,(%rax)
L106:
  add    $0x8,%rax
  cmp    %rdx,%rax
  jne    L309
L183:
  mov    (%rsp),%rdi
  call   <free@plt>
  xor    %eax,%eax
L385:
  add    $0x48,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
  nopl   (%rax)
L275:
  movsd  %xmm8,0x0(%rbp)
  jmp    L218
  nopl   0x0(%rax,%rax,1)
L196:
  ucomisd %xmm1,%xmm2
  ja     L247
  movapd %xmm1,%xmm6
  sqrtsd %xmm6,%xmm6
L223:
  movsd  0x8(%rbp),%xmm0
  movapd %xmm6,%xmm8
  xorpd  %xmm5,%xmm8
  comisd %xmm0,%xmm2
  ja     L401
L12:
  movapd %xmm0,%xmm7
  addsd  %xmm6,%xmm0
  lea    0x0(%rbp,%r9,1),%r11
  mulsd  %xmm6,%xmm7
  movsd  %xmm0,0x8(%rbp)
  addsd  %xmm7,%xmm1
  movapd %xmm4,%xmm7
  divsd  %xmm1,%xmm7
  cmp    %esi,%r15d
  jge    L296
  lea    0x0(,%r12,8),%r8
  mov    %r11,%rcx
  mov    %r15d,%r12d
  nopl   0x0(%rax,%rax,1)
L241:
  movapd %xmm0,%xmm1
  xor    %edx,%edx
  movapd %xmm2,%xmm6
  jmp    L238
  nopl   0x0(%rax)
L245:
  movsd  0x10(%rbp,%rdx,1),%xmm1
  add    $0x8,%rdx
L238:
  mulsd  (%rcx,%rdx,1),%xmm1
  addsd  %xmm1,%xmm6
  cmp    %rdx,%r8
  jne    L245
  mulsd  %xmm7,%xmm6
  xor    %eax,%eax
  jmp    L197
L253:
  movsd  0x10(%rbp,%rax,1),%xmm0
  add    $0x8,%rax
L197:
  mulsd  %xmm6,%xmm0
  movsd  (%rcx,%rax,1),%xmm1
  subsd  %xmm0,%xmm1
  movsd  %xmm1,(%rcx,%rax,1)
  cmp    %rax,%rdx
  jne    L253
  add    %r15d,%r12d
  add    %rbx,%rcx
  cmp    %esi,%r12d
  jge    L296
  movsd  0x8(%rbp),%xmm0
  jmp    L241
  nopl   0x0(%rax,%rax,1)
L296:
  movsd  %xmm8,0x8(%rbp)
  jmp    L342
L401:
  movq   %xmm6,%rax
  movapd %xmm8,%xmm6
  movq   %rax,%xmm8
  jmp    L12
L307:
  movq   %xmm0,%rax
  movapd %xmm8,%xmm0
  movq   %rax,%xmm8
  jmp    L155
L158:
  mov    (%rsp),%rsi
  mov    0x8(%rsp),%rdi
  mov    %r15d,%edx
  call   <qrbdi@plt>
  jmp    L183
L110:
  mov    $0xffffffff,%eax
  jmp    L385
L247:
  movapd %xmm1,%xmm0
  mov    %r10,0x38(%rsp)
  mov    %edi,0x34(%rsp)
  mov    %r9,0x28(%rsp)
  mov    %esi,0x30(%rsp)
  movsd  %xmm1,0x20(%rsp)
  call   <sqrt@plt>
  mov    D4(%rip),%rax
  mov    0x38(%rsp),%r10
  pxor   %xmm2,%xmm2
  movq   D60(%rip),%xmm5
  mov    0x34(%rsp),%edi
  movapd %xmm0,%xmm6
  mov    0x28(%rsp),%r9
  mov    0x30(%rsp),%esi
  movq   %rax,%xmm4
  movsd  0x20(%rsp),%xmm1
  movapd %xmm5,%xmm3
  jmp    L223
L297:
  movapd %xmm1,%xmm0
  mov    %r10,0x38(%rsp)
  mov    %edi,0x34(%rsp)
  mov    %r9,0x28(%rsp)
  mov    %esi,0x30(%rsp)
  movsd  %xmm1,0x20(%rsp)
  call   <sqrt@plt>
  mov    D4(%rip),%rax
  mov    0x38(%rsp),%r10
  pxor   %xmm2,%xmm2
  movq   D60(%rip),%xmm5
  mov    0x34(%rsp),%edi
  mov    0x28(%rsp),%r9
  mov    0x30(%rsp),%esi
  movq   %rax,%xmm4
  movsd  0x20(%rsp),%xmm1
  movapd %xmm5,%xmm3
  jmp    L353
```

tool_calls: name: parse_data
arguments: tag: D60
type_infered: f32[2]
name: parse_data
arguments: tag: D4
type_infered: f64

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

tool: D4: 1

assistant: ```c
int svdval(double *d, double *a, int m, int n) {
  double *p, *p1, *q, *w, *v;
  double s, h, u;
  int i, j, k, mm, nm, ms;
  if (m < n)
    return -1;
  w = (double *)calloc(m, sizeof(double));
  for (i = 0, mm = m, nm = n - 1, p = a; i < n; ++i, --mm, --nm, p += n + 1) {
    if (mm > 1) {
      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;
        w[0] += h;
        for (k = 1, ms = n - i; k < ms; ++k) {
          for (j = 0, q = p + k, u = 0.; j < mm; q += n)
            u += w[j++] * *q;
          u *= s;
          for (j = 0, q = p + k; j < mm; q += n)
            *q -= u * w[j++];
        }
        *p = -h;
      }
    }
    p1 = p + 1;
    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;
        s += *p1 * h;
        s = 1. / s;
        *p1 += h;
        for (k = n, ms = n * (m - i); k < ms; k += n) {
          for (j = 0, q = p1, v = p1 + k, u = 0.; j < nm; ++j)
            u += *q++ * *v++;
          u *= s;
          for (j = 0, q = p1, v = p1 + k; j < nm; ++j)
            *v++ -= u * *q++;
        }
        *p1 = -h;
      }
    }
  }
  for (j = 0, p = a; j < n; ++j, p += n + 1) {
    d[j] = *p;
    if (j != n - 1)
      w[j] = *(p + 1);
    else
      w[j] = 0.;
  }
  qrbdi(d, w, n);
  for (i = 0; i < n; ++i)
    if (d[i] < 0.)
      d[i] = -d[i];
  free(w);
  return 0;
}
```