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

```asm
<ludcmp>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x60,%rsp
  mov    %rdi,-0x48(%rbp)
  mov    %esi,-0x4c(%rbp)
  mov    %rdx,-0x58(%rbp)
  mov    %rcx,-0x60(%rbp)
  lea    D96(%rip),%rax
  mov    %rax,-0x20(%rbp)
  mov    -0x4c(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rcx
  mov    -0x20(%rbp),%rax
  lea    D114(%rip),%rdx
  mov    %rax,%rsi
  mov    %rcx,%rdi
  mov    $0x0,%eax
  call   <mem_alloc@plt>
  cltq
  mov    %rax,-0x18(%rbp)
  mov    -0x60(%rbp),%rax
  movsd  D80(%rip),%xmm0
  movsd  %xmm0,(%rax)
  movl   $0x0,-0x40(%rbp)
  jmp    L88
L24:
  movsd  D77(%rip),%xmm0
  movsd  %xmm0,-0x30(%rbp)
  movl   $0x0,-0x38(%rbp)
  jmp    L217
L143:
  mov    -0x40(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x48(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%rdx
  mov    -0x38(%rbp),%eax
  cltq
  shl    $0x3,%rax
  add    %rdx,%rax
  movsd  (%rax),%xmm0
  movq   D64(%rip),%xmm1
  andpd  %xmm1,%xmm0
  movsd  %xmm0,-0x8(%rbp)
  movsd  -0x8(%rbp),%xmm0
  comisd -0x30(%rbp),%xmm0
  jbe    L132
  movsd  -0x8(%rbp),%xmm0
  movsd  %xmm0,-0x30(%rbp)
L132:
  addl   $0x1,-0x38(%rbp)
L217:
  mov    -0x38(%rbp),%eax
  cmp    -0x4c(%rbp),%eax
  jl     L143
  movsd  -0x30(%rbp),%xmm0
  ucomisd D77(%rip),%xmm0
  jp     L2
  movsd  -0x30(%rbp),%xmm0
  ucomisd D77(%rip),%xmm0
  jne    L2
  lea    D9(%rip),%rax
  mov    %rax,%rdi
  call   <puts@plt>
  mov    $0x1,%edi
  call   <exit@plt>
L2:
  mov    -0x40(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x18(%rbp),%rax
  add    %rdx,%rax
  movsd  D80(%rip),%xmm0
  divsd  -0x30(%rbp),%xmm0
  movsd  %xmm0,(%rax)
  addl   $0x1,-0x40(%rbp)
L88:
  mov    -0x40(%rbp),%eax
  cmp    -0x4c(%rbp),%eax
  jl     L24
  movl   $0x0,-0x38(%rbp)
  jmp    L222
L241:
  movl   $0x0,-0x40(%rbp)
  jmp    L141
L172:
  mov    -0x40(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x48(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%rdx
  mov    -0x38(%rbp),%eax
  cltq
  shl    $0x3,%rax
  add    %rdx,%rax
  movsd  (%rax),%xmm0
  movsd  %xmm0,-0x28(%rbp)
  movl   $0x0,-0x34(%rbp)
  jmp    L10
L105:
  mov    -0x40(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x48(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%rdx
  mov    -0x34(%rbp),%eax
  cltq
  shl    $0x3,%rax
  add    %rdx,%rax
  movsd  (%rax),%xmm1
  mov    -0x34(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x48(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%rdx
  mov    -0x38(%rbp),%eax
  cltq
  shl    $0x3,%rax
  add    %rdx,%rax
  movsd  (%rax),%xmm0
  mulsd  %xmm0,%xmm1
  movsd  -0x28(%rbp),%xmm0
  subsd  %xmm1,%xmm0
  movsd  %xmm0,-0x28(%rbp)
  addl   $0x1,-0x34(%rbp)
L10:
  mov    -0x34(%rbp),%eax
  cmp    -0x40(%rbp),%eax
  jl     L105
  mov    -0x40(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x48(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%rdx
  mov    -0x38(%rbp),%eax
  cltq
  shl    $0x3,%rax
  add    %rdx,%rax
  movsd  -0x28(%rbp),%xmm0
  movsd  %xmm0,(%rax)
  addl   $0x1,-0x40(%rbp)
L141:
  mov    -0x40(%rbp),%eax
  cmp    -0x38(%rbp),%eax
  jl     L172
  movsd  D77(%rip),%xmm0
  movsd  %xmm0,-0x30(%rbp)
  mov    -0x38(%rbp),%eax
  mov    %eax,-0x40(%rbp)
  jmp    L6
L226:
  mov    -0x40(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x48(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%rdx
  mov    -0x38(%rbp),%eax
  cltq
  shl    $0x3,%rax
  add    %rdx,%rax
  movsd  (%rax),%xmm0
  movsd  %xmm0,-0x28(%rbp)
  movl   $0x0,-0x34(%rbp)
  jmp    L159
L224:
  mov    -0x40(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x48(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%rdx
  mov    -0x34(%rbp),%eax
  cltq
  shl    $0x3,%rax
  add    %rdx,%rax
  movsd  (%rax),%xmm1
  mov    -0x34(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x48(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%rdx
  mov    -0x38(%rbp),%eax
  cltq
  shl    $0x3,%rax
  add    %rdx,%rax
  movsd  (%rax),%xmm0
  mulsd  %xmm0,%xmm1
  movsd  -0x28(%rbp),%xmm0
  subsd  %xmm1,%xmm0
  movsd  %xmm0,-0x28(%rbp)
  addl   $0x1,-0x34(%rbp)
L159:
  mov    -0x34(%rbp),%eax
  cmp    -0x38(%rbp),%eax
  jl     L224
  mov    -0x40(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x48(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%rdx
  mov    -0x38(%rbp),%eax
  cltq
  shl    $0x3,%rax
  add    %rdx,%rax
  movsd  -0x28(%rbp),%xmm0
  movsd  %xmm0,(%rax)
  mov    -0x40(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x18(%rbp),%rax
  add    %rdx,%rax
  movsd  (%rax),%xmm1
  movsd  -0x28(%rbp),%xmm0
  movq   D64(%rip),%xmm2
  andpd  %xmm2,%xmm0
  mulsd  %xmm1,%xmm0
  movsd  %xmm0,-0x10(%rbp)
  movsd  -0x10(%rbp),%xmm0
  comisd -0x30(%rbp),%xmm0
  jb     L80
  movsd  -0x10(%rbp),%xmm0
  movsd  %xmm0,-0x30(%rbp)
  mov    -0x40(%rbp),%eax
  mov    %eax,-0x3c(%rbp)
L80:
  addl   $0x1,-0x40(%rbp)
L6:
  mov    -0x40(%rbp),%eax
  cmp    -0x4c(%rbp),%eax
  jl     L226
  mov    -0x38(%rbp),%eax
  cmp    -0x3c(%rbp),%eax
  je     L152
  movl   $0x0,-0x34(%rbp)
  jmp    L82
L45:
  mov    -0x3c(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x48(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%rdx
  mov    -0x34(%rbp),%eax
  cltq
  shl    $0x3,%rax
  add    %rdx,%rax
  movsd  (%rax),%xmm0
  movsd  %xmm0,-0x10(%rbp)
  mov    -0x38(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x48(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%rdx
  mov    -0x34(%rbp),%eax
  cltq
  shl    $0x3,%rax
  add    %rax,%rdx
  mov    -0x3c(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rcx
  mov    -0x48(%rbp),%rax
  add    %rcx,%rax
  mov    (%rax),%rcx
  mov    -0x34(%rbp),%eax
  cltq
  shl    $0x3,%rax
  add    %rcx,%rax
  movsd  (%rdx),%xmm0
  movsd  %xmm0,(%rax)
  mov    -0x38(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x48(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%rdx
  mov    -0x34(%rbp),%eax
  cltq
  shl    $0x3,%rax
  add    %rdx,%rax
  movsd  -0x10(%rbp),%xmm0
  movsd  %xmm0,(%rax)
  addl   $0x1,-0x34(%rbp)
L82:
  mov    -0x34(%rbp),%eax
  cmp    -0x4c(%rbp),%eax
  jl     L45
  mov    -0x60(%rbp),%rax
  movsd  (%rax),%xmm0
  movq   D126(%rip),%xmm1
  xorpd  %xmm1,%xmm0
  mov    -0x60(%rbp),%rax
  movsd  %xmm0,(%rax)
  mov    -0x38(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x18(%rbp),%rax
  add    %rax,%rdx
  mov    -0x3c(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rcx
  mov    -0x18(%rbp),%rax
  add    %rcx,%rax
  movsd  (%rdx),%xmm0
  movsd  %xmm0,(%rax)
L152:
  mov    -0x38(%rbp),%eax
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    -0x58(%rbp),%rax
  add    %rax,%rdx
  mov    -0x3c(%rbp),%eax
  mov    %eax,(%rdx)
  mov    -0x38(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x48(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%rdx
  mov    -0x38(%rbp),%eax
  cltq
  shl    $0x3,%rax
  add    %rdx,%rax
  movsd  (%rax),%xmm0
  movq   D64(%rip),%xmm1
  andpd  %xmm0,%xmm1
  movsd  D77(%rip),%xmm0
  comisd %xmm1,%xmm0
  jbe    L11
  mov    -0x38(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x48(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%rdx
  mov    -0x38(%rbp),%eax
  cltq
  shl    $0x3,%rax
  add    %rdx,%rax
  movsd  D77(%rip),%xmm0
  movsd  %xmm0,(%rax)
L11:
  mov    -0x4c(%rbp),%eax
  sub    $0x1,%eax
  cmp    %eax,-0x38(%rbp)
  jge    L43
  mov    -0x38(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x48(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%rdx
  mov    -0x38(%rbp),%eax
  cltq
  shl    $0x3,%rax
  add    %rdx,%rax
  movsd  (%rax),%xmm1
  movsd  D80(%rip),%xmm0
  divsd  %xmm1,%xmm0
  movsd  %xmm0,-0x10(%rbp)
  mov    -0x38(%rbp),%eax
  add    $0x1,%eax
  mov    %eax,-0x40(%rbp)
  jmp    L41
L85:
  mov    -0x40(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x48(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%rdx
  mov    -0x38(%rbp),%eax
  cltq
  shl    $0x3,%rax
  add    %rdx,%rax
  movsd  (%rax),%xmm0
  mov    -0x40(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x48(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%rdx
  mov    -0x38(%rbp),%eax
  cltq
  shl    $0x3,%rax
  add    %rdx,%rax
  mulsd  -0x10(%rbp),%xmm0
  movsd  %xmm0,(%rax)
  addl   $0x1,-0x40(%rbp)
L41:
  mov    -0x40(%rbp),%eax
  cmp    -0x4c(%rbp),%eax
  jl     L85
L43:
  addl   $0x1,-0x38(%rbp)
L222:
  mov    -0x38(%rbp),%eax
  cmp    -0x4c(%rbp),%eax
  jl     L241
  mov    -0x18(%rbp),%rax
  mov    %rax,%rdi
  call   <free@plt>
  nop
  leave
  ret
```

tool_calls: name: retrieve_data
arguments: data_tag: D96
type_infered: string
name: retrieve_data
arguments: data_tag: D114
type_infered: string
name: retrieve_data
arguments: data_tag: D80
type_infered: f64
name: retrieve_data
arguments: data_tag: D77
type_infered: byte[8]
name: retrieve_data
arguments: data_tag: D64
type_infered: qword
name: retrieve_data
arguments: data_tag: D9
type_infered: string
name: retrieve_data
arguments: data_tag: D126
type_infered: byte[8]

tool: D96: ludcmp(): 

tool: D114: vv[]

tool: D80: 1

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

tool: D64: 9223372036854775807

tool: D9: 

Singular matrix in routine ludcmp()

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

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);
}
```