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

```asm
<utf8_char_int>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  mov    %rdi,-0x18(%rbp)
  cmpq   $0x0,-0x18(%rbp)
  jne    L57
  mov    $0x0,%eax
  jmp    L50
L57:
  mov    -0x18(%rbp),%rax
  mov    %rax,-0x8(%rbp)
  mov    -0x8(%rbp),%rax
  movzbl (%rax),%eax
  movzbl %al,%eax
  and    $0xe0,%eax
  cmp    $0xc0,%eax
  jne    L134
  mov    -0x8(%rbp),%rax
  add    $0x1,%rax
  movzbl (%rax),%eax
  test   %al,%al
  jne    L177
  mov    -0x8(%rbp),%rax
  movzbl (%rax),%eax
  movzbl %al,%eax
  and    $0x1f,%eax
  jmp    L50
L177:
  mov    -0x8(%rbp),%rax
  movzbl (%rax),%eax
  movzbl %al,%eax
  shl    $0x6,%eax
  and    $0x7c0,%eax
  mov    %eax,%edx
  mov    -0x8(%rbp),%rax
  add    $0x1,%rax
  movzbl (%rax),%eax
  movzbl %al,%eax
  and    $0x3f,%eax
  or     %edx,%eax
  jmp    L50
L134:
  mov    -0x8(%rbp),%rax
  movzbl (%rax),%eax
  movzbl %al,%eax
  and    $0xf0,%eax
  cmp    $0xe0,%eax
  jne    L196
  mov    -0x8(%rbp),%rax
  add    $0x1,%rax
  movzbl (%rax),%eax
  test   %al,%al
  jne    L75
  mov    -0x8(%rbp),%rax
  movzbl (%rax),%eax
  movzbl %al,%eax
  and    $0xf,%eax
  jmp    L50
L75:
  mov    -0x8(%rbp),%rax
  add    $0x2,%rax
  movzbl (%rax),%eax
  test   %al,%al
  jne    L171
  mov    -0x8(%rbp),%rax
  movzbl (%rax),%eax
  movzbl %al,%eax
  shl    $0x6,%eax
  and    $0x3c0,%eax
  mov    %eax,%edx
  mov    -0x8(%rbp),%rax
  add    $0x1,%rax
  movzbl (%rax),%eax
  movzbl %al,%eax
  and    $0x3f,%eax
  or     %edx,%eax
  jmp    L50
L171:
  mov    -0x8(%rbp),%rax
  movzbl (%rax),%eax
  movzbl %al,%eax
  shl    $0xc,%eax
  movzwl %ax,%edx
  mov    -0x8(%rbp),%rax
  add    $0x1,%rax
  movzbl (%rax),%eax
  movzbl %al,%eax
  shl    $0x6,%eax
  and    $0xfc0,%eax
  add    %eax,%edx
  mov    -0x8(%rbp),%rax
  add    $0x2,%rax
  movzbl (%rax),%eax
  movzbl %al,%eax
  and    $0x3f,%eax
  add    %edx,%eax
  jmp    L50
L196:
  mov    -0x8(%rbp),%rax
  movzbl (%rax),%eax
  movzbl %al,%eax
  and    $0xf8,%eax
  cmp    $0xf0,%eax
  jne    L186
  mov    -0x8(%rbp),%rax
  add    $0x1,%rax
  movzbl (%rax),%eax
  test   %al,%al
  jne    L60
  mov    -0x8(%rbp),%rax
  movzbl (%rax),%eax
  movzbl %al,%eax
  and    $0x7,%eax
  jmp    L50
L60:
  mov    -0x8(%rbp),%rax
  add    $0x2,%rax
  movzbl (%rax),%eax
  test   %al,%al
  jne    L123
  mov    -0x8(%rbp),%rax
  movzbl (%rax),%eax
  movzbl %al,%eax
  shl    $0x6,%eax
  and    $0x1c0,%eax
  mov    %eax,%edx
  mov    -0x8(%rbp),%rax
  add    $0x1,%rax
  movzbl (%rax),%eax
  movzbl %al,%eax
  and    $0x3f,%eax
  or     %edx,%eax
  jmp    L50
L123:
  mov    -0x8(%rbp),%rax
  add    $0x3,%rax
  movzbl (%rax),%eax
  test   %al,%al
  jne    L0
  mov    -0x8(%rbp),%rax
  movzbl (%rax),%eax
  movzbl %al,%eax
  shl    $0xc,%eax
  and    $0x7000,%eax
  mov    %eax,%edx
  mov    -0x8(%rbp),%rax
  add    $0x1,%rax
  movzbl (%rax),%eax
  movzbl %al,%eax
  shl    $0x6,%eax
  and    $0xfc0,%eax
  or     %eax,%edx
  mov    -0x8(%rbp),%rax
  add    $0x2,%rax
  movzbl (%rax),%eax
  movzbl %al,%eax
  and    $0x3f,%eax
  add    %edx,%eax
  jmp    L50
L0:
  mov    -0x8(%rbp),%rax
  movzbl (%rax),%eax
  movzbl %al,%eax
  shl    $0x12,%eax
  and    $0x1c0000,%eax
  mov    %eax,%edx
  mov    -0x8(%rbp),%rax
  add    $0x1,%rax
  movzbl (%rax),%eax
  movzbl %al,%eax
  shl    $0xc,%eax
  and    $0x3f000,%eax
  or     %eax,%edx
  mov    -0x8(%rbp),%rax
  add    $0x2,%rax
  movzbl (%rax),%eax
  movzbl %al,%eax
  shl    $0x6,%eax
  and    $0xfc0,%eax
  add    %eax,%edx
  mov    -0x8(%rbp),%rax
  add    $0x3,%rax
  movzbl (%rax),%eax
  movzbl %al,%eax
  and    $0x3f,%eax
  add    %edx,%eax
  jmp    L50
L186:
  mov    -0x8(%rbp),%rax
  movzbl (%rax),%eax
  movzbl %al,%eax
L50:
  pop    %rbp
  ret
```

