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

```asm
<toml_rtoi>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0xb0,%rsp
  mov    %rdi,-0xa8(%rbp)
  mov    %rsi,-0xb0(%rbp)
  mov    %fs:0x28,%rax
  mov    %rax,-0x8(%rbp)
  xor    %eax,%eax
  cmpq   $0x0,-0xa8(%rbp)
  jne    L81
  mov    $0xffffffff,%eax
  jmp    L197
L81:
  lea    -0x70(%rbp),%rax
  mov    %rax,-0x90(%rbp)
  mov    -0x90(%rbp),%rax
  add    $0x64,%rax
  mov    %rax,-0x80(%rbp)
  mov    -0xa8(%rbp),%rax
  mov    %rax,-0x88(%rbp)
  cmpq   $0x0,-0xb0(%rbp)
  jne    L104
  lea    -0xa0(%rbp),%rax
  jmp    L162
L104:
  mov    -0xb0(%rbp),%rax
L162:
  mov    %rax,-0x78(%rbp)
  mov    -0x88(%rbp),%rax
  movzbl (%rax),%eax
  cmp    $0x2b,%al
  jne    L209
  mov    -0x88(%rbp),%rdx
  lea    0x1(%rdx),%rax
  mov    %rax,-0x88(%rbp)
  mov    -0x90(%rbp),%rax
  lea    0x1(%rax),%rcx
  mov    %rcx,-0x90(%rbp)
  movzbl (%rdx),%edx
  mov    %dl,(%rax)
  jmp    L49
L209:
  mov    -0x88(%rbp),%rax
  movzbl (%rax),%eax
  cmp    $0x2d,%al
  jne    L49
  mov    -0x88(%rbp),%rdx
  lea    0x1(%rdx),%rax
  mov    %rax,-0x88(%rbp)
  mov    -0x90(%rbp),%rax
  lea    0x1(%rax),%rcx
  mov    %rcx,-0x90(%rbp)
  movzbl (%rdx),%edx
  mov    %dl,(%rax)
L49:
  mov    -0x88(%rbp),%rax
  movzbl (%rax),%eax
  cmp    $0x30,%al
  jne    L193
  mov    -0x88(%rbp),%rax
  add    $0x1,%rax
  movzbl (%rax),%eax
  test   %al,%al
  je     L80
  mov    $0xffffffff,%eax
  jmp    L197
L80:
  mov    -0x78(%rbp),%rax
  movl   $0x0,(%rax)
  mov    $0x0,%eax
  jmp    L197
L100:
  mov    -0x88(%rbp),%rax
  lea    0x1(%rax),%rdx
  mov    %rdx,-0x88(%rbp)
  movzbl (%rax),%eax
  movsbl %al,%eax
  mov    %eax,-0x9c(%rbp)
  cmpl   $0x5f,-0x9c(%rbp)
  je     L193
  mov    -0x90(%rbp),%rax
  lea    0x1(%rax),%rdx
  mov    %rdx,-0x90(%rbp)
  mov    -0x9c(%rbp),%edx
  mov    %dl,(%rax)
L193:
  mov    -0x88(%rbp),%rax
  movzbl (%rax),%eax
  test   %al,%al
  je     L27
  mov    -0x90(%rbp),%rax
  cmp    -0x80(%rbp),%rax
  jb     L100
L27:
  mov    -0x88(%rbp),%rax
  movzbl (%rax),%eax
  test   %al,%al
  jne    L42
  mov    -0x90(%rbp),%rax
  cmp    -0x80(%rbp),%rax
  jne    L153
L42:
  mov    $0xffffffff,%eax
  jmp    L197
L153:
  mov    -0x90(%rbp),%rax
  movb   $0x0,(%rax)
  mov    D0(%rip),%rax
  movq   $0x0,(%rax)
  lea    -0x98(%rbp),%rcx
  lea    -0x70(%rbp),%rax
  mov    $0x0,%edx
  mov    %rcx,%rsi
  mov    %rax,%rdi
  call   <strtoll@plt>
  mov    -0x78(%rbp),%rdx
  mov    %eax,(%rdx)
  mov    D0(%rip),%rax
  mov    (%rax),%rax
  test   %rax,%rax
  jne    L84
  mov    -0x98(%rbp),%rax
  movzbl (%rax),%eax
  test   %al,%al
  je     L45
L84:
  mov    $0xffffffff,%eax
  jmp    L197
L45:
  mov    $0x0,%eax
L197:
  mov    -0x8(%rbp),%rdx
  sub    %fs:0x28,%rdx
  je     L66
  call   <__stack_chk_fail@plt>
L66:
  leave
  ret
```

assistant: ```c
int toml_rtoi(const char *src, int64_t *ret_) {
  if (!src)
    return -1;
  char buf[100];
  char *p = buf;
  char *q = p + sizeof(buf);
  const char *s = src;
  int64_t dummy;
  int64_t *ret = ret_ ? ret_ : &dummy;
  if (*s == '+')
    *p++ = *s++;
  else if (*s == '-')
    *p++ = *s++;
  if ('0' == s[0]) {
    if (s[1])
      return -1;
    return *ret = 0, 0;
  }
  while (*s && p < q) {
    int ch = *s++;
    if (ch == '_')
      ;
    else
      *p++ = ch;
  }
  if (*s || p == q)
    return -1;
  *p = 0;
  char *endp;
  errno = 0;
  *ret = strtoll(buf, &endp, 0);
  return (errno || *endp) ? -1 : 0;
}
```