user: What is the c source code of the assembly code below?

```asm
<dsvdinv>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0xf8,%rsp
  mov    %rdi,0x48(%rsp)
  mov    %rsi,0xe8(%rsp)
  mov    %edx,%ebp
  movslq %edx,%r14
  mov    %r14,0x90(%rsp)
  lea    0x0(,%rdx,8),%ebx
  mov    %ebx,%edi
  call   <malloc@plt>
  mov    %rax,%r15
  mov    %rax,0x60(%rsp)
  mov    %ebx,%edi
  call   <malloc@plt>
  mov    %rax,0xd0(%rsp)
  mov    %ebp,%edi
  imul   %ebp,%edi
  shl    $0x3,%edi
  call   <malloc@plt>
  mov    %rax,0x58(%rsp)
  mov    %ebx,%edi
  call   <malloc@plt>
  mov    %rax,0x20(%rsp)
  test   %ebp,%ebp
  jle    L1520
  lea    0x1(%rbp),%eax
  mov    %eax,0xc8(%rsp)
  lea    -0x2(%rbp),%eax
  mov    %eax,0x40(%rsp)
  lea    0x8(%r15),%rax
  mov    %rax,0x28(%rsp)
  mov    %ebp,%eax
  mov    %rax,0x88(%rsp)
  shl    $0x3,%r14
  movl   $0x1,0x68(%rsp)
  movl   $0x0,0x30(%rsp)
  movq   $0x1,0x18(%rsp)
  movq   $0x0,0x10(%rsp)
  pxor   %xmm6,%xmm6
  movsd  %xmm6,0x8(%rsp)
  movapd %xmm6,%xmm2
  movsd  %xmm6,0x38(%rsp)
  jmp    L1224
L410:
  mov    %r13,%rax
  mov    %r15d,%edx
  pxor   %xmm7,%xmm7
  movsd  %xmm7,0x8(%rsp)
L1273:
  movsd  (%rax),%xmm0
  divsd  (%rsp),%xmm0
  movsd  %xmm0,(%rax)
  mulsd  %xmm0,%xmm0
  addsd  0x8(%rsp),%xmm0
  movsd  %xmm0,0x8(%rsp)
  mov    %edx,%ecx
  add    $0x1,%edx
  add    %r14,%rax
  cmp    %ecx,%ebx
  jne    L1273
  mov    0x68(%rsp),%eax
  sub    $0x1,%eax
  cltq
  mov    0x48(%rsp),%rdi
  lea    (%rdi,%rax,8),%rax
  mov    %rax,0x98(%rsp)
  movsd  (%rax),%xmm3
  movsd  %xmm3,0xa0(%rsp)
  comisd D28(%rip),%xmm3
  jb     L241
  pxor   %xmm0,%xmm0
  movsd  0x8(%rsp),%xmm3
  ucomisd %xmm3,%xmm0
  ja     L649
  sqrtsd %xmm3,%xmm3
  movapd %xmm3,%xmm2
L573:
  andpd  D71(%rip),%xmm2
  xorpd  D368(%rip),%xmm2
L735:
  movsd  0xa0(%rsp),%xmm6
  movapd %xmm6,%xmm3
  mulsd  %xmm2,%xmm3
  subsd  0x8(%rsp),%xmm3
  subsd  %xmm2,%xmm6
  mov    0x98(%rsp),%rax
  movsd  %xmm6,(%rax)
  mov    0x18(%rsp),%rsi
  cmp    %esi,%r12d
  jle    L440
  mov    0x80(%rsp),%rax
  add    %rsi,%rax
  mov    0x48(%rsp),%rsi
  lea    (%rsi,%rax,8),%rsi
  mov    0x40(%rsp),%eax
  mov    $0xfffffffffffffffe,%rdi
  sub    %rax,%rdi
  mov    $0x1,%ecx
  mov    $0xffffffffffffffff,%rdx
  mov    0x70(%rsp),%r8d
  jmp    L633
L649:
  movsd  0x8(%rsp),%xmm0
  call   <sqrt@plt>
  movapd %xmm0,%xmm2
  jmp    L573
L241:
  pxor   %xmm0,%xmm0
  movsd  0x8(%rsp),%xmm7
  ucomisd %xmm7,%xmm0
  ja     L1526
  sqrtsd %xmm7,%xmm7
  movapd %xmm7,%xmm2
L92:
  andpd  D71(%rip),%xmm2
  jmp    L735
L1526:
  movsd  0x8(%rsp),%xmm0
  call   <sqrt@plt>
  movapd %xmm0,%xmm2
  jmp    L92
L675:
  movapd %xmm1,%xmm0
  mulsd  (%rax,%rdx,8),%xmm0
  addsd  (%rax),%xmm0
  movsd  %xmm0,(%rax)
  mov    %r9d,%r10d
  add    $0x1,%r9d
  add    %r14,%rax
  cmp    %r10d,%ebx
  jne    L675
L279:
  add    $0x8,%rsi
  sub    $0x1,%rdx
  add    $0x1,%rcx
  cmp    %rdi,%rdx
  je     L440
L633:
  mov    %r13,%rax
  mov    %r15d,%r9d
  pxor   %xmm1,%xmm1
  cmp    %r8d,%r12d
  jle    L279
L954:
  movsd  (%rax),%xmm0
  mulsd  (%rax,%rcx,8),%xmm0
  addsd  %xmm0,%xmm1
  mov    %r9d,%r10d
  add    $0x1,%r9d
  add    %r14,%rax
  cmp    %r10d,%ebx
  jne    L954
  divsd  %xmm3,%xmm1
  mov    %rsi,%rax
  mov    %r15d,%r9d
  jmp    L675
L440:
  cmp    0x70(%rsp),%r12d
  jle    L1305
L196:
  movsd  (%rsp),%xmm0
  mulsd  0x0(%r13),%xmm0
  movsd  %xmm0,0x0(%r13)
  mov    %r15d,%eax
  add    $0x1,%r15d
  add    %r14,%r13
  cmp    %eax,%ebx
  jne    L196
  jmp    L1305
L195:
  pxor   %xmm6,%xmm6
  movsd  %xmm6,(%rsp)
  movapd %xmm6,%xmm2
  jmp    L1305
L439:
  movsd  (%rsp),%xmm0
  call   <sqrt@plt>
  movapd %xmm0,%xmm2
  jmp    L940
L509:
  pxor   %xmm0,%xmm0
  movsd  (%rsp),%xmm7
  ucomisd %xmm7,%xmm0
  ja     L853
  sqrtsd %xmm7,%xmm7
  movapd %xmm7,%xmm2
L449:
  andpd  D71(%rip),%xmm2
  jmp    L16
L853:
  movsd  (%rsp),%xmm0
  call   <sqrt@plt>
  movapd %xmm0,%xmm2
  jmp    L449
L662:
  pxor   %xmm6,%xmm6
  movsd  %xmm6,0x8(%rsp)
  movapd %xmm6,%xmm2
L1419:
  movsd  0x0(%r13),%xmm0
  movq   D71(%rip),%xmm3
  andpd  %xmm3,%xmm0
  mov    0x50(%rsp),%rax
  movsd  (%rax),%xmm1
  andpd  %xmm3,%xmm1
  addsd  %xmm1,%xmm0
  movsd  0x38(%rsp),%xmm3
  maxsd  %xmm0,%xmm3
  movsd  %xmm3,0x38(%rsp)
  addq   $0x1,0x10(%rsp)
  mov    0x10(%rsp),%rax
  addq   $0x1,0x18(%rsp)
  add    %ebp,0x30(%rsp)
  mov    0xc8(%rsp),%esi
  add    %esi,0x68(%rsp)
  subl   $0x1,0x40(%rsp)
  addq   $0x8,0x28(%rsp)
  cmp    0x88(%rsp),%rax
  je     L704
L1224:
  mov    0x10(%rsp),%rax
  mov    %eax,%r15d
  mov    0x18(%rsp),%edi
  mov    %edi,0x78(%rsp)
  mov    0x28(%rsp),%rdi
  lea    -0x8(%rdi),%rsi
  mov    %rsi,0x50(%rsp)
  mulsd  0x8(%rsp),%xmm2
  movsd  %xmm2,-0x8(%rdi)
  mov    %eax,0x70(%rsp)
  mov    %rax,%rdi
  cmp    %eax,%ebp
  jle    L195
  movslq 0x30(%rsp),%rax
  mov    %rax,0x80(%rsp)
  add    %rdi,%rax
  mov    0x48(%rsp),%rsi
  lea    (%rsi,%rax,8),%r13
  mov    %r13,%rax
  mov    %r15d,%r12d
  pxor   %xmm7,%xmm7
  movsd  %xmm7,(%rsp)
L1376:
  movsd  (%rax),%xmm0
  andpd  D71(%rip),%xmm0
  addsd  (%rsp),%xmm0
  movsd  %xmm0,(%rsp)
  mov    %r12d,%ebx
  add    $0x1,%r12d
  add    %r14,%rax
  cmp    %r12d,%ebp
  jne    L1376
  movsd  (%rsp),%xmm6
  ucomisd D28(%rip),%xmm6
  jp     L410
  pxor   %xmm2,%xmm2
  jne    L410
L1305:
  mov    0x20(%rsp),%rax
  sub    0x60(%rsp),%rax
  mov    0x28(%rsp),%rdi
  lea    -0x8(%rax,%rdi,1),%r13
  mulsd  (%rsp),%xmm2
  movsd  %xmm2,0x0(%r13)
  mov    0x18(%rsp),%rax
  cmp    %eax,%ebp
  je     L662
  jle    L699
  movslq 0x30(%rsp),%r15
  add    %r15,%rax
  mov    0x48(%rsp),%rsi
  lea    (%rsi,%rax,8),%r12
  mov    0x40(%rsp),%eax
  mov    %rax,0x70(%rsp)
  add    %r15,%rax
  add    0x10(%rsp),%rax
  lea    0x10(%rsi,%rax,8),%rbx
  mov    %r12,%rax
  pxor   %xmm6,%xmm6
  movq   D71(%rip),%xmm1
  movapd %xmm6,%xmm2
L958:
  movsd  (%rax),%xmm0
  andpd  %xmm1,%xmm0
  addsd  %xmm0,%xmm2
  add    $0x8,%rax
  cmp    %rbx,%rax
  jne    L958
  movsd  %xmm2,0x8(%rsp)
  ucomisd D28(%rip),%xmm2
  jp     L367
  pxor   %xmm2,%xmm2
  je     L1419
L367:
  mov    %r12,%rax
  pxor   %xmm3,%xmm3
  movsd  %xmm3,(%rsp)
  movsd  0x8(%rsp),%xmm1
L846:
  movsd  (%rax),%xmm0
  divsd  %xmm1,%xmm0
  movsd  %xmm0,(%rax)
  mulsd  %xmm0,%xmm0
  addsd  (%rsp),%xmm0
  movsd  %xmm0,(%rsp)
  add    $0x8,%rax
  cmp    %rbx,%rax
  jne    L846
  movslq 0x68(%rsp),%rax
  mov    0x48(%rsp),%rdi
  lea    (%rdi,%rax,8),%rax
  mov    %rax,0x80(%rsp)
  movsd  (%rax),%xmm7
  movsd  %xmm7,0x98(%rsp)
  comisd D28(%rip),%xmm7
  jb     L509
  pxor   %xmm0,%xmm0
  movsd  (%rsp),%xmm3
  ucomisd %xmm3,%xmm0
  ja     L439
  sqrtsd %xmm3,%xmm3
  movapd %xmm3,%xmm2
L940:
  orpd   D368(%rip),%xmm2
L16:
  movsd  0x98(%rsp),%xmm3
  movapd %xmm3,%xmm1
  mulsd  %xmm2,%xmm1
  subsd  (%rsp),%xmm1
  subsd  %xmm2,%xmm3
  mov    0x80(%rsp),%rax
  movsd  %xmm3,(%rax)
  mov    0x70(%rsp),%rax
  add    0x10(%rsp),%rax
  mov    0x60(%rsp),%rcx
  lea    0x10(%rcx,%rax,8),%rsi
  lea    0x0(,%r15,8),%rdi
  mov    %rdi,%rdx
  sub    %rcx,%rdx
  add    0x48(%rsp),%rdx
  mov    0x28(%rsp),%rax
L327:
  movsd  (%rdx,%rax,1),%xmm0
  divsd  %xmm1,%xmm0
  movsd  %xmm0,(%rax)
  add    $0x8,%rax
  cmp    %rsi,%rax
  jne    L327
  mov    0x30(%rsp),%eax
  lea    (%rax,%rbp,1),%ecx
  movslq %ecx,%rcx
  shl    $0x3,%rcx
  mov    %rcx,%rdx
  sub    0x60(%rsp),%rdx
  mov    0x48(%rsp),%rax
  add    %rax,%rdx
  add    %rax,%rcx
  add    %rax,%rdi
  mov    0x78(%rsp),%r8d
  mov    0x18(%rsp),%r9
  mov    0x28(%rsp),%r10
L1076:
  mov    %r9,%rax
  pxor   %xmm1,%xmm1
L1122:
  movsd  (%rcx,%rax,8),%xmm0
  mulsd  (%rdi,%rax,8),%xmm0
  addsd  %xmm0,%xmm1
  add    $0x1,%rax
  cmp    %eax,%ebp
  jg     L1122
  mov    %r10,%rax
L1345:
  movapd %xmm1,%xmm0
  mulsd  (%rax),%xmm0
  addsd  (%rdx,%rax,1),%xmm0
  movsd  %xmm0,(%rdx,%rax,1)
  add    $0x8,%rax
  cmp    %rsi,%rax
  jne    L1345
  add    $0x1,%r8d
  add    %r14,%rdx
  add    %r14,%rcx
  cmp    %r8d,%ebp
  jne    L1076
  movsd  0x8(%rsp),%xmm1
L3:
  movapd %xmm1,%xmm0
  mulsd  (%r12),%xmm0
  movsd  %xmm0,(%r12)
  add    $0x8,%r12
  cmp    %rbx,%r12
  jne    L3
  movsd  %xmm1,0x8(%rsp)
  jmp    L1419
L699:
  pxor   %xmm3,%xmm3
  movsd  %xmm3,0x8(%rsp)
  movapd %xmm3,%xmm2
  jmp    L1419
L1520:
  jne    L281
  mov    %ebp,%ebx
L1527:
  mov    0xd0(%rsp),%rdi
  call   <free@plt>
  mov    0x60(%rsp),%rdi
  call   <free@plt>
  mov    0x58(%rsp),%rdi
  call   <free@plt>
  mov    0x20(%rsp),%rdi
  call   <free@plt>
  jmp    L1370
L281:
  lea    -0x1(%rbp),%eax
  movsd  D518(%rip),%xmm3
  movsd  %xmm3,0x68(%rsp)
  pxor   %xmm2,%xmm2
  mov    $0x0,%ecx
  jmp    L707
L1056:
  cmp    %ecx,%ebp
  jle    L435
  lea    0x0(%r13,%rcx,1),%eax
  cltq
  mov    0x48(%rsp),%rsi
  lea    (%rsi,%rax,8),%r9
  movslq %ecx,%r8
  movslq %r13d,%rax
  add    %r8,%rax
  lea    (%rsi,%rax,8),%r10
  mov    %r10,0x8(%rsp)
  mov    %ebp,%esi
  imul   %ecx,%esi
  movslq %esi,%rsi
  lea    (%rsi,%rbx,1),%rdx
  mov    0x58(%rsp),%rdi
  lea    (%rdi,%rdx,8),%rdx
  mov    0x40(%rsp),%edi
  sub    %ecx,%edi
  add    %rax,%rdi
  mov    0x50(%rsp),%rax
  lea    (%rax,%rdi,8),%rdi
  mov    %r10,%rax
L1174:
  movsd  (%rax),%xmm0
  divsd  (%r9),%xmm0
  divsd  %xmm2,%xmm0
  movsd  %xmm0,(%rdx)
  add    $0x8,%rax
  add    %r15,%rdx
  cmp    %rdi,%rax
  jne    L1174
  add    %r8,%rsi
  mov    0x58(%rsp),%rax
  lea    (%rax,%rsi,8),%r9
  mov    %rbx,%rsi
  sub    %r8,%rsi
  shl    $0x3,%rsi
  mov    %ecx,%r10d
L822:
  mov    %r9,%rdx
  mov    0x8(%rsp),%rax
  pxor   %xmm1,%xmm1
L244:
  movsd  (%rax),%xmm0
  mulsd  (%rdx),%xmm0
  addsd  %xmm0,%xmm1
  add    $0x8,%rax
  add    %r15,%rdx
  cmp    %rdi,%rax
  jne    L244
  mov    %r9,%rax
  mov    %ecx,%edx
L957:
  movapd %xmm1,%xmm0
  mulsd  (%rax,%rsi,1),%xmm0
  addsd  (%rax),%xmm0
  movsd  %xmm0,(%rax)
  mov    %edx,%r8d
  add    $0x1,%edx
  add    %r15,%rax
  cmp    %edx,%ebp
  jne    L957
  lea    0x1(%r10),%eax
  add    $0x8,%r9
  sub    $0x8,%rsi
  cmp    %r8d,%r10d
  je     L162
  mov    %eax,%r10d
  jmp    L822
L162:
  mov    %ebp,%eax
  imul   %ecx,%eax
  cltq
  add    %rbx,%rax
  mov    0x58(%rsp),%rdi
  lea    (%rdi,%rax,8),%rdx
  movslq %r13d,%rax
  movslq %ecx,%rsi
  add    %rsi,%rax
  lea    (%rdi,%rax,8),%rax
L1213:
  movq   $0x0,(%rdx)
  movq   $0x0,(%rax)
  add    $0x1,%ecx
  add    %r15,%rdx
  add    $0x8,%rax
  cmp    %ecx,%ebp
  jg     L1213
L435:
  movsd  %xmm3,(%r12)
  movsd  (%r11),%xmm2
  sub    $0x1,%rbx
  add    0x18(%rsp),%r12
  sub    $0x8,%r11
  sub    %ebp,%r13d
  cmp    0xb8(%rsp),%rbx
  je     L804
  mov    %r14d,%ecx
L26:
  mov    %r14d,%eax
  mov    %ebx,%r14d
  cmp    %eax,%ebp
  jle    L435
  ucomisd D28(%rip),%xmm2
  jp     L1056
  jne    L1056
  cmp    %ecx,%ebp
  jg     L162
  jmp    L435
L804:
  mov    0x28(%rsp),%rax
  add    0x20(%rsp),%rax
  mov    %rax,0x8(%rsp)
  mov    0x10(%rsp),%rax
  mov    0x48(%rsp),%rdi
  add    %rdi,%rax
  mov    %rax,0x10(%rsp)
  lea    0x1(%rbp),%eax
  imul   0x38(%rsp),%eax
  mov    %eax,0x28(%rsp)
  mov    0xc0(%rsp),%r12
  mov    %ebp,%r13d
  movsd  D53(%rip),%xmm7
  lea    -0x1(%rbp),%eax
  mov    %eax,0x38(%rsp)
  lea    0x8(%rdi),%rax
  mov    %rax,0x40(%rsp)
  pxor   %xmm5,%xmm5
  movapd %xmm5,%xmm4
  movapd %xmm7,%xmm6
  movapd %xmm7,%xmm3
  jmp    L1009
L65:
  lea    0x1(%r10),%eax
  add    $0x8,%r9
  sub    $0x1,%r8
  add    $0x1,%rdi
  cmp    %ecx,%r10d
  je     L1073
  mov    %eax,%r10d
L157:
  mov    %rbx,%rdx
  mov    %r11d,%eax
  pxor   %xmm1,%xmm1
L904:
  movsd  (%rdx),%xmm0
  mulsd  (%rdx,%rdi,8),%xmm0
  addsd  %xmm0,%xmm1
  mov    %eax,%ecx
  add    $0x1,%eax
  add    %r15,%rdx
  cmp    %eax,%ebp
  jne    L904
  divsd  (%r14),%xmm1
  mulsd  %xmm2,%xmm1
  cmp    %r12d,%eax
  jle    L65
  mov    %r9,%rax
  mov    %r13d,%edx
L1367:
  movapd %xmm1,%xmm0
  mulsd  (%rax,%r8,8),%xmm0
  addsd  (%rax),%xmm0
  movsd  %xmm0,(%rax)
  mov    %edx,%esi
  add    $0x1,%edx
  add    %r15,%rax
  cmp    %esi,%ecx
  jne    L1367
  jmp    L65
L114:
  mov    %ebp,0xcc(%rsp)
  movl   $0x0,0x18(%rsp)
  mov    %ebp,%eax
  mov    %r15,%rbp
  mov    %eax,%r15d
  jmp    L82
L40:
  mov    %esi,0x18(%rsp)
L1022:
  mov    0xc0(%rsp),%rax
  mov    %eax,0x30(%rsp)
  cmp    %eax,%r14d
  jg     L400
  movslq %r14d,%rbp
  mov    0x60(%rsp),%rax
  lea    (%rax,%rbp,8),%r12
  movslq 0x18(%rsp),%rax
  sub    %rax,%rbp
  mov    0x48(%rsp),%rdi
  lea    (%rdi,%rax,8),%rax
  mov    %rax,0x38(%rsp)
  movsd  D53(%rip),%xmm4
  pxor   %xmm3,%xmm3
  mov    %r14d,0x40(%rsp)
  mov    %r13d,0x50(%rsp)
  jmp    L1532
L1407:
  movsd  (%rsp),%xmm0
  divsd  0x8(%rsp),%xmm0
  mulsd  %xmm0,%xmm0
  addsd  D53(%rip),%xmm0
  pxor   %xmm1,%xmm1
  ucomisd %xmm0,%xmm1
  ja     L743
  sqrtsd %xmm0,%xmm0
L1414:
  mulsd  0x10(%rsp),%xmm0
L854:
  movsd  %xmm0,0x0(%r13)
  movsd  D53(%rip),%xmm1
  divsd  %xmm0,%xmm1
  movsd  (%rsp),%xmm3
  mulsd  %xmm1,%xmm3
  movsd  0x8(%rsp),%xmm4
  xorpd  D368(%rip),%xmm4
  mulsd  %xmm1,%xmm4
  test   %r15d,%r15d
  jle    L1183
  mov    0x38(%rsp),%rax
  mov    $0x0,%edx
L1046:
  movsd  (%rax),%xmm1
  movsd  (%rax,%rbp,8),%xmm0
  movapd %xmm3,%xmm2
  mulsd  %xmm1,%xmm2
  movapd %xmm4,%xmm5
  mulsd  %xmm0,%xmm5
  addsd  %xmm5,%xmm2
  movsd  %xmm2,(%rax)
  mulsd  %xmm3,%xmm0
  mulsd  %xmm4,%xmm1
  subsd  %xmm1,%xmm0
  movsd  %xmm0,(%rax,%rbp,8)
  add    $0x1,%edx
  add    %rbx,%rax
  cmp    %edx,%r15d
  jne    L1046
L1183:
  add    $0x1,%r14d
  add    $0x8,%r12
  add    $0x1,%rbp
  cmp    0x30(%rsp),%r14d
  jg     L202
L1532:
  movsd  (%r12),%xmm0
  movapd %xmm4,%xmm6
  mulsd  %xmm0,%xmm6
  movsd  %xmm6,0x8(%rsp)
  mulsd  %xmm3,%xmm0
  movsd  %xmm0,(%r12)
  andpd  D71(%rip),%xmm6
  movsd  %xmm6,0x10(%rsp)
  movsd  0x68(%rsp),%xmm7
  comisd %xmm6,%xmm7
  jae    L938
  mov    0x20(%rsp),%r13
  sub    0x60(%rsp),%r13
  add    %r12,%r13
  movsd  0x0(%r13),%xmm7
  movsd  %xmm7,(%rsp)
  andpd  D71(%rip),%xmm7
  movsd  %xmm7,0x28(%rsp)
  comisd %xmm7,%xmm6
  ja     L1407
  movsd  (%rsp),%xmm6
  ucomisd D28(%rip),%xmm6
  jp     L1210
  pxor   %xmm0,%xmm0
  je     L854
L1210:
  movsd  0x8(%rsp),%xmm0
  divsd  (%rsp),%xmm0
  mulsd  %xmm0,%xmm0
  addsd  D53(%rip),%xmm0
  pxor   %xmm1,%xmm1
  ucomisd %xmm0,%xmm1
  ja     L845
  sqrtsd %xmm0,%xmm0
L436:
  mulsd  0x28(%rsp),%xmm0
  jmp    L854
L743:
  call   <sqrt@plt>
  jmp    L1414
L845:
  call   <sqrt@plt>
  jmp    L436
L202:
  mov    0x40(%rsp),%r14d
  mov    0x50(%rsp),%r13d
  jmp    L400
L206:
  mov    %esi,0x18(%rsp)
  mov    $0x1,%r13d
  jmp    L400
L482:
  mov    %esi,0x18(%rsp)
L400:
  mov    0x78(%rsp),%rax
  mov    (%rax),%r12
  cmp    0x70(%rsp),%r13d
  je     L581
  cmpl   $0x1,0x80(%rsp)
  je     L1559
  movslq %r14d,%rax
  mov    %rax,0x90(%rsp)
  lea    0x0(,%rax,8),%rbp
  mov    0x20(%rsp),%rdi
  movsd  (%rdi,%rax,8),%xmm6
  movsd  %xmm6,0x18(%rsp)
  mov    0xa8(%rsp),%rax
  mov    (%rax),%r13
  mov    0xb0(%rsp),%rax
  movsd  (%rax),%xmm1
  mov    0x88(%rsp),%rax
  movsd  (%rax),%xmm6
  movsd  %xmm6,0x8(%rsp)
  movq   %r13,%xmm0
  movq   %r12,%xmm3
  subsd  %xmm3,%xmm0
  movq   %r13,%xmm2
  addsd  %xmm3,%xmm2
  mulsd  %xmm2,%xmm0
  movapd %xmm1,%xmm2
  subsd  %xmm6,%xmm2
  addsd  %xmm6,%xmm1
  mulsd  %xmm2,%xmm1
  addsd  %xmm1,%xmm0
  movapd %xmm6,%xmm1
  addsd  %xmm6,%xmm1
  movq   %r13,%xmm6
  mulsd  %xmm6,%xmm1
  divsd  %xmm1,%xmm0
  movapd %xmm0,%xmm6
  movsd  %xmm0,(%rsp)
  andpd  D71(%rip),%xmm0
  comisd D53(%rip),%xmm0
  jbe    L252
  movsd  D53(%rip),%xmm1
  movapd %xmm1,%xmm0
  divsd  %xmm6,%xmm0
  mulsd  %xmm0,%xmm0
  addsd  %xmm1,%xmm0
  pxor   %xmm1,%xmm1
  ucomisd %xmm0,%xmm1
  ja     L1078
  sqrtsd %xmm0,%xmm0
L1495:
  mulsd  (%rsp),%xmm0
L1568:
  movsd  0x18(%rsp),%xmm7
  movapd %xmm7,%xmm2
  movq   %r12,%xmm6
  subsd  %xmm6,%xmm2
  movq   %r12,%xmm1
  addsd  %xmm7,%xmm1
  mulsd  %xmm1,%xmm2
  movapd %xmm0,%xmm1
  andpd  D71(%rip),%xmm1
  movsd  (%rsp),%xmm6
  comisd D28(%rip),%xmm6
  jb     L1132
L871:
  addsd  (%rsp),%xmm1
  movq   %r13,%xmm0
  divsd  %xmm1,%xmm0
  movsd  0x8(%rsp),%xmm3
  subsd  %xmm3,%xmm0
  mulsd  %xmm3,%xmm0
  addsd  %xmm2,%xmm0
  divsd  0x18(%rsp),%xmm0
  movsd  %xmm0,(%rsp)
  cmp    %r14d,0xc8(%rsp)
  jl     L1225
  mov    0x60(%rsp),%rax
  lea    0x0(%rbp,%rax,1),%r12
  add    0x20(%rsp),%rbp
  mov    0x70(%rsp),%eax
  sub    $0x1,%eax
  mov    %eax,0x50(%rsp)
  movsd  D53(%rip),%xmm7
  movsd  %xmm7,0x10(%rsp)
  movsd  %xmm7,0x8(%rsp)
  mov    %r14d,%r13d
  jmp    L1325
L938:
  mov    0x40(%rsp),%r14d
  mov    0x50(%rsp),%r13d
  jmp    L400
L581:
  mov    %rbx,%rbp
  pxor   %xmm0,%xmm0
  movq   %r12,%xmm6
  comisd %xmm6,%xmm0
  ja     L709
L1140:
  subq   $0x1,0xc0(%rsp)
  mov    0xc0(%rsp),%rax
  cmp    0xb8(%rsp),%rax
  je     L594
L82:
  mov    0xcc(%rsp),%esi
  mov    %esi,0x70(%rsp)
  mov    0xc0(%rsp),%rax
  mov    %eax,0xcc(%rsp)
  lea    0x0(,%rax,8),%rdi
  mov    %rdi,0xd8(%rsp)
  mov    %rdi,%rax
  mov    0x20(%rsp),%rcx
  add    %rcx,%rax
  mov    %rax,0x78(%rsp)
  lea    -0x2(%rsi),%eax
  mov    %eax,0xc8(%rsp)
  cltq
  shl    $0x3,%rax
  lea    (%rcx,%rax,1),%rbx
  mov    %rbx,0xa8(%rsp)
  mov    0x60(%rsp),%rbx
  add    %rbx,%rax
  mov    %rax,0xb0(%rsp)
  add    %rbx,%rdi
  mov    %rdi,0x88(%rsp)
  movslq %esi,%rax
  lea    -0x10(%rcx,%rax,8),%rdi
  mov    %rdi,0xa0(%rsp)
  mov    %rdi,%rdx
  mov    %esi,%eax
  shl    $0x3,%rax
  sub    %rax,%rdx
  mov    %rdx,0x98(%rsp)
  movl   $0x1e,0x80(%rsp)
  mov    %rbp,%rbx
  jmp    L903
L709:
  movq   %r12,%xmm0
  xorpd  D368(%rip),%xmm0
  movsd  %xmm0,(%rax)
  test   %r15d,%r15d
  jle    L1140
  mov    0xd8(%rsp),%rax
  add    0x58(%rsp),%rax
  mov    $0x0,%edx
  movq   D368(%rip),%xmm1
L1238:
  movsd  (%rax),%xmm0
  xorpd  %xmm1,%xmm0
  movsd  %xmm0,(%rax)
  add    $0x1,%edx
  add    %rbp,%rax
  cmp    %edx,%r15d
  jne    L1238
  jmp    L1140
L1078:
  call   <sqrt@plt>
  jmp    L1495
L252:
  movsd  (%rsp),%xmm6
  movapd %xmm6,%xmm0
  mulsd  %xmm6,%xmm0
  addsd  D53(%rip),%xmm0
  pxor   %xmm1,%xmm1
  ucomisd %xmm0,%xmm1
  ja     L267
  sqrtsd %xmm0,%xmm0
  jmp    L1568
L267:
  call   <sqrt@plt>
  jmp    L1568
L1132:
  movapd %xmm0,%xmm1
  orpd   D368(%rip),%xmm1
  jmp    L871
L1530:
  movsd  0x10(%rsp),%xmm0
  divsd  (%rsp),%xmm0
  mulsd  %xmm0,%xmm0
  addsd  D53(%rip),%xmm0
  pxor   %xmm1,%xmm1
  ucomisd %xmm0,%xmm1
  ja     L1145
  sqrtsd %xmm0,%xmm0
L791:
  mulsd  0x8(%rsp),%xmm0
  jmp    L1537
L1145:
  call   <sqrt@plt>
  jmp    L791
L370:
  movsd  (%rsp),%xmm0
  divsd  0x10(%rsp),%xmm0
  mulsd  %xmm0,%xmm0
  addsd  D53(%rip),%xmm0
  pxor   %xmm1,%xmm1
  ucomisd %xmm0,%xmm1
  ja     L1137
  sqrtsd %xmm0,%xmm0
L205:
  mulsd  0x40(%rsp),%xmm0
  jmp    L1537
L1137:
  call   <sqrt@plt>
  jmp    L205
L928:
  movsd  (%rsp),%xmm0
  divsd  0x18(%rsp),%xmm0
  mulsd  %xmm0,%xmm0
  addsd  D53(%rip),%xmm0
  pxor   %xmm1,%xmm1
  ucomisd %xmm0,%xmm1
  ja     L1187
  sqrtsd %xmm0,%xmm0
L1464:
  mulsd  0x38(%rsp),%xmm0
L286:
  movsd  %xmm0,(%r14)
  ucomisd D28(%rip),%xmm0
  jp     L104
  je     L790
L104:
  movsd  D53(%rip),%xmm1
  divsd  %xmm0,%xmm1
  movsd  0x18(%rsp),%xmm7
  mulsd  %xmm1,%xmm7
  movsd  %xmm7,0x8(%rsp)
  mulsd  (%rsp),%xmm1
  movsd  %xmm1,0x10(%rsp)
L790:
  movsd  0x8(%rsp),%xmm3
  movapd %xmm3,%xmm1
  movsd  0x30(%rsp),%xmm6
  mulsd  %xmm6,%xmm1
  movsd  0x10(%rsp),%xmm4
  movapd %xmm4,%xmm0
  movsd  0x28(%rsp),%xmm7
  mulsd  %xmm7,%xmm0
  addsd  %xmm0,%xmm1
  movsd  %xmm1,(%rsp)
  mulsd  %xmm3,%xmm7
  movapd %xmm7,%xmm1
  mulsd  %xmm4,%xmm6
  subsd  %xmm6,%xmm1
  movsd  %xmm1,0x18(%rsp)
  test   %r15d,%r15d
  jle    L1383
  mov    0x48(%rsp),%rax
  sub    0x20(%rsp),%rax
  add    %r14,%rax
  mov    $0x0,%edx
L73:
  movsd  (%rax),%xmm1
  movsd  0x8(%rax),%xmm0
  movapd %xmm3,%xmm2
  mulsd  %xmm1,%xmm2
  movapd %xmm4,%xmm5
  mulsd  %xmm0,%xmm5
  addsd  %xmm5,%xmm2
  movsd  %xmm2,(%rax)
  mulsd  %xmm3,%xmm0
  mulsd  %xmm4,%xmm1
  subsd  %xmm1,%xmm0
  movsd  %xmm0,0x8(%rax)
  add    $0x1,%edx
  add    %rbx,%rax
  cmp    %edx,%r15d
  jne    L73
L1383:
  cmp    %r13d,0x50(%rsp)
  je     L1225
L1325:
  add    $0x1,%r13d
  mov    %r12,0x38(%rsp)
  add    $0x8,%r12
  movsd  (%r12),%xmm0
  mov    %rbp,%r14
  add    $0x8,%rbp
  movsd  0x0(%rbp),%xmm7
  movsd  %xmm7,0x28(%rsp)
  movsd  0x10(%rsp),%xmm6
  mulsd  %xmm0,%xmm6
  movsd  %xmm6,0x10(%rsp)
  mulsd  0x8(%rsp),%xmm0
  movsd  %xmm0,0x30(%rsp)
  movsd  (%rsp),%xmm7
  andpd  D71(%rip),%xmm7
  movsd  %xmm7,0x8(%rsp)
  andpd  D71(%rip),%xmm6
  movsd  %xmm6,0x40(%rsp)
  comisd %xmm6,%xmm7
  ja     L1530
  movsd  0x10(%rsp),%xmm7
  ucomisd D28(%rip),%xmm7
  jp     L370
  pxor   %xmm0,%xmm0
  jne    L370
L1537:
  mov    0x38(%rsp),%rax
  movsd  %xmm0,(%rax)
  movsd  (%rsp),%xmm7
  divsd  %xmm0,%xmm7
  movsd  %xmm7,0x8(%rsp)
  movsd  0x10(%rsp),%xmm4
  divsd  %xmm0,%xmm4
  movsd  %xmm4,0x10(%rsp)
  movapd %xmm7,%xmm1
  movsd  0x18(%rsp),%xmm3
  mulsd  %xmm3,%xmm1
  movsd  0x30(%rsp),%xmm6
  movapd %xmm6,%xmm0
  mulsd  %xmm4,%xmm0
  addsd  %xmm0,%xmm1
  movsd  %xmm1,0x18(%rsp)
  mulsd  %xmm7,%xmm6
  movapd %xmm6,%xmm0
  mulsd  %xmm4,%xmm3
  subsd  %xmm3,%xmm0
  movsd  %xmm0,0x30(%rsp)
  movsd  0x28(%rsp),%xmm6
  movapd %xmm6,%xmm3
  mulsd  %xmm4,%xmm3
  movsd  %xmm3,(%rsp)
  mulsd  %xmm7,%xmm6
  movsd  %xmm6,0x28(%rsp)
  test   %r15d,%r15d
  jle    L271
  mov    0x58(%rsp),%rax
  sub    0x20(%rsp),%rax
  add    %r14,%rax
  mov    $0x0,%edx
  movapd %xmm7,%xmm3
L617:
  movsd  (%rax),%xmm1
  movsd  0x8(%rax),%xmm0
  movapd %xmm3,%xmm2
  mulsd  %xmm1,%xmm2
  movapd %xmm4,%xmm5
  mulsd  %xmm0,%xmm5
  addsd  %xmm5,%xmm2
  movsd  %xmm2,(%rax)
  mulsd  %xmm3,%xmm0
  mulsd  %xmm4,%xmm1
  subsd  %xmm1,%xmm0
  movsd  %xmm0,0x8(%rax)
  add    $0x1,%edx
  add    %rbx,%rax
  cmp    %edx,%r15d
  jne    L617
L271:
  movsd  0x18(%rsp),%xmm6
  andpd  D71(%rip),%xmm6
  movsd  %xmm6,0x38(%rsp)
  movsd  (%rsp),%xmm7
  andpd  D71(%rip),%xmm7
  movsd  %xmm7,0x40(%rsp)
  comisd %xmm7,%xmm6
  ja     L928
  movsd  (%rsp),%xmm6
  ucomisd D28(%rip),%xmm6
  jp     L855
  jne    L855
  movq   $0x0,(%r14)
  jmp    L790
L1187:
  call   <sqrt@plt>
  jmp    L1464
L855:
  movsd  0x18(%rsp),%xmm0
  divsd  (%rsp),%xmm0
  mulsd  %xmm0,%xmm0
  addsd  D53(%rip),%xmm0
  pxor   %xmm1,%xmm1
  ucomisd %xmm0,%xmm1
  ja     L708
  sqrtsd %xmm0,%xmm0
L1288:
  mulsd  0x40(%rsp),%xmm0
  jmp    L286
L708:
  call   <sqrt@plt>
  jmp    L1288
L1225:
  mov    0x60(%rsp),%rax
  mov    0x90(%rsp),%rdi
  movq   $0x0,(%rax,%rdi,8)
  mov    0x88(%rsp),%rax
  movsd  (%rsp),%xmm6
  movsd  %xmm6,(%rax)
  mov    0x78(%rsp),%rax
  movsd  0x18(%rsp),%xmm3
  movsd  %xmm3,(%rax)
  subl   $0x1,0x80(%rsp)
  mov    0xc8(%rsp),%eax
  mov    %eax,0x18(%rsp)
L903:
  mov    0xa0(%rsp),%rax
  mov    0x70(%rsp),%r14d
  mov    0x60(%rsp),%rdi
  lea    0x8(%rdi),%rdx
  sub    0x20(%rsp),%rdx
  movsd  0x68(%rsp),%xmm1
  mov    0x18(%rsp),%esi
  mov    0x98(%rsp),%rcx
L734:
  mov    %r14d,%r13d
  sub    $0x1,%r14d
  cmp    %rax,%rcx
  je     L40
  lea    -0x2(%r13),%esi
  movsd  (%rdx,%rax,1),%xmm0
  andpd  D71(%rip),%xmm0
  comisd %xmm0,%xmm1
  jae    L482
  test   %r14d,%r14d
  je     L206
  movsd  (%rax),%xmm0
  andpd  D71(%rip),%xmm0
  sub    $0x8,%rax
  comisd %xmm0,%xmm1
  jb     L734
  mov    %esi,0x18(%rsp)
  jmp    L1022
L594:
  mov    %r15d,%eax
  mov    %rbp,%r15
  mov    %eax,%ebp
  mov    0x20(%rsp),%rdx
  mov    0xe0(%rsp),%rax
  lea    0x8(%rdx,%rax,8),%rax
  pxor   %xmm0,%xmm0
L1510:
  movsd  (%rdx),%xmm1
  maxsd  %xmm0,%xmm1
  movapd %xmm1,%xmm0
  add    $0x8,%rdx
  cmp    %rax,%rdx
  jne    L1510
  mulsd  D518(%rip),%xmm0
  mov    0x20(%rsp),%rax
  mov    $0x0,%ebx
  movsd  D53(%rip),%xmm3
  jmp    L1062
L113:
  movsd  %xmm1,(%rax)
  add    $0x8,%rax
  cmp    %rdx,%rax
  je     L948
L1062:
  movsd  (%rax),%xmm2
  pxor   %xmm1,%xmm1
  comisd %xmm2,%xmm0
  jae    L113
  add    $0x1,%ebx
  movapd %xmm3,%xmm1
  divsd  %xmm2,%xmm1
  jmp    L113
L948:
  test   %ebp,%ebp
  jle    L1527
  mov    0x58(%rsp),%rcx
  mov    0x20(%rsp),%rdi
  sub    %rdi,%rcx
  mov    0xe8(%rsp),%r10
  mov    %ebp,%eax
  lea    (%rdi,%rax,8),%rsi
  mov    $0x0,%r9d
  mov    $0x0,%r11d
  mov    %rdi,%r12
  jmp    L645
L744:
  lea    0x1(%r9),%eax
  add    %r15,%rcx
  add    $0x8,%r10
  cmp    %r9d,%r8d
  je     L1527
  mov    %eax,%r9d
L645:
  mov    0x48(%rsp),%rdx
  sub    %r12,%rdx
  mov    %r10,%rdi
  mov    %r11d,%r8d
L1314:
  mov    %r12,%rax
  pxor   %xmm1,%xmm1
L500:
  movsd  (%rcx,%rax,1),%xmm0
  mulsd  (%rdx,%rax,1),%xmm0
  mulsd  (%rax),%xmm0
  addsd  %xmm0,%xmm1
  add    $0x8,%rax
  cmp    %rax,%rsi
  jne    L500
  movsd  %xmm1,(%rdi)
  lea    0x1(%r8),%eax
  add    %r15,%rdi
  add    %r15,%rdx
  cmp    %eax,%ebp
  je     L744
  mov    %eax,%r8d
  jmp    L1314
L1559:
  mov    $0x0,%ebx
L1370:
  mov    %ebx,%eax
  add    $0xf8,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
L1090:
  movapd %xmm6,%xmm2
  divsd  %xmm0,%xmm2
  movslq 0x28(%rsp),%rax
  mov    0x48(%rsp),%rsi
  lea    (%rsi,%rax,8),%r14
  mov    %r12,%r8
  sub    %rdi,%r8
  sub    %r12,%rdi
  mov    %ebp,%eax
  imul   %r11d,%eax
  cltq
  add    %r12,%rax
  lea    (%rsi,%rax,8),%rbx
  mov    %r11d,%r10d
  jmp    L157
L557:
  ucomisd D28(%rip),%xmm0
  jp     L882
  je     L452
L882:
  movapd %xmm7,%xmm2
  divsd  %xmm0,%xmm2
L1073:
  cmp    %r12d,%ebp
  jle    L460
  movslq (%rsp),%rax
  add    %r12,%rax
  mov    0x48(%rsp),%rsi
  lea    (%rsi,%rax,8),%rax
  mov    %r13d,%edx
L7:
  movapd %xmm2,%xmm0
  mulsd  (%rax),%xmm0
  movsd  %xmm0,(%rax)
  add    $0x1,%edx
  add    %r15,%rax
  cmp    %edx,%ebp
  jne    L7
L460:
  mov    0x10(%rsp),%rax
  movapd %xmm3,%xmm0
  addsd  (%rax),%xmm0
  movsd  %xmm0,(%rax)
  sub    $0x1,%r12
  subq   $0x8,0x8(%rsp)
  mov    0x18(%rsp),%rdi
  add    %rdi,%rax
  mov    %rax,0x10(%rsp)
  sub    %ebp,(%rsp)
  mov    0x30(%rsp),%edi
  add    %edi,0x28(%rsp)
  cmp    0xb8(%rsp),%r12
  je     L114
L1009:
  mov    %r13d,%r11d
  mov    %r12d,%r13d
  mov    0x8(%rsp),%rax
  movsd  (%rax),%xmm0
  cmp    %r11d,%ebp
  jle    L557
  movslq %r11d,%rdi
  movslq (%rsp),%rax
  add    %rdi,%rax
  mov    0x48(%rsp),%rsi
  lea    (%rsi,%rax,8),%r9
  mov    0x38(%rsp),%edx
  sub    %r11d,%edx
  add    %rax,%rdx
  mov    0x40(%rsp),%rax
  lea    (%rax,%rdx,8),%rdx
  mov    %r9,%rax
L625:
  movq   $0x0,(%rax)
  add    $0x8,%rax
  cmp    %rdx,%rax
  jne    L625
  ucomisd %xmm5,%xmm0
  jp     L1090
  ucomisd %xmm4,%xmm0
  jne    L1090
L452:
  cmp    %r12d,%ebp
  jle    L460
  movslq (%rsp),%rax
  add    %r12,%rax
  mov    0x48(%rsp),%rsi
  lea    (%rsi,%rax,8),%rdx
  mov    %r13d,%eax
L1327:
  movq   $0x0,(%rdx)
  add    $0x1,%eax
  add    %r15,%rdx
  cmp    %eax,%ebp
  jne    L1327
  jmp    L460
L704:
  movsd  0x38(%rsp),%xmm6
  mulsd  D518(%rip),%xmm6
  movsd  %xmm6,0x68(%rsp)
  lea    -0x1(%rbp),%eax
  mov    %ebp,%ecx
L707:
  movslq %eax,%rbx
  mov    %rbx,0xc0(%rsp)
  mov    %ebp,%edi
  not    %edi
  mov    %edi,0x30(%rsp)
  movslq %edi,%rdx
  lea    0x0(,%rdx,8),%rsi
  mov    %rsi,0x18(%rsp)
  mov    %eax,%edx
  imul   %ebp,%edx
  movslq %edx,%rsi
  add    %rbx,%rsi
  lea    0x0(,%rsi,8),%rdi
  mov    %rdi,0x10(%rsp)
  add    0x58(%rsp),%rdi
  mov    %rdi,%r12
  lea    0x0(,%rbx,8),%rdi
  mov    %rdi,0x28(%rsp)
  add    0x60(%rsp),%rdi
  mov    %rdi,%r11
  mov    %eax,0x38(%rsp)
  mov    %edx,(%rsp)
  mov    %eax,%esi
  mov    %rsi,0xe0(%rsp)
  lea    -0x1(%rbx),%rax
  sub    %rsi,%rax
  mov    %rax,0xb8(%rsp)
  mov    0x90(%rsp),%r15
  shl    $0x3,%r15
  mov    %edx,%r13d
  mov    %ebp,%r14d
  lea    -0x1(%rbp),%eax
  mov    %eax,0x40(%rsp)
  mov    0x48(%rsp),%rax
  add    $0x8,%rax
  mov    %rax,0x50(%rsp)
  movsd  D53(%rip),%xmm3
  jmp    L26
```

