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

```asm
<strntoumax>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x40,%rsp
  mov    %rdi,-0x28(%rbp)
  mov    %rsi,-0x30(%rbp)
  mov    %edx,-0x34(%rbp)
  mov    %rcx,-0x40(%rbp)
  mov    -0x28(%rbp),%rax
  mov    %rax,-0x10(%rbp)
  mov    -0x10(%rbp),%rdx
  mov    -0x40(%rbp),%rax
  add    %rdx,%rax
  mov    %rax,-0x8(%rbp)
  movl   $0x0,-0x1c(%rbp)
  movl   $0x0,-0x18(%rbp)
  jmp    L90
L169:
  addq   $0x1,-0x10(%rbp)
L90:
  mov    -0x10(%rbp),%rax
  cmp    -0x8(%rbp),%rax
  jae    L246
  mov    -0x10(%rbp),%rax
  movzbl (%rax),%eax
  movzbl %al,%eax
  mov    %eax,%edi
  call   <isspace@plt>
  test   %rax,%rax
  jne    L169
L246:
  mov    -0x10(%rbp),%rax
  cmp    -0x8(%rbp),%rax
  jae    L39
  mov    -0x10(%rbp),%rax
  movzbl (%rax),%eax
  mov    %al,-0x1d(%rbp)
  cmpb   $0x2d,-0x1d(%rbp)
  je     L209
  cmpb   $0x2b,-0x1d(%rbp)
  jne    L39
L209:
  cmpb   $0x2d,-0x1d(%rbp)
  sete   %al
  movzbl %al,%eax
  mov    %eax,-0x1c(%rbp)
  addq   $0x1,-0x10(%rbp)
L39:
  cmpl   $0x0,-0x34(%rbp)
  jne    L61
  mov    -0x10(%rbp),%rax
  add    $0x2,%rax
  cmp    %rax,-0x8(%rbp)
  jbe    L91
  mov    -0x10(%rbp),%rax
  movzbl (%rax),%eax
  cmp    $0x30,%al
  jne    L91
  mov    -0x10(%rbp),%rax
  add    $0x1,%rax
  movzbl (%rax),%eax
  cmp    $0x78,%al
  je     L22
  mov    -0x10(%rbp),%rax
  add    $0x1,%rax
  movzbl (%rax),%eax
  cmp    $0x58,%al
  jne    L91
L22:
  addq   $0x2,-0x10(%rbp)
  movl   $0x10,-0x34(%rbp)
  jmp    L111
L91:
  mov    -0x10(%rbp),%rax
  add    $0x1,%rax
  cmp    %rax,-0x8(%rbp)
  jbe    L89
  mov    -0x10(%rbp),%rax
  movzbl (%rax),%eax
  cmp    $0x30,%al
  jne    L89
  addq   $0x1,-0x10(%rbp)
  movl   $0x8,-0x34(%rbp)
  jmp    L111
L89:
  movl   $0xa,-0x34(%rbp)
  jmp    L54
L61:
  cmpl   $0x10,-0x34(%rbp)
  jne    L54
  mov    -0x10(%rbp),%rax
  add    $0x2,%rax
  cmp    %rax,-0x8(%rbp)
  jbe    L54
  mov    -0x10(%rbp),%rax
  movzbl (%rax),%eax
  cmp    $0x30,%al
  jne    L54
  mov    -0x10(%rbp),%rax
  add    $0x1,%rax
  movzbl (%rax),%eax
  cmp    $0x78,%al
  je     L259
  mov    -0x10(%rbp),%rax
  add    $0x1,%rax
  movzbl (%rax),%eax
  cmp    $0x58,%al
  jne    L54
L259:
  addq   $0x2,-0x10(%rbp)
L111:
  jmp    L54
L60:
  mov    -0x18(%rbp),%eax
  imul   -0x34(%rbp),%eax
  mov    %eax,%edx
  mov    -0x14(%rbp),%eax
  add    %edx,%eax
  mov    %eax,-0x18(%rbp)
  addq   $0x1,-0x10(%rbp)
L54:
  mov    -0x10(%rbp),%rax
  cmp    -0x8(%rbp),%rax
  jae    L16
  mov    -0x10(%rbp),%rax
  movzbl (%rax),%eax
  movzbl %al,%eax
  mov    %eax,%edi
  call   <digitval@plt>
  mov    %eax,-0x14(%rbp)
  cmpl   $0x0,-0x14(%rbp)
  js     L16
  mov    -0x14(%rbp),%eax
  cmp    -0x34(%rbp),%eax
  jl     L60
L16:
  cmpq   $0x0,-0x30(%rbp)
  je     L227
  mov    -0x30(%rbp),%rax
  mov    -0x10(%rbp),%rdx
  mov    %rdx,(%rax)
L227:
  cmpl   $0x0,-0x1c(%rbp)
  je     L195
  mov    -0x18(%rbp),%eax
  neg    %eax
  jmp    L107
L195:
  mov    -0x18(%rbp),%eax
L107:
  leave
  ret
```

assistant: ```c
uintmax_t strntoumax(const char *nptr, char **endptr, int base, size_t n) {
  const unsigned char *p = (const unsigned char *)nptr;
  const unsigned char *end = p + n;
  int minus = 0;
  uintmax_t v = 0;
  int d;
  while (p < end && isspace(*p))
    p++;
  if (p < end) {
    char c = p[0];
    if (c == '-' || c == '+') {
      minus = (c == '-');
      p++;
    }
  }
  if (base == 0) {
    if (p + 2 < end && p[0] == '0' && (p[1] == 'x' || p[1] == 'X')) {
      p += 2;
      base = 16;
    } else if (p + 1 < end && p[0] == '0') {
      p += 1;
      base = 8;
    } else {
      base = 10;
    }
  } else if (base == 16) {
    if (p + 2 < end && p[0] == '0' && (p[1] == 'x' || p[1] == 'X')) {
      p += 2;
    }
  }
  while (p < end && (d = digitval(*p)) >= 0 && d < base) {
    v = v * base + d;
    p += 1;
  }
  if (endptr)
    *endptr = (char *)p;
  return minus ? -v : v;
}
```