user: What would the C source look like for the assembly code provided here:

```asm
<read_image>:
  endbr64
  push   %r15
  lea    D66(%rip),%rsi
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  mov    %rdi,%rbp
  lea    D26(%rip),%rdi
  push   %rbx
  sub    $0x98,%rsp
  mov    %rdx,0x8(%rsp)
  mov    %rcx,0x10(%rsp)
  mov    %r8,0x18(%rsp)
  mov    %fs:0x28,%rax
  mov    %rax,0x88(%rsp)
  xor    %eax,%eax
  call   <fopen@plt>
  mov    %rax,%r13
  test   %rax,%rax
  je     L71
L64:
  lea    0x30(%rsp),%r12
  lea    D64(%rip),%rsi
  mov    %r13,%rdi
  xor    %eax,%eax
  mov    %r12,%rdx
  call   <fscanf@plt>
  lea    D11(%rip),%rsi
  mov    %r12,%rdi
  call   <strcmp@plt>
  test   %rax,%rax
  jne    L11
L95:
  mov    %r13,%rdx
  mov    $0x50,%esi
  mov    %r12,%rdi
  call   <fgets@plt>
  mov    %r13,%rdx
  mov    $0x50,%esi
  mov    %r12,%rdi
  call   <fgets@plt>
  lea    0x24(%rsp),%rcx
  mov    %r13,%rdi
  xor    %eax,%eax
  lea    0x28(%rsp),%rdx
  lea    D59(%rip),%rsi
  call   <fscanf@plt>
  lea    0x2c(%rsp),%rdx
  mov    %r13,%rdi
  xor    %eax,%eax
  lea    D55(%rip),%rbx
  mov    %rbx,%rsi
  call   <fscanf@plt>
  mov    0x28(%rsp),%edx
  mov    0x24(%rsp),%esi
  xor    %eax,%eax
  lea    D14(%rip),%rdi
  call   <printf@plt>
  mov    0x24(%rsp),%eax
  test   %eax,%eax
  jle    L60
  mov    0x28(%rsp),%eax
  xor    %r12d,%r12d
  test   %eax,%eax
  jle    L60
  nopw   0x0(%rax,%rax,1)
L47:
  mov    %rbp,%r15
  xor    %r14d,%r14d
  cs nopw 0x0(%rax,%rax,1)
L65:
  mov    %r15,%rdx
  mov    %rbx,%rsi
  mov    %r13,%rdi
  xor    %eax,%eax
  call   <fscanf@plt>
  mov    0x28(%rsp),%eax
  add    $0x1,%r14d
  add    $0x4,%r15
  cmp    %r14d,%eax
  jg     L65
  add    $0x1,%r12d
  cmp    0x24(%rsp),%r12d
  jge    L60
  add    $0xebc,%rbp
  test   %eax,%eax
  jg     L47
L60:
  mov    %r13,%rdi
  call   <fclose@plt>
  mov    0x24(%rsp),%eax
  mov    0x8(%rsp),%rcx
  mov    %eax,(%rcx)
  mov    0x28(%rsp),%eax
  mov    0x10(%rsp),%rcx
  mov    %eax,(%rcx)
  mov    0x2c(%rsp),%eax
  mov    0x18(%rsp),%rcx
  mov    %eax,(%rcx)
  mov    0x88(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L23
  add    $0x98,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
L11:
  lea    D36(%rip),%rdi
  call   <puts@plt>
  mov    $0xffffffff,%edi
  call   <exit@plt>
  jmp    L95
L71:
  lea    D15(%rip),%rdi
  call   <puts@plt>
  mov    $0xffffffff,%edi
  call   <exit@plt>
  jmp    L64
L23:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: read_data
arguments: label: D66
type_infered: string
name: read_data
arguments: label: D26
type_infered: string
name: read_data
arguments: label: D64
type_infered: string
name: read_data
arguments: label: D11
type_infered: string
name: read_data
arguments: label: D59
type_infered: string
name: read_data
arguments: label: D55
type_infered: string
name: read_data
arguments: label: D14
type_infered: string
name: read_data
arguments: label: D36
type_infered: string
name: read_data
arguments: label: D15
type_infered: string

tool: D66: r

tool: D26: logo.pgm

tool: D64: %s

tool: D11: P2

tool: D59: %d%d

tool: D55: %d

tool: D14: image reading ... h = %d w = %d


tool: D36: the image format must be P2

tool: D15: file open error

assistant: ```c
void read_image(int image[827][943], char file_name[], int *p_h, int *p_w, int *p_levels) {
  FILE *fin;
  int i, j, h, w, levels;
  char buffer[80];
  fin = fopen("logo.pgm", "r");
  if (fin == NULL) {
    printf("file open error\n");
    exit(-1);
  }
  fscanf(fin, "%s", buffer);
  if (strcmp(buffer, "P2")) {
    printf("the image format must be P2\n");
    exit(-1);
  }
  fgets(buffer, 80, fin);
  fgets(buffer, 80, fin);
  fscanf(fin, "%d%d", &w, &h);
  fscanf(fin, "%d", &levels);
  printf("image reading ... h = %d w = %d\n", h, w);
  for (i = 0; i < h; i++)
    for (j = 0; j < w; j++)
      fscanf(fin, "%d", &image[i][j]);
  fclose(fin);
  *p_h = h;
  *p_w = w;
  *p_levels = levels;
  return;
}
```