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

```asm
<strtoxl>:
  endbr64
  push   %r15
  push   %r14
  lea    0x1(%rdi),%r14
  push   %r13
  push   %r12
  push   %rbp
  mov    %edx,%ebp
  push   %rbx
  mov    %ecx,%ebx
  sub    $0x28,%rsp
  movsbl (%rdi),%r15d
  mov    %rdi,0x18(%rsp)
  mov    %rsi,0x10(%rsp)
  jmp    L345
  nopw   0x0(%rax,%rax,1)
L58:
  movsbl (%r14),%r15d
  add    $0x1,%r14
L345:
  movsbl %r15b,%edi
  call   <isspace@plt>
  test   %rax,%rax
  jne    L58
  cmp    $0x2d,%r15b
  je     L452
  cmp    $0x2b,%r15b
  je     L373
L158:
  cmp    $0x1,%ebp
  je     L22
  cmp    $0x24,%ebp
  ja     L22
  test   %ebp,%ebp
  jne    L184
  cmp    $0x30,%r15b
  je     L70
  movq   $0xa,0x8(%rsp)
  mov    $0x19999999,%r13d
  mov    $0xa,%ebp
  jmp    L59
L22:
  mov    0x10(%rsp),%rax
  xor    %r12d,%r12d
  test   %rax,%rax
  je     L9
  mov    0x18(%rsp),%rsi
  mov    %rsi,(%rax)
L9:
  add    $0x28,%rsp
  mov    %r12,%rax
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
  nopw   0x0(%rax,%rax,1)
L373:
  movsbl (%r14),%r15d
  add    $0x1,%r14
  jmp    L158
  nopw   0x0(%rax,%rax,1)
L452:
  movsbl (%r14),%r15d
  or     $0x2,%ebx
  add    $0x1,%r14
  jmp    L158
  nopl   (%rax)
L184:
  cmp    $0x10,%ebp
  je     L95
  movslq %ebp,%rsi
  mov    $0xffffffff,%eax
  xor    %edx,%edx
  div    %rsi
  mov    %rsi,0x8(%rsp)
  mov    %rax,%r13
L59:
  xor    %r12d,%r12d
  jmp    L239
  nopl   0x0(%rax,%rax,1)
L280:
  je     L86
L404:
  or     $0xc,%ebx
L71:
  movsbl (%r14),%r15d
  add    $0x1,%r14
L239:
  mov    %r15d,%edi
  call   <isdigit@plt>
  lea    -0x30(%r15),%ecx
  test   %rax,%rax
  je     L60
  cmp    %ecx,%ebp
  jbe    L229
L343:
  cmp    %r13,%r12
  jae    L280
  imul   0x8(%rsp),%r12
  or     $0x8,%ebx
  add    %rcx,%r12
  jmp    L71
L70:
  movzbl (%r14),%eax
  and    $0xffffffdf,%eax
  cmp    $0x58,%al
  jne    L212
L110:
  movsbl 0x1(%r14),%r15d
  mov    $0xfffffff,%r13d
  add    $0x2,%r14
  movq   $0x10,0x8(%rsp)
  mov    $0x10,%ebp
  jmp    L59
L95:
  cmp    $0x30,%r15b
  je     L123
L409:
  movq   $0x10,0x8(%rsp)
  mov    $0xfffffff,%r13d
  jmp    L59
  nopl   0x0(%rax)
L60:
  mov    %r15d,%edi
  call   <isalpha@plt>
  test   %rax,%rax
  je     L229
  mov    %r15d,%edi
  call   <toupper@plt>
  movsbl %al,%ecx
  sub    $0x37,%ecx
  cmp    %ecx,%ebp
  ja     L343
L229:
  mov    %ebx,%eax
  lea    -0x1(%r14),%rsi
  and    $0x2,%eax
  test   $0x8,%bl
  jne    L283
  xor    %r12d,%r12d
  cmpq   $0x0,0x10(%rsp)
  je     L211
L188:
  mov    0x10(%rsp),%rdx
  mov    0x18(%rsp),%rsi
  mov    %rsi,(%rdx)
L211:
  test   %eax,%eax
  je     L9
L450:
  neg    %r12
  jmp    L9
  nopl   0x0(%rax)
L86:
  mov    $0xffffffff,%eax
  xor    %edx,%edx
  divq   0x8(%rsp)
  cmp    %rdx,%rcx
  ja     L404
  imul   0x8(%rsp),%r12
  or     $0x8,%ebx
  add    %rcx,%r12
  jmp    L71
  xchg   %ax,%ax
L283:
  mov    %ebx,%edx
  and    $0x1,%edx
  and    $0x4,%ebx
  jne    L139
  test   %edx,%edx
  jne    L328
  test   %eax,%eax
  je     L364
  mov    $0xffffffff80000000,%rdx
  cmp    %rdx,%r12
  cmovb  %rdx,%r12
L130:
  cmpq   $0x0,0x10(%rsp)
  mov    %rsi,0x18(%rsp)
  jne    L188
  jmp    L450
  nopl   0x0(%rax,%rax,1)
L139:
  mov    $0xffffffff,%r12d
  test   %edx,%edx
  je     L246
L328:
  cmpq   $0x0,0x10(%rsp)
  je     L211
  mov    %rsi,0x18(%rsp)
  jmp    L188
L246:
  mov    $0x7fffffff,%r12d
  test   %eax,%eax
  jne    L245
L374:
  cmpq   $0x0,0x10(%rsp)
  mov    %rsi,0x18(%rsp)
  jne    L188
  jmp    L9
L212:
  movq   $0x8,0x8(%rsp)
  mov    $0x1fffffff,%r13d
  mov    $0x8,%ebp
  jmp    L59
L364:
  mov    $0x7fffffff,%edx
  cmp    %rdx,%r12
  cmova  %rdx,%r12
  jmp    L374
L245:
  mov    $0xffffffff80000000,%r12
  jmp    L130
L123:
  movzbl (%r14),%eax
  and    $0xffffffdf,%eax
  cmp    $0x58,%al
  jne    L409
  jmp    L110
```

