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

```asm
<ltf8_get>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  mov    %rdi,-0x18(%rbp)
  mov    %rsi,-0x20(%rbp)
  mov    -0x18(%rbp),%rax
  mov    %rax,-0x8(%rbp)
  mov    -0x8(%rbp),%rax
  movzbl (%rax),%eax
  test   %al,%al
  js     L156
  mov    -0x8(%rbp),%rax
  movzbl (%rax),%eax
  movzbl %al,%edx
  mov    -0x20(%rbp),%rax
  mov    %edx,(%rax)
  mov    $0x1,%eax
  jmp    L49
L156:
  mov    -0x8(%rbp),%rax
  movzbl (%rax),%eax
  cmp    $0xbf,%al
  ja     L70
  mov    -0x8(%rbp),%rax
  movzbl (%rax),%eax
  movzbl %al,%eax
  shl    $0x8,%eax
  mov    %eax,%edx
  mov    -0x8(%rbp),%rax
  add    $0x1,%rax
  movzbl (%rax),%eax
  movzbl %al,%eax
  or     %edx,%eax
  and    $0x3fff,%eax
  mov    %eax,%edx
  mov    -0x20(%rbp),%rax
  mov    %edx,(%rax)
  mov    $0x2,%eax
  jmp    L49
L70:
  mov    -0x8(%rbp),%rax
  movzbl (%rax),%eax
  cmp    $0xdf,%al
  ja     L32
  mov    -0x8(%rbp),%rax
  movzbl (%rax),%eax
  movzbl %al,%eax
  shl    $0x10,%eax
  mov    %eax,%edx
  mov    -0x8(%rbp),%rax
  add    $0x1,%rax
  movzbl (%rax),%eax
  movzbl %al,%eax
  shl    $0x8,%eax
  or     %eax,%edx
  mov    -0x8(%rbp),%rax
  add    $0x2,%rax
  movzbl (%rax),%eax
  movzbl %al,%eax
  or     %edx,%eax
  and    $0x1fffff,%eax
  mov    %eax,%edx
  mov    -0x20(%rbp),%rax
  mov    %edx,(%rax)
  mov    $0x3,%eax
  jmp    L49
L32:
  mov    -0x8(%rbp),%rax
  movzbl (%rax),%eax
  cmp    $0xef,%al
  ja     L151
  mov    -0x8(%rbp),%rax
  movzbl (%rax),%eax
  movzbl %al,%eax
  shl    $0x18,%eax
  mov    %eax,%edx
  mov    -0x8(%rbp),%rax
  add    $0x1,%rax
  movzbl (%rax),%eax
  movzbl %al,%eax
  shl    $0x10,%eax
  or     %eax,%edx
  mov    -0x8(%rbp),%rax
  add    $0x2,%rax
  movzbl (%rax),%eax
  movzbl %al,%eax
  shl    $0x8,%eax
  or     %eax,%edx
  mov    -0x8(%rbp),%rax
  add    $0x3,%rax
  movzbl (%rax),%eax
  movzbl %al,%eax
  or     %edx,%eax
  and    $0xfffffff,%eax
  mov    %eax,%edx
  mov    -0x20(%rbp),%rax
  mov    %edx,(%rax)
  mov    $0x4,%eax
  jmp    L49
L151:
  mov    -0x8(%rbp),%rax
  movzbl (%rax),%eax
  cmp    $0xf7,%al
  ja     L15
  mov    -0x8(%rbp),%rax
  movzbl (%rax),%eax
  movzbl %al,%eax
  mov    $0x20,%edx
  mov    %edx,%ecx
  shl    %cl,%eax
  mov    %eax,%edx
  mov    -0x8(%rbp),%rax
  add    $0x1,%rax
  movzbl (%rax),%eax
  movzbl %al,%eax
  shl    $0x18,%eax
  or     %eax,%edx
  mov    -0x8(%rbp),%rax
  add    $0x2,%rax
  movzbl (%rax),%eax
  movzbl %al,%eax
  shl    $0x10,%eax
  or     %eax,%edx
  mov    -0x8(%rbp),%rax
  add    $0x3,%rax
  movzbl (%rax),%eax
  movzbl %al,%eax
  shl    $0x8,%eax
  or     %eax,%edx
  mov    -0x8(%rbp),%rax
  add    $0x4,%rax
  movzbl (%rax),%eax
  movzbl %al,%eax
  or     %eax,%edx
  mov    -0x20(%rbp),%rax
  mov    %edx,(%rax)
  mov    $0x5,%eax
  jmp    L49
L15:
  mov    -0x8(%rbp),%rax
  movzbl (%rax),%eax
  cmp    $0xfb,%al
  ja     L41
  mov    -0x8(%rbp),%rax
  movzbl (%rax),%eax
  movzbl %al,%eax
  mov    $0x28,%edx
  mov    %edx,%ecx
  shl    %cl,%eax
  mov    %eax,%esi
  mov    -0x8(%rbp),%rax
  add    $0x1,%rax
  movzbl (%rax),%eax
  movzbl %al,%eax
  mov    $0x20,%edx
  mov    %edx,%ecx
  shl    %cl,%eax
  or     %eax,%esi
  mov    %esi,%edx
  mov    -0x8(%rbp),%rax
  add    $0x2,%rax
  movzbl (%rax),%eax
  movzbl %al,%eax
  shl    $0x18,%eax
  or     %eax,%edx
  mov    -0x8(%rbp),%rax
  add    $0x3,%rax
  movzbl (%rax),%eax
  movzbl %al,%eax
  shl    $0x10,%eax
  or     %eax,%edx
  mov    -0x8(%rbp),%rax
  add    $0x4,%rax
  movzbl (%rax),%eax
  movzbl %al,%eax
  shl    $0x8,%eax
  or     %eax,%edx
  mov    -0x8(%rbp),%rax
  add    $0x5,%rax
  movzbl (%rax),%eax
  movzbl %al,%eax
  or     %eax,%edx
  mov    -0x20(%rbp),%rax
  mov    %edx,(%rax)
  mov    $0x6,%eax
  jmp    L49
L41:
  mov    -0x8(%rbp),%rax
  movzbl (%rax),%eax
  cmp    $0xfd,%al
  ja     L101
  mov    -0x8(%rbp),%rax
  movzbl (%rax),%eax
  movzbl %al,%eax
  mov    $0x30,%edx
  mov    %edx,%ecx
  shl    %cl,%eax
  mov    %eax,%esi
  mov    -0x8(%rbp),%rax
  add    $0x1,%rax
  movzbl (%rax),%eax
  movzbl %al,%eax
  mov    $0x28,%edx
  mov    %edx,%ecx
  shl    %cl,%eax
  or     %eax,%esi
  mov    -0x8(%rbp),%rax
  add    $0x2,%rax
  movzbl (%rax),%eax
  movzbl %al,%eax
  mov    $0x20,%edx
  mov    %edx,%ecx
  shl    %cl,%eax
  or     %eax,%esi
  mov    %esi,%edx
  mov    -0x8(%rbp),%rax
  add    $0x3,%rax
  movzbl (%rax),%eax
  movzbl %al,%eax
  shl    $0x18,%eax
  or     %eax,%edx
  mov    -0x8(%rbp),%rax
  add    $0x4,%rax
  movzbl (%rax),%eax
  movzbl %al,%eax
  shl    $0x10,%eax
  or     %eax,%edx
  mov    -0x8(%rbp),%rax
  add    $0x5,%rax
  movzbl (%rax),%eax
  movzbl %al,%eax
  shl    $0x8,%eax
  or     %eax,%edx
  mov    -0x8(%rbp),%rax
  add    $0x6,%rax
  movzbl (%rax),%eax
  movzbl %al,%eax
  or     %eax,%edx
  mov    -0x20(%rbp),%rax
  mov    %edx,(%rax)
  mov    $0x7,%eax
  jmp    L49
L101:
  mov    -0x8(%rbp),%rax
  movzbl (%rax),%eax
  cmp    $0xff,%al
  je     L43
  mov    -0x8(%rbp),%rax
  add    $0x1,%rax
  movzbl (%rax),%eax
  movzbl %al,%eax
  mov    $0x30,%edx
  mov    %edx,%ecx
  shl    %cl,%eax
  mov    %eax,%esi
  mov    -0x8(%rbp),%rax
  add    $0x2,%rax
  movzbl (%rax),%eax
  movzbl %al,%eax
  mov    $0x28,%edx
  mov    %edx,%ecx
  shl    %cl,%eax
  or     %eax,%esi
  mov    -0x8(%rbp),%rax
  add    $0x3,%rax
  movzbl (%rax),%eax
  movzbl %al,%eax
  mov    $0x20,%edx
  mov    %edx,%ecx
  shl    %cl,%eax
  or     %eax,%esi
  mov    %esi,%edx
  mov    -0x8(%rbp),%rax
  add    $0x4,%rax
  movzbl (%rax),%eax
  movzbl %al,%eax
  shl    $0x18,%eax
  or     %eax,%edx
  mov    -0x8(%rbp),%rax
  add    $0x5,%rax
  movzbl (%rax),%eax
  movzbl %al,%eax
  shl    $0x10,%eax
  or     %eax,%edx
  mov    -0x8(%rbp),%rax
  add    $0x6,%rax
  movzbl (%rax),%eax
  movzbl %al,%eax
  shl    $0x8,%eax
  or     %eax,%edx
  mov    -0x8(%rbp),%rax
  add    $0x7,%rax
  movzbl (%rax),%eax
  movzbl %al,%eax
  or     %eax,%edx
  mov    -0x20(%rbp),%rax
  mov    %edx,(%rax)
  mov    $0x8,%eax
  jmp    L49
L43:
  mov    -0x8(%rbp),%rax
  add    $0x1,%rax
  movzbl (%rax),%eax
  movzbl %al,%eax
  mov    $0x38,%edx
  mov    %edx,%ecx
  shl    %cl,%eax
  mov    %eax,%esi
  mov    -0x8(%rbp),%rax
  add    $0x2,%rax
  movzbl (%rax),%eax
  movzbl %al,%eax
  mov    $0x30,%edx
  mov    %edx,%ecx
  shl    %cl,%eax
  or     %eax,%esi
  mov    -0x8(%rbp),%rax
  add    $0x3,%rax
  movzbl (%rax),%eax
  movzbl %al,%eax
  mov    $0x28,%edx
  mov    %edx,%ecx
  shl    %cl,%eax
  or     %eax,%esi
  mov    -0x8(%rbp),%rax
  add    $0x4,%rax
  movzbl (%rax),%eax
  movzbl %al,%eax
  mov    $0x20,%edx
  mov    %edx,%ecx
  shl    %cl,%eax
  or     %eax,%esi
  mov    %esi,%edx
  mov    -0x8(%rbp),%rax
  add    $0x5,%rax
  movzbl (%rax),%eax
  movzbl %al,%eax
  shl    $0x18,%eax
  or     %eax,%edx
  mov    -0x8(%rbp),%rax
  add    $0x6,%rax
  movzbl (%rax),%eax
  movzbl %al,%eax
  shl    $0x10,%eax
  or     %eax,%edx
  mov    -0x8(%rbp),%rax
  add    $0x7,%rax
  movzbl (%rax),%eax
  movzbl %al,%eax
  shl    $0x8,%eax
  or     %eax,%edx
  mov    -0x8(%rbp),%rax
  add    $0x8,%rax
  movzbl (%rax),%eax
  movzbl %al,%eax
  or     %eax,%edx
  mov    -0x20(%rbp),%rax
  mov    %edx,(%rax)
  mov    $0x9,%eax
L49:
  pop    %rbp
  ret
```

