user: 请显示与下面列出的汇编代码相匹配的C语言实现:

```asm
<parse_edlf>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x40,%rsp
  mov    %rdi,-0x28(%rbp)
  mov    %esi,-0x2c(%rbp)
  mov    %rdx,-0x38(%rbp)
  mov    -0x28(%rbp),%rax
  mov    %rax,-0x10(%rbp)
  mov    -0x2c(%rbp),%eax
  movslq %eax,%rdx
  mov    -0x28(%rbp),%rax
  add    %rdx,%rax
  mov    %rax,-0x8(%rbp)
  movw   $0x0,-0x12(%rbp)
  mov    -0x10(%rbp),%rax
  lea    0x1(%rax),%rdx
  mov    %rdx,-0x10(%rbp)
  movzbl (%rax),%eax
  cmp    $0xa,%al
  jne    L73
L165:
  mov    -0x10(%rbp),%rax
  sub    -0x28(%rbp),%rax
  lea    0x1(%rax),%rcx
  movabs $0x6666666666666667,%rdx
  mov    %rcx,%rax
  imul   %rdx
  mov    %rdx,%rax
  sar    %rax
  mov    %rcx,%rdx
  sar    $0x3f,%rdx
  sub    %rdx,%rax
  mov    %rax,%rdx
  shl    $0x2,%rdx
  add    %rax,%rdx
  mov    %rcx,%rax
  sub    %rdx,%rax
  test   %rax,%rax
  jne    L42
  addq   $0x1,-0x10(%rbp)
L42:
  mov    -0x10(%rbp),%rax
  cmp    -0x8(%rbp),%rax
  jae    L77
  mov    -0x10(%rbp),%rax
  lea    0x1(%rax),%rdx
  mov    %rdx,-0x10(%rbp)
  movzbl (%rax),%eax
  mov    %al,-0x14(%rbp)
  mov    -0x10(%rbp),%rax
  sub    -0x28(%rbp),%rax
  lea    0x1(%rax),%rcx
  movabs $0x6666666666666667,%rdx
  mov    %rcx,%rax
  imul   %rdx
  mov    %rdx,%rax
  sar    %rax
  mov    %rcx,%rdx
  sar    $0x3f,%rdx
  sub    %rdx,%rax
  mov    %rax,%rdx
  shl    $0x2,%rdx
  add    %rax,%rdx
  mov    %rcx,%rax
  sub    %rdx,%rax
  test   %rax,%rax
  jne    L143
  addq   $0x1,-0x10(%rbp)
L143:
  mov    -0x10(%rbp),%rax
  cmp    -0x8(%rbp),%rax
  jae    L69
  mov    -0x10(%rbp),%rax
  lea    0x1(%rax),%rdx
  mov    %rdx,-0x10(%rbp)
  movzbl (%rax),%eax
  mov    %al,-0x13(%rbp)
  movzbl -0x14(%rbp),%eax
  cmp    $0xaa,%eax
  je     L74
  cmp    $0xaa,%eax
  jg     L114
  cmp    $0xa5,%eax
  je     L128
  cmp    $0xa5,%eax
  jg     L114
  cmp    $0x5a,%eax
  je     L171
  cmp    $0x5a,%eax
  jg     L114
  cmp    $0x7,%eax
  je     L174
  cmp    $0x55,%eax
  je     L214
  jmp    L114
L74:
  movzwl -0x12(%rbp),%eax
  movzbl %al,%edx
  movzbl -0x13(%rbp),%eax
  shl    $0x8,%eax
  or     %edx,%eax
  mov    %ax,-0x12(%rbp)
  jmp    L64
L128:
  movzwl -0x12(%rbp),%eax
  mov    $0x0,%al
  mov    %eax,%edx
  movzbl -0x13(%rbp),%eax
  or     %edx,%eax
  mov    %ax,-0x12(%rbp)
  jmp    L64
L171:
  movzbl -0x13(%rbp),%edx
  movzwl -0x12(%rbp),%ecx
  mov    -0x38(%rbp),%rax
  mov    %ecx,%esi
  mov    %rax,%rdi
  call   <image_data_set@plt>
  addw   $0x1,-0x12(%rbp)
  jmp    L64
L214:
  cmpb   $0x7,-0x13(%rbp)
  je     L66
  movzbl -0x13(%rbp),%eax
  mov    %eax,%esi
  lea    D12(%rip),%rax
  mov    %rax,%rdi
  call   <printf@plt>
  jmp    L202
L66:
  addw   $0x1,-0x12(%rbp)
  jmp    L64
L114:
  movzbl -0x14(%rbp),%eax
  mov    %eax,%esi
  lea    D11(%rip),%rax
  mov    %rax,%rdi
  call   <printf@plt>
  jmp    L202
L64:
  jmp    L165
L73:
  nop
  jmp    L202
L77:
  nop
  jmp    L202
L69:
  nop
  jmp    L202
L174:
  nop
L202:
  leave
  ret
```

tool_calls: name: disassemble_data
arguments: data_label: D12
type_guessed: string
name: disassemble_data
arguments: data_label: D11
type_guessed: string

tool: D12: Invalid NULL data byte 0x%02x


tool: D11: Illegal tag 0x%02x


assistant: ```c
void parse_edlf(unsigned char *start, int bytes, struct image_data *idata) {
  unsigned char *s = start;
  unsigned char *end = start + bytes;
  unsigned short cci = 0;
  if (*s++ != 0x0a)
    return;
  while (1) {
    unsigned char tag, data;
    if ((s - start + 1) % 5 == 0)
      s++;
    if (s >= end)
      return;
    tag = *s++;
    if ((s - start + 1) % 5 == 0)
      s++;
    if (s >= end)
      return;
    data = *s++;
    switch (tag) {
    case 0x07:
      return;
    case 0xaa:
      cci = (cci & 0xff) | (((unsigned short)data) << 8);
      break;
    case 0xa5:
      cci = (cci & 0xff00) | data;
      break;
    case 0x5a:
      image_data_set(idata, cci, data);
      cci += 1;
      break;
    case 0x55:
      if (data != 0x07) {
        printf("Invalid NULL data byte 0x%02x\n", data);
        return;
      }
      cci += 1;
      break;
    default:
      printf("Illegal tag 0x%02x\n", tag);
      return;
    }
  }
}
```