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

```asm
<dump_disk_ext>:
  endbr64
  test   %esi,%esi
  jle    L58
  push   %rbp
  push   %rbx
  mov    %rdi,%rbx
  sub    $0x8,%rsp
  mov    (%rdi),%eax
  cmp    $0x1,%eax
  je     L5
  sub    $0x2,%eax
  cmp    $0x1,%eax
  ja     L23
  cmp    $0x2,%esi
  jle    L27
  mov    0x4(%rdi),%eax
  lea    D11(%rip),%rdx
  lea    D144(%rip),%rcx
  lea    D33(%rip),%rbp
  lea    D67(%rip),%rsi
  test   $0x10,%al
  lea    D16(%rip),%rdi
  cmove  %rdx,%rcx
  test   $0x8,%al
  lea    D167(%rip),%rdx
  cmove  %rbp,%rdx
  test   $0x4,%al
  lea    D157(%rip),%rax
  cmove  %rax,%rsi
  xor    %eax,%eax
  call   <printf@plt>
  mov    0x8(%rbx),%eax
  test   $0x7f,%al
  je     L23
  test   $0x40,%al
  lea    D15(%rip),%r10
  lea    D5(%rip),%rdi
  cmove  %rbp,%r10
  test   $0x20,%al
  lea    D14(%rip),%r9
  cmove  %rbp,%rdi
  lea    D27(%rip),%r8
  test   $0x10,%al
  cmove  %rbp,%r9
  lea    D105(%rip),%rcx
  test   $0x8,%al
  push   %r10
  cmove  %rbp,%r8
  lea    D31(%rip),%rdx
  test   $0x4,%al
  push   %rdi
  cmove  %rbp,%rcx
  lea    D3(%rip),%rsi
  test   $0x2,%al
  cmove  %rbp,%rdx
  lea    D107(%rip),%rdi
  test   $0x1,%al
  cmove  %rbp,%rsi
  xor    %eax,%eax
  call   <printf@plt>
  pop    %rax
  pop    %rdx
L23:
  add    $0x8,%rsp
  pop    %rbx
  pop    %rbp
  ret
  xchg   %ax,%ax
L5:
  cmp    $0x1,%esi
  je     L27
  testb  $0x1,0x4(%rdi)
  lea    D170(%rip),%rax
  lea    D32(%rip),%rsi
  cmove  %rax,%rsi
  add    $0x8,%rsp
  lea    D35(%rip),%rdi
  xor    %eax,%eax
  pop    %rbx
  pop    %rbp
  jmp    1070 <printf@plt>
  nop
L27:
  add    $0x8,%rsp
  lea    D130(%rip),%rdi
  pop    %rbx
  pop    %rbp
  jmp    1060 <puts@plt>
  nopw   0x0(%rax,%rax,1)
L58:
  ret
```

tool_calls: name: parse_data
arguments: tag: D11
datatype: string
name: parse_data
arguments: tag: D144
datatype: string
name: parse_data
arguments: tag: D33
datatype: string
name: parse_data
arguments: tag: D67
datatype: string
name: parse_data
arguments: tag: D16
datatype: string
name: parse_data
arguments: tag: D167
datatype: string
name: parse_data
arguments: tag: D157
datatype: string
name: parse_data
arguments: tag: D15
datatype: string
name: parse_data
arguments: tag: D5
datatype: string
name: parse_data
arguments: tag: D14
datatype: string
name: parse_data
arguments: tag: D27
datatype: string
name: parse_data
arguments: tag: D105
datatype: string
name: parse_data
arguments: tag: D31
datatype: string
name: parse_data
arguments: tag: D3
datatype: string
name: parse_data
arguments: tag: D107
datatype: string
name: parse_data
arguments: tag: D170
datatype: string
name: parse_data
arguments: tag: D32
datatype: string
name: parse_data
arguments: tag: D35
datatype: string
name: parse_data
arguments: tag: D130
datatype: string

tool: D11: Single

tool: D144: Dual

tool: 

tool: D67: Silicon

tool: D16: 	Disk features: %s, %s%s


tool: D167: Unique, 

tool: D157: Rotating

tool: D15: Iois16

tool: D5: Index, 

tool: D14: Reg inhibit, 

tool: D27: Low power, 

tool: D105: Idle, 

tool: D31: Standby, 

tool: D3: Sleep, 

tool: D107: 		%s%s%s%s%s%s%s


tool: D170: Undefined

tool: D32: IDE

tool: D35: 	Disk interface: %s


tool: D130: 	Wrong length for fixed disk extension tuple

assistant: ```c
void dump_disk_ext(u_char *p, int len) {
  if (len < 1)
    return;
  switch (p[0]) {
  case 1:
    if (len < 2)
      goto err;
    printf("\tDisk interface: %s\n", (p[1] & 1) ? "IDE" : "Undefined");
    break;
  case 2:
  case 3:
    if (len < 3)
      goto err;
    printf("\tDisk features: %s, %s%s\n", (p[1] & 0x04) ? "Silicon" : "Rotating", (p[1] & 0x08) ? "Unique, " : "", (p[1] & 0x10) ? "Dual" : "Single");
    if (p[2] & 0x7f)
      printf("\t\t%s%s%s%s%s%s%s\n", (p[2] & 0x01) ? "Sleep, " : "", (p[2] & 0x02) ? "Standby, " : "", (p[2] & 0x04) ? "Idle, " : "", (p[2] & 0x08) ? "Low power, " : "", (p[2] & 0x10) ? "Reg inhibit, " : "", (p[2] & 0x20) ? "Index, " : "", (p[2] & 0x40) ? "Iois16" : "");
    break;
  err:
    printf("\tWrong length for fixed disk extension tuple\n");
    return;
  }
}
```