user: 请将这段汇编代码片段转换成等效的C代码：

```asm
<ludcmp>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x38,%rsp
  mov    %rdi,%rbx
  mov    %esi,%ebp
  mov    %rdx,0x18(%rsp)
  mov    %rcx,%r15
  mov    %rcx,0x28(%rsp)
  mov    %esi,%edi
  call   <dvector@plt>
  mov    %rax,%r12
  mov    D47(%rip),%rax
  mov    %rax,(%r15)
  test   %ebp,%ebp
  jle    L197
  mov    %ebp,%r13d
  mov    $0x0,%r14d
  mov    %ebp,%r15d
  shl    $0x3,%r15
  jmp    L4
L142:
  movsd  D47(%rip),%xmm0
  divsd  0x8(%rsp),%xmm0
  movsd  %xmm0,(%r12,%r14,8)
  add    $0x1,%r14
  cmp    %r13,%r14
  je     L133
L4:
  mov    (%rbx,%r14,8),%rax
  lea    (%r15,%rax,1),%rdx
  pxor   %xmm4,%xmm4
  movsd  %xmm4,0x8(%rsp)
L143:
  movsd  (%rax),%xmm0
  andpd  D36(%rip),%xmm0
  maxsd  0x8(%rsp),%xmm0
  movsd  %xmm0,0x8(%rsp)
  add    $0x8,%rax
  cmp    %rdx,%rax
  jne    L143
  pxor   %xmm4,%xmm4
  ucomisd %xmm4,%xmm0
  jp     L142
  jne    L142
  lea    D8(%rip),%rdi
  call   <error@plt>
  jmp    L142
L133:
  shl    $0x3,%r13
  movl   $0xffffffff,0x20(%rsp)
  mov    $0x0,%edx
  movl   $0x1,0x14(%rsp)
  mov    $0x0,%r15d
  mov    $0x0,%r14d
  movl   $0x0,0x8(%rsp)
  pxor   %xmm6,%xmm6
  movq   D36(%rip),%xmm3
  movq   D24(%rip),%xmm9
  movapd %xmm6,%xmm5
  movapd %xmm6,%xmm4
  movsd  D76(%rip),%xmm8
  lea    -0x1(%rbp),%eax
  mov    %eax,0x24(%rsp)
  movsd  D47(%rip),%xmm7
  jmp    L230
L252:
  mov    (%rbx,%rsi,1),%rcx
  lea    (%rcx,%rdx,1),%r9
  movsd  (%r9),%xmm1
  test   %r8d,%r8d
  jle    L76
  mov    $0x0,%eax
L278:
  mov    (%rbx,%rax,1),%rdi
  movsd  (%rdi,%rdx,1),%xmm0
  mulsd  (%rcx,%rax,1),%xmm0
  subsd  %xmm0,%xmm1
  add    $0x8,%rax
  cmp    %rax,%rsi
  jne    L278
L76:
  add    $0x8,%rsi
L17:
  movsd  %xmm1,(%r9)
  add    $0x1,%r8d
  cmp    %r10d,%r8d
  jne    L252
L188:
  cmp    %r10d,%ebp
  jle    L229
  mov    %r15,%r8
  movapd %xmm6,%xmm2
  mov    0x20(%rsp),%edi
  jmp    L90
L87:
  add    $0x1,%r8
  cmp    %r8d,%ebp
  jle    L229
L90:
  mov    %r8d,%r11d
  mov    (%rbx,%r8,8),%rsi
  lea    (%rsi,%rdx,1),%r9
  movsd  (%r9),%xmm1
  test   %r10d,%r10d
  jle    L270
  mov    $0x0,%eax
L223:
  mov    (%rbx,%rax,8),%rcx
  movsd  (%rcx,%rdx,1),%xmm0
  mulsd  (%rsi,%rax,8),%xmm0
  subsd  %xmm0,%xmm1
  mov    %rax,%rcx
  add    $0x1,%rax
  cmp    %rdi,%rcx
  jne    L223
L270:
  movsd  %xmm1,(%r9)
  andpd  %xmm3,%xmm1
  mulsd  (%r12,%r8,8),%xmm1
  comisd %xmm2,%xmm1
  jb     L87
  movapd %xmm1,%xmm2
  mov    %r11d,0x8(%rsp)
  jmp    L87
L229:
  mov    0x8(%rsp),%eax
  cmp    %r10d,%eax
  jne    L243
L84:
  mov    0x18(%rsp),%rax
  mov    0x8(%rsp),%esi
  mov    %esi,(%rax,%r15,4)
  mov    %rdx,%rax
  add    (%rbx,%rdx,1),%rax
  ucomisd (%rax),%xmm5
  jp     L131
  ucomisd (%rax),%xmm4
  jne    L131
  movsd  %xmm8,(%rax)
L131:
  cmp    %r10d,0x24(%rsp)
  je     L132
  mov    (%rbx,%rdx,1),%rax
  movapd %xmm7,%xmm1
  divsd  (%rax,%rdx,1),%xmm1
  mov    0x14(%rsp),%eax
  cmp    %eax,%ebp
  jle    L197
  cltq
L59:
  mov    %rdx,%rcx
  add    (%rbx,%rax,8),%rcx
  movapd %xmm1,%xmm0
  mulsd  (%rcx),%xmm0
  movsd  %xmm0,(%rcx)
  add    $0x1,%rax
  cmp    %eax,%ebp
  jg     L59
L45:
  add    $0x1,%r14d
  add    $0x1,%r15
  addl   $0x1,0x14(%rsp)
  add    $0x8,%rdx
  addl   $0x1,0x20(%rsp)
L230:
  mov    %r14d,%r10d
  test   %r14d,%r14d
  jle    L188
  mov    %rdx,%r9
  add    (%rbx),%r9
  movsd  (%r9),%xmm1
  mov    $0x8,%esi
  mov    $0x0,%r8d
  jmp    L17
L243:
  movslq %eax,%r8
  lea    (%rbx,%r8,8),%rdi
  mov    $0x0,%eax
L209:
  mov    %rax,%rcx
  add    (%rdi),%rcx
  movsd  (%rcx),%xmm0
  mov    (%rbx,%rdx,1),%rsi
  movsd  (%rsi,%rax,1),%xmm1
  movsd  %xmm1,(%rcx)
  mov    (%rbx,%rdx,1),%rcx
  movsd  %xmm0,(%rcx,%rax,1)
  add    $0x8,%rax
  cmp    %rax,%r13
  jne    L209
  mov    0x28(%rsp),%rax
  movsd  (%rax),%xmm0
  xorpd  %xmm9,%xmm0
  movsd  %xmm0,(%rax)
  movsd  (%r12,%rdx,1),%xmm0
  movsd  %xmm0,(%r12,%r8,8)
  jmp    L84
L132:
  cmp    0x14(%rsp),%ebp
  jg     L45
L197:
  mov    %r12,%rdi
  call   <free@plt>
  add    $0x38,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
```

tool_calls: name: retrieve_data
arguments: tag: D47
data_type: f64
name: retrieve_data
arguments: tag: D36
data_type: qword[2]
name: retrieve_data
arguments: tag: D8
data_type: string
name: retrieve_data
arguments: tag: D24
data_type: f32[2]
name: retrieve_data
arguments: tag: D76
data_type: byte[8]

tool: D47: 1

tool: {"D36": [0x7fffffffffffffff,0x0000000000000000]}

tool: D8: Singular matrix in routine ludcmp

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

tool: {"D76": [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);
}
```