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

```asm
<strtoul>:
  endbr64
  push   %r14
  push   %r13
  mov    %rdi,%r13
  push   %r12
  mov    %rdi,%r12
  push   %rbp
  mov    %rsi,%rbp
  push   %rbx
  mov    %edx,%ebx
  jmp    L230
  nopl   0x0(%rax)
L82:
  add    $0x1,%r13
L230:
  movsbl 0x0(%r13),%edi
  call   <isspace@plt>
  test   %rax,%rax
  jne    L82
  movzbl 0x0(%r13),%eax
  cmp    $0x2d,%al
  je     L103
  xor    %r14d,%r14d
  cmp    $0x2b,%al
  sete   %al
  movzbl %al,%eax
  add    %rax,%r13
L269:
  cmp    $0x10,%ebx
  je     L178
  test   %ebx,%ebx
  jne    L155
  movzbl 0x0(%r13),%edx
  mov    $0xa,%ebx
  cmp    $0x30,%dl
  je     L149
L211:
  xor    %esi,%esi
  test   %dl,%dl
  je     L229
L107:
  mov    %r13,%rcx
L176:
  mov    D2(%rip),%rax
  xor    %esi,%esi
  movslq %ebx,%rdi
  mov    $0x1,%r9d
  mov    (%rax),%r8d
  xor    %eax,%eax
  sar    $0x8,%r8d
  movslq %r8d,%r8
  jmp    L171
  nop
L256:
  mov    $0xff,%edx
  mov    $0xffffffff,%r10d
  cmp    %ebx,%edx
  jge    L48
L122:
  movzbl %al,%edx
  movzbl %r10b,%r10d
  shr    $0x8,%rax
  imul   %rdi,%rdx
  imul   %rdi,%rax
  add    %r10,%rdx
  mov    %rdx,%r10
  movzbl %dl,%edx
  shr    $0x8,%r10
  add    %r10,%rax
  cmp    %rax,%r8
  cmovb  %r9d,%esi
  shl    $0x8,%rax
  add    $0x1,%rcx
  add    %rdx,%rax
  movzbl (%rcx),%edx
  test   %dl,%dl
  je     L48
L171:
  cmp    $0x40,%dl
  ja     L146
  cmp    $0x39,%dl
  ja     L256
L146:
  lea    -0x30(%rdx),%r10d
  movzbl %r10b,%edx
  cmp    %ebx,%edx
  jl     L122
L48:
  cmp    %rcx,%r13
  je     L229
L105:
  test   %rbp,%rbp
  je     L204
  mov    %rcx,0x0(%rbp)
L204:
  test   %esi,%esi
  jne    L142
  mov    %rax,%rdx
  pop    %rbx
  pop    %rbp
  neg    %rdx
  test   %r14d,%r14d
  pop    %r12
  pop    %r13
  cmovne %rdx,%rax
  pop    %r14
  ret
  nopl   0x0(%rax)
L178:
  movzbl 0x0(%r13),%edx
  cmp    $0x30,%dl
  jne    L211
L260:
  movzbl 0x1(%r13),%eax
  mov    $0x30,%edx
  and    $0xffffffdf,%eax
  cmp    $0x58,%al
  jne    L107
  movsbl 0x2(%r13),%edi
  call   <isxdigit@plt>
  test   %rax,%rax
  je     L114
  movzbl 0x2(%r13),%edx
  lea    0x2(%r13),%rcx
  test   %dl,%dl
  je     L43
  mov    $0x10,%ebx
  jmp    L176
  nopl   0x0(%rax)
L103:
  add    $0x1,%r13
  mov    $0x1,%r14d
  jmp    L269
  nop
L142:
  mov    D67(%rip),%rax
  mov    (%rax),%edx
  mov    D22(%rip),%rax
  mov    %edx,(%rax)
  mov    D2(%rip),%rax
  pop    %rbx
  pop    %rbp
  movslq (%rax),%rax
  pop    %r12
  pop    %r13
  pop    %r14
  ret
  nopl   (%rax)
L229:
  mov    D41(%rip),%rax
  mov    %r12,%rcx
  mov    (%rax),%edx
  mov    D22(%rip),%rax
  mov    %edx,(%rax)
  xor    %eax,%eax
  jmp    L105
  nopl   0x0(%rax)
L155:
  lea    -0x2(%rbx),%eax
  cmp    $0x22,%eax
  jbe    L114
  mov    D41(%rip),%rax
  mov    (%rax),%edx
  mov    D22(%rip),%rax
  mov    %edx,(%rax)
  xor    %eax,%eax
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  ret
L114:
  movzbl 0x0(%r13),%edx
  jmp    L211
  nopw   0x0(%rax,%rax,1)
L149:
  mov    $0x8,%ebx
  jmp    L260
L43:
  xor    %eax,%eax
  xor    %esi,%esi
  jmp    L48
```

assistant: ```c
unsigned long int strtoul(const char *ptr, char **endptr, int base) {
  int neg = 0, overflow = 0;
  unsigned long int v = 0;
  const char *orig;
  const char *nptr = ptr;
  while (isspace(*nptr))
    ++nptr;
  if (*nptr == '-') {
    neg = 1;
    nptr++;
  } else if (*nptr == '+')
    ++nptr;
  orig = nptr;
  if (base == 16 && nptr[0] == '0')
    goto skip0x;
  if (base) {
    register unsigned int b = base - 2;
    if (b > 34) {
      errno = EINVAL;
      return 0;
    }
  } else {
    if (*nptr == '0') {
      base = 8;
    skip0x:
      if ((nptr[1] == 'x' || nptr[1] == 'X') && isxdigit(nptr[2])) {
        nptr += 2;
        base = 16;
      }
    } else
      base = 10;
  }
  while (*nptr) {
    register unsigned char c = *nptr;
    c = (((c >= 'a' ? (c - 'a' + 10) : (c >= 'A')) ? (c - 'A' + 10) : (c <= '9')) ? (c - '0') : 0xff);
    if (c >= base)
      break;
    {
      register unsigned long x = (v & 0xff) * base + c;
      register unsigned long w = (v >> 8) * base + (x >> 8);
      if (w > (ULONG_MAX >> 8))
        overflow = 1;
      v = (w << 8) + (x & 0xff);
    }
    ++nptr;
  }
  if (nptr == orig) {
    nptr = ptr;
    errno = EINVAL;
    v = 0;
  }
  if (endptr)
    *endptr = (char *)nptr;
  if (overflow) {
    errno = ERANGE;
    return ULONG_MAX;
  }
  return (neg ? -v : v);
}
```