user: Please show me the C implementation that matches the assembly code listed below:

```asm
<x4E_Tag_DescriptorParser>:
  endbr64
  test   %rsi,%rsi
  je     L117
  push   %r15
  mov    %edi,%r15d
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  mov    %rsi,%rbx
  sub    $0x18,%rsp
  movzbl (%rsi),%esi
  call   <Parser_DisplayTagInfo@plt>
  movzbl 0x1(%rbx),%edx
  mov    %r15d,%edi
  xor    %eax,%eax
  lea    D38(%rip),%rsi
  call   <Parser_TsPacketLog@plt>
  movzbl 0x2(%rbx),%edx
  mov    %r15d,%edi
  xor    %eax,%eax
  lea    D95(%rip),%rsi
  shr    $0x4,%dl
  movzbl %dl,%edx
  call   <Parser_TsPacketLog@plt>
  movzbl 0x2(%rbx),%edx
  mov    %r15d,%edi
  xor    %eax,%eax
  lea    D140(%rip),%rsi
  and    $0xf,%edx
  call   <Parser_TsPacketLog@plt>
  movzbl 0x4(%rbx),%r8d
  movzbl 0x3(%rbx),%ecx
  lea    D16(%rip),%rsi
  movzbl 0x5(%rbx),%r9d
  mov    %r15d,%edi
  mov    %ecx,%edx
  mov    %r8d,%eax
  shl    $0x8,%eax
  shl    $0x10,%edx
  or     %eax,%edx
  xor    %eax,%eax
  or     %r9d,%edx
  call   <Parser_TsPacketLog@plt>
  movzbl 0x6(%rbx),%edx
  xor    %eax,%eax
  mov    %r15d,%edi
  lea    D179(%rip),%rsi
  call   <Parser_TsPacketLog@plt>
  cmpb   $0x0,0x6(%rbx)
  je     L159
  xor    %r12d,%r12d
  xor    %r13d,%r13d
  jmp    L92
  nopw   0x0(%rax,%rax,1)
L31:
  lea    (%r12,%rax,1),%r14d
  lea    0x2(%r12),%eax
  mov    %eax,0x4(%rsp)
  lea    0x1(%r12),%eax
  mov    %eax,0xc(%rsp)
L89:
  mov    %r14d,%eax
  lea    D154(%rip),%rsi
  mov    %r15d,%edi
  movzbl (%rbx,%rax,1),%r14d
  xor    %eax,%eax
  mov    %r14d,%edx
  call   <Parser_TsPacketLog@plt>
  test   %r14b,%r14b
  jne    L116
L143:
  mov    0x4(%rsp),%ebp
  movzbl 0x6(%rbx),%eax
  add    %r14d,%ebp
  add    %ebp,%r13d
  cmp    %r13d,%eax
  jbe    L60
L92:
  lea    0x7(%r13),%r14d
  xor    %eax,%eax
  lea    D5(%rip),%rsi
  mov    %r15d,%edi
  add    %rbx,%r14
  movzbl (%r14),%edx
  call   <Parser_TsPacketLog@plt>
  lea    0x8(%r13),%eax
  cmpb   $0x0,(%r14)
  mov    %eax,0x8(%rsp)
  je     L31
  xor    %eax,%eax
  lea    D142(%rip),%rsi
  mov    %r15d,%edi
  call   <Parser_TsPacketLog@plt>
  cmpb   $0x0,(%r14)
  je     L97
  mov    0x8(%rsp),%ebp
  xor    %r12d,%r12d
  add    %rbx,%rbp
  nopl   0x0(%rax)
L87:
  movzbl 0x0(%rbp),%edx
  lea    D47(%rip),%rsi
  mov    %r15d,%edi
  xor    %eax,%eax
  add    $0x1,%rbp
  call   <Parser_TsPacketLog@plt>
  movzbl (%r14),%eax
  mov    %r12d,%edx
  add    $0x1,%r12d
  cmp    %r12d,%eax
  ja     L87
  lea    0x2(%rdx),%eax
  mov    %eax,0xc(%rsp)
  mov    0x8(%rsp),%eax
  lea    (%r12,%rax,1),%r14d
  lea    0x3(%rdx),%eax
  mov    %eax,0x4(%rsp)
L150:
  lea    D149(%rip),%rsi
  mov    %r15d,%edi
  xor    %eax,%eax
  call   <Parser_TsPacketLog@plt>
  jmp    L89
  nopl   (%rax)
L116:
  lea    D40(%rip),%rsi
  mov    %r15d,%edi
  xor    %eax,%eax
  call   <Parser_TsPacketLog@plt>
  mov    0xc(%rsp),%r12d
  add    0x8(%rsp),%r12d
  lea    (%r12,%r14,1),%ebp
  nop
L93:
  mov    %r12d,%eax
  lea    D47(%rip),%rsi
  mov    %r15d,%edi
  add    $0x1,%r12d
  movzbl (%rbx,%rax,1),%edx
  xor    %eax,%eax
  call   <Parser_TsPacketLog@plt>
  cmp    %r12d,%ebp
  jne    L93
  lea    D149(%rip),%rsi
  mov    %r15d,%edi
  xor    %eax,%eax
  mov    %r14d,%r12d
  call   <Parser_TsPacketLog@plt>
  jmp    L143
  nopw   0x0(%rax,%rax,1)
L60:
  mov    %r13d,%r14d
  add    $0x7,%r13d
L76:
  add    %rbx,%r13
  xor    %eax,%eax
  lea    D15(%rip),%rsi
  mov    %r15d,%edi
  movzbl 0x0(%r13),%edx
  call   <Parser_TsPacketLog@plt>
  cmpb   $0x0,0x0(%r13)
  jne    L29
L99:
  mov    %r15d,%edi
  lea    D173(%rip),%rsi
  xor    %eax,%eax
  call   <Parser_TsPacketLog@plt>
  movzbl 0x1(%rbx),%eax
  add    $0x18,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
  nopl   0x0(%rax,%rax,1)
L29:
  xor    %eax,%eax
  mov    %r14d,%r12d
  lea    D178(%rip),%rsi
  mov    %r15d,%edi
  call   <Parser_TsPacketLog@plt>
  add    $0x8,%r12d
  xor    %ebp,%ebp
  cmpb   $0x0,0x0(%r13)
  lea    D47(%rip),%r14
  je     L80
  nopl   0x0(%rax,%rax,1)
L94:
  lea    0x0(%rbp,%r12,1),%eax
  mov    %r14,%rsi
  mov    %r15d,%edi
  add    $0x1,%ebp
  movzbl (%rbx,%rax,1),%edx
  xor    %eax,%eax
  call   <Parser_TsPacketLog@plt>
  movzbl 0x0(%r13),%eax
  cmp    %ebp,%eax
  ja     L94
L80:
  lea    D149(%rip),%rsi
  mov    %r15d,%edi
  xor    %eax,%eax
  call   <Parser_TsPacketLog@plt>
  jmp    L99
  nopl   0x0(%rax,%rax,1)
L159:
  mov    $0x7,%r13d
  xor    %r14d,%r14d
  jmp    L76
  xchg   %ax,%ax
L97:
  movl   $0x2,0x4(%rsp)
  mov    0x8(%rsp),%r14d
  xor    %r12d,%r12d
  movl   $0x1,0xc(%rsp)
  jmp    L150
L117:
  mov    $0xffffffff,%eax
  ret
```

