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

```asm
<bit_entry_16>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x30,%rsp
  mov    %rdi,-0x18(%rbp)
  mov    %esi,-0x1c(%rbp)
  mov    %rdx,-0x28(%rbp)
  mov    %rcx,-0x30(%rbp)
  movl   $0x0,-0x4(%rbp)
  cmpq   $0x0,-0x18(%rbp)
  jne    L181
  mov    $0x0,%eax
  jmp    L30
L181:
  cmpl   $0x40,-0x1c(%rbp)
  jg     L89
  cmpl   $0x0,-0x1c(%rbp)
  jg     L90
L89:
  mov    $0x0,%eax
  jmp    L30
L90:
  mov    -0x18(%rbp),%rax
  mov    %rax,%rdi
  call   <strlen@plt>
  mov    %eax,-0x4(%rbp)
  mov    -0x1c(%rbp),%eax
  sub    $0x1,%eax
  mov    %eax,-0x8(%rbp)
  movl   $0x0,-0xc(%rbp)
  jmp    L151
L82:
  mov    -0xc(%rbp),%edx
  mov    -0x18(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%eax
  cmp    $0x7b,%al
  je     L63
  mov    -0xc(%rbp),%edx
  mov    -0x18(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%eax
  cmp    $0x7d,%al
  je     L63
  mov    -0xc(%rbp),%edx
  mov    -0x18(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%eax
  cmp    $0x20,%al
  je     L63
  mov    -0xc(%rbp),%edx
  mov    -0x18(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%eax
  cmp    $0x9,%al
  je     L63
  mov    -0xc(%rbp),%edx
  mov    -0x18(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%eax
  cmp    $0x30,%al
  jne    L78
  mov    -0x28(%rbp),%rax
  mov    (%rax),%edx
  mov    -0x8(%rbp),%eax
  mov    $0x1,%esi
  mov    %eax,%ecx
  shl    %cl,%esi
  mov    %esi,%eax
  not    %eax
  and    %eax,%edx
  mov    -0x28(%rbp),%rax
  mov    %edx,(%rax)
  mov    -0x30(%rbp),%rax
  mov    (%rax),%edx
  mov    -0x8(%rbp),%eax
  mov    $0x1,%esi
  mov    %eax,%ecx
  shl    %cl,%esi
  mov    %esi,%eax
  or     %eax,%edx
  mov    -0x30(%rbp),%rax
  mov    %edx,(%rax)
  subl   $0x1,-0x8(%rbp)
  jmp    L63
L78:
  mov    -0xc(%rbp),%edx
  mov    -0x18(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%eax
  cmp    $0x31,%al
  jne    L29
  mov    -0x28(%rbp),%rax
  mov    (%rax),%edx
  mov    -0x8(%rbp),%eax
  mov    $0x1,%esi
  mov    %eax,%ecx
  shl    %cl,%esi
  mov    %esi,%eax
  or     %eax,%edx
  mov    -0x28(%rbp),%rax
  mov    %edx,(%rax)
  mov    -0x30(%rbp),%rax
  mov    (%rax),%edx
  mov    -0x8(%rbp),%eax
  mov    $0x1,%esi
  mov    %eax,%ecx
  shl    %cl,%esi
  mov    %esi,%eax
  or     %eax,%edx
  mov    -0x30(%rbp),%rax
  mov    %edx,(%rax)
  subl   $0x1,-0x8(%rbp)
  jmp    L63
L29:
  mov    -0xc(%rbp),%edx
  mov    -0x18(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%eax
  cmp    $0x2d,%al
  je     L154
  mov    -0xc(%rbp),%edx
  mov    -0x18(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%eax
  cmp    $0x2a,%al
  jne    L14
L154:
  mov    -0x28(%rbp),%rax
  mov    (%rax),%edx
  mov    -0x8(%rbp),%eax
  mov    $0x1,%esi
  mov    %eax,%ecx
  shl    %cl,%esi
  mov    %esi,%eax
  not    %eax
  and    %eax,%edx
  mov    -0x28(%rbp),%rax
  mov    %edx,(%rax)
  mov    -0x30(%rbp),%rax
  mov    (%rax),%edx
  mov    -0x8(%rbp),%eax
  mov    $0x1,%esi
  mov    %eax,%ecx
  shl    %cl,%esi
  mov    %esi,%eax
  not    %eax
  and    %eax,%edx
  mov    -0x30(%rbp),%rax
  mov    %edx,(%rax)
  subl   $0x1,-0x8(%rbp)
  jmp    L63
L14:
  mov    $0x0,%eax
  jmp    L30
L63:
  addl   $0x1,-0xc(%rbp)
L151:
  mov    -0xc(%rbp),%eax
  cmp    -0x4(%rbp),%eax
  jb     L82
  cmpl   $0xffffffff,-0x8(%rbp)
  je     L161
  mov    $0x0,%eax
  jmp    L30
L161:
  mov    $0x1,%eax
L30:
  leave
  ret
```

assistant: ```c
int bit_entry_16(const char *token, int bits, uint16_t *data, uint16_t *mask) {
  do {
    unsigned int count = 0;
    unsigned int index;
    int buf_index;
    if (token == NULL)
      return 0;
    if ((bits > 64) || (bits < 1))
      return 0;
    count = strlen(token);
    buf_index = bits - 1;
    for (index = 0; index < count; index++) {
      if ((token[index] == '{') || (token[index] == '}')) {
      } else if ((token[index] == ' ') || (token[index] == '\t')) {
      } else if (token[index] == '0') {
        *data &= ~(1 << buf_index);
        *mask |= (1 << buf_index);
        buf_index--;
      } else if (token[index] == '1') {
        *data |= (1 << buf_index);
        *mask |= (1 << buf_index);
        buf_index--;
      } else if ((token[index] == '-') || (token[index] == '*')) {
        *data &= ~(1 << buf_index);
        *mask &= ~(1 << buf_index);
        buf_index--;
      } else {
        return 0;
      };
    };
    if (buf_index != -1)
      return 0;
    return 1;
  } while (0);
  ;
}
```