user: 请将以下的汇编代码转换成C语言代码:

```asm
<mp_qrfac>:
  endbr64
  push   %r15
  mov    %edi,%r10d
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0xb8,%rsp
  mov    %esi,0x3c(%rsp)
  mov    0xf8(%rsp),%rbp
  mov    %rdx,0x10(%rsp)
  mov    0x100(%rsp),%r12
  mov    %r8d,0x4(%rsp)
  mov    %r9,0x60(%rsp)
  test   %esi,%esi
  jle    L289
  mov    0x10(%rsp),%r15
  movslq 0x3c(%rsp),%r13
  xor    %r14d,%r14d
  movslq %edi,%rbx
  shl    $0x3,%rbx
  mov    %r15,%rax
  mov    %r13,0x8(%rsp)
  mov    %r14,%r15
  mov    %edi,%r13d
  mov    %rax,%r14
  nopl   0x0(%rax)
L48:
  mov    %r14,%rsi
  mov    %r13d,%edi
  call   <mp_enorm@plt>
  mov    0x108(%rsp),%rax
  mov    0x4(%rsp),%r8d
  movsd  %xmm0,(%r12,%r15,8)
  movsd  %xmm0,0x0(%rbp,%r15,8)
  movsd  %xmm0,(%rax,%r15,8)
  test   %r8d,%r8d
  je     L39
  mov    0x60(%rsp),%rax
  mov    %r15d,(%rax,%r15,4)
L39:
  add    $0x1,%r15
  add    %rbx,%r14
  cmp    0x8(%rsp),%r15
  jne    L48
  mov    %r13d,%r10d
L289:
  mov    0x3c(%rsp),%esi
  mov    %r10d,%edi
  mov    %r10d,0x8(%rsp)
  call   <mp_min0@plt>
  mov    0x8(%rsp),%r10d
  test   %eax,%eax
  jle    L320
  movslq %r10d,%rbx
  cltq
  lea    -0x1(%r10),%ecx
  xor    %r11d,%r11d
  lea    0x1(%r10),%edi
  lea    0x1(%rbx),%rdx
  mov    %rax,0x58(%rsp)
  xor    %r15d,%r15d
  lea    0x0(,%rbx,8),%rax
  mov    %rbx,0x40(%rsp)
  mov    %r10d,%ebx
  mov    %rax,0x98(%rsp)
  mov    0x10(%rsp),%rax
  mov    %ecx,0x68(%rsp)
  mov    %edi,0x4c(%rsp)
  mov    %rdx,0x50(%rsp)
  mov    %edi,0x48(%rsp)
  mov    %ecx,0x38(%rsp)
  movq   $0x0,0x30(%rsp)
  jmp    L321
  nopl   0x0(%rax)
L12:
  lea    (%rax,%r11,8),%rcx
  mov    %r10d,%edi
  mov    %rax,0x28(%rsp)
  mov    %rcx,%rsi
  sub    %r14d,%edi
  mov    %r11,0x20(%rsp)
  mov    %r10d,0x18(%rsp)
  mov    %rcx,0x10(%rsp)
  call   <mp_enorm@plt>
  pxor   %xmm3,%xmm3
  mov    0x10(%rsp),%rcx
  mov    0x18(%rsp),%r10d
  ucomisd %xmm3,%xmm0
  mov    0x20(%rsp),%r11
  movapd %xmm0,%xmm1
  lea    0x1(%r14),%esi
  mov    0x28(%rsp),%rax
  jp     L140
  jne    L140
  movapd %xmm0,%xmm4
  xorpd  D45(%rip),%xmm4
  lea    0x1(%r15),%r9
L256:
  mov    0x8(%rsp),%ebx
  mov    0x4c(%rsp),%ecx
  movsd  %xmm4,0x0(%rbp,%r15,8)
  mov    %r9,%r15
  add    %ecx,0x48(%rsp)
  add    0x50(%rsp),%r11
  mov    0x40(%rsp),%rcx
  subl   $0x1,0x38(%rsp)
  lea    (%rbx,%r10,2),%ebx
  add    %rcx,0x30(%rsp)
  cmp    0x58(%rsp),%r9
  je     L320
L321:
  mov    %ebx,%edi
  mov    %r15d,%r14d
  mov    %r15d,%ecx
  sub    %r10d,%edi
  mov    %edi,0x8(%rsp)
  mov    0x4(%rsp),%edi
  test   %edi,%edi
  je     L12
  mov    0x3c(%rsp),%r8d
  mov    %r15d,%edi
  cmp    %r15d,%r8d
  jle    L12
  mov    %r15,%rdx
  xchg   %ax,%ax
L79:
  movslq %ecx,%rsi
  movsd  0x0(%rbp,%rdx,8),%xmm0
  ucomisd 0x0(%rbp,%rsi,8),%xmm0
  cmova  %edx,%ecx
  add    $0x1,%rdx
  cmp    %edx,%r8d
  jg     L79
  cmp    %edi,%ecx
  je     L12
  mov    %ecx,%esi
  imul   %r10d,%esi
  test   %r10d,%r10d
  jle    L317
  mov    0x30(%rsp),%r9
  mov    0x68(%rsp),%edi
  movslq %esi,%rsi
  add    %r9,%rdi
  lea    (%rax,%r9,8),%rdx
  sub    %r9,%rsi
  lea    0x8(%rax,%rdi,8),%rdi
  nopl   0x0(%rax)
L311:
  movsd  (%rdx),%xmm0
  movsd  (%rdx,%rsi,8),%xmm1
  movsd  %xmm1,(%rdx)
  movsd  %xmm0,(%rdx,%rsi,8)
  add    $0x8,%rdx
  cmp    %rdi,%rdx
  jne    L311
L317:
  movsd  0x0(%rbp,%r15,8),%xmm0
  mov    0x108(%rsp),%rdi
  movslq %ecx,%rcx
  movsd  %xmm0,0x0(%rbp,%rcx,8)
  movsd  (%rdi,%r15,8),%xmm0
  movsd  %xmm0,(%rdi,%rcx,8)
  mov    0x60(%rsp),%rdi
  lea    (%rdi,%rcx,4),%rdx
  mov    (%rdi,%r15,4),%esi
  mov    (%rdx),%ecx
  mov    %ecx,(%rdi,%r15,4)
  mov    %esi,(%rdx)
  jmp    L12
  nopl   0x0(%rax,%rax,1)
L140:
  movsd  (%rax,%r11,8),%xmm0
  movapd %xmm1,%xmm4
  xorpd  D45(%rip),%xmm4
  comisd %xmm0,%xmm3
  jbe    L313
  movq   %xmm1,%rdx
  movapd %xmm4,%xmm1
  movq   %rdx,%xmm4
L313:
  mov    %r15d,0x10(%rsp)
  cmp    %r15d,%r10d
  jle    L176
  mov    0x38(%rsp),%edx
  add    %r11,%rdx
  lea    (%rax,%rdx,8),%rdi
  mov    %rcx,%rdx
  jmp    L207
L98:
  movsd  0x8(%rdx),%xmm0
  add    $0x8,%rdx
L207:
  divsd  %xmm1,%xmm0
  movsd  %xmm0,(%rdx)
  cmp    %rdi,%rdx
  jne    L98
  movsd  (%rax,%r11,8),%xmm0
L176:
  addsd  D35(%rip),%xmm0
  lea    0x1(%r15),%r9
  movsd  %xmm0,(%rax,%r11,8)
  cmp    %esi,0x3c(%rsp)
  jle    L256
  movslq %ebx,%rbx
  mov    %r11,%r13
  mov    %r15,0xa0(%rsp)
  lea    (%rbx,%r15,1),%rsi
  sub    %r15,%r13
  mov    %rcx,0x20(%rsp)
  mov    0x98(%rsp),%rcx
  lea    (%rax,%rsi,8),%r8
  mov    0x38(%rsp),%esi
  sub    %rbx,%r13
  mov    %r9,0xa8(%rsp)
  lea    (%rbx,%rsi,1),%rdi
  sub    %r11,%rbx
  add    %r11,%rsi
  add    %r15,%rdi
  add    %r15,%rbx
  lea    (%rax,%rdi,8),%r12
  mov    0x3c(%rsp),%edi
  sub    $0x2,%edi
  sub    %r14d,%edi
  lea    0x8(%rax,%rsi,8),%r14
  lea    0x2(%r15,%rdi,1),%rdi
  mov    %r9,%r15
  mov    %rbp,%r9
  mov    %r8,%rbp
  mov    %rdi,0x18(%rsp)
  mov    0x48(%rsp),%edi
  mov    0x40(%rsp),%r8
  mov    %edi,%edx
  xchg   %ax,%ax
L291:
  mov    0x20(%rsp),%rsi
  movapd %xmm3,%xmm1
  cmp    0x10(%rsp),%r10d
  jle    L303
L103:
  movsd  (%rsi),%xmm0
  mulsd  (%rsi,%rbx,8),%xmm0
  add    $0x8,%rsi
  addsd  %xmm0,%xmm1
  cmp    %rsi,%r14
  jne    L103
  movsd  (%rax,%r11,8),%xmm0
  movapd %xmm1,%xmm2
  mov    %rbp,%rsi
  divsd  %xmm0,%xmm2
  jmp    L145
  nopl   0x0(%rax)
L47:
  movsd  0x8(%rsi,%r13,8),%xmm0
  add    $0x8,%rsi
L145:
  mulsd  %xmm2,%xmm0
  movsd  (%rsi),%xmm1
  subsd  %xmm0,%xmm1
  movsd  %xmm1,(%rsi)
  cmp    %rsi,%r12
  jne    L47
L303:
  mov    0x4(%rsp),%esi
  test   %esi,%esi
  je     L168
  movsd  (%r9,%r15,8),%xmm0
  ucomisd %xmm3,%xmm0
  jp     L14
  jne    L14
L168:
  add    $0x1,%r15
  add    %r10d,%edx
  add    %rcx,%rbp
  add    %rcx,%r12
  sub    %r8,%r13
  add    %r8,%rbx
  cmp    0x18(%rsp),%r15
  jne    L291
  mov    %r9,%rbp
  mov    0xa0(%rsp),%r15
  mov    0xa8(%rsp),%r9
  jmp    L256
  nopl   0x0(%rax)
L14:
  movsd  0x0(%rbp),%xmm1
  movsd  D35(%rip),%xmm5
  mov    %r9,0xf8(%rsp)
  mov    %rax,0x90(%rsp)
  divsd  %xmm0,%xmm1
  movapd %xmm3,%xmm0
  mov    %r11,0x78(%rsp)
  mov    %r10d,0x88(%rsp)
  mov    %r8,0x80(%rsp)
  mov    %edx,0x6c(%rsp)
  mov    %rcx,0x28(%rsp)
  movsd  %xmm4,0x70(%rsp)
  mulsd  %xmm1,%xmm1
  subsd  %xmm1,%xmm5
  movapd %xmm5,%xmm1
  call   <mp_dmax1@plt>
  pxor   %xmm3,%xmm3
  mov    0x28(%rsp),%rcx
  mov    0x6c(%rsp),%edx
  ucomisd %xmm0,%xmm3
  movsd  0x70(%rsp),%xmm4
  mov    0x78(%rsp),%r11
  mov    0x80(%rsp),%r8
  mov    0x88(%rsp),%r10d
  mov    0x90(%rsp),%rax
  mov    0xf8(%rsp),%r9
  ja     L34
  sqrtsd %xmm0,%xmm0
L197:
  mulsd  (%r9,%r15,8),%xmm0
  mov    0x108(%rsp),%rdi
  movsd  D38(%rip),%xmm1
  movsd  D31(%rip),%xmm6
  movsd  %xmm0,(%r9,%r15,8)
  divsd  (%rdi,%r15,8),%xmm0
  mulsd  %xmm0,%xmm1
  mulsd  %xmm1,%xmm0
  comisd %xmm0,%xmm6
  jb     L168
  movslq %edx,%rsi
  mov    0x38(%rsp),%edi
  mov    %r9,0xf8(%rsp)
  lea    (%rax,%rsi,8),%rsi
  mov    %r10d,0x90(%rsp)
  mov    %r8,0x88(%rsp)
  mov    %r11,0x80(%rsp)
  mov    %rcx,0x70(%rsp)
  mov    %edx,0x6c(%rsp)
  mov    %rax,0x28(%rsp)
  movsd  %xmm4,0x78(%rsp)
  call   <mp_enorm@plt>
  mov    0x108(%rsp),%rax
  mov    0xf8(%rsp),%r9
  pxor   %xmm3,%xmm3
  mov    0x90(%rsp),%r10d
  mov    0x88(%rsp),%r8
  movsd  %xmm0,(%r9,%r15,8)
  movsd  0x78(%rsp),%xmm4
  mov    0x70(%rsp),%rcx
  movsd  %xmm0,(%rax,%r15,8)
  mov    0x80(%rsp),%r11
  mov    0x6c(%rsp),%edx
  mov    0x28(%rsp),%rax
  jmp    L168
  nopl   0x0(%rax)
L320:
  add    $0xb8,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
L34:
  mov    %r9,0xf8(%rsp)
  mov    %rax,0x90(%rsp)
  mov    %r10d,0x88(%rsp)
  mov    %r8,0x80(%rsp)
  mov    %r11,0x78(%rsp)
  mov    %edx,0x6c(%rsp)
  mov    %rcx,0x28(%rsp)
  movsd  %xmm4,0x70(%rsp)
  call   <sqrt@plt>
  mov    0xf8(%rsp),%r9
  mov    0x90(%rsp),%rax
  pxor   %xmm3,%xmm3
  mov    0x88(%rsp),%r10d
  mov    0x80(%rsp),%r8
  mov    0x78(%rsp),%r11
  movsd  0x70(%rsp),%xmm4
  mov    0x6c(%rsp),%edx
  mov    0x28(%rsp),%rcx
  jmp    L197
```

