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

```asm
<ludecomp>:
  endbr64
  push   %r15
  mov    %ecx,%r8d
  push   %r14
  push   %r13
  mov    %rsi,%r13
  push   %r12
  push   %rbp
  push   %rbx
  mov    %rdx,-0x8(%rsp)
  cmp    %rsi,%rdi
  je     L133
  mov    %ecx,%edx
  imul   %ecx,%edx
  test   %edx,%edx
  je     L133
  movslq %edx,%rdx
  xor    %eax,%eax
L135:
  movss  (%rdi,%rax,4),%xmm0
  movss  %xmm0,0x0(%r13,%rax,4)
  add    $0x1,%rax
  cmp    %rdx,%rax
  jne    L135
L133:
  movslq %r8d,%rax
  mov    %rax,-0x20(%rsp)
  xor    %eax,%eax
  test   %r8d,%r8d
  jle    L71
  mov    -0x8(%rsp),%rdx
  mov    -0x20(%rsp),%rcx
  xchg   %ax,%ax
L59:
  mov    %eax,(%rdx,%rax,4)
  add    $0x1,%rax
  cmp    %rcx,%rax
  jne    L59
  mov    -0x20(%rsp),%rax
  mov    %r13,-0x28(%rsp)
  mov    %r13,%rbp
  mov    %r13,%r10
  movl   $0x0,-0x10(%rsp)
  xor    %r15d,%r15d
  xor    %r11d,%r11d
  pxor   %xmm2,%xmm2
  lea    0x4(,%rax,4),%rbx
  movl   $0x0,-0x3c(%rsp)
  lea    0x0(,%rax,4),%rcx
  mov    $0xffffffff,%eax
  mov    %rbx,-0x18(%rsp)
  lea    0x4(%r13),%rbx
  mov    %eax,%r13d
  movss  D4(%rip),%xmm3
  mov    %rbx,-0x30(%rsp)
  mov    %rbx,-0x38(%rsp)
  lea    0x1(%r8),%ebx
  mov    %ebx,-0xc(%rsp)
  xor    %ebx,%ebx
  nopl   0x0(%rax,%rax,1)
L112:
  mov    %rbx,%rax
  mov    $0xffffffff,%edx
  movaps %xmm2,%xmm1
  nopl   0x0(%rax,%rax,1)
L146:
  movss  (%r10,%rax,4),%xmm0
  andps  %xmm3,%xmm0
  comiss %xmm1,%xmm0
  maxss  %xmm1,%xmm0
  cmova  %eax,%edx
  add    $0x1,%rax
  movaps %xmm0,%xmm1
  cmp    %eax,%r8d
  jg     L146
  cmp    %r11d,%edx
  je     L155
  cmp    $0xffffffff,%edx
  je     L155
  movslq %edx,%rdx
  mov    %rbp,%rax
  xor    %esi,%esi
  mov    %rdx,%rdi
  sub    %rbx,%rdi
  nop
L8:
  movss  (%rax),%xmm0
  movss  (%rax,%rdi,4),%xmm1
  add    $0x1,%esi
  movss  %xmm1,(%rax)
  movss  %xmm0,(%rax,%rdi,4)
  add    %rcx,%rax
  cmp    %esi,%r8d
  jne    L8
  mov    -0x8(%rsp),%rdi
  lea    (%rdi,%rdx,4),%rdx
  mov    (%rdi,%rbx,4),%eax
  mov    (%rdx),%esi
  mov    %esi,(%rdi,%rbx,4)
  mov    %eax,(%rdx)
L155:
  cmp    %r11d,%r8d
  jle    L17
  movslq -0x3c(%rsp),%rdx
  mov    -0x28(%rsp),%r14
  mov    %r11d,%r9d
  mov    -0x30(%rsp),%rsi
  lea    (%rdx,%rbx,1),%rax
  lea    (%r14,%rax,4),%rdi
  mov    %r13d,%eax
  sub    %rbp,%r14
  add    %rdx,%rax
  mov    %r14,%r12
  lea    (%rsi,%rax,4),%rsi
  nop
L0:
  lea    (%r12,%rdi,1),%rax
  mov    %rbp,%rdx
  movaps %xmm2,%xmm1
  test   %r11d,%r11d
  je     L52
  nop
L21:
  movss  (%rdx),%xmm0
  mulss  (%rax),%xmm0
  add    $0x4,%rax
  add    %rcx,%rdx
  addss  %xmm0,%xmm1
  cmp    %rax,%rsi
  jne    L21
L52:
  movss  (%rdi),%xmm0
  add    $0x1,%r9d
  add    %rcx,%rsi
  subss  %xmm1,%xmm0
  movss  %xmm0,(%rdi)
  add    %rcx,%rdi
  cmp    %r9d,%r8d
  jne    L0
L17:
  add    $0x1,%r11d
  cmp    %r11d,%r8d
  je     L71
  movslq -0x10(%rsp),%rax
  mov    -0x28(%rsp),%rdi
  mov    %r15,%r12
  mov    %r11d,%r9d
  neg    %r12
  lea    (%rdi,%rax,4),%r14
  mov    -0x30(%rsp),%rdi
  mov    %r13d,%eax
  shl    $0x2,%r12
  add    %r15,%rax
  lea    (%rdi,%rax,4),%rsi
  mov    -0x38(%rsp),%rdi
  nop
L48:
  lea    (%rdi,%r12,1),%rdx
  mov    %r10,%rax
  movaps %xmm2,%xmm1
  test   %rbx,%rbx
  je     L131
  nop
L138:
  movss  (%rdx),%xmm0
  mulss  (%rax),%xmm0
  add    $0x4,%rax
  add    %rcx,%rdx
  addss  %xmm0,%xmm1
  cmp    %rax,%rsi
  jne    L138
L131:
  movss  (%rdi),%xmm0
  add    $0x1,%r9d
  add    $0x4,%rdi
  subss  %xmm1,%xmm0
  divss  (%r14),%xmm0
  movss  %xmm0,-0x4(%rdi)
  cmp    %r9d,%r8d
  jne    L48
  mov    -0x18(%rsp),%rdi
  add    $0x1,%rbx
  add    $0x1,%r13d
  add    %rcx,%r10
  add    %rdi,-0x38(%rsp)
  add    $0x4,%rbp
  mov    -0xc(%rsp),%edi
  add    %r8d,-0x3c(%rsp)
  add    -0x20(%rsp),%r15
  add    %edi,-0x10(%rsp)
  jmp    L112
L71:
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
```

