user: 请将这段汇编代码片段转换成等效的C代码：

```asm
<strtoll>:
  endbr64
  push   %r15
  mov    %rdi,%r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  mov    %edx,%ebp
  push   %rbx
  sub    $0x38,%rsp
  mov    %rdi,0x28(%rsp)
  mov    %rsi,0x20(%rsp)
  nopl   0x0(%rax)
L14:
  mov    %r15,%rbx
  movzbl (%r15),%r13d
  add    $0x1,%r15
  mov    %r13d,%edi
  call   <isspace@plt>
  mov    %rax,%r12
  test   %rax,%rax
  jne    L14
  mov    %ebp,%eax
  and    $0xffffffef,%eax
  cmp    $0x2d,%r13d
  je     L188
  cmp    $0x2b,%r13d
  je     L79
  test   %eax,%eax
  jne    L30
L0:
  cmp    $0x30,%r13d
  je     L326
L133:
  test   %ebp,%ebp
  jne    L172
  movq   $0xa,0x18(%rsp)
  mov    $0xa,%ebp
L93:
  test   %eax,%eax
  je     L209
L294:
  mov    D22(%rip),%rax
  mov    (%rax),%rax
  cqto
  idivq  0x18(%rsp)
  mov    %rax,0x8(%rsp)
  mov    %edx,%ecx
  test   %rdx,%rdx
  jle    L339
  addq   $0x1,0x8(%rsp)
  sub    %ebp,%ecx
L339:
  neg    %ecx
  mov    $0x1,%r14d
  mov    %ecx,0x14(%rsp)
L245:
  xor    %ebx,%ebx
  jmp    L182
  nopl   0x0(%rax)
L203:
  cmp    0x8(%rsp),%r12
  jl     L106
  jne    L83
  cmp    0x14(%rsp),%ecx
  jle    L83
L106:
  mov    D22(%rip),%rax
L32:
  mov    (%rax),%r12
  mov    D31(%rip),%rax
  mov    $0xffffffff,%ebx
  mov    (%rax),%edx
  mov    D4(%rip),%rax
  mov    %edx,(%rax)
L12:
  movzbl (%r15),%r13d
  add    $0x1,%r15
L182:
  mov    %r13d,%edi
  call   <isdigit@plt>
  lea    -0x30(%r13),%ecx
  test   %rax,%rax
  je     L193
  cmp    %ebp,%ecx
  jge    L278
L302:
  cmp    $0xffffffff,%ebx
  je     L12
  test   %r14d,%r14d
  jne    L203
  cmp    0x8(%rsp),%r12
  jg     L39
  jne    L60
  cmp    0x14(%rsp),%ecx
  jle    L60
L39:
  mov    D13(%rip),%rax
  jmp    L32
  nopl   0x0(%rax,%rax,1)
L30:
  movslq %ebp,%rax
  mov    %rax,0x18(%rsp)
L209:
  mov    D13(%rip),%rax
  xor    %r14d,%r14d
  mov    (%rax),%rax
  cqto
  idivq  0x18(%rsp)
  mov    %edx,0x14(%rsp)
  mov    %rax,0x8(%rsp)
  jmp    L245
  nopw   0x0(%rax,%rax,1)
L79:
  movsbl (%r15),%r13d
  lea    0x2(%rbx),%r15
  test   %eax,%eax
  je     L0
  jmp    L30
  nopw   0x0(%rax,%rax,1)
L193:
  mov    %r13d,%edi
  call   <isalpha@plt>
  test   %rax,%rax
  je     L278
  mov    %r13d,%edi
  call   <isupper@plt>
  mov    %r13d,%ecx
  cmp    $0x1,%rax
  sbb    %eax,%eax
  and    $0x20,%eax
  add    $0x37,%eax
  sub    %eax,%ecx
  cmp    %ebp,%ecx
  jl     L302
L278:
  mov    0x20(%rsp),%rax
  test   %rax,%rax
  je     L186
  lea    -0x1(%r15),%rsi
  test   %ebx,%ebx
  cmove  0x28(%rsp),%rsi
  mov    %rsi,(%rax)
L186:
  add    $0x38,%rsp
  mov    %r12,%rax
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
  nopl   0x0(%rax)
L60:
  imul   0x18(%rsp),%r12
  movslq %ecx,%rcx
  mov    $0x1,%ebx
  add    %rcx,%r12
  jmp    L12
  xchg   %ax,%ax
L83:
  imul   0x18(%rsp),%r12
  movslq %ecx,%rcx
  mov    %r14d,%ebx
  sub    %rcx,%r12
  jmp    L12
  nopl   0x0(%rax)
L188:
  movsbl (%r15),%r13d
  add    $0x2,%rbx
  test   %eax,%eax
  jne    L281
  mov    %rbx,%r15
  mov    $0x1,%eax
  cmp    $0x30,%r13d
  jne    L133
L326:
  movzbl (%r15),%edx
  and    $0xffffffdf,%edx
  cmp    $0x58,%dl
  jne    L334
  movsbl 0x1(%r15),%r13d
  mov    $0x10,%ebp
  add    $0x2,%r15
  movq   $0x10,0x18(%rsp)
  jmp    L93
L334:
  test   %ebp,%ebp
  jne    L172
  movq   $0x8,0x18(%rsp)
  mov    $0x8,%ebp
  jmp    L93
L172:
  movslq %ebp,%rsi
  mov    %rsi,0x18(%rsp)
  jmp    L93
L281:
  movslq %ebp,%rax
  mov    %rbx,%r15
  mov    %rax,0x18(%rsp)
  jmp    L294
```

assistant: ```c
long long strtoll(const char *nptr, char **endptr, int base) {
  const char *s;
  long long acc, cutoff;
  int c;
  int neg, any, cutlim;
  s = nptr;
  do {
    c = (unsigned char)*s++;
  } while (isspace(c));
  if (c == '-') {
    neg = 1;
    c = *s++;
  } else {
    neg = 0;
    if (c == '+')
      c = *s++;
  }
  if ((base == 0 || base == 16) && c == '0' && (*s == 'x' || *s == 'X')) {
    c = s[1];
    s += 2;
    base = 16;
  }
  if (base == 0)
    base = c == '0' ? 8 : 10;
  cutoff = neg ? LLONG_MIN : LLONG_MAX;
  cutlim = cutoff % base;
  cutoff /= base;
  if (neg) {
    if (cutlim > 0) {
      cutlim -= base;
      cutoff += 1;
    }
    cutlim = -cutlim;
  }
  for (acc = 0, any = 0;; c = (unsigned char)*s++) {
    if (isdigit(c))
      c -= '0';
    else if (isalpha(c))
      c -= isupper(c) ? 'A' - 10 : 'a' - 10;
    else
      break;
    if (c >= base)
      break;
    if (any < 0)
      continue;
    if (neg) {
      if (acc < cutoff || (acc == cutoff && c > cutlim)) {
        any = -1;
        acc = LLONG_MIN;
        errno = ERANGE;
      } else {
        any = 1;
        acc *= base;
        acc -= c;
      }
    } else {
      if (acc > cutoff || (acc == cutoff && c > cutlim)) {
        any = -1;
        acc = LLONG_MAX;
        errno = ERANGE;
      } else {
        any = 1;
        acc *= base;
        acc += c;
      }
    }
  }
  if (endptr != 0)
    *endptr = (char *)(any ? s - 1 : nptr);
  return (acc);
}
```