tool_calls: name: unpack_data
arguments: data_label: D45
type: f32[4]
name: unpack_data
arguments: data_label: D35
type: f64
name: unpack_data
arguments: data_label: D38
type: f64
name: unpack_data
arguments: data_label: D31
type: byte[8]

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

tool: D35: 1

tool: D38: 0.05

tool: {"D31": [0xa3,0x8d,0x17,0xf4,0xff,0xff,0xaf,0x3c]}

assistant: ```c
void mp_qrfac(int m, int n, double *a, int lda, int pivot, int *ipvt, int lipvt, double *rdiag, double *acnorm, double *wa) {
  int i, ij, jj, j, jp1, k, kmax, minmn;
  double ajnorm, sum, temp;
  static double zero = 0.0;
  static double one = 1.0;
  static double p05 = 0.05;
  lda = 0;
  lipvt = 0;
  if (lda) {
  }
  if (lipvt) {
  }
  ij = 0;
  for (j = 0; j < n; j++) {
    acnorm[j] = mp_enorm(m, &a[ij]);
    rdiag[j] = acnorm[j];
    wa[j] = rdiag[j];
    if (pivot != 0)
      ipvt[j] = j;
    ij += m;
  }
  minmn = mp_min0(m, n);
  for (j = 0; j < minmn; j++) {
    if (pivot == 0)
      goto L40;
    kmax = j;
    for (k = j; k < n; k++) {
      if (rdiag[k] > rdiag[kmax])
        kmax = k;
    }
    if (kmax == j)
      goto L40;
    ij = m * j;
    jj = m * kmax;
    for (i = 0; i < m; i++) {
      temp = a[ij];
      a[ij] = a[jj];
      a[jj] = temp;
      ij += 1;
      jj += 1;
    }
    rdiag[kmax] = rdiag[j];
    wa[kmax] = wa[j];
    k = ipvt[j];
    ipvt[j] = ipvt[kmax];
    ipvt[kmax] = k;
  L40:
    jj = j + m * j;
    ajnorm = mp_enorm(m - j, &a[jj]);
    if (ajnorm == zero)
      goto L100;
    if (a[jj] < zero)
      ajnorm = -ajnorm;
    ij = jj;
    for (i = j; i < m; i++) {
      a[ij] /= ajnorm;
      ij += 1;
    }
    a[jj] += one;
    jp1 = j + 1;
    if (jp1 < n) {
      for (k = jp1; k < n; k++) {
        sum = zero;
        ij = j + m * k;
        jj = j + m * j;
        for (i = j; i < m; i++) {
          sum += a[jj] * a[ij];
          ij += 1;
          jj += 1;
        }
        temp = sum / a[j + m * j];
        ij = j + m * k;
        jj = j + m * j;
        for (i = j; i < m; i++) {
          a[ij] -= temp * a[jj];
          ij += 1;
          jj += 1;
        }
        if ((pivot != 0) && (rdiag[k] != zero)) {
          temp = a[j + m * k] / rdiag[k];
          temp = mp_dmax1(zero, one - temp * temp);
          rdiag[k] *= sqrt(temp);
          temp = rdiag[k] / wa[k];
          if ((p05 * temp * temp) <= 2.2204460e-16) {
            rdiag[k] = mp_enorm(m - j - 1, &a[jp1 + m * k]);
            wa[k] = rdiag[k];
          }
        }
      }
    }
  L100:
    rdiag[j] = -ajnorm;
  }
}
```