user: 请从给定的汇编指令推导出C源代码：

```asm
<parse_ttx_pes>:
  endbr64
  push   %r12
  mov    %rsi,%r12
  push   %rbp
  mov    %rdx,%rbp
  push   %rbx
  mov    (%rdx),%esi
  mov    %rdi,%rbx
  lea    D20(%rip),%rdi
  lea    0x1(%rsi),%eax
  mov    %eax,(%rdx)
  mov    %r12,%rdx
  xor    %eax,%eax
  call   <printf@plt>
  mov    (%rbx),%edx
  mov    0x4(%rbx),%ecx
  mov    0x8(%rbx),%r8d
  test   %edx,%edx
  jne    L41
  test   %ecx,%ecx
  jne    L41
  cmp    $0x1,%r8d
  je     L20
L41:
  mov    0x0(%rbp),%esi
  pop    %rbx
  lea    D0(%rip),%rdi
  xor    %eax,%eax
  pop    %rbp
  pop    %r12
  sub    $0x1,%esi
  jmp    1080 <printf@plt>
  nopl   0x0(%rax,%rax,1)
L20:
  mov    0xc(%rbx),%edx
  cmp    $0xbd,%edx
  jne    L99
  lea    0x10(%rbx),%rdi
  call   <read_be16@plt>
  mov    %rax,%rdx
  lea    -0x6(%r12),%rax
  cmp    %rdx,%rax
  jne    L3
  movabs $0xd37a6f4de9bd37a7,%rax
  movabs $0x1642c8590b21642,%rdx
  imul   %r12,%rax
  ror    $0x3,%rax
  cmp    %rdx,%rax
  ja     L33
  testb  $0x4,0x18(%rbx)
  je     L28
  mov    0x20(%rbx),%edx
  cmp    $0x24,%edx
  jne    L72
  lea    -0x2d(%r12),%rsi
  lea    0xb4(%rbx),%rdi
  call   <parse_ttx@plt>
  mov    0x0(%rbp),%esi
  lea    D47(%rip),%rdi
  sub    $0x1,%esi
L35:
  pop    %rbx
  xor    %eax,%eax
  pop    %rbp
  pop    %r12
  jmp    1080 <printf@plt>
  nopl   (%rax)
L99:
  mov    0x0(%rbp),%esi
  pop    %rbx
  lea    D29(%rip),%rdi
  xor    %eax,%eax
  pop    %rbp
  pop    %r12
  sub    $0x1,%esi
  jmp    1080 <printf@plt>
L72:
  mov    0x0(%rbp),%esi
  pop    %rbx
  mov    $0x24,%ecx
  lea    D57(%rip),%rdi
  pop    %rbp
  xor    %eax,%eax
  pop    %r12
  sub    $0x1,%esi
  jmp    1080 <printf@plt>
  nopl   (%rax)
L3:
  mov    0x0(%rbp),%esi
  pop    %rbx
  lea    D48(%rip),%rdi
  xor    %eax,%eax
  pop    %rbp
  pop    %r12
  sub    $0x1,%esi
  jmp    1080 <printf@plt>
  nopl   0x0(%rax,%rax,1)
L33:
  mov    0x0(%rbp),%esi
  lea    D72(%rip),%rdi
  sub    $0x1,%esi
  jmp    L35
  nop
L28:
  mov    0x0(%rbp),%esi
  lea    D73(%rip),%rdi
  sub    $0x1,%esi
  jmp    L35
```

tool_calls: name: unpack_data
arguments: label: D20
data_type: string
name: unpack_data
arguments: label: D0
data_type: string
name: unpack_data
arguments: label: D47
data_type: string
name: unpack_data
arguments: label: D29
data_type: string
name: unpack_data
arguments: label: D57
data_type: string
name: unpack_data
arguments: label: D48
data_type: string
name: unpack_data
arguments: label: D72
data_type: string
name: unpack_data
arguments: label: D73
data_type: string

tool: D20: TTX_PES[%u] : Received PES packet of size %zu.


tool: D0: TTX_PES[%u] : PES magic number incorrect : %hhx%hhx%hhx.


tool: D47: TTX_PES[%u] : Finished.


tool: D29: TTX_PES[%u] : PES stream ID incorrect : %hhx.


tool: D57: TTX_PES[%u] : Header length %hhu different from expected (%hhu).


tool: D48: TTX_PES[%u] : PES packet length mismatch : %hu.


tool: D72: TTX_PES[%u] : Declared PES packet length incorrect.


tool: D73: TTX_PES[%u] : Data alignment indicator set to zero.


assistant: ```c
void parse_ttx_pes(const uint8_t *pes, size_t size, void *user_data) {
  unsigned int *ttx_pes_pkt_no = user_data;
  ++(*ttx_pes_pkt_no);
  do {
    printf("TTX_PES[%u] : "
           "Received PES packet of size %zu.\n",
           *ttx_pes_pkt_no - 1, size);
  } while (0);
  if (pes[0] != 0x00 || pes[1] != 0x00 || pes[2] != 0x01) {
    do {
      printf("TTX_PES[%u] : "
             "PES magic number incorrect : %hhx%hhx%hhx.\n",
             *ttx_pes_pkt_no - 1, pes[0], pes[1], pes[2]);
    } while (0);
    return;
  }
  if (pes[3] != 0xBD) {
    do {
      printf("TTX_PES[%u] : "
             "PES stream ID incorrect : %hhx.\n",
             *ttx_pes_pkt_no - 1, pes[3]);
    } while (0);
    return;
  }
  uint16_t pes_pkt_len = read_be16(pes + 4);
  if (pes_pkt_len != size - 6) {
    do {
      printf("TTX_PES[%u] : "
             "PES packet length mismatch : %hu.\n",
             *ttx_pes_pkt_no - 1, pes_pkt_len);
    } while (0);
    return;
  }
  if (((pes_pkt_len + 6) % 184) != 0) {
    do {
      printf("TTX_PES[%u] : "
             "Declared PES packet length incorrect.\n",
             *ttx_pes_pkt_no - 1);
    } while (0);
    return;
  }
  if (!(pes[6] & 0x04)) {
    do {
      printf("TTX_PES[%u] : "
             "Data alignment indicator set to zero.\n",
             *ttx_pes_pkt_no - 1);
    } while (0);
    return;
  }
  if (pes[8] != 0x24) {
    do {
      printf("TTX_PES[%u] : "
             "Header length %hhu different from expected (%hhu).\n",
             *ttx_pes_pkt_no - 1, pes[8], 0x24);
    } while (0);
    return;
  }
  parse_ttx(pes + 9 + 0x24, size - 9 - 0x24);
  do {
    printf("TTX_PES[%u] : "
           "Finished.\n",
           *ttx_pes_pkt_no - 1);
  } while (0);
}
```