user: Please show me the C implementation that matches the assembly code listed below:

```asm
<rose_dump>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  push   %rbx
  sub    $0x38,%rsp
  mov    %rdi,-0x38(%rbp)
  mov    %esi,-0x3c(%rbp)
  mov    %edx,-0x40(%rbp)
  mov    -0x38(%rbp),%rax
  movzbl (%rax),%eax
  movzbl %al,%eax
  shl    $0x8,%eax
  and    $0xf00,%eax
  mov    %eax,%edx
  mov    -0x38(%rbp),%rax
  add    $0x1,%rax
  movzbl (%rax),%eax
  movzbl %al,%eax
  add    %edx,%eax
  mov    %eax,-0x24(%rbp)
  mov    -0x24(%rbp),%eax
  mov    %eax,%edx
  lea    D392(%rip),%rax
  mov    %rax,%rsi
  mov    $0xb,%edi
  mov    $0x0,%eax
  call   <lprintf@plt>
  mov    -0x38(%rbp),%rax
  add    $0x2,%rax
  movzbl (%rax),%eax
  movzbl %al,%eax
  cmp    $0x27,%eax
  jg     L422
  cmp    $0xb,%eax
  jge    L283
  jmp    L44
L68:
  sub    $0xf1,%eax
  cmp    $0xe,%eax
  ja     L44
  mov    %eax,%eax
  lea    0x0(,%rax,4),%rdx
  lea    D408(%rip),%rax
  mov    (%rdx,%rax,1),%eax
  cltq
  lea    D408(%rip),%rdx
  add    %rdx,%rax
  notrack jmp *%rax
L283:
  sub    $0xb,%eax
  cmp    $0x1c,%eax
  ja     L44
  mov    %eax,%eax
  lea    0x0(,%rax,4),%rdx
  lea    D107(%rip),%rax
  mov    (%rdx,%rax,1),%eax
  cltq
  lea    D107(%rip),%rdx
  add    %rdx,%rax
  notrack jmp *%rax
L422:
  cmp    $0xff,%eax
  jg     L44
  cmp    $0xf1,%eax
  jge    L68
  jmp    L44
  movl   $0x4,-0x20(%rbp)
  mov    -0x38(%rbp),%rax
  add    $0x3,%rax
  movzbl (%rax),%eax
  shr    $0x4,%al
  movzbl %al,%eax
  and    $0xf,%eax
  add    $0x1,%eax
  mov    %eax,%edx
  shr    $0x1f,%edx
  add    %edx,%eax
  sar    %eax
  mov    %eax,-0x1c(%rbp)
  mov    -0x38(%rbp),%rax
  add    $0x3,%rax
  movzbl (%rax),%eax
  movzbl %al,%eax
  and    $0xf,%eax
  add    $0x1,%eax
  mov    %eax,%edx
  shr    $0x1f,%edx
  add    %edx,%eax
  sar    %eax
  add    %eax,-0x1c(%rbp)
  mov    -0x1c(%rbp),%eax
  add    %eax,-0x20(%rbp)
  mov    -0x20(%rbp),%eax
  add    %rax,-0x38(%rbp)
  mov    -0x3c(%rbp),%eax
  sub    -0x20(%rbp),%eax
  mov    %eax,-0x3c(%rbp)
  lea    D311(%rip),%rax
  mov    %rax,%rsi
  mov    $0xb,%edi
  mov    $0x0,%eax
  call   <lprintf@plt>
  cmpl   $0x0,-0x3c(%rbp)
  je     L55
  mov    -0x38(%rbp),%rax
  movzbl (%rax),%eax
  movzbl %al,%eax
  add    $0x1,%eax
  mov    %eax,-0x18(%rbp)
  mov    -0x3c(%rbp),%edx
  mov    -0x38(%rbp),%rax
  mov    %edx,%esi
  mov    %rax,%rdi
  call   <facility@plt>
  mov    -0x3c(%rbp),%eax
  sub    -0x18(%rbp),%eax
  mov    %eax,-0x3c(%rbp)
  mov    -0x18(%rbp),%eax
  add    %rax,-0x38(%rbp)
  cmpl   $0x0,-0x3c(%rbp)
  jle    L348
  mov    -0x3c(%rbp),%ecx
  mov    -0x38(%rbp),%rax
  mov    $0x1,%edx
  mov    %ecx,%esi
  mov    %rax,%rdi
  call   <data_dump@plt>
  jmp    L348
L55:
  lea    D385(%rip),%rax
  mov    %rax,%rsi
  mov    $0xb,%edi
  mov    $0x0,%eax
  call   <lprintf@plt>
  jmp    L348
  lea    D125(%rip),%rax
  mov    %rax,%rsi
  mov    $0xb,%edi
  mov    $0x0,%eax
  call   <lprintf@plt>
  jmp    L183
  mov    -0x38(%rbp),%rax
  add    $0x4,%rax
  movzbl (%rax),%eax
  movzbl %al,%ebx
  mov    -0x38(%rbp),%rax
  add    $0x3,%rax
  movzbl (%rax),%eax
  movzbl %al,%eax
  mov    %eax,%edi
  call   <clear_code@plt>
  mov    %ebx,%ecx
  mov    %eax,%edx
  lea    D266(%rip),%rax
  mov    %rax,%rsi
  mov    $0xb,%edi
  mov    $0x0,%eax
  call   <lprintf@plt>
  cmpl   $0x6,-0x3c(%rbp)
  jle    L210
  mov    -0x3c(%rbp),%eax
  lea    -0x6(%rax),%edx
  mov    -0x38(%rbp),%rax
  add    $0x6,%rax
  mov    %edx,%esi
  mov    %rax,%rdi
  call   <facility@plt>
  jmp    L210
  lea    D75(%rip),%rax
  mov    %rax,%rsi
  mov    $0xb,%edi
  mov    $0x0,%eax
  call   <lprintf@plt>
  jmp    L183
  mov    -0x38(%rbp),%rax
  add    $0x3,%rax
  movzbl (%rax),%eax
  movzbl %al,%eax
  mov    %eax,%edx
  lea    D280(%rip),%rax
  mov    %rax,%rsi
  mov    $0xb,%edi
  mov    $0x0,%eax
  call   <lprintf@plt>
  jmp    L183
  lea    D197(%rip),%rax
  mov    %rax,%rsi
  mov    $0xb,%edi
  mov    $0x0,%eax
  call   <lprintf@plt>
  mov    -0x3c(%rbp),%eax
  lea    -0x3(%rax),%esi
  mov    -0x38(%rbp),%rax
  lea    0x3(%rax),%rcx
  mov    -0x40(%rbp),%eax
  mov    %eax,%edx
  mov    %rcx,%rdi
  call   <data_dump@plt>
  jmp    L183
  lea    D288(%rip),%rax
  mov    %rax,%rsi
  mov    $0xb,%edi
  mov    $0x0,%eax
  call   <lprintf@plt>
  jmp    L183
  mov    -0x38(%rbp),%rax
  add    $0x4,%rax
  movzbl (%rax),%eax
  movzbl %al,%ebx
  mov    -0x38(%rbp),%rax
  add    $0x3,%rax
  movzbl (%rax),%eax
  movzbl %al,%eax
  mov    %eax,%edi
  call   <reset_code@plt>
  mov    %ebx,%ecx
  mov    %eax,%edx
  lea    D163(%rip),%rax
  mov    %rax,%rsi
  mov    $0xb,%edi
  mov    $0x0,%eax
  call   <lprintf@plt>
  jmp    L183
  lea    D235(%rip),%rax
  mov    %rax,%rsi
  mov    $0xb,%edi
  mov    $0x0,%eax
  call   <lprintf@plt>
  jmp    L183
  mov    -0x38(%rbp),%rax
  add    $0x4,%rax
  movzbl (%rax),%eax
  movzbl %al,%ebx
  mov    -0x38(%rbp),%rax
  add    $0x3,%rax
  movzbl (%rax),%eax
  movzbl %al,%eax
  mov    %eax,%edi
  call   <restart_code@plt>
  mov    %ebx,%ecx
  mov    %eax,%edx
  lea    D400(%rip),%rax
  mov    %rax,%rsi
  mov    $0xb,%edi
  mov    $0x0,%eax
  call   <lprintf@plt>
  jmp    L183
  lea    D189(%rip),%rax
  mov    %rax,%rsi
  mov    $0xb,%edi
  mov    $0x0,%eax
  call   <lprintf@plt>
  jmp    L183
  lea    D168(%rip),%rax
  mov    %rax,%rsi
  mov    $0xb,%edi
  mov    $0x0,%eax
  call   <lprintf@plt>
  jmp    L183
  lea    D300(%rip),%rax
  mov    %rax,%rsi
  mov    $0xb,%edi
  mov    $0x0,%eax
  call   <lprintf@plt>
  jmp    L183
L44:
  mov    -0x38(%rbp),%rax
  add    $0x2,%rax
  movzbl (%rax),%eax
  movzbl %al,%eax
  and    $0x1,%eax
  test   %eax,%eax
  jne    L0
  mov    -0x38(%rbp),%rax
  add    $0x2,%rax
  movzbl (%rax),%eax
  movzbl %al,%eax
  and    $0x10,%eax
  test   %eax,%eax
  je     L182
  lea    D127(%rip),%rax
  jmp    L296
L182:
  lea    D89(%rip),%rax
L296:
  mov    -0x38(%rbp),%rdx
  movzbl (%rdx),%edx
  movzbl %dl,%edx
  and    $0x40,%edx
  test   %edx,%edx
  je     L442
  lea    D347(%rip),%rcx
  jmp    L187
L442:
  lea    D89(%rip),%rcx
L187:
  mov    -0x38(%rbp),%rdx
  movzbl (%rdx),%edx
  test   %dl,%dl
  jns    L338
  lea    D2(%rip),%rdx
  jmp    L346
L338:
  lea    D89(%rip),%rdx
L346:
  mov    -0x38(%rbp),%rsi
  add    $0x2,%rsi
  movzbl (%rsi),%esi
  shr    %sil
  movzbl %sil,%esi
  mov    %esi,%edi
  and    $0x7,%edi
  mov    -0x38(%rbp),%rsi
  add    $0x2,%rsi
  movzbl (%rsi),%esi
  shr    $0x5,%sil
  movzbl %sil,%esi
  and    $0x7,%esi
  sub    $0x8,%rsp
  push   %rax
  mov    %rcx,%r9
  mov    %rdx,%r8
  mov    %edi,%ecx
  mov    %esi,%edx
  lea    D65(%rip),%rax
  mov    %rax,%rsi
  mov    $0xb,%edi
  mov    $0x0,%eax
  call   <lprintf@plt>
  add    $0x10,%rsp
  cmpl   $0x4,-0x3c(%rbp)
  jle    L97
  mov    -0x38(%rbp),%rax
  movzbl (%rax),%eax
  test   %al,%al
  jns    L97
  mov    -0x38(%rbp),%rax
  add    $0x3,%rax
  movzbl (%rax),%eax
  cmp    $0x7f,%al
  jne    L97
  mov    -0x38(%rbp),%rax
  add    $0x4,%rax
  movzbl (%rax),%eax
  movzbl %al,%eax
  mov    %eax,-0x14(%rbp)
  addq   $0x5,-0x38(%rbp)
  subl   $0x5,-0x3c(%rbp)
  cmpl   $0xf0,-0x14(%rbp)
  jg     L532
  cmpl   $0xc3,-0x14(%rbp)
  jge    L101
  cmpl   $0x1,-0x14(%rbp)
  je     L295
  cmpl   $0x8,-0x14(%rbp)
  je     L20
  jmp    L532
L101:
  mov    -0x14(%rbp),%eax
  sub    $0xc3,%eax
  cmp    $0x2d,%eax
  ja     L532
  mov    %eax,%eax
  lea    0x0(,%rax,4),%rdx
  lea    D146(%rip),%rax
  mov    (%rdx,%rax,1),%eax
  cltq
  lea    D146(%rip),%rdx
  add    %rdx,%rax
  notrack jmp *%rax
L20:
  mov    -0x3c(%rbp),%eax
  sub    $0x5,%eax
  mov    %eax,%edx
  lea    D352(%rip),%rax
  mov    %rax,%rsi
  mov    $0xb,%edi
  mov    $0x0,%eax
  call   <lprintf@plt>
  mov    -0x40(%rbp),%edx
  mov    -0x3c(%rbp),%ecx
  mov    -0x38(%rbp),%rax
  mov    %ecx,%esi
  mov    %rax,%rdi
  call   <data_dump@plt>
  jmp    L194
  mov    -0x3c(%rbp),%eax
  sub    $0x5,%eax
  mov    %eax,%edx
  lea    D160(%rip),%rax
  mov    %rax,%rsi
  mov    $0xb,%edi
  mov    $0x0,%eax
  call   <lprintf@plt>
  mov    -0x3c(%rbp),%edx
  mov    -0x38(%rbp),%rax
  mov    %edx,%esi
  mov    %rax,%rdi
  call   <arp_dump@plt>
  jmp    L194
  mov    -0x3c(%rbp),%eax
  sub    $0x5,%eax
  mov    %eax,%edx
  lea    D305(%rip),%rax
  mov    %rax,%rsi
  mov    $0xb,%edi
  mov    $0x0,%eax
  call   <lprintf@plt>
  mov    -0x40(%rbp),%edx
  mov    -0x3c(%rbp),%esi
  mov    -0x38(%rbp),%rax
  mov    $0x0,%ecx
  mov    %rax,%rdi
  call   <netrom_dump@plt>
  jmp    L194
  mov    -0x3c(%rbp),%eax
  sub    $0x5,%eax
  mov    %eax,%edx
  lea    D83(%rip),%rax
  mov    %rax,%rsi
  mov    $0xb,%edi
  mov    $0x0,%eax
  call   <lprintf@plt>
  mov    -0x40(%rbp),%edx
  mov    -0x3c(%rbp),%ecx
  mov    -0x38(%rbp),%rax
  mov    %ecx,%esi
  mov    %rax,%rdi
  call   <ip_dump@plt>
  jmp    L194
L295:
  mov    -0x3c(%rbp),%eax
  sub    $0x5,%eax
  mov    %eax,%edx
  lea    D405(%rip),%rax
  mov    %rax,%rsi
  mov    $0xb,%edi
  mov    $0x0,%eax
  call   <lprintf@plt>
  mov    -0x40(%rbp),%edx
  mov    -0x3c(%rbp),%ecx
  mov    -0x38(%rbp),%rax
  mov    %ecx,%esi
  mov    %rax,%rdi
  call   <rose_dump>
  jmp    L194
  mov    -0x3c(%rbp),%eax
  sub    $0x5,%eax
  mov    %eax,%edx
  lea    D106(%rip),%rax
  mov    %rax,%rsi
  mov    $0xb,%edi
  mov    $0x0,%eax
  call   <lprintf@plt>
  mov    -0x40(%rbp),%edx
  mov    -0x3c(%rbp),%ecx
  mov    -0x38(%rbp),%rax
  mov    %ecx,%esi
  mov    %rax,%rdi
  call   <data_dump@plt>
  jmp    L194
  mov    -0x3c(%rbp),%eax
  sub    $0x5,%eax
  mov    %eax,%edx
  lea    D139(%rip),%rax
  mov    %rax,%rsi
  mov    $0xb,%edi
  mov    $0x0,%eax
  call   <lprintf@plt>
  mov    -0x40(%rbp),%edx
  mov    -0x3c(%rbp),%ecx
  mov    -0x38(%rbp),%rax
  mov    %ecx,%esi
  mov    %rax,%rdi
  call   <flexnet_dump@plt>
  jmp    L194
  mov    -0x3c(%rbp),%eax
  sub    $0x5,%eax
  mov    %eax,%edx
  lea    D177(%rip),%rax
  mov    %rax,%rsi
  mov    $0xb,%edi
  mov    $0x0,%eax
  call   <lprintf@plt>
  mov    -0x40(%rbp),%edx
  mov    -0x3c(%rbp),%ecx
  mov    -0x38(%rbp),%rax
  mov    %ecx,%esi
  mov    %rax,%rdi
  call   <data_dump@plt>
  jmp    L194
L532:
  mov    -0x3c(%rbp),%eax
  lea    -0x5(%rax),%edx
  mov    -0x14(%rbp),%eax
  mov    %edx,%ecx
  mov    %eax,%edx
  lea    D393(%rip),%rax
  mov    %rax,%rsi
  mov    $0xb,%edi
  mov    $0x0,%eax
  call   <lprintf@plt>
  mov    -0x40(%rbp),%edx
  mov    -0x3c(%rbp),%ecx
  mov    -0x38(%rbp),%rax
  mov    %ecx,%esi
  mov    %rax,%rdi
  call   <data_dump@plt>
  nop
L194:
  nop
  jmp    L183
L97:
  mov    -0x3c(%rbp),%eax
  sub    $0x3,%eax
  mov    %eax,%edx
  lea    D352(%rip),%rax
  mov    %rax,%rsi
  mov    $0xb,%edi
  mov    $0x0,%eax
  call   <lprintf@plt>
  mov    -0x3c(%rbp),%eax
  lea    -0x3(%rax),%esi
  mov    -0x38(%rbp),%rax
  lea    0x3(%rax),%rcx
  mov    -0x40(%rbp),%eax
  mov    %eax,%edx
  mov    %rcx,%rdi
  call   <data_dump@plt>
  jmp    L183
L0:
  mov    -0x38(%rbp),%rax
  add    $0x2,%rax
  movzbl (%rax),%eax
  movzbl %al,%eax
  and    $0x1f,%eax
  cmp    $0x9,%eax
  je     L81
  cmp    $0x9,%eax
  jg     L137
  cmp    $0x1,%eax
  je     L120
  cmp    $0x5,%eax
  je     L42
  jmp    L137
L120:
  mov    -0x38(%rbp),%rax
  add    $0x2,%rax
  movzbl (%rax),%eax
  shr    $0x5,%al
  movzbl %al,%eax
  and    $0x7,%eax
  mov    %eax,%edx
  lea    D396(%rip),%rax
  mov    %rax,%rsi
  mov    $0xb,%edi
  mov    $0x0,%eax
  call   <lprintf@plt>
  jmp    L183
L42:
  mov    -0x38(%rbp),%rax
  add    $0x2,%rax
  movzbl (%rax),%eax
  shr    $0x5,%al
  movzbl %al,%eax
  and    $0x7,%eax
  mov    %eax,%edx
  lea    D50(%rip),%rax
  mov    %rax,%rsi
  mov    $0xb,%edi
  mov    $0x0,%eax
  call   <lprintf@plt>
  jmp    L183
L81:
  mov    -0x38(%rbp),%rax
  add    $0x2,%rax
  movzbl (%rax),%eax
  shr    $0x5,%al
  movzbl %al,%eax
  and    $0x7,%eax
  mov    %eax,%edx
  lea    D302(%rip),%rax
  mov    %rax,%rsi
  mov    $0xb,%edi
  mov    $0x0,%eax
  call   <lprintf@plt>
  jmp    L183
L137:
  lea    D395(%rip),%rax
  mov    %rax,%rsi
  mov    $0xb,%edi
  mov    $0x0,%eax
  call   <lprintf@plt>
  mov    -0x3c(%rbp),%ecx
  mov    -0x38(%rbp),%rax
  mov    $0x1,%edx
  mov    %ecx,%esi
  mov    %rax,%rdi
  call   <data_dump@plt>
  jmp    L183
L348:
  nop
  jmp    L183
L210:
  nop
L183:
  mov    -0x8(%rbp),%rbx
  leave
  ret
```

