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

```asm
<ludcmp2>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  mov    %esi,%ebp
  push   %rbx
  mov    %rcx,%rbx
  sub    $0x78,%rsp
  mov    %rdi,0x8(%rsp)
  mov    %esi,%edi
  mov    %rdx,0x30(%rsp)
  mov    %rcx,0x50(%rsp)
  call   <dvector@plt>
  movsd  D8(%rip),%xmm5
  mov    %rax,%r12
  movsd  %xmm5,(%rbx)
  test   %ebp,%ebp
  jle    L266
  mov    0x8(%rsp),%rdi
  mov    %rax,%r15
  movslq %ebp,%rax
  mov    $0xfffffffffffffff8,%rdx
  mov    %rax,0x48(%rsp)
  lea    0x0(,%rax,8),%rbx
  lea    -0x1(%rbp),%eax
  pxor   %xmm4,%xmm4
  add    $0x8,%rdi
  mov    %eax,0x60(%rsp)
  movq   D23(%rip),%xmm2
  mov    %rdi,0x28(%rsp)
  mov    %rax,0x68(%rsp)
  shl    $0x3,%rax
  lea    (%rdi,%rax,1),%r14
  lea    0x8(%r12,%rax,1),%r13
  sub    %rax,%rdx
  nopl   0x0(%rax)
L239:
  lea    (%rdx,%r14,1),%rax
  movapd %xmm4,%xmm1
L156:
  movsd  (%rax),%xmm0
  add    $0x8,%rax
  andpd  %xmm2,%xmm0
  maxsd  %xmm1,%xmm0
  movapd %xmm0,%xmm1
  cmp    %r14,%rax
  jne    L156
  ucomisd %xmm4,%xmm0
  jp     L90
  je     L175
L90:
  movapd %xmm5,%xmm0
  add    $0x8,%r15
  add    %rbx,%r14
  divsd  %xmm1,%xmm0
  movsd  %xmm0,-0x8(%r15)
  cmp    %r13,%r15
  jne    L239
L8:
  mov    0x8(%rsp),%rdi
  lea    0x8(%rbx),%r13
  xor    %r8d,%r8d
  xor    %r15d,%r15d
  movq   $0x0,0x20(%rsp)
  movq   D56(%rip),%xmm7
  xor    %r9d,%r9d
  lea    (%rdi,%rbx,1),%rax
  mov    %rdi,0x18(%rsp)
  mov    %rdi,%r10
  movsd  D65(%rip),%xmm6
  mov    %rax,0x38(%rsp)
  mov    0x28(%rsp),%rax
  movl   $0x0,0x10(%rsp)
  add    %rbx,%rax
  mov    %rax,0x40(%rsp)
  mov    %ebp,%eax
  shr    %eax
  sub    $0x1,%eax
  add    $0x1,%rax
  shl    $0x4,%rax
  mov    %rax,0x58(%rsp)
  mov    %ebp,%eax
  and    $0xfffffffe,%eax
  mov    %eax,0x64(%rsp)
  nopl   (%rax)
L133:
  mov    0x28(%rsp),%rdi
  lea    -0x1(%r9),%eax
  mov    %r8,%rsi
  movapd %xmm4,%xmm3
  mov    0x8(%rsp),%r14
  add    0x20(%rsp),%rax
  lea    (%rdi,%rax,8),%rcx
  mov    0x18(%rsp),%rdi
  sub    %r10,%r14
  cs nopw 0x0(%rax,%rax,1)
L247:
  movsd  (%rdi),%xmm1
  mov    %esi,%r11d
  test   %r9d,%r9d
  je     L13
  lea    (%r14,%rdi,1),%rax
  mov    %r10,%rdx
  nopl   0x0(%rax,%rax,1)
L277:
  movsd  (%rax),%xmm0
  mulsd  (%rdx),%xmm0
  add    $0x8,%rax
  add    %rbx,%rdx
  subsd  %xmm0,%xmm1
  cmp    %rax,%rcx
  jne    L277
L13:
  movsd  %xmm1,(%rdi)
  andpd  %xmm2,%xmm1
  mulsd  (%r12,%rsi,8),%xmm1
  comisd %xmm3,%xmm1
  jb     L78
  movapd %xmm1,%xmm3
  mov    %r11d,%r15d
L78:
  add    $0x1,%rsi
  add    %rbx,%rdi
  add    %rbx,%rcx
  cmp    %esi,%ebp
  jg     L247
  cmp    %r9d,%r15d
  jne    L89
L45:
  mov    0x30(%rsp),%rax
  mov    %r15d,(%rax,%r8,4)
  mov    0x18(%rsp),%rax
  movsd  (%rax),%xmm0
  ucomisd %xmm4,%xmm0
  jp     L57
  jne    L57
  movsd  %xmm6,(%rax)
  movapd %xmm6,%xmm0
L57:
  lea    0x1(%r9),%r11d
  cmp    %r8d,0x60(%rsp)
  je     L101
  movapd %xmm5,%xmm1
  divsd  %xmm0,%xmm1
  cmp    %r11d,%ebp
  jle    L266
  mov    0x10(%rsp),%ecx
  mov    0x8(%rsp),%rdi
  mov    %r11d,%edx
  add    %ebp,%ecx
  movslq %ecx,%rax
  add    %r8,%rax
  lea    (%rdi,%rax,8),%rax
  nopl   0x0(%rax)
L291:
  movsd  (%rax),%xmm0
  add    $0x1,%edx
  mulsd  %xmm1,%xmm0
  movsd  %xmm0,(%rax)
  add    %rbx,%rax
  cmp    %edx,%ebp
  jne    L291
L132:
  mov    0x48(%rsp),%rdi
  mov    %ecx,0x10(%rsp)
  add    $0x1,%r8
  add    $0x8,%r10
  add    %rdi,0x20(%rsp)
  mov    0x40(%rsp),%rcx
  mov    $0x1,%edi
  add    %r13,0x18(%rsp)
  mov    0x38(%rsp),%rsi
  cmp    $0x1,%r11d
  je     L123
  cs nopw 0x0(%rax,%rax,1)
L250:
  movsd  (%rsi,%r8,8),%xmm1
  mov    %r10,%rdx
  mov    %rsi,%rax
  nopl   0x0(%rax)
L76:
  movsd  (%rax),%xmm0
  mulsd  (%rdx),%xmm0
  add    $0x8,%rax
  add    %rbx,%rdx
  subsd  %xmm0,%xmm1
  cmp    %rcx,%rax
  jne    L76
  movsd  %xmm1,(%rsi,%r8,8)
  lea    0x1(%rdi),%eax
  add    %rbx,%rsi
  add    %r13,%rcx
  cmp    %r9d,%edi
  je     L123
  mov    %eax,%edi
  jmp    L250
L123:
  mov    %r11d,%r9d
  jmp    L133
L101:
  cmp    %r11d,%ebp
  jle    L266
  mov    0x10(%rsp),%eax
  lea    (%rax,%rbp,1),%ecx
  jmp    L132
L89:
  mov    %r15d,%eax
  mov    0x20(%rsp),%rcx
  imul   %ebp,%eax
  lea    0x0(,%rcx,8),%rdx
  lea    0x10(%rdx),%r11
  movslq %eax,%rsi
  lea    0x0(,%rsi,8),%rcx
  lea    0x10(,%rsi,8),%rdi
  cmp    %r11,%rcx
  setge  %r11b
  cmp    %rdx,%rdi
  setle  %dil
  or     %r11b,%dil
  je     L82
  cmpl   $0x1,0x60(%rsp)
  jbe    L82
  mov    0x8(%rsp),%rdi
  xor    %esi,%esi
  add    %rdi,%rcx
  add    %rdi,%rdx
  mov    0x58(%rsp),%rdi
  nopl   0x0(%rax,%rax,1)
L254:
  movupd (%rcx,%rsi,1),%xmm0
  movupd (%rdx,%rsi,1),%xmm3
  movups %xmm3,(%rcx,%rsi,1)
  movups %xmm0,(%rdx,%rsi,1)
  add    $0x10,%rsi
  cmp    %rsi,%rdi
  jne    L254
  mov    0x64(%rsp),%edi
  cmp    %ebp,%edi
  je     L86
  mov    0x8(%rsp),%rsi
  add    %edi,%eax
  cltq
  lea    (%rsi,%rax,8),%rdx
  mov    0x10(%rsp),%eax
  movsd  (%rdx),%xmm0
  add    %edi,%eax
  cltq
  lea    (%rsi,%rax,8),%rax
  movsd  (%rax),%xmm1
  movsd  %xmm1,(%rdx)
  movsd  %xmm0,(%rax)
L86:
  mov    0x50(%rsp),%rax
  movsd  (%rax),%xmm0
  xorpd  %xmm7,%xmm0
  movsd  %xmm0,(%rax)
  movsd  (%r12,%r8,8),%xmm0
  movslq %r15d,%rax
  movsd  %xmm0,(%r12,%rax,8)
  jmp    L45
L175:
  lea    D64(%rip),%rdi
  mov    %rdx,0x18(%rsp)
  add    $0x8,%r15
  add    %rbx,%r14
  movsd  %xmm0,0x10(%rsp)
  call   <error@plt>
  mov    D8(%rip),%rax
  movsd  0x10(%rsp),%xmm1
  pxor   %xmm4,%xmm4
  movq   D23(%rip),%xmm2
  mov    0x18(%rsp),%rdx
  movq   %rax,%xmm0
  movq   %rax,%xmm5
  divsd  %xmm1,%xmm0
  movsd  %xmm0,-0x8(%r15)
  cmp    %r13,%r15
  jne    L239
  jmp    L8
L266:
  add    $0x78,%rsp
  mov    %r12,%rdi
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  jmp    1070 <free@plt>
L82:
  mov    0x68(%rsp),%rdi
  mov    0x8(%rsp),%rax
  lea    (%rsi,%rdi,1),%rdx
  mov    0x28(%rsp),%rdi
  lea    (%rax,%rsi,8),%rax
  lea    (%rdi,%rdx,8),%rcx
  mov    0x20(%rsp),%rdx
  sub    %rsi,%rdx
L286:
  movsd  (%rax),%xmm0
  movsd  (%rax,%rdx,8),%xmm1
  movsd  %xmm1,(%rax)
  movsd  %xmm0,(%rax,%rdx,8)
  add    $0x8,%rax
  cmp    %rax,%rcx
  jne    L286
  jmp    L86
```

