user: 请显示与下面列出的汇编代码相匹配的C语言实现：

```asm
<Utf8ToGb2312>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x50,%rsp
  mov    %rdi,-0x38(%rbp)
  mov    %esi,-0x3c(%rbp)
  mov    %rdx,-0x48(%rbp)
  mov    %fs:0x28,%rax
  mov    %rax,-0x8(%rbp)
  xor    %eax,%eax
  movl   $0x0,-0x24(%rbp)
  movl   $0x0,-0x20(%rbp)
  movl   $0x0,-0x1c(%rbp)
  movl   $0x0,-0x18(%rbp)
  movw   $0x0,-0x28(%rbp)
  movw   $0x0,-0x26(%rbp)
  jmp    L103
L17:
  mov    -0x1c(%rbp),%eax
  movslq %eax,%rdx
  mov    -0x38(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%eax
  movzbl %al,%eax
  mov    %eax,%edi
  call   <GetUtf8ByteNumForWord@plt>
  cmp    $0x6,%eax
  ja     L5
  mov    %eax,%eax
  lea    0x0(,%rax,4),%rdx
  lea    D18(%rip),%rax
  mov    (%rdx,%rax,1),%eax
  cltq
  lea    D18(%rip),%rdx
  add    %rdx,%rax
  notrack jmp *%rax
  mov    -0x1c(%rbp),%eax
  movslq %eax,%rdx
  mov    -0x38(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%edx
  mov    -0x18(%rbp),%eax
  cltq
  mov    %dl,-0x12(%rbp,%rax,1)
  movl   $0x1,-0x20(%rbp)
  jmp    L109
  mov    -0x1c(%rbp),%eax
  movslq %eax,%rdx
  mov    -0x38(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%edx
  mov    -0x18(%rbp),%eax
  cltq
  mov    %dl,-0x12(%rbp,%rax,1)
  mov    -0x1c(%rbp),%eax
  cltq
  lea    0x1(%rax),%rdx
  mov    -0x38(%rbp),%rax
  add    %rdx,%rax
  mov    -0x18(%rbp),%edx
  lea    0x1(%rdx),%ecx
  movzbl (%rax),%edx
  movslq %ecx,%rax
  mov    %dl,-0x12(%rbp,%rax,1)
  movl   $0x2,-0x20(%rbp)
  jmp    L109
  mov    -0x1c(%rbp),%eax
  movslq %eax,%rdx
  mov    -0x38(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%eax
  movsbl %al,%eax
  shl    $0x4,%eax
  mov    %eax,%ecx
  mov    -0x1c(%rbp),%eax
  cltq
  lea    0x1(%rax),%rdx
  mov    -0x38(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%eax
  sar    $0x2,%al
  and    $0xf,%eax
  mov    %eax,%edx
  mov    -0x18(%rbp),%eax
  add    $0x1,%eax
  or     %ecx,%edx
  cltq
  mov    %dl,-0x12(%rbp,%rax,1)
  mov    -0x1c(%rbp),%eax
  cltq
  lea    0x1(%rax),%rdx
  mov    -0x38(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%eax
  movsbl %al,%eax
  shl    $0x6,%eax
  mov    %eax,%ecx
  mov    -0x1c(%rbp),%eax
  cltq
  lea    0x2(%rax),%rdx
  mov    -0x38(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%eax
  and    $0x3f,%eax
  add    %ecx,%eax
  mov    %eax,%edx
  mov    -0x18(%rbp),%eax
  cltq
  mov    %dl,-0x12(%rbp,%rax,1)
  mov    -0x18(%rbp),%eax
  cltq
  lea    -0x12(%rbp),%rdx
  lea    (%rdx,%rax,1),%rcx
  lea    -0x28(%rbp),%rax
  mov    $0x2,%edx
  mov    %rcx,%rsi
  mov    %rax,%rdi
  call   <memcpy@plt>
  movzwl -0x28(%rbp),%eax
  movzwl %ax,%eax
  mov    %eax,%edi
  call   <SearchCodeTable@plt>
  mov    %ax,-0x26(%rbp)
  mov    -0x24(%rbp),%eax
  lea    0x1(%rax),%edx
  mov    %edx,-0x24(%rbp)
  cltq
  lea    (%rax,%rax,1),%rdx
  mov    -0x48(%rbp),%rax
  add    %rax,%rdx
  movzwl -0x26(%rbp),%eax
  mov    %ax,(%rdx)
  movl   $0x3,-0x20(%rbp)
  jmp    L109
  movl   $0x4,-0x20(%rbp)
  jmp    L109
  movl   $0x5,-0x20(%rbp)
  jmp    L109
  movl   $0x6,-0x20(%rbp)
  jmp    L109
L5:
  lea    D2(%rip),%rax
  mov    %rax,%rdi
  call   <printf@plt>
  nop
L109:
  mov    -0x20(%rbp),%eax
  add    %eax,-0x1c(%rbp)
  cmpl   $0x1,-0x20(%rbp)
  jne    L114
  addl   $0x1,-0x18(%rbp)
  jmp    L103
L114:
  addl   $0x2,-0x18(%rbp)
L103:
  mov    -0x1c(%rbp),%eax
  cmp    -0x3c(%rbp),%eax
  jl     L17
  nop
  mov    -0x8(%rbp),%rax
  sub    %fs:0x28,%rax
  je     L39
  call   <__stack_chk_fail@plt>
L39:
  leave
  ret
```

tool_calls: name: unpack_data
arguments: label: D2
type: string

tool: D2: the len is more than 6


assistant: ```c
void Utf8ToGb2312(const char *utf8, int len, unsigned short int *gbArray) {
  int k = 0;
  int byteCount = 0;
  int i = 0;
  int j = 0;
  char temp[10];
  unsigned short int unicodeKey = 0;
  unsigned short int gbKey = 0;
  while (i < len) {
    switch (GetUtf8ByteNumForWord((unsigned char)utf8[i])) {
    case 0:
      temp[j] = utf8[i];
      byteCount = 1;
      break;
    case 2:
      temp[j] = utf8[i];
      temp[j + 1] = utf8[i + 1];
      byteCount = 2;
      break;
    case 3:
      temp[j + 1] = ((utf8[i] & 0x0F) << 4) | ((utf8[i + 1] >> 2) & 0x0F);
      temp[j] = ((utf8[i + 1] & 0x03) << 6) + (utf8[i + 2] & 0x3F);
      memcpy(&unicodeKey, (temp + j), 2);
      gbKey = SearchCodeTable(unicodeKey);
      gbArray[k++] = gbKey;
      byteCount = 3;
      break;
    case 4:
      byteCount = 4;
      break;
    case 5:
      byteCount = 5;
      break;
    case 6:
      byteCount = 6;
      break;
    default:
      printf("the len is more than 6\n");
      break;
    }
    i += byteCount;
    if (byteCount == 1) {
      j++;
    } else {
      j += 2;
    }
  }
}
```