user: Converte this assembly snippet into its equivalent C code:

```asm
<char_emphasis>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x40,%rsp
  mov    %rdi,-0x18(%rbp)
  mov    %rsi,-0x20(%rbp)
  mov    %rdx,-0x28(%rbp)
  mov    %rcx,-0x30(%rbp)
  mov    %r8,-0x38(%rbp)
  mov    -0x28(%rbp),%rax
  movzbl (%rax),%eax
  mov    %al,-0x9(%rbp)
  cmpq   $0x2,-0x38(%rbp)
  jbe    L103
  mov    -0x28(%rbp),%rax
  add    $0x1,%rax
  movzbl (%rax),%eax
  cmp    %al,-0x9(%rbp)
  je     L103
  cmpb   $0x7e,-0x9(%rbp)
  je     L109
  mov    -0x28(%rbp),%rax
  add    $0x1,%rax
  movzbl (%rax),%eax
  movsbl %al,%eax
  mov    %eax,%edi
  call   <isspace@plt>
  test   %rax,%rax
  jne    L109
  movsbl -0x9(%rbp),%edi
  mov    -0x38(%rbp),%rax
  lea    -0x1(%rax),%rcx
  mov    -0x28(%rbp),%rax
  lea    0x1(%rax),%rdx
  mov    -0x20(%rbp),%rsi
  mov    -0x18(%rbp),%rax
  mov    %edi,%r8d
  mov    %rax,%rdi
  call   <parse_emph1@plt>
  mov    %rax,-0x8(%rbp)
  cmpq   $0x0,-0x8(%rbp)
  jne    L37
L109:
  mov    $0x0,%eax
  jmp    L118
L37:
  mov    -0x8(%rbp),%rax
  add    $0x1,%rax
  jmp    L118
L103:
  cmpq   $0x3,-0x38(%rbp)
  jbe    L96
  mov    -0x28(%rbp),%rax
  add    $0x1,%rax
  movzbl (%rax),%eax
  cmp    %al,-0x9(%rbp)
  jne    L96
  mov    -0x28(%rbp),%rax
  add    $0x2,%rax
  movzbl (%rax),%eax
  cmp    %al,-0x9(%rbp)
  je     L96
  mov    -0x28(%rbp),%rax
  add    $0x2,%rax
  movzbl (%rax),%eax
  movsbl %al,%eax
  mov    %eax,%edi
  call   <isspace@plt>
  test   %rax,%rax
  jne    L140
  movsbl -0x9(%rbp),%edi
  mov    -0x38(%rbp),%rax
  lea    -0x2(%rax),%rcx
  mov    -0x28(%rbp),%rax
  lea    0x2(%rax),%rdx
  mov    -0x20(%rbp),%rsi
  mov    -0x18(%rbp),%rax
  mov    %edi,%r8d
  mov    %rax,%rdi
  call   <parse_emph2@plt>
  mov    %rax,-0x8(%rbp)
  cmpq   $0x0,-0x8(%rbp)
  jne    L130
L140:
  mov    $0x0,%eax
  jmp    L118
L130:
  mov    -0x8(%rbp),%rax
  add    $0x2,%rax
  jmp    L118
L96:
  cmpq   $0x4,-0x38(%rbp)
  jbe    L63
  mov    -0x28(%rbp),%rax
  add    $0x1,%rax
  movzbl (%rax),%eax
  cmp    %al,-0x9(%rbp)
  jne    L63
  mov    -0x28(%rbp),%rax
  add    $0x2,%rax
  movzbl (%rax),%eax
  cmp    %al,-0x9(%rbp)
  jne    L63
  mov    -0x28(%rbp),%rax
  add    $0x3,%rax
  movzbl (%rax),%eax
  cmp    %al,-0x9(%rbp)
  je     L63
  cmpb   $0x7e,-0x9(%rbp)
  je     L90
  mov    -0x28(%rbp),%rax
  add    $0x3,%rax
  movzbl (%rax),%eax
  movsbl %al,%eax
  mov    %eax,%edi
  call   <isspace@plt>
  test   %rax,%rax
  jne    L90
  movsbl -0x9(%rbp),%edi
  mov    -0x38(%rbp),%rax
  lea    -0x3(%rax),%rcx
  mov    -0x28(%rbp),%rax
  lea    0x3(%rax),%rdx
  mov    -0x20(%rbp),%rsi
  mov    -0x18(%rbp),%rax
  mov    %edi,%r8d
  mov    %rax,%rdi
  call   <parse_emph3@plt>
  mov    %rax,-0x8(%rbp)
  cmpq   $0x0,-0x8(%rbp)
  jne    L1
L90:
  mov    $0x0,%eax
  jmp    L118
L1:
  mov    -0x8(%rbp),%rax
  add    $0x3,%rax
  jmp    L118
L63:
  mov    $0x0,%eax
L118:
  leave
  ret
```

assistant: ```c
size_t char_emphasis(struct buf *ob, struct render *rndr, char *data, size_t offset, size_t size) {
  char c = data[0];
  size_t ret;
  if (size > 2 && data[1] != c) {
    if (c == '~' || isspace(data[1]) || (ret = parse_emph1(ob, rndr, data + 1, size - 1, c)) == 0)
      return 0;
    return ret + 1;
  }
  if (size > 3 && data[1] == c && data[2] != c) {
    if (isspace(data[2]) || (ret = parse_emph2(ob, rndr, data + 2, size - 2, c)) == 0)
      return 0;
    return ret + 2;
  }
  if (size > 4 && data[1] == c && data[2] == c && data[3] != c) {
    if (c == '~' || isspace(data[3]) || (ret = parse_emph3(ob, rndr, data + 3, size - 3, c)) == 0)
      return 0;
    return ret + 3;
  }
  return 0;
}
```