user: 请将以下的汇编代码转换成C语言代码:

```asm
<parse_ttx_pes>:
  endbr64
  push   %r12
  push   %rbp
  push   %rbx
  mov    %rdi,%rbx
  mov    %rsi,%r12
  mov    %rdx,%rbp
  mov    (%rdx),%esi
  lea    0x1(%rsi),%eax
  mov    %eax,(%rdx)
  mov    %r12,%rdx
  lea    D48(%rip),%rdi
  mov    $0x0,%eax
  call   <printf@plt>
  mov    (%rbx),%edx
  test   %edx,%edx
  jne    L66
  cmpl   $0x0,0x4(%rbx)
  jne    L66
  cmpl   $0x1,0x8(%rbx)
  je     L57
L66:
  mov    0x4(%rbx),%ecx
  mov    0x0(%rbp),%esi
  sub    $0x1,%esi
  mov    0x8(%rbx),%r8d
  lea    D46(%rip),%rdi
  mov    $0x0,%eax
  call   <printf@plt>
L124:
  pop    %rbx
  pop    %rbp
  pop    %r12
  ret
L57:
  mov    0xc(%rbx),%edx
  cmp    $0xbd,%edx
  je     L121
  mov    0x0(%rbp),%esi
  sub    $0x1,%esi
  lea    D61(%rip),%rdi
  mov    $0x0,%eax
  call   <printf@plt>
  jmp    L124
L121:
  lea    0x10(%rbx),%rdi
  call   <read_be16@plt>
  mov    %rax,%rdx
  lea    -0x6(%r12),%rax
  cmp    %rdx,%rax
  jne    L92
  lea    0x6(%rdx),%rcx
  mov    %rcx,%rdx
  shr    $0x3,%rdx
  movabs $0x1642c8590b21642d,%rsi
  mov    %rdx,%rax
  mul    %rsi
  shr    %rdx
  imul   $0xb8,%rdx,%rdx
  cmp    %rdx,%rcx
  jne    L8
  testb  $0x4,0x18(%rbx)
  je     L125
  mov    0x20(%rbx),%edx
  cmp    $0x24,%edx
  je     L119
  mov    0x0(%rbp),%esi
  sub    $0x1,%esi
  mov    $0x24,%ecx
  lea    D43(%rip),%rdi
  mov    $0x0,%eax
  call   <printf@plt>
  jmp    L124
L92:
  mov    0x0(%rbp),%esi
  sub    $0x1,%esi
  lea    D63(%rip),%rdi
  mov    $0x0,%eax
  call   <printf@plt>
  jmp    L124
L8:
  mov    0x0(%rbp),%esi
  sub    $0x1,%esi
  lea    D37(%rip),%rdi
  mov    $0x0,%eax
  call   <printf@plt>
  jmp    L124
L125:
  mov    0x0(%rbp),%esi
  sub    $0x1,%esi
  lea    D73(%rip),%rdi
  mov    $0x0,%eax
  call   <printf@plt>
  jmp    L124
L119:
  lea    -0x2d(%r12),%rsi
  lea    0xb4(%rbx),%rdi
  call   <parse_ttx@plt>
  mov    0x0(%rbp),%esi
  sub    $0x1,%esi
  lea    D34(%rip),%rdi
  mov    $0x0,%eax
  call   <printf@plt>
  jmp    L124
```

tool_calls: name: unpack_data
arguments: label: D48
data_type: string
name: unpack_data
arguments: label: D46
data_type: string
name: unpack_data
arguments: label: D61
data_type: string
name: unpack_data
arguments: label: D43
data_type: string
name: unpack_data
arguments: label: D63
data_type: string
name: unpack_data
arguments: label: D37
data_type: string
name: unpack_data
arguments: label: D73
data_type: string
name: unpack_data
arguments: label: D34
data_type: string

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


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


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


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


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


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


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


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


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