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

```asm
<match_c_literal>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x38,%rsp
  mov    %rdi,0x10(%rsp)
  mov    %rsi,0x28(%rsp)
  movzbl (%rdi),%ebx
  test   %bl,%bl
  je     L21
  mov    %rdi,%rax
  mov    %rdi,%r13
  mov    $0x1,%ebp
  movl   $0x0,0xc(%rsp)
  movl   $0x0,0x18(%rsp)
  mov    $0x0,%r12d
  movl   $0x0,0x1c(%rsp)
  mov    $0x0,%r15d
  add    $0x1,%rax
  mov    %rax,0x20(%rsp)
  jmp    L286
L296:
  test   %r15d,%r15d
  jne    L25
  cmp    $0x2e,%bl
  jne    L25
  or     0xc(%rsp),%r12d
  jne    L247
  mov    %ebp,%r14d
  mov    %r12d,0xc(%rsp)
  mov    $0x1,%r15d
L339:
  add    $0x1,%r13
  movzbl 0x0(%r13),%ebx
  add    $0x1,%ebp
  test   %bl,%bl
  je     L247
L286:
  lea    -0x1(%rbp),%r14d
  movsbl %bl,%edi
  call   <isdigit@plt>
  test   %rax,%rax
  je     L296
  or     0xc(%rsp),%r12d
  jne    L247
  mov    %ebp,%r14d
  mov    %r12d,0xc(%rsp)
  movl   $0x1,0x18(%rsp)
  jmp    L339
L25:
  cmp    $0x66,%bl
  jne    L216
  test   %r15d,%r15d
  jne    L394
L216:
  cmp    $0x2d,%bl
  jne    L379
  cmp    %r13,0x10(%rsp)
  jne    L379
  mov    %ebp,%r14d
  jmp    L339
L394:
  or     0xc(%rsp),%r12d
  cmove  %ebp,%r14d
  jmp    L247
L379:
  cmp    $0x78,%bl
  je     L372
  mov    %ebx,%eax
  and    $0xffffffdf,%eax
  cmp    $0x55,%al
  jne    L234
  test   %r12d,%r12d
  jne    L234
  mov    %ebp,%r14d
  mov    $0x1,%r12d
  jmp    L339
L372:
  cmp    0x20(%rsp),%r13
  je     L112
L151:
  cmpl   $0x0,0x1c(%rsp)
  je     L247
  or     0xc(%rsp),%r12d
  jne    L247
  cmp    $0x46,%bl
  jle    L49
  sub    $0x61,%ebx
  cmp    $0x5,%bl
  ja     L247
L1:
  mov    %ebp,%r14d
  mov    %r12d,0xc(%rsp)
  jmp    L339
L112:
  mov    %ebp,%r14d
  movl   $0x1,0x1c(%rsp)
  jmp    L339
L234:
  mov    %ebx,%eax
  and    $0xffffffdf,%eax
  cmp    $0x4c,%al
  jne    L151
  mov    0xc(%rsp),%eax
  cmp    $0x1,%eax
  jg     L151
  add    $0x1,%eax
  mov    %eax,0xc(%rsp)
  mov    %ebp,%r14d
  jmp    L339
L49:
  cmp    $0x40,%bl
  jg     L1
L247:
  cmp    $0x1,%r14d
  je     L17
L196:
  cmpl   $0x0,0x18(%rsp)
  je     L187
  mov    0x28(%rsp),%rdx
  cmp    %rdx,0x10(%rsp)
  ja     L363
L389:
  mov    %r14d,%eax
  add    $0x38,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
L17:
  mov    0x10(%rsp),%rax
  movzbl (%rax),%eax
  mov    %al,0xc(%rsp)
  sub    $0x2d,%eax
  cmp    $0x1,%al
  ja     L196
  mov    $0x0,%r14d
  jmp    L389
L363:
  mov    0x10(%rsp),%rbx
  movsbl -0x1(%rbx),%edi
  call   <is_caps_var_char@plt>
  test   %rax,%rax
  je     L243
  mov    $0x0,%r14d
  jmp    L389
L243:
  movsbl -0x1(%rbx),%edi
  call   <isalpha@plt>
  test   %rax,%rax
  mov    $0x0,%eax
  cmovne %eax,%r14d
  jmp    L389
L21:
  mov    $0x0,%r14d
  jmp    L389
L187:
  mov    0x18(%rsp),%r14d
  jmp    L389
```

assistant: ```c
int64_t match_c_literal(const char *str, const char *beginning_of_line) {
  const char *itr = str;
  int64_t count = 0;
  char ch = *itr;
  bool seen_decimal = false;
  bool seen_hex = false;
  bool seen_u = false;
  bool seen_digit = false;
  int seen_l = 0;
  while (ch != 0) {
    if (isdigit(ch)) {
      if (seen_u || seen_l)
        break;
      seen_digit = true;
      count++;
    } else if (!seen_decimal && ch == '.') {
      if (seen_u || seen_l)
        break;
      seen_decimal = true;
      count++;
    } else if (ch == 'f' && seen_decimal) {
      if (seen_u || seen_l)
        break;
      count++;
      break;
    } else if (ch == '-' && itr == str) {
      count++;
    } else if (ch == 'x' && itr == (str + 1)) {
      seen_hex = true;
      count++;
    } else if ((ch == 'u' || ch == 'U') && !seen_u) {
      seen_u = true;
      count++;
    } else if ((ch == 'l' || ch == 'L') && seen_l < 2) {
      seen_l++;
      count++;
    } else if (seen_hex) {
      if (seen_u || seen_l)
        break;
      bool valid_hex_char = false;
      switch (ch) {
      default:
        break;
      case 'a':
      case 'b':
      case 'c':
      case 'd':
      case 'e':
      case 'f':
      case 'A':
      case 'B':
      case 'C':
      case 'D':
      case 'E':
      case 'F':
        count++;
        valid_hex_char = true;
        break;
      }
      if (!valid_hex_char)
        break;
    } else {
      break;
    }
    itr++;
    ch = *itr;
  }
  if (count == 1 && (str[0] == '-' || str[0] == '.'))
    return 0;
  if (!seen_digit)
    return 0;
  if (str > beginning_of_line) {
    const char *prev = str - 1;
    if (is_caps_var_char(*prev) || isalpha(*prev))
      return 0;
  }
  return count;
}
```