assistant: ```c
int ltf8_get(char *cp, int64_t *val_p) {
  unsigned char *up = (unsigned char *)cp;
  if (up[0] < 0x80) {
    *val_p = up[0];
    return 1;
  } else if (up[0] < 0xc0) {
    *val_p = (((uint64_t)up[0] << 8) | (uint64_t)up[1]) & (((1LL << (6 + 8))) - 1);
    return 2;
  } else if (up[0] < 0xe0) {
    *val_p = (((uint64_t)up[0] << 16) | ((uint64_t)up[1] << 8) | (uint64_t)up[2]) & ((1LL << (5 + 2 * 8)) - 1);
    return 3;
  } else if (up[0] < 0xf0) {
    *val_p = (((uint64_t)up[0] << 24) | ((uint64_t)up[1] << 16) | ((uint64_t)up[2] << 8) | (uint64_t)up[3]) & ((1LL << (4 + 3 * 8)) - 1);
    return 4;
  } else if (up[0] < 0xf8) {
    *val_p = (((uint64_t)up[0] << 32) | ((uint64_t)up[1] << 24) | ((uint64_t)up[2] << 16) | ((uint64_t)up[3] << 8) | (uint64_t)up[4]) & ((1LL << (3 + 4 * 8)) - 1);
    return 5;
  } else if (up[0] < 0xfc) {
    *val_p = (((uint64_t)up[0] << 40) | ((uint64_t)up[1] << 32) | ((uint64_t)up[2] << 24) | ((uint64_t)up[3] << 16) | ((uint64_t)up[4] << 8) | (uint64_t)up[5]) & ((1LL << (2 + 5 * 8)) - 1);
    return 6;
  } else if (up[0] < 0xfe) {
    *val_p = (((uint64_t)up[0] << 48) | ((uint64_t)up[1] << 40) | ((uint64_t)up[2] << 32) | ((uint64_t)up[3] << 24) | ((uint64_t)up[4] << 16) | ((uint64_t)up[5] << 8) | (uint64_t)up[6]) & ((1LL << (1 + 6 * 8)) - 1);
    return 7;
  } else if (up[0] < 0xff) {
    *val_p = (((uint64_t)up[1] << 48) | ((uint64_t)up[2] << 40) | ((uint64_t)up[3] << 32) | ((uint64_t)up[4] << 24) | ((uint64_t)up[5] << 16) | ((uint64_t)up[6] << 8) | (uint64_t)up[7]) & ((1LL << (7 * 8)) - 1);
    return 8;
  } else {
    *val_p = (((uint64_t)up[1] << 56) | ((uint64_t)up[2] << 48) | ((uint64_t)up[3] << 40) | ((uint64_t)up[4] << 32) | ((uint64_t)up[5] << 24) | ((uint64_t)up[6] << 16) | ((uint64_t)up[7] << 8) | (uint64_t)up[8]);
    return 9;
  }
}
```