user: Demonstrate the C code that generates the assembly output below:

```asm
<iie_load_PGM>:
  endbr64
  push   %r12
  mov    %rdi,%r12
  mov    %rsi,%rdi
  lea    D76(%rip),%rsi
  push   %rbp
  sub    $0x28,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,0x18(%rsp)
  xor    %eax,%eax
  call   <fopen@plt>
  test   %rax,%rax
  je     L2
  mov    %rax,%rdi
  lea    0x16(%rsp),%rdx
  lea    0x17(%rsp),%rcx
  mov    %rax,%rbp
  lea    D40(%rip),%rsi
  xor    %eax,%eax
  call   <fscanf@plt>
  cmpb   $0x50,0x16(%rsp)
  jne    L101
  cmpb   $0x35,0x17(%rsp)
  je     L4
L101:
  lea    D36(%rip),%rdi
  call   <printf@plt>
  mov    $0x1,%edi
  call   <exit@plt>
L31:
  mov    0x18(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L40
  add    $0x28,%rsp
  pop    %rbp
  pop    %r12
  ret
L2:
  lea    D8(%rip),%rdi
  call   <printf@plt>
  mov    0x18(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L40
  add    $0x28,%rsp
  mov    $0x1,%edi
  pop    %rbp
  pop    %r12
  jmp    1130 <exit@plt>
  nopl   0x0(%rax)
L4:
  xor    %eax,%eax
  lea    0x8(%rsp),%rcx
  lea    0xc(%rsp),%rdx
  mov    %rbp,%rdi
  lea    D72(%rip),%rsi
  call   <fscanf@plt>
  cmpl   $0x100,0xc(%rsp)
  jg     L19
  cmpl   $0x100,0x8(%rsp)
  jg     L19
  xor    %eax,%eax
  lea    0x10(%rsp),%rdx
  lea    D70(%rip),%rsi
  mov    %rbp,%rdi
  call   <fscanf@plt>
  cmpl   $0xff,0x10(%rsp)
  je     L25
  lea    D49(%rip),%rdi
  call   <printf@plt>
  mov    $0x1,%edi
  call   <exit@plt>
  jmp    L31
  nopw   0x0(%rax,%rax,1)
L19:
  lea    D4(%rip),%rdi
  call   <printf@plt>
  mov    $0x1,%edi
  call   <exit@plt>
  jmp    L31
L25:
  mov    %rbp,%rdi
  call   <fgetc@plt>
  mov    %r12,%rdi
  mov    %rbp,%rcx
  mov    $0x10000,%edx
  mov    $0x1,%esi
  call   <fread@plt>
  mov    %rbp,%rdi
  call   <fclose@plt>
  jmp    L31
L40:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: unpack_data
arguments: data_label: D76
data_type: string
name: unpack_data
arguments: data_label: D40
data_type: string
name: unpack_data
arguments: data_label: D36
data_type: string
name: unpack_data
arguments: data_label: D8
data_type: string
name: unpack_data
arguments: data_label: D72
data_type: string
name: unpack_data
arguments: data_label: D70
data_type: string
name: unpack_data
arguments: data_label: D49
data_type: string
name: unpack_data
arguments: data_label: D4
data_type: string

tool: D76: rb

tool: D40: %c%c

tool: D36: UnMatch MagicNumber


tool: D8: InputFile Not Found


tool: D72: %d %d

tool: D70: %d

tool: D49: Out of Max Intensity


tool: D4: Size over


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);
        }
      }
    }
  }
}
```