user: 请将以下的汇编代码转换成C语言代码:

```asm
<print_transport_type>:
  endbr64
  push   %r12
  push   %rbp
  push   %rbx
  mov    0x378(%rdi),%ebx
  test   %ebx,%ebx
  je     L116
  cmp    $0xffff,%ebx
  je     L116
  mov    0x37c(%rdi),%r12d
  lea    D13(%rip),%rsi
  lea    D28(%rip),%rdi
  mov    $0x0,%eax
  call   <printf@plt>
  mov    %ebx,%ebp
  sar    $0xc,%ebp
  je     L106
  cmp    $0x1,%ebp
  je     L247
  mov    %ebx,%esi
  lea    D34(%rip),%rdi
  mov    $0x0,%eax
  call   <printf@plt>
L188:
  test   %r12d,%r12d
  je     L73
  cmp    $0xffff,%r12d
  jne    L123
L73:
  mov    $0xa,%edi
  call   <putchar@plt>
  jmp    L3
L106:
  lea    D27(%rip),%rdi
  mov    $0x0,%eax
  call   <printf@plt>
  test   $0x1,%bl
  je     L188
  lea    D52(%rip),%rdi
  mov    $0x0,%eax
  call   <printf@plt>
  jmp    L188
L247:
  lea    D100(%rip),%rdi
  mov    $0x0,%eax
  call   <printf@plt>
  test   $0x2f,%bl
  je     L188
  test   $0x1,%bl
  jne    L228
L66:
  test   $0x2,%bl
  jne    L113
L86:
  test   $0x4,%bl
  jne    L114
L199:
  test   $0x8,%bl
  jne    L117
L109:
  test   $0x10,%bl
  jne    L182
L249:
  test   $0x20,%bl
  je     L188
  lea    D75(%rip),%rdi
  mov    $0x0,%eax
  call   <printf@plt>
  jmp    L188
L228:
  lea    D93(%rip),%rdi
  mov    $0x0,%eax
  call   <printf@plt>
  jmp    L66
L113:
  lea    D122(%rip),%rdi
  mov    $0x0,%eax
  call   <printf@plt>
  jmp    L86
L114:
  lea    D81(%rip),%rdi
  mov    $0x0,%eax
  call   <printf@plt>
  jmp    L199
L117:
  lea    D9(%rip),%rdi
  mov    $0x0,%eax
  call   <printf@plt>
  jmp    L109
L182:
  lea    D92(%rip),%rdi
  mov    $0x0,%eax
  call   <printf@plt>
  jmp    L249
L123:
  lea    D68(%rip),%rdi
  mov    $0x0,%eax
  call   <printf@plt>
  cmp    $0x21,%r12d
  je     L62
  mov    %r12d,%esi
  lea    D34(%rip),%rdi
  mov    $0x0,%eax
  call   <printf@plt>
  jmp    L73
L62:
  lea    D73(%rip),%rdi
  mov    $0x0,%eax
  call   <printf@plt>
  jmp    L73
L116:
  mov    $0x0,%ebp
L3:
  mov    %ebp,%eax
  pop    %rbx
  pop    %rbp
  pop    %r12
  ret
```

tool_calls: name: retrieve_data
arguments: data_tag: D13
type_guessed: string
name: retrieve_data
arguments: data_tag: D28
type_guessed: string
name: retrieve_data
arguments: data_tag: D34
type_guessed: string
name: retrieve_data
arguments: data_tag: D27
type_guessed: string
name: retrieve_data
arguments: data_tag: D52
type_guessed: string
name: retrieve_data
arguments: data_tag: D100
type_guessed: string
name: retrieve_data
arguments: data_tag: D75
type_guessed: string
name: retrieve_data
arguments: data_tag: D93
type_guessed: string
name: retrieve_data
arguments: data_tag: D122
type_guessed: string
name: retrieve_data
arguments: data_tag: D81
type_guessed: string
name: retrieve_data
arguments: data_tag: D9
type_guessed: string
name: retrieve_data
arguments: data_tag: D92
type_guessed: string
name: retrieve_data
arguments: data_tag: D68
type_guessed: string
name: retrieve_data
arguments: data_tag: D73
type_guessed: string

tool: D13: Transport:

tool: D28: 	%-20s

tool: D34: 0x%04x

tool: D27: Parallel

tool: D52: , ATA8-APT

tool: D100: Serial

tool: D75: , SATA Rev 3.0

tool: D93: , ATA8-AST

tool: D122: , SATA 1.0a

tool: D81: , SATA II Extensions

tool: D9: , SATA Rev 2.5

tool: D92: , SATA Rev 2.6

tool: D68: ; Revision: 

tool: D73: ATA8-AST T13 Project D1697 Revision 0b

assistant: ```c
int print_transport_type(__u16 val[]) {
  __u16 major = val[222], minor = val[223];
  unsigned int ttype, subtype, transport = 0;
  if (major == 0x0000 || major == 0xffff) {
    return transport;
  }
  printf("\t%-20s", "Transport:");
  ttype = major >> 12;
  subtype = major & 0xfff;
  transport = ttype;
  switch (ttype) {
  case 0:
    printf("Parallel");
    if (subtype & 1)
      printf(", ATA8-APT");
    break;
  case 1:
    printf("Serial");
    if (subtype & 0x2f) {
      if (subtype & (1 << 0))
        printf(", ATA8-AST");
      if (subtype & (1 << 1))
        printf(", SATA 1.0a");
      if (subtype & (1 << 2))
        printf(", SATA II Extensions");
      if (subtype & (1 << 3))
        printf(", SATA Rev 2.5");
      if (subtype & (1 << 4))
        printf(", SATA Rev 2.6");
      if (subtype & (1 << 5))
        printf(", SATA Rev 3.0");
    }
    break;
  default:
    printf("0x%04x", major);
    break;
  }
  if (minor != 0x0000 && minor != 0xffff) {
    printf("; Revision: ");
    switch (minor) {
    case 0x21:
      printf("ATA8-AST T13 Project D1697 Revision 0b");
      break;
    default:
      printf("0x%04x", minor);
    }
  }
  putchar('\n');
  return transport;
}
```