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

```asm
<rspf_dump>:
  endbr64
  push   %r15
  xor    %eax,%eax
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  mov    %esi,%ebp
  lea    D21(%rip),%rsi
  push   %rbx
  mov    %rdi,%rbx
  sub    $0x28,%rsp
  movzbl (%rdi),%edx
  mov    %rdi,(%rsp)
  mov    $0x9,%edi
  call   <lprintf@plt>
  movzbl 0x1(%rbx),%eax
  cmp    $0x1,%al
  je     L71
  cmp    $0x3,%al
  jne    L72
  mov    0x8(%rbx),%edi
  movzbl 0xa(%rbx),%r12d
  call   <ntohs@plt>
  mov    %r12d,%ecx
  mov    $0x9,%edi
  lea    D92(%rip),%rsi
  mov    %eax,%edx
  xor    %eax,%eax
  call   <lprintf@plt>
  cmp    $0xb,%ebp
  jle    L137
  mov    %rbx,%rsi
  lea    -0xc(%rbp),%eax
  lea    0xb(%rbx),%rbx
  lea    0xc(%rsi,%rax,1),%r12
  lea    D81(%rip),%rbp
  nopl   (%rax)
L20:
  movzbl (%rbx),%edx
  mov    %rbp,%rsi
  mov    $0x9,%edi
  xor    %eax,%eax
  add    $0x1,%rbx
  call   <lprintf@plt>
  cmp    %rbx,%r12
  jne    L20
L137:
  add    $0x28,%rsp
  lea    D30(%rip),%rsi
  mov    $0x9,%edi
  xor    %eax,%eax
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  jmp    1090 <lprintf@plt>
L71:
  lea    D37(%rip),%rsi
  mov    $0x9,%edi
  xor    %eax,%eax
  call   <lprintf@plt>
  mov    (%rsp),%rbx
  mov    0x8(%rbx),%edi
  call   <ntohs@plt>
  sub    $0x8,%rsp
  movzbl 0x3(%rbx),%ecx
  movzbl 0x2(%rbx),%edx
  push   %rax
  movzbl 0x7(%rbx),%r9d
  lea    D56(%rip),%rsi
  xor    %eax,%eax
  movzbl 0x6(%rbx),%r8d
  mov    $0x9,%edi
  call   <lprintf@plt>
  movzbl 0x6(%rbx),%r10d
  movzbl 0x7(%rbx),%eax
  pop    %rdx
  pop    %rcx
  lea    0x6(%r10),%r15d
  test   %eax,%eax
  je     L22
  mov    %ebp,%edx
  sub    %r15d,%edx
  cmp    $0x7,%edx
  jle    L22
  sub    $0x2,%eax
  lea    D9(%rip),%r12
  mov    %eax,0x14(%rsp)
  lea    0x5(%rbx),%rax
  mov    %rax,0x8(%rsp)
  nopl   0x0(%rax)
L58:
  mov    (%rsp),%r13
  movslq %r15d,%rbx
  add    $0x8,%r15d
  lea    0x7(%r13,%rbx,1),%r14
  movzbl 0x6(%r13,%rbx,1),%r8d
  mov    0x4(%r13,%rbx,1),%edi
  movzbl (%r14),%r9d
  mov    %r8d,0x18(%rsp)
  mov    %r9d,0x1c(%rsp)
  call   <ntohs@plt>
  mov    0x0(%r13,%rbx,1),%edi
  mov    %eax,0x10(%rsp)
  call   <inet_ntoa@plt>
  mov    0x1c(%rsp),%r9d
  mov    0x10(%rsp),%ecx
  lea    D59(%rip),%rsi
  mov    0x18(%rsp),%r8d
  mov    %eax,%edx
  mov    $0x5,%edi
  xor    %eax,%eax
  call   <lprintf@plt>
  movzbl (%r14),%r14d
  test   %r14d,%r14d
  je     L40
  mov    %ebp,%eax
  sub    %r15d,%eax
  cmp    $0x4,%eax
  jle    L40
  lea    -0x2(%r14),%eax
  mov    %eax,0x10(%rsp)
  nopw   0x0(%rax,%rax,1)
L29:
  mov    (%rsp),%r13
  movslq %r15d,%rbx
  lea    D60(%rip),%rsi
  xor    %eax,%eax
  mov    $0x5,%edi
  add    $0x4,%r15d
  lea    0x3(%r13,%rbx,1),%r14
  movzbl 0x1(%r13,%rbx,1),%ecx
  movzbl 0x0(%r13,%rbx,1),%edx
  movzbl (%r14),%r9d
  movzbl 0x2(%r13,%rbx,1),%r8d
  call   <lprintf@plt>
  movzbl (%r14),%eax
  test   %al,%al
  je     L161
  mov    %ebp,%edx
  sub    %r15d,%edx
  cmp    $0x4,%edx
  jle    L40
  sub    $0x1,%eax
  movslq %r15d,%rdx
  add    0x8(%rsp),%rbx
  lea    (%rax,%rax,4),%rax
  lea    0x1(%r13,%rdx,1),%r14
  add    %rax,%rbx
  jmp    L131
  nopl   0x0(%rax)
L169:
  mov    %ebp,%eax
  add    $0x5,%r14
  sub    %r15d,%eax
  cmp    $0x4,%eax
  jle    L40
L131:
  movzbl -0x1(%r14),%r13d
  mov    (%r14),%edi
  add    $0x5,%r15d
  call   <inet_ntoa@plt>
  and    $0x3f,%r13d
  mov    %r12,%rsi
  mov    $0x5,%edi
  mov    %eax,%edx
  mov    %r13d,%ecx
  xor    %eax,%eax
  call   <lprintf@plt>
  cmp    %rbx,%r14
  jne    L169
L161:
  mov    0x10(%rsp),%eax
  cmp    $0xffffffff,%eax
  je     L40
  sub    $0x1,%eax
  mov    %eax,0x10(%rsp)
  mov    %ebp,%eax
  sub    %r15d,%eax
  cmp    $0x4,%eax
  jg     L29
  nopw   0x0(%rax,%rax,1)
L40:
  mov    0x14(%rsp),%eax
  cmp    $0xffffffff,%eax
  je     L22
  sub    $0x1,%eax
  mov    %eax,0x14(%rsp)
  mov    %ebp,%eax
  sub    %r15d,%eax
  cmp    $0x7,%eax
  jg     L58
L22:
  add    $0x28,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
L72:
  add    $0x28,%rsp
  movzbl %al,%edx
  mov    $0x1,%edi
  xor    %eax,%eax
  pop    %rbx
  lea    D41(%rip),%rsi
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  jmp    1090 <lprintf@plt>
```