assistant: ```c
int utf8_char_int(const char *string) {
  const unsigned char *ptr_string;
  if (!string)
    return 0;
  ptr_string = (unsigned char *)string;
  if ((ptr_string[0] & 0xE0) == 0xC0) {
    if (!ptr_string[1])
      return (int)(ptr_string[0] & 0x1F);
    return ((int)(ptr_string[0] & 0x1F) << 6) + ((int)(ptr_string[1] & 0x3F));
  } else if ((ptr_string[0] & 0xF0) == 0xE0) {
    if (!ptr_string[1])
      return (int)(ptr_string[0] & 0x0F);
    if (!ptr_string[2])
      return (((int)(ptr_string[0] & 0x0F)) << 6) + ((int)(ptr_string[1] & 0x3F));
    return (((int)(ptr_string[0] & 0x0F)) << 12) + (((int)(ptr_string[1] & 0x3F)) << 6) + ((int)(ptr_string[2] & 0x3F));
  } else if ((ptr_string[0] & 0xF8) == 0xF0) {
    if (!ptr_string[1])
      return (int)ptr_string[0] & 0x07;
    if (!ptr_string[2])
      return (((int)(ptr_string[0] & 0x07)) << 6) + ((int)(ptr_string[1] & 0x3F));
    if (!ptr_string[3])
      return (((int)(ptr_string[0] & 0x07)) << 12) + (((int)(ptr_string[1] & 0x3F)) << 6) + ((int)(ptr_string[2] & 0x3F));
    return (((int)(ptr_string[0] & 0x07)) << 18) + (((int)(ptr_string[1] & 0x3F)) << 12) + (((int)(ptr_string[2] & 0x3F)) << 6) + ((int)(ptr_string[3] & 0x3F));
  }
  return (int)ptr_string[0];
}
```