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

```asm
<main>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  lea    -0x13000(%rsp),%r11
L122:
  sub    $0x1000,%rsp
  orq    $0x0,(%rsp)
  cmp    %r11,%rsp
  jne    L122
  sub    $0x8a8,%rsp
  lea    D76(%rip),%rsi
  lea    D51(%rip),%rdi
  mov    %fs:0x28,%rax
  mov    %rax,0x13898(%rsp)
  xor    %eax,%eax
  call   <fopen@plt>
  mov    %rax,%r12
  test   %rax,%rax
  je     L91
L291:
  mov    %r12,%rdi
  call   <feof@plt>
  test   %eax,%eax
  je     L148
L3:
  mov    0x8(%rsp),%eax
  cmp    $0x64,%eax
  jg     L66
  cmpl   $0x64,0xc(%rsp)
  jg     L66
  xor    %r15d,%r15d
  xor    %r14d,%r14d
  lea    D92(%rip),%r13
  test   %eax,%eax
  jle    L87
  nopl   0x0(%rax)
L241:
  mov    %r12,%rdi
  call   <feof@plt>
  test   %eax,%eax
  jne    L87
  mov    0xc(%rsp),%ecx
  test   %ecx,%ecx
  jle    L188
  lea    0x10(%rsp,%r15,4),%rbp
  xor    %ebx,%ebx
  jmp    L214
  nopl   0x0(%rax)
L154:
  mov    %rbp,%rdx
  mov    %r13,%rsi
  mov    %r12,%rdi
  xor    %eax,%eax
  call   <fscanf@plt>
  add    $0x1,%ebx
  add    $0x4,%rbp
  cmp    %ebx,0xc(%rsp)
  jle    L288
L214:
  mov    %r12,%rdi
  call   <feof@plt>
  test   %eax,%eax
  je     L154
L288:
  add    $0x1,%r14d
  add    $0x64,%r15
  cmp    %r14d,0x8(%rsp)
  jg     L241
L87:
  mov    %r12,%rdi
  call   <fclose@plt>
  cmp    %r14d,0x8(%rsp)
  jne    L254
  mov    0xc(%rsp),%r8d
  cmp    %ebx,%r8d
  jne    L254
  test   %r14d,%r14d
  je     L200
  lea    -0x1(%rbx),%eax
  lea    0x10(%rsp),%rdi
  lea    (%rax,%rax,4),%rax
  lea    0x9c50(%rsp),%rsi
  lea    (%rax,%rax,4),%rax
  shl    $0x4,%rax
  lea    0x9de0(%rsp,%rax,1),%rcx
  lea    -0x1(%r14),%eax
  lea    0x9c54(%rsp,%rax,4),%r9
  cs nopw 0x0(%rax,%rax,1)
L261:
  mov    %rsi,%rax
  mov    %rdi,%rdx
  test   %r8d,%r8d
  je     L125
  nopl   0x0(%rax,%rax,1)
L28:
  movss  (%rdx),%xmm0
  add    $0x190,%rax
  add    $0x4,%rdx
  movss  %xmm0,-0x190(%rax)
  cmp    %rcx,%rax
  jne    L28
L125:
  add    $0x4,%rsi
  add    $0x190,%rdi
  add    $0x4,%rcx
  cmp    %r9,%rsi
  jne    L261
L200:
  lea    D111(%rip),%rsi
  lea    D17(%rip),%rdi
  call   <fopen@plt>
  mov    %rax,%r12
  test   %rax,%rax
  je     L96
L177:
  pxor   %xmm0,%xmm0
  mov    0x8(%rsp),%edx
  mov    %r12,%rdi
  mov    $0x1,%eax
  cvtsi2ssl 0xc(%rsp),%xmm0
  lea    D117(%rip),%rsi
  call   <fprintf@plt>
  mov    0xc(%rsp),%edx
  test   %edx,%edx
  jle    L276
  lea    0x9c50(%rsp),%rbp
  xor    %r14d,%r14d
  lea    D45(%rip),%r13
  nopw   0x0(%rax,%rax,1)
L54:
  mov    0x8(%rsp),%eax
  xor    %ebx,%ebx
  test   %eax,%eax
  jle    L61
  nopw   0x0(%rax,%rax,1)
L230:
  movss  0x0(%rbp,%rbx,4),%xmm0
  mov    %r13,%rsi
  mov    %r12,%rdi
  mov    $0x1,%eax
  add    $0x1,%rbx
  call   <fprintf@plt>
  cmp    %ebx,0x8(%rsp)
  jg     L230
L61:
  add    $0x1,%r14d
  add    $0x190,%rbp
  cmp    %r14d,0xc(%rsp)
  jg     L54
L276:
  mov    %r12,%rdi
  call   <fclose@plt>
  xor    %eax,%eax
L29:
  mov    0x13898(%rsp),%rdx
  sub    %fs:0x28,%rdx
  jne    L229
  add    $0x138a8,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
L188:
  xor    %ebx,%ebx
  jmp    L288
L148:
  lea    0xc(%rsp),%rcx
  lea    0x8(%rsp),%rdx
  mov    %r12,%rdi
  lea    D24(%rip),%rsi
  call   <fscanf@plt>
  jmp    L3
L91:
  lea    D13(%rip),%rdi
  call   <printf@plt>
  mov    $0x1,%edi
  call   <exit@plt>
  jmp    L291
L96:
  lea    D91(%rip),%rdi
  call   <printf@plt>
  mov    $0x1,%edi
  call   <exit@plt>
  jmp    L177
L254:
  lea    D75(%rip),%rdi
  call   <printf@plt>
  or     $0xffffffff,%eax
  jmp    L29
L66:
  lea    D41(%rip),%rdi
  call   <printf@plt>
  or     $0xffffffff,%eax
  jmp    L29
L229:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: disassemble_data
arguments: label: D76
type: string
name: disassemble_data
arguments: label: D51
type: string
name: disassemble_data
arguments: label: D92
type: string
name: disassemble_data
arguments: label: D111
type: string
name: disassemble_data
arguments: label: D17
type: string
name: disassemble_data
arguments: label: D117
type: string
name: disassemble_data
arguments: label: D45
type: string
name: disassemble_data
arguments: label: D24
type: string
name: disassemble_data
arguments: label: D13
type: string
name: disassemble_data
arguments: label: D91
type: string
name: disassemble_data
arguments: label: D75
type: string
name: disassemble_data
arguments: label: D41
type: string

tool: D76: r

tool: D51: mat1.txt

tool: D92: %f

tool: D111: w

tool: D17: mat2.txt

tool: D117: %d %d


tool: D45: %7.2f


tool: D24: %d %d

tool: D13: The file `mat1.txt` can not be opened!


tool: D91: The file `mat2.txt` can not be opened!


tool: D75: Not enough data in the file!

tool: D41: Very large matrix!

assistant: ```c
int main() {
  int i, j, m, n;
  float a[100][100], b[100][100];
  FILE *input, *output;
  if ((input = fopen("mat1.txt", "r")) == NULL) {
    printf("The file `mat1.txt` can not be opened!\n");
    exit(1);
  }
  if (!feof(input))
    fscanf(input, "%d %d", &m, &n);
  if ((m > 100) || (n > 100)) {
    printf("Very large matrix!");
    return (-1);
  }
  for (i = 0; i < m && !feof(input); i++)
    for (j = 0; j < n && !feof(input); j++)
      fscanf(input, "%f", &a[i][j]);
  fclose(input);
  if (i != m || j != n) {
    printf("Not enough data in the file!");
    return (-1);
  }
  for (i = 0; i < m; i++)
    for (j = 0; j < n; j++)
      b[j][i] = a[i][j];
  if ((output = fopen("mat2.txt", "w")) == NULL) {
    printf("The file `mat2.txt` can not be opened!\n");
    exit(1);
  }
  fprintf(output, "%d %d\n", n, m);
  for (i = 0; i < n; i++)
    for (j = 0; j < m; j++)
      fprintf(output, "%7.2f\n", b[i][j]);
  fclose(output);
  return (0);
}
```