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

```asm
<dump_network_ext>:
  endbr64
  test   %esi,%esi
  jle    L21
  push   %r12
  push   %rbp
  push   %rbx
  mov    %rdi,%rbx
  cmpl   $0x5,(%rdi)
  ja     L130
  mov    (%rdi),%eax
  lea    D76(%rip),%rdx
  movslq (%rdx,%rax,4),%rax
  add    %rdx,%rax
  notrack jmp *%rax
  cmp    $0x1,%esi
  jle    L93
  mov    0x4(%rdi),%eax
  and    $0x7,%eax
  lea    D26(%rip),%rdx
  mov    (%rdx,%rax,8),%rsi
  lea    D13(%rip),%rdi
  mov    $0x0,%eax
  call   <printf@plt>
  jmp    L130
  cmp    $0x4,%esi
  jg     L83
L93:
  lea    D88(%rip),%rdi
  call   <puts@plt>
L130:
  pop    %rbx
  pop    %rbp
  pop    %r12
  ret
L83:
  lea    D52(%rip),%rdi
  mov    $0x0,%eax
  call   <printf@plt>
  mov    0x10(%rbx),%edi
  shl    $0x18,%edi
  mov    0xc(%rbx),%eax
  shl    $0x10,%eax
  or     %eax,%edi
  or     0x4(%rbx),%edi
  mov    0x8(%rbx),%eax
  shl    $0x8,%eax
  or     %eax,%edi
  call   <print_speed@plt>
  mov    $0xa,%edi
  call   <putchar@plt>
  jmp    L130
  cmp    $0x1,%esi
  jle    L93
  mov    0x4(%rdi),%eax
  cmp    $0xb,%eax
  mov    $0x0,%edx
  cmovge %edx,%eax
  cltq
  lea    D110(%rip),%rdx
  mov    (%rdx,%rax,8),%rsi
  lea    D34(%rip),%rdi
  mov    $0x0,%eax
  call   <printf@plt>
  jmp    L130
  cmp    $0x2,%esi
  jle    L93
  mov    0x4(%rdi),%eax
  add    $0x1,%eax
  cmp    %esi,%eax
  jge    L93
  lea    D42(%rip),%rdi
  mov    $0x0,%eax
  call   <printf@plt>
  cmpl   $0x0,0x4(%rbx)
  je     L115
  mov    $0x0,%ebp
  lea    D102(%rip),%r12
L147:
  mov    0x8(%rbx,%rbp,4),%esi
  mov    %r12,%rdi
  mov    $0x0,%eax
  call   <printf@plt>
  add    $0x1,%rbp
  movslq 0x4(%rbx),%rax
  cmp    %rbp,%rax
  ja     L147
L115:
  mov    $0xa,%edi
  call   <putchar@plt>
  jmp    L130
  cmp    $0x1,%esi
  jle    L93
  cmpl   $0x0,0x4(%rdi)
  lea    D37(%rip),%rsi
  lea    D43(%rip),%rax
  cmovne %rax,%rsi
  lea    D96(%rip),%rdi
  mov    $0x0,%eax
  call   <printf@plt>
  jmp    L130
L21:
  ret
```

tool_calls: name: retrieve_data
arguments: label: D13
type: string
name: retrieve_data
arguments: label: D88
type: string
name: retrieve_data
arguments: label: D52
type: string
name: retrieve_data
arguments: label: D34
type: string
name: retrieve_data
arguments: label: D42
type: string
name: retrieve_data
arguments: label: D102
type: string
name: retrieve_data
arguments: label: D37
type: string
name: retrieve_data
arguments: label: D43
type: string
name: retrieve_data
arguments: label: D96
type: string

tool: D13: 	Network technology: %s


tool: D88: 	Wrong length for network extension tuple

tool: D52: 	Network speed: 

tool: D34: 	Network media: %s


tool: D42: 	Network node ID:

tool: D102:  %02x

tool: D37: open

tool: D43: closed

tool: D96: 	Network connector: %s connector standard


assistant: ```c
void dump_network_ext(u_char *p, int len) {
  static const char *tech[] = {"Undefined", "ARCnet", "Ethernet", "Token ring", "Localtalk", "FDDI/CDDI", "ATM", "Wireless"};
  static const char *media[] = {"Undefined", "UTP", "STP", "Thin coax", "THICK coax", "Fiber", "900 MHz", "2.4 GHz", "5.4 GHz", "Diffuse Infrared", "Point to point Infrared"};
  u_int i = 0;
  if (len < 1)
    return;
  switch (p[0]) {
  case 1:
    if (len < 2)
      goto err;
    printf("\tNetwork technology: %s\n", tech[p[1] & 7]);
    break;
  case 2:
    if (len < 5)
      goto err;
    printf("\tNetwork speed: ");
    print_speed(((*((p + 1) + 3) << 24) | (*((p + 1) + 2) << 16) | (*((p + 1) + 1) << 8) | *(p + 1)));
    putchar('\n');
    break;
  case 3:
    if (len < 2)
      goto err;
    if (p[1] <= 10)
      i = p[1];
    printf("\tNetwork media: %s\n", media[i]);
    break;
  case 4:
    if (len <= 2 || len < p[1] + 2)
      goto err;
    printf("\tNetwork node ID:");
    for (i = 0; i < p[1]; i++)
      printf(" %02x", p[i + 2]);
    putchar('\n');
    break;
  case 5:
    if (len < 2)
      goto err;
    printf("\tNetwork connector: %s connector standard\n", (p[1] == 0) ? "open" : "closed");
    break;
  err:
    printf("\tWrong length for network extension tuple\n");
    return;
  }
}
```