user: 请将这段汇编代码片段转换成等效的C代码:

```asm
<x45_Tag_DescriptorParser>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x30,%rsp
  mov    %edi,-0x24(%rbp)
  mov    %rsi,-0x30(%rbp)
  movl   $0x0,-0x10(%rbp)
  movl   $0x0,-0xc(%rbp)
  movb   $0x0,-0x11(%rbp)
  movq   $0x0,-0x8(%rbp)
  cmpq   $0x0,-0x30(%rbp)
  jne    L12
  mov    $0xffffffff,%eax
  jmp    L125
L12:
  mov    -0x30(%rbp),%rax
  movzbl (%rax),%eax
  movzbl %al,%edx
  mov    -0x24(%rbp),%eax
  mov    %edx,%esi
  mov    %eax,%edi
  call   <Parser_DisplayTagInfo@plt>
  mov    -0x30(%rbp),%rax
  add    $0x1,%rax
  movzbl (%rax),%eax
  movzbl %al,%edx
  mov    -0x24(%rbp),%eax
  lea    D6(%rip),%rcx
  mov    %rcx,%rsi
  mov    %eax,%edi
  mov    $0x0,%eax
  call   <Parser_TsPacketLog@plt>
  mov    -0x30(%rbp),%rax
  mov    %rax,-0x8(%rbp)
  addq   $0x2,-0x8(%rbp)
  movl   $0x0,-0x10(%rbp)
  jmp    L126
L102:
  mov    -0x8(%rbp),%rax
  movzbl (%rax),%eax
  movzbl %al,%edx
  mov    -0x24(%rbp),%eax
  lea    D20(%rip),%rcx
  mov    %rcx,%rsi
  mov    %eax,%edi
  mov    $0x0,%eax
  call   <Parser_TsPacketLog@plt>
  mov    -0x8(%rbp),%rax
  movzbl 0x1(%rax),%eax
  mov    %al,-0x11(%rbp)
  movzbl -0x11(%rbp),%edx
  mov    -0x24(%rbp),%eax
  lea    D42(%rip),%rcx
  mov    %rcx,%rsi
  mov    %eax,%edi
  mov    $0x0,%eax
  call   <Parser_TsPacketLog@plt>
  mov    -0x8(%rbp),%rax
  movzbl (%rax),%eax
  cmp    $0x1,%al
  je     L128
  mov    -0x8(%rbp),%rax
  movzbl (%rax),%eax
  cmp    $0x2,%al
  je     L128
  mov    -0x8(%rbp),%rax
  movzbl (%rax),%eax
  cmp    $0x4,%al
  je     L128
  mov    -0x8(%rbp),%rax
  movzbl (%rax),%eax
  cmp    $0x5,%al
  je     L128
  mov    -0x8(%rbp),%rax
  movzbl (%rax),%eax
  cmp    $0x6,%al
  je     L128
  mov    -0x8(%rbp),%rax
  movzbl (%rax),%eax
  cmp    $0x7,%al
  jne    L16
L128:
  addq   $0x2,-0x8(%rbp)
  movl   $0x0,-0xc(%rbp)
  jmp    L123
L27:
  mov    -0xc(%rbp),%edx
  mov    -0x8(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%eax
  movzbl %al,%eax
  sar    $0x5,%eax
  and    $0x2,%eax
  mov    %eax,%edx
  mov    -0x24(%rbp),%eax
  lea    D47(%rip),%rcx
  mov    %rcx,%rsi
  mov    %eax,%edi
  mov    $0x0,%eax
  call   <Parser_TsPacketLog@plt>
  mov    -0xc(%rbp),%edx
  mov    -0x8(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%eax
  movzbl %al,%eax
  and    $0x1f,%eax
  mov    %eax,%edx
  mov    -0x24(%rbp),%eax
  lea    D57(%rip),%rcx
  mov    %rcx,%rsi
  mov    %eax,%edi
  mov    $0x0,%eax
  call   <Parser_TsPacketLog@plt>
  addl   $0x1,-0xc(%rbp)
L123:
  movzbl -0x11(%rbp),%eax
  cmp    %eax,-0xc(%rbp)
  jb     L27
  jmp    L108
L16:
  addq   $0x2,-0x8(%rbp)
  mov    -0x8(%rbp),%rax
  movzbl (%rax),%eax
  movzbl %al,%edx
  mov    -0x24(%rbp),%eax
  lea    D69(%rip),%rcx
  mov    %rcx,%rsi
  mov    %eax,%edi
  mov    $0x0,%eax
  call   <Parser_TsPacketLog@plt>
L108:
  movzbl -0x11(%rbp),%eax
  add    %rax,-0x8(%rbp)
  addl   $0x1,-0x10(%rbp)
L126:
  mov    -0x30(%rbp),%rax
  add    $0x1,%rax
  movzbl (%rax),%eax
  movzbl %al,%eax
  cmp    %eax,-0x10(%rbp)
  jb     L102
  mov    -0x24(%rbp),%eax
  lea    D64(%rip),%rdx
  mov    %rdx,%rsi
  mov    %eax,%edi
  mov    $0x0,%eax
  call   <Parser_TsPacketLog@plt>
  mov    -0x30(%rbp),%rax
  add    $0x1,%rax
  movzbl (%rax),%eax
  movzbl %al,%eax
L125:
  leave
  ret
```

tool_calls: name: retrieve_data
arguments: tag: D6
type: string
name: retrieve_data
arguments: tag: D20
type: string
name: retrieve_data
arguments: tag: D42
type: string
name: retrieve_data
arguments: tag: D47
type: string
name: retrieve_data
arguments: tag: D57
type: string
name: retrieve_data
arguments: tag: D69
type: string
name: retrieve_data
arguments: tag: D64
type: string

tool: D6: Descriptor_length = 0x%x


tool: D20: data_service_id = 0x%x


tool: D42: data_service_descriptor_length = 0x%x


tool: D47: field_parity = 0x%x


tool: D57: line_offset = 0x%x


tool: D69: reserved = 0x%x ...


tool: D64: ******END******


assistant: ```c
int x45_Tag_DescriptorParser(unsigned int type, unsigned char *buff) {
  unsigned int i = 0, j = 0;
  unsigned char tmplen = 0;
  unsigned char *data = NULL;
  if (NULL == buff) {
    return -1;
  }
  Parser_DisplayTagInfo(type, buff[0]);
  Parser_TsPacketLog(type, "Descriptor_length = 0x%x\n", buff[1]);
  data = buff;
  data += 2;
  for (i = 0; i < buff[1]; i++) {
    Parser_TsPacketLog(type, "data_service_id = 0x%x\n", data[0]);
    tmplen = data[1];
    Parser_TsPacketLog(type, "data_service_descriptor_length = 0x%x\n", tmplen);
    if ((data[0] == 0x01) || (data[0] == 0x02) || (data[0] == 0x04) || (data[0] == 0x05) || (data[0] == 0x06) || (data[0] == 0x07)) {
      data += 2;
      for (j = 0; j < tmplen; j++) {
        Parser_TsPacketLog(type, "field_parity = 0x%x\n", (data[j] & 0x40) >> 5);
        Parser_TsPacketLog(type, "line_offset = 0x%x\n", data[j] & 0x1F);
      }
    } else {
      data += 2;
      Parser_TsPacketLog(type, "reserved = 0x%x ...\n", data[0]);
    }
    data += tmplen;
  }
  Parser_TsPacketLog(type, "******END******\n");
  return buff[1];
}
```