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

```asm
<hugeglasso>:
  endbr64
  mov    %ecx,%eax
  push   %r15
  mov    %rdi,%r15
  imul   %ecx,%eax
  push   %r14
  mov    %rsi,%r14
  push   %r13
  push   %r12
  mov    %rdx,%r12
  push   %rbp
  cltq
  mov    %ecx,%ebp
  push   %rbx
  lea    0x0(,%rax,4),%r13
  mov    %r13,%rdi
  sub    $0x118,%rsp
  movsd  %xmm0,0x10(%rsp)
  call   <malloc@plt>
  mov    %r13,%rdi
  movslq %ebp,%r13
  lea    0x0(,%r13,4),%rbx
  mov    %rax,0x38(%rsp)
  call   <malloc@plt>
  mov    %rbx,%rdi
  mov    %r13,0x98(%rsp)
  mov    %rax,0x58(%rsp)
  call   <malloc@plt>
  mov    %r13,%rdi
  shl    $0x3,%rdi
  mov    %rax,0x20(%rsp)
  mov    %rdi,0x40(%rsp)
  call   <malloc@plt>
  mov    0x40(%rsp),%rdi
  mov    %rax,%r13
  call   <malloc@plt>
  mov    %rax,0x60(%rsp)
  test   %ebp,%ebp
  jle    L712
  mov    0x58(%rsp),%r10
  mov    0x40(%rsp),%rdi
  mov    %r12,%r9
  xor    %r11d,%r11d
  lea    0x4(%rbx),%rsi
  mov    %r13,0x48(%rsp)
  xor    %r8d,%r8d
  pxor   %xmm3,%xmm3
  add    $0x8,%rdi
  mov    %rsi,0x28(%rsp)
  mov    0x20(%rsp),%r13
  movq   D91(%rip),%xmm1
  mov    %r10,0x8(%rsp)
  mov    %rdi,0xc0(%rsp)
  movsd  0x10(%rsp),%xmm2
  lea    -0x1(%rbp),%edi
  mov    %edi,0x84(%rsp)
  movapd %xmm1,%xmm5
  mov    %rdi,0x30(%rsp)
  xor    %edi,%edi
L871:
  movsd  (%r15,%r11,1),%xmm0
  mov    0x8(%rsp),%rax
  movl   $0x0,0x0(%r13,%r8,4)
  addsd  %xmm2,%xmm0
  movl   $0xffffffff,(%rax)
  lea    -0x1(%r8),%eax
  mov    %rax,0x18(%rsp)
  xor    %eax,%eax
  movsd  %xmm0,(%r14,%r11,1)
  movsd  (%r12,%r11,1),%xmm4
  movq   $0x0,(%r12,%r11,1)
  test   %r8,%r8
  jne    L452
  jmp    L521
L1299:
  xorpd  %xmm1,%xmm0
  mov    0x0(%r13,%r8,4),%edx
  movl   $0xffffffff,(%r10,%rax,4)
  divsd  %xmm4,%xmm0
  mov    %edx,0x10(%rsp)
  lea    (%rdx,%rdi,1),%ecx
  mov    0x38(%rsp),%rdx
  movslq %ecx,%rcx
  mov    %esi,(%rdx,%rcx,4)
  mov    0x10(%rsp),%edx
  add    $0x1,%edx
  mov    %edx,0x0(%r13,%r8,4)
  lea    0x1(%rax),%rdx
  movsd  %xmm0,(%r9,%rax,8)
  cmp    0x18(%rsp),%rax
  je     L521
L1175:
  mov    %rdx,%rax
L452:
  movsd  (%r9,%rax,8),%xmm0
  mov    %eax,%esi
  ucomisd %xmm3,%xmm0
  jp     L1299
  jne    L1299
  movl   $0x1,(%r10,%rax,4)
  lea    0x1(%rax),%rdx
  cmp    0x18(%rsp),%rax
  jne    L1175
L521:
  cmp    0x30(%rsp),%r8
  je     L867
  lea    0x1(%r8),%rsi
  mov    %rsi,0x10(%rsp)
  mov    %rsi,%rax
  jmp    L1344
L710:
  xorpd  %xmm5,%xmm0
  mov    0x0(%r13,%r8,4),%edx
  mov    0x38(%rsp),%rsi
  movl   $0xffffffff,(%r10,%rax,4)
  divsd  %xmm4,%xmm0
  add    %edi,%edx
  movslq %edx,%rdx
  mov    %ecx,(%rsi,%rdx,4)
  mov    0x0(%r13,%r8,4),%esi
  lea    0x1(%rsi),%edx
  mov    %edx,0x0(%r13,%r8,4)
  movsd  %xmm0,(%r9,%rax,8)
  add    $0x1,%rax
  cmp    %eax,%ebp
  jle    L808
L1344:
  movsd  (%r9,%rax,8),%xmm0
  mov    %eax,%ecx
  ucomisd %xmm3,%xmm0
  jp     L710
  jne    L710
  movl   $0x1,(%r10,%rax,4)
  add    $0x1,%rax
  cmp    %eax,%ebp
  jg     L1344
L808:
  mov    0x10(%rsp),%rsi
  mov    0x28(%rsp),%rdx
  add    %ebp,%edi
  add    %rbx,%r10
  add    %rdx,0x8(%rsp)
  add    0x40(%rsp),%r9
  add    0xc0(%rsp),%r11
  mov    %rsi,%r8
  jmp    L871
L867:
  mov    %ebp,%eax
  movapd %xmm2,%xmm4
  mov    0x48(%rsp),%r13
  movl   $0x0,0xa0(%rsp)
  mov    %rax,0x18(%rsp)
  shl    $0x3,%rax
  xorpd  D91(%rip),%xmm4
  mov    %rax,0xa8(%rsp)
  mov    %ebp,%eax
  shr    %eax
  sub    $0x1,%eax
  add    $0x1,%rax
  shl    $0x4,%rax
  mov    %rax,0xe8(%rsp)
  mov    %ebp,%eax
  and    $0xfffffffe,%eax
  test   %ebp,%ebp
  mov    %eax,0x108(%rsp)
  mov    $0x1,%eax
  cmovg  %ebp,%eax
  mov    %eax,%ebx
  mov    %eax,0xe4(%rsp)
  shr    %eax
  sub    $0x1,%eax
  and    $0xfffffffe,%ebx
  add    $0x1,%rax
  mov    %ebx,0xe0(%rsp)
  shl    $0x4,%rax
  mov    %rax,0xd0(%rsp)
  lea    0x1(%rbp),%eax
  mov    %eax,0x74(%rsp)
  mov    0x38(%rsp),%rax
  add    $0x4,%rax
  mov    %rax,0x28(%rsp)
  mov    0x98(%rsp),%rax
  add    $0x1,%rax
  mov    %rax,0xf8(%rsp)
  mov    %ebp,%eax
  mov    %r12,%rbp
  mov    %r14,%r12
  mov    %eax,%r14d
L980:
  mov    0xa8(%rsp),%rdx
  mov    0x60(%rsp),%rdi
  mov    %rbp,%rsi
  movsd  %xmm4,0x10(%rsp)
  movsd  %xmm2,0x8(%rsp)
  call   <memcpy@plt>
  mov    0x20(%rsp),%rax
  mov    0x38(%rsp),%r11
  movl   $0x0,0x30(%rsp)
  movsd  0x8(%rsp),%xmm2
  movsd  0x10(%rsp),%xmm4
  pxor   %xmm3,%xmm3
  mov    (%rax),%eax
  movq   D61(%rip),%xmm5
  mov    %eax,0x48(%rsp)
  mov    %eax,%r10d
L599:
  mov    %r15,0x10(%rsp)
  mov    0x58(%rsp),%r9
  xor    %esi,%esi
  xor    %ebx,%ebx
  mov    %r13,0x8(%rsp)
  mov    0x74(%rsp),%r15d
  xor    %edi,%edi
  jmp    L496
  nopl   (%rax)
L923:
  add    $0x1,%rdi
  add    $0x4,%r9
  add    %r15d,%ebx
  add    %r14d,%esi
  cmp    %rdi,0x18(%rsp)
  je     L669
L496:
  cmpl   $0xffffffff,(%r9)
  mov    %edi,%r13d
  je     L923
  mov    0x10(%rsp),%rax
  movsd  (%rax,%rdi,8),%xmm1
  test   %r10d,%r10d
  jle    L409
  mov    0x28(%rsp),%rdx
  lea    -0x1(%r10),%eax
  lea    (%rdx,%rax,4),%r8
  mov    %r11,%rdx
  nopl   0x0(%rax)
L1296:
  movslq (%rdx),%rax
  add    $0x4,%rdx
  lea    (%rsi,%rax,1),%ecx
  movslq %ecx,%rcx
  movsd  (%r12,%rcx,8),%xmm0
  mulsd  0x0(%rbp,%rax,8),%xmm0
  subsd  %xmm0,%xmm1
  cmp    %r8,%rdx
  jne    L1296
L409:
  comisd %xmm2,%xmm1
  jbe    L765
  subsd  %xmm2,%xmm1
L747:
  movslq %ebx,%rax
  divsd  (%r12,%rax,8),%xmm1
  mov    0x8(%rsp),%rax
  movsd  %xmm1,(%rax,%rdi,8)
  movslq %r10d,%rax
  add    $0x1,%r10d
  mov    %r13d,(%r11,%rax,4)
  mov    0x20(%rsp),%rax
  movl   $0xffffffff,(%r9)
  mov    %r10d,(%rax)
L1029:
  movsd  %xmm1,0x0(%rbp,%rdi,8)
  jmp    L923
L765:
  comisd %xmm1,%xmm4
  jbe    L847
  addsd  %xmm2,%xmm1
  jmp    L747
L669:
  mov    0x28(%rsp),%rbx
  mov    0x8(%rsp),%r13
  mov    %r10d,%eax
  mov    %r10d,0x8(%rsp)
  sub    $0x1,%eax
  mov    0x10(%rsp),%r15
  lea    (%rbx,%rax,4),%rsi
  xor    %ebx,%ebx
  nopl   0x0(%rax)
L224:
  mov    0x8(%rsp),%edx
  mov    %r11,%r8
  movapd %xmm3,%xmm10
  movapd %xmm3,%xmm7
  test   %edx,%edx
  jg     L530
  jmp    L491
  nopl   0x0(%rax)
L1077:
  add    $0x4,%r8
  cmp    %rsi,%r8
  je     L491
L530:
  mov    (%r8),%eax
  cmp    $0xffffffff,%eax
  je     L1077
  mov    %r14d,%edi
  movslq %eax,%r9
  mov    %r11,%rdx
  imul   %eax,%edi
  lea    0x0(%rbp,%r9,8),%r10
  movsd  (%r10),%xmm8
  add    %edi,%eax
  movapd %xmm8,%xmm1
  cltq
  movsd  (%r12,%rax,8),%xmm9
  mulsd  %xmm9,%xmm1
  addsd  (%r15,%r9,8),%xmm1
  nopl   (%rax)
L520:
  movslq (%rdx),%rax
  add    $0x4,%rdx
  lea    (%rdi,%rax,1),%ecx
  movslq %ecx,%rcx
  movsd  (%r12,%rcx,8),%xmm0
  mulsd  0x0(%rbp,%rax,8),%xmm0
  subsd  %xmm0,%xmm1
  cmp    %rsi,%rdx
  jne    L520
  comisd %xmm2,%xmm1
  lea    0x0(%r13,%r9,8),%rax
  jbe    L877
  subsd  %xmm2,%xmm1
  divsd  %xmm9,%xmm1
  addsd  %xmm1,%xmm10
L955:
  movapd %xmm1,%xmm0
  add    $0x4,%r8
  movsd  %xmm1,(%rax)
  subsd  %xmm8,%xmm0
  movsd  %xmm1,(%r10)
  andpd  %xmm5,%xmm0
  addsd  %xmm0,%xmm7
  cmp    %rsi,%r8
  jne    L530
L491:
  divsd  %xmm10,%xmm7
  add    $0x1,%ebx
  comisd D10(%rip),%xmm7
  jbe    L231
  cmp    $0x2710,%ebx
  jne    L224
L231:
  mov    0x8(%rsp),%ecx
  mov    %r11,%rdx
  xor    %eax,%eax
  xor    %edi,%edi
  test   %ecx,%ecx
  jle    L986
  mov    0x58(%rsp),%r9
  mov    0x8(%rsp),%r8d
  jmp    L1341
L826:
  add    $0x1,%eax
  movl   $0xffffffff,(%rdx)
  add    $0x1,%edi
  add    $0x4,%rdx
  movl   $0x1,(%r9,%rsi,4)
  cmp    %r8d,%eax
  je     L1056
L1341:
  movslq (%rdx),%rsi
  ucomisd 0x0(%r13,%rsi,8),%xmm3
  mov    %rsi,%rcx
  jp     L88
  je     L826
L88:
  mov    %eax,%esi
  add    $0x1,%eax
  add    $0x4,%rdx
  sub    %edi,%esi
  movslq %esi,%rsi
  mov    %ecx,(%r11,%rsi,4)
  cmp    %r8d,%eax
  jne    L1341
L1056:
  mov    0x8(%rsp),%eax
  sub    %edi,%eax
L1216:
  mov    0x20(%rsp),%rbx
  addl   $0x1,0x30(%rsp)
  mov    0x8(%rsp),%esi
  mov    %eax,(%rbx)
  mov    0x30(%rsp),%ebx
  cmp    %esi,0x48(%rsp)
  je     L1102
  cmp    $0x270f,%ebx
  jg     L1102
  mov    %eax,0x48(%rsp)
  mov    %eax,%r10d
  jmp    L599
  nopl   0x0(%rax)
L877:
  comisd %xmm1,%xmm4
  jbe    L184
  addsd  %xmm2,%xmm1
  divsd  %xmm9,%xmm1
  subsd  %xmm1,%xmm10
  jmp    L955
  nopl   0x0(%rax)
L184:
  movapd %xmm3,%xmm1
  jmp    L955
L847:
  mov    0x8(%rsp),%rax
  movapd %xmm3,%xmm1
  movq   $0x0,(%rax,%rdi,8)
  jmp    L1029
L1102:
  cmp    $0x1,%r14d
  je     L147
  mov    0x74(%rsp),%eax
  lea    0x8(%r12),%r9
  lea    0x8(%rbp),%rbx
  mov    %r14d,%ecx
  mov    0x84(%rsp),%edi
  lea    (%r12,%rax,8),%rdx
  lea    -0x2(%r14),%eax
  lea    0x10(%r12,%rax,8),%r10
  mov    %edi,%eax
  shr    %eax
  sub    $0x1,%eax
  add    $0x1,%rax
  shl    $0x4,%rax
  mov    %rax,%r8
  mov    %edi,%eax
  and    $0xfffffffe,%edi
  mov    %edi,%r11d
  mov    %eax,%edi
  mov    $0x1,%eax
  or     $0x1,%edi
  cmp    $0x2,%r14d
  mov    %edi,%esi
  cmove  %eax,%esi
  mov    %esi,%eax
  lea    0x0(%rbp,%rax,8),%rdi
L526:
  cmp    $0x2,%r14d
  je     L368
  xor    %eax,%eax
  movapd %xmm3,%xmm0
  nopl   0x0(%rax)
L1174:
  movupd (%rbx,%rax,1),%xmm7
  movupd (%rdx,%rax,1),%xmm1
  add    $0x10,%rax
  mulpd  %xmm1,%xmm7
  addsd  %xmm7,%xmm0
  unpckhpd %xmm7,%xmm7
  addsd  %xmm7,%xmm0
  cmp    %r8,%rax
  jne    L1174
  cmp    %r11d,0x84(%rsp)
  je     L198
L439:
  lea    (%rcx,%rsi,1),%eax
  cltq
  movsd  (%r12,%rax,8),%xmm1
  mulsd  (%rdi),%xmm1
  addsd  %xmm1,%xmm0
L198:
  movsd  %xmm0,(%r9)
  add    $0x8,%r9
  add    %r14d,%ecx
  movsd  %xmm0,-0x8(%rdx)
  add    0x40(%rsp),%rdx
  cmp    %r10,%r9
  jne    L526
  mov    0x60(%rsp),%rdx
  xor    %eax,%eax
  movapd %xmm3,%xmm12
L1128:
  movupd (%rdx,%rax,1),%xmm0
  movupd 0x0(%rbp,%rax,1),%xmm7
  add    $0x10,%rax
  subpd  %xmm7,%xmm0
  andpd  D88(%rip),%xmm0
  addsd  %xmm0,%xmm12
  unpckhpd %xmm0,%xmm0
  addsd  %xmm0,%xmm12
  cmp    0xe8(%rsp),%rax
  jne    L1128
  movslq 0x108(%rsp),%rax
  cmp    %eax,%r14d
  je     L465
L153:
  mov    0x60(%rsp),%rbx
  movsd  (%rbx,%rax,8),%xmm0
  subsd  0x0(%rbp,%rax,8),%xmm0
  andpd  D61(%rip),%xmm0
  addsd  %xmm0,%xmm12
L465:
  addsd  %xmm3,%xmm10
  cmp    $0x1,%r14d
  je     L544
  lea    (%r14,%r14,1),%eax
  movl   $0x1,0x70(%rsp)
  mov    %r14d,%ebx
  mov    %eax,0xa4(%rsp)
  mov    0x98(%rsp),%rax
  movq   $0x1,0x48(%rsp)
  mov    %rax,0x30(%rsp)
  add    $0x1,%rax
  mov    %rax,0x90(%rsp)
  lea    0x8(%r12),%rax
  mov    %rax,0xf0(%rsp)
  lea    0x8(%rbp),%rax
  mov    %rax,0xb8(%rsp)
  mov    %r15,0x88(%rsp)
  mov    %r14d,%r15d
L282:
  mov    0x30(%rsp),%rax
  movsd  %xmm12,0x10(%rsp)
  mov    0xa8(%rsp),%rdx
  movsd  %xmm4,0x100(%rsp)
  lea    0x0(,%rax,8),%r14
  movsd  %xmm10,0x8(%rsp)
  lea    0x0(%rbp,%r14,1),%rdi
  mov    %r14,0xc8(%rsp)
  mov    %rdi,%rsi
  mov    %rdi,0x50(%rsp)
  mov    0x60(%rsp),%rdi
  movsd  %xmm2,0xd8(%rsp)
  call   <memcpy@plt>
  mov    0x30(%rsp),%rax
  pxor   %xmm3,%xmm3
  mov    0x20(%rsp),%rdi
  mov    0x48(%rsp),%rsi
  movsd  0x8(%rsp),%xmm10
  movl   $0x0,0x80(%rsp)
  lea    0x0(,%rax,4),%r11
  mov    0x58(%rsp),%rax
  movsd  0x10(%rsp),%xmm12
  mov    (%rdi,%rsi,4),%edi
  movq   D61(%rip),%xmm6
  movsd  0xd8(%rsp),%xmm2
  add    %r11,%rax
  movsd  0x100(%rsp),%xmm4
  mov    %rax,0xb0(%rsp)
  mov    0x88(%rsp),%rax
  mov    %edi,%r10d
  mov    %edi,0x78(%rsp)
  add    0x38(%rsp),%r11
  add    %r14,%rax
  mov    %rax,0x68(%rsp)
L370:
  mov    %r11,0x8(%rsp)
  xor    %esi,%esi
  mov    0x74(%rsp),%r11d
  xor    %r14d,%r14d
  mov    %r13,0x10(%rsp)
  mov    0xb0(%rsp),%r9
  xor    %edi,%edi
  jmp    L1037
L31:
  add    $0x1,%rdi
  add    $0x4,%r9
  add    %r11d,%r14d
  add    %r15d,%esi
  cmp    0x18(%rsp),%rdi
  je     L700
L1037:
  cmpl   $0xffffffff,(%r9)
  mov    %edi,%r13d
  je     L31
  mov    0x68(%rsp),%rax
  movsd  (%rax,%rdi,8),%xmm1
  test   %r10d,%r10d
  jle    L138
  mov    0x28(%rsp),%rdx
  lea    -0x1(%r10),%eax
  add    0x30(%rsp),%rax
  lea    (%rdx,%rax,4),%r8
  mov    0x8(%rsp),%rdx
  nopl   0x0(%rax,%rax,1)
L1221:
  mov    (%rdx),%eax
  add    $0x4,%rdx
  lea    (%rax,%rbx,1),%ecx
  add    %esi,%eax
  movslq %ecx,%rcx
  cltq
  movsd  0x0(%rbp,%rcx,8),%xmm0
  mulsd  (%r12,%rax,8),%xmm0
  subsd  %xmm0,%xmm1
  cmp    %r8,%rdx
  jne    L1221
L138:
  comisd %xmm2,%xmm1
  jbe    L300
  subsd  %xmm2,%xmm1
L9:
  movslq %r14d,%rax
  mov    0x38(%rsp),%rdx
  divsd  (%r12,%rax,8),%xmm1
  mov    0x10(%rsp),%rax
  movsd  %xmm1,(%rax,%rdi,8)
  lea    (%r10,%rbx,1),%eax
  add    $0x1,%r10d
  cltq
  mov    %r13d,(%rdx,%rax,4)
  mov    0x20(%rsp),%rax
  mov    0x48(%rsp),%rdx
  movl   $0xffffffff,(%r9)
  mov    %r10d,(%rax,%rdx,4)
L139:
  mov    0x50(%rsp),%rax
  movsd  %xmm1,(%rax,%rdi,8)
  jmp    L31
L300:
  comisd %xmm1,%xmm4
  jbe    L766
  addsd  %xmm2,%xmm1
  jmp    L9
L700:
  xor    %r14d,%r14d
  mov    0x10(%rsp),%r13
  mov    0x28(%rsp),%rdi
  mov    %r10d,0x10(%rsp)
  mov    0x8(%rsp),%r11
  lea    -0x1(%r10),%eax
  mov    %r14d,0x8(%rsp)
  add    0x30(%rsp),%rax
  mov    0x88(%rsp),%r14
  lea    (%rdi,%rax,4),%rdi
  nopw   0x0(%rax,%rax,1)
L102:
  mov    0x10(%rsp),%eax
  test   %eax,%eax
  jle    L1016
  mov    %r11,%r9
  movapd %xmm3,%xmm11
  movapd %xmm3,%xmm7
  jmp    L807
  nopw   0x0(%rax,%rax,1)
L737:
  add    $0x4,%r9
  cmp    %rdi,%r9
  je     L365
L807:
  movslq (%r9),%rsi
  cmp    $0xffffffff,%esi
  je     L737
  mov    %r15d,%r8d
  lea    (%rsi,%rbx,1),%eax
  imul   %esi,%r8d
  cltq
  lea    0x0(%rbp,%rax,8),%r10
  movsd  (%r10),%xmm8
  lea    (%r8,%rsi,1),%edx
  movslq %edx,%rdx
  movsd  (%r12,%rdx,8),%xmm9
  mov    %r11,%rdx
  movapd %xmm9,%xmm1
  mulsd  %xmm8,%xmm1
  addsd  (%r14,%rax,8),%xmm1
  nopl   0x0(%rax,%rax,1)
L775:
  mov    (%rdx),%eax
  add    $0x4,%rdx
  lea    (%rax,%rbx,1),%ecx
  add    %r8d,%eax
  movslq %ecx,%rcx
  cltq
  movsd  0x0(%rbp,%rcx,8),%xmm0
  mulsd  (%r12,%rax,8),%xmm0
  subsd  %xmm0,%xmm1
  cmp    %rdi,%rdx
  jne    L775
  comisd %xmm2,%xmm1
  lea    0x0(%r13,%rsi,8),%rax
  jbe    L639
  subsd  %xmm2,%xmm1
  divsd  %xmm9,%xmm1
  addsd  %xmm1,%xmm11
L1163:
  movapd %xmm1,%xmm0
  add    $0x4,%r9
  movsd  %xmm1,(%rax)
  subsd  %xmm8,%xmm0
  movsd  %xmm1,(%r10)
  andpd  %xmm6,%xmm0
  addsd  %xmm0,%xmm7
  cmp    %rdi,%r9
  jne    L807
L365:
  divsd  %xmm11,%xmm7
  addl   $0x1,0x8(%rsp)
  mov    0x8(%rsp),%eax
  comisd D10(%rip),%xmm7
  jbe    L953
  cmp    $0x2710,%eax
  jne    L102
L953:
  mov    0x10(%rsp),%eax
  test   %eax,%eax
  jle    L1262
  mov    0x38(%rsp),%r9
  mov    0x58(%rsp),%r10
  lea    (%rax,%rbx,1),%r8d
  mov    %ebx,%ecx
  mov    %r11,%rdx
  xor    %edi,%edi
  jmp    L1101
L749:
  add    %ebx,%eax
  add    $0x1,%ecx
  movl   $0xffffffff,(%rdx)
  add    $0x1,%edi
  cltq
  add    $0x4,%rdx
  movl   $0x1,(%r10,%rax,4)
  cmp    %ecx,%r8d
  je     L635
L1101:
  movslq (%rdx),%rsi
  ucomisd 0x0(%r13,%rsi,8),%xmm3
  mov    %rsi,%rax
  jp     L509
  je     L749
L509:
  mov    %ecx,%esi
  add    $0x1,%ecx
  add    $0x4,%rdx
  sub    %edi,%esi
  movslq %esi,%rsi
  mov    %eax,(%r9,%rsi,4)
  cmp    %ecx,%r8d
  jne    L1101
L635:
  mov    0x10(%rsp),%eax
  sub    %edi,%eax
L1262:
  mov    0x20(%rsp),%rdi
  mov    0x48(%rsp),%rsi
  addl   $0x1,0x80(%rsp)
  mov    %eax,(%rdi,%rsi,4)
  mov    0x80(%rsp),%edi
  cmp    $0x270f,%edi
  jg     L1017
  mov    0x78(%rsp),%esi
  cmp    %esi,0x10(%rsp)
  je     L1017
  mov    %eax,0x78(%rsp)
  mov    %eax,%r10d
  jmp    L370
  nopl   (%rax)
L639:
  comisd %xmm1,%xmm4
  jbe    L735
  addsd  %xmm2,%xmm1
  divsd  %xmm9,%xmm1
  subsd  %xmm1,%xmm11
  jmp    L1163
  nopl   0x0(%rax)
L735:
  movapd %xmm3,%xmm1
  jmp    L1163
L1016:
  movapd %xmm3,%xmm11
  movapd %xmm3,%xmm7
  jmp    L365
L766:
  mov    0x10(%rsp),%rax
  movapd %xmm3,%xmm1
  movq   $0x0,(%rax,%rdi,8)
  jmp    L139
L1017:
  mov    0xc8(%rsp),%rax
  mov    0x70(%rsp),%ecx
  mov    %r13,0x100(%rsp)
  mov    0x48(%rsp),%rsi
  mov    0xf0(%rsp),%r14
  add    %r12,%rax
  lea    0x1(%rcx),%edi
  mov    0x74(%rsp),%r10d
  mov    0x50(%rsp),%r13
  mov    %rax,0xc8(%rsp)
  lea    0x0(,%rsi,8),%rdx
  lea    -0x1(%rcx),%eax
  add    0x30(%rsp),%rax
  lea    (%r14,%rdx,1),%rsi
  lea    (%r14,%rax,8),%r14
  mov    %ecx,%eax
  and    $0xfffffffe,%ecx
  shr    %eax
  mov    %ecx,0x68(%rsp)
  mov    %r15d,%ecx
  mov    0x90(%rsp),%r9
  sub    $0x1,%eax
  sub    %edi,%ecx
  mov    %r14,0x10(%rsp)
  sub    %edi,%r10d
  add    $0x1,%rax
  mov    0xb8(%rsp),%r14
  mov    %edi,0x8(%rsp)
  mov    %rax,%r11
  mov    %ecx,%eax
  mov    %ecx,0xb0(%rsp)
  and    $0xfffffffe,%ecx
  shr    %eax
  lea    (%r14,%r9,8),%r9
  lea    (%rcx,%rdi,1),%r8d
  shl    $0x4,%r11
  sub    $0x1,%eax
  mov    %r10d,0x80(%rsp)
  add    $0x1,%rax
  mov    %ecx,0xd8(%rsp)
  mov    %rax,%r14
  shl    $0x4,%r14
  cmp    $0x2,%r10d
  cmove  %edi,%r8d
  mov    0xc8(%rsp),%rdi
  xor    %ecx,%ecx
  lea    (%r8,%rbx,1),%eax
  cltq
  lea    0x0(%rbp,%rax,8),%r10
  mov    $0xfffffffffffffff8,%rax
  sub    %rdx,%rax
  mov    %rax,0x78(%rsp)
L673:
  cmpl   $0x1,0x70(%rsp)
  je     L866
  mov    0x78(%rsp),%rax
  movapd %xmm3,%xmm0
  lea    (%rax,%rsi,1),%rdx
  xor    %eax,%eax
  nopl   0x0(%rax)
L450:
  movupd 0x0(%r13,%rax,1),%xmm1
  movupd (%rdx,%rax,1),%xmm7
  add    $0x10,%rax
  mulpd  %xmm7,%xmm1
  addsd  %xmm1,%xmm0
  unpckhpd %xmm1,%xmm1
  addsd  %xmm1,%xmm0
  cmp    %r11,%rax
  jne    L450
  mov    0x68(%rsp),%eax
  mov    0x70(%rsp),%edx
  cmp    %edx,%eax
  je     L1308
L354:
  lea    (%rbx,%rax,1),%edx
  add    %ecx,%eax
  movslq %edx,%rdx
  cltq
  movsd  0x0(%rbp,%rdx,8),%xmm1
  mulsd  (%r12,%rax,8),%xmm1
  addsd  %xmm1,%xmm0
L1308:
  cmp    0x8(%rsp),%r15d
  jle    L655
  cmpl   $0x2,0x80(%rsp)
  je     L713
  xor    %eax,%eax
  xchg   %ax,%ax
L1049:
  movupd (%r9,%rax,1),%xmm1
  movupd (%rsi,%rax,1),%xmm7
  add    $0x10,%rax
  mulpd  %xmm7,%xmm1
  addsd  %xmm1,%xmm0
  unpckhpd %xmm1,%xmm1
  addsd  %xmm1,%xmm0
  cmp    %rax,%r14
  jne    L1049
  mov    0xd8(%rsp),%edx
  cmp    %edx,0xb0(%rsp)
  je     L655
L713:
  lea    (%rcx,%r8,1),%eax
  cltq
  movsd  (%r12,%rax,8),%xmm1
  mulsd  (%r10),%xmm1
  addsd  %xmm1,%xmm0
L655:
  movsd  %xmm0,(%rdi)
  add    %r15d,%ecx
  add    $0x8,%rdi
  movsd  %xmm0,-0x8(%rsi)
  add    0x40(%rsp),%rsi
  cmp    0x10(%rsp),%rdi
  jne    L673
  mov    0x8(%rsp),%edi
  mov    0x100(%rsp),%r13
  cmp    %edi,%r15d
  jle    L971
  movslq %edi,%rax
  add    0x30(%rsp),%rax
  mov    0x48(%rsp),%rsi
  mov    %r13,0x100(%rsp)
  lea    (%r12,%rax,8),%rax
  mov    0x90(%rsp),%r14
  mov    0x74(%rsp),%r10d
  mov    %edi,0x10c(%rsp)
  mov    %rax,0xd8(%rsp)
  add    $0x1,%rsi
  mov    0x50(%rsp),%r13
  movslq 0xa4(%rsp),%rax
  mov    %rsi,0x8(%rsp)
  mov    0xb8(%rsp),%r9
  mov    %rax,%rcx
  add    %rsi,%rax
  lea    (%r12,%rax,8),%rsi
  mov    0x84(%rsp),%eax
  lea    (%r9,%r14,8),%r9
  sub    %edi,%eax
  add    %r14,%rax
  lea    0x10(%r12,%rax,8),%rdx
  mov    $0x1,%eax
  mov    %rdx,0x48(%rsp)
  mov    0x70(%rsp),%edx
  test   %edx,%edx
  cmovg  %edx,%eax
  sub    %edi,%r10d
  mov    %r10d,0xb0(%rsp)
  mov    %eax,%edx
  mov    %eax,0x10(%rsp)
  shr    %eax
  and    $0xfffffffe,%edx
  sub    $0x1,%eax
  mov    %edx,0x78(%rsp)
  mov    %r15d,%edx
  add    $0x1,%rax
  sub    %edi,%edx
  mov    %rax,%r11
  mov    %edx,%eax
  mov    %edx,0x80(%rsp)
  and    $0xfffffffe,%edx
  shl    $0x4,%r11
  shr    %eax
  lea    (%rdx,%rdi,1),%r8d
  mov    %edx,0x68(%rsp)
  sub    $0x1,%eax
  add    $0x1,%rax
  mov    %rax,%r14
  shl    $0x4,%r14
  cmp    $0x2,%r10d
  cmove  %edi,%r8d
  mov    0xd8(%rsp),%rdi
  lea    (%r8,%rbx,1),%eax
  cltq
  lea    0x0(%rbp,%rax,8),%r10
  mov    0x8(%rsp),%rax
  neg    %rax
  lea    0x0(,%rax,8),%rdx
  mov    %rdx,0xc8(%rsp)
L57:
  cmpl   $0x1,0x70(%rsp)
  je     L105
  mov    0xc8(%rsp),%rax
  movapd %xmm3,%xmm0
  lea    (%rax,%rsi,1),%rdx
  xor    %eax,%eax
  nopl   0x0(%rax)
L446:
  movupd (%rdx,%rax,1),%xmm1
  movupd 0x0(%r13,%rax,1),%xmm7
  add    $0x10,%rax
  mulpd  %xmm7,%xmm1
  addsd  %xmm1,%xmm0
  unpckhpd %xmm1,%xmm1
  addsd  %xmm1,%xmm0
  cmp    %r11,%rax
  jne    L446
  mov    0x78(%rsp),%eax
  cmp    %eax,0x10(%rsp)
  je     L1086
L201:
  lea    (%rax,%rcx,1),%edx
  add    %ebx,%eax
  movslq %edx,%rdx
  cltq
  movsd  (%r12,%rdx,8),%xmm1
  mulsd  0x0(%rbp,%rax,8),%xmm1
  addsd  %xmm1,%xmm0
L1086:
  cmpl   $0x2,0xb0(%rsp)
  je     L841
  xor    %eax,%eax
  nopl   (%rax)
L193:
  movupd (%rsi,%rax,1),%xmm1
  movupd (%r9,%rax,1),%xmm7
  add    $0x10,%rax
  mulpd  %xmm7,%xmm1
  addsd  %xmm1,%xmm0
  unpckhpd %xmm1,%xmm1
  addsd  %xmm1,%xmm0
  cmp    %r14,%rax
  jne    L193
  mov    0x80(%rsp),%edx
  cmp    %edx,0x68(%rsp)
  je     L120
L841:
  lea    (%r8,%rcx,1),%eax
  cltq
  movsd  (%r12,%rax,8),%xmm1
  mulsd  (%r10),%xmm1
  addsd  %xmm1,%xmm0
L120:
  movsd  %xmm0,(%rdi)
  add    %r15d,%ecx
  add    $0x8,%rdi
  movsd  %xmm0,-0x8(%rsi)
  add    0x40(%rsp),%rsi
  cmp    %rdi,0x48(%rsp)
  jne    L57
  mov    0x100(%rsp),%r13
  mov    0x10c(%rsp),%edi
L1103:
  mov    0x60(%rsp),%rdx
  mov    0x50(%rsp),%rcx
  xor    %eax,%eax
L1211:
  movupd (%rdx,%rax,1),%xmm0
  movupd (%rcx,%rax,1),%xmm7
  add    $0x10,%rax
  subpd  %xmm7,%xmm0
  andpd  D88(%rip),%xmm0
  addsd  %xmm0,%xmm12
  unpckhpd %xmm0,%xmm0
  addsd  %xmm0,%xmm12
  cmp    %rax,0xd0(%rsp)
  jne    L1211
  mov    0xe0(%rsp),%eax
  mov    0xe4(%rsp),%esi
  cmp    %esi,%eax
  je     L1200
  mov    %eax,%edx
  mov    0x60(%rsp),%rsi
  add    %ebx,%eax
  cltq
  movsd  (%rsi,%rdx,8),%xmm0
  subsd  0x0(%rbp,%rax,8),%xmm0
  andpd  D61(%rip),%xmm0
  addsd  %xmm0,%xmm12
L1200:
  mov    0x8(%rsp),%rax
  mov    0x98(%rsp),%rsi
  addsd  %xmm11,%xmm10
  add    %r15d,%ebx
  add    %rsi,0x30(%rsp)
  mov    0xf8(%rsp),%rsi
  add    %r15d,0xa4(%rsp)
  add    %rsi,0x90(%rsp)
  mov    %rax,0x48(%rsp)
  cmp    %edi,%r15d
  je     L722
  mov    %edi,0x70(%rsp)
  jmp    L282
L105:
  movapd %xmm3,%xmm0
  xor    %eax,%eax
  jmp    L201
L866:
  movapd %xmm3,%xmm0
  xor    %eax,%eax
  jmp    L354
L368:
  movapd %xmm3,%xmm0
  jmp    L439
L986:
  mov    0x8(%rsp),%eax
  jmp    L1216
L722:
  mov    %r15d,%r14d
  mov    0x88(%rsp),%r15
L544:
  divsd  %xmm10,%xmm12
  addl   $0x1,0xa0(%rsp)
  mov    0xa0(%rsp),%eax
  comisd D10(%rip),%xmm12
  jbe    L791
  cmp    $0x64,%eax
  jne    L980
L791:
  mov    %r14d,%eax
  xor    %r9d,%r9d
  mov    %r12,%r14
  mov    %rbp,%r12
  movq   D91(%rip),%xmm2
  mov    %eax,%ebp
  add    $0x1,%r9d
  xor    %eax,%eax
  mov    0x40(%rsp),%rbx
  mov    %r12,%r15
  xor    %r11d,%r11d
  movapd %xmm3,%xmm0
  movsd  D70(%rip),%xmm4
  mov    $0x8,%r10d
  movapd %xmm2,%xmm5
  cmp    %r9d,%ebp
  jle    L718
L256:
  mov    %ebp,%edx
  mov    %ebp,%esi
  sub    %eax,%edx
  sub    %r9d,%esi
  cmp    $0x2,%edx
  je     L234
  mov    %esi,%ecx
  lea    (%r14,%r10,1),%r8
  lea    (%r12,%r10,1),%rdi
  xor    %edx,%edx
  shr    %ecx
  shl    $0x4,%rcx
L29:
  movupd (%rdi,%rdx,1),%xmm1
  movupd (%r8,%rdx,1),%xmm6
  add    $0x10,%rdx
  mulpd  %xmm6,%xmm1
  addsd  %xmm1,%xmm0
  unpckhpd %xmm1,%xmm1
  addsd  %xmm1,%xmm0
  cmp    %rcx,%rdx
  jne    L29
  mov    %esi,%ecx
  and    $0xfffffffe,%ecx
  lea    (%rcx,%r9,1),%edx
  cmp    %esi,%ecx
  je     L332
L3:
  add    %r11d,%edx
  movslq %edx,%rdx
  movsd  (%r12,%rdx,8),%xmm1
  mulsd  (%r14,%rdx,8),%xmm1
  addsd  %xmm1,%xmm0
L332:
  movsd  -0x8(%r14,%r10,1),%xmm1
  mov    %eax,%edx
  subsd  %xmm0,%xmm1
  movapd %xmm4,%xmm0
  divsd  %xmm1,%xmm0
  movsd  %xmm0,-0x8(%r12,%r10,1)
  test   %eax,%eax
  je     L82
  movapd %xmm0,%xmm1
  xorpd  %xmm2,%xmm1
  cmp    $0x1,%eax
  jne    L782
L1252:
  xor    %ecx,%ecx
L921:
  add    %r11d,%ecx
  movslq %ecx,%rcx
  lea    (%r12,%rcx,8),%rcx
  mulsd  (%rcx),%xmm1
  movsd  %xmm1,(%rcx)
L335:
  cmp    %r9d,%ebp
  je     L712
L82:
  mov    %ebp,%ecx
  mov    %ebp,%r8d
  sub    %eax,%ecx
  sub    %r9d,%r8d
  cmp    $0x2,%ecx
  je     L54
  lea    (%r12,%r10,1),%rdi
  movapd %xmm0,%xmm1
  movapd %xmm2,%xmm7
  mov    %r8d,%ecx
  shr    %ecx
  lea    0x10(%rdi),%rsi
  xorpd  %xmm5,%xmm1
  sub    $0x1,%ecx
  unpcklpd %xmm1,%xmm1
  shl    $0x4,%rcx
  add    %rsi,%rcx
  jmp    L1205
L1315:
  add    $0x10,%rsi
L1205:
  movupd (%rdi),%xmm6
  mulpd  %xmm1,%xmm6
  movups %xmm6,(%rdi)
  mov    %rsi,%rdi
  cmp    %rsi,%rcx
  jne    L1315
  mov    %r8d,%esi
  and    $0xfffffffe,%esi
  lea    (%rsi,%r9,1),%ecx
  cmp    %esi,%r8d
  je     L1291
L817:
  add    %r11d,%ecx
  xorpd  %xmm7,%xmm0
  movslq %ecx,%rcx
  lea    (%r12,%rcx,8),%rcx
  mulsd  (%rcx),%xmm0
  movsd  %xmm0,(%rcx)
L1291:
  add    %ebp,%r11d
  test   %eax,%eax
  je     L1233
  mov    %r9d,%ecx
  lea    (%r14,%rbx,1),%rdi
  lea    (%r12,%rbx,1),%rsi
  xor    %edx,%edx
  shr    %ecx
  movapd %xmm3,%xmm0
  shl    $0x4,%rcx
L690:
  movupd (%rsi,%rdx,1),%xmm1
  movupd (%rdi,%rdx,1),%xmm6
  add    $0x10,%rdx
  mulpd  %xmm6,%xmm1
  addsd  %xmm1,%xmm0
  unpckhpd %xmm1,%xmm1
  addsd  %xmm1,%xmm0
  cmp    %rcx,%rdx
  jne    L690
  mov    %r9d,%edx
  and    $0xfffffffe,%edx
  test   $0x1,%r9b
  je     L35
L51:
  add    %r11d,%edx
  movslq %edx,%rdx
  movsd  (%r12,%rdx,8),%xmm1
  mulsd  (%r14,%rdx,8),%xmm1
  addsd  %xmm1,%xmm0
L35:
  mov    0x40(%rsp),%rdi
  add    $0x1,%r9d
  add    $0x1,%eax
  add    0xc0(%rsp),%r10
  add    %rdi,%r15
  add    %rdi,%rbx
  cmp    %r9d,%ebp
  jg     L256
L718:
  movsd  -0x8(%r14,%r10,1),%xmm1
  mov    %eax,%edx
  subsd  %xmm0,%xmm1
  movapd %xmm4,%xmm0
  divsd  %xmm1,%xmm0
  movsd  %xmm0,-0x8(%r12,%r10,1)
  test   %eax,%eax
  je     L335
  movapd %xmm0,%xmm1
  xorpd  %xmm2,%xmm1
  cmp    $0x1,%eax
  je     L1252
L782:
  mov    %eax,%ecx
  movapd %xmm1,%xmm7
  shr    %ecx
  unpcklpd %xmm7,%xmm7
  sub    $0x1,%ecx
  shl    $0x4,%rcx
  lea    0x10(%r15,%rcx,1),%rsi
  mov    %r15,%rcx
L1332:
  movupd (%rcx),%xmm6
  add    $0x10,%rcx
  mulpd  %xmm7,%xmm6
  movups %xmm6,-0x10(%rcx)
  cmp    %rsi,%rcx
  jne    L1332
  mov    %eax,%ecx
  and    $0xfffffffe,%ecx
  test   $0x1,%al
  jne    L921
  cmp    %r9d,%ebp
  jne    L82
L712:
  mov    0x38(%rsp),%rdi
  call   <free@plt>
  mov    0x58(%rsp),%rdi
  call   <free@plt>
  mov    0x20(%rsp),%rdi
  call   <free@plt>
  mov    %r13,%rdi
  call   <free@plt>
  mov    0x60(%rsp),%rdi
  add    $0x118,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  jmp    1070 <free@plt>
L971:
  mov    0x48(%rsp),%rax
  add    $0x1,%rax
  mov    %rax,0x8(%rsp)
  jmp    L1103
L147:
  movapd %xmm3,%xmm12
  xor    %eax,%eax
  jmp    L153
L234:
  mov    %r9d,%edx
  jmp    L3
L54:
  mov    %r9d,%ecx
  movapd %xmm2,%xmm7
  jmp    L817
L1233:
  movapd %xmm3,%xmm0
  jmp    L51
```

