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

```asm
<main>:
  endbr64
  push   %r13
  lea    D48(%rip),%rdi
  push   %r12
  push   %rbp
  sub    $0x10,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,0x8(%rsp)
  xor    %eax,%eax
  call   <printf@plt>
  lea    0x4(%rsp),%rdx
  mov    %rsp,%rsi
  lea    D58(%rip),%rdi
  call   <scanf@plt>
  mov    $0xa,%edi
  call   <putchar@plt>
  mov    (%rsp),%eax
  lea    0x0(,%rax,8),%edi
  call   <malloc@plt>
  mov    %rax,%rbp
  test   %rax,%rax
  je     L92
L82:
  mov    (%rsp),%edi
  imul   0x4(%rsp),%edi
  shl    $0x3,%edi
  call   <malloc@plt>
  mov    %rax,%r12
  test   %rax,%rax
  je     L122
L40:
  mov    0x4(%rsp),%eax
  lea    0x0(,%rax,8),%edi
  call   <malloc@plt>
  mov    %rax,%r13
  test   %rax,%rax
  je     L49
L30:
  lea    D3(%rip),%rdi
  call   <puts@plt>
  mov    0x4(%rsp),%r8d
  test   %r8d,%r8d
  jle    L18
  mov    %r8d,%edx
  movsd  D12(%rip),%xmm0
  mov    %r13,%rax
  lea    0x0(%r13,%rdx,8),%rdx
  nopl   0x0(%rax,%rax,1)
L12:
  movsd  %xmm0,(%rax)
  add    $0x8,%rax
  cmp    %rax,%rdx
  jne    L12
L18:
  mov    (%rsp),%r9d
  test   %r9d,%r9d
  jle    L62
  xor    %esi,%esi
  lea    -0x1(%r8),%r10d
  lea    0x8(%r12),%rdi
  xor    %ecx,%ecx
  nopl   0x0(%rax,%rax,1)
L65:
  test   %r8d,%r8d
  jle    L17
  pxor   %xmm0,%xmm0
  movslq %esi,%rdx
  cvtsi2sd %ecx,%xmm0
  lea    (%r12,%rdx,8),%rax
  add    %r10,%rdx
  lea    (%rdi,%rdx,8),%rdx
  nopl   0x0(%rax,%rax,1)
L11:
  movsd  %xmm0,(%rax)
  add    $0x8,%rax
  cmp    %rax,%rdx
  jne    L11
L17:
  add    $0x1,%ecx
  add    %r8d,%esi
  cmp    %r9d,%ecx
  jne    L65
L62:
  mov    %r9d,%esi
  mov    %r8d,%edx
  lea    D23(%rip),%rdi
  xor    %eax,%eax
  call   <printf@plt>
  mov    0x4(%rsp),%esi
  mov    (%rsp),%edi
  mov    %r13,%r8
  mov    %r12,%rcx
  mov    %rbp,%rdx
  call   <mxv@plt>
  mov    %rbp,%rdi
  call   <free@plt>
  mov    %r12,%rdi
  call   <free@plt>
  mov    %r13,%rdi
  call   <free@plt>
  mov    0x8(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L37
  add    $0x10,%rsp
  xor    %eax,%eax
  pop    %rbp
  pop    %r12
  pop    %r13
  ret
L92:
  lea    D60(%rip),%rdi
  call   <perror@plt>
  jmp    L82
L49:
  lea    D17(%rip),%rdi
  call   <perror@plt>
  jmp    L30
L122:
  lea    D43(%rip),%rdi
  call   <perror@plt>
  jmp    L40
L37:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: parse_data
arguments: data_label: D48
type_guessed: string
name: parse_data
arguments: data_label: D58
type_guessed: string
name: parse_data
arguments: data_label: D3
type_guessed: string
name: parse_data
arguments: data_label: D12
type_guessed: f64
name: parse_data
arguments: data_label: D23
type_guessed: string
name: parse_data
arguments: data_label: D60
type_guessed: string
name: parse_data
arguments: data_label: D17
type_guessed: string
name: parse_data
arguments: data_label: D43
type_guessed: string

tool: D48: Please give m and n: 

tool: D58: %d %d

tool: D3: Initializing matrix B and vector c

tool: D12: 2

tool: D23: Executing mxv function for m = %d n = %d


tool: D60: memory allocation for a

tool: D17: memory allocation for c

tool: D43: memory allocation for b

assistant: ```c
int main(int argc, char *argv[]) {
  double *a, *b, *c;
  int i, j, m, n;
  printf("Please give m and n: ");
  scanf("%d %d", &m, &n);
  printf("\n");
  if ((a = (double *)malloc(m * sizeof(double))) == NULL)
    perror("memory allocation for a");
  if ((b = (double *)malloc(m * n * sizeof(double))) == NULL)
    perror("memory allocation for b");
  if ((c = (double *)malloc(n * sizeof(double))) == NULL)
    perror("memory allocation for c");
  printf("Initializing matrix B and vector c\n");
  for (j = 0; j < n; j++)
    c[j] = 2.0;
  for (i = 0; i < m; i++)
    for (j = 0; j < n; j++)
      b[i * n + j] = i;
  printf("Executing mxv function for m = %d n = %d\n", m, n);
  (void)mxv(m, n, a, b, c);
  free(a);
  free(b);
  free(c);
  return (0);
}
```