tool_calls: name: unpack_data
arguments: tag: D38
type_guessed: string
name: unpack_data
arguments: tag: D95
type_guessed: string
name: unpack_data
arguments: tag: D140
type_guessed: string
name: unpack_data
arguments: tag: D16
type_guessed: string
name: unpack_data
arguments: tag: D179
type_guessed: string
name: unpack_data
arguments: tag: D154
type_guessed: string
name: unpack_data
arguments: tag: D5
type_guessed: string
name: unpack_data
arguments: tag: D142
type_guessed: string
name: unpack_data
arguments: tag: D47
type_guessed: string
name: unpack_data
arguments: tag: D149
type_guessed: string
name: unpack_data
arguments: tag: D40
type_guessed: string
name: unpack_data
arguments: tag: D15
type_guessed: string
name: unpack_data
arguments: tag: D173
type_guessed: string
name: unpack_data
arguments: tag: D178
type_guessed: string

tool: D38: Descriptor_length = 0x%x


tool: D95: descriptor_number = 0x%x


tool: D140: last_descriptor_number = 0x%x


tool: D16: ISO_639_language_code = 0x%x : %c%c%c


tool: D179: length_of_items = 0x%x


tool: D154: item_length = 0x%x


tool: D5: item_description_length = 0x%x


tool: D142: item_description_char: 

tool: D47: %c

tool: D149: 


tool: D40: item_char: 

tool: D15: text_length = 0x%x


tool: D173: ******END******


tool: D178: text_char: 

assistant: ```c
int x4E_Tag_DescriptorParser(unsigned int type, unsigned char *buff) {
  unsigned int i = 0, j = 0;
  unsigned int offset = 0;
  unsigned char tmp = 0;
  if (NULL == buff) {
    return -1;
  }
  Parser_DisplayTagInfo(type, buff[0]);
  Parser_TsPacketLog(type, "Descriptor_length = 0x%x\n", buff[1]);
  Parser_TsPacketLog(type, "descriptor_number = 0x%x\n", (buff[2] & 0xF0) >> 4);
  Parser_TsPacketLog(type, "last_descriptor_number = 0x%x\n", buff[2] & 0x0F);
  Parser_TsPacketLog(type, "ISO_639_language_code = 0x%x : %c%c%c\n", (buff[3] << 16) | (buff[4] << 8) | (buff[5] & 0xFF), buff[3], buff[4], buff[5]);
  Parser_TsPacketLog(type, "length_of_items = 0x%x\n", buff[6]);
  if (0 != buff[6]) {
    for (i = 0; i < buff[6]; i += offset) {
      Parser_TsPacketLog(type, "item_description_length = 0x%x\n", buff[i + 7]);
      if (0 != buff[i + 7]) {
        Parser_TsPacketLog(type, "item_description_char: ");
        for (j = 0; j < buff[i + 7]; j++) {
          Parser_TsPacketLog(type, "%c", buff[i + j + 8]);
        }
        Parser_TsPacketLog(type, "\n");
      }
      offset = j + 1;
      tmp = buff[i + j + 8];
      Parser_TsPacketLog(type, "item_length = 0x%x\n", tmp);
      if (0 != tmp) {
        Parser_TsPacketLog(type, "item_char: ");
        for (j = 0; j < tmp; j++) {
          Parser_TsPacketLog(type, "%c", buff[i + j + offset + 8]);
        }
        Parser_TsPacketLog(type, "\n");
      }
      offset += tmp;
      offset += 1;
    }
  }
  Parser_TsPacketLog(type, "text_length = 0x%x\n", buff[i + 7]);
  if (0 != buff[i + 7]) {
    Parser_TsPacketLog(type, "text_char: ");
    for (j = 0; j < buff[i + 7]; j++) {
      Parser_TsPacketLog(type, "%c", buff[i + j + 8]);
    }
    Parser_TsPacketLog(type, "\n");
  }
  Parser_TsPacketLog(type, "******END******\n");
  return buff[1];
}
```