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

```asm
<getQR>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x70,%rsp
  mov    %rdi,-0x48(%rbp)
  mov    %esi,-0x4c(%rbp)
  mov    %edx,-0x50(%rbp)
  mov    %rcx,-0x58(%rbp)
  mov    %r8,-0x60(%rbp)
  mov    %r9,-0x68(%rbp)
  mov    -0x4c(%rbp),%eax
  cltq
  shl    $0x3,%eax
  mov    %eax,%edi
  call   <malloc@plt>
  mov    %rax,-0x20(%rbp)
  mov    -0x4c(%rbp),%eax
  cltq
  shl    $0x3,%eax
  mov    %eax,%edi
  call   <malloc@plt>
  mov    %rax,-0x18(%rbp)
  mov    -0x4c(%rbp),%eax
  cltq
  mov    %eax,%edx
  mov    -0x50(%rbp),%eax
  cltq
  imul   %edx,%eax
  shl    $0x3,%eax
  mov    %eax,%edi
  call   <malloc@plt>
  mov    %rax,-0x10(%rbp)
  mov    -0x4c(%rbp),%eax
  cltq
  mov    %eax,%edx
  mov    -0x4c(%rbp),%eax
  cltq
  imul   %edx,%eax
  shl    $0x3,%eax
  mov    %eax,%edi
  call   <malloc@plt>
  mov    %rax,-0x8(%rbp)
  movl   $0x0,-0x34(%rbp)
  jmp    L84
L143:
  mov    -0x34(%rbp),%eax
  imul   -0x50(%rbp),%eax
  mov    %eax,-0x24(%rbp)
  movl   $0x0,-0x30(%rbp)
  jmp    L154
L50:
  mov    -0x34(%rbp),%eax
  cmp    -0x30(%rbp),%eax
  jle    L235
  mov    -0x24(%rbp),%edx
  mov    -0x30(%rbp),%eax
  add    %edx,%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x68(%rbp),%rax
  add    %rdx,%rax
  pxor   %xmm0,%xmm0
  movsd  %xmm0,(%rax)
  jmp    L62
L235:
  mov    -0x24(%rbp),%edx
  mov    -0x30(%rbp),%eax
  add    %edx,%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x48(%rbp),%rax
  add    %rax,%rdx
  mov    -0x24(%rbp),%ecx
  mov    -0x30(%rbp),%eax
  add    %ecx,%eax
  cltq
  lea    0x0(,%rax,8),%rcx
  mov    -0x68(%rbp),%rax
  add    %rcx,%rax
  movsd  (%rdx),%xmm0
  movsd  %xmm0,(%rax)
L62:
  addl   $0x1,-0x30(%rbp)
L154:
  mov    -0x30(%rbp),%eax
  cmp    -0x50(%rbp),%eax
  jl     L50
  addl   $0x1,-0x34(%rbp)
L84:
  mov    -0x34(%rbp),%eax
  cmp    -0x50(%rbp),%eax
  jl     L143
  movl   $0x0,-0x34(%rbp)
  jmp    L53
L222:
  mov    -0x34(%rbp),%eax
  imul   -0x50(%rbp),%eax
  mov    %eax,-0x24(%rbp)
  movl   $0x0,-0x30(%rbp)
  jmp    L162
L160:
  mov    -0x34(%rbp),%eax
  cmp    -0x30(%rbp),%eax
  jne    L69
  mov    -0x24(%rbp),%edx
  mov    -0x30(%rbp),%eax
  add    %edx,%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x60(%rbp),%rax
  add    %rdx,%rax
  movsd  D18(%rip),%xmm0
  movsd  %xmm0,(%rax)
  jmp    L127
L69:
  mov    -0x24(%rbp),%edx
  mov    -0x30(%rbp),%eax
  add    %edx,%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x60(%rbp),%rax
  add    %rdx,%rax
  pxor   %xmm0,%xmm0
  movsd  %xmm0,(%rax)
L127:
  addl   $0x1,-0x30(%rbp)
L162:
  mov    -0x30(%rbp),%eax
  cmp    -0x50(%rbp),%eax
  jl     L160
  addl   $0x1,-0x34(%rbp)
L53:
  mov    -0x34(%rbp),%eax
  cmp    -0x4c(%rbp),%eax
  jl     L222
  mov    -0x50(%rbp),%eax
  sub    $0x1,%eax
  mov    %eax,-0x30(%rbp)
  jmp    L99
L146:
  mov    -0x18(%rbp),%rax
  movsd  D18(%rip),%xmm0
  movsd  %xmm0,(%rax)
  mov    -0x30(%rbp),%eax
  add    $0x1,%eax
  mov    %eax,-0x34(%rbp)
  jmp    L198
L43:
  mov    -0x34(%rbp),%eax
  imul   -0x50(%rbp),%eax
  mov    %eax,%edx
  mov    -0x30(%rbp),%eax
  add    %edx,%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x48(%rbp),%rax
  add    %rax,%rdx
  mov    -0x34(%rbp),%eax
  sub    -0x30(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rcx
  mov    -0x18(%rbp),%rax
  add    %rcx,%rax
  movsd  (%rdx),%xmm0
  movsd  %xmm0,(%rax)
  addl   $0x1,-0x34(%rbp)
L198:
  mov    -0x34(%rbp),%eax
  cmp    -0x4c(%rbp),%eax
  jl     L43
  mov    -0x30(%rbp),%eax
  mov    %eax,-0x34(%rbp)
  jmp    L193
L150:
  mov    -0x34(%rbp),%eax
  imul   -0x50(%rbp),%eax
  mov    %eax,-0x24(%rbp)
  movl   $0x0,-0x28(%rbp)
  mov    -0x30(%rbp),%eax
  mov    %eax,-0x2c(%rbp)
  jmp    L211
L215:
  mov    -0x2c(%rbp),%edx
  mov    -0x24(%rbp),%eax
  add    %edx,%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x60(%rbp),%rax
  add    %rax,%rdx
  mov    -0x28(%rbp),%ecx
  mov    -0x34(%rbp),%eax
  add    %ecx,%eax
  sub    -0x30(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rcx
  mov    -0x10(%rbp),%rax
  add    %rcx,%rax
  movsd  (%rdx),%xmm0
  movsd  %xmm0,(%rax)
  mov    -0x4c(%rbp),%eax
  sub    -0x30(%rbp),%eax
  add    %eax,-0x28(%rbp)
  addl   $0x1,-0x2c(%rbp)
L211:
  mov    -0x2c(%rbp),%eax
  cmp    -0x50(%rbp),%eax
  jl     L215
  addl   $0x1,-0x34(%rbp)
L193:
  mov    -0x34(%rbp),%eax
  cmp    -0x4c(%rbp),%eax
  jl     L150
  mov    -0x4c(%rbp),%eax
  sub    -0x30(%rbp),%eax
  mov    %eax,%edi
  mov    -0x50(%rbp),%eax
  sub    -0x30(%rbp),%eax
  mov    %eax,%ecx
  mov    -0x8(%rbp),%rdx
  mov    -0x18(%rbp),%rsi
  mov    -0x10(%rbp),%rax
  mov    $0x1,%r9d
  mov    %edi,%r8d
  mov    %rax,%rdi
  call   <mmult@plt>
  mov    -0x30(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x58(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%rdx
  mov    -0x50(%rbp),%eax
  sub    -0x30(%rbp),%eax
  mov    %eax,%ecx
  mov    -0x8(%rbp),%rax
  movq   %rdx,%xmm0
  mov    $0x1,%edx
  mov    %ecx,%esi
  mov    %rax,%rdi
  call   <scale@plt>
  mov    -0x50(%rbp),%eax
  sub    -0x30(%rbp),%eax
  mov    %eax,%edi
  mov    -0x4c(%rbp),%eax
  sub    -0x30(%rbp),%eax
  mov    %eax,%ecx
  mov    -0x10(%rbp),%rdx
  mov    -0x8(%rbp),%rsi
  mov    -0x18(%rbp),%rax
  mov    %edi,%r9d
  mov    $0x1,%r8d
  mov    %rax,%rdi
  call   <mmult@plt>
  mov    -0x30(%rbp),%eax
  mov    %eax,-0x34(%rbp)
  jmp    L0
L185:
  mov    -0x34(%rbp),%eax
  imul   -0x50(%rbp),%eax
  mov    %eax,-0x24(%rbp)
  mov    -0x30(%rbp),%eax
  mov    %eax,-0x2c(%rbp)
  jmp    L171
L101:
  mov    -0x24(%rbp),%edx
  mov    -0x2c(%rbp),%eax
  add    %edx,%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x60(%rbp),%rax
  add    %rdx,%rax
  movsd  (%rax),%xmm0
  mov    -0x34(%rbp),%eax
  sub    -0x30(%rbp),%eax
  mov    %eax,%edx
  mov    -0x50(%rbp),%eax
  sub    -0x30(%rbp),%eax
  imul   %eax,%edx
  mov    -0x2c(%rbp),%eax
  add    %edx,%eax
  sub    -0x30(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x10(%rbp),%rax
  add    %rdx,%rax
  movsd  (%rax),%xmm1
  mov    -0x24(%rbp),%edx
  mov    -0x2c(%rbp),%eax
  add    %edx,%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x60(%rbp),%rax
  add    %rdx,%rax
  subsd  %xmm1,%xmm0
  movsd  %xmm0,(%rax)
  addl   $0x1,-0x2c(%rbp)
L171:
  mov    -0x2c(%rbp),%eax
  cmp    -0x50(%rbp),%eax
  jl     L101
  addl   $0x1,-0x34(%rbp)
L0:
  mov    -0x34(%rbp),%eax
  cmp    -0x4c(%rbp),%eax
  jl     L185
  subl   $0x1,-0x30(%rbp)
L99:
  cmpl   $0x0,-0x30(%rbp)
  jns    L146
  mov    -0x20(%rbp),%rax
  mov    %rax,%rdi
  call   <free@plt>
  mov    -0x18(%rbp),%rax
  mov    %rax,%rdi
  call   <free@plt>
  mov    -0x10(%rbp),%rax
  mov    %rax,%rdi
  call   <free@plt>
  mov    -0x8(%rbp),%rax
  mov    %rax,%rdi
  call   <free@plt>
  nop
  leave
  ret
```

tool_calls: name: extract_symbolic_data
arguments: label: D18
type_infered: f64

tool: D18: 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);
}
```