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

```asm
<x6E_Tag_DescriptorParser>:
  endbr64
  test   %rsi,%rsi
  je     L48
  push   %r15
  mov    %edi,%r15d
  push   %r14
  lea    D15(%rip),%r14
  push   %r13
  lea    D10(%rip),%r13
  push   %r12
  lea    D19(%rip),%r12
  push   %rbp
  mov    %rsi,%rbp
  push   %rbx
  sub    $0x8,%rsp
  movzbl (%rsi),%esi
  call   <Parser_DisplayTagInfo@plt>
  movzbl 0x1(%rbp),%edx
  mov    %r15d,%edi
  xor    %eax,%eax
  lea    D14(%rip),%rsi
  call   <Parser_TsPacketLog@plt>
  movzwl 0x2(%rbp),%edx
  mov    %r15d,%edi
  xor    %eax,%eax
  lea    D16(%rip),%rsi
  rol    $0x8,%dx
  movzwl %dx,%edx
  call   <Parser_TsPacketLog@plt>
  jmp    L0
  nopl   0x0(%rax)
L24:
  movzbl 0x4(%rbp),%edx
  mov    %r13,%rsi
  mov    %r15d,%edi
  xor    %eax,%eax
  and    $0xf0,%edx
  call   <Parser_TsPacketLog@plt>
  movzbl 0x4(%rbp),%edx
  mov    %r12,%rsi
  mov    %r15d,%edi
  xor    %eax,%eax
  mov    %edx,%ebx
  and    $0x7,%edx
  call   <Parser_TsPacketLog@plt>
  and    $0x7,%ebx
  sub    $0x1,%ebx
  cmp    $0x2,%bl
  jbe    L12
L0:
  cmpb   $0x2,0x1(%rbp)
  ja     L24
  mov    %r15d,%edi
  lea    D85(%rip),%rsi
  xor    %eax,%eax
  call   <Parser_TsPacketLog@plt>
  movzbl 0x1(%rbp),%eax
  add    $0x8,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
  nopw   0x0(%rax,%rax,1)
L12:
  movzwl 0x5(%rbp),%edx
  mov    %r14,%rsi
  mov    %r15d,%edi
  xor    %eax,%eax
  rol    $0x8,%dx
  movzwl %dx,%edx
  call   <Parser_TsPacketLog@plt>
  movzwl 0x7(%rbp),%edx
  mov    %r15d,%edi
  xor    %eax,%eax
  lea    D68(%rip),%rsi
  rol    $0x8,%dx
  movzwl %dx,%edx
  call   <Parser_TsPacketLog@plt>
  movzwl 0x9(%rbp),%edx
  mov    %r15d,%edi
  xor    %eax,%eax
  lea    D67(%rip),%rsi
  rol    $0x8,%dx
  movzwl %dx,%edx
  call   <Parser_TsPacketLog@plt>
  movzbl 0xb(%rbp),%edx
  mov    %r15d,%edi
  xor    %eax,%eax
  lea    D6(%rip),%rsi
  call   <Parser_TsPacketLog@plt>
  jmp    L0
L48:
  mov    $0xffffffff,%eax
  ret
```

tool_calls: name: retrieve_data
arguments: tag: D15
type_infered: string
name: retrieve_data
arguments: tag: D10
type_infered: string
name: retrieve_data
arguments: tag: D19
type_infered: string
name: retrieve_data
arguments: tag: D14
type_infered: string
name: retrieve_data
arguments: tag: D16
type_infered: string
name: retrieve_data
arguments: tag: D85
type_infered: string
name: retrieve_data
arguments: tag: D68
type_infered: string
name: retrieve_data
arguments: tag: D67
type_infered: string
name: retrieve_data
arguments: tag: D6
type_infered: string

tool: D15: original_network_id = 0x%x


tool: D10: announcement_type = 0x%x


tool: D19: reference_type = 0x%x


tool: D14: Descriptor_length = 0x%x


tool: D16: announcement_support_indicator = 0x%x


tool: D85: ******END******


tool: D68: transport_stream_id = 0x%x


tool: D67: service_id = 0x%x


tool: D6: component_tag = 0x%x


assistant: ```c
int x6E_Tag_DescriptorParser(unsigned int type, unsigned char *buff) {
  unsigned int i = 0;
  unsigned char reference_type = 0;
  unsigned char offset = 0;
  if (NULL == buff) {
    return -1;
  }
  Parser_DisplayTagInfo(type, buff[0]);
  Parser_TsPacketLog(type, "Descriptor_length = 0x%x\n", buff[1]);
  Parser_TsPacketLog(type, "announcement_support_indicator = 0x%x\n", ((buff[2] & 0xFF) << 8) | (buff[3] & 0xFF));
  for (i = 2; i < buff[1]; i += offset) {
    Parser_TsPacketLog(type, "announcement_type = 0x%x\n", buff[4] & 0xF0);
    reference_type = buff[4] & 0x07;
    Parser_TsPacketLog(type, "reference_type = 0x%x\n", reference_type);
    if ((0x01 == reference_type) || (0x02 == reference_type) || (0x03 == reference_type)) {
      Parser_TsPacketLog(type, "original_network_id = 0x%x\n", ((buff[5] & 0xFF) << 8) | (buff[6] & 0xFF));
      Parser_TsPacketLog(type, "transport_stream_id = 0x%x\n", ((buff[7] & 0xFF) << 8) | (buff[8] & 0xFF));
      Parser_TsPacketLog(type, "service_id = 0x%x\n", ((buff[9] & 0xFF) << 8) | (buff[10] & 0xFF));
      Parser_TsPacketLog(type, "component_tag = 0x%x\n", buff[11]);
    } else {
    }
  }
  Parser_TsPacketLog(type, "******END******\n");
  return buff[1];
}
```