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

```asm
<ludcmp>:
  endbr64
  push   %r15
  mov    %rdx,%r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  mov    %esi,%ebp
  mov    $0x8,%esi
  push   %rbx
  mov    %rdi,%rbx
  mov    %ebp,%edi
  sub    $0x48,%rsp
  mov    %rdx,0x20(%rsp)
  call   <mCalloc@plt>
  movsd  D54(%rip),%xmm5
  mov    %rax,0x8(%rsp)
  movsd  %xmm5,(%r15)
  test   %ebp,%ebp
  jle    L219
  mov    %rax,%r13
  lea    -0x1(%rbp),%eax
  movq   D66(%rip),%xmm2
  pxor   %xmm4,%xmm4
  mov    %eax,0x30(%rsp)
  lea    D8(%rip),%r12
  mov    %rax,0x18(%rsp)
  mov    %ebp,%eax
  mov    %rax,0x38(%rsp)
  lea    0x0(,%rax,8),%r14
  lea    0x0(%r13,%r14,1),%r15
  nopl   0x0(%rax,%rax,1)
L68:
  mov    %rbx,%rax
  sub    0x8(%rsp),%rax
  movapd %xmm4,%xmm1
  mov    (%rax,%r13,1),%rax
  lea    (%rax,%r14,1),%rdx
  nopl   0x0(%rax)
L264:
  movsd  (%rax),%xmm0
  add    $0x8,%rax
  andpd  %xmm2,%xmm0
  maxsd  %xmm1,%xmm0
  movapd %xmm0,%xmm1
  cmp    %rdx,%rax
  jne    L264
  ucomisd %xmm4,%xmm0
  jp     L17
  je     L3
L17:
  movapd %xmm5,%xmm0
  add    $0x8,%r13
  divsd  %xmm1,%xmm0
  movsd  %xmm0,-0x8(%r13)
  cmp    %r15,%r13
  jne    L68
L77:
  mov    %ebp,%eax
  movsd  D22(%rip),%xmm7
  xor    %edx,%edx
  xor    %r11d,%r11d
  shr    %eax
  movsd  D32(%rip),%xmm6
  xor    %r14d,%r14d
  movq   D46(%rip),%xmm8
  sub    $0x1,%eax
  add    $0x1,%rax
  shl    $0x4,%rax
  mov    %rax,0x28(%rsp)
  mov    %ebp,%eax
  and    $0xfffffffe,%eax
  mov    %eax,0x34(%rsp)
  lea    0x0(,%rax,8),%r15
  nopw   0x0(%rax,%rax,1)
L151:
  mov    %r11d,%r13d
  test   %r11,%r11
  je     L287
  mov    $0x8,%esi
  mov    $0x1,%r8d
  cmp    $0x1,%r11d
  je     L287
  nopl   0x0(%rax)
L66:
  mov    (%rbx,%rsi,1),%rdi
  xor    %eax,%eax
  lea    (%rdi,%rdx,1),%r9
  movsd  (%r9),%xmm1
  nop
L137:
  mov    (%rbx,%rax,1),%rcx
  movsd  (%rcx,%rdx,1),%xmm0
  mulsd  (%rdi,%rax,1),%xmm0
  add    $0x8,%rax
  subsd  %xmm0,%xmm1
  cmp    %rax,%rsi
  jne    L137
  add    $0x1,%r8d
  movsd  %xmm1,(%r9)
  add    $0x8,%rsi
  cmp    %r8d,%r13d
  jne    L66
L287:
  mov    0x8(%rsp),%rax
  mov    %r11,%r8
  movapd %xmm4,%xmm3
  lea    -0x1(%r11),%edi
  add    %rdx,%rax
  mov    %rax,0x10(%rsp)
  mov    %rax,%r9
  nopl   0x0(%rax,%rax,1)
L45:
  mov    (%rbx,%r8,8),%rsi
  mov    %r8d,%r12d
  lea    (%rsi,%rdx,1),%r10
  movsd  (%r10),%xmm1
  test   %r11,%r11
  je     L112
  xor    %eax,%eax
  nopw   0x0(%rax,%rax,1)
L84:
  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    %rdi,%rcx
  jne    L84
L112:
  movsd  %xmm1,(%r10)
  andpd  %xmm2,%xmm1
  mulsd  (%r9),%xmm1
  comisd %xmm3,%xmm1
  jb     L257
  movapd %xmm1,%xmm3
  mov    %r12d,%r14d
L257:
  add    $0x1,%r8
  add    $0x8,%r9
  cmp    %r8d,%ebp
  jg     L45
  mov    (%rbx,%rdx,1),%rsi
  cmp    %r13d,%r14d
  jne    L114
L241:
  add    %rdx,%rsi
  movsd  (%rsi),%xmm0
  ucomisd %xmm4,%xmm0
  jp     L33
  je     L71
L33:
  movapd %xmm5,%xmm1
  divsd  %xmm0,%xmm1
  cmp    0x18(%rsp),%r11
  je     L219
L28:
  add    $0x1,%r11
  mov    %r11,%rax
  nopl   0x0(%rax)
L90:
  mov    (%rbx,%rax,8),%rcx
  add    $0x1,%rax
  add    %rdx,%rcx
  movsd  (%rcx),%xmm0
  mulsd  %xmm1,%xmm0
  movsd  %xmm0,(%rcx)
  cmp    %eax,%ebp
  jg     L90
  add    $0x8,%rdx
  jmp    L151
L71:
  movsd  %xmm7,(%rsi)
  movapd %xmm6,%xmm1
  cmp    0x18(%rsp),%r11
  jne    L28
L219:
  mov    0x8(%rsp),%rdi
  call   <free@plt>
  add    $0x48,%rsp
  xor    %eax,%eax
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
L114:
  movslq %r14d,%rdi
  mov    (%rbx,%rdi,8),%rcx
  lea    0xf(%rcx),%rax
  sub    %rsi,%rax
  cmp    $0x1e,%rax
  mov    $0x0,%eax
  jbe    L220
  cmpl   $0x1,0x30(%rsp)
  jbe    L220
  mov    0x28(%rsp),%r8
  nopl   0x0(%rax,%rax,1)
L63:
  movupd (%rcx,%rax,1),%xmm0
  movupd (%rsi,%rax,1),%xmm3
  movups %xmm3,(%rcx,%rax,1)
  movups %xmm0,(%rsi,%rax,1)
  add    $0x10,%rax
  cmp    %rax,%r8
  jne    L63
  cmp    0x34(%rsp),%ebp
  je     L9
  add    %r15,%rcx
  lea    (%rsi,%r15,1),%rax
  movsd  (%rcx),%xmm0
  movsd  (%rax),%xmm1
  movsd  %xmm1,(%rcx)
  movsd  %xmm0,(%rax)
L9:
  mov    0x20(%rsp),%rax
  movsd  (%rax),%xmm0
  xorpd  %xmm8,%xmm0
  movsd  %xmm0,(%rax)
  mov    0x10(%rsp),%rax
  movsd  (%rax),%xmm0
  mov    0x8(%rsp),%rax
  movsd  %xmm0,(%rax,%rdi,8)
  jmp    L241
L3:
  mov    %r12,%rdi
  movsd  %xmm0,0x10(%rsp)
  add    $0x8,%r13
  call   <Exit@plt>
  mov    D54(%rip),%rax
  movsd  0x10(%rsp),%xmm1
  pxor   %xmm4,%xmm4
  movq   D66(%rip),%xmm2
  movq   %rax,%xmm0
  movq   %rax,%xmm5
  divsd  %xmm1,%xmm0
  movsd  %xmm0,-0x8(%r13)
  cmp    %r15,%r13
  jne    L68
  jmp    L77
L220:
  mov    0x38(%rsp),%r8
L129:
  movsd  (%rcx,%rax,8),%xmm0
  movsd  (%rsi,%rax,8),%xmm1
  movsd  %xmm1,(%rcx,%rax,8)
  movsd  %xmm0,(%rsi,%rax,8)
  add    $0x1,%rax
  cmp    %r8,%rax
  jne    L129
  jmp    L9
```

