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

```asm
<fmprint>:
  endbr64
  push   %r15
  mov    %rcx,%r15
  push   %r14
  push   %r13
  push   %r12
  mov    %edx,%r12d
  mov    $0x4,%edx
  push   %rbp
  push   %rbx
  sub    $0x18,%rsp
  mov    %rdi,0x8(%rsp)
  lea    D8(%rip),%rdi
  mov    %esi,0x4(%rsp)
  mov    $0x1,%esi
  call   <fwrite@plt>
  test   %r12d,%r12d
  jle    L85
  xor    %ebx,%ebx
  lea    D46(%rip),%rbp
  nopl   0x0(%rax)
L82:
  mov    %r15,%rcx
  mov    $0xf,%edx
  mov    $0x1,%esi
  mov    %rbp,%rdi
  call   <fwrite@plt>
  add    $0x1,%ebx
  cmp    %ebx,%r12d
  jne    L82
  mov    %r15,%rsi
  mov    $0xa,%edi
  call   <fputc@plt>
  mov    0x4(%rsp),%edx
  test   %edx,%edx
  jle    L86
L47:
  movl   $0x0,(%rsp)
  xor    %r13d,%r13d
  lea    D30(%rip),%rbp
  nopw   0x0(%rax,%rax,1)
L0:
  mov    %r15,%rcx
  mov    $0x3,%edx
  mov    $0x1,%esi
  lea    D52(%rip),%rdi
  call   <fwrite@plt>
  test   %r12d,%r12d
  jle    L56
  movslq (%rsp),%rsi
  mov    0x8(%rsp),%rdx
  lea    -0x1(%r12),%eax
  add    %rsi,%rax
  lea    (%rdx,%rsi,8),%r14
  lea    0x8(%rdx,%rax,8),%rbx
  nopl   0x0(%rax,%rax,1)
L72:
  movsd  (%r14),%xmm0
  mov    %rbp,%rsi
  mov    %r15,%rdi
  mov    $0x1,%eax
  add    $0x8,%r14
  call   <fprintf@plt>
  cmp    %rbx,%r14
  jne    L72
L56:
  mov    %r15,%rsi
  mov    $0xa,%edi
  add    $0x1,%r13d
  call   <fputc@plt>
  add    %r12d,(%rsp)
  cmp    %r13d,0x4(%rsp)
  jg     L0
  mov    %r15,%rcx
  mov    $0x3,%edx
  mov    $0x1,%esi
  lea    D34(%rip),%rdi
  call   <fwrite@plt>
  test   %r12d,%r12d
  jle    L14
  lea    D46(%rip),%rbp
L89:
  xor    %ebx,%ebx
  nopl   0x0(%rax)
L11:
  mov    %r15,%rcx
  mov    $0xf,%edx
  mov    $0x1,%esi
  mov    %rbp,%rdi
  call   <fwrite@plt>
  add    $0x1,%ebx
  cmp    %ebx,%r12d
  jne    L11
L14:
  add    $0x18,%rsp
  mov    %r15,%rcx
  mov    $0x2,%edx
  mov    $0x1,%esi
  pop    %rbx
  lea    D57(%rip),%rdi
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  jmp    1090 <fwrite@plt>
L85:
  mov    %r15,%rsi
  mov    $0xa,%edi
  call   <fputc@plt>
  mov    0x4(%rsp),%eax
  test   %eax,%eax
  jg     L47
  mov    %r15,%rcx
  mov    $0x3,%edx
  mov    $0x1,%esi
  lea    D34(%rip),%rdi
  call   <fwrite@plt>
  jmp    L14
L86:
  mov    %r15,%rcx
  mov    $0x3,%edx
  mov    $0x1,%esi
  lea    D34(%rip),%rdi
  call   <fwrite@plt>
  jmp    L89
```

tool_calls: name: extract_symbolic_data
arguments: label: D8
data_type: string
name: extract_symbolic_data
arguments: label: D46
data_type: string
name: extract_symbolic_data
arguments: label: D30
data_type: string
name: extract_symbolic_data
arguments: label: D52
data_type: string
name: extract_symbolic_data
arguments: label: D34
data_type: string
name: extract_symbolic_data
arguments: label: D57
data_type: string

tool: D8: 
  +

tool: D46: --------------+

tool: D30:  %12.4f |

tool: D52:   |

tool: D34:   +

tool: D57: 



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