tool_calls: name: retrieve_data
arguments: label: D28
type_infered: f64[2]
name: retrieve_data
arguments: label: D71
type_infered: qword[2]
name: retrieve_data
arguments: label: D368
type_infered: byte[16]
name: retrieve_data
arguments: label: D518
type_infered: byte[8]
name: retrieve_data
arguments: label: D53
type_infered: f64[2]

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

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

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

tool: {"D518": [0x95,0xd6,0x26,0xe8,0x0b,0x2e,0x11,0x3e]}

tool: {"D53": [1.0,null]}

assistant: ```c
int dsvdinv(double *a, double *b, int m) {
  int flag, i, its, j, jj, k, l, nm, rank;
  double *vmat, *wmat, *w, *rv1, *tmp, c, f, h, s, x, y, z, anorm, g, scale, at, bt, ct, maxarg1, maxarg2, thresh, wmax, tol, tanorm;
  anorm = g = scale = 0.0;
  tanorm = tol = sizeof(anorm) > 4 ? 1.0e-9 : 1.0e-6;
  rv1 = (double *)malloc(m * sizeof(double));
  tmp = (double *)malloc(m * sizeof(double));
  vmat = (double *)malloc(m * m * sizeof(double));
  wmat = (double *)malloc(m * sizeof(double));
  l = nm = 0;
  for (i = 0; i < m; i++) {
    l = i + 1;
    rv1[i] = scale * g;
    g = s = scale = 0.0;
    for (k = i; k < m; k++)
      scale += fabs(a[k * m + i]);
    if (scale) {
      for (k = i; k < m; k++) {
        a[k * m + i] /= scale;
        s += a[k * m + i] * a[k * m + i];
      }
      f = a[i * m + i];
      g = -((f) >= 0.0 ? fabs(sqrt(s)) : -fabs(sqrt(s)));
      h = f * g - s;
      a[i * m + i] = f - g;
      for (j = l; j < m; j++) {
        s = 0.0;
        for (k = i; k < m; k++)
          s += a[k * m + i] * a[k * m + j];
        f = s / h;
        for (k = i; k < m; k++)
          a[k * m + j] += f * a[k * m + i];
      }
      for (k = i; k < m; k++)
        a[k * m + i] *= scale;
    }
    wmat[i] = scale * g;
    g = s = scale = 0.0;
    if (l != m) {
      for (k = l; k < m; k++)
        scale += fabs(a[i * m + k]);
      if (scale) {
        for (k = l; k < m; k++) {
          a[i * m + k] /= scale;
          s += a[i * m + k] * a[i * m + k];
        }
        f = a[i * m + l];
        g = -((f) >= 0.0 ? fabs(sqrt(s)) : -fabs(sqrt(s)));
        h = f * g - s;
        a[i * m + l] = f - g;
        for (k = l; k < m; k++)
          rv1[k] = a[i * m + k] / h;
        for (j = l; j < m; j++) {
          s = 0.0;
          for (k = l; k < m; k++)
            s += a[j * m + k] * a[i * m + k];
          for (k = l; k < m; k++)
            a[j * m + k] += s * rv1[k];
        }
        for (k = l; k < m; k++)
          a[i * m + k] *= scale;
      }
    }
    anorm = (maxarg1 = (anorm), maxarg2 = ((fabs(wmat[i]) + fabs(rv1[i]))), (maxarg1) > (maxarg2) ? (maxarg1) : (maxarg2));
    tanorm = tol * anorm;
  }
  for (i = m; i--;) {
    if (i < m - 1) {
      if (g) {
        for (j = l; j < m; j++)
          vmat[j * m + i] = (a[i * m + j] / a[i * m + l]) / g;
        for (j = l; j < m; j++) {
          s = 0.0;
          for (k = l; k < m; k++)
            s += a[i * m + k] * vmat[k * m + j];
          for (k = l; k < m; k++)
            vmat[k * m + j] += s * vmat[k * m + i];
        }
      }
      for (j = l; j < m; j++)
        vmat[i * m + j] = vmat[j * m + i] = 0.0;
    }
    vmat[i * m + i] = 1.0;
    g = rv1[i];
    l = i;
  }
  for (i = m; i--;) {
    l = i + 1;
    g = wmat[i];
    for (j = l; j < m; j++)
      a[i * m + j] = 0.0;
    if (g) {
      g = 1.0 / g;
      for (j = l; j < m; j++) {
        s = 0.0;
        for (k = l; k < m; k++)
          s += a[k * m + i] * a[k * m + j];
        f = (s / a[i * m + i]) * g;
        for (k = i; k < m; k++)
          a[k * m + j] += f * a[k * m + i];
      }
      for (j = i; j < m; j++)
        a[j * m + i] *= g;
    } else
      for (j = i; j < m; j++)
        a[j * m + i] = 0.0;
    ++a[i * m + i];
  }
  for (k = m; k--;) {
    for (its = 0; its < 30; its++) {
      flag = 1;
      for (l = k + 1; l--;) {
        nm = l - 1;
        if (fabs(rv1[l]) <= tanorm || !l) {
          flag = 0;
          break;
        }
        if (fabs(wmat[nm]) <= tanorm)
          break;
      }
      if (flag) {
        c = 0.0;
        s = 1.0;
        for (i = l; i <= k; i++) {
          f = s * rv1[i];
          rv1[i] = c * rv1[i];
          if (fabs(f) <= tanorm)
            break;
          g = wmat[i];
          h = ((at = fabs(f)) > (bt = fabs(g)) ? (ct = bt / at, at * sqrt(1.0 + ct * ct)) : (bt ? (ct = at / bt, bt * sqrt(1.0 + ct * ct)) : 0.0));
          wmat[i] = h;
          h = 1.0 / h;
          c = g * h;
          s = -f * h;
          for (j = 0; j < m; j++) {
            y = a[j * m + nm];
            z = a[j * m + i];
            a[j * m + nm] = y * c + z * s;
            a[j * m + i] = z * c - y * s;
          }
        }
      }
      z = wmat[k];
      if (l == k) {
        if (z < 0.0) {
          wmat[k] = -z;
          for (j = 0; j < m; j++)
            vmat[j * m + k] = -vmat[j * m + k];
        }
        break;
      }
      if (its == 29)
        return 0;
      x = wmat[l];
      nm = k - 1;
      y = wmat[nm];
      g = rv1[nm];
      h = rv1[k];
      f = ((y - z) * (y + z) + (g - h) * (g + h)) / (2.0 * h * y);
      g = ((at = fabs(f)) > (bt = fabs(1.0)) ? (ct = bt / at, at * sqrt(1.0 + ct * ct)) : (bt ? (ct = at / bt, bt * sqrt(1.0 + ct * ct)) : 0.0));
      f = ((x - z) * (x + z) + h * ((y / (f + ((f) >= 0.0 ? fabs(g) : -fabs(g)))) - h)) / x;
      c = s = 1.0;
      for (j = l; j <= nm; j++) {
        i = j + 1;
        g = rv1[i];
        y = wmat[i];
        h = s * g;
        g = c * g;
        z = ((at = fabs(f)) > (bt = fabs(h)) ? (ct = bt / at, at * sqrt(1.0 + ct * ct)) : (bt ? (ct = at / bt, bt * sqrt(1.0 + ct * ct)) : 0.0));
        rv1[j] = z;
        c = f / z;
        s = h / z;
        f = x * c + g * s;
        g = g * c - x * s;
        h = y * s;
        y *= c;
        for (jj = 0; jj < m; jj++) {
          x = vmat[jj * m + j];
          z = vmat[jj * m + i];
          vmat[jj * m + j] = x * c + z * s;
          vmat[jj * m + i] = z * c - x * s;
        }
        z = ((at = fabs(f)) > (bt = fabs(h)) ? (ct = bt / at, at * sqrt(1.0 + ct * ct)) : (bt ? (ct = at / bt, bt * sqrt(1.0 + ct * ct)) : 0.0));
        wmat[j] = z;
        if (z) {
          z = 1.0 / z;
          c = f * z;
          s = h * z;
        }
        f = c * g + s * y;
        x = c * y - s * g;
        for (jj = 0; jj < m; jj++) {
          y = a[jj * m + j];
          z = a[jj * m + i];
          a[jj * m + j] = y * c + z * s;
          a[jj * m + i] = z * c - y * s;
        }
      }
      rv1[l] = 0.0;
      rv1[k] = f;
      wmat[k] = x;
    }
  }
  wmax = 0.0;
  w = wmat;
  for (j = m; j--; w++)
    if (*w > wmax)
      wmax = *w;
  thresh = tol * wmax;
  rank = 0;
  w = wmat;
  for (j = m; j--; w++)
    if (*w <= thresh)
      *w = 0.0;
    else {
      rank++;
      *w = 1.0 / *w;
    }
  for (j = 0; j < m; j++)
    for (i = 0; i < m; i++) {
      s = 0.0;
      for (k = 0; k < m; k++)
        s += vmat[k + j * m] * a[k + i * m] * wmat[k];
      b[j + i * m] = s;
    }
  free(tmp);
  free(rv1);
  free(vmat);
  free(wmat);
  return rank;
}
```