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

```asm
<ludcmp>:
  endbr64
  push   %r15
  xor    %eax,%eax
  mov    %rcx,%r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  mov    %rdi,%rbx
  movslq %esi,%rdi
  lea    D8(%rip),%rsi
  mov    %rdi,%rbp
  shl    $0x3,%rdi
  sub    $0x38,%rsp
  mov    %rdx,0x20(%rsp)
  lea    D15(%rip),%rdx
  mov    %rcx,0x28(%rsp)
  call   <mem_alloc@plt>
  movsd  D59(%rip),%xmm5
  cltq
  mov    %rax,0x8(%rsp)
  movsd  %xmm5,(%r15)
  test   %ebp,%ebp
  jle    L154
  mov    0x8(%rsp),%rax
  mov    %ebp,%r15d
  mov    %rbx,%rdi
  movq   D21(%rip),%xmm2
  lea    0x0(,%r15,8),%rsi
  movsd  D68(%rip),%xmm4
  lea    (%rax,%rsi,1),%r8
  mov    %rax,%rcx
  sub    %rax,%rdi
  nopw   0x0(%rax,%rax,1)
L48:
  mov    (%rdi,%rcx,1),%rax
  movapd %xmm4,%xmm1
  lea    (%rax,%rsi,1),%rdx
  nopl   0x0(%rax)
L75:
  movsd  (%rax),%xmm0
  add    $0x8,%rax
  andpd  %xmm2,%xmm0
  maxsd  %xmm1,%xmm0
  movapd %xmm0,%xmm1
  cmp    %rax,%rdx
  jne    L75
  ucomisd %xmm4,%xmm0
  jp     L39
  je     L222
L39:
  movapd %xmm5,%xmm0
  add    $0x8,%rcx
  divsd  %xmm1,%xmm0
  movsd  %xmm0,-0x8(%rcx)
  cmp    %rcx,%r8
  jne    L48
  lea    -0x1(%rbp),%eax
  movq   D23(%rip),%xmm6
  xor    %r14d,%r14d
  xor    %r11d,%r11d
  mov    %eax,0x1c(%rsp)
L68:
  lea    0x0(,%r14,8),%rdx
  test   %r11d,%r11d
  je     L90
  mov    (%rbx),%r10
  xor    %r8d,%r8d
  mov    $0x8,%esi
  add    $0x1,%r8d
  lea    (%r10,%rdx,1),%r9
  movsd  (%r9),%xmm1
  movsd  %xmm1,(%r9)
  cmp    %r11d,%r8d
  je     L90
  nop
L101:
  mov    (%rbx,%rsi,1),%rcx
  mov    %r10,%rdi
  xor    %eax,%eax
  lea    (%rcx,%rdx,1),%r9
  movsd  (%r9),%xmm1
  jmp    L123
  nopl   0x0(%rax)
L165:
  mov    (%rbx,%rax,1),%rdi
L123:
  movsd  (%rdi,%rdx,1),%xmm0
  mulsd  (%rcx,%rax,1),%xmm0
  add    $0x8,%rax
  subsd  %xmm0,%xmm1
  cmp    %rax,%rsi
  jne    L165
  add    $0x1,%r8d
  add    $0x8,%rsi
  movsd  %xmm1,(%r9)
  cmp    %r11d,%r8d
  jne    L101
L90:
  mov    0x8(%rsp),%rax
  mov    %r14,%r8
  movapd %xmm4,%xmm3
  lea    -0x1(%r14),%edi
  add    %rdx,%rax
  mov    %rax,0x10(%rsp)
  mov    %rax,%r9
L26:
  mov    (%rbx,%r8,8),%rsi
  mov    %r8d,%r13d
  lea    (%rsi,%rdx,1),%r10
  movsd  (%r10),%xmm1
  test   %r11d,%r11d
  je     L64
  xor    %eax,%eax
  nopw   0x0(%rax,%rax,1)
L121:
  mov    (%rbx,%rax,8),%rcx
  movsd  (%rcx,%rdx,1),%xmm0
  mulsd  (%rsi,%rax,8),%xmm0
  mov    %rax,%rcx
  add    $0x1,%rax
  subsd  %xmm0,%xmm1
  cmp    %rcx,%rdi
  jne    L121
L64:
  movsd  %xmm1,(%r10)
  andpd  %xmm2,%xmm1
  mulsd  (%r9),%xmm1
  comisd %xmm3,%xmm1
  jb     L79
  movapd %xmm1,%xmm3
  mov    %r13d,%r12d
L79:
  add    $0x1,%r8
  add    $0x8,%r9
  cmp    %r8d,%ebp
  jg     L26
  mov    (%rbx,%r14,8),%rcx
  cmp    %r11d,%r12d
  jne    L201
L131:
  add    %rdx,%rcx
  mov    0x20(%rsp),%rax
  movsd  (%rcx),%xmm0
  mov    %r12d,(%rax,%r14,4)
  andpd  %xmm2,%xmm0
  comisd %xmm0,%xmm4
  jbe    L175
  movsd  %xmm4,(%rcx)
L175:
  add    $0x1,%r11d
  cmp    %r14d,0x1c(%rsp)
  jg     L129
  cmp    %r11d,%ebp
  jle    L154
  add    $0x1,%r14
  jmp    L68
L201:
  movslq %r12d,%rdi
  xor    %eax,%eax
  mov    (%rbx,%rdi,8),%rsi
  nopl   0x0(%rax,%rax,1)
L128:
  movsd  (%rsi,%rax,8),%xmm0
  movsd  (%rcx,%rax,8),%xmm1
  movsd  %xmm1,(%rsi,%rax,8)
  movsd  %xmm0,(%rcx,%rax,8)
  add    $0x1,%rax
  cmp    %rax,%r15
  jne    L128
  mov    0x28(%rsp),%rax
  movsd  (%rax),%xmm0
  xorpd  %xmm6,%xmm0
  movsd  %xmm0,(%rax)
  mov    0x10(%rsp),%rax
  movsd  (%rax),%xmm0
  mov    0x8(%rsp),%rax
  movsd  %xmm0,(%rax,%rdi,8)
  jmp    L131
L129:
  movapd %xmm5,%xmm1
  divsd  (%rcx),%xmm1
  cmp    %r11d,%ebp
  jle    L154
  add    $0x1,%r14
  mov    %r14,%rax
  nopw   0x0(%rax,%rax,1)
L124:
  mov    (%rbx,%rax,8),%rcx
  add    $0x1,%rax
  add    %rdx,%rcx
  movsd  (%rcx),%xmm0
  mulsd  %xmm1,%xmm0
  movsd  %xmm0,(%rcx)
  cmp    %eax,%ebp
  jg     L124
  jmp    L68
L154:
  mov    0x8(%rsp),%rdi
  add    $0x38,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  jmp    1080 <free@plt>
L222:
  lea    D16(%rip),%rdi
  call   <puts@plt>
  mov    $0x1,%edi
  call   <exit@plt>
```

