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

```asm
<show_last_n_error_page>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  lea    -0x4(%rsi),%ebp
  push   %rbx
  sub    $0xa8,%rsp
  mov    %edx,0x4(%rsp)
  mov    %fs:0x28,%rax
  mov    %rax,0x98(%rsp)
  xor    %eax,%eax
  cmp    $0x3,%ebp
  jle    L99
  lea    0x4(%rdi),%r15
  lea    D38(%rip),%rdi
  call   <puts@plt>
  lea    D72(%rip),%r14
  jmp    L98
  nopl   0x0(%rax)
L83:
  sub    %ebx,%ebp
  movslq %ebx,%rbx
  add    %rbx,%r15
  test   %ebp,%ebp
  jle    L22
L135:
  cmp    $0x2,%ebp
  jle    L84
L98:
  movzbl (%r15),%esi
  movzbl 0x1(%r15),%eax
  mov    %r14,%rdi
  movzbl 0x3(%r15),%r13d
  movzbl 0x2(%r15),%r12d
  shl    $0x8,%esi
  add    %eax,%esi
  lea    0x4(%r13),%ebx
  xor    %eax,%eax
  call   <printf@plt>
  cmp    $0x4,%ebx
  je     L72
  mov    %r12d,%eax
  lea    0x4(%r15),%r9
  and    $0x3,%eax
  cmp    $0x3,%al
  je     L41
  test   $0x1,%r12b
  je     L32
  mov    %r9,%rdx
  mov    %r13d,%esi
  lea    D58(%rip),%rdi
  xor    %eax,%eax
  call   <printf@plt>
L72:
  mov    0x4(%rsp),%eax
  test   %eax,%eax
  je     L83
  lea    0x10(%rsp),%rsi
  movzbl %r12b,%edi
  mov    $0x80,%edx
  xor    %eax,%eax
  mov    %rsi,0x8(%rsp)
  sub    %ebx,%ebp
  movslq %ebx,%rbx
  call   <get_pcb_str@plt>
  mov    0x8(%rsp),%rsi
  xor    %eax,%eax
  add    %rbx,%r15
  lea    D50(%rip),%rdi
  call   <printf@plt>
  test   %ebp,%ebp
  jg     L135
  nopl   0x0(%rax)
L22:
  mov    0x98(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L68
  add    $0xa8,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
  nopl   0x0(%rax)
L32:
  mov    %r9,0x8(%rsp)
  lea    D65(%rip),%rdi
L137:
  call   <puts@plt>
  mov    0x8(%rsp),%rdi
  mov    %r13d,%esi
  xor    %eax,%eax
  mov    $0x1,%edx
  call   <dStrHex@plt>
  jmp    L72
  nopw   0x0(%rax,%rax,1)
L41:
  mov    %r9,0x8(%rsp)
  lea    D35(%rip),%rdi
  jmp    L137
  cs nopw 0x0(%rax,%rax,1)
L99:
  mov    0x98(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L68
  add    $0xa8,%rsp
  lea    D47(%rip),%rdi
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  jmp    1090 <puts@plt>
L84:
  lea    D18(%rip),%rdi
  call   <puts@plt>
  jmp    L22
L68:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: retrieve_data
arguments: label: D38
type_guessed: string
name: retrieve_data
arguments: label: D72
type_guessed: string
name: retrieve_data
arguments: label: D58
type_guessed: string
name: retrieve_data
arguments: label: D50
type_guessed: string
name: retrieve_data
arguments: label: D65
type_guessed: string
name: retrieve_data
arguments: label: D35
type_guessed: string
name: retrieve_data
arguments: label: D47
type_guessed: string
name: retrieve_data
arguments: label: D18
type_guessed: string

tool: D38: Last n error events log page

tool: D72:   Error event %d:


tool: D58:     %.*s


tool: D50:         <%s>


tool: D65:     [data counter?? (LP bit should be set)]:

tool: D35:     [binary]:

tool: D47: No error events logged

tool: D18: short Last n error events log page

assistant: ```c
void show_last_n_error_page(unsigned char *resp, int len, int show_pcb) {
  int k, num, pl, pc, pcb;
  unsigned char *ucp;
  char pcb_str[128];
  num = len - 4;
  ucp = &resp[0] + 4;
  if (num < 4) {
    printf("No error events logged\n");
    return;
  }
  printf("Last n error events log page\n");
  for (k = num; k > 0; k -= pl, ucp += pl) {
    if (k < 3) {
      printf("short Last n error events log page\n");
      return;
    }
    pl = ucp[3] + 4;
    pc = (ucp[0] << 8) + ucp[1];
    pcb = ucp[2];
    printf("  Error event %d:\n", pc);
    if (pl > 4) {
      if ((pcb & 0x1) && (pcb & 0x2)) {
        printf("    [binary]:\n");
        dStrHex((const char *)ucp + 4, pl - 4, 1);
      } else if (pcb & 0x1)
        printf("    %.*s\n", pl - 4, (const char *)(ucp + 4));
      else {
        printf("    [data counter?? (LP bit should be set)]:\n");
        dStrHex((const char *)ucp + 4, pl - 4, 1);
      }
    }
    if (show_pcb) {
      get_pcb_str(pcb, pcb_str, sizeof(pcb_str));
      printf("        <%s>\n", pcb_str);
    }
  }
}
```