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

```asm
<lu_polish>:
  endbr64
  push   %r15
  mov    %rdi,%r10
  mov    %rsi,%r11
  push   %r14
  push   %r13
  mov    %edx,%r13d
  mov    %rcx,%rdx
  push   %r12
  push   %rbp
  push   %rbx
  mov    %r8,%rbx
  sub    $0x88,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,0x78(%rsp)
  xor    %eax,%eax
  cmp    $0xa,%r13d
  jg     L151
  test   %r13d,%r13d
  jle    L93
  lea    0x20(%rsp),%r8
  mov    %r8,%r14
L85:
  test   %r13d,%r13d
  mov    $0x1,%r15d
  movq   D2(%rip),%xmm3
  cmovg  %r13d,%r15d
  xor    %esi,%esi
  mov    %r15d,%eax
  mov    %r15d,%r12d
  shr    %eax
  and    $0xfffffffe,%r12d
  lea    -0x1(%rax),%ebp
  add    $0x1,%rbp
  shl    $0x4,%rbp
  nopl   (%rax)
L78:
  movsd  (%rdx,%rsi,8),%xmm1
  mov    (%r10,%rsi,8),%rcx
  xor    %eax,%eax
  xorpd  %xmm3,%xmm1
  cmp    $0x1,%r13d
  jle    L70
  nopl   (%rax)
L6:
  movupd (%rcx,%rax,1),%xmm0
  movupd (%rbx,%rax,1),%xmm4
  add    $0x10,%rax
  mulpd  %xmm4,%xmm0
  addsd  %xmm0,%xmm1
  unpckhpd %xmm0,%xmm0
  addsd  %xmm0,%xmm1
  cmp    %rbp,%rax
  jne    L6
  cmp    %r12d,%r15d
  je     L158
  movslq %r12d,%rax
L70:
  movsd  (%rcx,%rax,8),%xmm0
  mulsd  (%rbx,%rax,8),%xmm0
  addsd  %xmm0,%xmm1
L158:
  movsd  %xmm1,(%r14,%rsi,8)
  add    $0x1,%rsi
  cmp    %esi,%r13d
  jg     L78
  mov    %r14,%rcx
  mov    %r9,%rdx
  mov    %r13d,%esi
  mov    %r11,%rdi
  mov    %r8,(%rsp)
  call   <lu_backsub@plt>
  lea    0x8(%r14),%rax
  mov    (%rsp),%r8
  cmp    %rax,%rbx
  je     L19
  xor    %eax,%eax
  cmp    $0x2,%r13d
  jle    L19
  nopw   0x0(%rax,%rax,1)
L144:
  movupd (%rbx,%rax,1),%xmm0
  movupd (%r14,%rax,1),%xmm5
  subpd  %xmm5,%xmm0
  movups %xmm0,(%rbx,%rax,1)
  add    $0x10,%rax
  cmp    %rbp,%rax
  jne    L144
  cmp    %r12d,%r15d
  je     L69
  movslq %r12d,%r12
  lea    (%rbx,%r12,8),%rax
  movsd  (%rax),%xmm0
  subsd  (%r14,%r12,8),%xmm0
  movsd  %xmm0,(%rax)
L69:
  cmp    %r8,%r14
  je     L80
  lea    -0x1(%r13),%edx
  xor    %esi,%esi
  mov    %r14,%rdi
  call   <free_dvector@plt>
L80:
  mov    0x78(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L152
  add    $0x88,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
L151:
  mov    %rsi,0x8(%rsp)
  lea    -0x1(%r13),%esi
  mov    %rdi,(%rsp)
  xor    %edi,%edi
  mov    %r9,0x18(%rsp)
  mov    %rcx,0x10(%rsp)
  call   <dvector@plt>
  mov    (%rsp),%r10
  mov    0x8(%rsp),%r11
  lea    0x20(%rsp),%r8
  mov    0x10(%rsp),%rdx
  mov    0x18(%rsp),%r9
  mov    %rax,%r14
  jmp    L85
L19:
  xor    %eax,%eax
  nopw   0x0(%rax,%rax,1)
L42:
  movsd  (%rbx,%rax,8),%xmm0
  subsd  (%r14,%rax,8),%xmm0
  movsd  %xmm0,(%rbx,%rax,8)
  add    $0x1,%rax
  cmp    %eax,%r13d
  jg     L42
  jmp    L69
L93:
  lea    0x20(%rsp),%rcx
  mov    %r9,%rdx
  mov    %r13d,%esi
  mov    %r11,%rdi
  call   <lu_backsub@plt>
  jmp    L80
L152:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: read_data
arguments: label: D2
type_guessed: byte[8]

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

assistant: ```c
void lu_polish(double **a, double **lua, int n, double *b, double *x, int *pivx) {
  int i, j;
  double *r, R[10];
  if (n <= 10)
    r = R;
  else
    r = dvector(0, n - 1);
  for (i = 0; i < n; i++) {
    double sum;
    sum = -b[i];
    for (j = 0; j < n; j++)
      sum += a[i][j] * x[j];
    r[i] = sum;
  }
  lu_backsub(lua, n, pivx, r);
  for (i = 0; i < n; i++)
    x[i] -= r[i];
  if (r != R)
    free_dvector(r, 0, n - 1);
}
```