tool_calls: name: parse_data
arguments: tag: D8
data_type: string
name: parse_data
arguments: tag: D15
data_type: string
name: parse_data
arguments: tag: D59
data_type: f64
name: parse_data
arguments: tag: D21
data_type: qword
name: parse_data
arguments: tag: D68
data_type: byte[8]
name: parse_data
arguments: tag: D23
data_type: byte[8]
name: parse_data
arguments: tag: D16
data_type: string

tool: D8: ludcmp(): 

tool: D15: vv[]

tool: D59: 1

tool: D21: 9223372036854775807

tool: {"D68": [0xbb,0xbd,0xd7,0xd9,0xdf,0x7c,0xdb,0x3d]}

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

tool: D16: 

Singular matrix in routine ludcmp()

assistant: ```c
void ludcmp(double **a, int n, int *indx, double *d) {
  char *func = {"ludcmp(): "};
  int i, imax, j, k;
  double big, dum, sum, temp, *vv;
  vv = (double *)mem_alloc((n) * sizeof(double), func, "vv[]");
  *d = 1.0;
  for (i = 0; i < n; i++) {
    big = 1.0E-10;
    for (j = 0; j < n; j++) {
      if ((temp = fabs(a[i][j])) > big)
        big = temp;
    }
    if (big == 1.0E-10) {
      printf("\n\nSingular matrix in routine ludcmp()\n");
      exit(1);
    }
    vv[i] = 1.0 / big;
  }
  for (j = 0; j < n; j++) {
    for (i = 0; i < j; i++) {
      sum = a[i][j];
      for (k = 0; k < i; k++)
        sum -= a[i][k] * a[k][j];
      a[i][j] = sum;
    }
    big = 1.0E-10;
    for (i = j; i < n; i++) {
      sum = a[i][j];
      for (k = 0; k < j; k++)
        sum -= a[i][k] * a[k][j];
      a[i][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][k];
        a[imax][k] = a[j][k];
        a[j][k] = dum;
      }
      (*d) *= -1;
      vv[imax] = vv[j];
    }
    indx[j] = imax;
    if (fabs(a[j][j]) < 1.0E-10)
      a[j][j] = 1.0E-10;
    if (j < (n - 1)) {
      dum = 1.0 / a[j][j];
      for (i = j + 1; i < n; i++)
        a[i][j] *= dum;
    }
  }
  free(vv);
}
```