user: Demonstrate the C code that generates the assembly output below:

```asm
<matprod_mat_vec_n3>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x40,%rsp
  mov    %rdi,-0x28(%rbp)
  mov    %rsi,-0x30(%rbp)
  mov    %rdx,-0x38(%rbp)
  mov    %ecx,-0x3c(%rbp)
  mov    %r8d,-0x40(%rbp)
  mov    %fs:0x28,%rax
  mov    %rax,-0x8(%rbp)
  xor    %eax,%eax
  mov    $0x1,%edi
  call   <assert@plt>
  mov    $0x1,%edi
  call   <assert@plt>
  mov    $0x1,%edi
  call   <assert@plt>
  cmpl   $0x0,-0x40(%rbp)
  je     L18
  mov    -0x38(%rbp),%rax
  movsd  (%rax),%xmm0
  movsd  %xmm0,-0x20(%rbp)
  mov    -0x38(%rbp),%rax
  movsd  0x8(%rax),%xmm0
  movsd  %xmm0,-0x18(%rbp)
  mov    -0x38(%rbp),%rax
  movsd  0x10(%rax),%xmm0
  movsd  %xmm0,-0x10(%rbp)
  jmp    L59
L18:
  pxor   %xmm0,%xmm0
  movsd  %xmm0,-0x10(%rbp)
  movsd  -0x10(%rbp),%xmm0
  movsd  %xmm0,-0x18(%rbp)
  movsd  -0x18(%rbp),%xmm0
  movsd  %xmm0,-0x20(%rbp)
  jmp    L59
L43:
  movsd  -0x20(%rbp),%xmm1
  mov    -0x28(%rbp),%rax
  movsd  (%rax),%xmm2
  mov    -0x30(%rbp),%rax
  movsd  (%rax),%xmm0
  mulsd  %xmm2,%xmm0
  addsd  %xmm0,%xmm1
  mov    -0x28(%rbp),%rax
  add    $0x18,%rax
  movsd  (%rax),%xmm2
  mov    -0x30(%rbp),%rax
  add    $0x8,%rax
  movsd  (%rax),%xmm0
  mulsd  %xmm2,%xmm0
  addsd  %xmm1,%xmm0
  movsd  %xmm0,-0x20(%rbp)
  movsd  -0x18(%rbp),%xmm1
  mov    -0x28(%rbp),%rax
  add    $0x8,%rax
  movsd  (%rax),%xmm2
  mov    -0x30(%rbp),%rax
  movsd  (%rax),%xmm0
  mulsd  %xmm2,%xmm0
  addsd  %xmm0,%xmm1
  mov    -0x28(%rbp),%rax
  add    $0x20,%rax
  movsd  (%rax),%xmm2
  mov    -0x30(%rbp),%rax
  add    $0x8,%rax
  movsd  (%rax),%xmm0
  mulsd  %xmm2,%xmm0
  addsd  %xmm1,%xmm0
  movsd  %xmm0,-0x18(%rbp)
  movsd  -0x10(%rbp),%xmm1
  mov    -0x28(%rbp),%rax
  add    $0x10,%rax
  movsd  (%rax),%xmm2
  mov    -0x30(%rbp),%rax
  movsd  (%rax),%xmm0
  mulsd  %xmm2,%xmm0
  addsd  %xmm0,%xmm1
  mov    -0x28(%rbp),%rax
  add    $0x28,%rax
  movsd  (%rax),%xmm2
  mov    -0x30(%rbp),%rax
  add    $0x8,%rax
  movsd  (%rax),%xmm0
  mulsd  %xmm2,%xmm0
  addsd  %xmm1,%xmm0
  movsd  %xmm0,-0x10(%rbp)
  addq   $0x30,-0x28(%rbp)
  addq   $0x10,-0x30(%rbp)
  subl   $0x2,-0x3c(%rbp)
L59:
  cmpl   $0x1,-0x3c(%rbp)
  jg     L43
  cmpl   $0x0,-0x3c(%rbp)
  jle    L14
  movsd  -0x20(%rbp),%xmm1
  mov    -0x28(%rbp),%rax
  movsd  (%rax),%xmm2
  mov    -0x30(%rbp),%rax
  movsd  (%rax),%xmm0
  mulsd  %xmm2,%xmm0
  addsd  %xmm1,%xmm0
  movsd  %xmm0,-0x20(%rbp)
  movsd  -0x18(%rbp),%xmm1
  mov    -0x28(%rbp),%rax
  add    $0x8,%rax
  movsd  (%rax),%xmm2
  mov    -0x30(%rbp),%rax
  movsd  (%rax),%xmm0
  mulsd  %xmm2,%xmm0
  addsd  %xmm1,%xmm0
  movsd  %xmm0,-0x18(%rbp)
  movsd  -0x10(%rbp),%xmm1
  mov    -0x28(%rbp),%rax
  add    $0x10,%rax
  movsd  (%rax),%xmm2
  mov    -0x30(%rbp),%rax
  movsd  (%rax),%xmm0
  mulsd  %xmm2,%xmm0
  addsd  %xmm1,%xmm0
  movsd  %xmm0,-0x10(%rbp)
L14:
  movsd  -0x20(%rbp),%xmm0
  mov    -0x38(%rbp),%rax
  movsd  %xmm0,(%rax)
  mov    -0x38(%rbp),%rax
  add    $0x8,%rax
  movsd  -0x18(%rbp),%xmm0
  movsd  %xmm0,(%rax)
  mov    -0x38(%rbp),%rax
  add    $0x10,%rax
  movsd  -0x10(%rbp),%xmm0
  movsd  %xmm0,(%rax)
  nop
  mov    -0x8(%rbp),%rax
  sub    %fs:0x28,%rax
  je     L4
  call   <__stack_chk_fail@plt>
L4:
  leave
  ret
```

assistant: ```c
void matprod_mat_vec_n3(double *restrict x, double *restrict y, double *restrict z, int k, int add) {
  assert(((uintptr_t)(x) & (1 - 1)) == 0);
  assert(((uintptr_t)(y) & (1 - 1)) == 0);
  assert(((uintptr_t)(z) & (1 - 1)) == 0);
  x = (x);
  y = (y);
  z = (z);
  {
    double s[3];
    if (add) {
      s[0] = z[0];
      s[1] = z[1];
      s[2] = z[2];
    } else
      s[0] = s[1] = s[2] = 0;
    while (k > 1) {
      s[0] = (s[0] + (x[0] * y[0])) + (x[3] * y[1]);
      s[1] = (s[1] + (x[1] * y[0])) + (x[4] * y[1]);
      s[2] = (s[2] + (x[2] * y[0])) + (x[5] * y[1]);
      x += 6;
      y += 2;
      k -= 2;
    }
    if (k >= 1) {
      s[0] += x[0] * y[0];
      s[1] += x[1] * y[0];
      s[2] += x[2] * y[0];
    }
    z[0] = s[0];
    z[1] = s[1];
    z[2] = s[2];
  }
}
```