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

```asm
<show_last_n_error_page>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0xc0,%rsp
  mov    %rdi,-0xb8(%rbp)
  mov    %esi,-0xbc(%rbp)
  mov    %edx,-0xc0(%rbp)
  mov    %fs:0x28,%rax
  mov    %rax,-0x8(%rbp)
  xor    %eax,%eax
  mov    -0xbc(%rbp),%eax
  sub    $0x4,%eax
  mov    %eax,-0xa8(%rbp)
  mov    -0xb8(%rbp),%rax
  add    $0x4,%rax
  mov    %rax,-0x98(%rbp)
  cmpl   $0x3,-0xa8(%rbp)
  jg     L50
  lea    D35(%rip),%rax
  mov    %rax,%rdi
  call   <puts@plt>
  jmp    L17
L50:
  lea    D12(%rip),%rax
  mov    %rax,%rdi
  call   <puts@plt>
  mov    -0xa8(%rbp),%eax
  mov    %eax,-0xac(%rbp)
  jmp    L52
L137:
  cmpl   $0x2,-0xac(%rbp)
  jg     L100
  lea    D9(%rip),%rax
  mov    %rax,%rdi
  call   <puts@plt>
  jmp    L17
L100:
  mov    -0x98(%rbp),%rax
  add    $0x3,%rax
  movzbl (%rax),%eax
  movzbl %al,%eax
  add    $0x4,%eax
  mov    %eax,-0xa4(%rbp)
  mov    -0x98(%rbp),%rax
  movzbl (%rax),%eax
  movzbl %al,%eax
  shl    $0x8,%eax
  mov    %eax,%edx
  mov    -0x98(%rbp),%rax
  add    $0x1,%rax
  movzbl (%rax),%eax
  movzbl %al,%eax
  add    %edx,%eax
  mov    %eax,-0xa0(%rbp)
  mov    -0x98(%rbp),%rax
  add    $0x2,%rax
  movzbl (%rax),%eax
  movzbl %al,%eax
  mov    %eax,-0x9c(%rbp)
  mov    -0xa0(%rbp),%eax
  mov    %eax,%esi
  lea    D33(%rip),%rax
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <printf@plt>
  cmpl   $0x4,-0xa4(%rbp)
  jle    L96
  mov    -0x9c(%rbp),%eax
  and    $0x1,%eax
  test   %eax,%eax
  je     L6
  mov    -0x9c(%rbp),%eax
  and    $0x2,%eax
  test   %eax,%eax
  je     L6
  lea    D79(%rip),%rax
  mov    %rax,%rdi
  call   <puts@plt>
  mov    -0xa4(%rbp),%eax
  lea    -0x4(%rax),%ecx
  mov    -0x98(%rbp),%rax
  add    $0x4,%rax
  mov    $0x1,%edx
  mov    %ecx,%esi
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <dStrHex@plt>
  jmp    L96
L6:
  mov    -0x9c(%rbp),%eax
  and    $0x1,%eax
  test   %eax,%eax
  je     L99
  mov    -0x98(%rbp),%rax
  lea    0x4(%rax),%rdx
  mov    -0xa4(%rbp),%eax
  sub    $0x4,%eax
  mov    %eax,%esi
  lea    D74(%rip),%rax
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <printf@plt>
  jmp    L96
L99:
  lea    D4(%rip),%rax
  mov    %rax,%rdi
  call   <puts@plt>
  mov    -0xa4(%rbp),%eax
  lea    -0x4(%rax),%ecx
  mov    -0x98(%rbp),%rax
  add    $0x4,%rax
  mov    $0x1,%edx
  mov    %ecx,%esi
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <dStrHex@plt>
L96:
  cmpl   $0x0,-0xc0(%rbp)
  je     L70
  lea    -0x90(%rbp),%rcx
  mov    -0x9c(%rbp),%eax
  mov    $0x80,%edx
  mov    %rcx,%rsi
  mov    %eax,%edi
  mov    $0x0,%eax
  call   <get_pcb_str@plt>
  lea    -0x90(%rbp),%rax
  mov    %rax,%rsi
  lea    D60(%rip),%rax
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <printf@plt>
L70:
  mov    -0xa4(%rbp),%eax
  sub    %eax,-0xac(%rbp)
  mov    -0xa4(%rbp),%eax
  cltq
  add    %rax,-0x98(%rbp)
L52:
  cmpl   $0x0,-0xac(%rbp)
  jg     L137
L17:
  mov    -0x8(%rbp),%rax
  sub    %fs:0x28,%rax
  je     L18
  call   <__stack_chk_fail@plt>
L18:
  leave
  ret
```

tool_calls: name: disassemble_data
arguments: data_label: D35
data_type: string
name: disassemble_data
arguments: data_label: D12
data_type: string
name: disassemble_data
arguments: data_label: D9
data_type: string
name: disassemble_data
arguments: data_label: D33
data_type: string
name: disassemble_data
arguments: data_label: D79
data_type: string
name: disassemble_data
arguments: data_label: D74
data_type: string
name: disassemble_data
arguments: data_label: D4
data_type: string
name: disassemble_data
arguments: data_label: D60
data_type: string

tool: D35: No error events logged

tool: D12: Last n error events log page

tool: D9: short Last n error events log page

tool: D33:   Error event %d:


tool: D79:     [binary]:

tool: D74:     %.*s


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

tool: D60:         <%s>


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);
    }
  }
}
```