user: Converte this assembly snippet into its equivalent C code:

```asm
<getQR>:
  endbr64
  push   %r15
  mov    %esi,%r15d
  push   %r14
  mov    %edx,%r14d
  push   %r13
  imul   %r14d,%r15d
  mov    %esi,%r13d
  push   %r12
  lea    0x0(,%rsi,4),%r12d
  push   %rbp
  mov    %r8,%rbp
  push   %rbx
  mov    %r9,%rbx
  sub    $0xd8,%rsp
  mov    %rdi,0xb8(%rsp)
  mov    %r12d,%edi
  mov    %rcx,0xa8(%rsp)
  movslq %esi,%rcx
  mov    %esi,0x1c(%rsp)
  mov    %rcx,0x10(%rsp)
  call   <malloc@plt>
  mov    %r12d,%edi
  movslq %r14d,%r12
  mov    %rax,0xc8(%rsp)
  call   <malloc@plt>
  mov    %r15d,%edi
  mov    %r12,0x30(%rsp)
  shl    $0x2,%edi
  mov    %rax,0x70(%rsp)
  call   <malloc@plt>
  mov    %rax,%r15
  mov    %r13d,%eax
  imul   %r13d,%eax
  mov    %eax,%edi
  shl    $0x2,%edi
  call   <malloc@plt>
  mov    %rax,0x78(%rsp)
  test   %r14d,%r14d
  jle    L438
  lea    0x0(,%r12,4),%rsi
  mov    %r15,0x20(%rsp)
  mov    0xb8(%rsp),%rax
  mov    %rbx,%r10
  mov    %rsi,0x8(%rsp)
  xor    %r13d,%r13d
  xor    %r9d,%r9d
  xor    %edi,%edi
  movdqa D56(%rip),%xmm4
  mov    %rbp,0x28(%rsp)
  mov    %rax,%r11
  pxor   %xmm2,%xmm2
  movdqa D39(%rip),%xmm3
  mov    %rax,%rbp
  nopw   0x0(%rax,%rax,1)
L520:
  test   %edi,%edi
  je     L376
  cmp    %edi,%r14d
  mov    %edi,%edx
  mov    $0x1,%ecx
  cmovle %r14d,%edx
  test   %edx,%edx
  cmovg  %edx,%ecx
  cmp    $0x3,%edx
  jle    L195
  mov    %ecx,%eax
  movdqa D4(%rip),%xmm1
  shr    $0x2,%eax
  sub    $0x1,%eax
  shl    $0x4,%rax
  lea    0x10(%r10,%rax,1),%rsi
  mov    %r10,%rax
  nopl   0x0(%rax,%rax,1)
L303:
  movdqa %xmm1,%xmm0
  movups %xmm2,(%rax)
  add    $0x10,%rax
  paddd  %xmm4,%xmm1
  paddd  %xmm3,%xmm0
  cmp    %rsi,%rax
  jne    L303
  mov    %ecx,%esi
  pshufd $0xff,%xmm0,%xmm0
  and    $0xfffffffc,%esi
  and    $0x3,%ecx
  movd   %xmm0,%eax
  je     L144
L407:
  lea    (%r9,%rsi,1),%eax
  cltq
  movl   $0x0,(%rbx,%rax,4)
  lea    0x1(%rsi),%eax
  cmp    %eax,%edx
  jle    L144
  add    %r9d,%eax
  cltq
  movl   $0x0,(%rbx,%rax,4)
  lea    0x2(%rsi),%eax
  cmp    %eax,%edx
  jle    L144
  add    %r9d,%eax
  cltq
  movl   $0x0,(%rbx,%rax,4)
  lea    0x3(%rsi),%eax
L144:
  cmp    %eax,%r14d
  jle    L408
L117:
  mov    %r14d,%r8d
  movslq %eax,%rcx
  sub    %eax,%r8d
  lea    (%rcx,%r13,1),%rdx
  lea    -0x1(%r8),%r12d
  shl    $0x2,%rdx
  cmp    $0x2,%r12d
  lea    (%rbx,%rdx,1),%rsi
  seta   %r15b
  cmp    %eax,%r14d
  setg   %r12b
  test   %r12b,%r15b
  je     L369
  lea    0x4(%rbp,%rdx,1),%r15
  mov    %rsi,%r12
  sub    %r15,%r12
  cmp    $0x8,%r12
  jbe    L369
  cmp    %eax,%r14d
  mov    $0x1,%ecx
  cmovle %ecx,%r8d
  add    %rbp,%rdx
  xor    %ecx,%ecx
  mov    %r8d,%r12d
  shr    $0x2,%r12d
  shl    $0x4,%r12
  nopl   0x0(%rax)
L472:
  movups (%rdx,%rcx,1),%xmm6
  movups %xmm6,(%rsi,%rcx,1)
  add    $0x10,%rcx
  cmp    %r12,%rcx
  jne    L472
  mov    %r8d,%edx
  and    $0xfffffffc,%edx
  add    %edx,%eax
  cmp    %edx,%r8d
  je     L408
  lea    (%r9,%rax,1),%edx
  movslq %edx,%rdx
  movss  0x0(%rbp,%rdx,4),%xmm0
  movss  %xmm0,(%rbx,%rdx,4)
  lea    0x1(%rax),%edx
  cmp    %edx,%r14d
  jle    L408
  add    %r9d,%edx
  add    $0x2,%eax
  movslq %edx,%rdx
  movss  0x0(%rbp,%rdx,4),%xmm0
  movss  %xmm0,(%rbx,%rdx,4)
  cmp    %eax,%r14d
  jle    L408
  add    %r9d,%eax
  cltq
  movss  0x0(%rbp,%rax,4),%xmm0
  movss  %xmm0,(%rbx,%rax,4)
L408:
  mov    0x8(%rsp),%rax
  add    $0x1,%edi
  add    %r14d,%r9d
  add    0x30(%rsp),%r13
  add    %rax,%r11
  add    %rax,%r10
  cmp    %edi,%r14d
  jne    L520
  mov    0x1c(%rsp),%eax
  mov    0x20(%rsp),%r15
  mov    0x28(%rsp),%rbp
  test   %eax,%eax
  jle    L438
  mov    0x30(%rsp),%rax
  mov    %r14d,%r9d
  mov    0x1c(%rsp),%r8d
  mov    %rbp,%rsi
  movss  D6(%rip),%xmm3
  lea    -0x1(%r14),%r11d
  xor    %ecx,%ecx
  xor    %edx,%edx
  lea    0x0(,%rax,4),%r10
  mov    %r14d,%eax
  pxor   %xmm6,%xmm6
  and    $0xfffffffc,%r9d
  shr    $0x2,%eax
  movdqa D56(%rip),%xmm5
  movaps D6(%rip),%xmm4
  sub    $0x1,%eax
  add    $0x1,%rax
  shl    $0x4,%rax
  mov    %rax,%rbx
  nopl   0x0(%rax)
L339:
  cmp    $0x2,%r11d
  jbe    L342
  movd   %edx,%xmm2
  movdqa D4(%rip),%xmm1
  lea    (%rbx,%rsi,1),%rdi
  mov    %rsi,%rax
  pshufd $0x0,%xmm2,%xmm2
  nopw   0x0(%rax,%rax,1)
L533:
  movdqa %xmm1,%xmm0
  add    $0x10,%rax
  paddd  %xmm5,%xmm1
  pcmpeqd %xmm2,%xmm0
  andps  %xmm4,%xmm0
  movups %xmm0,-0x10(%rax)
  cmp    %rdi,%rax
  jne    L533
  mov    %r9d,%eax
  cmp    %r14d,%r9d
  je     L483
L430:
  lea    (%rcx,%rax,1),%edi
  movaps %xmm3,%xmm0
  movslq %edi,%rdi
  lea    0x0(%rbp,%rdi,4),%rdi
  cmp    %eax,%edx
  je     L238
  movaps %xmm6,%xmm0
L238:
  movss  %xmm0,(%rdi)
  lea    0x1(%rax),%edi
  cmp    %edi,%r14d
  jle    L483
  lea    (%rcx,%rdi,1),%r12d
  movaps %xmm3,%xmm0
  movslq %r12d,%r12
  lea    0x0(%rbp,%r12,4),%r12
  cmp    %edi,%edx
  je     L592
  movaps %xmm6,%xmm0
L592:
  add    $0x2,%eax
  movss  %xmm0,(%r12)
  cmp    %r14d,%eax
  jge    L483
  lea    (%rax,%rcx,1),%edi
  movaps %xmm3,%xmm0
  movslq %edi,%rdi
  lea    0x0(%rbp,%rdi,4),%rdi
  cmp    %edx,%eax
  je     L285
  movaps %xmm6,%xmm0
L285:
  movss  %xmm0,(%rdi)
L483:
  add    $0x1,%edx
  add    %r14d,%ecx
  add    %r10,%rsi
  cmp    %edx,%r8d
  jne    L339
L38:
  mov    %r11d,%eax
  movslq %r11d,%rbx
  add    $0x1,%r11d
  xor    %r10d,%r10d
  imul   %r14d,%eax
  mov    %rbx,0x50(%rsp)
  movq   $0x1,0x28(%rsp)
  movss  %xmm3,0xb0(%rsp)
  mov    %eax,0x84(%rsp)
  mov    0x10(%rsp),%rax
  sub    %rbx,%rax
  lea    0x0(,%rax,4),%r12
  lea    0x4(,%rbx,8),%rax
  mov    0x70(%rsp),%rbx
  sub    %rbx,%rax
  add    0xb8(%rsp),%rax
  mov    %rax,0x90(%rsp)
  movslq %r11d,%rax
  mov    %rax,0xa0(%rsp)
  mov    0x30(%rsp),%rax
  shl    $0x2,%rax
  mov    %rax,0x38(%rsp)
  mov    0x1c(%rsp),%eax
  sub    $0x2,%eax
  mov    %eax,0xb4(%rsp)
  lea    0x8(%rbx),%rax
  mov    %rax,0xc0(%rsp)
  xchg   %ax,%ax
L4:
  mov    0x50(%rsp),%rax
  mov    0x70(%rsp),%rsi
  movss  0xb0(%rsp),%xmm4
  mov    %eax,%r11d
  mov    %eax,%ebx
  lea    0x1(%rax),%ecx
  movss  %xmm4,(%rsi)
  cmp    %ecx,0x1c(%rsp)
  jle    L504
  cmp    $0x1,%r14d
  jne    L349
  mov    0x90(%rsp),%r9
  mov    %rsi,%r8
  mov    0xb4(%rsp),%esi
  lea    0x4(%r8),%rdx
  mov    %r9,%rdi
  sub    %eax,%esi
  mov    %rdx,%rax
  neg    %rdi
  cmp    $0x8,%rdi
  jbe    L166
  cmp    $0x2,%esi
  jbe    L166
  mov    0x1c(%rsp),%edi
  lea    -0x1(%rdi),%esi
  mov    %r9,%rdi
  sub    %r11d,%esi
  mov    %esi,%edx
  shr    $0x2,%edx
  sub    $0x1,%edx
  shl    $0x4,%rdx
  lea    0x14(%r8,%rdx,1),%rdx
  nopl   (%rax)
L305:
  movups -0x4(%rax,%rdi,1),%xmm5
  add    $0x10,%rax
  movups %xmm5,-0x10(%rax)
  cmp    %rdx,%rax
  jne    L305
  mov    %esi,%eax
  and    $0xfffffffc,%eax
  add    %eax,%ecx
  cmp    %esi,%eax
  je     L504
  mov    0xb8(%rsp),%rdi
  lea    (%rbx,%rcx,1),%eax
  mov    0x70(%rsp),%rsi
  cltq
  mov    0x1c(%rsp),%r9d
  movss  (%rdi,%rax,4),%xmm0
  mov    %ecx,%eax
  sub    %ebx,%eax
  cltq
  movss  %xmm0,(%rsi,%rax,4)
  lea    0x1(%rcx),%eax
  cmp    %eax,%r9d
  jle    L504
  lea    (%rax,%rbx,1),%edx
  sub    %ebx,%eax
  add    $0x2,%ecx
  movslq %edx,%rdx
  cltq
  movss  (%rdi,%rdx,4),%xmm0
  movss  %xmm0,(%rsi,%rax,4)
  cmp    %ecx,%r9d
  jle    L504
  lea    (%rbx,%rcx,1),%eax
  sub    %ebx,%ecx
  cltq
  movss  (%rdi,%rax,4),%xmm0
  movslq %ecx,%rax
  movss  %xmm0,(%rsi,%rax,4)
L504:
  mov    0x28(%rsp),%rax
  mov    %eax,0x10(%rsp)
  mov    %eax,%r13d
  mov    0x1c(%rsp),%eax
  mov    %eax,%edi
  sub    %r11d,%edi
  mov    %edi,0x8(%rsp)
  mov    0x50(%rsp),%rdi
  mov    %edi,0x60(%rsp)
  cmp    %edi,%eax
  jle    L53
  movslq 0x84(%rsp),%rax
  mov    %rax,0x20(%rsp)
  cmp    %edi,%r14d
  jle    L300
  add    0x50(%rsp),%rax
  mov    %r10,%rdi
  mov    0x38(%rsp),%r9
  xor    %esi,%esi
  add    %r10,%rax
  not    %rdi
  lea    0x4(%rbp,%rax,4),%rcx
  mov    0x1c(%rsp),%eax
  shl    $0x2,%rdi
  lea    -0x1(%rax),%r8d
  lea    0x1(%r10),%rax
  mov    %rax,0x88(%rsp)
  sub    %r11d,%r8d
  nopl   0x0(%rax)
L454:
  lea    (%rdi,%rcx,1),%rax
  lea    (%r15,%rsi,4),%rdx
  nopl   0x0(%rax,%rax,1)
L510:
  movss  (%rax),%xmm0
  add    $0x4,%rax
  movss  %xmm0,(%rdx)
  add    %r12,%rdx
  cmp    %rcx,%rax
  jne    L510
  lea    0x1(%rsi),%rax
  add    %r9,%rcx
  cmp    %rsi,%r8
  je     L471
  mov    %rax,%rsi
  jmp    L454
  nopl   (%rax)
L369:
  movss  (%r11,%rcx,4),%xmm0
  movss  %xmm0,(%r10,%rcx,4)
  add    $0x1,%rcx
  cmp    %ecx,%r14d
  jg     L369
  jmp    L408
  nopw   0x0(%rax,%rax,1)
L376:
  xor    %eax,%eax
  jmp    L117
L300:
  lea    0x1(%r10),%rax
  mov    %rax,0x88(%rsp)
  nopl   0x0(%rax,%rax,1)
L471:
  mov    0x8(%rsp),%r8d
  mov    0x78(%rsp),%rdx
  mov    %r13d,%ecx
  mov    %r15,%rdi
  mov    0x70(%rsp),%rsi
  mov    $0x1,%r9d
  mov    %r11d,0x48(%rsp)
  mov    %r10,0x58(%rsp)
  call   <mmult@plt>
  mov    0xa8(%rsp),%r10
  mov    0x50(%rsp),%rax
  mov    %r13d,%esi
  mov    0x78(%rsp),%rdi
  mov    $0x1,%edx
  movss  (%r10,%rax,4),%xmm0
  call   <scale@plt>
  mov    0x8(%rsp),%ecx
  mov    %r13d,%r9d
  mov    %r15,%rdx
  mov    0x78(%rsp),%rsi
  mov    0x70(%rsp),%rdi
  mov    $0x1,%r8d
  call   <mmult@plt>
  mov    0x20(%rsp),%rdi
  mov    0x50(%rsp),%rax
  mov    %r15,%rcx
  mov    0x58(%rsp),%r10
  mov    0x48(%rsp),%r11d
  mov    %ebx,0x8(%rsp)
  mov    %rdi,%r13
  lea    0x0(%rbp,%rdi,4),%r8
  mov    %r12,0x98(%rsp)
  add    %rax,%r13
  neg    %rax
  shl    $0x2,%rax
  lea    0x0(%rbp,%r13,4),%r9
  mov    %rax,0x40(%rsp)
  sub    %r9,%rcx
  mov    $0x1,%eax
  cmp    %ebx,%r14d
  cmovg  0x10(%rsp),%eax
  cmp    0x60(%rsp),%r14d
  setle  %dl
  cmp    $0x2,%r10d
  mov    %eax,%edi
  mov    %eax,0x20(%rsp)
  setbe  %al
  xor    %r10d,%r10d
  or     %eax,%edx
  mov    %edi,%eax
  and    $0xfffffffc,%edi
  xor    %esi,%esi
  shr    $0x2,%eax
  add    %edi,%r11d
  mov    %dl,0x58(%rsp)
  lea    0x4(%r15),%rdx
  sub    $0x1,%eax
  mov    %r11d,0x80(%rsp)
  add    $0x1,%rax
  mov    %rdx,0x48(%rsp)
  shl    $0x4,%rax
  mov    %edi,0x64(%rsp)
  mov    0x84(%rsp),%edi
  mov    %rax,0x68(%rsp)
  nopl   0x0(%rax)
L287:
  mov    0x48(%rsp),%rdx
  lea    0x0(,%r10,4),%rax
  lea    (%rdx,%rax,1),%r11
  mov    %r9,%rdx
  sub    %r11,%rdx
  cmp    $0x8,%rdx
  jbe    L140
  cmp    0x60(%rsp),%r14d
  setg   %r11b
  cmpl   $0x1,0x10(%rsp)
  setne  %dl
  test   %dl,%r11b
  je     L140
  cmpb   $0x0,0x58(%rsp)
  jne    L576
  mov    0x68(%rsp),%rax
  lea    (%rax,%r9,1),%rdx
  mov    %r9,%rax
  nopw   0x0(%rax,%rax,1)
L568:
  movups (%rax),%xmm0
  movups (%rax,%rcx,1),%xmm7
  add    $0x10,%rax
  subps  %xmm7,%xmm0
  movups %xmm0,-0x10(%rax)
  cmp    %rax,%rdx
  jne    L568
  mov    0x64(%rsp),%eax
  cmp    %eax,0x20(%rsp)
  je     L444
  mov    %eax,%edx
  mov    0x80(%rsp),%eax
L595:
  mov    0x20(%rsp),%r11d
  sub    %edx,%r11d
  cmp    $0x1,%r11d
  je     L337
  lea    0x0(%r13,%rdx,1),%r12
  add    %r10,%rdx
  lea    0x0(%rbp,%r12,4),%r12
  movq   (%r15,%rdx,4),%xmm1
  mov    %r11d,%edx
  movq   (%r12),%xmm0
  and    $0xfffffffe,%edx
  add    %edx,%eax
  subps  %xmm1,%xmm0
  movlps %xmm0,(%r12)
  cmp    %edx,%r11d
  je     L444
L337:
  lea    (%rdi,%rax,1),%edx
  add    %esi,%eax
  movslq %edx,%rdx
  sub    %ebx,%eax
  lea    0x0(%rbp,%rdx,4),%rdx
  cltq
  movss  (%rdx),%xmm0
  subss  (%r15,%rax,4),%xmm0
  movss  %xmm0,(%rdx)
L444:
  mov    0x38(%rsp),%rdx
  addl   $0x1,0x8(%rsp)
  add    %r14d,%edi
  mov    0x8(%rsp),%eax
  add    0x10(%rsp),%esi
  add    %rdx,%r9
  add    %rdx,%r8
  add    0x40(%rsp),%rcx
  add    0x30(%rsp),%r13
  add    0x28(%rsp),%r10
  cmp    %eax,0x1c(%rsp)
  jne    L287
  mov    0x98(%rsp),%r12
L184:
  subq   $0x1,0x50(%rsp)
  add    $0x4,%r12
  mov    0x88(%rsp),%r10
  addq   $0x1,0x28(%rsp)
  sub    %r14d,0x84(%rsp)
  subq   $0x8,0x90(%rsp)
  cmp    0xa0(%rsp),%r10
  jne    L4
L386:
  mov    0xc8(%rsp),%rdi
  call   <free@plt>
  mov    0x70(%rsp),%rdi
  call   <free@plt>
  mov    %r15,%rdi
  call   <free@plt>
  mov    0x78(%rsp),%rdi
  add    $0xd8,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  jmp    1080 <free@plt>
  nopw   0x0(%rax,%rax,1)
L140:
  mov    0x50(%rsp),%rdx
  add    %r15,%rax
L58:
  movss  (%r8,%rdx,4),%xmm0
  subss  (%rax),%xmm0
  add    $0x4,%rax
  movss  %xmm0,(%r8,%rdx,4)
  add    $0x1,%rdx
  cmp    %edx,%r14d
  jg     L58
  jmp    L444
L576:
  mov    %ebx,%eax
  xor    %edx,%edx
  jmp    L595
L349:
  mov    0x84(%rsp),%eax
  mov    0xb8(%rsp),%rdi
  mov    0xb4(%rsp),%ecx
  add    %r14d,%eax
  cltq
  add    0x50(%rsp),%rax
  sub    %r11d,%ecx
  lea    (%rdi,%rax,4),%rdx
  mov    0xc0(%rsp),%rdi
  mov    %rsi,%rax
  mov    0x38(%rsp),%rsi
  add    $0x4,%rax
  lea    (%rdi,%rcx,4),%rcx
  nopw   0x0(%rax,%rax,1)
L605:
  movss  (%rdx),%xmm0
  add    $0x4,%rax
  add    %rsi,%rdx
  movss  %xmm0,-0x4(%rax)
  cmp    %rax,%rcx
  jne    L605
  jmp    L504
L166:
  mov    0xc0(%rsp),%rax
  lea    (%rax,%rsi,4),%rcx
  mov    0x90(%rsp),%rax
  sub    $0x4,%rax
  nopw   0x0(%rax,%rax,1)
L89:
  movss  (%rax,%rdx,1),%xmm0
  add    $0x4,%rdx
  movss  %xmm0,-0x4(%rdx)
  cmp    %rcx,%rdx
  jne    L89
  jmp    L504
L53:
  mov    0x78(%rsp),%rbx
  mov    0x10(%rsp),%ecx
  mov    %r15,%rdi
  mov    %r10,0x20(%rsp)
  mov    0x70(%rsp),%r13
  mov    0x8(%rsp),%r8d
  mov    $0x1,%r9d
  mov    %rbx,%rdx
  mov    %r13,%rsi
  call   <mmult@plt>
  mov    0x50(%rsp),%rdi
  mov    0x10(%rsp),%esi
  mov    $0x1,%edx
  mov    0xa8(%rsp),%rax
  movss  (%rax,%rdi,4),%xmm0
  mov    %rbx,%rdi
  call   <scale@plt>
  mov    0x28(%rsp),%r9d
  mov    %r15,%rdx
  mov    %rbx,%rsi
  mov    0x8(%rsp),%ecx
  mov    $0x1,%r8d
  mov    %r13,%rdi
  call   <mmult@plt>
  mov    0x20(%rsp),%r10
  lea    0x1(%r10),%rax
  mov    %rax,0x88(%rsp)
  jmp    L184
L195:
  xor    %esi,%esi
  jmp    L407
L342:
  xor    %eax,%eax
  jmp    L430
L438:
  mov    %r14d,%r11d
  movss  D6(%rip),%xmm3
  sub    $0x1,%r11d
  js     L386
  jmp    L38
```

tool_calls: name: parse_data
arguments: label: D56
type_guessed: byte[16]
name: parse_data
arguments: label: D39
type_guessed: byte[16]
name: parse_data
arguments: label: D4
type_guessed: f32[4]
name: parse_data
arguments: label: D6
type_guessed: f32[4]

tool: {"D56": [0x04,0x00,0x00,0x00,0x04,0x00,0x00,0x00,0x04,0x00,0x00,0x00,0x04,0x00,0x00,0x00]}

tool: {"D39": [0x01,0x00,0x00,0x00,0x01,0x00,0x00,0x00,0x01,0x00,0x00,0x00,0x01,0x00,0x00,0x00]}

tool: {"D4": [0.0,1.401298464324817e-45,2.802596928649634e-45,4.203895392974451e-45]}

tool: {"D6": [1.0,1.0,1.0,1.0]}

assistant: ```c
void getQR(float *A, int M, int N, float *bvec, float *Q, float *R) {
  int i, j, k, t, u;
  float *x, *v, *AT, *w;
  x = (float *)malloc(sizeof(float) * M);
  v = (float *)malloc(sizeof(float) * M);
  AT = (float *)malloc(sizeof(float) * M * N);
  w = (float *)malloc(sizeof(float) * 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);
}
```