user: Converte this assembly snippet into its equivalent C code:

```asm
<corth>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x78,%rsp
  mov    %edi,0x20(%rsp)
  mov    %esi,0x60(%rsp)
  mov    %edx,%eax
  mov    0xb0(%rsp),%rbx
  mov    0xb8(%rsp),%r14
  lea    0x1(%rdx),%edx
  cmp    %edx,%ecx
  jle    L35
  mov    %ecx,%r15d
  mov    %r8,%r13
  mov    %r9,%r12
  movslq %edx,%rsi
  mov    %rsi,0x18(%rsp)
  mov    %edi,%esi
  lea    0x1(%rdi),%edi
  mov    %edi,0x4c(%rsp)
  lea    -0x1(%rax),%edx
  imul   %esi,%edx
  mov    %edx,0x24(%rsp)
  lea    (%rax,%rdx,1),%edi
  mov    %edi,0x38(%rsp)
  mov    %ecx,%edx
  sub    %eax,%edx
  lea    -0x1(%rdx),%edi
  mov    %edi,0x28(%rsp)
  imul   %esi,%eax
  mov    %eax,0x2c(%rsp)
  mov    %esi,%eax
  neg    %eax
  cltq
  shl    $0x3,%rax
  mov    %rax,0x58(%rsp)
  movslq %esi,%rax
  shl    $0x3,%rax
  mov    %rax,0x50(%rsp)
  lea    -0x1(%rcx),%eax
  mov    %eax,0x64(%rsp)
  imul   %esi,%eax
  cltq
  mov    %rax,0x68(%rsp)
  jmp    L120
L166:
  movsd  0x10(%rsp),%xmm0
  call   <sqrt@plt>
  movsd  %xmm0,0x30(%rsp)
  jmp    L109
L124:
  mov    0x18(%rsp),%rax
  movsd  0x30(%rsp),%xmm5
  movsd  %xmm5,-0x8(%rbx,%rax,8)
  movslq 0x38(%rsp),%rax
  movsd  0x8(%rsp),%xmm5
  movsd  %xmm5,0x0(%r13,%rax,8)
  jmp    L131
L110:
  movapd %xmm2,%xmm3
  mulsd  -0x8(%rbx,%rax,8),%xmm3
  movsd  -0x8(%rcx,%rax,8),%xmm0
  subsd  %xmm3,%xmm0
  movapd %xmm1,%xmm3
  mulsd  -0x8(%r14,%rax,8),%xmm3
  addsd  %xmm3,%xmm0
  movsd  %xmm0,-0x8(%rcx,%rax,8)
  movapd %xmm2,%xmm3
  mulsd  -0x8(%r14,%rax,8),%xmm3
  movsd  -0x8(%rdx,%rax,8),%xmm0
  subsd  %xmm3,%xmm0
  movapd %xmm1,%xmm3
  mulsd  -0x8(%rbx,%rax,8),%xmm3
  subsd  %xmm3,%xmm0
  movsd  %xmm0,-0x8(%rdx,%rax,8)
  add    $0x1,%rax
  cmp    %eax,%r15d
  jge    L110
  add    $0x1,%r8d
  add    0x20(%rsp),%esi
  cmp    %edi,%r8d
  je     L57
L149:
  movslq %esi,%rdx
  shl    $0x3,%rdx
  lea    0x0(%r13,%rdx,1),%rcx
  add    %r12,%rdx
  mov    %r9,%rax
  movapd %xmm5,%xmm2
  movapd %xmm5,%xmm1
L185:
  movsd  (%rbx,%rax,1),%xmm0
  movsd  (%rcx,%rax,1),%xmm4
  movapd %xmm0,%xmm3
  mulsd  %xmm4,%xmm3
  addsd  %xmm3,%xmm2
  movsd  (%r14,%rax,1),%xmm3
  movsd  (%rdx,%rax,1),%xmm6
  movapd %xmm3,%xmm7
  mulsd  %xmm6,%xmm7
  addsd  %xmm7,%xmm2
  mulsd  %xmm6,%xmm0
  addsd  %xmm0,%xmm1
  mulsd  %xmm3,%xmm4
  subsd  %xmm4,%xmm1
  sub    $0x8,%rax
  cmp    %rbp,%rax
  jne    L185
  movsd  0x10(%rsp),%xmm6
  divsd  %xmm6,%xmm2
  divsd  %xmm6,%xmm1
  mov    %r10,%rax
  jmp    L110
L57:
  test   %r15d,%r15d
  jle    L28
  movslq 0x2c(%rsp),%rax
  lea    0x8(,%rax,8),%rcx
  mov    0x64(%rsp),%r8d
  mov    0x68(%rsp),%rdi
  sub    %rax,%rdi
  shl    $0x3,%rdi
  mov    $0x0,%esi
  pxor   %xmm5,%xmm5
  mov    0x50(%rsp),%r9
  mov    0x58(%rsp),%r10
  mov    0x40(%rsp),%r11
  jmp    L126
L107:
  movapd %xmm2,%xmm3
  mulsd  -0x8(%rbx,%rax,8),%xmm3
  movsd  -0x8(%r13,%rdx,1),%xmm0
  subsd  %xmm3,%xmm0
  movapd %xmm1,%xmm3
  mulsd  -0x8(%r14,%rax,8),%xmm3
  subsd  %xmm3,%xmm0
  movsd  %xmm0,-0x8(%r13,%rdx,1)
  movapd %xmm2,%xmm0
  mulsd  -0x8(%r14,%rax,8),%xmm0
  addsd  -0x8(%r12,%rdx,1),%xmm0
  movapd %xmm1,%xmm3
  mulsd  -0x8(%rbx,%rax,8),%xmm3
  subsd  %xmm3,%xmm0
  movsd  %xmm0,-0x8(%r12,%rdx,1)
  add    $0x1,%rax
  add    %r9,%rdx
  cmp    %eax,%r15d
  jge    L107
  lea    0x1(%rsi),%rax
  add    $0x8,%rcx
  cmp    %r8,%rsi
  je     L28
  mov    %rax,%rsi
L126:
  lea    (%rcx,%rdi,1),%rdx
  mov    %r11,%rax
  movapd %xmm5,%xmm2
  movapd %xmm5,%xmm1
L123:
  movsd  (%rbx,%rax,1),%xmm0
  movsd  -0x8(%r13,%rdx,1),%xmm4
  movapd %xmm0,%xmm3
  mulsd  %xmm4,%xmm3
  addsd  %xmm3,%xmm2
  movsd  (%r14,%rax,1),%xmm3
  movsd  -0x8(%r12,%rdx,1),%xmm6
  movapd %xmm3,%xmm7
  mulsd  %xmm6,%xmm7
  subsd  %xmm7,%xmm2
  mulsd  %xmm6,%xmm0
  addsd  %xmm0,%xmm1
  mulsd  %xmm3,%xmm4
  addsd  %xmm4,%xmm1
  sub    $0x8,%rax
  add    %r10,%rdx
  cmp    %rbp,%rax
  jne    L123
  movsd  0x10(%rsp),%xmm6
  divsd  %xmm6,%xmm2
  divsd  %xmm6,%xmm1
  mov    %rcx,%rdx
  mov    0x18(%rsp),%rax
  jmp    L107
L28:
  mov    0x18(%rsp),%rax
  movsd  0x8(%rsp),%xmm5
  movapd %xmm5,%xmm0
  mulsd  -0x8(%rbx,%rax,8),%xmm0
  movsd  %xmm0,-0x8(%rbx,%rax,8)
  mulsd  -0x8(%r14,%rax,8),%xmm5
  movsd  %xmm5,-0x8(%r14,%rax,8)
  movsd  0x30(%rsp),%xmm0
  xorpd  D0(%rip),%xmm0
  movslq 0x38(%rsp),%rax
  shl    $0x3,%rax
  lea    0x0(%r13,%rax,1),%rdx
  movapd %xmm0,%xmm1
  mulsd  (%rdx),%xmm1
  movsd  %xmm1,(%rdx)
  add    %r12,%rax
  mulsd  (%rax),%xmm0
  movsd  %xmm0,(%rax)
L26:
  addq   $0x1,0x18(%rsp)
  mov    0x4c(%rsp),%edi
  add    %edi,0x38(%rsp)
  mov    0x20(%rsp),%edi
  add    %edi,0x24(%rsp)
  add    %edi,0x2c(%rsp)
  subl   $0x1,0x28(%rsp)
  je     L35
L120:
  mov    0x18(%rsp),%r11
  mov    %r11d,%esi
  mov    %r11d,0x48(%rsp)
  movq   $0x0,-0x8(%rbx,%r11,8)
  movq   $0x0,-0x8(%r14,%r11,8)
  mov    %r11d,0x3c(%rsp)
  cmp    %r11d,%r15d
  jl     L26
  movslq 0x24(%rsp),%rcx
  lea    -0x1(%rcx,%r11,1),%rax
  shl    $0x3,%rax
  mov    0x28(%rsp),%edi
  lea    (%rcx,%rdi,1),%rdx
  add    %r11,%rdx
  shl    $0x3,%rdx
  pxor   %xmm5,%xmm5
  movsd  %xmm5,0x8(%rsp)
L13:
  movsd  0x0(%r13,%rax,1),%xmm0
  andpd  D38(%rip),%xmm0
  movsd  (%r12,%rax,1),%xmm1
  andpd  D38(%rip),%xmm1
  addsd  %xmm1,%xmm0
  addsd  0x8(%rsp),%xmm0
  movsd  %xmm0,0x8(%rsp)
  add    $0x8,%rax
  cmp    %rdx,%rax
  jne    L13
  movsd  0x8(%rsp),%xmm5
  ucomisd D19(%rip),%xmm5
  jp     L48
  je     L26
L48:
  lea    (%r15,%rsi,1),%eax
  cltq
  mov    %rax,%rdx
  mov    0x18(%rsp),%r11
  sub    %r11,%rdx
  lea    -0x8(,%rdx,8),%rsi
  mov    %rsi,0x40(%rsp)
  add    %r11,%rdi
  sub    %rdi,%rax
  lea    -0x10(,%rax,8),%rbp
  lea    0x0(,%rcx,8),%rdx
  lea    0x0(%r13,%rdx,1),%rcx
  add    %r12,%rdx
  mov    %rsi,%rax
  pxor   %xmm5,%xmm5
  movsd  %xmm5,0x10(%rsp)
L41:
  movsd  (%rcx,%rax,1),%xmm0
  movsd  0x8(%rsp),%xmm5
  divsd  %xmm5,%xmm0
  movsd  %xmm0,(%rbx,%rax,1)
  movsd  (%rdx,%rax,1),%xmm0
  divsd  %xmm5,%xmm0
  movsd  %xmm0,(%r14,%rax,1)
  movsd  (%rbx,%rax,1),%xmm1
  mulsd  %xmm1,%xmm1
  addsd  0x10(%rsp),%xmm1
  mulsd  %xmm0,%xmm0
  addsd  %xmm1,%xmm0
  movsd  %xmm0,0x10(%rsp)
  sub    $0x8,%rax
  cmp    %rbp,%rax
  jne    L41
  pxor   %xmm0,%xmm0
  movsd  0x10(%rsp),%xmm5
  ucomisd %xmm5,%xmm0
  ja     L166
  sqrtsd %xmm5,%xmm5
  movsd  %xmm5,0x30(%rsp)
L109:
  mov    0x18(%rsp),%rax
  movsd  -0x8(%rbx,%rax,8),%xmm0
  movsd  -0x8(%r14,%rax,8),%xmm1
  mov    $0x2,%eax
  call   <pythag@plt>
  test   %eax,%eax
  je     L124
  pxor   %xmm0,%xmm0
  cvtsi2sd %eax,%xmm0
  movsd  0x30(%rsp),%xmm5
  movapd %xmm5,%xmm1
  mulsd  %xmm0,%xmm1
  addsd  0x10(%rsp),%xmm1
  movsd  %xmm1,0x10(%rsp)
  divsd  %xmm0,%xmm5
  movsd  %xmm5,0x30(%rsp)
  movapd %xmm5,%xmm0
  addsd  D6(%rip),%xmm0
  mov    0x18(%rsp),%rax
  movapd %xmm0,%xmm1
  mulsd  -0x8(%rbx,%rax,8),%xmm1
  movsd  %xmm1,-0x8(%rbx,%rax,8)
  mulsd  -0x8(%r14,%rax,8),%xmm0
  movsd  %xmm0,-0x8(%r14,%rax,8)
L131:
  mov    0x60(%rsp),%eax
  mov    0x3c(%rsp),%esi
  cmp    %esi,%eax
  jl     L57
  lea    0x1(%rax),%edi
  mov    0x2c(%rsp),%esi
  pxor   %xmm5,%xmm5
  mov    0x48(%rsp),%r8d
  mov    0x40(%rsp),%r9
  mov    0x18(%rsp),%r10
  jmp    L149
L35:
  add    $0x78,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
```

