user: Please show me the C implementation that matches the assembly code listed below:

```asm
<svd>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0xf8,%rsp
  mov    %rcx,0x50(%rsp)
  mov    %r8,0x58(%rsp)
  cmp    %edx,%esi
  jl     L639
  movslq %edx,%rax
  mov    %rdi,%rbx
  lea    0x0(,%rdx,8),%edi
  mov    %edx,%r13d
  mov    %esi,%r14d
  mov    %r9,%rbp
  mov    %rax,0x88(%rsp)
  call   <malloc@plt>
  mov    %rax,0x68(%rsp)
  xor    %eax,%eax
  call   <macheps@plt>
  mov    %r14d,%edx
  xor    %eax,%eax
  movsd  %xmm0,0xc0(%rsp)
  imul   %r13d,%edx
  movslq %edx,%rcx
  test   %edx,%edx
  jle    L283
  mov    0x50(%rsp),%rdx
L892:
  movsd  (%rbx,%rax,8),%xmm0
  movsd  %xmm0,(%rdx,%rax,8)
  add    $0x1,%rax
  cmp    %rcx,%rax
  jne    L892
L283:
  lea    -0x1(%r13),%eax
  mov    %eax,0x8(%rsp)
  test   %r13d,%r13d
  jle    L1054
  lea    -0x2(%r13),%eax
  pxor   %xmm2,%xmm2
  xor    %r11d,%r11d
  mov    %r14d,%edi
  mov    %eax,0x18(%rsp)
  mov    0x68(%rsp),%rax
  mov    %rbp,%r14
  movapd %xmm2,%xmm3
  mov    %rbp,0xb8(%rsp)
  mov    %r11,%rbx
  mov    %r13d,%r9d
  movq   D17(%rip),%xmm7
  lea    0x8(%rax),%r15
  lea    0x1(%r13),%eax
  movl   $0x1,0x70(%rsp)
  mov    $0x1,%r12d
  mov    %eax,0xa0(%rsp)
  mov    0x88(%rsp),%rax
  movl   $0x0,0x10(%rsp)
  lea    0x8(,%rax,8),%rsi
  lea    0x0(,%rax,8),%r10
  mov    0x50(%rsp),%rax
  movsd  %xmm2,0x40(%rsp)
  mov    %rsi,0xa8(%rsp)
  mov    %r10,%rbp
  mov    %rax,0x90(%rsp)
  add    $0x10,%rax
  mov    %rax,0x80(%rsp)
  movsd  %xmm2,(%rsp)
  movaps %xmm7,0x30(%rsp)
  jmp    L688
L833:
  movsd  0x40(%rsp),%xmm1
  movq   $0x0,(%r14)
  movapd %xmm1,%xmm3
L1207:
  mov    0x28(%rsp),%rax
  movapd 0x30(%rsp),%xmm7
  movsd  (%rax),%xmm0
  andpd  %xmm7,%xmm1
  andpd  %xmm7,%xmm0
  addsd  %xmm1,%xmm0
  comisd (%rsp),%xmm0
  jbe    L1151
  movsd  %xmm0,(%rsp)
L1151:
  pxor   %xmm2,%xmm2
L201:
  cmp    %r12d,%r9d
  jle    L864
  mov    0x10(%rsp),%eax
  lea    (%rax,%r9,1),%r10d
L625:
  add    $0x1,%rbx
  add    $0x1,%r12
  add    $0x8,%r15
  add    $0x8,%r14
  mov    0xa0(%rsp),%esi
  subl   $0x1,0x18(%rsp)
  add    %esi,0x70(%rsp)
  mov    0xa8(%rsp),%rsi
  add    %rsi,0x90(%rsp)
  mov    %r10d,0x10(%rsp)
L688:
  mulsd  %xmm3,%xmm2
  lea    -0x8(%r15),%rax
  mov    %r12d,0x48(%rsp)
  mov    %ebx,%ecx
  mov    %r12d,0xb0(%rsp)
  mov    %rax,0x28(%rsp)
  mov    %ebx,0x78(%rsp)
  movsd  %xmm2,-0x8(%r15)
  cmp    %ebx,%edi
  jle    L833
  movslq 0x10(%rsp),%rax
  mov    0x50(%rsp),%rsi
  pxor   %xmm1,%xmm1
  mov    %rax,0x20(%rsp)
  add    %rbx,%rax
  lea    (%rsi,%rax,8),%rax
  mov    %rax,0x60(%rsp)
  mov    %rax,%r8
  mov    %ebx,%eax
L1175:
  movsd  (%r8),%xmm0
  andpd  0x30(%rsp),%xmm0
  mov    %eax,%edx
  add    $0x1,%eax
  add    %rbp,%r8
  addsd  %xmm0,%xmm1
  cmp    %eax,%edi
  jne    L1175
  movsd  0x40(%rsp),%xmm7
  ucomisd %xmm7,%xmm1
  jp     L421
  jne    L421
  mulsd  %xmm7,%xmm1
  movsd  %xmm1,(%r14)
  cmp    0x78(%rsp),%edi
  jle    L1052
L147:
  mov    0x78(%rsp),%esi
  cmp    %esi,0x8(%rsp)
  jne    L1155
  movsd  (%r14),%xmm1
  pxor   %xmm3,%xmm3
  jmp    L1207
L1155:
  mov    %r12d,0x60(%rsp)
  cmp    %r12d,%edi
  jle    L1193
  mov    0x20(%rsp),%rsi
  mov    0x50(%rsp),%rcx
  pxor   %xmm3,%xmm3
  lea    (%rsi,%r12,1),%rax
  lea    (%rsi,%rbx,1),%rdx
  mov    0x80(%rsp),%rsi
  lea    (%rcx,%rax,8),%r11
  lea    -0x1(%rdi),%eax
  sub    0xb0(%rsp),%eax
  add    %rdx,%rax
  lea    (%rsi,%rax,8),%rdx
  mov    %r11,%rax
L721:
  movsd  (%rax),%xmm0
  andpd  0x30(%rsp),%xmm0
  add    $0x8,%rax
  addsd  %xmm0,%xmm3
  cmp    %rdx,%rax
  jne    L721
  ucomisd 0x40(%rsp),%xmm3
  jp     L1171
  jne    L1171
  movsd  (%r14),%xmm1
  jmp    L1207
L864:
  mov    0xb8(%rsp),%rbp
  mov    %edi,%r14d
  mov    %r9d,%r13d
L1022:
  mov    0x8(%rsp),%eax
  test   %eax,%eax
  js     L73
  mov    0x8(%rsp),%eax
  mov    0x68(%rsp),%rsi
  xor    %r12d,%r12d
  mov    %r14d,0xc8(%rsp)
  mov    %rbp,0xd0(%rsp)
  mov    %eax,%r9d
  movslq %eax,%rbx
  mov    %r13d,%eax
  imul   %r13d,%r9d
  neg    %eax
  mov    %rbx,0x60(%rsp)
  cltq
  sub    $0x1,%rax
  mov    %r9d,%r11d
  mov    %rax,0x48(%rsp)
  mov    %rbx,%r9
  mov    %r11d,%ecx
  mov    %r11d,0x18(%rsp)
  mov    %r11d,%r10d
  sub    %r13d,%ecx
  mov    %r11d,0x20(%rsp)
  movslq %ecx,%rax
  mov    %r11d,0xb8(%rsp)
  lea    (%rax,%rbx,1),%r8
  lea    0x0(,%rbx,8),%rax
  add    %rax,%rsi
  lea    0x8(%rax),%r15
  mov    0x58(%rsp),%rax
  mov    %rsi,0x30(%rsp)
  movslq %r11d,%rsi
  add    $0x8,%rax
  mov    %rsi,0xa0(%rsp)
  mov    %r13d,%esi
  not    %esi
  mov    %rax,0xa8(%rsp)
  mov    0x50(%rsp),%rax
  mov    %esi,0x10(%rsp)
  lea    -0x2(%r13),%esi
  mov    %esi,0x70(%rsp)
  add    $0x8,%rax
  add    %ecx,%esi
  mov    %esi,0x28(%rsp)
  mov    %rax,0xb0(%rsp)
  jmp    L287
L1112:
  mov    0x10(%rsp),%esi
  subq   $0x8,0x30(%rsp)
  sub    %r13d,%ecx
  sub    %r13d,%r10d
  add    %esi,0x28(%rsp)
  add    $0x1,%r12
  sub    $0x1,%rbx
  mov    %r11d,%r9d
  add    0x48(%rsp),%r8
L287:
  mov    0x20(%rsp),%eax
  mov    0x58(%rsp),%rsi
  lea    -0x1(%r9),%r11d
  mov    D43(%rip),%rdx
  add    %r9d,%eax
  cltq
  mov    %rdx,(%rsi,%rax,8)
  test   %r9d,%r9d
  je     L146
  mov    %ecx,0x20(%rsp)
  cmp    %ebx,%r13d
  jle    L1112
  mov    0x30(%rsp),%rax
  movsd  (%rax),%xmm1
  ucomisd 0x40(%rsp),%xmm1
  jp     L604
  jne    L604
  movslq %r11d,%rax
  movslq %r10d,%rbp
  mov    %rax,0x98(%rsp)
  lea    (%r8,%r12,1),%rax
  mov    %rax,0x90(%rsp)
L683:
  mov    0x98(%rsp),%rax
  mov    0x58(%rsp),%rsi
  mov    0x90(%rsp),%rdi
  add    %rbp,%rax
  lea    (%rsi,%rax,8),%rdx
  lea    (%rsi,%r8,8),%rax
  mov    0xa8(%rsp),%rsi
  lea    (%rsi,%rdi,8),%rsi
L802:
  movq   $0x0,(%rdx)
  add    $0x8,%rax
  add    %r15,%rdx
  movq   $0x0,-0x8(%rax)
  cmp    %rax,%rsi
  jne    L802
  jmp    L1112
L146:
  movslq 0x10(%rsp),%rax
  mov    0xa0(%rsp),%rsi
  mov    %r13d,%r12d
  mov    0x60(%rsp),%rcx
  mov    0x50(%rsp),%rdx
  shl    $0x3,%rax
  mov    0xb8(%rsp),%r11d
  add    0x8(%rsp),%r11d
  mov    %rax,0x80(%rsp)
  mov    %rsi,%rax
  mov    0xd0(%rsp),%rbp
  add    %rcx,%rax
  mov    %r11d,0x30(%rsp)
  mov    0xc8(%rsp),%r14d
  lea    (%rdx,%rax,8),%rax
  mov    %rax,0x20(%rsp)
  mov    0x48(%rsp),%rax
  mov    %rbp,0x48(%rsp)
  mov    %rcx,%rbp
  mov    %r13d,%ecx
  shl    $0x3,%rax
  mov    %rax,0x78(%rsp)
  mov    0x88(%rsp),%rax
  add    %rsi,%rax
  lea    (%rdx,%rax,8),%rax
  mov    %rax,0x28(%rsp)
L239:
  mov    0x48(%rsp),%rax
  mov    %ebp,%r9d
  mov    %ebp,%ebx
  mov    %ebp,%r13d
  movsd  (%rax,%rbp,8),%xmm2
  cmp    0x8(%rsp),%ebp
  jl     L409
  ucomisd 0x40(%rsp),%xmm2
  jp     L1232
  je     L45
L1232:
  cmp    0x8(%rsp),%r13d
  jne    L1093
L1099:
  cmp    %r13d,%r14d
  jle    L1206
  movslq 0x18(%rsp),%rax
  mov    0x50(%rsp),%rsi
  add    %rbp,%rax
  lea    (%rsi,%rax,8),%rax
  nopl   0x0(%rax,%rax,1)
L1254:
  movsd  (%rax),%xmm0
  add    $0x1,%ebx
  divsd  %xmm2,%xmm0
  movsd  %xmm0,(%rax)
  add    %r15,%rax
  cmp    %ebx,%r14d
  jne    L1254
L1206:
  mov    0x20(%rsp),%rax
  sub    $0x1,%rbp
  sub    %ecx,0x18(%rsp)
  sub    $0x1,%r12d
  movsd  D43(%rip),%xmm0
  mov    0x80(%rsp),%rsi
  addsd  (%rax),%xmm0
  movsd  %xmm0,(%rax)
  add    %rsi,%rax
  mov    0x10(%rsp),%esi
  mov    %rax,0x20(%rsp)
  add    %esi,0x30(%rsp)
  mov    0x78(%rsp),%rsi
  add    %rsi,0x28(%rsp)
  test   %ebp,%ebp
  jns    L239
  mov    0x68(%rsp),%rax
  mov    0x48(%rsp),%rbp
  mov    %r14d,%r13d
  movsd  0xc0(%rsp),%xmm7
  mulsd  (%rsp),%xmm7
  sub    $0x8,%rax
  mov    %rbp,%r12
  mov    %ecx,%ebp
  mov    %rax,0xa8(%rsp)
  movsd  %xmm7,0x70(%rsp)
  movq   D17(%rip),%xmm7
  movaps %xmm7,0x30(%rsp)
L1239:
  mov    0x60(%rsp),%rsi
  mov    0x68(%rsp),%rcx
  mov    %r12,%r14
  mov    %r13d,%r12d
  movl   $0x32,0x98(%rsp)
  lea    0x0(,%rsi,8),%rax
  mov    %esi,0x90(%rsp)
  add    %rax,%rcx
  mov    %rax,0x88(%rsp)
  mov    %rcx,0x80(%rsp)
  mov    0xa8(%rsp),%rcx
  mov    %esi,0x48(%rsp)
  add    %rax,%rcx
  mov    %rcx,0xa0(%rsp)
  nopl   (%rax)
L1183:
  mov    0x88(%rsp),%rax
  mov    0x90(%rsp),%ecx
  mov    0x68(%rsp),%rsi
  movsd  0x70(%rsp),%xmm1
  jmp    L499
  nopl   0x0(%rax)
L44:
  mov    %edi,%ecx
L499:
  lea    (%rsi,%rax,1),%rdx
  movapd 0x30(%rsp),%xmm7
  movsd  (%rdx),%xmm0
  andpd  %xmm7,%xmm0
  comisd %xmm0,%xmm1
  jae    L720
  movsd  -0x8(%r14,%rax,1),%xmm0
  lea    -0x1(%rcx),%edi
  andpd  %xmm7,%xmm0
  comisd %xmm0,%xmm1
  jae    L342
  sub    $0x8,%rax
  cmp    $0xffffffff,%edi
  jne    L44
  mov    0xa8(%rsp),%rax
  mov    $0xffffffff,%ecx
  mov    $0xfffffffe,%edi
  mov    %rax,0x78(%rsp)
  mov    $0xfffffffffffffff8,%rax
  cmp    0x60(%rsp),%ecx
  jg     L1115
L123:
  mov    0x68(%rsp),%rax
  movslq %ecx,%r13
  movslq %edi,%rdi
  mov    %ecx,0x18(%rsp)
  mov    %r13,%rbx
  mov    %ebp,0x20(%rsp)
  pxor   %xmm1,%xmm1
  mov    %r15,%rbp
  lea    (%rax,%r13,8),%r11
  mov    0x50(%rsp),%rax
  sub    %rdi,%rbx
  mov    %r12d,%r15d
  mov    %r11,%r12
  lea    (%rax,%rdi,8),%rax
  mov    %rax,0x10(%rsp)
  mov    D43(%rip),%rax
  movq   %rax,%xmm4
  mov    %r14,%rax
  mov    %rbx,%r14
  mov    %rax,%rbx
  nopl   0x0(%rax)
L962:
  movsd  (%r12),%xmm0
  movapd 0x30(%rsp),%xmm7
  mulsd  %xmm0,%xmm4
  mulsd  %xmm1,%xmm0
  andpd  %xmm4,%xmm7
  movsd  %xmm0,(%r12)
  movapd %xmm7,%xmm0
  movsd  0x70(%rsp),%xmm7
  comisd %xmm0,%xmm7
  jae    L679
  movsd  (%rbx,%r13,8),%xmm1
  movapd %xmm4,%xmm0
  movsd  %xmm4,(%rsp)
  movsd  %xmm1,0x8(%rsp)
  call   <hypot@plt>
  movsd  0x8(%rsp),%xmm1
  movsd  (%rsp),%xmm4
  xor    %edx,%edx
  xorpd  D0(%rip),%xmm4
  mov    0x10(%rsp),%rax
  movsd  %xmm0,(%rbx,%r13,8)
  divsd  %xmm0,%xmm1
  divsd  %xmm0,%xmm4
  test   %r15d,%r15d
  jle    L298
  nopl   0x0(%rax)
L1045:
  movsd  (%rax),%xmm2
  movapd %xmm1,%xmm3
  movapd %xmm4,%xmm5
  add    $0x1,%edx
  movsd  (%rax,%r14,8),%xmm0
  mulsd  %xmm2,%xmm3
  mulsd  %xmm0,%xmm5
  mulsd  %xmm4,%xmm2
  mulsd  %xmm1,%xmm0
  addsd  %xmm5,%xmm3
  subsd  %xmm2,%xmm0
  movsd  %xmm3,(%rax)
  movsd  %xmm0,(%rax,%r14,8)
  add    %rbp,%rax
  cmp    %edx,%r15d
  jne    L1045
L298:
  add    $0x1,%r13
  add    $0x8,%r12
  add    $0x1,%r14
  cmp    %r13d,0x48(%rsp)
  jge    L962
L679:
  mov    %r15d,%r12d
  mov    0x18(%rsp),%ecx
  mov    %rbp,%r15
  mov    0x20(%rsp),%ebp
  mov    %rbx,%r14
L720:
  mov    0x60(%rsp),%rax
  movsd  (%r14,%rax,8),%xmm3
  cmp    %eax,%ecx
  je     L1103
  mov    0x68(%rsp),%rsi
  movslq %ecx,%rax
  shl    $0x3,%rax
  add    %rax,%rsi
  mov    %rsi,0x78(%rsp)
L945:
  movsd  (%r14,%rax,1),%xmm8
  mov    0x60(%rsp),%rax
  mov    %ecx,0x28(%rsp)
  movsd  %xmm3,0x18(%rsp)
  movsd  -0x8(%r14,%rax,8),%xmm6
  mov    0xa0(%rsp),%rax
  movsd  %xmm8,0x20(%rsp)
  movsd  (%rax),%xmm0
  mov    0x80(%rsp),%rax
  movsd  %xmm6,0x8(%rsp)
  movapd %xmm0,%xmm2
  subsd  %xmm3,%xmm0
  movsd  (%rax),%xmm4
  mov    D43(%rip),%rax
  addsd  %xmm3,%xmm2
  movq   %rax,%xmm1
  movsd  %xmm4,0x10(%rsp)
  divsd  %xmm6,%xmm0
  divsd  %xmm4,%xmm2
  mulsd  %xmm0,%xmm2
  movapd %xmm6,%xmm0
  divsd  %xmm4,%xmm0
  addsd  %xmm0,%xmm2
  movapd %xmm4,%xmm0
  divsd  %xmm6,%xmm0
  subsd  %xmm0,%xmm2
  mulsd  D52(%rip),%xmm2
  movapd %xmm2,%xmm0
  movsd  %xmm2,(%rsp)
  call   <hypot@plt>
  movsd  0x40(%rsp),%xmm7
  movsd  (%rsp),%xmm2
  movsd  0x8(%rsp),%xmm6
  movsd  0x10(%rsp),%xmm4
  comisd %xmm2,%xmm7
  movsd  0x18(%rsp),%xmm3
  movsd  0x20(%rsp),%xmm8
  mov    0x28(%rsp),%ecx
  ja     L752
  addsd  %xmm0,%xmm2
L447:
  divsd  %xmm2,%xmm6
  movapd %xmm3,%xmm0
  add    $0x1,%ecx
  divsd  %xmm8,%xmm0
  subsd  %xmm4,%xmm6
  divsd  %xmm8,%xmm4
  mulsd  %xmm0,%xmm3
  movapd %xmm8,%xmm0
  subsd  %xmm3,%xmm0
  mulsd  %xmm4,%xmm6
  addsd  %xmm0,%xmm6
  cmp    0x60(%rsp),%ecx
  jg     L943
  mov    0x68(%rsp),%rax
  movslq %ecx,%r13
  lea    (%rax,%r13,8),%rbx
  mov    D43(%rip),%rax
  movq   %rax,%xmm4
  movq   %rax,%xmm2
  mov    %ebp,%eax
  mov    %rbx,%rbp
  mov    %r13,%rbx
  mov    %eax,%r13d
  nopl   (%rax)
L1164:
  movsd  0x0(%rbp),%xmm7
  movapd %xmm6,%xmm0
  movsd  (%r14,%rbx,8),%xmm3
  movsd  %xmm8,0x20(%rsp)
  movsd  %xmm6,(%rsp)
  mulsd  %xmm7,%xmm2
  movsd  %xmm3,0x18(%rsp)
  mulsd  %xmm4,%xmm7
  movapd %xmm2,%xmm1
  movsd  %xmm2,0x8(%rsp)
  movsd  %xmm7,0x10(%rsp)
  call   <hypot@plt>
  movsd  (%rsp),%xmm6
  xor    %edi,%edi
  movsd  0x8(%rsp),%xmm1
  movsd  0x10(%rsp),%xmm7
  movsd  %xmm0,-0x8(%rbp)
  mov    0x58(%rsp),%rax
  movapd %xmm6,%xmm4
  movapd %xmm1,%xmm2
  movsd  0x20(%rsp),%xmm8
  movsd  0x18(%rsp),%xmm3
  divsd  %xmm0,%xmm4
  lea    (%rax,%rbx,8),%rax
  movapd %xmm3,%xmm1
  divsd  %xmm0,%xmm2
  movapd %xmm7,%xmm0
  mulsd  %xmm4,%xmm3
  movapd %xmm4,%xmm9
  mulsd  %xmm8,%xmm9
  mulsd  %xmm4,%xmm7
  mulsd  %xmm2,%xmm0
  mulsd  %xmm2,%xmm1
  addsd  %xmm0,%xmm9
  movapd %xmm8,%xmm0
  movapd %xmm3,%xmm8
  mulsd  %xmm2,%xmm0
  subsd  %xmm0,%xmm7
  test   %r13d,%r13d
  jle    L710
  nopw   0x0(%rax,%rax,1)
L743:
  movsd  -0x8(%rax),%xmm3
  movsd  (%rax),%xmm0
  movapd %xmm4,%xmm5
  add    $0x1,%edi
  movapd %xmm2,%xmm6
  mulsd  %xmm3,%xmm5
  mulsd  %xmm0,%xmm6
  mulsd  %xmm2,%xmm3
  mulsd  %xmm4,%xmm0
  addsd  %xmm6,%xmm5
  subsd  %xmm3,%xmm0
  movsd  %xmm5,-0x8(%rax)
  movsd  %xmm0,(%rax)
  add    %r15,%rax
  cmp    %edi,%r13d
  jne    L743
L710:
  movapd %xmm9,%xmm0
  movsd  %xmm8,0x18(%rsp)
  movsd  %xmm7,0x10(%rsp)
  movsd  %xmm1,0x8(%rsp)
  movsd  %xmm9,(%rsp)
  movsd  %xmm4,0x28(%rsp)
  movsd  %xmm2,0x20(%rsp)
  call   <hypot@plt>
  ucomisd 0x40(%rsp),%xmm0
  movsd  (%rsp),%xmm9
  movsd  0x8(%rsp),%xmm1
  movsd  0x10(%rsp),%xmm7
  movsd  %xmm0,-0x8(%r14,%rbx,8)
  movsd  0x18(%rsp),%xmm8
  jp     L706
  movsd  0x20(%rsp),%xmm2
  movsd  0x28(%rsp),%xmm4
  je     L1057
L706:
  movapd %xmm9,%xmm4
  movapd %xmm1,%xmm2
  divsd  %xmm0,%xmm4
  divsd  %xmm0,%xmm2
L1057:
  movapd %xmm4,%xmm6
  movapd %xmm2,%xmm0
  mov    0x50(%rsp),%rax
  xor    %edi,%edi
  mulsd  %xmm7,%xmm6
  mulsd  %xmm8,%xmm0
  lea    (%rax,%rbx,8),%rax
  mulsd  %xmm4,%xmm8
  mulsd  %xmm2,%xmm7
  addsd  %xmm0,%xmm6
  subsd  %xmm7,%xmm8
  test   %r12d,%r12d
  jle    L989
  xchg   %ax,%ax
L1102:
  movsd  -0x8(%rax),%xmm1
  movsd  (%rax),%xmm0
  movapd %xmm4,%xmm3
  add    $0x1,%edi
  movapd %xmm2,%xmm5
  mulsd  %xmm1,%xmm3
  mulsd  %xmm0,%xmm5
  mulsd  %xmm2,%xmm1
  mulsd  %xmm4,%xmm0
  addsd  %xmm5,%xmm3
  subsd  %xmm1,%xmm0
  movsd  %xmm3,-0x8(%rax)
  movsd  %xmm0,(%rax)
  add    %r15,%rax
  cmp    %edi,%r12d
  jne    L1102
L989:
  add    $0x1,%rbx
  add    $0x8,%rbp
  cmp    %ebx,0x48(%rsp)
  jge    L1164
  mov    %r13d,%ebp
L943:
  mov    0x78(%rsp),%rax
  subl   $0x1,0x98(%rsp)
  movq   $0x0,(%rax)
  mov    0x80(%rsp),%rax
  movsd  %xmm6,(%rax)
  mov    0x60(%rsp),%rax
  movsd  %xmm8,(%r14,%rax,8)
  jne    L1183
  lea    D143(%rip),%rdi
  call   <printf@plt>
  mov    $0xf,%eax
L571:
  add    $0xf8,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
L752:
  subsd  %xmm0,%xmm2
  jmp    L447
L342:
  mov    %rdx,0x78(%rsp)
  cmp    0x60(%rsp),%ecx
  jle    L123
L1115:
  mov    0x60(%rsp),%rsi
  movsd  (%r14,%rsi,8),%xmm3
  jmp    L945
L198:
  ucomisd 0x40(%rsp),%xmm2
  jp     L1099
  jne    L1099
L45:
  cmp    %r13d,%r14d
  jle    L1206
  movslq 0x18(%rsp),%rax
  mov    0x50(%rsp),%rsi
  add    %rbp,%rax
  lea    (%rsi,%rax,8),%rax
  nopw   0x0(%rax,%rax,1)
L472:
  add    $0x1,%ebx
  movq   $0x0,(%rax)
  add    %r15,%rax
  cmp    %ebx,%r14d
  jne    L472
  jmp    L1206
L409:
  cmp    %r12d,%ecx
  jle    L198
  mov    0x70(%rsp),%eax
  mov    0x28(%rsp),%rdi
  xor    %esi,%esi
  mov    %ecx,0x98(%rsp)
  movsd  %xmm2,0x90(%rsp)
  sub    %ebp,%eax
  mov    %ebp,0x88(%rsp)
  lea    0x8(,%rax,8),%rdx
  call   <memset@plt>
  mov    0x88(%rsp),%r9d
  movsd  0x90(%rsp),%xmm2
  ucomisd 0x40(%rsp),%xmm2
  mov    0x98(%rsp),%ecx
  jp     L1101
  je     L45
L1101:
  mov    0x50(%rsp),%rsi
  movslq 0x30(%rsp),%rax
  movslq %r12d,%rdx
  mov    $0xfffffffffffffffe,%r8
  lea    (%rsi,%rax,8),%r10
  movslq 0x18(%rsp),%rax
  mov    %rax,%r11
  add    %rdx,%rax
  mov    $0xffffffffffffffff,%rdx
  lea    (%rsi,%rax,8),%rdi
  mov    0x70(%rsp),%eax
  sub    %r9d,%eax
  sub    %rax,%r8
  lea    (%rcx,%r11,1),%eax
  cltq
  add    %rbp,%rax
  lea    (%rsi,%rax,8),%r9
  mov    $0x1,%esi
L31:
  mov    %r9,%rax
  mov    %r12d,%r11d
  pxor   %xmm1,%xmm1
  cmp    %r12d,%r14d
  jle    L651
  nopl   0x0(%rax)
L547:
  movsd  (%rax),%xmm0
  mulsd  (%rax,%rsi,8),%xmm0
  add    $0x1,%r11d
  add    %r15,%rax
  addsd  %xmm0,%xmm1
  cmp    %r11d,%r14d
  jne    L547
L651:
  divsd  (%r10),%xmm1
  divsd  %xmm2,%xmm1
  mov    %rdi,%rax
  mov    %ebx,%r11d
  cmp    %r13d,%r14d
  jle    L606
  nopl   (%rax)
L923:
  movsd  (%rax,%rdx,8),%xmm0
  add    $0x1,%r11d
  mulsd  %xmm1,%xmm0
  addsd  (%rax),%xmm0
  movsd  %xmm0,(%rax)
  add    %r15,%rax
  cmp    %r11d,%r14d
  jne    L923
L606:
  sub    $0x1,%rdx
  add    $0x8,%rdi
  add    $0x1,%rsi
  cmp    %rdx,%r8
  jne    L31
  jmp    L1099
L1103:
  movsd  0x40(%rsp),%xmm7
  mov    %r12d,%r13d
  mov    %r14,%r12
  comisd %xmm3,%xmm7
  ja     L707
L938:
  subq   $0x1,0x60(%rsp)
  mov    0x60(%rsp),%rax
  test   %eax,%eax
  jns    L1239
  mov    %r13d,%r14d
  mov    %ebp,%r13d
  mov    %r12,%rbp
L73:
  mov    0x58(%rsp),%rcx
  mov    0x50(%rsp),%rdi
  mov    %rbp,%r8
  mov    %r13d,%edx
  mov    %r14d,%esi
  call   <svd_sort@plt>
  mov    0x68(%rsp),%rdi
  call   <free@plt>
  xor    %eax,%eax
  jmp    L571
L1093:
  cmp    %r12d,%ecx
  jg     L1101
  jmp    L1099
  nopl   0x0(%rax)
L604:
  mov    0x50(%rsp),%rsi
  movslq 0x28(%rsp),%rax
  movslq %r10d,%rbp
  lea    (%rsi,%r8,8),%rdi
  mulsd  0x8(%rsi,%rax,8),%xmm1
  mov    0x58(%rsp),%rsi
  movslq %r11d,%rax
  mov    %rax,0x98(%rsp)
  add    %rbp,%rax
  lea    (%rsi,%rax,8),%rdx
  mov    %rdi,0x78(%rsp)
  mov    0xb0(%rsp),%rsi
  lea    (%r8,%r12,1),%rax
  mov    %rax,0x90(%rsp)
  lea    (%rsi,%rax,8),%rsi
  mov    %rdi,%rax
L433:
  movsd  (%rax),%xmm0
  add    $0x8,%rax
  divsd  %xmm1,%xmm0
  movsd  %xmm0,(%rdx)
  add    %r15,%rdx
  cmp    %rax,%rsi
  jne    L433
  mov    0x58(%rsp),%rdx
  lea    (%rbx,%rbp,1),%rax
  lea    (%rdx,%rax,8),%rdi
  mov    %r12,%rax
  xor    %edx,%edx
  not    %rax
  mov    %rax,0x80(%rsp)
L912:
  mov    0x78(%rsp),%rax
  mov    %rdi,%r14
  pxor   %xmm1,%xmm1
  nop
L656:
  movsd  (%rax),%xmm0
  mulsd  (%r14),%xmm0
  add    $0x8,%rax
  add    %r15,%r14
  addsd  %xmm0,%xmm1
  cmp    %rax,%rsi
  jne    L656
  mov    %rdi,%rax
  mov    %r9d,%r14d
  nop
L135:
  movsd  -0x8(%rax,%rdx,8),%xmm0
  add    $0x1,%r14d
  mulsd  %xmm1,%xmm0
  addsd  (%rax),%xmm0
  movsd  %xmm0,(%rax)
  add    %r15,%rax
  cmp    %r14d,%r13d
  jne    L135
  add    $0x8,%rdi
  sub    $0x1,%rdx
  cmp    %rdx,0x80(%rsp)
  jne    L912
  jmp    L683
L421:
  mov    0x60(%rsp),%rax
  mov    %ecx,%r11d
  pxor   %xmm2,%xmm2
L678:
  movsd  (%rax),%xmm0
  mov    %r11d,%esi
  add    $0x1,%r11d
  divsd  %xmm1,%xmm0
  movsd  %xmm0,(%rax)
  mulsd  %xmm0,%xmm0
  add    %rbp,%rax
  addsd  %xmm0,%xmm2
  cmp    %esi,%edx
  jne    L678
  mov    0x70(%rsp),%eax
  mov    0x50(%rsp),%rsi
  movsd  0x40(%rsp),%xmm4
  sub    $0x1,%eax
  cltq
  lea    (%rsi,%rax,8),%r13
  movsd  0x0(%r13),%xmm7
  movsd  %xmm7,0x98(%rsp)
  comisd %xmm7,%xmm4
  ja     L13
  movsd  0x40(%rsp),%xmm7
  ucomisd %xmm2,%xmm7
  ja     L380
  movapd %xmm2,%xmm0
  sqrtsd %xmm0,%xmm0
L151:
  xorpd  D0(%rip),%xmm0
L87:
  movsd  0x98(%rsp),%xmm3
  mov    0x78(%rsp),%esi
  subsd  %xmm0,%xmm3
  movsd  %xmm3,0x0(%r13)
  cmp    %esi,0x8(%rsp)
  jg     L1087
L953:
  mov    0x60(%rsp),%rax
L1180:
  movsd  (%rax),%xmm2
  mov    %ecx,%esi
  add    $0x1,%ecx
  mulsd  %xmm1,%xmm2
  movsd  %xmm2,(%rax)
  add    %rbp,%rax
  cmp    %esi,%edx
  jne    L1180
  mulsd  %xmm1,%xmm0
  movsd  %xmm0,(%r14)
  jmp    L147
L13:
  ucomisd %xmm2,%xmm4
  ja     L701
  movapd %xmm2,%xmm0
  sqrtsd %xmm0,%xmm0
  jmp    L87
L707:
  xorpd  D0(%rip),%xmm3
  mov    0x60(%rsp),%rax
  movsd  %xmm3,(%r14,%rax,8)
  test   %ebp,%ebp
  jle    L938
  mov    0x88(%rsp),%rax
  xor    %ecx,%ecx
  add    0x58(%rsp),%rax
L67:
  movsd  (%rax),%xmm0
  xorpd  D0(%rip),%xmm0
  add    $0x1,%ecx
  movsd  %xmm0,(%rax)
  add    %r15,%rax
  cmp    %ecx,%ebp
  jne    L67
  jmp    L938
L1171:
  movslq 0x70(%rsp),%rax
  mov    0x50(%rsp),%rsi
  lea    (%rsi,%rax,8),%rdx
  movsd  (%rdx),%xmm1
  cmp    0x60(%rsp),%r9d
  jle    L926
  mov    0x18(%rsp),%r13d
  mov    0x20(%rsp),%rax
  pxor   %xmm4,%xmm4
  mov    0x80(%rsp),%rsi
  add    %r13,%rax
  add    %rbx,%rax
  lea    (%rsi,%rax,8),%rcx
  mov    %r11,%rax
L55:
  movsd  (%rax),%xmm0
  add    $0x8,%rax
  divsd  %xmm3,%xmm0
  movsd  %xmm0,-0x8(%rax)
  mulsd  %xmm0,%xmm0
  addsd  %xmm0,%xmm4
  cmp    %rcx,%rax
  jne    L55
  movsd  (%rdx),%xmm1
  movsd  0x40(%rsp),%xmm7
  comisd %xmm1,%xmm7
  ja     L791
  movsd  0x40(%rsp),%xmm7
  ucomisd %xmm4,%xmm7
  ja     L1041
L1037:
  movapd %xmm4,%xmm2
  sqrtsd %xmm2,%xmm2
L825:
  xorpd  D0(%rip),%xmm2
L795:
  movapd %xmm1,%xmm0
  subsd  %xmm2,%xmm1
  mov    0x68(%rsp),%rax
  mulsd  %xmm2,%xmm0
  lea    0x10(%rax),%r8
  movsd  %xmm1,(%rdx)
  subsd  %xmm4,%xmm0
  cmp    0x60(%rsp),%r9d
  jle    L513
L564:
  mov    0x68(%rsp),%rsi
  lea    0x0(%r13,%rbx,1),%rax
  mov    0x20(%rsp),%rcx
  lea    0x10(%rsi),%r8
  lea    (%r8,%rax,8),%rdx
  mov    0x50(%rsp),%rax
  lea    (%rax,%rcx,8),%rax
  sub    %rsi,%rax
  mov    %rax,%rcx
  mov    %r15,%rax
  jmp    L462
L922:
  movsd  (%rcx,%rax,1),%xmm1
L462:
  divsd  %xmm0,%xmm1
  add    $0x8,%rax
  movsd  %xmm1,-0x8(%rax)
  cmp    %rdx,%rax
  jne    L922
L513:
  mov    0x10(%rsp),%eax
  mov    0x20(%rsp),%rsi
  lea    (%rax,%r9,1),%r10d
  mov    0x50(%rsp),%rax
  movslq %r10d,%rcx
  lea    (%rax,%rcx,8),%rdx
  sub    0x68(%rsp),%rdx
  lea    0x0(%r13,%rbx,1),%rax
  sub    %rcx,%rsi
  mov    %rdx,0x78(%rsp)
  mov    0x80(%rsp),%rdx
  add    %rax,%rcx
  lea    (%r8,%rax,8),%r8
  lea    (%rdx,%rcx,8),%rcx
  mov    0x78(%rsp),%rdx
L514:
  lea    (%rdx,%r15,1),%rax
  pxor   %xmm1,%xmm1
  cmp    0x60(%rsp),%r9d
  jle    L576
  nopl   0x0(%rax,%rax,1)
L124:
  movsd  (%rax),%xmm0
  mulsd  (%rax,%rsi,8),%xmm0
  add    $0x8,%rax
  addsd  %xmm0,%xmm1
  cmp    %rax,%rcx
  jne    L124
  mov    %r15,%rax
  nopl   0x0(%rax)
L673:
  movsd  (%rax),%xmm0
  mulsd  %xmm1,%xmm0
  addsd  (%rdx,%rax,1),%xmm0
  movsd  %xmm0,(%rdx,%rax,1)
  add    $0x8,%rax
  cmp    %rax,%r8
  jne    L673
L576:
  addl   $0x1,0x48(%rsp)
  mov    0x48(%rsp),%eax
  add    %rbp,%rdx
  add    %rbp,%rcx
  sub    0x88(%rsp),%rsi
  cmp    %eax,%edi
  jne    L514
  cmp    0x60(%rsp),%r9d
  jle    L155
  mov    0x20(%rsp),%rax
  mov    0x80(%rsp),%rsi
  add    %r13,%rax
  add    %rbx,%rax
  lea    (%rsi,%rax,8),%rax
L59:
  movsd  (%r11),%xmm0
  add    $0x8,%r11
  mulsd  %xmm3,%xmm0
  movsd  %xmm0,-0x8(%r11)
  cmp    %r11,%rax
  jne    L59
  mov    0x28(%rsp),%rax
  movapd 0x30(%rsp),%xmm7
  movsd  (%r14),%xmm1
  movsd  (%rax),%xmm0
  andpd  %xmm7,%xmm1
  andpd  %xmm7,%xmm0
  addsd  %xmm1,%xmm0
  maxsd  (%rsp),%xmm0
  movsd  %xmm0,(%rsp)
  jmp    L625
L1087:
  cmp    %r12d,%r9d
  jle    L953
  mov    0x20(%rsp),%rax
  mov    0x50(%rsp),%rsi
  mov    $0x1,%r10d
  mov    $0xffffffffffffffff,%r11
  movsd  0x98(%rsp),%xmm4
  mov    0x18(%rsp),%r13d
  add    %r12,%rax
  mulsd  %xmm0,%xmm4
  lea    (%rsi,%rax,8),%rsi
  mov    $0xfffffffffffffffe,%rax
  sub    %r13,%rax
  mov    %rax,0x98(%rsp)
  subsd  %xmm2,%xmm4
L503:
  mov    0x90(%rsp),%rax
  mov    %ecx,%r8d
  pxor   %xmm2,%xmm2
L254:
  movsd  (%rax),%xmm3
  mulsd  (%rax,%r10,8),%xmm3
  mov    %r8d,%r13d
  add    %rbp,%rax
  add    $0x1,%r8d
  addsd  %xmm3,%xmm2
  cmp    %edx,%r13d
  jne    L254
  divsd  %xmm4,%xmm2
  mov    %rsi,%rax
  mov    %ecx,%r8d
L205:
  movsd  (%rax,%r11,8),%xmm3
  mov    %r8d,%r13d
  add    $0x1,%r8d
  mulsd  %xmm2,%xmm3
  addsd  (%rax),%xmm3
  movsd  %xmm3,(%rax)
  add    %rbp,%rax
  cmp    %r13d,%edx
  jne    L205
  add    $0x8,%rsi
  sub    $0x1,%r11
  add    $0x1,%r10
  cmp    0x98(%rsp),%r11
  jne    L503
  jmp    L953
L1193:
  movsd  0x40(%rsp),%xmm2
  movsd  (%r14),%xmm1
  movapd %xmm2,%xmm3
L248:
  mov    0x28(%rsp),%rax
  movapd 0x30(%rsp),%xmm7
  movsd  (%rax),%xmm0
  andpd  %xmm7,%xmm1
  andpd  %xmm7,%xmm0
  addsd  %xmm1,%xmm0
  comisd (%rsp),%xmm0
  jbe    L201
  mov    0xb8(%rsp),%rbp
  mov    %edi,%r14d
  mov    %r9d,%r13d
  movsd  %xmm0,(%rsp)
  jmp    L1022
L791:
  ucomisd %xmm4,%xmm7
  ja     L89
L1135:
  movapd %xmm4,%xmm2
  sqrtsd %xmm2,%xmm2
  jmp    L795
L1054:
  pxor   %xmm7,%xmm7
  movsd  %xmm7,0x40(%rsp)
  movsd  %xmm7,(%rsp)
  jmp    L1022
L89:
  movapd %xmm4,%xmm0
  mov    %r9d,0xe4(%rsp)
  mov    %edi,0xd8(%rsp)
  mov    %rdx,0xd0(%rsp)
  mov    %r11,0xc8(%rsp)
  movsd  %xmm3,0xb0(%rsp)
  movsd  %xmm1,0x98(%rsp)
  movsd  %xmm4,0x78(%rsp)
  call   <sqrt@plt>
  movsd  0x78(%rsp),%xmm4
  movsd  0x98(%rsp),%xmm1
  movapd %xmm0,%xmm2
  mov    0xd0(%rsp),%rdx
  movsd  0xb0(%rsp),%xmm3
  movapd %xmm1,%xmm0
  subsd  %xmm2,%xmm1
  mov    0xc8(%rsp),%r11
  mov    0xd8(%rsp),%edi
  mulsd  %xmm2,%xmm0
  mov    0xe4(%rsp),%r9d
  movsd  %xmm1,(%rdx)
  subsd  %xmm4,%xmm0
  jmp    L564
L1052:
  movapd %xmm7,%xmm3
  jmp    L1207
  nopl   0x0(%rax)
L155:
  movsd  (%r14),%xmm1
  jmp    L248
L380:
  movapd %xmm2,%xmm0
  mov    %r9d,0xec(%rsp)
  mov    %edi,0xe8(%rsp)
  mov    %edx,0xe4(%rsp)
  mov    %ecx,0xd0(%rsp)
  movsd  %xmm1,0xd8(%rsp)
  movsd  %xmm2,0xc8(%rsp)
  call   <sqrt@plt>
  mov    0xec(%rsp),%r9d
  mov    0xe8(%rsp),%edi
  mov    0xe4(%rsp),%edx
  mov    0xd0(%rsp),%ecx
  movsd  0xd8(%rsp),%xmm1
  movsd  0xc8(%rsp),%xmm2
  jmp    L151
L701:
  movapd %xmm2,%xmm0
  mov    %r9d,0xec(%rsp)
  mov    %edi,0xe8(%rsp)
  mov    %edx,0xe4(%rsp)
  mov    %ecx,0xd0(%rsp)
  movsd  %xmm1,0xd8(%rsp)
  movsd  %xmm2,0xc8(%rsp)
  call   <sqrt@plt>
  mov    0xd0(%rsp),%ecx
  movsd  0xc8(%rsp),%xmm2
  movsd  0xd8(%rsp),%xmm1
  mov    0xe4(%rsp),%edx
  mov    0xe8(%rsp),%edi
  mov    0xec(%rsp),%r9d
  jmp    L87
  nopw   0x0(%rax,%rax,1)
L926:
  movsd  0x40(%rsp),%xmm7
  comisd %xmm1,%xmm7
  ja     L168
  mov    0x18(%rsp),%r13d
  movapd %xmm7,%xmm4
  jmp    L1037
L639:
  lea    D15(%rip),%rdi
  call   <printf@plt>
  lea    D23(%rip),%rdi
  call   <printf@plt>
  mov    $0xffffffff,%eax
  jmp    L571
L1041:
  movapd %xmm4,%xmm0
  mov    %r9d,0xe4(%rsp)
  mov    %edi,0xd8(%rsp)
  mov    %rdx,0xd0(%rsp)
  mov    %r11,0xc8(%rsp)
  movsd  %xmm3,0xb0(%rsp)
  movsd  %xmm1,0x98(%rsp)
  movsd  %xmm4,0x78(%rsp)
  call   <sqrt@plt>
  mov    0xe4(%rsp),%r9d
  mov    0xd8(%rsp),%edi
  mov    0xd0(%rsp),%rdx
  movsd  0x78(%rsp),%xmm4
  movapd %xmm0,%xmm2
  mov    0xc8(%rsp),%r11
  movsd  0xb0(%rsp),%xmm3
  movsd  0x98(%rsp),%xmm1
  jmp    L825
  nopl   0x0(%rax,%rax,1)
L168:
  mov    0x18(%rsp),%r13d
  pxor   %xmm4,%xmm4
  jmp    L1135
```

