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

```asm
<save_matrix>:
  endbr64
  push   %r15
  push   %r14
  mov    %rdi,%r14
  push   %r13
  mov    %rsi,%r13
  push   %r12
  mov    %r9d,%r12d
  push   %rbp
  sub    %r8d,%r12d
  mov    %r9d,%ebp
  push   %rbx
  add    $0x1,%r12d
  mov    %ecx,%ebx
  sub    $0x38,%rsp
  mov    %edx,0xc(%rsp)
  mov    0x78(%rsp),%rsi
  mov    %r8d,0x8(%rsp)
  mov    %fs:0x28,%rax
  mov    %rax,0x28(%rsp)
  mov    %ecx,%eax
  sub    %edx,%eax
  add    $0x1,%eax
  mov    %eax,0x10(%rsp)
  mov    0x70(%rsp),%eax
  test   %eax,%eax
  je     L57
  call   <fopen@plt>
  mov    %rax,%r15
  test   %rax,%rax
  je     L68
  lea    0x24(%rsp),%rdi
  mov    %rdi,0x18(%rsp)
  call   <time@plt>
  mov    0x18(%rsp),%rdi
  call   <ctime@plt>
  mov    %r14,%rdx
  lea    D82(%rip),%rsi
  mov    %r15,%rdi
  mov    %rax,%rcx
  xor    %eax,%eax
  call   <fprintf@plt>
  lea    D49(%rip),%rsi
  mov    %r15,%rdi
  xor    %eax,%eax
  call   <fprintf@plt>
  mov    %r12d,%edx
  mov    %r15,%rdi
  xor    %eax,%eax
  lea    D6(%rip),%rsi
  call   <fprintf@plt>
  mov    0x10(%rsp),%edx
  mov    %r15,%rdi
  xor    %eax,%eax
  lea    D60(%rip),%rsi
  call   <fprintf@plt>
  mov    0x8(%rsp),%eax
  cmp    %eax,%ebp
  jl     L65
  movslq %eax,%r12
  shl    $0x2,%r12
  nopl   0x0(%rax,%rax,1)
L129:
  movslq 0xc(%rsp),%r14
  cmp    %r14d,%ebx
  jge    L208
  jmp    L162
  nopl   0x0(%rax)
L155:
  mov    %r15,%rdi
  lea    D98(%rip),%rsi
  add    $0x1,%r14
  cvtss2sd %xmm0,%xmm0
  mov    $0x1,%eax
  call   <fprintf@plt>
  cmp    %r14d,%ebx
  jl     L162
L208:
  mov    0x0(%r13,%r14,8),%rax
  pxor   %xmm1,%xmm1
  movss  (%rax,%r12,1),%xmm0
  ucomiss %xmm1,%xmm0
  jp     L155
  jne    L155
  mov    %r15,%rcx
  mov    $0xf,%edx
  mov    $0x1,%esi
  add    $0x1,%r14
  lea    D30(%rip),%rdi
  call   <fwrite@plt>
  cmp    %r14d,%ebx
  jge    L208
L162:
  mov    %r15,%rsi
  mov    $0xa,%edi
  add    $0x4,%r12
  call   <fputc@plt>
  addl   $0x1,0x8(%rsp)
  mov    0x8(%rsp),%eax
  cmp    %eax,%ebp
  jge    L129
L65:
  mov    %r15,%rdi
  call   <fclose@plt>
  mov    0x28(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L179
  add    $0x38,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
  cs nopw 0x0(%rax,%rax,1)
L57:
  call   <fopen@plt>
  mov    %rax,%r15
  test   %rax,%rax
  je     L68
  lea    0x24(%rsp),%rdi
  mov    %rdi,0x18(%rsp)
  call   <time@plt>
  mov    0x18(%rsp),%rdi
  call   <ctime@plt>
  mov    %r14,%rdx
  lea    D82(%rip),%rsi
  mov    %r15,%rdi
  mov    %rax,%rcx
  xor    %eax,%eax
  call   <fprintf@plt>
  lea    D49(%rip),%rsi
  mov    %r15,%rdi
  xor    %eax,%eax
  call   <fprintf@plt>
  mov    0x10(%rsp),%edx
  mov    %r15,%rdi
  xor    %eax,%eax
  lea    D6(%rip),%rsi
  call   <fprintf@plt>
  mov    %r12d,%edx
  mov    %r15,%rdi
  xor    %eax,%eax
  lea    D60(%rip),%rsi
  call   <fprintf@plt>
  movslq 0xc(%rsp),%rax
  cmp    %eax,%ebx
  jl     L65
  lea    0x0(%r13,%rax,8),%r12
  movslq 0x8(%rsp),%rax
  shl    $0x2,%rax
  mov    %rax,0x10(%rsp)
  nopl   0x0(%rax,%rax,1)
L78:
  mov    0x8(%rsp),%eax
  mov    0x10(%rsp),%r14
  mov    %eax,%r13d
  cmp    %eax,%ebp
  jge    L140
  jmp    L3
  nopw   0x0(%rax,%rax,1)
L105:
  mov    %r15,%rdi
  add    $0x1,%r13d
  cvtss2sd %xmm0,%xmm0
  add    $0x4,%r14
  lea    D98(%rip),%rsi
  mov    $0x1,%eax
  call   <fprintf@plt>
  cmp    %r13d,%ebp
  jl     L3
L140:
  mov    (%r12),%rax
  pxor   %xmm2,%xmm2
  movss  (%rax,%r14,1),%xmm0
  ucomiss %xmm2,%xmm0
  jp     L105
  jne    L105
  mov    %r15,%rcx
  mov    $0xf,%edx
  add    $0x1,%r13d
  add    $0x4,%r14
  mov    $0x1,%esi
  lea    D30(%rip),%rdi
  call   <fwrite@plt>
  cmp    %r13d,%ebp
  jge    L140
L3:
  mov    %r15,%rsi
  mov    $0xa,%edi
  add    $0x8,%r12
  call   <fputc@plt>
  addl   $0x1,0xc(%rsp)
  mov    0xc(%rsp),%eax
  cmp    %eax,%ebx
  jge    L78
  jmp    L65
L179:
  call   <__stack_chk_fail@plt>
L68:
  lea    D109(%rip),%rdi
  mov    %r14,%rsi
  call   <printf@plt>
  mov    $0x3f5,%edi
  call   <exit@plt>
```

