user: What is the c source code of the assembly code below?

```asm
<read_graphics>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  mov    %ecx,%ebp
  push   %rbx
  xor    %ebx,%ebx
  sub    $0x38,%rsp
  mov    %rsi,0x10(%rsp)
  lea    D38(%rip),%rsi
  mov    %edx,0x18(%rsp)
  mov    %r8d,(%rsp)
  mov    %fs:0x28,%rax
  mov    %rax,0x28(%rsp)
  xor    %eax,%eax
  call   <fopen@plt>
  mov    %rax,%r15
  test   %rax,%rax
  je     L9
  nopl   0x0(%rax,%rax,1)
L8:
  mov    %r15,%rdi
  call   <fgetc@plt>
  cmp    $0xa,%al
  sete   %al
  movzbl %al,%eax
  add    %eax,%ebx
  cmp    $0x3,%ebx
  jne    L8
  mov    (%rsp),%edx
  test   %edx,%edx
  jne    L137
  mov    0x18(%rsp),%eax
  test   %eax,%eax
  jle    L81
  movl   $0x0,0x8(%rsp)
  lea    D28(%rip),%r13
  nopl   0x0(%rax)
L121:
  test   %ebp,%ebp
  jle    L35
  movslq 0x8(%rsp),%rdx
  mov    0x10(%rsp),%rcx
  lea    -0x1(%rbp),%eax
  lea    0x24(%rsp),%rbx
  add    %rdx,%rax
  lea    (%rcx,%rdx,4),%r14
  lea    0x4(%rcx,%rax,4),%r12
  nopw   0x0(%rax,%rax,1)
L89:
  mov    %rbx,%rdx
  mov    %r13,%rsi
  mov    %r15,%rdi
  add    $0x4,%r14
  call   <fscanf@plt>
  pxor   %xmm0,%xmm0
  cvtsi2ssl 0x24(%rsp),%xmm0
  movss  %xmm0,-0x4(%r14)
  cmp    %r12,%r14
  jne    L89
L35:
  addl   $0x1,(%rsp)
  mov    (%rsp),%eax
  add    %ebp,0x8(%rsp)
  cmp    %eax,0x18(%rsp)
  jne    L121
L81:
  mov    %r15,%rdi
  call   <fclose@plt>
  mov    0x28(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L80
  add    $0x38,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
  nopl   0x0(%rax,%rax,1)
L137:
  movslq 0x18(%rsp),%rax
  test   %eax,%eax
  jle    L81
  mov    %rax,0x18(%rsp)
  shl    $0x2,%rax
  lea    D28(%rip),%r12
  mov    %rax,(%rsp)
  movq   $0x0,0x8(%rsp)
  cs nopw 0x0(%rax,%rax,1)
L50:
  test   %ebp,%ebp
  jle    L21
  mov    0x10(%rsp),%rax
  mov    0x8(%rsp),%rcx
  xor    %r14d,%r14d
  lea    0x24(%rsp),%rbx
  lea    (%rax,%rcx,4),%r13
  nopw   0x0(%rax,%rax,1)
L0:
  mov    %rbx,%rdx
  mov    %r12,%rsi
  mov    %r15,%rdi
  add    $0x1,%r14d
  call   <fscanf@plt>
  pxor   %xmm0,%xmm0
  cvtsi2ssl 0x24(%rsp),%xmm0
  movss  %xmm0,0x0(%r13)
  add    (%rsp),%r13
  cmp    %r14d,%ebp
  jne    L0
L21:
  addq   $0x1,0x8(%rsp)
  mov    0x8(%rsp),%rax
  cmp    0x18(%rsp),%rax
  jne    L50
  jmp    L81
L9:
  mov    0x28(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L80
  add    $0x38,%rsp
  lea    D35(%rip),%rdi
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  jmp    10c0 <printf@plt>
L80:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: retrieve_data
arguments: data_tag: D38
datatype: string
name: retrieve_data
arguments: data_tag: D28
datatype: string
name: retrieve_data
arguments: data_tag: D35
datatype: string

tool: D38: r

tool: D28: %d

tool: D35: The file was not opened for reading


assistant: ```c
void read_graphics(char *filename, float *input, int data_rows, int data_cols, int major) {
  FILE *fid;
  int i, j;
  char c;
  int temp;
  fid = fopen(filename, "r");
  if (fid == NULL) {
    printf("The file was not opened for reading\n");
    return;
  }
  i = 0;
  while (i < 3) {
    c = fgetc(fid);
    if (c == '\n') {
      i = i + 1;
    }
  };
  if (major == 0) {
    for (i = 0; i < data_rows; i++) {
      for (j = 0; j < data_cols; j++) {
        fscanf(fid, "%d", &temp);
        input[i * data_cols + j] = (float)temp;
      }
    }
  } else {
    for (i = 0; i < data_rows; i++) {
      for (j = 0; j < data_cols; j++) {
        fscanf(fid, "%d", &temp);
        input[j * data_rows + i] = (float)temp;
      }
    }
  }
  fclose(fid);
}
```