user: 请将这段汇编代码片段转换成等效的C代码:

```asm
<main>:
  endbr64
  push   %r13
  lea    D47(%rip),%rdi
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x18,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,0x8(%rsp)
  xor    %eax,%eax
  call   <printf@plt>
  lea    0x4(%rsp),%rdx
  mov    %rsp,%rsi
  lea    D82(%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     L154
L127:
  mov    (%rsp),%edi
  imul   0x4(%rsp),%edi
  shl    $0x3,%edi
  call   <malloc@plt>
  mov    %rax,%r12
  test   %rax,%rax
  je     L80
L133:
  mov    0x4(%rsp),%eax
  lea    0x0(,%rax,8),%edi
  call   <malloc@plt>
  mov    %rax,%r13
  test   %rax,%rax
  je     L23
L106:
  lea    D16(%rip),%rdi
  call   <puts@plt>
  mov    0x4(%rsp),%r9d
  test   %r9d,%r9d
  jle    L137
  cmp    $0x1,%r9d
  je     L10
  mov    %r9d,%edx
  movapd D45(%rip),%xmm0
  mov    %r13,%rax
  shr    %edx
  shl    $0x4,%rdx
  add    %r13,%rdx
  cs nopw 0x0(%rax,%rax,1)
L120:
  movups %xmm0,(%rax)
  add    $0x10,%rax
  cmp    %rax,%rdx
  jne    L120
  mov    %r9d,%eax
  and    $0xfffffffe,%eax
  test   $0x1,%r9b
  je     L51
L117:
  mov    D45(%rip),%rcx
  cltq
  mov    %rcx,0x0(%r13,%rax,8)
L51:
  mov    (%rsp),%r10d
  test   %r10d,%r10d
  jle    L37
  mov    %r9d,%eax
  movslq %r9d,%r11
  mov    %r9d,%edi
  mov    %r12,%rsi
  shr    %eax
  shl    $0x3,%r11
  and    $0xfffffffe,%edi
  xor    %edx,%edx
  lea    -0x1(%rax),%r8d
  xor    %ecx,%ecx
  add    $0x1,%r8
  shl    $0x4,%r8
  nopl   0x0(%rax)
L146:
  pxor   %xmm0,%xmm0
  cvtsi2sd %ecx,%xmm0
  cmp    $0x1,%r9d
  je     L122
  movapd %xmm0,%xmm1
  lea    (%r8,%rsi,1),%rbx
  mov    %rsi,%rax
  unpcklpd %xmm1,%xmm1
  nopl   0x0(%rax)
L181:
  movups %xmm1,(%rax)
  add    $0x10,%rax
  cmp    %rax,%rbx
  jne    L181
  mov    %edi,%eax
  cmp    %edi,%r9d
  je     L161
L141:
  add    %edx,%eax
  cltq
  movsd  %xmm0,(%r12,%rax,8)
L161:
  add    $0x1,%ecx
  add    %r9d,%edx
  add    %r11,%rsi
  cmp    %r10d,%ecx
  jne    L146
L37:
  mov    %r9d,%edx
  mov    %r10d,%esi
  lea    D18(%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    L59
  add    $0x18,%rsp
  xor    %eax,%eax
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  ret
L122:
  xor    %eax,%eax
  jmp    L141
L154:
  lea    D53(%rip),%rdi
  call   <perror@plt>
  jmp    L127
L23:
  lea    D87(%rip),%rdi
  call   <perror@plt>
  jmp    L106
L80:
  lea    D69(%rip),%rdi
  call   <perror@plt>
  jmp    L133
L137:
  mov    (%rsp),%r10d
  jmp    L37
L10:
  xor    %eax,%eax
  jmp    L117
L59:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: disassemble_data
arguments: data_label: D47
datatype: string
name: disassemble_data
arguments: data_label: D82
datatype: string
name: disassemble_data
arguments: data_label: D16
datatype: string
name: disassemble_data
arguments: data_label: D45
datatype: f64[2]
name: disassemble_data
arguments: data_label: D18
datatype: string
name: disassemble_data
arguments: data_label: D53
datatype: string
name: disassemble_data
arguments: data_label: D87
datatype: string
name: disassemble_data
arguments: data_label: D69
datatype: string

tool: D47: Please give m and n: 

tool: D82: %d %d

tool: D16: Initializing matrix B and vector c

tool: {"D45": [2.0,2.0]}

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


tool: D53: memory allocation for a

tool: D87: memory allocation for c

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