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

```asm
<blur_matrix>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x50,%rsp
  mov    %rdi,-0x38(%rbp)
  mov    %rsi,-0x40(%rbp)
  mov    %edx,-0x44(%rbp)
  mov    %ecx,-0x48(%rbp)
  mov    %fs:0x28,%rax
  mov    %rax,-0x8(%rbp)
  xor    %eax,%eax
  movsd  D3(%rip),%xmm0
  movsd  %xmm0,-0x20(%rbp)
  movsd  D16(%rip),%xmm0
  movsd  %xmm0,-0x18(%rbp)
  movsd  D26(%rip),%xmm0
  movsd  %xmm0,-0x10(%rbp)
  mov    -0x38(%rbp),%rax
  cmp    -0x40(%rbp),%rax
  jne    L66
  mov    -0x48(%rbp),%edx
  mov    -0x44(%rbp),%eax
  mov    %edx,%esi
  mov    %eax,%edi
  call   <new_matrix2@plt>
  jmp    L31
L66:
  mov    -0x38(%rbp),%rax
L31:
  mov    %rax,-0x28(%rbp)
  mov    -0x44(%rbp),%eax
  imul   -0x48(%rbp),%eax
  cltq
  shl    $0x3,%eax
  mov    %eax,%edx
  mov    -0x40(%rbp),%rax
  mov    (%rax),%rcx
  mov    -0x28(%rbp),%rax
  mov    (%rax),%rax
  mov    %rcx,%rsi
  mov    %rax,%rdi
  call   <memcpy@plt>
  movl   $0x1,-0x30(%rbp)
  jmp    L5
L13:
  movl   $0x1,-0x2c(%rbp)
  jmp    L43
L56:
  movsd  -0x20(%rbp),%xmm1
  mov    -0x30(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x40(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%rdx
  mov    -0x2c(%rbp),%eax
  cltq
  shl    $0x3,%rax
  add    %rdx,%rax
  movsd  (%rax),%xmm0
  mulsd  %xmm0,%xmm1
  movsd  -0x18(%rbp),%xmm2
  mov    -0x30(%rbp),%eax
  cltq
  add    $0x1,%rax
  lea    0x0(,%rax,8),%rdx
  mov    -0x40(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%rdx
  mov    -0x2c(%rbp),%eax
  cltq
  shl    $0x3,%rax
  add    %rdx,%rax
  movsd  (%rax),%xmm3
  mov    -0x30(%rbp),%eax
  cltq
  shl    $0x3,%rax
  lea    -0x8(%rax),%rdx
  mov    -0x40(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%rdx
  mov    -0x2c(%rbp),%eax
  cltq
  shl    $0x3,%rax
  add    %rdx,%rax
  movsd  (%rax),%xmm0
  addsd  %xmm0,%xmm3
  mov    -0x30(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x40(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%rdx
  mov    -0x2c(%rbp),%eax
  cltq
  add    $0x1,%rax
  shl    $0x3,%rax
  add    %rdx,%rax
  movsd  (%rax),%xmm0
  addsd  %xmm0,%xmm3
  mov    -0x30(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x40(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%rdx
  mov    -0x2c(%rbp),%eax
  cltq
  shl    $0x3,%rax
  sub    $0x8,%rax
  add    %rdx,%rax
  movsd  (%rax),%xmm0
  addsd  %xmm3,%xmm0
  mulsd  %xmm2,%xmm0
  addsd  %xmm0,%xmm1
  movsd  -0x10(%rbp),%xmm2
  mov    -0x30(%rbp),%eax
  cltq
  add    $0x1,%rax
  lea    0x0(,%rax,8),%rdx
  mov    -0x40(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%rdx
  mov    -0x2c(%rbp),%eax
  cltq
  add    $0x1,%rax
  shl    $0x3,%rax
  add    %rdx,%rax
  movsd  (%rax),%xmm3
  mov    -0x30(%rbp),%eax
  cltq
  add    $0x1,%rax
  lea    0x0(,%rax,8),%rdx
  mov    -0x40(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%rdx
  mov    -0x2c(%rbp),%eax
  cltq
  shl    $0x3,%rax
  sub    $0x8,%rax
  add    %rdx,%rax
  movsd  (%rax),%xmm0
  addsd  %xmm0,%xmm3
  mov    -0x30(%rbp),%eax
  cltq
  shl    $0x3,%rax
  lea    -0x8(%rax),%rdx
  mov    -0x40(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%rdx
  mov    -0x2c(%rbp),%eax
  cltq
  add    $0x1,%rax
  shl    $0x3,%rax
  add    %rdx,%rax
  movsd  (%rax),%xmm0
  addsd  %xmm0,%xmm3
  mov    -0x30(%rbp),%eax
  cltq
  shl    $0x3,%rax
  lea    -0x8(%rax),%rdx
  mov    -0x40(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%rdx
  mov    -0x2c(%rbp),%eax
  cltq
  shl    $0x3,%rax
  sub    $0x8,%rax
  add    %rdx,%rax
  movsd  (%rax),%xmm0
  addsd  %xmm3,%xmm0
  mulsd  %xmm2,%xmm0
  mov    -0x30(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x28(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%rdx
  mov    -0x2c(%rbp),%eax
  cltq
  shl    $0x3,%rax
  add    %rdx,%rax
  addsd  %xmm1,%xmm0
  movsd  %xmm0,(%rax)
  addl   $0x1,-0x2c(%rbp)
L43:
  mov    -0x48(%rbp),%eax
  sub    $0x1,%eax
  cmp    %eax,-0x2c(%rbp)
  jl     L56
  addl   $0x1,-0x30(%rbp)
L5:
  mov    -0x44(%rbp),%eax
  sub    $0x1,%eax
  cmp    %eax,-0x30(%rbp)
  jl     L13
  mov    -0x38(%rbp),%rax
  cmp    -0x40(%rbp),%rax
  jne    L49
  mov    -0x44(%rbp),%eax
  imul   -0x48(%rbp),%eax
  cltq
  shl    $0x3,%eax
  mov    %eax,%edx
  mov    -0x28(%rbp),%rax
  mov    (%rax),%rcx
  mov    -0x38(%rbp),%rax
  mov    (%rax),%rax
  mov    %rcx,%rsi
  mov    %rax,%rdi
  call   <memcpy@plt>
  mov    -0x28(%rbp),%rax
  mov    %rax,%rdi
  call   <free_matrix2@plt>
L49:
  nop
  mov    -0x8(%rbp),%rax
  sub    %fs:0x28,%rax
  je     L55
  call   <__stack_chk_fail@plt>
L55:
  leave
  ret
```