tool_calls: name: parse_data
arguments: data_tag: D21
type_infered: string
name: parse_data
arguments: data_tag: D92
type_infered: string
name: parse_data
arguments: data_tag: D81
type_infered: string
name: parse_data
arguments: data_tag: D30
type_infered: string
name: parse_data
arguments: data_tag: D37
type_infered: string
name: parse_data
arguments: data_tag: D56
type_infered: string
name: parse_data
arguments: data_tag: D9
type_infered: string
name: parse_data
arguments: data_tag: D59
type_infered: string
name: parse_data
arguments: data_tag: D60
type_infered: string
name: parse_data
arguments: data_tag: D41
type_infered: string

tool: D21: RSPF: version %u 

tool: D92: type RRH seq %#04x flags %d


tool: D81: %c

tool: D30: 


tool: D37: type ROUTING UPDATE 

tool: D56: fragment %u frag total %u sync %u #nodes %u env_id %u


tool: D9:                %s/%d 


tool: D59:      Reporting Router: %s Seq %u Subseq %u #links %u


tool: D60:           horizon %u ERP factor %u cost %u #adjacencies %u


tool: D41: Unknown packet type %d


assistant: ```c
void rspf_dump(unsigned char *data, int length) {
  int bptr, nodes, links, adjs;
  lprintf(9, "RSPF: version %u ", data[0]);
  switch (data[1]) {
  case 3:
    lprintf(9, "type RRH seq %#04x flags %d\n", ntohs(*((u_short *)(&data[8]))), data[10]);
    bptr = 11;
    while (bptr < length)
      lprintf(9, "%c", data[bptr++]);
    lprintf(9, "\n");
    break;
  case 1:
    lprintf(9, "type ROUTING UPDATE ");
    lprintf(9, "fragment %u frag total %u sync %u #nodes %u env_id %u\n", data[2], data[3], data[6], data[7], ntohs(*((u_short *)(&data[8]))));
    bptr = data[6] + 6;
    nodes = data[7];
    while (nodes-- && (length - bptr) > 7) {
      lprintf(5, "     Reporting Router: %s Seq %u Subseq %u #links %u\n", inet_ntoa(*((struct in_addr *)(&data[bptr]))), ntohs(*((u_short *)(&data[bptr + 4]))), data[bptr + 6], data[bptr + 7]);
      links = data[bptr + 7];
      bptr += 8;
      while (links-- && (length - bptr) > 4) {
        lprintf(5, "          horizon %u ERP factor %u cost %u #adjacencies %u\n", data[bptr], data[bptr + 1], data[bptr + 2], data[bptr + 3]);
        adjs = data[bptr + 3];
        bptr += 4;
        while (adjs-- && (length - bptr) > 4) {
          lprintf(5, "               %s/%d \n", inet_ntoa(*((struct in_addr *)(&data[bptr + 1]))), data[bptr] & 0x3f);
          bptr += 5;
        }
      }
    }
    break;
  default:
    lprintf(1, "Unknown packet type %d\n", data[1]);
    break;
  }
}
```