tool_calls: name: retrieve_data
arguments: tag: D392
type_guessed: string
name: retrieve_data
arguments: tag: D311
type_guessed: string
name: retrieve_data
arguments: tag: D385
type_guessed: string
name: retrieve_data
arguments: tag: D125
type_guessed: string
name: retrieve_data
arguments: tag: D266
type_guessed: string
name: retrieve_data
arguments: tag: D75
type_guessed: string
name: retrieve_data
arguments: tag: D280
type_guessed: string
name: retrieve_data
arguments: tag: D197
type_guessed: string
name: retrieve_data
arguments: tag: D288
type_guessed: string
name: retrieve_data
arguments: tag: D163
type_guessed: string
name: retrieve_data
arguments: tag: D235
type_guessed: string
name: retrieve_data
arguments: tag: D400
type_guessed: string
name: retrieve_data
arguments: tag: D189
type_guessed: string
name: retrieve_data
arguments: tag: D168
type_guessed: string
name: retrieve_data
arguments: tag: D300
type_guessed: string
name: retrieve_data
arguments: tag: D127
type_guessed: string
name: retrieve_data
arguments: tag: D89
type_guessed: string
name: retrieve_data
arguments: tag: D347
type_guessed: string
name: retrieve_data
arguments: tag: D2
type_guessed: string
name: retrieve_data
arguments: tag: D65
type_guessed: string
name: retrieve_data
arguments: tag: D352
type_guessed: string
name: retrieve_data
arguments: tag: D160
type_guessed: string
name: retrieve_data
arguments: tag: D305
type_guessed: string
name: retrieve_data
arguments: tag: D83
type_guessed: string
name: retrieve_data
arguments: tag: D405
type_guessed: string
name: retrieve_data
arguments: tag: D106
type_guessed: string
name: retrieve_data
arguments: tag: D139
type_guessed: string
name: retrieve_data
arguments: tag: D177
type_guessed: string
name: retrieve_data
arguments: tag: D393
type_guessed: string
name: retrieve_data
arguments: tag: D396
type_guessed: string
name: retrieve_data
arguments: tag: D50
type_guessed: string
name: retrieve_data
arguments: tag: D302
type_guessed: string
name: retrieve_data
arguments: tag: D395
type_guessed: string

