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

```asm
<pnm_parse_header>:
  endbr64
  push   %r12
  push   %rbp
  push   %rbx
  mov    0x20(%rsp),%r10
  mov    0x28(%rsp),%r11
  test   %r10,%r10
  je     L155
  mov    %rdx,%rbp
  mov    %rcx,%r12
  xor    %eax,%eax
  jmp    L97
  nopl   0x0(%rax)
L52:
  test   %rsi,%rsi
  je     L212
  cmp    $0xa,%dl
  setne  %dl
  movzbl %dl,%edx
  mov    %edx,(%rsi)
L216:
  add    $0x1,%rax
  cmp    %rax,%r10
  je     L155
L97:
  mov    (%rdi),%ecx
  movzbl (%r11,%rax,1),%edx
  cmp    $0x9,%ecx
  jne    L52
  cmp    $0xa,%dl
  jne    L216
L250:
  movl   $0xa,(%rdi)
  mov    %rax,%r10
L155:
  pop    %rbx
  mov    %r10,%rax
  pop    %rbp
  pop    %r12
  ret
  nopl   0x0(%rax,%rax,1)
L212:
  cmp    $0x23,%dl
  je     L209
  cmp    $0x50,%dl
  jne    L271
  test   %ecx,%ecx
  je     L94
L271:
  lea    -0x1(%rcx),%ebx
  cmp    $0x1,%ebx
  jbe    L239
  lea    -0x3(%rcx),%ebx
  cmp    $0x1,%ebx
  ja     L241
  lea    -0x30(%rdx),%ebx
  cmp    $0x9,%bl
  ja     L64
  mov    (%r8),%rcx
  and    $0xf,%edx
  movl   $0x4,(%rdi)
  lea    (%rcx,%rcx,4),%rcx
  lea    (%rdx,%rcx,2),%rdx
  mov    %rdx,(%r8)
  jmp    L216
  nopl   0x0(%rax,%rax,1)
L241:
  lea    -0x5(%rcx),%ebx
  cmp    $0x1,%ebx
  ja     L162
  lea    -0x30(%rdx),%ebx
  cmp    $0x9,%bl
  jbe    L105
L64:
  test   $0x1,%cl
  jne    L216
  add    $0x1,%ecx
  mov    %ecx,(%rdi)
  cmp    $0x7,%ecx
  je     L245
L254:
  cmp    $0x9,%ecx
  sete   %cl
L171:
  cmp    $0xa,%dl
  jne    L216
  test   %cl,%cl
  je     L216
  jmp    L250
  nop
L209:
  movl   $0x0,0x0
  ud2
  nopl   (%rax)
L239:
  lea    -0x30(%rdx),%ebx
  cmp    $0x9,%bl
  jbe    L141
L162:
  lea    -0x7(%rcx),%ebx
  cmp    $0x1,%ebx
  ja     L64
  lea    -0x30(%rdx),%ebx
  cmp    $0x9,%bl
  ja     L157
  mov    (%r12),%ecx
  and    $0xf,%edx
  movl   $0x8,(%rdi)
  lea    (%rcx,%rcx,4),%ecx
  lea    (%rdx,%rcx,2),%edx
  mov    %edx,(%r12)
  jmp    L216
  nopl   0x0(%rax)
L141:
  mov    0x0(%rbp),%ecx
  and    $0xf,%edx
  movl   $0x2,(%rdi)
  lea    (%rcx,%rcx,4),%ecx
  lea    (%rdx,%rcx,2),%edx
  mov    %edx,0x0(%rbp)
  jmp    L216
  nopw   0x0(%rax,%rax,1)
L105:
  mov    (%r9),%rcx
  and    $0xf,%edx
  movl   $0x6,(%rdi)
  lea    (%rcx,%rcx,4),%rcx
  lea    (%rdx,%rcx,2),%rdx
  mov    %rdx,(%r9)
  jmp    L216
  nopl   0x0(%rax)
L94:
  movl   $0x1,(%rdi)
  jmp    L216
  nopl   0x0(%rax,%rax,1)
L157:
  cmp    $0x7,%ecx
  je     L216
  add    $0x1,%ecx
  mov    %ecx,(%rdi)
  jmp    L254
L245:
  cmpl   $0x4,0x0(%rbp)
  jne    L216
  movl   $0x9,(%rdi)
  mov    $0x1,%ecx
  movl   $0x1,(%r12)
  jmp    L171
```

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