tool_calls: name: read_data
arguments: data_tag: D3
datatype: byte[8]
name: read_data
arguments: data_tag: D16
datatype: byte[8]
name: read_data
arguments: data_tag: D26
datatype: byte[8]

tool: {"D3": [0xa8,0x35,0xcd,0x3b,0x4e,0xd1,0xe3,0x3f]}

tool: {"D16": [0xf9,0xa0,0x67,0xb3,0xea,0x73,0xb5,0x3f]}

tool: {"D26": [0x4d,0xf3,0x8e,0x53,0x74,0x24,0x87,0x3f]}

assistant: ```c
void blur_matrix(double **dst, double **src, int n, int m) {
  double G[3] = {.6193, .0838, .0113};
  double **I = (dst == src ? new_matrix2(n, m) : dst);
  memcpy(I[0], src[0], n * m * sizeof(double));
  int i, j;
  for (i = 1; i < n - 1; i++)
    for (j = 1; j < m - 1; j++)
      I[i][j] = G[0] * src[i][j] + G[1] * (src[i + 1][j] + src[i - 1][j] + src[i][j + 1] + src[i][j - 1]) + G[2] * (src[i + 1][j + 1] + src[i + 1][j - 1] + src[i - 1][j + 1] + src[i - 1][j - 1]);
  if (dst == src) {
    memcpy(dst[0], I[0], n * m * sizeof(double));
    free_matrix2(I);
  }
}
```