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

```asm
<iie_load_PGM>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x40,%rsp
  mov    %rdi,-0x38(%rbp)
  mov    %rsi,-0x40(%rbp)
  mov    %fs:0x28,%rax
  mov    %rax,-0x8(%rbp)
  xor    %eax,%eax
  mov    -0x40(%rbp),%rax
  lea    D35(%rip),%rdx
  mov    %rdx,%rsi
  mov    %rax,%rdi
  call   <fopen@plt>
  mov    %rax,-0x18(%rbp)
  cmpq   $0x0,-0x18(%rbp)
  jne    L18
  lea    D65(%rip),%rax
  mov    %rax,%rdi
  call   <printf@plt>
  mov    $0x1,%edi
  call   <exit@plt>
  jmp    L108
L18:
  lea    -0xa(%rbp),%rax
  lea    0x1(%rax),%rcx
  lea    -0xa(%rbp),%rdx
  mov    -0x18(%rbp),%rax
  lea    D4(%rip),%rsi
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <fscanf@plt>
  movzbl -0xa(%rbp),%eax
  cmp    $0x50,%al
  jne    L63
  movzbl -0x9(%rbp),%eax
  cmp    $0x35,%al
  je     L77
L63:
  lea    D41(%rip),%rax
  mov    %rax,%rdi
  call   <printf@plt>
  mov    $0x1,%edi
  call   <exit@plt>
  jmp    L108
L77:
  lea    -0x24(%rbp),%rcx
  lea    -0x20(%rbp),%rdx
  mov    -0x18(%rbp),%rax
  lea    D76(%rip),%rsi
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <fscanf@plt>
  mov    -0x20(%rbp),%eax
  cmp    $0x100,%eax
  jg     L94
  mov    -0x24(%rbp),%eax
  cmp    $0x100,%eax
  jle    L65
L94:
  lea    D15(%rip),%rax
  mov    %rax,%rdi
  call   <printf@plt>
  mov    $0x1,%edi
  call   <exit@plt>
  jmp    L108
L65:
  lea    -0x1c(%rbp),%rdx
  mov    -0x18(%rbp),%rax
  lea    D27(%rip),%rcx
  mov    %rcx,%rsi
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <fscanf@plt>
  mov    -0x1c(%rbp),%eax
  cmp    $0xff,%eax
  je     L89
  lea    D2(%rip),%rax
  mov    %rax,%rdi
  call   <printf@plt>
  mov    $0x1,%edi
  call   <exit@plt>
  jmp    L108
L89:
  mov    -0x18(%rbp),%rax
  mov    %rax,%rdi
  call   <fgetc@plt>
  mov    -0x18(%rbp),%rdx
  mov    -0x38(%rbp),%rax
  mov    %rdx,%rcx
  mov    $0x10000,%edx
  mov    $0x1,%esi
  mov    %rax,%rdi
  call   <fread@plt>
  mov    -0x18(%rbp),%rax
  mov    %rax,%rdi
  call   <fclose@plt>
  jmp    L108
L108:
  nop
  mov    -0x8(%rbp),%rax
  sub    %fs:0x28,%rax
  je     L10
  call   <__stack_chk_fail@plt>
L10:
  leave
  ret
```

tool_calls: name: read_data
arguments: data_label: D35
type_guessed: string
name: read_data
arguments: data_label: D65
type_guessed: string
name: read_data
arguments: data_label: D4
type_guessed: string
name: read_data
arguments: data_label: D41
type_guessed: string
name: read_data
arguments: data_label: D76
type_guessed: string
name: read_data
arguments: data_label: D15
type_guessed: string
name: read_data
arguments: data_label: D27
type_guessed: string
name: read_data
arguments: data_label: D2
type_guessed: string

tool: D35: rb

tool: D65: InputFile Not Found


tool: D4: %c%c

tool: D41: UnMatch MagicNumber


tool: D76: %d %d

tool: D15: Size over


tool: D27: %d

tool: D2: Out of Max Intensity


assistant: ```c
void iie_load_PGM(unsigned char image[][256], const char path[]) {
  int height, width;
  int max_intensity;
  char magic_number[2];
  FILE *fp;
  if ((fp = fopen(path, "rb")) == NULL) {
    printf("InputFile Not Found\n");
    exit(1);
  } else {
    fscanf(fp, "%c%c", &magic_number[0], &magic_number[1]);
    if (magic_number[0] != 'P' || magic_number[1] != '5') {
      printf("UnMatch MagicNumber\n");
      exit(1);
    } else {
      fscanf(fp, "%d %d", &width, &height);
      if (width > 256 || height > 256) {
        printf("Size over\n");
        exit(1);
      } else {
        fscanf(fp, "%d", &max_intensity);
        if (max_intensity != 255) {
          printf("Out of Max Intensity\n");
          exit(1);
        } else {
          fgetc(fp);
          fread(image, sizeof(unsigned char), 256 * 256, fp);
          fclose(fp);
        }
      }
    }
  }
}
```