tool_calls: name: parse_data
arguments: tag: D0
data_type: f32[4]
name: parse_data
arguments: tag: D38
data_type: qword[2]
name: parse_data
arguments: tag: D19
data_type: f32[2]
name: parse_data
arguments: tag: D6
data_type: f64

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

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

tool: {"D19": [0.0,0.0]}

tool: D6: 1

assistant: ```c
void corth(int nm, int n, int low, int igh, double *ar, double *ai, double *ortr, double *orti) {
  int i, j, m, ii, jj, la, mp, kp1;
  double f, g, h, fi, fr, scale;
  la = igh - 1;
  kp1 = low + 1;
  if (la < kp1)
    return;
  for (m = kp1; m <= la; m++) {
    h = 0.0;
    ortr[(m)-1] = 0.0;
    orti[(m)-1] = 0.0;
    scale = 0.0;
    for (i = m; i <= igh; i++)
      scale += fabs(ar[(i)-1 + ((m - 1) - 1) * (nm)]) + fabs(ai[(i)-1 + ((m - 1) - 1) * (nm)]);
    if (scale == 0.0)
      continue;
    mp = m + igh;
    for (ii = m; ii <= igh; ii++) {
      i = mp - ii;
      ortr[(i)-1] = ar[(i)-1 + ((m - 1) - 1) * (nm)] / scale;
      orti[(i)-1] = ai[(i)-1 + ((m - 1) - 1) * (nm)] / scale;
      h = h + ortr[(i)-1] * ortr[(i)-1] + orti[(i)-1] * orti[(i)-1];
    }
    g = sqrt(h);
    f = pythag(ortr[(m)-1], orti[(m)-1]);
    if (f != 0.0) {
      h += f * g;
      g /= f;
      ortr[(m)-1] = (1.0 + g) * ortr[(m)-1];
      orti[(m)-1] = (1.0 + g) * orti[(m)-1];
    } else {
      ortr[(m)-1] = g;
      ar[(m)-1 + ((m - 1) - 1) * (nm)] = scale;
    }
    for (j = m; j <= n; j++) {
      fr = 0.0;
      fi = 0.0;
      for (ii = m; ii <= igh; ii++) {
        i = mp - ii;
        fr = fr + ortr[(i)-1] * ar[(i)-1 + ((j)-1) * (nm)] + orti[(i)-1] * ai[(i)-1 + ((j)-1) * (nm)];
        fi = fi + ortr[(i)-1] * ai[(i)-1 + ((j)-1) * (nm)] - orti[(i)-1] * ar[(i)-1 + ((j)-1) * (nm)];
      }
      fr /= h;
      fi /= h;
      for (i = m; i <= igh; i++) {
        ar[(i)-1 + ((j)-1) * (nm)] = ar[(i)-1 + ((j)-1) * (nm)] - fr * ortr[(i)-1] + fi * orti[(i)-1];
        ai[(i)-1 + ((j)-1) * (nm)] = ai[(i)-1 + ((j)-1) * (nm)] - fr * orti[(i)-1] - fi * ortr[(i)-1];
      }
    }
    for (i = 1; i <= igh; i++) {
      fr = 0.0;
      fi = 0.0;
      for (jj = m; jj <= igh; jj++) {
        j = mp - jj;
        fr = fr + ortr[(j)-1] * ar[(i)-1 + ((j)-1) * (nm)] - orti[(j)-1] * ai[(i)-1 + ((j)-1) * (nm)];
        fi = fi + ortr[(j)-1] * ai[(i)-1 + ((j)-1) * (nm)] + orti[(j)-1] * ar[(i)-1 + ((j)-1) * (nm)];
      }
      fr /= h;
      fi /= h;
      for (j = m; j <= igh; j++) {
        ar[(i)-1 + ((j)-1) * (nm)] = ar[(i)-1 + ((j)-1) * (nm)] - fr * ortr[(j)-1] - fi * orti[(j)-1];
        ai[(i)-1 + ((j)-1) * (nm)] = ai[(i)-1 + ((j)-1) * (nm)] + fr * orti[(j)-1] - fi * ortr[(j)-1];
      }
    }
    ortr[(m)-1] = scale * ortr[(m)-1];
    orti[(m)-1] = scale * orti[(m)-1];
    ar[(m)-1 + ((m - 1) - 1) * (nm)] = -g * ar[(m)-1 + ((m - 1) - 1) * (nm)];
    ai[(m)-1 + ((m - 1) - 1) * (nm)] = -g * ai[(m)-1 + ((m - 1) - 1) * (nm)];
  }
}
```