tool: D392: X.25: LCI %3.3X : 

tool: D311: CALL REQUEST - 

tool: D385: 


tool: D125: CALL ACCEPTED


tool: D266: CLEAR REQUEST - Cause %s - Diag %d


tool: D75: CLEAR CONFIRMATION


tool: D280: DIAGNOSTIC - Diag %d


tool: D197: INTERRUPT


tool: D288: INTERRUPT CONFIRMATION


tool: D163: RESET REQUEST - Cause %s - Diag %d


tool: D235: RESET CONFIRMATION


tool: D400: RESTART REQUEST - Cause %s - Diag %d


tool: D189: RESTART CONFIRMATION


tool: D168: REGISTRATION REQUEST


tool: D300: REGISTRATION CONFIRMATION


tool: D127: M

tool: 

tool: D347: D

tool: D2: Q

tool: D65: DATA R%d S%d %s%s%s

tool: D352:  len %d


tool: D160:  pid=ARP len %d


tool: D305:  pid=NET/ROM len %d


tool: D83:  pid=IP len %d


tool: D405:  pid=X.25 len %d


tool: D106:  pid=TEXNET len %d


tool: D139:  pid=FLEXNET len %d


tool: D177:  pid=Text len %d


tool: D393:  pid=0x%x len %d


tool: D396: RR R%d


