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

```asm
<fmprint>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x28,%rsp
  mov    %rdi,0x8(%rsp)
  mov    %esi,0x10(%rsp)
  mov    %edx,%r14d
  mov    %rcx,%rbp
  mov    $0x4,%edx
  mov    $0x1,%esi
  lea    D43(%rip),%rdi
  call   <fwrite@plt>
  test   %r14d,%r14d
  jle    L30
  mov    $0x0,%ebx
  lea    D87(%rip),%r12
L70:
  mov    %rbp,%rcx
  mov    $0xf,%edx
  mov    $0x1,%esi
  mov    %r12,%rdi
  call   <fwrite@plt>
  add    $0x1,%ebx
  cmp    %ebx,%r14d
  jne    L70
  mov    %rbp,%rsi
  mov    $0xa,%edi
  call   <fputc@plt>
  cmpl   $0x0,0x10(%rsp)
  jle    L109
L98:
  movl   $0x0,0x4(%rsp)
  mov    $0x0,%r15d
  lea    -0x1(%r14),%eax
  mov    %eax,0x14(%rsp)
  mov    0x8(%rsp),%rax
  add    $0x8,%rax
  mov    %rax,0x18(%rsp)
  lea    D30(%rip),%r13
L84:
  mov    %rbp,%rcx
  mov    $0x3,%edx
  mov    $0x1,%esi
  lea    D49(%rip),%rdi
  call   <fwrite@plt>
  test   %r14d,%r14d
  jle    L46
  movslq 0x4(%rsp),%rdx
  mov    0x8(%rsp),%rax
  lea    (%rax,%rdx,8),%rbx
  mov    0x14(%rsp),%eax
  add    %rdx,%rax
  mov    0x18(%rsp),%rcx
  lea    (%rcx,%rax,8),%r12
L79:
  movsd  (%rbx),%xmm0
  mov    %r13,%rsi
  mov    %rbp,%rdi
  mov    $0x1,%eax
  call   <fprintf@plt>
  add    $0x8,%rbx
  cmp    %r12,%rbx
  jne    L79
L46:
  mov    %rbp,%rsi
  mov    $0xa,%edi
  call   <fputc@plt>
  add    $0x1,%r15d
  add    %r14d,0x4(%rsp)
  cmp    %r15d,0x10(%rsp)
  jg     L84
  mov    %rbp,%rcx
  mov    $0x3,%edx
  mov    $0x1,%esi
  lea    D46(%rip),%rdi
  call   <fwrite@plt>
  test   %r14d,%r14d
  jle    L80
L14:
  mov    $0x0,%ebx
  lea    D87(%rip),%r12
L28:
  mov    %rbp,%rcx
  mov    $0xf,%edx
  mov    $0x1,%esi
  mov    %r12,%rdi
  call   <fwrite@plt>
  add    $0x1,%ebx
  cmp    %ebx,%r14d
  jne    L28
L80:
  mov    %rbp,%rcx
  mov    $0x2,%edx
  mov    $0x1,%esi
  lea    D23(%rip),%rdi
  call   <fwrite@plt>
  add    $0x28,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
L30:
  mov    %rbp,%rsi
  mov    $0xa,%edi
  call   <fputc@plt>
  cmpl   $0x0,0x10(%rsp)
  jg     L98
  mov    %rbp,%rcx
  mov    $0x3,%edx
  mov    $0x1,%esi
  lea    D46(%rip),%rdi
  call   <fwrite@plt>
  jmp    L80
L109:
  mov    %rbp,%rcx
  mov    $0x3,%edx
  mov    $0x1,%esi
  lea    D46(%rip),%rdi
  call   <fwrite@plt>
  jmp    L14
```

tool_calls: name: extract_symbolic_data
arguments: tag: D43
type: string
name: extract_symbolic_data
arguments: tag: D87
type: string
name: extract_symbolic_data
arguments: tag: D30
type: string
name: extract_symbolic_data
arguments: tag: D49
type: string
name: extract_symbolic_data
arguments: tag: D46
type: string
name: extract_symbolic_data
arguments: tag: D23
type: string

tool: D43: 
  +

tool: D87: --------------+

tool: D30:  %12.4f |

tool: D49:   |

tool: D46:   +

tool: D23: 



assistant: ```c
void fmprint(double *matrix, int nrows, int ncols, FILE *file) {
  int i, j;
  fprintf(file, "\n  +");
  for (i = 0; i < ncols; i++) {
    fprintf(file, "--------------+");
  }
  fputs("\n", file);
  for (i = 0; i < nrows; i++) {
    fprintf(file, "  |");
    for (j = 0; j < ncols; j++) {
      fprintf(file, " %12.4f |", matrix[((i) * (ncols) + (j))]);
    }
    fputs("\n", file);
  }
  fprintf(file, "  +");
  for (i = 0; i < ncols; i++) {
    fprintf(file, "--------------+");
  }
  fputs("\n\n", file);
}
```