user: What would the C source look like for the assembly code provided here?

```asm
<process_8021q_vlan>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x30,%rsp
  mov    %rdi,-0x18(%rbp)
  mov    %rsi,-0x20(%rbp)
  mov    %rdx,-0x28(%rbp)
  mov    %ecx,-0x2c(%rbp)
  mov    %r8d,-0x30(%rbp)
  movl   $0x0,-0x8(%rbp)
  movl   $0x0,-0xc(%rbp)
  cmpl   $0x3,-0x2c(%rbp)
  jbe    L88
  nop
L80:
  mov    -0x28(%rbp),%rax
  movzbl (%rax),%eax
  movzbl %al,%eax
  shl    $0x8,%eax
  mov    %eax,%edx
  mov    -0x28(%rbp),%rax
  add    $0x1,%rax
  movzbl (%rax),%eax
  movzbl %al,%eax
  or     %edx,%eax
  and    $0xfff,%eax
  or     %eax,-0xc(%rbp)
  mov    -0x28(%rbp),%rax
  add    $0x2,%rax
  movzbl (%rax),%eax
  movzbl %al,%eax
  shl    $0x8,%eax
  mov    %eax,%edx
  mov    -0x28(%rbp),%rax
  add    $0x3,%rax
  movzbl (%rax),%eax
  movzbl %al,%eax
  or     %edx,%eax
  mov    %eax,-0x8(%rbp)
  cmpl   $0x600,-0x8(%rbp)
  ja     L94
  mov    -0x8(%rbp),%eax
  mov    %eax,-0x4(%rbp)
  addq   $0x4,-0x28(%rbp)
  subl   $0x4,-0x2c(%rbp)
  mov    -0x4(%rbp),%eax
  cmp    -0x2c(%rbp),%eax
  jbe    L99
  mov    -0x8(%rbp),%ecx
  mov    -0x8(%rbp),%edx
  mov    -0x20(%rbp),%rax
  mov    %ecx,%r8d
  mov    %edx,%ecx
  lea    D0(%rip),%rdx
  lea    D18(%rip),%rsi
  mov    %rax,%rdi
  call   <FRAMERR@plt>
  jmp    L64
L99:
  mov    -0x4(%rbp),%eax
  cmp    -0x2c(%rbp),%eax
  jae    L3
  mov    -0x4(%rbp),%eax
  mov    %eax,-0x2c(%rbp)
L3:
  mov    -0x2c(%rbp),%ecx
  mov    -0x28(%rbp),%rdx
  mov    -0x20(%rbp),%rsi
  mov    -0x18(%rbp),%rax
  mov    %rax,%rdi
  call   <process_llc_frame@plt>
  jmp    L64
L94:
  cmpl   $0x8100,-0x8(%rbp)
  je     L52
  cmpl   $0x9100,-0x8(%rbp)
  je     L52
  cmpl   $0x88a8,-0x8(%rbp)
  jne    L6
L52:
  addq   $0x4,-0x28(%rbp)
  subl   $0x4,-0x2c(%rbp)
  shll   $0xc,-0xc(%rbp)
  jmp    L80
L6:
  mov    -0x2c(%rbp),%eax
  lea    -0x4(%rax),%ecx
  mov    -0x28(%rbp),%rax
  lea    0x4(%rax),%rdx
  mov    -0x8(%rbp),%r8d
  mov    -0x30(%rbp),%edi
  mov    -0x20(%rbp),%rsi
  mov    -0x18(%rbp),%rax
  mov    %r8d,%r9d
  mov    %edi,%r8d
  mov    %rax,%rdi
  call   <dispatch_ethertype@plt>
  jmp    L64
L88:
  nop
L64:
  leave
  ret
```

tool_calls: name: disassemble_data
arguments: tag: D0
datatype: string
name: disassemble_data
arguments: tag: D18
datatype: string

tool: D0: ethertype

tool: D18: %s: unknown value: 0x%x (%d)


assistant: ```c
void process_8021q_vlan(struct Ferret *ferret, struct NetFrame *frame, const unsigned char *px, unsigned length, unsigned oui) {
  unsigned ethertype = 0;
  unsigned vlan_id = 0;
  if (length < 4)
    return;
q_in_q:
  vlan_id |= (*((unsigned char *)(px + 0) + 0) << 8 | *((unsigned char *)(px + 0) + 1) << 0) & 0xFFF;
  ethertype = (*((unsigned char *)(px + 2) + 0) << 8 | *((unsigned char *)(px + 2) + 1) << 0);
  if (ethertype <= 1536) {
    unsigned new_length = ethertype;
    px += 4;
    length -= 4;
    if (new_length > length) {
      FRAMERR(frame, "%s: unknown value: 0x%x (%d)\n", "ethertype", ethertype, ethertype);
      ;
      return;
    } else if (new_length < length)
      length = new_length;
    process_llc_frame(ferret, frame, px, length);
    return;
  } else if (ethertype == 0x8100 || ethertype == 0x9100 || ethertype == 0x88a8) {
    px += 4;
    length -= 4;
    vlan_id <<= 12;
    goto q_in_q;
  } else {
    dispatch_ethertype(ferret, frame, px + 4, length - 4, oui, ethertype);
  }
}
```