user: Converte this assembly snippet into its equivalent C code:

```asm
<squirrel_wifi_frame>:
  endbr64
  push   %r14
  push   %r13
  mov    %rsi,%r13
  lea    D34(%rip),%rsi
  push   %r12
  mov    %rdx,%r12
  push   %rbp
  push   %rbx
  movzbl (%rdx),%ebx
  mov    %ebx,%edx
  and    $0x3,%edx
  movzbl %dl,%edx
  jne    L53
  mov    %rdi,%rbp
  mov    %ecx,%edx
  mov    %r12,%rsi
  mov    %r13,%rdi
  mov    %ecx,%r14d
  call   <squirrel_get_mac_address@plt>
  mov    %ebx,%eax
  shr    $0x4,%bl
  shr    $0x2,%al
  movzbl %bl,%ebx
  and    $0x3,%eax
  shl    $0x4,%ebx
  shl    $0x2,%eax
  or     %ebx,%eax
  cmp    $0xf0,%eax
  ja     L83
  cmp    $0x7f,%eax
  jbe    L36
  add    $0xffffff80,%eax
  cmp    $0x70,%eax
  ja     L83
  lea    D25(%rip),%rdx
  movslq (%rdx,%rax,4),%rax
  add    %rdx,%rax
  notrack jmp *%rax
L36:
  cmp    $0x54,%eax
  ja     L83
  cmp    $0x1f,%eax
  jbe    L10
  sub    $0x20,%eax
  cmp    $0x34,%eax
  ja     L83
  lea    D12(%rip),%rdx
  movslq (%rdx,%rax,4),%rax
  add    %rdx,%rax
  notrack jmp *%rax
  nopl   0x0(%rax,%rax,1)
L10:
  cmp    $0x8,%eax
  je     L87
  cmp    $0x10,%eax
  jne    L8
  pop    %rbx
  mov    %r14d,%ecx
  mov    %r12,%rdx
  mov    %r13,%rsi
  mov    %rbp,%rdi
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  jmp    11a0 <squirrel_wifi_associate_response@plt>
  nop
L8:
  test   %eax,%eax
  jne    L83
  pop    %rbx
  mov    %r14d,%ecx
  mov    %r12,%rdx
  mov    %r13,%rsi
  mov    %rbp,%rdi
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  jmp    11d0 <squirrel_wifi_associate_request@plt>
  nopl   (%rax)
L83:
  movzbl (%r12),%edx
  lea    D27(%rip),%rsi
L53:
  pop    %rbx
  mov    %r13,%rdi
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  jmp    11c0 <FRAMERR@plt>
  nopl   0x0(%rax)
  pop    %rbx
  mov    %r14d,%ecx
  mov    %r12,%rdx
  mov    %r13,%rsi
  mov    %rbp,%rdi
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  jmp    11b0 <squirrel_wifi_ctrl_frame@plt>
  nopl   0x0(%rax)
  pop    %rbx
  mov    %r14d,%ecx
  mov    %r12,%rdx
  mov    %r13,%rsi
  mov    %rbp,%rdi
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  jmp    1180 <squirrel_wifi_beacon@plt>
  nopl   0x0(%rax)
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  ret
  nopl   0x0(%rax)
  pop    %rbx
  mov    %r14d,%ecx
  mov    %r12,%rdx
  mov    %r13,%rsi
  mov    %rbp,%rdi
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  jmp    1140 <squirrel_wifi_proberequest@plt>
  nopl   0x0(%rax)
L87:
  pop    %rbx
  mov    %r14d,%ecx
  mov    %r12,%rdx
  mov    %r13,%rsi
  mov    %rbp,%rdi
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  jmp    1190 <squirrel_wifi_data@plt>
  nopl   0x0(%rax)
  pop    %rbx
  mov    %r14d,%ecx
  mov    %r12,%rdx
  mov    %r13,%rsi
  mov    %rbp,%rdi
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  jmp    1150 <squirrel_wifi_mgmt_action@plt>
  pop    %rbx
  mov    %r14d,%ecx
  mov    %r12,%rdx
  mov    %r13,%rsi
  mov    %rbp,%rdi
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  jmp    1160 <squirrel_wifi_ctrl_power_save_poll@plt>
  pop    %rbx
  mov    %r14d,%ecx
  mov    %r12,%rdx
  mov    %r13,%rsi
  mov    %rbp,%rdi
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  jmp    1110 <squirrel_wifi_deauthentication@plt>
  pop    %rbx
  mov    %r14d,%ecx
  mov    %r12,%rdx
  mov    %r13,%rsi
  mov    %rbp,%rdi
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  jmp    1170 <squirrel_wifi_authentication@plt>
  pop    %rbx
  mov    %r14d,%ecx
  mov    %r12,%rdx
  mov    %r13,%rsi
  mov    %rbp,%rdi
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  jmp    1130 <squirrel_wifi_disassociate@plt>
```