tool_calls: name: parse_data
arguments: data_tag: D82
type_infered: string
name: parse_data
arguments: data_tag: D49
type_infered: string
name: parse_data
arguments: data_tag: D6
type_infered: string
name: parse_data
arguments: data_tag: D60
type_infered: string
name: parse_data
arguments: data_tag: D98
type_infered: string
name: parse_data
arguments: data_tag: D30
type_infered: string
name: parse_data
arguments: data_tag: D109
type_infered: string

tool: D82: %% filename: %s - %s

tool: D49: %% type: matrix 


tool: D6: %% rows: %d


tool: D60: %% columns: %d


tool: D98: %15.6e

tool: D30:     0          

tool: D109:  error: cannot open file: %s 


assistant: ```c
void save_matrix(char filename[], float **A, int ml, int mh, int nl, int nh, int transpose, const char *mode) {
  FILE *fp_m;
  int i, j, rows, cols;
  void exit();
  time_t now;
  if (transpose)
    rows = nh - nl + 1;
  else
    rows = mh - ml + 1;
  if (transpose)
    cols = mh - ml + 1;
  else
    cols = nh - nl + 1;
  if ((fp_m = fopen(filename, mode)) == NULL) {
    printf(" error: cannot open file: %s \n", filename);
    exit(1013);
  }
  (void)time(&now);
  fprintf(fp_m, "%% filename: %s - %s", filename, ctime(&now));
  fprintf(fp_m, "%% type: matrix \n");
  fprintf(fp_m, "%% rows: %d\n", rows);
  fprintf(fp_m, "%% columns: %d\n", cols);
  if (transpose) {
    for (j = nl; j <= nh; j++) {
      for (i = ml; i <= mh; i++) {
        if (A[i][j] != 0)
          fprintf(fp_m, "%15.6e", A[i][j]);
        else
          fprintf(fp_m, "    0          ");
      }
      fprintf(fp_m, "\n");
    }
  } else {
    for (i = ml; i <= mh; i++) {
      for (j = nl; j <= nh; j++) {
        if (A[i][j] != 0)
          fprintf(fp_m, "%15.6e", A[i][j]);
        else
          fprintf(fp_m, "    0          ");
      }
      fprintf(fp_m, "\n");
    }
  }
  fclose(fp_m);
  return;
}
```