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

```asm
<Parser_SectionBAT>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x30,%rsp
  mov    %rdi,-0x28(%rbp)
  movw   $0x0,-0x1c(%rbp)
  movw   $0x0,-0x1a(%rbp)
  movw   $0x0,-0x18(%rbp)
  movw   $0x0,-0x16(%rbp)
  movl   $0x0,-0x14(%rbp)
  movl   $0x0,-0x10(%rbp)
  movl   $0x0,-0xc(%rbp)
  movl   $0x0,-0x8(%rbp)
  movl   $0xffffffff,-0x4(%rbp)
  cmpq   $0x0,-0x28(%rbp)
  jne    L176
  lea    D143(%rip),%rax
  mov    %rax,%rsi
  mov    $0x20,%edi
  mov    $0x0,%eax
  call   <Parser_TsPacketLog@plt>
  mov    $0xffffffff,%eax
  jmp    L74
L176:
  mov    -0x28(%rbp),%rax
  movzbl (%rax),%eax
  cmp    $0x4a,%al
  je     L108
  mov    -0x28(%rbp),%rax
  movzbl (%rax),%eax
  movzbl %al,%eax
  mov    %eax,%edx
  lea    D129(%rip),%rax
  mov    %rax,%rsi
  mov    $0x20,%edi
  mov    $0x0,%eax
  call   <Parser_TsPacketLog@plt>
  mov    $0xffffffff,%eax
  jmp    L74
L108:
  mov    -0x28(%rbp),%rax
  add    $0x1,%rax
  movzbl (%rax),%eax
  movzbl %al,%eax
  shl    $0x8,%eax
  and    $0xf00,%ax
  mov    %eax,%edx
  mov    -0x28(%rbp),%rax
  add    $0x2,%rax
  movzbl (%rax),%eax
  movzbl %al,%eax
  or     %edx,%eax
  mov    %ax,-0x1c(%rbp)
  lea    D5(%rip),%rax
  mov    %rax,%rsi
  mov    $0x20,%edi
  mov    $0x0,%eax
  call   <Parser_TsPacketLog@plt>
  mov    -0x28(%rbp),%rax
  movzbl (%rax),%eax
  movzbl %al,%eax
  mov    %eax,%edx
  lea    D90(%rip),%rax
  mov    %rax,%rsi
  mov    $0x20,%edi
  mov    $0x0,%eax
  call   <Parser_TsPacketLog@plt>
  mov    -0x28(%rbp),%rax
  add    $0x1,%rax
  movzbl (%rax),%eax
  shr    $0x7,%al
  movzbl %al,%eax
  mov    %eax,%edx
  lea    D0(%rip),%rax
  mov    %rax,%rsi
  mov    $0x20,%edi
  mov    $0x0,%eax
  call   <Parser_TsPacketLog@plt>
  movzwl -0x1c(%rbp),%eax
  mov    %eax,%edx
  lea    D83(%rip),%rax
  mov    %rax,%rsi
  mov    $0x20,%edi
  mov    $0x0,%eax
  call   <Parser_TsPacketLog@plt>
  mov    -0x28(%rbp),%rax
  add    $0x3,%rax
  movzbl (%rax),%eax
  movzbl %al,%eax
  shl    $0x8,%eax
  mov    %eax,%edx
  mov    -0x28(%rbp),%rax
  add    $0x4,%rax
  movzbl (%rax),%eax
  movzbl %al,%eax
  or     %edx,%eax
  mov    %eax,%edx
  lea    D96(%rip),%rax
  mov    %rax,%rsi
  mov    $0x20,%edi
  mov    $0x0,%eax
  call   <Parser_TsPacketLog@plt>
  mov    -0x28(%rbp),%rax
  add    $0x5,%rax
  movzbl (%rax),%eax
  movzbl %al,%eax
  sar    %eax
  and    $0x1f,%eax
  mov    %eax,%edx
  lea    D170(%rip),%rax
  mov    %rax,%rsi
  mov    $0x20,%edi
  mov    $0x0,%eax
  call   <Parser_TsPacketLog@plt>
  mov    -0x28(%rbp),%rax
  add    $0x5,%rax
  movzbl (%rax),%eax
  movzbl %al,%eax
  and    $0x1,%eax
  mov    %eax,%edx
  lea    D133(%rip),%rax
  mov    %rax,%rsi
  mov    $0x20,%edi
  mov    $0x0,%eax
  call   <Parser_TsPacketLog@plt>
  mov    -0x28(%rbp),%rax
  add    $0x6,%rax
  movzbl (%rax),%eax
  movzbl %al,%eax
  mov    %eax,%edx
  lea    D51(%rip),%rax
  mov    %rax,%rsi
  mov    $0x20,%edi
  mov    $0x0,%eax
  call   <Parser_TsPacketLog@plt>
  mov    -0x28(%rbp),%rax
  add    $0x7,%rax
  movzbl (%rax),%eax
  movzbl %al,%eax
  mov    %eax,%edx
  lea    D153(%rip),%rax
  mov    %rax,%rsi
  mov    $0x20,%edi
  mov    $0x0,%eax
  call   <Parser_TsPacketLog@plt>
  mov    -0x28(%rbp),%rax
  add    $0x8,%rax
  movzbl (%rax),%eax
  movzbl %al,%eax
  shl    $0x8,%eax
  and    $0xf00,%eax
  mov    %eax,%edx
  mov    -0x28(%rbp),%rax
  add    $0x9,%rax
  movzbl (%rax),%eax
  movzbl %al,%eax
  or     %edx,%eax
  mov    %eax,%edx
  lea    D43(%rip),%rax
  mov    %rax,%rsi
  mov    $0x20,%edi
  mov    $0x0,%eax
  call   <Parser_TsPacketLog@plt>
  movzwl -0x1c(%rbp),%eax
  lea    -0x1(%rax),%rdx
  mov    -0x28(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%eax
  movzbl %al,%eax
  shl    $0x18,%eax
  mov    %eax,%ecx
  movzwl -0x1c(%rbp),%edx
  mov    -0x28(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%eax
  movzbl %al,%eax
  shl    $0x10,%eax
  or     %eax,%ecx
  mov    %ecx,%edx
  movzwl -0x1c(%rbp),%eax
  lea    0x1(%rax),%rcx
  mov    -0x28(%rbp),%rax
  add    %rcx,%rax
  movzbl (%rax),%eax
  movzbl %al,%eax
  shl    $0x8,%eax
  or     %eax,%edx
  movzwl -0x1c(%rbp),%eax
  lea    0x2(%rax),%rcx
  mov    -0x28(%rbp),%rax
  add    %rcx,%rax
  movzbl (%rax),%eax
  movzbl %al,%eax
  or     %edx,%eax
  mov    %eax,%edx
  lea    D94(%rip),%rax
  mov    %rax,%rsi
  mov    $0x20,%edi
  mov    $0x0,%eax
  call   <Parser_TsPacketLog@plt>
  mov    -0x28(%rbp),%rax
  add    $0x8,%rax
  movzbl (%rax),%eax
  movzbl %al,%eax
  shl    $0x8,%eax
  and    $0xf00,%ax
  mov    %eax,%edx
  mov    -0x28(%rbp),%rax
  add    $0x9,%rax
  movzbl (%rax),%eax
  movzbl %al,%eax
  or     %edx,%eax
  mov    %ax,-0x1a(%rbp)
  addl   $0xa,-0xc(%rbp)
  movl   $0x0,-0x14(%rbp)
  jmp    L1
L97:
  mov    -0xc(%rbp),%edx
  mov    -0x28(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%eax
  movzbl %al,%eax
  cmp    $0x5f,%eax
  je     L157
  cmp    $0x5f,%eax
  jg     L92
  cmp    $0x47,%eax
  je     L16
  cmp    $0x4a,%eax
  je     L19
  jmp    L92
L16:
  mov    -0xc(%rbp),%edx
  mov    -0x28(%rbp),%rax
  add    %rdx,%rax
  mov    %rax,%rsi
  mov    $0x20,%edi
  call   <x47_Tag_DescriptorParser@plt>
  mov    %eax,-0x8(%rbp)
  jmp    L118
L19:
  mov    -0xc(%rbp),%edx
  mov    -0x28(%rbp),%rax
  add    %rdx,%rax
  mov    %rax,%rsi
  mov    $0x20,%edi
  call   <x4A_Tag_DescriptorParser@plt>
  mov    %eax,-0x8(%rbp)
  jmp    L118
L157:
  mov    -0xc(%rbp),%edx
  mov    -0x28(%rbp),%rax
  add    %rdx,%rax
  mov    %rax,%rsi
  mov    $0x20,%edi
  call   <x5F_Tag_DescriptorParser@plt>
  mov    %eax,-0x8(%rbp)
  jmp    L118
L92:
  mov    -0xc(%rbp),%edx
  mov    -0x28(%rbp),%rax
  add    %rdx,%rax
  mov    %rax,%rsi
  mov    $0x20,%edi
  call   <x00_Tag_DescriptorParser@plt>
  mov    %eax,-0x8(%rbp)
  nop
L118:
  addl   $0x2,-0x8(%rbp)
  mov    -0x8(%rbp),%eax
  add    %eax,-0xc(%rbp)
  mov    -0x8(%rbp),%eax
  add    %eax,-0x14(%rbp)
L1:
  movzwl -0x1a(%rbp),%eax
  cmp    %eax,-0x14(%rbp)
  jb     L97
  mov    -0xc(%rbp),%edx
  mov    -0x28(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%eax
  movzbl %al,%eax
  shl    $0x8,%eax
  and    $0xf00,%ax
  mov    %eax,%edx
  mov    -0xc(%rbp),%eax
  add    $0x1,%eax
  mov    %eax,%ecx
  mov    -0x28(%rbp),%rax
  add    %rcx,%rax
  movzbl (%rax),%eax
  movzbl %al,%eax
  or     %edx,%eax
  mov    %ax,-0x18(%rbp)
  movzwl -0x18(%rbp),%eax
  mov    %eax,%edx
  lea    D122(%rip),%rax
  mov    %rax,%rsi
  mov    $0x20,%edi
  mov    $0x0,%eax
  call   <Parser_TsPacketLog@plt>
  addl   $0x2,-0xc(%rbp)
  movl   $0x0,-0x8(%rbp)
  movl   $0x0,-0x14(%rbp)
  jmp    L115
L197:
  mov    -0xc(%rbp),%edx
  mov    -0x28(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%eax
  movzbl %al,%eax
  shl    $0x8,%eax
  mov    %eax,%edx
  mov    -0xc(%rbp),%eax
  add    $0x1,%eax
  mov    %eax,%ecx
  mov    -0x28(%rbp),%rax
  add    %rcx,%rax
  movzbl (%rax),%eax
  movzbl %al,%eax
  or     %edx,%eax
  mov    %eax,%edx
  lea    D92(%rip),%rax
  mov    %rax,%rsi
  mov    $0x20,%edi
  mov    $0x0,%eax
  call   <Parser_TsPacketLog@plt>
  mov    -0xc(%rbp),%eax
  add    $0x2,%eax
  mov    %eax,%edx
  mov    -0x28(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%eax
  movzbl %al,%eax
  shl    $0x8,%eax
  mov    %eax,%edx
  mov    -0xc(%rbp),%eax
  add    $0x3,%eax
  mov    %eax,%ecx
  mov    -0x28(%rbp),%rax
  add    %rcx,%rax
  movzbl (%rax),%eax
  movzbl %al,%eax
  or     %edx,%eax
  mov    %eax,%edx
  lea    D149(%rip),%rax
  mov    %rax,%rsi
  mov    $0x20,%edi
  mov    $0x0,%eax
  call   <Parser_TsPacketLog@plt>
  mov    -0xc(%rbp),%eax
  add    $0x4,%eax
  mov    %eax,%edx
  mov    -0x28(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%eax
  movzbl %al,%eax
  shl    $0x8,%eax
  and    $0xf00,%ax
  mov    %eax,%edx
  mov    -0xc(%rbp),%eax
  add    $0x5,%eax
  mov    %eax,%ecx
  mov    -0x28(%rbp),%rax
  add    %rcx,%rax
  movzbl (%rax),%eax
  movzbl %al,%eax
  or     %edx,%eax
  mov    %ax,-0x1a(%rbp)
  movzwl -0x1a(%rbp),%eax
  mov    %eax,%edx
  lea    D41(%rip),%rax
  mov    %rax,%rsi
  mov    $0x20,%edi
  mov    $0x0,%eax
  call   <Parser_TsPacketLog@plt>
  addl   $0x6,-0xc(%rbp)
  movl   $0x0,-0x10(%rbp)
  jmp    L109
L114:
  mov    -0xc(%rbp),%edx
  mov    -0x28(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%eax
  movzbl %al,%eax
  cmp    $0x41,%eax
  jne    L4
  mov    -0xc(%rbp),%edx
  mov    -0x28(%rbp),%rax
  add    %rdx,%rax
  mov    %rax,%rsi
  mov    $0x20,%edi
  call   <x41_Tag_DescriptorParser@plt>
  mov    %eax,-0x8(%rbp)
  jmp    L9
L4:
  mov    -0xc(%rbp),%edx
  mov    -0x28(%rbp),%rax
  add    %rdx,%rax
  mov    %rax,%rsi
  mov    $0x20,%edi
  call   <x00_Tag_DescriptorParser@plt>
  mov    %eax,-0x8(%rbp)
  nop
L9:
  addl   $0x2,-0x8(%rbp)
  mov    -0x8(%rbp),%eax
  add    %eax,-0xc(%rbp)
  mov    -0x8(%rbp),%eax
  add    %eax,-0x10(%rbp)
L109:
  movzwl -0x1a(%rbp),%eax
  cmp    %eax,-0x10(%rbp)
  jb     L114
  movzwl -0x1a(%rbp),%eax
  mov    %ax,-0x16(%rbp)
  addw   $0x6,-0x16(%rbp)
  movzwl -0x16(%rbp),%eax
  add    %eax,-0x14(%rbp)
L115:
  movzwl -0x18(%rbp),%eax
  cmp    %eax,-0x14(%rbp)
  jb     L197
  lea    D89(%rip),%rax
  mov    %rax,%rsi
  mov    $0x20,%edi
  mov    $0x0,%eax
  call   <Parser_TsPacketLog@plt>
  movl   $0x0,-0x4(%rbp)
  mov    -0x4(%rbp),%eax
L74:
  leave
  ret
```

