user: Demonstrate the C code that generates the assembly output below:

```asm
<intel_pt_get_ext>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x20,%rsp
  mov    %rdi,-0x8(%rbp)
  mov    %rsi,-0x10(%rbp)
  mov    %rdx,-0x18(%rbp)
  cmpq   $0x1,-0x10(%rbp)
  ja     L309
  mov    $0xffffffff,%eax
  jmp    L59
L309:
  mov    -0x8(%rbp),%rax
  add    $0x1,%rax
  movzbl (%rax),%eax
  movzbl %al,%eax
  cmp    $0xf3,%eax
  je     L266
  cmp    $0xf3,%eax
  jg     L65
  cmp    $0xc8,%eax
  je     L175
  cmp    $0xc8,%eax
  jg     L65
  cmp    $0xc3,%eax
  je     L189
  cmp    $0xc3,%eax
  jg     L65
  cmp    $0xa3,%eax
  je     L219
  cmp    $0xa3,%eax
  jg     L65
  cmp    $0x83,%eax
  je     L120
  cmp    $0x83,%eax
  jg     L65
  cmp    $0x82,%eax
  je     L63
  cmp    $0x82,%eax
  jg     L65
  cmp    $0x73,%eax
  je     L275
  cmp    $0x73,%eax
  jg     L65
  cmp    $0x43,%eax
  je     L44
  cmp    $0x43,%eax
  jg     L65
  cmp    $0x3,%eax
  je     L198
  cmp    $0x23,%eax
  je     L42
  jmp    L65
L219:
  mov    -0x18(%rbp),%rdx
  mov    -0x10(%rbp),%rcx
  mov    -0x8(%rbp),%rax
  mov    %rcx,%rsi
  mov    %rax,%rdi
  call   <intel_pt_get_long_tnt@plt>
  jmp    L59
L44:
  mov    -0x18(%rbp),%rdx
  mov    -0x10(%rbp),%rcx
  mov    -0x8(%rbp),%rax
  mov    %rcx,%rsi
  mov    %rax,%rdi
  call   <intel_pt_get_pip@plt>
  jmp    L59
L120:
  mov    -0x18(%rbp),%rax
  mov    %rax,%rdi
  call   <intel_pt_get_tracestop@plt>
  jmp    L59
L198:
  mov    -0x18(%rbp),%rdx
  mov    -0x10(%rbp),%rcx
  mov    -0x8(%rbp),%rax
  mov    %rcx,%rsi
  mov    %rax,%rdi
  call   <intel_pt_get_cbr@plt>
  jmp    L59
L175:
  mov    -0x18(%rbp),%rdx
  mov    -0x10(%rbp),%rcx
  mov    -0x8(%rbp),%rax
  mov    %rcx,%rsi
  mov    %rax,%rdi
  call   <intel_pt_get_vmcs@plt>
  jmp    L59
L266:
  mov    -0x18(%rbp),%rax
  mov    %rax,%rdi
  call   <intel_pt_get_ovf@plt>
  jmp    L59
L63:
  mov    -0x18(%rbp),%rdx
  mov    -0x10(%rbp),%rcx
  mov    -0x8(%rbp),%rax
  mov    %rcx,%rsi
  mov    %rax,%rdi
  call   <intel_pt_get_psb@plt>
  jmp    L59
L42:
  mov    -0x18(%rbp),%rax
  mov    %rax,%rdi
  call   <intel_pt_get_psbend@plt>
  jmp    L59
L275:
  mov    -0x18(%rbp),%rdx
  mov    -0x10(%rbp),%rcx
  mov    -0x8(%rbp),%rax
  mov    %rcx,%rsi
  mov    %rax,%rdi
  call   <intel_pt_get_tma@plt>
  jmp    L59
L189:
  mov    -0x18(%rbp),%rdx
  mov    -0x10(%rbp),%rcx
  mov    -0x8(%rbp),%rax
  mov    %rcx,%rsi
  mov    %rax,%rdi
  call   <intel_pt_get_3byte@plt>
  jmp    L59
L65:
  mov    $0xfffffffe,%eax
L59:
  leave
  ret
```

assistant: ```c
int intel_pt_get_ext(const unsigned char *buf, size_t len, struct intel_pt_pkt *packet) {
  if (len < 2)
    return -1;
  switch (buf[1]) {
  case 0xa3:
    return intel_pt_get_long_tnt(buf, len, packet);
  case 0x43:
    return intel_pt_get_pip(buf, len, packet);
  case 0x83:
    return intel_pt_get_tracestop(packet);
  case 0x03:
    return intel_pt_get_cbr(buf, len, packet);
  case 0xc8:
    return intel_pt_get_vmcs(buf, len, packet);
  case 0xf3:
    return intel_pt_get_ovf(packet);
  case 0x82:
    return intel_pt_get_psb(buf, len, packet);
  case 0x23:
    return intel_pt_get_psbend(packet);
  case 0x73:
    return intel_pt_get_tma(buf, len, packet);
  case 0xC3:
    return intel_pt_get_3byte(buf, len, packet);
  default:
    return -2;
  }
}
```