tool: D50: RNR R%d


tool: D302: REJ R%d


tool: D395: UNKNOWN


assistant: ```c
void rose_dump(unsigned char *data, int length, int hexdump) {
  unsigned int len, hlen;
  unsigned int lci = ((unsigned)(data[0] & 0x0F) << 8) + data[1];
  lprintf(11, "X.25: LCI %3.3X : ", lci);
  switch (data[2]) {
  case 0x0B:
    len = 4;
    hlen = (((data[3] >> 4) & 0x0F) + 1) / 2;
    hlen += (((data[3] >> 0) & 0x0F) + 1) / 2;
    len += hlen;
    data += len;
    length -= len;
    lprintf(11, "CALL REQUEST - ");
    if (length) {
      unsigned int flen = data[0] + 1;
      facility(data, length);
      length -= flen;
      data += flen;
      if (length > 0)
        data_dump(data, length, 1);
    } else {
      lprintf(11, "\n");
    }
    return;
  case 0x0F:
    lprintf(11, "CALL ACCEPTED\n");
    return;
  case 0x13:
    lprintf(11, "CLEAR REQUEST - Cause %s - Diag %d\n", clear_code(data[3]), data[4]);
    if (length > 6) {
      facility(data + 6, length - 6);
    }
    return;
  case 0x17:
    lprintf(11, "CLEAR CONFIRMATION\n");
    return;
  case 0xF1:
    lprintf(11, "DIAGNOSTIC - Diag %d\n", data[3]);
    return;
  case 0x23:
    lprintf(11, "INTERRUPT\n");
    data_dump(data + 3, length - 3, hexdump);
    return;
  case 0x27:
    lprintf(11, "INTERRUPT CONFIRMATION\n");
    return;
  case 0x1B:
    lprintf(11, "RESET REQUEST - Cause %s - Diag %d\n", reset_code(data[3]), data[4]);
    return;
  case 0x1F:
    lprintf(11, "RESET CONFIRMATION\n");
    return;
  case 0xFB:
    lprintf(11, "RESTART REQUEST - Cause %s - Diag %d\n", restart_code(data[3]), data[4]);
    return;
  case 0xFF:
    lprintf(11, "RESTART CONFIRMATION\n");
    return;
  case 0xF3:
    lprintf(11, "REGISTRATION REQUEST\n");
    return;
  case 0xF7:
    lprintf(11, "REGISTRATION CONFIRMATION\n");
    return;
  }
  if ((data[2] & 0x01) == 0x00) {
    lprintf(11, "DATA R%d S%d %s%s%s", (data[2] >> 5) & 0x07, (data[2] >> 1) & 0x07, (data[0] & 0x80) ? "Q" : "", (data[0] & 0x40) ? "D" : "", (data[2] & 0x10) ? "M" : "");
    if ((length >= 5) && (data[0] & 0x80) && (data[3] == 0x7f)) {
      int pid = data[4];
      data += 5;
      length -= 5;
      switch (pid) {
      case 0x08:
        lprintf(11, " len %d\n", length - 5);
        data_dump(data, length, hexdump);
        break;
      case 0xCD:
        lprintf(11, " pid=ARP len %d\n", length - 5);
        arp_dump(data, length);
        break;
      case 0xCF:
        lprintf(11, " pid=NET/ROM len %d\n", length - 5);
        netrom_dump(data, length, hexdump, 0);
        break;
      case 0xCC:
        lprintf(11, " pid=IP len %d\n", length - 5);
        ip_dump(data, length, hexdump);
        break;
      case 0x01:
        lprintf(11, " pid=X.25 len %d\n", length - 5);
        rose_dump(data, length, hexdump);
        break;
      case 0xC3:
        lprintf(11, " pid=TEXNET len %d\n", length - 5);
        data_dump(data, length, hexdump);
        break;
      case 0xCE:
        lprintf(11, " pid=FLEXNET len %d\n", length - 5);
        flexnet_dump(data, length, hexdump);
        break;
      case 0xF0:
        lprintf(11, " pid=Text len %d\n", length - 5);
        data_dump(data, length, hexdump);
        break;
      default:
        lprintf(11, " pid=0x%x len %d\n", pid, length - 5);
        data_dump(data, length, hexdump);
        break;
      }
    } else {
      lprintf(11, " len %d\n", length - 3);
      data_dump(data + 3, length - 3, hexdump);
    }
    return;
  }
  switch (data[2] & 0x1F) {
  case 0x01:
    lprintf(11, "RR R%d\n", (data[2] >> 5) & 0x07);
    return;
  case 0x05:
    lprintf(11, "RNR R%d\n", (data[2] >> 5) & 0x07);
    return;
  case 0x09:
    lprintf(11, "REJ R%d\n", (data[2] >> 5) & 0x07);
    return;
  }
  lprintf(11, "UNKNOWN\n");
  data_dump(data, length, 1);
}
```