user: 请将以下的汇编代码转换成C语言代码：

```asm
<u8_rune_length>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  mov    %rdi,-0x8(%rbp)
  mov    -0x8(%rbp),%rax
  movzbl (%rax),%eax
  test   %al,%al
  jne    L246
  mov    $0x0,%eax
  jmp    L169
L246:
  mov    -0x8(%rbp),%rax
  movzbl (%rax),%eax
  test   %al,%al
  jle    L117
  mov    $0x1,%eax
  jmp    L169
L117:
  mov    -0x8(%rbp),%rax
  movzbl (%rax),%eax
  cmp    $0xc2,%al
  jl     L113
  mov    -0x8(%rbp),%rax
  movzbl (%rax),%eax
  cmp    $0xe0,%al
  jge    L113
  mov    -0x8(%rbp),%rax
  add    $0x1,%rax
  movzbl (%rax),%eax
  cmp    $0xc0,%al
  jge    L113
  mov    $0x2,%eax
  jmp    L169
L113:
  mov    -0x8(%rbp),%rax
  movzbl (%rax),%eax
  cmp    $0xe0,%al
  jne    L43
  mov    -0x8(%rbp),%rax
  add    $0x1,%rax
  movzbl (%rax),%eax
  cmp    $0xa0,%al
  jl     L43
  mov    -0x8(%rbp),%rax
  add    $0x1,%rax
  movzbl (%rax),%eax
  cmp    $0xc0,%al
  jge    L43
  mov    -0x8(%rbp),%rax
  add    $0x2,%rax
  movzbl (%rax),%eax
  cmp    $0xc0,%al
  jge    L43
  mov    $0x3,%eax
  jmp    L169
L43:
  mov    -0x8(%rbp),%rax
  movzbl (%rax),%eax
  cmp    $0xe1,%al
  jl     L158
  mov    -0x8(%rbp),%rax
  movzbl (%rax),%eax
  cmp    $0xed,%al
  jge    L158
  mov    -0x8(%rbp),%rax
  add    $0x1,%rax
  movzbl (%rax),%eax
  cmp    $0xc0,%al
  jge    L158
  mov    -0x8(%rbp),%rax
  add    $0x2,%rax
  movzbl (%rax),%eax
  cmp    $0xc0,%al
  jge    L158
  mov    $0x3,%eax
  jmp    L169
L158:
  mov    -0x8(%rbp),%rax
  movzbl (%rax),%eax
  cmp    $0xed,%al
  jne    L272
  mov    -0x8(%rbp),%rax
  add    $0x1,%rax
  movzbl (%rax),%eax
  cmp    $0xa0,%al
  jge    L272
  mov    -0x8(%rbp),%rax
  add    $0x2,%rax
  movzbl (%rax),%eax
  cmp    $0xc0,%al
  jge    L272
  mov    $0x3,%eax
  jmp    L169
L272:
  mov    -0x8(%rbp),%rax
  movzbl (%rax),%eax
  cmp    $0xf0,%al
  jne    L3
  mov    -0x8(%rbp),%rax
  add    $0x1,%rax
  movzbl (%rax),%eax
  cmp    $0x90,%al
  jl     L3
  mov    -0x8(%rbp),%rax
  add    $0x1,%rax
  movzbl (%rax),%eax
  cmp    $0xc0,%al
  jge    L3
  mov    -0x8(%rbp),%rax
  add    $0x2,%rax
  movzbl (%rax),%eax
  cmp    $0xc0,%al
  jge    L3
  mov    -0x8(%rbp),%rax
  add    $0x3,%rax
  movzbl (%rax),%eax
  cmp    $0xc0,%al
  jge    L3
  mov    $0x4,%eax
  jmp    L169
L3:
  mov    -0x8(%rbp),%rax
  movzbl (%rax),%eax
  cmp    $0xf1,%al
  jl     L131
  mov    -0x8(%rbp),%rax
  movzbl (%rax),%eax
  cmp    $0xf4,%al
  jge    L131
  mov    -0x8(%rbp),%rax
  add    $0x1,%rax
  movzbl (%rax),%eax
  cmp    $0xc0,%al
  jge    L131
  mov    -0x8(%rbp),%rax
  add    $0x2,%rax
  movzbl (%rax),%eax
  cmp    $0xc0,%al
  jge    L131
  mov    -0x8(%rbp),%rax
  add    $0x3,%rax
  movzbl (%rax),%eax
  cmp    $0xc0,%al
  jge    L131
  mov    $0x4,%eax
  jmp    L169
L131:
  mov    -0x8(%rbp),%rax
  movzbl (%rax),%eax
  cmp    $0xf4,%al
  jne    L387
  mov    -0x8(%rbp),%rax
  add    $0x1,%rax
  movzbl (%rax),%eax
  cmp    $0x90,%al
  jge    L387
  mov    -0x8(%rbp),%rax
  add    $0x2,%rax
  movzbl (%rax),%eax
  cmp    $0xc0,%al
  jge    L387
  mov    -0x8(%rbp),%rax
  add    $0x3,%rax
  movzbl (%rax),%eax
  cmp    $0xc0,%al
  jge    L387
  mov    $0x4,%eax
  jmp    L169
L387:
  mov    $0xffffffff,%eax
L169:
  pop    %rbp
  ret
```

assistant: ```c
int u8_rune_length(const char *p) {
  if (*p == '\x00')
    return 0;
  if (*p > '\x00' && *p <= '\x7f')
    return 1;
  if (*p >= '\xc2' && *p <= '\xdf' && *(p + 1) >= '\x80' && *(p + 1) <= '\xbf')
    return 2;
  if (*p == '\xe0' && *(p + 1) >= '\xa0' && *(p + 1) <= '\xbf' && *(p + 2) >= '\x80' && *(p + 2) <= '\xbf')
    return 3;
  if (*p >= '\xe1' && *p <= '\xec' && *(p + 1) >= '\x80' && *(p + 1) <= '\xbf' && *(p + 2) >= '\x80' && *(p + 2) <= '\xbf')
    return 3;
  if (*p == '\xed' && *(p + 1) >= '\x80' && *(p + 1) <= '\x9f' && *(p + 2) >= '\x80' && *(p + 2) <= '\xbf')
    return 3;
  if (*p == '\xf0' && *(p + 1) >= '\x90' && *(p + 1) <= '\xbf' && *(p + 2) >= '\x80' && *(p + 2) <= '\xbf' && *(p + 3) >= '\x80' && *(p + 3) <= '\xbf')
    return 4;
  if (*p >= '\xf1' && *p <= '\xf3' && *(p + 1) >= '\x80' && *(p + 1) <= '\xbf' && *(p + 2) >= '\x80' && *(p + 2) <= '\xbf' && *(p + 3) >= '\x80' && *(p + 3) <= '\xbf')
    return 4;
  if (*p == '\xf4' && *(p + 1) >= '\x80' && *(p + 1) <= '\x8f' && *(p + 2) >= '\x80' && *(p + 2) <= '\xbf' && *(p + 3) >= '\x80' && *(p + 3) <= '\xbf')
    return 4;
  return -1;
}
```