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

```asm
<getQR>:
  endbr64
  push   %r15
  mov    %edx,%r15d
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  movslq %esi,%rbp
  push   %rbx
  lea    0x0(,%rbp,8),%r12d
  mov    %r9,%rbx
  sub    $0x98,%rsp
  mov    %rdi,0x58(%rsp)
  mov    %r12d,%edi
  mov    %rcx,0x60(%rsp)
  mov    %r8,0x50(%rsp)
  mov    %ebp,0x1c(%rsp)
  call   <malloc@plt>
  mov    %r12d,%edi
  movslq %r15d,%r12
  mov    %rax,0x88(%rsp)
  call   <malloc@plt>
  mov    %ebp,%edi
  imul   %r15d,%edi
  mov    %rax,0x10(%rsp)
  shl    $0x3,%edi
  call   <malloc@plt>
  mov    %ebp,%edi
  imul   %ebp,%edi
  mov    %rax,0x80(%rsp)
  shl    $0x3,%edi
  call   <malloc@plt>
  mov    %rax,0x20(%rsp)
  test   %r15d,%r15d
  jle    L56
  mov    0x58(%rsp),%rcx
  lea    0x0(,%r12,8),%rsi
  xor    %edx,%edx
  pxor   %xmm1,%xmm1
  nopl   (%rax)
L106:
  xor    %eax,%eax
  nopw   0x0(%rax,%rax,1)
L225:
  movapd %xmm1,%xmm0
  cmp    %eax,%edx
  jg     L170
  movsd  (%rcx,%rax,8),%xmm0
L170:
  movsd  %xmm0,(%rbx,%rax,8)
  add    $0x1,%rax
  cmp    %r12,%rax
  jne    L225
  add    $0x1,%edx
  add    %rsi,%rbx
  add    %rsi,%rcx
  cmp    %edx,%r15d
  jne    L106
  mov    0x1c(%rsp),%eax
  test   %eax,%eax
  jle    L72
L49:
  lea    -0x1(%r15),%edi
  mov    0x50(%rsp),%rcx
  mov    0x1c(%rsp),%r10d
  xor    %edx,%edx
  movsd  D8(%rip),%xmm1
  lea    0x0(,%r12,8),%rsi
  mov    %rdi,%r8
  pxor   %xmm2,%xmm2
  nopl   0x0(%rax)
L118:
  xor    %eax,%eax
  test   %r15d,%r15d
  jg     L104
  jmp    L254
  nopl   0x0(%rax)
L79:
  mov    %r9,%rax
L104:
  movapd %xmm1,%xmm0
  cmp    %eax,%edx
  je     L191
  movapd %xmm2,%xmm0
L191:
  movsd  %xmm0,(%rcx,%rax,8)
  lea    0x1(%rax),%r9
  cmp    %rdi,%rax
  jne    L79
L254:
  add    $0x1,%edx
  add    %rsi,%rcx
  cmp    %edx,%r10d
  jne    L118
L246:
  test   %r8d,%r8d
  js     L226
L250:
  mov    0x1c(%rsp),%edi
  movslq %r8d,%rax
  mov    0x80(%rsp),%r11
  movl   $0x0,0x18(%rsp)
  sub    %rax,%rbp
  mov    %rax,(%rsp)
  sub    %r8d,%edi
  imul   %r15d,%r8d
  shl    $0x3,%rbp
  mov    %edi,0xc(%rsp)
  lea    0x0(,%rax,8),%rdi
  mov    0x10(%rsp),%rax
  mov    %rdi,0x28(%rsp)
  lea    0x8(%rdi),%r13
  mov    0x50(%rsp),%rdi
  add    $0x10,%rax
  mov    %r8d,0x40(%rsp)
  mov    %rax,0x68(%rsp)
  lea    0x8(%rdi),%rax
  mov    %rax,0x70(%rsp)
  mov    %r11,%rax
  sub    %rdi,%rax
  mov    %rax,0x78(%rsp)
  nopl   0x0(%rax,%rax,1)
L181:
  mov    (%rsp),%rax
  mov    0x10(%rsp),%rdi
  mov    D8(%rip),%rbx
  mov    %eax,%esi
  mov    %eax,%r12d
  add    $0x1,%eax
  mov    %rbx,(%rdi)
  cmp    %eax,0x1c(%rsp)
  jle    L116
  mov    0x40(%rsp),%eax
  mov    0x58(%rsp),%rdi
  add    %r15d,%eax
  cltq
  add    (%rsp),%rax
  lea    (%rdi,%rax,8),%rdx
  mov    0xc(%rsp),%edi
  mov    0x10(%rsp),%rax
  lea    -0x2(%rdi),%ecx
  mov    0x68(%rsp),%rdi
  add    $0x8,%rax
  lea    (%rdi,%rcx,8),%rcx
  nopl   0x0(%rax,%rax,1)
L185:
  movsd  (%rdx),%xmm0
  add    $0x8,%rax
  add    %r13,%rdx
  movsd  %xmm0,-0x8(%rax)
  cmp    %rcx,%rax
  jne    L185
L116:
  mov    (%rsp),%rax
  mov    %r15d,%r10d
  sub    %esi,%r10d
  mov    %eax,%r14d
  cmp    %eax,0x1c(%rsp)
  jle    L220
  movslq 0x40(%rsp),%rax
  mov    0x18(%rsp),%edi
  mov    0x70(%rsp),%rsi
  mov    %rax,0x30(%rsp)
  add    %rdi,%rax
  add    (%rsp),%rax
  not    %rdi
  lea    (%rsi,%rax,8),%rbx
  mov    0xc(%rsp),%eax
  xor    %esi,%esi
  shl    $0x3,%rdi
  mov    %rbx,%rcx
  lea    -0x1(%rax),%r8d
  xchg   %ax,%ax
L119:
  lea    (%rdi,%rcx,1),%rax
  lea    (%r11,%rsi,8),%rdx
  cmp    %r14d,%r15d
  jle    L25
  nopl   (%rax)
L171:
  movsd  (%rax),%xmm0
  add    $0x8,%rax
  movsd  %xmm0,(%rdx)
  add    %rbp,%rdx
  cmp    %rcx,%rax
  jne    L171
L25:
  lea    0x1(%rsi),%rax
  add    %r13,%rcx
  cmp    %r8,%rsi
  je     L164
  mov    %rax,%rsi
  jmp    L119
  nopl   (%rax)
L164:
  mov    0xc(%rsp),%r8d
  mov    0x20(%rsp),%rdx
  mov    %r10d,%ecx
  mov    %r11,%rdi
  mov    0x10(%rsp),%rsi
  mov    $0x1,%r9d
  mov    %r10d,0x38(%rsp)
  mov    %r11,0x48(%rsp)
  call   <mmult@plt>
  mov    0x60(%rsp),%r9
  mov    0x28(%rsp),%rax
  mov    $0x1,%edx
  mov    0x38(%rsp),%esi
  mov    0x20(%rsp),%rdi
  movsd  (%r9,%rax,1),%xmm0
  call   <scale@plt>
  mov    0x38(%rsp),%r10d
  mov    0x48(%rsp),%r11
  mov    $0x1,%r8d
  mov    0xc(%rsp),%ecx
  mov    0x20(%rsp),%rsi
  mov    0x10(%rsp),%rdi
  mov    %r10d,%r9d
  mov    %r11,%rdx
  mov    %r10d,0x44(%rsp)
  mov    %r11,0x38(%rsp)
  call   <mmult@plt>
  mov    0x38(%rsp),%r11
  mov    0x30(%rsp),%rcx
  xor    %esi,%esi
  mov    0x28(%rsp),%rax
  mov    0x50(%rsp),%r8
  mov    0x78(%rsp),%rdi
  mov    %r11,0x30(%rsp)
  shl    $0x3,%rcx
  mov    0x44(%rsp),%r10d
  mov    0x1c(%rsp),%r11d
  add    %rax,%r8
  sub    %rax,%rdi
  nopl   0x0(%rax)
L165:
  cmp    %r14d,%r15d
  jle    L243
  mov    %rdi,%rdx
  movslq %esi,%r9
  lea    (%r8,%rcx,1),%rax
  sub    %rcx,%rdx
  lea    (%rdx,%r9,8),%rdx
  cs nopw 0x0(%rax,%rax,1)
L169:
  movsd  (%rax),%xmm0
  subsd  (%rax,%rdx,1),%xmm0
  add    $0x8,%rax
  movsd  %xmm0,-0x8(%rax)
  cmp    %rax,%rbx
  jne    L169
L243:
  add    $0x1,%r12d
  add    %r10d,%esi
  add    %r13,%rcx
  add    %r13,%rbx
  cmp    %r12d,%r11d
  jne    L165
L166:
  addl   $0x1,0x18(%rsp)
  mov    0x18(%rsp),%eax
  add    $0x8,%rbp
  subq   $0x1,(%rsp)
  mov    0x30(%rsp),%r11
  addl   $0x1,0xc(%rsp)
  sub    %r15d,0x40(%rsp)
  subq   $0x8,0x28(%rsp)
  cmp    %r15d,%eax
  jne    L181
L226:
  mov    0x88(%rsp),%rdi
  call   <free@plt>
  mov    0x10(%rsp),%rdi
  call   <free@plt>
  mov    0x80(%rsp),%rdi
  call   <free@plt>
  mov    0x20(%rsp),%rdi
  add    $0x98,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  jmp    1080 <free@plt>
L220:
  mov    0x20(%rsp),%rbx
  mov    0xc(%rsp),%r12d
  mov    %r10d,%ecx
  mov    %r11,%rdi
  mov    0x10(%rsp),%r14
  mov    $0x1,%r9d
  mov    %r11,0x38(%rsp)
  mov    %r12d,%r8d
  mov    %rbx,%rdx
  mov    %r10d,0x30(%rsp)
  mov    %r14,%rsi
  call   <mmult@plt>
  mov    0x28(%rsp),%rdi
  mov    0x60(%rsp),%rax
  mov    $0x1,%edx
  mov    0x30(%rsp),%esi
  movsd  (%rax,%rdi,1),%xmm0
  mov    %rbx,%rdi
  call   <scale@plt>
  mov    0x38(%rsp),%r11
  mov    %r12d,%ecx
  mov    %rbx,%rsi
  mov    0x30(%rsp),%r9d
  mov    $0x1,%r8d
  mov    %r14,%rdi
  mov    %r11,%rdx
  mov    %r11,0x30(%rsp)
  call   <mmult@plt>
  jmp    L166
L56:
  mov    0x1c(%rsp),%edx
  lea    -0x1(%r15),%r8d
  test   %edx,%edx
  jg     L49
  jmp    L246
L72:
  lea    -0x1(%r15),%r8d
  jmp    L250
```