tool_calls: name: read_data
arguments: label: D17
type_guessed: qword
name: read_data
arguments: label: D43
type_guessed: f64
name: read_data
arguments: label: D0
type_guessed: f32[4]
name: read_data
arguments: label: D52
type_guessed: f64
name: read_data
arguments: label: D143
type_guessed: string
name: read_data
arguments: label: D15
type_guessed: string
name: read_data
arguments: label: D23
type_guessed: string

tool: D17: 9223372036854775807

tool: D43: 1

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

tool: D52: 0.5

tool: D143: Convergence Not Achieved 


tool: D15: Rows (M) should be greater than Columns (B) 


tool: D23: Retry By Transposing the Input Matrix

assistant: ```c
int svd(double *A, int M, int N, double *U, double *V, double *q) {
  int i, j, k, l, t, t2, ierr, cancel, iter, l1;
  double eps, g, x, s, temp, f, h, c, y, z, scale;
  double *e;
  if (M < N) {
    printf("Rows (M) should be greater than Columns (B) \n");
    printf("Retry By Transposing the Input Matrix");
    return -1;
  }
  e = (double *)malloc(sizeof(double) * N);
  ierr = 0;
  eps = macheps();
  g = scale = x = 0.0;
  for (i = 0; i < M * N; ++i) {
    U[i] = A[i];
  }
  for (i = 0; i < N; ++i) {
    l = i + 1;
    e[i] = scale * g;
    g = 0.0;
    s = 0.0;
    scale = 0.0;
    if (i < M) {
      for (k = i; k < M; ++k) {
        scale += fabs(U[k * N + i]);
      }
      if (scale != 0.0) {
        for (k = i; k < M; ++k) {
          t = k * N;
          U[t + i] /= scale;
          temp = U[t + i];
          s += temp * temp;
        }
        f = U[i * N + i];
        g = (f < 0) ? sqrt(s) : -sqrt(s);
        h = f * g - s;
        U[i * N + i] = f - g;
        if (i < N - 1) {
          for (j = l; j < N; ++j) {
            s = 0.0;
            for (k = i; k < M; ++k) {
              t = k * N;
              s += U[t + i] * U[t + j];
            }
            f = s / h;
            for (k = i; k < M; ++k) {
              t = k * N;
              U[t + j] += f * U[t + i];
            }
          }
        }
        for (k = i; k < M; ++k) {
          t = k * N;
          U[t + i] *= scale;
        }
      }
    }
    q[i] = scale * g;
    g = 0.0;
    s = 0.0;
    scale = 0.0;
    if (i < M && i != N - 1) {
      t = i * N;
      for (k = l; k < M; ++k) {
        scale += fabs(U[t + k]);
      }
      if (scale != 0.0) {
        for (k = l; k < N; ++k) {
          U[t + k] /= scale;
          temp = U[t + k];
          s = s + temp * temp;
        }
        f = U[t + l];
        g = (f < 0) ? sqrt(s) : -sqrt(s);
        h = f * g - s;
        U[t + l] = f - g;
        for (k = l; k < N; ++k) {
          e[k] = U[t + k] / h;
        }
        for (j = l; j < M; j++) {
          s = 0.0;
          t2 = j * N;
          for (k = l; k < N; k++) {
            s += U[t2 + k] * U[t + k];
          }
          for (k = l; k < N; k++) {
            U[t2 + k] += s * e[k];
          }
        }
        for (k = l; k < N; k++)
          U[t + k] *= scale;
      }
    }
    temp = fabs(q[i]) + fabs(e[i]);
    if (x < temp) {
      x = temp;
    }
  }
  for (i = N - 1; i >= 0; --i) {
    t = i * N;
    if (i < N - 1) {
      if (g != 0.0) {
        h = U[t + i + 1] * g;
        for (j = l; j < N; ++j) {
          V[j * N + i] = U[t + j] / h;
        }
        for (j = l; j < N; ++j) {
          s = 0.0;
          for (k = l; k < N; ++k) {
            s += U[t + k] * V[k * N + j];
          }
          for (k = l; k < N; ++k) {
            V[k * N + j] += (s * V[k * N + i]);
          }
        }
      }
      for (j = l; j < N; ++j) {
        V[t + j] = V[j * N + i] = 0.0;
      }
    }
    V[t + i] = 1.0;
    g = e[i];
    l = i;
  }
  for (i = N - 1; i >= 0; --i) {
    t = i * N;
    l = i + 1;
    g = q[i];
    if (i < N - 1) {
      for (j = l; j < N; ++j) {
        U[t + j] = 0.0;
      }
    }
    if (g != 0.0) {
      if (i != N - 1) {
        for (j = l; j < N; ++j) {
          s = 0.0;
          for (k = l; k < M; ++k) {
            s += (U[k * N + i] * U[k * N + j]);
          }
          f = (s / U[t + i]) / g;
          for (k = i; k < M; ++k) {
            U[k * N + j] += (f * U[k * N + i]);
          }
        }
      }
      for (j = i; j < M; ++j) {
        U[j * N + i] = U[j * N + i] / g;
      }
    } else {
      for (j = i; j < M; ++j) {
        U[j * N + i] = 0.0;
      }
    }
    U[t + i] += 1.0;
  }
  eps = eps * x;
  for (k = N - 1; k >= 0; --k) {
    iter = 0;
    while (1) {
      iter++;
      if (iter > 50) {
        printf("Convergence Not Achieved \n");
        return 15;
      }
      cancel = 1;
      for (l = k; l >= 0; --l) {
        if (fabs(e[l]) <= eps) {
          cancel = 0;
          break;
        }
        if (fabs(q[l - 1]) <= eps) {
          break;
        }
      }
      if (cancel) {
        c = 0.0;
        s = 1.0;
        l1 = l - 1;
        for (i = l; i <= k; ++i) {
          f = s * e[i];
          e[i] *= c;
          if (fabs(f) <= eps) {
            break;
          }
          g = q[i];
          h = q[i] = hypot(f, g);
          c = g / h;
          s = -f / h;
          for (j = 0; j < M; ++j) {
            t = j * N;
            y = U[t + l1];
            z = U[t + i];
            U[t + l1] = y * c + z * s;
            U[t + i] = z * c - y * s;
          }
        }
      }
      z = q[k];
      if (l != k) {
        x = q[l];
        y = q[k - 1];
        g = e[k - 1];
        h = e[k];
        f = 0.5 * (((g + z) / h) * ((g - z) / y) + y / h - h / y);
        g = hypot(f, 1.0);
        if (f < 0.0) {
          temp = f - g;
        } else {
          temp = f + g;
        }
        f = x - (z / x) * z + (h / x) * (y / temp - h);
        c = s = 1.0;
        for (i = l + 1; i <= k; ++i) {
          g = e[i];
          y = q[i];
          h = s * g;
          g = c * g;
          e[i - 1] = z = hypot(f, h);
          c = f / z;
          s = h / z;
          f = x * c + g * s;
          g = g * c - x * s;
          h = y * s;
          y *= c;
          for (j = 0; j < N; ++j) {
            t = j * N;
            x = V[t + i - 1];
            z = V[t + i];
            V[t + i - 1] = x * c + z * s;
            V[t + i] = z * c - x * s;
          }
          q[i - 1] = z = hypot(f, h);
          if (z != 0.0) {
            c = f / z;
            s = h / z;
          }
          f = c * g + s * y;
          x = c * y - s * g;
          for (j = 0; j < M; ++j) {
            t = j * N;
            y = U[t + i - 1];
            z = U[t + i];
            U[t + i - 1] = y * c + z * s;
            U[t + i] = z * c - y * s;
          }
        }
        e[l] = 0.0;
        e[k] = f;
        q[k] = x;
      } else {
        if (z < 0.0) {
          q[k] = -z;
          for (j = 0; j < N; j++) {
            t = j * N;
            V[t + k] = -V[t + k];
          }
        }
        break;
      }
    }
  }
  svd_sort(U, M, N, V, q);
  free(e);
  return ierr;
}
```