user: 请显示与下面列出的汇编代码相匹配的C语言实现:

```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     L987
  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    L480
  mov    0x50(%rsp),%rdx
L583:
  movsd  (%rbx,%rax,8),%xmm0
  movsd  %xmm0,(%rdx,%rax,8)
  add    $0x1,%rax
  cmp    %rcx,%rax
  jne    L583
L480:
  lea    -0x1(%r13),%eax
  mov    %eax,0x8(%rsp)
  test   %r13d,%r13d
  jle    L717
  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   D68(%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    L741
L250:
  movsd  0x40(%rsp),%xmm1
  movq   $0x0,(%r14)
  movapd %xmm1,%xmm3
L1031:
  mov    0x28(%rsp),%rax
  movapd 0x30(%rsp),%xmm7
  movsd  (%rax),%xmm0
  andpd  %xmm7,%xmm1
  andpd  %xmm7,%xmm0
  addsd  %xmm1,%xmm0
  comisd (%rsp),%xmm0
  jbe    L340
  movsd  %xmm0,(%rsp)
L340:
  pxor   %xmm2,%xmm2
L563:
  cmp    %r12d,%r9d
  jle    L523
  mov    0x10(%rsp),%eax
  lea    (%rax,%r9,1),%r10d
L1066:
  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)
L741:
  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    L250
  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
L1168:
  movsd  (%r8),%xmm0
  andpd  0x30(%rsp),%xmm0
  mov    %eax,%edx
  add    $0x1,%eax
  add    %rbp,%r8
  addsd  %xmm0,%xmm1
  cmp    %eax,%edi
  jne    L1168
  movsd  0x40(%rsp),%xmm7
  ucomisd %xmm7,%xmm1
  jp     L1194
  jne    L1194
  mulsd  %xmm7,%xmm1
  movsd  %xmm1,(%r14)
  cmp    0x78(%rsp),%edi
  jle    L1159
L474:
  mov    0x78(%rsp),%esi
  cmp    %esi,0x8(%rsp)
  jne    L273
  movsd  (%r14),%xmm1
  pxor   %xmm3,%xmm3
  jmp    L1031
L273:
  mov    %r12d,0x60(%rsp)
  cmp    %r12d,%edi
  jle    L66
  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
L1054:
  movsd  (%rax),%xmm0
  andpd  0x30(%rsp),%xmm0
  add    $0x8,%rax
  addsd  %xmm0,%xmm3
  cmp    %rdx,%rax
  jne    L1054
  ucomisd 0x40(%rsp),%xmm3
  jp     L135
  jne    L135
  movsd  (%r14),%xmm1
  jmp    L1031
L523:
  mov    0xb8(%rsp),%rbp
  mov    %edi,%r14d
  mov    %r9d,%r13d
L1022:
  mov    0x8(%rsp),%eax
  test   %eax,%eax
  js     L504
  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    L169
L627:
  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
L169:
  mov    0x20(%rsp),%eax
  mov    0x58(%rsp),%rsi
  lea    -0x1(%r9),%r11d
  mov    D95(%rip),%rdx
  add    %r9d,%eax
  cltq
  mov    %rdx,(%rsi,%rax,8)
  test   %r9d,%r9d
  je     L1234
  mov    %ecx,0x20(%rsp)
  cmp    %ebx,%r13d
  jle    L627
  mov    0x30(%rsp),%rax
  movsd  (%rax),%xmm1
  ucomisd 0x40(%rsp),%xmm1
  jp     L442
  jne    L442
  movslq %r11d,%rax
  movslq %r10d,%rbp
  mov    %rax,0x98(%rsp)
  lea    (%r8,%r12,1),%rax
  mov    %rax,0x90(%rsp)
L266:
  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
L1161:
  movq   $0x0,(%rdx)
  add    $0x8,%rax
  add    %r15,%rdx
  movq   $0x0,-0x8(%rax)
  cmp    %rax,%rsi
  jne    L1161
  jmp    L627
L1234:
  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)
L790:
  mov    0x48(%rsp),%rax
  mov    %ebp,%r9d
  mov    %ebp,%ebx
  mov    %ebp,%r13d
  movsd  (%rax,%rbp,8),%xmm2
  cmp    0x8(%rsp),%ebp
  jl     L1065
  ucomisd 0x40(%rsp),%xmm2
  jp     L339
  je     L940
L339:
  cmp    0x8(%rsp),%r13d
  jne    L1182
L559:
  cmp    %r13d,%r14d
  jle    L1084
  movslq 0x18(%rsp),%rax
  mov    0x50(%rsp),%rsi
  add    %rbp,%rax
  lea    (%rsi,%rax,8),%rax
  nopl   0x0(%rax,%rax,1)
L23:
  movsd  (%rax),%xmm0
  add    $0x1,%ebx
  divsd  %xmm2,%xmm0
  movsd  %xmm0,(%rax)
  add    %r15,%rax
  cmp    %ebx,%r14d
  jne    L23
L1084:
  mov    0x20(%rsp),%rax
  sub    $0x1,%rbp
  sub    %ecx,0x18(%rsp)
  sub    $0x1,%r12d
  movsd  D95(%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    L790
  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   D68(%rip),%xmm7
  movaps %xmm7,0x30(%rsp)
L732:
  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)
L271:
  mov    0x88(%rsp),%rax
  mov    0x90(%rsp),%ecx
  mov    0x68(%rsp),%rsi
  movsd  0x70(%rsp),%xmm1
  jmp    L900
  nopl   0x0(%rax)
L555:
  mov    %edi,%ecx
L900:
  lea    (%rsi,%rax,1),%rdx
  movapd 0x30(%rsp),%xmm7
  movsd  (%rdx),%xmm0
  andpd  %xmm7,%xmm0
  comisd %xmm0,%xmm1
  jae    L110
  movsd  -0x8(%r14,%rax,1),%xmm0
  lea    -0x1(%rcx),%edi
  andpd  %xmm7,%xmm0
  comisd %xmm0,%xmm1
  jae    L455
  sub    $0x8,%rax
  cmp    $0xffffffff,%edi
  jne    L555
  mov    0xa8(%rsp),%rax
  mov    $0xffffffff,%ecx
  mov    $0xfffffffe,%edi
  mov    %rax,0x78(%rsp)
  mov    $0xfffffffffffffff8,%rax
  cmp    0x60(%rsp),%ecx
  jg     L6
L54:
  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    D95(%rip),%rax
  movq   %rax,%xmm4
  mov    %r14,%rax
  mov    %rbx,%r14
  mov    %rax,%rbx
  nopl   0x0(%rax)
L602:
  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    L568
  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  D44(%rip),%xmm4
  mov    0x10(%rsp),%rax
  movsd  %xmm0,(%rbx,%r13,8)
  divsd  %xmm0,%xmm1
  divsd  %xmm0,%xmm4
  test   %r15d,%r15d
  jle    L1014
  nopl   0x0(%rax)
L377:
  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    L377
L1014:
  add    $0x1,%r13
  add    $0x8,%r12
  add    $0x1,%r14
  cmp    %r13d,0x48(%rsp)
  jge    L602
L568:
  mov    %r15d,%r12d
  mov    0x18(%rsp),%ecx
  mov    %rbp,%r15
  mov    0x20(%rsp),%ebp
  mov    %rbx,%r14
L110:
  mov    0x60(%rsp),%rax
  movsd  (%r14,%rax,8),%xmm3
  cmp    %eax,%ecx
  je     L237
  mov    0x68(%rsp),%rsi
  movslq %ecx,%rax
  shl    $0x3,%rax
  add    %rax,%rsi
  mov    %rsi,0x78(%rsp)
L507:
  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    D95(%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  D63(%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     L1072
  addsd  %xmm0,%xmm2
L1103:
  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     L145
  mov    0x68(%rsp),%rax
  movslq %ecx,%r13
  lea    (%rax,%r13,8),%rbx
  mov    D95(%rip),%rax
  movq   %rax,%xmm4
  movq   %rax,%xmm2
  mov    %ebp,%eax
  mov    %rbx,%rbp
  mov    %r13,%rbx
  mov    %eax,%r13d
  nopl   (%rax)
L951:
  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    L905
  nopw   0x0(%rax,%rax,1)
L1082:
  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    L1082
L905:
  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     L1088
  movsd  0x20(%rsp),%xmm2
  movsd  0x28(%rsp),%xmm4
  je     L166
L1088:
  movapd %xmm9,%xmm4
  movapd %xmm1,%xmm2
  divsd  %xmm0,%xmm4
  divsd  %xmm0,%xmm2
L166:
  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    L87
  xchg   %ax,%ax
L861:
  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    L861
L87:
  add    $0x1,%rbx
  add    $0x8,%rbp
  cmp    %ebx,0x48(%rsp)
  jge    L951
  mov    %r13d,%ebp
L145:
  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    L271
  lea    D146(%rip),%rdi
  call   <printf@plt>
  mov    $0xf,%eax
L50:
  add    $0xf8,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
L1072:
  subsd  %xmm0,%xmm2
  jmp    L1103
L455:
  mov    %rdx,0x78(%rsp)
  cmp    0x60(%rsp),%ecx
  jle    L54
L6:
  mov    0x60(%rsp),%rsi
  movsd  (%r14,%rsi,8),%xmm3
  jmp    L507
L639:
  ucomisd 0x40(%rsp),%xmm2
  jp     L559
  jne    L559
L940:
  cmp    %r13d,%r14d
  jle    L1084
  movslq 0x18(%rsp),%rax
  mov    0x50(%rsp),%rsi
  add    %rbp,%rax
  lea    (%rsi,%rax,8),%rax
  nopw   0x0(%rax,%rax,1)
L299:
  add    $0x1,%ebx
  movq   $0x0,(%rax)
  add    %r15,%rax
  cmp    %ebx,%r14d
  jne    L299
  jmp    L1084
L1065:
  cmp    %r12d,%ecx
  jle    L639
  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     L971
  je     L940
L971:
  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
L590:
  mov    %r9,%rax
  mov    %r12d,%r11d
  pxor   %xmm1,%xmm1
  cmp    %r12d,%r14d
  jle    L406
  nopl   0x0(%rax)
L962:
  movsd  (%rax),%xmm0
  mulsd  (%rax,%rsi,8),%xmm0
  add    $0x1,%r11d
  add    %r15,%rax
  addsd  %xmm0,%xmm1
  cmp    %r11d,%r14d
  jne    L962
L406:
  divsd  (%r10),%xmm1
  divsd  %xmm2,%xmm1
  mov    %rdi,%rax
  mov    %ebx,%r11d
  cmp    %r13d,%r14d
  jle    L780
  nopl   (%rax)
L899:
  movsd  (%rax,%rdx,8),%xmm0
  add    $0x1,%r11d
  mulsd  %xmm1,%xmm0
  addsd  (%rax),%xmm0
  movsd  %xmm0,(%rax)
  add    %r15,%rax
  cmp    %r11d,%r14d
  jne    L899
L780:
  sub    $0x1,%rdx
  add    $0x8,%rdi
  add    $0x1,%rsi
  cmp    %rdx,%r8
  jne    L590
  jmp    L559
L237:
  movsd  0x40(%rsp),%xmm7
  mov    %r12d,%r13d
  mov    %r14,%r12
  comisd %xmm3,%xmm7
  ja     L139
L236:
  subq   $0x1,0x60(%rsp)
  mov    0x60(%rsp),%rax
  test   %eax,%eax
  jns    L732
  mov    %r13d,%r14d
  mov    %ebp,%r13d
  mov    %r12,%rbp
L504:
  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    L50
L1182:
  cmp    %r12d,%ecx
  jg     L971
  jmp    L559
  nopl   0x0(%rax)
L442:
  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
L1202:
  movsd  (%rax),%xmm0
  add    $0x8,%rax
  divsd  %xmm1,%xmm0
  movsd  %xmm0,(%rdx)
  add    %r15,%rdx
  cmp    %rax,%rsi
  jne    L1202
  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)
L633:
  mov    0x78(%rsp),%rax
  mov    %rdi,%r14
  pxor   %xmm1,%xmm1
  nop
L460:
  movsd  (%rax),%xmm0
  mulsd  (%r14),%xmm0
  add    $0x8,%rax
  add    %r15,%r14
  addsd  %xmm0,%xmm1
  cmp    %rax,%rsi
  jne    L460
  mov    %rdi,%rax
  mov    %r9d,%r14d
  nop
L1138:
  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    L1138
  add    $0x8,%rdi
  sub    $0x1,%rdx
  cmp    %rdx,0x80(%rsp)
  jne    L633
  jmp    L266
L1194:
  mov    0x60(%rsp),%rax
  mov    %ecx,%r11d
  pxor   %xmm2,%xmm2
L1227:
  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    L1227
  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     L991
  movsd  0x40(%rsp),%xmm7
  ucomisd %xmm2,%xmm7
  ja     L769
  movapd %xmm2,%xmm0
  sqrtsd %xmm0,%xmm0
L800:
  xorpd  D44(%rip),%xmm0
L1142:
  movsd  0x98(%rsp),%xmm3
  mov    0x78(%rsp),%esi
  subsd  %xmm0,%xmm3
  movsd  %xmm3,0x0(%r13)
  cmp    %esi,0x8(%rsp)
  jg     L32
L710:
  mov    0x60(%rsp),%rax
L1024:
  movsd  (%rax),%xmm2
  mov    %ecx,%esi
  add    $0x1,%ecx
  mulsd  %xmm1,%xmm2
  movsd  %xmm2,(%rax)
  add    %rbp,%rax
  cmp    %esi,%edx
  jne    L1024
  mulsd  %xmm1,%xmm0
  movsd  %xmm0,(%r14)
  jmp    L474
L991:
  ucomisd %xmm2,%xmm4
  ja     L798
  movapd %xmm2,%xmm0
  sqrtsd %xmm0,%xmm0
  jmp    L1142
L139:
  xorpd  D44(%rip),%xmm3
  mov    0x60(%rsp),%rax
  movsd  %xmm3,(%r14,%rax,8)
  test   %ebp,%ebp
  jle    L236
  mov    0x88(%rsp),%rax
  xor    %ecx,%ecx
  add    0x58(%rsp),%rax
L499:
  movsd  (%rax),%xmm0
  xorpd  D44(%rip),%xmm0
  add    $0x1,%ecx
  movsd  %xmm0,(%rax)
  add    %r15,%rax
  cmp    %ecx,%ebp
  jne    L499
  jmp    L236
L135:
  movslq 0x70(%rsp),%rax
  mov    0x50(%rsp),%rsi
  lea    (%rsi,%rax,8),%rdx
  movsd  (%rdx),%xmm1
  cmp    0x60(%rsp),%r9d
  jle    L1056
  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
L941:
  movsd  (%rax),%xmm0
  add    $0x8,%rax
  divsd  %xmm3,%xmm0
  movsd  %xmm0,-0x8(%rax)
  mulsd  %xmm0,%xmm0
  addsd  %xmm0,%xmm4
  cmp    %rcx,%rax
  jne    L941
  movsd  (%rdx),%xmm1
  movsd  0x40(%rsp),%xmm7
  comisd %xmm1,%xmm7
  ja     L319
  movsd  0x40(%rsp),%xmm7
  ucomisd %xmm4,%xmm7
  ja     L793
L527:
  movapd %xmm4,%xmm2
  sqrtsd %xmm2,%xmm2
L973:
  xorpd  D44(%rip),%xmm2
L1015:
  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    L403
L488:
  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    L824
L1039:
  movsd  (%rcx,%rax,1),%xmm1
L824:
  divsd  %xmm0,%xmm1
  add    $0x8,%rax
  movsd  %xmm1,-0x8(%rax)
  cmp    %rdx,%rax
  jne    L1039
L403:
  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
L3:
  lea    (%rdx,%r15,1),%rax
  pxor   %xmm1,%xmm1
  cmp    0x60(%rsp),%r9d
  jle    L1246
  nopl   0x0(%rax,%rax,1)
L409:
  movsd  (%rax),%xmm0
  mulsd  (%rax,%rsi,8),%xmm0
  add    $0x8,%rax
  addsd  %xmm0,%xmm1
  cmp    %rax,%rcx
  jne    L409
  mov    %r15,%rax
  nopl   0x0(%rax)
L893:
  movsd  (%rax),%xmm0
  mulsd  %xmm1,%xmm0
  addsd  (%rdx,%rax,1),%xmm0
  movsd  %xmm0,(%rdx,%rax,1)
  add    $0x8,%rax
  cmp    %rax,%r8
  jne    L893
L1246:
  addl   $0x1,0x48(%rsp)
  mov    0x48(%rsp),%eax
  add    %rbp,%rdx
  add    %rbp,%rcx
  sub    0x88(%rsp),%rsi
  cmp    %eax,%edi
  jne    L3
  cmp    0x60(%rsp),%r9d
  jle    L632
  mov    0x20(%rsp),%rax
  mov    0x80(%rsp),%rsi
  add    %r13,%rax
  add    %rbx,%rax
  lea    (%rsi,%rax,8),%rax
L334:
  movsd  (%r11),%xmm0
  add    $0x8,%r11
  mulsd  %xmm3,%xmm0
  movsd  %xmm0,-0x8(%r11)
  cmp    %r11,%rax
  jne    L334
  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    L1066
L32:
  cmp    %r12d,%r9d
  jle    L710
  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
L760:
  mov    0x90(%rsp),%rax
  mov    %ecx,%r8d
  pxor   %xmm2,%xmm2
L880:
  movsd  (%rax),%xmm3
  mulsd  (%rax,%r10,8),%xmm3
  mov    %r8d,%r13d
  add    %rbp,%rax
  add    $0x1,%r8d
  addsd  %xmm3,%xmm2
  cmp    %edx,%r13d
  jne    L880
  divsd  %xmm4,%xmm2
  mov    %rsi,%rax
  mov    %ecx,%r8d
L354:
  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    L354
  add    $0x8,%rsi
  sub    $0x1,%r11
  add    $0x1,%r10
  cmp    0x98(%rsp),%r11
  jne    L760
  jmp    L710
L66:
  movsd  0x40(%rsp),%xmm2
  movsd  (%r14),%xmm1
  movapd %xmm2,%xmm3
L606:
  mov    0x28(%rsp),%rax
  movapd 0x30(%rsp),%xmm7
  movsd  (%rax),%xmm0
  andpd  %xmm7,%xmm1
  andpd  %xmm7,%xmm0
  addsd  %xmm1,%xmm0
  comisd (%rsp),%xmm0
  jbe    L563
  mov    0xb8(%rsp),%rbp
  mov    %edi,%r14d
  mov    %r9d,%r13d
  movsd  %xmm0,(%rsp)
  jmp    L1022
L319:
  ucomisd %xmm4,%xmm7
  ja     L593
L364:
  movapd %xmm4,%xmm2
  sqrtsd %xmm2,%xmm2
  jmp    L1015
L717:
  pxor   %xmm7,%xmm7
  movsd  %xmm7,0x40(%rsp)
  movsd  %xmm7,(%rsp)
  jmp    L1022
L593:
  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    L488
L1159:
  movapd %xmm7,%xmm3
  jmp    L1031
  nopl   0x0(%rax)
L632:
  movsd  (%r14),%xmm1
  jmp    L606
L769:
  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    L800
L798:
  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    L1142
  nopw   0x0(%rax,%rax,1)
L1056:
  movsd  0x40(%rsp),%xmm7
  comisd %xmm1,%xmm7
  ja     L1209
  mov    0x18(%rsp),%r13d
  movapd %xmm7,%xmm4
  jmp    L527
L987:
  lea    D138(%rip),%rdi
  call   <printf@plt>
  lea    D18(%rip),%rdi
  call   <printf@plt>
  mov    $0xffffffff,%eax
  jmp    L50
L793:
  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    L973
  nopl   0x0(%rax,%rax,1)
L1209:
  mov    0x18(%rsp),%r13d
  pxor   %xmm4,%xmm4
  jmp    L364
```

tool_calls: name: unpack_data
arguments: data_label: D68
type_infered: qword
name: unpack_data
arguments: data_label: D95
type_infered: f64
name: unpack_data
arguments: data_label: D44
type_infered: f32[4]
name: unpack_data
arguments: data_label: D63
type_infered: f64
name: unpack_data
arguments: data_label: D146
type_infered: string
name: unpack_data
arguments: data_label: D138
type_infered: string
name: unpack_data
arguments: data_label: D18
type_infered: string

tool: D68: 9223372036854775807

tool: D95: 1

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

tool: D63: 0.5

tool: D146: Convergence Not Achieved 


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


tool: D18: 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;
}
```