user: 提供的汇编代码用C语言表示会是什么样子：

```asm
<pnm_parse_header>:
  endbr64
  push   %r12
  mov    %rcx,%r12
  mov    %rsi,%r10
  push   %rbp
  push   %rbx
  mov    0x20(%rsp),%rcx
  mov    0x28(%rsp),%rsi
  test   %rcx,%rcx
  je     L250
  mov    %rdi,%r11
  mov    (%rdi),%edi
  mov    %rdx,%rbp
  xor    %eax,%eax
  nopl   0x0(%rax,%rax,1)
L96:
  movzbl (%rsi,%rax,1),%edx
  cmp    $0x9,%edi
  je     L248
  test   %r10,%r10
  je     L139
  cmp    $0xa,%dl
  setne  %dl
  movzbl %dl,%edx
  mov    %edx,(%r10)
L263:
  add    $0x1,%rax
  cmp    %rcx,%rax
  jne    L96
L336:
  pop    %rbx
  pop    %rbp
  pop    %r12
  ret
  nopl   0x0(%rax)
L158:
  lea    -0x30(%rdx),%ebx
  cmp    $0x9,%bl
  ja     L305
  mov    0x0(%rbp),%edi
  and    $0xf,%edx
  add    $0x1,%rax
  movl   $0x2,(%r11)
  lea    (%rdi,%rdi,4),%edi
  lea    (%rdx,%rdi,2),%edx
  mov    %edx,0x0(%rbp)
  cmp    %rax,%rcx
  je     L336
  movzbl (%rsi,%rax,1),%edx
  mov    $0x2,%edi
  nopl   0x0(%rax)
L139:
  cmp    $0x23,%dl
  je     L265
L94:
  cmp    $0x50,%dl
  jne    L23
  test   %edi,%edi
  je     L319
L23:
  lea    -0x1(%rdi),%ebx
  cmp    $0x1,%ebx
  jbe    L158
  lea    -0x3(%rdi),%ebx
  cmp    $0x1,%ebx
  ja     L285
  lea    -0x30(%rdx),%ebx
  cmp    $0x9,%bl
  ja     L41
  mov    (%r8),%rdi
  and    $0xf,%edx
  add    $0x1,%rax
  movl   $0x4,(%r11)
  lea    (%rdi,%rdi,4),%rdi
  lea    (%rdx,%rdi,2),%rdx
  mov    %rdx,(%r8)
  cmp    %rax,%rcx
  je     L336
  movzbl (%rsi,%rax,1),%edx
  mov    $0x4,%edi
  cmp    $0x23,%dl
  jne    L94
  nopl   (%rax)
L265:
  movl   $0x0,0x0
  ud2
  nopl   (%rax)
L285:
  lea    -0x5(%rdi),%ebx
  cmp    $0x1,%ebx
  ja     L305
  lea    -0x30(%rdx),%ebx
  cmp    $0x9,%bl
  jbe    L279
L41:
  test   $0x1,%dil
  jne    L263
  add    $0x1,%edi
  mov    %edi,(%r11)
  cmp    $0x7,%edi
  je     L134
L324:
  cmp    $0x9,%edi
  sete   %bl
L251:
  cmp    $0xa,%dl
  jne    L263
  test   %bl,%bl
  je     L263
L289:
  movl   $0xa,(%r11)
L321:
  pop    %rbx
  pop    %rbp
  pop    %r12
  ret
  nopl   0x0(%rax)
L248:
  cmp    $0xa,%dl
  je     L289
  add    $0x1,%rax
  cmp    %rax,%rcx
  jne    L236
  jmp    L336
  nopl   0x0(%rax,%rax,1)
L401:
  add    $0x1,%rax
  cmp    %rax,%rcx
  jbe    L336
L236:
  cmpb   $0xa,(%rsi,%rax,1)
  jne    L401
  movl   $0xa,(%r11)
  jmp    L321
  nopl   0x0(%rax)
L305:
  lea    -0x7(%rdi),%ebx
  cmp    $0x1,%ebx
  ja     L41
  lea    -0x30(%rdx),%ebx
  cmp    $0x9,%bl
  ja     L20
  mov    (%r12),%edi
  and    $0xf,%edx
  add    $0x1,%rax
  movl   $0x8,(%r11)
  lea    (%rdi,%rdi,4),%edi
  lea    (%rdx,%rdi,2),%edx
  mov    %edx,(%r12)
  cmp    %rax,%rcx
  je     L336
  movzbl (%rsi,%rax,1),%edx
  mov    $0x8,%edi
  jmp    L139
  nopl   0x0(%rax,%rax,1)
L279:
  mov    (%r9),%rdi
  and    $0xf,%edx
  add    $0x1,%rax
  movl   $0x6,(%r11)
  lea    (%rdi,%rdi,4),%rdi
  lea    (%rdx,%rdi,2),%rdx
  mov    %rdx,(%r9)
  cmp    %rax,%rcx
  je     L336
  movzbl (%rsi,%rax,1),%edx
  mov    $0x6,%edi
  jmp    L139
  nopl   0x0(%rax,%rax,1)
L319:
  add    $0x1,%rax
  movl   $0x1,(%r11)
  cmp    %rax,%rcx
  je     L336
  movzbl (%rsi,%rax,1),%edx
  mov    $0x1,%edi
  jmp    L139
  nopw   0x0(%rax,%rax,1)
L20:
  cmp    $0x7,%edi
  je     L263
  add    $0x1,%edi
  mov    %edi,(%r11)
  jmp    L324
L134:
  cmpl   $0x4,0x0(%rbp)
  je     L148
  add    $0x1,%rax
  cmp    %rax,%rcx
  je     L336
  movzbl (%rsi,%rax,1),%edx
  jmp    L139
L148:
  movl   $0x9,(%r11)
  mov    $0x1,%ebx
  mov    $0x9,%edi
  movl   $0x1,(%r12)
  jmp    L251
L250:
  xor    %eax,%eax
  jmp    L336
```

assistant: ```c
size_t pnm_parse_header(int *restrict state, int *restrict comment, int *restrict type, unsigned int *restrict maxval, size_t *restrict width, size_t *restrict height, size_t size, const char *image) {
  size_t i;
  char c;
  for (i = 0; i < size; i++)
    if (c = image[i], *state == 9) {
      if (c == '\n')
        return *state = 10, i;
    } else if (comment)
      *comment = c != '\n';
    else if (c == '#')
      *comment = 1;
    else if ((*state == 0) && (c == 'P'))
      ++*state;
    else if (((*state == 1) || (*state == 1 + 1)) && ('0' <= c) && (c <= '9'))
      *state = 2, *type = *type * 10 + (c & 15);
    else if (((*state == 3) || (*state == 3 + 1)) && ('0' <= c) && (c <= '9'))
      *state = 4, *width = *width * 10 + (c & 15);
    else if (((*state == 5) || (*state == 5 + 1)) && ('0' <= c) && (c <= '9'))
      *state = 6, *height = *height * 10 + (c & 15);
    else if (((*state == 7) || (*state == 7 + 1)) && ('0' <= c) && (c <= '9'))
      *state = 8, *maxval = *maxval * 10 + (c & 15);
    else if ((*state % 2) == 0) {
      ++*state;
      if ((*state == 7) && (*type == 4))
        *state = 9, *maxval = 1;
      if ((*state == 9) && (c == '\n'))
        return *state = 10, i;
    }
  return i;
}
```