tool_calls: name: extract_symbolic_data
arguments: data_label: D8
datatype: f64

tool: D8: 1

assistant: ```c
void getQR(double *A, int M, int N, double *bvec, double *Q, double *R) {
  int i, j, k, t, u;
  double *x, *v, *AT, *w;
  x = (double *)malloc(sizeof(double) * M);
  v = (double *)malloc(sizeof(double) * M);
  AT = (double *)malloc(sizeof(double) * M * N);
  w = (double *)malloc(sizeof(double) * M * M);
  for (i = 0; i < N; ++i) {
    t = i * N;
    for (j = 0; j < N; ++j) {
      if (i > j) {
        R[t + j] = 0.;
      } else {
        R[t + j] = A[t + j];
      }
    }
  }
  for (i = 0; i < M; ++i) {
    t = i * N;
    for (j = 0; j < N; ++j) {
      if (i == j) {
        Q[t + j] = 1.;
      } else {
        Q[t + j] = 0.;
      }
    }
  }
  for (j = N - 1; j >= 0; --j) {
    v[0] = 1.;
    for (i = j + 1; i < M; ++i) {
      v[i - j] = A[i * N + j];
    }
    for (i = j; i < M; i++) {
      t = i * N;
      u = 0;
      for (k = j; k < N; k++) {
        AT[u + i - j] = Q[k + t];
        u += (M - j);
      }
    }
    mmult(AT, v, w, N - j, M - j, 1);
    scale(w, N - j, 1, bvec[j]);
    mmult(v, w, AT, M - j, 1, N - j);
    for (i = j; i < M; i++) {
      t = i * N;
      for (k = j; k < N; k++) {
        Q[t + k] -= AT[(i - j) * (N - j) + k - j];
      }
    }
  }
  free(x);
  free(v);
  free(AT);
  free(w);
}
```