user: Translate the below assembly code into C programming language:

```asm
<strtoumax>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x30,%rsp
  mov    %rdi,-0x18(%rbp)
  mov    %rsi,-0x20(%rbp)
  mov    %edx,-0x24(%rbp)
  cmpl   $0x1,-0x24(%rbp)
  jle    L284
  cmpl   $0x24,-0x24(%rbp)
  jle    L19
L284:
  cmpl   $0x0,-0x24(%rbp)
  je     L19
  cmpq   $0x0,-0x20(%rbp)
  je     L57
  mov    -0x20(%rbp),%rax
  mov    -0x18(%rbp),%rdx
  mov    %rdx,(%rax)
L57:
  mov    D5(%rip),%rax
  mov    (%rax),%edx
  mov    D40(%rip),%rax
  mov    %edx,(%rax)
  mov    $0x0,%eax
  jmp    L145
L299:
  addq   $0x1,-0x18(%rbp)
L19:
  mov    -0x18(%rbp),%rax
  movzbl (%rax),%eax
  movsbl %al,%eax
  mov    %eax,%edi
  call   <isspace@plt>
  test   %rax,%rax
  jne    L299
  movb   $0x0,-0x4(%rbp)
  cmpl   $0x0,-0x24(%rbp)
  jne    L224
  mov    -0x18(%rbp),%rax
  movzbl (%rax),%eax
  cmp    $0x30,%al
  jne    L63
  addq   $0x1,-0x18(%rbp)
  movl   $0x8,-0x24(%rbp)
  mov    -0x18(%rbp),%rax
  movzbl (%rax),%eax
  cmp    $0x78,%al
  jne    L224
  addq   $0x1,-0x18(%rbp)
  movl   $0x10,-0x24(%rbp)
  jmp    L224
L63:
  movl   $0xa,-0x24(%rbp)
L224:
  mov    -0x24(%rbp),%eax
  mov    %al,-0x2(%rbp)
  jmp    L152
L264:
  mov    -0x18(%rbp),%rax
  lea    0x1(%rax),%rdx
  mov    %rdx,-0x18(%rbp)
  movzbl (%rax),%eax
  mov    %al,-0x1(%rbp)
  cmpb   $0x2f,-0x1(%rbp)
  jle    L301
  cmpb   $0x39,-0x1(%rbp)
  jle    L141
L301:
  cmpb   $0x60,-0x1(%rbp)
  jle    L167
  cmpb   $0x7a,-0x1(%rbp)
  jle    L141
L167:
  cmpb   $0x40,-0x1(%rbp)
  jle    L52
  cmpb   $0x5a,-0x1(%rbp)
  jle    L141
L52:
  subq   $0x1,-0x18(%rbp)
  jmp    L199
L141:
  movb   $0x0,-0x3(%rbp)
  cmpb   $0x2f,-0x1(%rbp)
  jle    L0
  cmpb   $0x39,-0x1(%rbp)
  jg     L0
  movzbl -0x1(%rbp),%eax
  sub    $0x30,%eax
  mov    %al,-0x3(%rbp)
  jmp    L222
L0:
  cmpb   $0x60,-0x1(%rbp)
  jle    L23
  cmpb   $0x7a,-0x1(%rbp)
  jg     L23
  movzbl -0x1(%rbp),%eax
  sub    $0x57,%eax
  mov    %al,-0x3(%rbp)
  jmp    L222
L23:
  movzbl -0x1(%rbp),%eax
  sub    $0x37,%eax
  mov    %al,-0x3(%rbp)
L222:
  movzbl -0x3(%rbp),%eax
  cmp    -0x2(%rbp),%al
  jl     L39
  subq   $0x1,-0x18(%rbp)
  jmp    L199
L39:
  movsbl -0x4(%rbp),%ecx
  mov    D26(%rip),%rax
  movzbl (%rax),%eax
  movsbl %al,%eax
  movsbl -0x3(%rbp),%edx
  sub    %edx,%eax
  movsbl -0x2(%rbp),%esi
  cltd
  idiv   %esi
  cmp    %eax,%ecx
  jle    L58
  subq   $0x1,-0x18(%rbp)
  mov    D20(%rip),%rax
  mov    (%rax),%edx
  mov    D40(%rip),%rax
  mov    %edx,(%rax)
  cmpq   $0x0,-0x20(%rbp)
  je     L283
  mov    -0x20(%rbp),%rax
  mov    -0x18(%rbp),%rdx
  mov    %rdx,(%rax)
L283:
  mov    D57(%rip),%rax
  movzbl (%rax),%eax
  jmp    L145
L58:
  movzbl -0x4(%rbp),%eax
  movzbl -0x2(%rbp),%edx
  imul   %edx,%eax
  mov    %eax,%edx
  movzbl -0x3(%rbp),%eax
  add    %edx,%eax
  mov    %al,-0x4(%rbp)
L152:
  mov    -0x18(%rbp),%rax
  movzbl (%rax),%eax
  test   %al,%al
  jne    L264
  nop
L199:
  cmpq   $0x0,-0x20(%rbp)
  je     L164
  mov    -0x20(%rbp),%rax
  mov    -0x18(%rbp),%rdx
  mov    %rdx,(%rax)
L164:
  movzbl -0x4(%rbp),%eax
L145:
  leave
  ret
```

assistant: ```c
uintmax_t strtoumax(const char *str, char **str_end, int base) {
  if (((base < 2) || (base > 36)) && (base != 0)) {
    if (str_end != NULL)
      *str_end = (char *)str;
    errno = EINVAL;
    return 0;
  };
  while (isspace(*str))
    str++;
  uintmax_t out = 0;
  if (base == 0) {
    if (*str == '0') {
      str++;
      base = 8;
      if (*str == 'x') {
        str++;
        base = 16;
      };
    } else {
      base = 10;
    };
  };
  uintmax_t llbase = (uintmax_t)base;
  while (*str != 0) {
    char c = *str++;
    if (((c < '0') || (c > '9')) && ((c < 'a') || (c > 'z')) && ((c < 'A') || (c > 'Z'))) {
      str--;
      goto finished;
    };
    uintmax_t digit = 0;
    if ((c >= '0') && (c <= '9')) {
      digit = c - '0';
    } else if ((c >= 'a') && (c <= 'z')) {
      digit = 10 + c - 'a';
    } else {
      digit = 10 + c - 'A';
    };
    if (digit >= llbase) {
      str--;
      goto finished;
    };
    if (out > ((UINTMAX_MAX - digit) / llbase)) {
      str--;
      errno = ERANGE;
      if (str_end != NULL)
        *str_end = (char *)str;
      return ULONG_MAX;
    };
    out = out * llbase + digit;
  };
finished:
  if (str_end != NULL)
    *str_end = (char *)str;
  return out;
}
```