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

```asm
<expr_get_curr_symbol>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x40,%rsp
  mov    %rdi,-0x28(%rbp)
  mov    %rsi,-0x30(%rbp)
  mov    %rdx,-0x38(%rbp)
  mov    %rcx,-0x40(%rbp)
  movq   $0x0,-0x8(%rbp)
  movl   $0x0,-0x14(%rbp)
  cmpq   $0x0,-0x28(%rbp)
  je     L51
  mov    -0x28(%rbp),%rax
  movzbl (%rax),%eax
  test   %al,%al
  je     L51
  cmpq   $0x0,-0x30(%rbp)
  je     L51
  cmpq   $0x0,-0x38(%rbp)
  je     L51
  cmpq   $0x0,-0x40(%rbp)
  je     L51
  mov    -0x28(%rbp),%rax
  cmp    -0x30(%rbp),%rax
  jb     L95
L51:
  cmpq   $0x0,-0x40(%rbp)
  je     L203
  mov    -0x40(%rbp),%rax
  movq   $0x0,(%rax)
L203:
  mov    $0x0,%eax
  jmp    L228
L95:
  mov    -0x40(%rbp),%rax
  movq   $0x0,(%rax)
  mov    -0x28(%rbp),%rax
  mov    %rax,-0x10(%rbp)
  jmp    L127
L210:
  addq   $0x1,-0x10(%rbp)
L127:
  mov    -0x10(%rbp),%rax
  cmp    -0x30(%rbp),%rax
  je     L170
  mov    -0x10(%rbp),%rax
  movzbl (%rax),%eax
  cmp    $0x20,%al
  je     L210
  mov    -0x10(%rbp),%rax
  movzbl (%rax),%eax
  cmp    $0xa,%al
  je     L210
  mov    -0x10(%rbp),%rax
  movzbl (%rax),%eax
  cmp    $0xd,%al
  je     L210
  mov    -0x10(%rbp),%rax
  movzbl (%rax),%eax
  cmp    $0x9,%al
  je     L210
L170:
  mov    -0x10(%rbp),%rax
  cmp    -0x30(%rbp),%rax
  jne    L67
  mov    $0x0,%eax
  jmp    L228
L67:
  mov    -0x10(%rbp),%rax
  movzbl (%rax),%eax
  cmp    $0x2d,%al
  jne    L186
  mov    -0x10(%rbp),%rax
  add    $0x1,%rax
  cmp    %rax,-0x30(%rbp)
  je     L186
  mov    -0x10(%rbp),%rax
  add    $0x1,%rax
  movzbl (%rax),%eax
  movsbl %al,%eax
  mov    %eax,%edi
  call   <isdigit@plt>
  test   %rax,%rax
  je     L186
  addq   $0x1,-0x10(%rbp)
  movl   $0x1,-0x14(%rbp)
L186:
  mov    -0x10(%rbp),%rax
  movzbl (%rax),%eax
  movsbl %al,%eax
  mov    %eax,%edi
  call   <isdigit@plt>
  test   %rax,%rax
  je     L212
  mov    -0x10(%rbp),%rax
  lea    0x1(%rax),%rdx
  mov    -0x38(%rbp),%rax
  mov    %rdx,(%rax)
  jmp    L124
L235:
  mov    -0x38(%rbp),%rax
  mov    (%rax),%rax
  lea    0x1(%rax),%rdx
  mov    -0x38(%rbp),%rax
  mov    %rdx,(%rax)
L124:
  mov    -0x38(%rbp),%rax
  mov    (%rax),%rax
  cmp    %rax,-0x30(%rbp)
  je     L96
  mov    -0x38(%rbp),%rax
  mov    (%rax),%rax
  movzbl (%rax),%eax
  movsbl %al,%eax
  mov    %eax,%edi
  call   <isdigit@plt>
  test   %rax,%rax
  jne    L235
L96:
  mov    -0x14(%rbp),%eax
  cltq
  neg    %rax
  add    %rax,-0x10(%rbp)
  jmp    L10
L212:
  mov    -0x10(%rbp),%rax
  lea    0x1(%rax),%rdx
  mov    -0x38(%rbp),%rax
  mov    %rdx,(%rax)
L10:
  mov    -0x38(%rbp),%rax
  mov    (%rax),%rax
  sub    -0x10(%rbp),%rax
  mov    %rax,%rdx
  mov    -0x40(%rbp),%rax
  mov    %rdx,(%rax)
  mov    -0x40(%rbp),%rax
  mov    (%rax),%rax
  add    $0x1,%rax
  mov    %rax,%rdi
  call   <expr_alloc@plt>
  mov    %rax,-0x8(%rbp)
  mov    -0x40(%rbp),%rax
  mov    (%rax),%rax
  lea    0x1(%rax),%rdx
  mov    -0x8(%rbp),%rax
  mov    $0x0,%esi
  mov    %rax,%rdi
  call   <memset@plt>
  mov    -0x40(%rbp),%rax
  mov    (%rax),%rdx
  mov    -0x10(%rbp),%rcx
  mov    -0x8(%rbp),%rax
  mov    %rcx,%rsi
  mov    %rax,%rdi
  call   <memcpy@plt>
  mov    -0x8(%rbp),%rax
L228:
  leave
  ret
```

assistant: ```c
char *expr_get_curr_symbol(const char *buffer, const char *buffer_end, const char **next, size_t *symbol_size) {
  const char *bp, *tbp;
  char *symbol = NULL;
  int neg = 0;
  if (buffer == NULL || *buffer == 0 || buffer_end == NULL || next == NULL || symbol_size == NULL || buffer >= buffer_end) {
    if (symbol_size != NULL) {
      *symbol_size = 0;
    }
    return NULL;
  }
  *symbol_size = 0;
  bp = buffer;
  while (bp != buffer_end && ((*bp) == ' ' || (*bp) == '\n' || (*bp) == '\r' || (*bp) == '\t')) {
    bp++;
  }
  if (bp == buffer_end) {
    return NULL;
  }
  if (*bp == '-' && (bp + 1) != buffer_end && isdigit(*(bp + 1))) {
    bp += 1;
    neg = 1;
  }
  if (isdigit(*bp)) {
    (*next) = bp + 1;
    while ((*next) != buffer_end && isdigit(**next)) {
      (*next)++;
    }
    bp -= neg;
  } else {
    (*next) = bp + 1;
  }
  *symbol_size = (*next) - bp;
  symbol = (char *)expr_alloc(*symbol_size + 1);
  memset(symbol, 0, *symbol_size + 1);
  memcpy(symbol, bp, *symbol_size);
  return symbol;
}
```