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

```asm
<printMat>:
  endbr64
  push   %r15
  push   %r14
  mov    %edx,%r14d
  push   %r13
  push   %r12
  push   %rbp
  mov    %rcx,%rbp
  push   %rbx
  mov    %esi,%ebx
  sub    $0x48,%rsp
  mov    %rdi,0x28(%rsp)
  mov    %rcx,%rdi
  mov    %esi,0x34(%rsp)
  mov    %edx,0xc(%rsp)
  call   <strlen@plt>
  mov    %rbp,%rsi
  lea    D50(%rip),%rdi
  mov    %eax,0x30(%rsp)
  xor    %eax,%eax
  call   <PRNT@plt>
  test   %ebx,%ebx
  jle    L9
  mov    %r14d,%esi
  test   %r14d,%r14d
  jle    L9
  lea    -0x1(%rbx),%ecx
  sub    $0x1,%esi
  lea    D24(%rip),%r13
  movslq %ebx,%r12
  mov    %ecx,0x20(%rsp)
  mov    %ebx,%ecx
  shl    $0x3,%r12
  lea    D54(%rip),%r14
  mov    %rcx,0x38(%rsp)
  mov    %esi,0x10(%rsp)
  movq   $0x0,0x18(%rsp)
  nopl   0x0(%rax,%rax,1)
L67:
  mov    0x10(%rsp),%eax
  test   %eax,%eax
  jne    L102
  xor    %ebx,%ebx
L43:
  mov    0x34(%rsp),%eax
  mov    0x18(%rsp),%rcx
  mov    0x28(%rsp),%rsi
  imul   %ebx,%eax
  mov    %ecx,0x14(%rsp)
  cltq
  add    %rcx,%rax
  lea    (%rsi,%rax,8),%rbp
  jmp    L60
  xchg   %ax,%ax
L18:
  lea    D21(%rip),%rdi
  xor    %eax,%eax
  call   <PRNT@plt>
L19:
  add    $0x1,%ebx
  add    %r12,%rbp
  cmp    %ebx,0xc(%rsp)
  jle    L51
L60:
  movsd  0x0(%rbp),%xmm0
  mov    %r13,%rdi
  mov    $0x1,%eax
  call   <PRNT@plt>
  mov    0x14(%rsp),%edx
  cmp    %edx,0x20(%rsp)
  jle    L18
  lea    D52(%rip),%rdi
  xor    %eax,%eax
  xor    %r15d,%r15d
  call   <PRNT@plt>
  mov    0x30(%rsp),%eax
  test   %eax,%eax
  jle    L19
  mov    %ebx,0x24(%rsp)
  mov    %r15d,%ebx
  mov    %eax,%r15d
  nopl   0x0(%rax)
L29:
  mov    %r14,%rdi
  xor    %eax,%eax
  add    $0x1,%ebx
  call   <PRNT@plt>
  cmp    %ebx,%r15d
  jne    L29
  mov    0x24(%rsp),%ebx
  add    %r12,%rbp
  add    $0x1,%ebx
  cmp    %ebx,0xc(%rsp)
  jg     L60
  nopw   0x0(%rax,%rax,1)
L51:
  addq   $0x1,0x18(%rsp)
  mov    0x18(%rsp),%rax
  cmp    0x38(%rsp),%rax
  jne    L67
L9:
  add    $0x48,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
  nopl   (%rax)
L102:
  mov    0x28(%rsp),%rax
  mov    0x18(%rsp),%rsi
  xor    %ebx,%ebx
  lea    D43(%rip),%rbp
  lea    (%rax,%rsi,8),%r15
  nopw   0x0(%rax,%rax,1)
L73:
  movsd  (%r15),%xmm0
  mov    %r13,%rdi
  mov    $0x1,%eax
  add    $0x1,%ebx
  add    %r12,%r15
  call   <PRNT@plt>
  mov    %rbp,%rdi
  xor    %eax,%eax
  call   <PRNT@plt>
  cmp    0x10(%rsp),%ebx
  jl     L73
  cmp    %ebx,0xc(%rsp)
  jg     L43
  jmp    L51
```

tool_calls: name: retrieve_data
arguments: data_label: D50
type_guessed: string
name: retrieve_data
arguments: data_label: D24
type_guessed: string
name: retrieve_data
arguments: data_label: D54
type_guessed: string
name: retrieve_data
arguments: data_label: D21
type_guessed: string
name: retrieve_data
arguments: data_label: D52
type_guessed: string
name: retrieve_data
arguments: data_label: D43
type_guessed: string

tool: D50: %s= [

tool: D24: %g

tool: D54:  

tool: D21: ]


tool: D52: 
   

tool: D43: , 

assistant: ```c
void printMat(const double *A, const int n, const int m, const char *nm) {
  int c, r, i, sl = strlen(nm);
  ;
  PRNT("%s= [", nm);
  for (r = 0; r < n; r++) {
    for (c = 0; c < m; c++) {
      PRNT("%g", A[r + n * c]);
      if (c < (m - 1)) {
        PRNT(", ");
      } else {
        if (r < (n - 1)) {
          PRNT("\n   ");
          for (i = 0; i < sl; i++)
            PRNT(" ");
        } else {
          PRNT("]\n");
        }
      }
    }
  }
}
```