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

```asm
<vec_mat_vec_mult_2d>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  mov    %edi,-0x24(%rbp)
  mov    %esi,-0x28(%rbp)
  mov    %rdx,-0x30(%rbp)
  pxor   %xmm0,%xmm0
  movsd  %xmm0,-0x8(%rbp)
  movl   $0x0,-0x14(%rbp)
  jmp    L37
L55:
  movl   $0x0,-0x10(%rbp)
  jmp    L34
L33:
  mov    -0x14(%rbp),%eax
  imul   -0x28(%rbp),%eax
  mov    %eax,%edx
  mov    -0x10(%rbp),%eax
  add    %edx,%eax
  mov    %eax,-0xc(%rbp)
  mov    -0xc(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x30(%rbp),%rax
  add    %rdx,%rax
  movsd  (%rax),%xmm1
  movsd  D6(%rip),%xmm0
  mulsd  %xmm0,%xmm1
  mov    -0xc(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x30(%rbp),%rax
  add    %rdx,%rax
  movsd  (%rax),%xmm0
  mulsd  %xmm1,%xmm0
  movsd  -0x8(%rbp),%xmm1
  addsd  %xmm1,%xmm0
  movsd  %xmm0,-0x8(%rbp)
  cmpl   $0x0,-0x14(%rbp)
  jle    L52
  mov    -0xc(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x30(%rbp),%rax
  add    %rdx,%rax
  movsd  (%rax),%xmm0
  movq   D41(%rip),%xmm1
  xorpd  %xmm0,%xmm1
  mov    -0xc(%rbp),%eax
  sub    -0x28(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x30(%rbp),%rax
  add    %rdx,%rax
  movsd  (%rax),%xmm0
  mulsd  %xmm1,%xmm0
  movsd  -0x8(%rbp),%xmm1
  addsd  %xmm1,%xmm0
  movsd  %xmm0,-0x8(%rbp)
L52:
  mov    -0x28(%rbp),%eax
  sub    $0x1,%eax
  cmp    %eax,-0x14(%rbp)
  jge    L22
  mov    -0xc(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x30(%rbp),%rax
  add    %rdx,%rax
  movsd  (%rax),%xmm0
  movq   D41(%rip),%xmm1
  xorpd  %xmm0,%xmm1
  mov    -0xc(%rbp),%edx
  mov    -0x28(%rbp),%eax
  add    %edx,%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x30(%rbp),%rax
  add    %rdx,%rax
  movsd  (%rax),%xmm0
  mulsd  %xmm1,%xmm0
  movsd  -0x8(%rbp),%xmm1
  addsd  %xmm1,%xmm0
  movsd  %xmm0,-0x8(%rbp)
L22:
  cmpl   $0x0,-0x10(%rbp)
  jle    L48
  mov    -0xc(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x30(%rbp),%rax
  add    %rdx,%rax
  movsd  (%rax),%xmm0
  movq   D41(%rip),%xmm1
  xorpd  %xmm0,%xmm1
  mov    -0xc(%rbp),%eax
  cltq
  shl    $0x3,%rax
  lea    -0x8(%rax),%rdx
  mov    -0x30(%rbp),%rax
  add    %rdx,%rax
  movsd  (%rax),%xmm0
  mulsd  %xmm1,%xmm0
  movsd  -0x8(%rbp),%xmm1
  addsd  %xmm1,%xmm0
  movsd  %xmm0,-0x8(%rbp)
L48:
  mov    -0x28(%rbp),%eax
  sub    $0x1,%eax
  cmp    %eax,-0x10(%rbp)
  jge    L4
  mov    -0xc(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x30(%rbp),%rax
  add    %rdx,%rax
  movsd  (%rax),%xmm0
  movq   D41(%rip),%xmm1
  xorpd  %xmm0,%xmm1
  mov    -0xc(%rbp),%eax
  cltq
  add    $0x1,%rax
  lea    0x0(,%rax,8),%rdx
  mov    -0x30(%rbp),%rax
  add    %rdx,%rax
  movsd  (%rax),%xmm0
  mulsd  %xmm1,%xmm0
  movsd  -0x8(%rbp),%xmm1
  addsd  %xmm1,%xmm0
  movsd  %xmm0,-0x8(%rbp)
L4:
  addl   $0x1,-0x10(%rbp)
L34:
  mov    -0x10(%rbp),%eax
  cmp    -0x28(%rbp),%eax
  jl     L33
  addl   $0x1,-0x14(%rbp)
L37:
  mov    -0x14(%rbp),%eax
  cmp    -0x28(%rbp),%eax
  jl     L55
  movsd  -0x8(%rbp),%xmm0
  movq   %xmm0,%rax
  movq   %rax,%xmm0
  pop    %rbp
  ret
```

tool_calls: name: unpack_data
arguments: data_label: D6
datatype: f64
name: unpack_data
arguments: data_label: D41
datatype: f32[2]

tool: D6: 4

tool: {"D41": [0.0,-0.0]}

assistant: ```c
double vec_mat_vec_mult_2d(int unused, int lin_size, double *x) {
  double sum = 0.0;
  for (int grid_row = 0; grid_row < lin_size; grid_row++) {
    for (int grid_col = 0; grid_col < lin_size; grid_col++) {
      int index = grid_row * lin_size + grid_col;
      sum += x[index] * (4.0) * x[index];
      if (0 < grid_row)
        sum += x[index] * (-1.0) * x[index - lin_size];
      if (grid_row < lin_size - 1)
        sum += x[index] * (-1.0) * x[index + lin_size];
      if (0 < grid_col)
        sum += x[index] * (-1.0) * x[index - 1];
      if (grid_col < lin_size - 1)
        sum += x[index] * (-1.0) * x[index + 1];
    }
  }
  return sum;
}
```