tool_calls: name: read_data
arguments: label: D4
type: dword

tool: D4: 2147483647

assistant: ```c
int ludecomp(float A[], float LU[], int P[], int N) {
  int i, j, k;
  float max, tmp;
  int who, tmpi;
  float sum;
  if (A != LU) {
    for (i = 0; i < N * N; i++) {
      LU[i] = A[i];
    }
  }
  for (i = 0; i < N; i++) {
    P[i] = i;
  }
  for (i = 0; i < N; i++) {
    max = 0;
    who = -1;
    for (j = i; j < N; j++) {
      tmp = fabsf(LU[(i) * (N) + (j)]);
      if (tmp > max) {
        max = tmp;
        who = j;
      }
    }
    if (who == -1) {
      who = i;
    }
    if (who != i) {
      for (j = 0; j < N; j++) {
        tmp = LU[(j) * (N) + (i)];
        LU[(j) * (N) + (i)] = LU[(j) * (N) + (who)];
        LU[(j) * (N) + (who)] = tmp;
      }
      tmpi = P[i];
      P[i] = P[who];
      P[who] = tmpi;
    }
    for (j = i; j < N; j++) {
      sum = 0;
      for (k = 0; k < i; k++) {
        sum += LU[(k) * (N) + (i)] * LU[(j) * (N) + (k)];
      }
      LU[(j) * (N) + (i)] -= sum;
    }
    for (j = i + 1; j < N; j++) {
      sum = 0;
      for (k = 0; k < i; k++) {
        sum += LU[(k) * (N) + (j)] * LU[(i) * (N) + (k)];
      }
      LU[(i) * (N) + (j)] = (LU[(i) * (N) + (j)] - sum) / LU[(i) * (N) + (i)];
    }
  }
}
```