tool_calls: name: parse_data
arguments: data_tag: D54
type_guessed: f64
name: parse_data
arguments: data_tag: D66
type_guessed: qword
name: parse_data
arguments: data_tag: D8
type_guessed: string
name: parse_data
arguments: data_tag: D22
type_guessed: byte[8]
name: parse_data
arguments: data_tag: D32
type_guessed: byte[8]
name: parse_data
arguments: data_tag: D46
type_guessed: f32[2]

tool: D54: 1

tool: D66: 9223372036854775807

tool: D8: Singular matrix in routine LUDCMP.

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

tool: {"D32": [0x40,0x8c,0xb5,0x78,0x1d,0xaf,0x15,0x44]}

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

assistant: ```c
int ludcmp(double **a, int n, double *d) {
  int i, imax, j, k;
  double big, dum, sum, temp;
  double *vv;
  imax = 0;
  vv = (double *)mCalloc(n, sizeof(double));
  *d = 1.0;
  for (i = 0; i < n; i++) {
    big = 0.0;
    for (j = 0; j < n; j++)
      if ((temp = fabs(a[i][j])) > big)
        big = temp;
    if (big == 0.0)
      Exit((char *)"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][j];
      for (k = 0; k < i; k++)
        sum -= a[i][k] * a[k][j];
      a[i][j] = sum;
    }
    big = 0.0;
    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 = -(*d);
      vv[imax] = vv[j];
    }
    if (a[j][j] == 0.0)
      a[j][j] = 1.0e-20;
    ;
    if (j != n) {
      dum = 1.0 / (a[j][j]);
      for (i = j + 1; i < n; i++)
        a[i][j] *= dum;
    }
  }
  free(vv);
  return (0);
}
```