tool_calls: name: unpack_data
arguments: tag: D91
type: byte[16]
name: unpack_data
arguments: tag: D61
type: qword[2]
name: unpack_data
arguments: tag: D10
type: byte[16]
name: unpack_data
arguments: tag: D88
type: qword[2]
name: unpack_data
arguments: tag: D70
type: byte[8]

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

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

tool: {"D10": [0x2d,0x43,0x1c,0xeb,0xe2,0x36,0x1a,0x3f,0x00,0x00,0x00,0x00,0x00,0x00,0xf0,0x3f]}

tool: {"D88": [0x7fffffffffffffff,0x7fffffffffffffff]}

tool: {"D70": [0x00,0x00,0x00,0x00,0x00,0x00,0xf0,0x3f]}

assistant: ```c
void hugeglasso(const double *S, double *W, double *T, int d, double ilambda) {
  int d2;
  d2 = d * d;
  int i, j, k;
  int rss_idx, w_idx;
  int tmp_i;
  int tmp_j, tmp_a;
  int gap_int;
  double gap_ext, gap_act;
  double thol_act = 1e-4;
  double thol_ext = 1e-4;
  int MAX_ITER_EXT = 100;
  int MAX_ITER_INT = 10000;
  int MAX_ITER_ACT = 10000;
  int iter_ext, iter_int, iter_act;
  int *idx_a = (int *)malloc((d2) * sizeof(int));
  int *idx_i = (int *)malloc((d2) * sizeof(int));
  int *size_a = (int *)malloc(d * sizeof(int));
  double *w1 = (double *)malloc(d * sizeof(double));
  double *ww = (double *)malloc(d * sizeof(double));
  int size_a_prev;
  int junk_a;
  double r;
  double tmp1, tmp2, tmp3, tmp4, tmp5, tmp6;
  for (i = 0; i < d; i++) {
    tmp_i = i * d;
    W[tmp_i + i] = S[tmp_i + i] + ilambda;
    size_a[i] = 0;
    tmp1 = T[tmp_i + i];
    T[tmp_i + i] = 0;
    idx_i[tmp_i + i] = -1;
    for (j = 0; j < i; j++) {
      if (T[tmp_i + j] != 0) {
        idx_a[tmp_i + size_a[i]] = j;
        size_a[i]++;
        idx_i[tmp_i + j] = -1;
        T[tmp_i + j] = -T[tmp_i + j] / tmp1;
      } else
        idx_i[tmp_i + j] = 1;
    }
    for (j = i + 1; j < d; j++) {
      if (T[tmp_i + j] != 0) {
        idx_a[tmp_i + size_a[i]] = j;
        size_a[i]++;
        idx_i[tmp_i + j] = -1;
        T[tmp_i + j] = -T[tmp_i + j] / tmp1;
      } else
        idx_i[tmp_i + j] = 1;
    }
  }
  gap_ext = 1;
  iter_ext = 0;
  while (gap_ext > thol_ext && iter_ext < MAX_ITER_EXT) {
    tmp1 = 0;
    tmp6 = 0;
    tmp5 = 0;
    for (i = 0; i < d; i++) {
      tmp_i = i * d;
      gap_int = 1;
      iter_int = 0;
      for (j = 0; j < d; j++)
        ww[j] = T[tmp_i + j];
      while (gap_int != 0 && iter_int < MAX_ITER_INT) {
        size_a_prev = size_a[i];
        for (j = 0; j < d; j++) {
          if (idx_i[tmp_i + j] != -1) {
            tmp_j = j * d;
            r = S[tmp_i + j];
            for (k = 0; k < size_a[i]; k++) {
              rss_idx = idx_a[tmp_i + k];
              r = r - W[tmp_j + rss_idx] * T[tmp_i + rss_idx];
            }
            if (r > ilambda) {
              w1[j] = (r - ilambda) / W[tmp_j + j];
              idx_a[tmp_i + size_a[i]] = j;
              size_a[i] = size_a[i] + 1;
              idx_i[tmp_i + j] = -1;
            } else if (r < -ilambda) {
              w1[j] = (r + ilambda) / W[tmp_j + j];
              idx_a[tmp_i + size_a[i]] = j;
              size_a[i] = size_a[i] + 1;
              idx_i[tmp_i + j] = -1;
            } else
              w1[j] = 0;
            T[tmp_i + j] = w1[j];
          }
        }
        gap_int = size_a[i] - size_a_prev;
        gap_act = 1;
        iter_act = 0;
        while (gap_act > thol_act && iter_act < MAX_ITER_ACT) {
          tmp3 = 0;
          tmp4 = 0;
          for (j = 0; j < size_a[i]; j++) {
            w_idx = idx_a[tmp_i + j];
            if (w_idx != -1) {
              tmp_a = w_idx * d;
              r = S[tmp_i + w_idx] + T[tmp_i + w_idx] * W[tmp_a + w_idx];
              for (k = 0; k < size_a[i]; k++) {
                rss_idx = idx_a[tmp_i + k];
                r = r - W[tmp_a + rss_idx] * T[tmp_i + rss_idx];
              }
              if (r > ilambda) {
                w1[w_idx] = (r - ilambda) / W[tmp_a + w_idx];
                tmp4 += w1[w_idx];
              } else if (r < -ilambda) {
                w1[w_idx] = (r + ilambda) / W[tmp_a + w_idx];
                tmp4 -= w1[w_idx];
              } else
                w1[w_idx] = 0;
              tmp3 = tmp3 + fabs(w1[w_idx] - T[tmp_i + w_idx]);
              T[tmp_i + w_idx] = w1[w_idx];
            }
          }
          gap_act = tmp3 / tmp4;
          iter_act++;
        }
        junk_a = 0;
        for (j = 0; j < size_a[i]; j++) {
          w_idx = idx_a[tmp_i + j];
          if (w1[w_idx] == 0) {
            junk_a++;
            idx_i[tmp_i + w_idx] = 1;
            idx_a[tmp_i + j] = -1;
          } else
            idx_a[tmp_i + j - junk_a] = w_idx;
        }
        size_a[i] = size_a[i] - junk_a;
        iter_int++;
      }
      for (j = 0; j < i; j++) {
        tmp2 = 0;
        tmp_j = j * d;
        for (k = 0; k < i; k++)
          tmp2 = tmp2 + T[tmp_i + k] * W[tmp_j + k];
        for (k = i + 1; k < d; k++)
          tmp2 = tmp2 + T[tmp_i + k] * W[tmp_j + k];
        W[tmp_i + j] = tmp2;
        W[tmp_j + i] = tmp2;
      }
      for (j = i + 1; j < d; j++) {
        tmp2 = 0;
        tmp_j = j * d;
        for (k = 0; k < i; k++)
          tmp2 = tmp2 + T[tmp_i + k] * W[tmp_j + k];
        for (k = i + 1; k < d; k++)
          tmp2 = tmp2 + T[tmp_i + k] * W[tmp_j + k];
        W[tmp_i + j] = tmp2;
        W[tmp_j + i] = tmp2;
      }
      for (j = 0; j < d; j++)
        tmp5 = tmp5 + fabs(ww[j] - T[tmp_i + j]);
      tmp6 = tmp6 + tmp4;
    }
    gap_ext = tmp5 / tmp6;
    iter_ext++;
  }
  for (i = 0; i < d; i++) {
    tmp2 = 0;
    for (j = 0; j < i; j++)
      tmp2 = tmp2 + W[i * d + j] * T[i * d + j];
    for (j = i + 1; j < d; j++)
      tmp2 = tmp2 + W[i * d + j] * T[i * d + j];
    tmp1 = 1 / (W[i * d + i] - tmp2);
    T[i * d + i] = tmp1;
    for (j = 0; j < i; j++)
      T[i * d + j] = -tmp1 * T[i * d + j];
    for (j = i + 1; j < d; j++)
      T[i * d + j] = -tmp1 * T[i * d + j];
  }
  free(idx_a);
  free(idx_i);
  free(size_a);
  free(w1);
  free(ww);
}
```