tool_calls: name: retrieve_data
arguments: label: D143
type_infered: string
name: retrieve_data
arguments: label: D129
type_infered: string
name: retrieve_data
arguments: label: D5
type_infered: string
name: retrieve_data
arguments: label: D90
type_infered: string
name: retrieve_data
arguments: label: D0
type_infered: string
name: retrieve_data
arguments: label: D83
type_infered: string
name: retrieve_data
arguments: label: D96
type_infered: string
name: retrieve_data
arguments: label: D170
type_infered: string
name: retrieve_data
arguments: label: D133
type_infered: string
name: retrieve_data
arguments: label: D51
type_infered: string
name: retrieve_data
arguments: label: D153
type_infered: string
name: retrieve_data
arguments: label: D43
type_infered: string
name: retrieve_data
arguments: label: D94
type_infered: string
name: retrieve_data
arguments: label: D122
type_infered: string
name: retrieve_data
arguments: label: D92
type_infered: string
name: retrieve_data
arguments: label: D149
type_infered: string
name: retrieve_data
arguments: label: D41
type_infered: string
name: retrieve_data
arguments: label: D89
type_infered: string

tool: D143: BAT error: section is NULL !


tool: D129: BAT table id is error : %x


tool: D5: ****************BAT Info****************


tool: D90: BAT table id = 0x%x


