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

```asm
<ludcmp>:
  endbr64
  push   %r15
  push   %r14
  mov    %rcx,%r14
  push   %r13
  push   %r12
  push   %rbp
  mov    %esi,%ebp
  push   %rbx
  mov    %rdi,%rbx
  mov    %esi,%edi
  sub    $0x28,%rsp
  mov    %rdx,0x10(%rsp)
  mov    %rcx,0x18(%rsp)
  call   <dvector@plt>
  movsd  D48(%rip),%xmm5
  mov    %rax,%r12
  movsd  %xmm5,(%r14)
  test   %ebp,%ebp
  jle    L147
  movq   D56(%rip),%xmm2
  mov    %ebp,%r13d
  xor    %r15d,%r15d
  pxor   %xmm4,%xmm4
  lea    D55(%rip),%r14
  nopl   0x0(%rax)
L191:
  mov    (%rbx,%r15,8),%rax
  movapd %xmm4,%xmm1
  lea    (%rax,%r13,8),%rdx
  nopl   0x0(%rax)
L110:
  movsd  (%rax),%xmm0
  add    $0x8,%rax
  andpd  %xmm2,%xmm0
  maxsd  %xmm1,%xmm0
  movapd %xmm0,%xmm1
  cmp    %rax,%rdx
  jne    L110
  ucomisd %xmm4,%xmm0
  jp     L166
  je     L148
L166:
  movapd %xmm5,%xmm0
  divsd  %xmm1,%xmm0
  movsd  %xmm0,(%r12,%r15,8)
  add    $0x1,%r15
  cmp    %r15,%r13
  jne    L191
  lea    -0x1(%rbp),%eax
  movl   $0xffffffff,(%rsp)
  xor    %r11d,%r11d
  xor    %r10d,%r10d
  mov    %eax,0xc(%rsp)
  movq   D6(%rip),%xmm7
  xor    %r14d,%r14d
  movsd  D43(%rip),%xmm6
  nopl   0x0(%rax,%rax,1)
L98:
  lea    0x0(,%r11,8),%rdx
  test   %r10d,%r10d
  je     L42
  mov    (%rbx),%r15
  xor    %r8d,%r8d
  mov    $0x8,%esi
  add    $0x1,%r8d
  lea    (%r15,%rdx,1),%r9
  movsd  (%r9),%xmm1
  movsd  %xmm1,(%r9)
  cmp    %r10d,%r8d
  je     L42
  nopw   0x0(%rax,%rax,1)
L144:
  mov    (%rbx,%rsi,1),%rdi
  mov    %r15,%rcx
  xor    %eax,%eax
  lea    (%rdi,%rdx,1),%r9
  movsd  (%r9),%xmm1
  jmp    L48
  nopl   0x0(%rax)
L142:
  mov    (%rbx,%rax,1),%rcx
L48:
  movsd  (%rcx,%rdx,1),%xmm0
  mulsd  (%rdi,%rax,1),%xmm0
  add    $0x8,%rax
  subsd  %xmm0,%xmm1
  cmp    %rax,%rsi
  jne    L142
  add    $0x1,%r8d
  add    $0x8,%rsi
  movsd  %xmm1,(%r9)
  cmp    %r10d,%r8d
  jne    L144
L42:
  mov    (%rsp),%edi
  mov    %r11,%r8
  movapd %xmm4,%xmm3
  nop
L222:
  mov    (%rbx,%r8,8),%rsi
  mov    %r8d,%r15d
  lea    (%rsi,%rdx,1),%r9
  movsd  (%r9),%xmm1
  test   %r10d,%r10d
  je     L174
  xor    %eax,%eax
  nopw   0x0(%rax,%rax,1)
L199:
  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    L199
L174:
  movsd  %xmm1,(%r9)
  andpd  %xmm2,%xmm1
  mulsd  (%r12,%r8,8),%xmm1
  comisd %xmm3,%xmm1
  jb     L171
  movapd %xmm1,%xmm3
  mov    %r15d,%r14d
L171:
  add    $0x1,%r8
  cmp    %r8d,%ebp
  jg     L222
  mov    (%rbx,%r11,8),%rcx
  cmp    %r10d,%r14d
  jne    L214
L28:
  add    %rdx,%rcx
  mov    0x10(%rsp),%rax
  ucomisd (%rcx),%xmm4
  mov    %r14d,(%rax,%r11,4)
  jp     L237
  jne    L237
  movsd  %xmm6,(%rcx)
L237:
  add    $0x1,%r10d
  cmp    %r11d,0xc(%rsp)
  je     L3
  movapd %xmm5,%xmm1
  divsd  (%rcx),%xmm1
  cmp    %r10d,%ebp
  jle    L147
  add    $0x1,%r11
  mov    %r11,%rax
  nopw   0x0(%rax,%rax,1)
L234:
  mov    (%rbx,%rax,8),%rcx
  add    $0x1,%rax
  add    %rdx,%rcx
  movsd  (%rcx),%xmm0
  mulsd  %xmm1,%xmm0
  movsd  %xmm0,(%rcx)
  cmp    %eax,%ebp
  jg     L234
  addl   $0x1,(%rsp)
  jmp    L98
L3:
  cmp    %r10d,%ebp
  jle    L147
  addl   $0x1,(%rsp)
  add    $0x1,%r11
  jmp    L98
L214:
  movslq %r14d,%rdi
  xor    %eax,%eax
  mov    (%rbx,%rdi,8),%rsi
  nopl   0x0(%rax,%rax,1)
L47:
  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,%r13
  jne    L47
  mov    0x18(%rsp),%rax
  movsd  (%rax),%xmm0
  xorpd  %xmm7,%xmm0
  movsd  %xmm0,(%rax)
  movsd  (%r12,%r11,8),%xmm0
  movsd  %xmm0,(%r12,%rdi,8)
  jmp    L28
L148:
  mov    %r14,%rdi
  movsd  %xmm0,(%rsp)
  call   <error@plt>
  mov    D48(%rip),%rax
  movsd  (%rsp),%xmm1
  pxor   %xmm4,%xmm4
  movq   D56(%rip),%xmm2
  movq   %rax,%xmm5
  jmp    L166
L147:
  add    $0x28,%rsp
  mov    %r12,%rdi
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  jmp    1070 <free@plt>
```

tool_calls: name: disassemble_data
arguments: tag: D48
type: f64
name: disassemble_data
arguments: tag: D56
type: qword
name: disassemble_data
arguments: tag: D55
type: string
name: disassemble_data
arguments: tag: D6
type: f32[2]
name: disassemble_data
arguments: tag: D43
type: byte[8]

tool: D48: 1

tool: D56: 9223372036854775807

tool: D55: Singular matrix in routine ludcmp

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

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

assistant: ```c
void ludcmp(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][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][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];
    }
    indx[j] = imax;
    if (a[j][j] == 0.0)
      a[j][j] = 1.0e-20;
    if (j != n - 1) {
      dum = 1.0 / (a[j][j]);
      for (i = j + 1; i < n; i++)
        a[i][j] *= dum;
    }
  }
  free(vv);
}
```