tool_calls: name: retrieve_data
arguments: data_label: D8
type_guessed: f64
name: retrieve_data
arguments: data_label: D23
type_guessed: qword
name: retrieve_data
arguments: data_label: D56
type_guessed: f32[2]
name: retrieve_data
arguments: data_label: D65
type_guessed: byte[8]
name: retrieve_data
arguments: data_label: D64
type_guessed: string

tool: D8: 1

tool: D23: 9223372036854775807

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

tool: {"D65": [0x23,0x42,0x92,0x0c,0xa1,0x9c,0xc7,0x3b]}

tool: D64: Singular matrix in routine ludcmp

assistant: ```c
void ludcmp2(double *a, int n, int *indx, double *d) {
  int i, imax, j, k;
  double big, dum, sum, temp;
  double *vv;
  imax = 0;
  vv = dvector(n);
  *d = 1.0;
  for (i = 0; i < n; i++) {
    big = 0.0;
    for (j = 0; j < n; j++)
      if ((temp = fabs(a[i * n + j])) > big)
        big = temp;
    if (big == 0.0)
      error("Singular matrix in routine ludcmp");
    vv[i] = 1.0 / big;
  }
  for (j = 0; j < n; j++) {
    for (i = 0; i < j; i++) {
      sum = a[i * n + j];
      for (k = 0; k < i; k++)
        sum -= a[i * n + k] * a[k * n + j];
      a[i * n + j] = sum;
    }
    big = 0.0;
    for (i = j; i < n; i++) {
      sum = a[i * n + j];
      for (k = 0; k < j; k++)
        sum -= a[i * n + k] * a[k * n + j];
      a[i * n + j] = sum;
      if ((dum = vv[i] * fabs(sum)) >= big) {
        big = dum;
        imax = i;
      }
    }
    if (j != imax) {
      for (k = 0; k < n; k++) {
        dum = a[imax * n + k];
        a[imax * n + k] = a[j * n + k];
        a[j * n + k] = dum;
      }
      *d = -(*d);
      vv[imax] = vv[j];
    }
    indx[j] = imax;
    if (a[j * n + j] == 0.0)
      a[j * n + j] = 1.0e-20;
    if (j != n - 1) {
      dum = 1.0 / (a[j * n + j]);
      for (i = j + 1; i < n; i++)
        a[i * n + j] *= dum;
    }
  }
  free(vv);
}
```