tool_calls: name: parse_data
arguments: label: D34
data_type: string
name: parse_data
arguments: label: D27
data_type: string

tool: D34: wifi packet corrupted, version=%d


tool: D27: unknown wifi packet [0x%02x]


assistant: ```c
void squirrel_wifi_frame(struct Squirrel *squirrel, struct NetFrame *frame, const unsigned char *px, unsigned length) {
  unsigned version, type, subtype;
  version = px[0] & 3;
  type = (px[0] >> 2) & 3;
  subtype = (px[0] >> 4) & 0xf;
  if (version != 0) {
    FRAMERR(frame, "wifi packet corrupted, version=%d\n", version);
    return;
  }
  squirrel_get_mac_address(frame, px, length);
  switch (((type) << 2) | ((subtype) << 4)) {
  case ((0) << 2) | ((0x0) << 4):
    squirrel_wifi_associate_request(squirrel, frame, px, length);
    break;
  case ((0) << 2) | ((0x1) << 4):
    squirrel_wifi_associate_response(squirrel, frame, px, length);
    break;
  case ((0) << 2) | ((0x2) << 4):
    squirrel_wifi_associate_request(squirrel, frame, px, length);
    break;
  case ((0) << 2) | ((0x3) << 4):
    squirrel_wifi_associate_response(squirrel, frame, px, length);
    break;
  case ((0) << 2) | ((0x4) << 4):
    squirrel_wifi_proberequest(squirrel, frame, px, length);
    break;
  case ((0) << 2) | ((0x5) << 4):
    squirrel_wifi_beacon(squirrel, frame, px, length);
    break;
  case ((0) << 2) | ((0x8) << 4):
    squirrel_wifi_beacon(squirrel, frame, px, length);
    break;
  case ((0) << 2) | ((0xD) << 4):
  case ((0) << 2) | ((0xe) << 4):
    squirrel_wifi_mgmt_action(squirrel, frame, px, length);
    break;
  case ((0) << 2) | ((0x9) << 4):
    FRAMERR(frame, "unknown wifi packet [0x%02x]\n", px[0]);
    break;
  case ((0) << 2) | ((0xa) << 4):
    squirrel_wifi_disassociate(squirrel, frame, px, length);
    break;
  case ((0) << 2) | ((0xb) << 4):
    squirrel_wifi_authentication(squirrel, frame, px, length);
    break;
  case ((0) << 2) | ((0xc) << 4):
    squirrel_wifi_deauthentication(squirrel, frame, px, length);
    break;
  case ((0) << 2) | ((0xf) << 4):
    break;
  case ((2) << 2) | ((0x0) << 4):
  case ((2) << 2) | ((0x4) << 4):
  case ((2) << 2) | ((0x8) << 4):
  case ((2) << 2) | ((0xc) << 4):
    squirrel_wifi_data(squirrel, frame, px, length);
    break;
  case ((1) << 2) | ((0x05) << 4):
    break;
  case ((1) << 2) | ((0x4) << 4):
    break;
  case ((1) << 2) | ((0xa) << 4):
    squirrel_wifi_ctrl_power_save_poll(squirrel, frame, px, length);
    break;
  case ((1) << 2) | ((0xb) << 4):
    squirrel_wifi_ctrl_frame(squirrel, frame, px, length);
    break;
  case ((1) << 2) | ((0xE) << 4):
    squirrel_wifi_ctrl_frame(squirrel, frame, px, length);
    break;
  case ((1) << 2) | ((0x8) << 4):
  case ((1) << 2) | ((0x9) << 4):
    squirrel_wifi_ctrl_frame(squirrel, frame, px, length);
    break;
  case ((1) << 2) | ((0xC) << 4):
  case ((1) << 2) | ((0xD) << 4):
    break;
  default:
    FRAMERR(frame, "unknown wifi packet [0x%02x]\n", px[0]);
  }
}
```