assistant: ```c
unsigned long strtoxl(const char *nptr, char **endptr, int ibase, int flags) {
  const unsigned char *p;
  char c;
  unsigned long number;
  unsigned digval;
  unsigned long maxval;
  p = (const unsigned char *)nptr;
  number = 0;
  c = *p++;
  while (isspace(c))
    c = *p++;
  if (c == '-') {
    flags |= 2;
    c = *p++;
  } else if (c == '+') {
    c = *p++;
  }
  if (ibase < 0 || ibase == 1 || ibase > 36) {
    if (endptr)
      *endptr = (char *)nptr;
    return 0L;
  } else if (ibase == 0) {
    if (c != '0') {
      ibase = 10;
    } else if (*p == 'x' || *p == 'X') {
      ibase = 16;
    } else {
      ibase = 8;
    }
  }
  if (ibase == 16) {
    if (c == '0' && (*p == 'x' || *p == 'X')) {
      ++p;
      c = *p++;
    }
  }
  maxval = (2147483647L * 2UL + 1UL) / ibase;
  for (;;) {
    if (isdigit(c)) {
      digval = c - '0';
    } else if (isalpha(c)) {
      digval = toupper(c) - 'A' + 10;
    } else {
      break;
    }
    if (digval >= (unsigned)ibase)
      break;
    flags |= 8;
    if (number < maxval || (number == maxval && (unsigned long)digval <= (2147483647L * 2UL + 1UL) % ibase)) {
      number = number * ibase + digval;
    } else {
      flags |= 4;
    }
    c = *p++;
  }
  --p;
  if (!(flags & 8)) {
    if (endptr)
      p = (const unsigned char *)nptr;
    number = 0;
  } else if ((flags & 4) || (!(flags & 1) && (((flags & 2) && (number < (-2147483647L - 1L))) || (!(flags & 2) && (number > 2147483647L))))) {
    if (flags & 1) {
      number = (2147483647L * 2UL + 1UL);
    } else if (flags & 2) {
      number = (-2147483647L - 1L);
    } else {
      number = 2147483647L;
    }
  }
  if (endptr)
    *endptr = (char *)p;
  if (flags & 2)
    number = (unsigned long)(-(long)number);
  return number;
}
```