tool: D0: BAT section_syntax_indicator = 0x%x


tool: D83: BAT section_length = 0x%x


tool: D96: BAT bouquet_id = 0x%x


tool: D170: BAT version_number = 0x%x


tool: D133: BAT current_next_indicator = 0x%x


tool: D51: BAT section_number = 0x%x


tool: D153: BAT last_section_number = 0x%x


tool: D43: BAT bouquet_descriptors_length = 0x%x


tool: D94: BAT crc = 0x%08x


tool: D122: BAT transport_stream_loop_length = 0x%x


tool: D92: BAT transport_stream_id = 0x%x


tool: D149: BAT original_network_id = 0x%x


tool: D41: BAT transport_descriptors_length = 0x%x


tool: D89: ****************************************


assistant: ```c
int Parser_SectionBAT(unsigned char *section) {
  unsigned short section_len = 0;
  unsigned short descriptor_loop_len = 0;
  unsigned short transport_stream_loop_len = 0;
  unsigned short transport_stream_offset = 0;
  unsigned int i = 0, j = 0;
  unsigned int data_offset = 0;
  int descriptor_offset = 0;
  int ret = -1;
  if (NULL == section) {
    Parser_TsPacketLog((0x00000020), "BAT error: section is NULL !\n");
    return -1;
  }
  if (0x4A != section[0]) {
    Parser_TsPacketLog((0x00000020), "BAT table id is error : %x\n", section[0]);
    return -1;
  }
  section_len = ((section[1] & 0x0F) << 8) | (section[2] & 0xFF);
  Parser_TsPacketLog((0x00000020), "****************BAT Info****************\n");
  Parser_TsPacketLog((0x00000020), "BAT table id = 0x%x\n", section[0]);
  Parser_TsPacketLog((0x00000020), "BAT section_syntax_indicator = 0x%x\n", (section[1] & 0x80) >> 7);
  Parser_TsPacketLog((0x00000020), "BAT section_length = 0x%x\n", section_len);
  Parser_TsPacketLog((0x00000020), "BAT bouquet_id = 0x%x\n", ((section[3] & 0xFF) << 8) | (section[4] & 0xFF));
  Parser_TsPacketLog((0x00000020), "BAT version_number = 0x%x\n", (section[5] & 0x3E) >> 1);
  Parser_TsPacketLog((0x00000020), "BAT current_next_indicator = 0x%x\n", section[5] & 0x01);
  Parser_TsPacketLog((0x00000020), "BAT section_number = 0x%x\n", section[6]);
  Parser_TsPacketLog((0x00000020), "BAT last_section_number = 0x%x\n", section[7]);
  Parser_TsPacketLog((0x00000020), "BAT bouquet_descriptors_length = 0x%x\n", ((section[8] & 0x0F) << 8) | (section[9] & 0xFF));
  Parser_TsPacketLog((0x00000020), "BAT crc = 0x%08x\n", (section[section_len - 1] << 24) | ((section[section_len] & 0xFF) << 16) | ((section[section_len + 1] & 0xFF) << 8) | (section[section_len + 2] & 0xFF));
  descriptor_loop_len = ((section[8] & 0x0F) << 8) | (section[9] & 0xFF);
  data_offset += 10;
  for (i = 0; i < descriptor_loop_len; i += descriptor_offset) {
    switch (section[data_offset]) {
    case 0x47:
      descriptor_offset = x47_Tag_DescriptorParser((0x00000020), section + data_offset);
      break;
    case 0x4A:
      descriptor_offset = x4A_Tag_DescriptorParser((0x00000020), section + data_offset);
      break;
    case 0x5F:
      descriptor_offset = x5F_Tag_DescriptorParser((0x00000020), section + data_offset);
      break;
    default:
      descriptor_offset = x00_Tag_DescriptorParser((0x00000020), section + data_offset);
      break;
    }
    descriptor_offset += 2;
    data_offset += descriptor_offset;
  }
  transport_stream_loop_len = ((section[data_offset] & 0x0F) << 8) | (section[data_offset + 1] & 0xFF);
  Parser_TsPacketLog((0x00000020), "BAT transport_stream_loop_length = 0x%x\n", transport_stream_loop_len);
  data_offset += 2;
  descriptor_offset = 0;
  for (i = 0; i < transport_stream_loop_len; i += transport_stream_offset) {
    Parser_TsPacketLog((0x00000020), "BAT transport_stream_id = 0x%x\n", ((section[data_offset] & 0xFF) << 8) | (section[data_offset + 1] & 0xFF));
    Parser_TsPacketLog((0x00000020), "BAT original_network_id = 0x%x\n", ((section[data_offset + 2] & 0xFF) << 8) | (section[data_offset + 3] & 0xFF));
    descriptor_loop_len = ((section[data_offset + 4] & 0x0F) << 8) | (section[data_offset + 5] & 0xFF);
    Parser_TsPacketLog((0x00000020), "BAT transport_descriptors_length = 0x%x\n", descriptor_loop_len);
    data_offset += 6;
    for (j = 0; j < descriptor_loop_len; j += descriptor_offset) {
      switch (section[data_offset]) {
      case 0x41:
        descriptor_offset = x41_Tag_DescriptorParser((0x00000020), section + data_offset);
        break;
      default:
        descriptor_offset = x00_Tag_DescriptorParser((0x00000020), section + data_offset);
        break;
      }
      descriptor_offset += 2;
      data_offset += descriptor_offset;
    }
    transport_stream_offset = descriptor_loop_len;
    transport_stream_offset += 6;
  }
  Parser_TsPacketLog((0x00000020), "****************************************\n");
  ret = 0;
  return ret;
}
```