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

```asm
<stringToNumber>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x40,%rsp
  mov    %rdi,-0x28(%rbp)
  mov    %rsi,-0x30(%rbp)
  mov    %rdx,-0x38(%rbp)
  mov    -0x28(%rbp),%rax
  movzbl (%rax),%eax
  cmp    $0x30,%al
  jne    L282
  mov    -0x28(%rbp),%rax
  add    $0x1,%rax
  movzbl (%rax),%eax
  movsbl %al,%eax
  mov    %eax,%edi
  call   <tolower@plt>
  cmp    $0x78,%al
  jne    L282
  mov    $0x1,%eax
  jmp    L99
L282:
  mov    $0x0,%eax
L99:
  mov    %eax,-0x8(%rbp)
  movl   $0x0,-0x1c(%rbp)
  movl   $0x0,-0x18(%rbp)
  cmpl   $0x0,-0x8(%rbp)
  je     L210
  movl   $0x2,-0x14(%rbp)
  jmp    L28
L201:
  addl   $0x1,-0x14(%rbp)
L28:
  mov    -0x14(%rbp),%eax
  movslq %eax,%rdx
  mov    -0x28(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%eax
  movsbl %al,%eax
  mov    %eax,%edi
  call   <isxdigit@plt>
  test   %rax,%rax
  jne    L201
  jmp    L32
L210:
  movl   $0x0,-0x14(%rbp)
  jmp    L132
L63:
  addl   $0x1,-0x14(%rbp)
L132:
  mov    -0x14(%rbp),%eax
  movslq %eax,%rdx
  mov    -0x28(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%eax
  movsbl %al,%eax
  mov    %eax,%edi
  call   <isdigit@plt>
  test   %rax,%rax
  jne    L63
  jmp    L32
L281:
  addq   $0x1,-0x38(%rbp)
L32:
  mov    -0x38(%rbp),%rax
  movzbl (%rax),%eax
  test   %al,%al
  je     L9
  mov    -0x38(%rbp),%rax
  movzbl (%rax),%edx
  mov    -0x14(%rbp),%eax
  movslq %eax,%rcx
  mov    -0x28(%rbp),%rax
  add    %rcx,%rax
  movzbl (%rax),%eax
  cmp    %al,%dl
  jne    L281
L9:
  mov    -0x38(%rbp),%rax
  movzbl (%rax),%edx
  mov    -0x14(%rbp),%eax
  movslq %eax,%rcx
  mov    -0x28(%rbp),%rax
  add    %rcx,%rax
  movzbl (%rax),%eax
  cmp    %al,%dl
  je     L59
  mov    $0xffffffff,%eax
  jmp    L36
L59:
  mov    -0x38(%rbp),%rax
  movzbl (%rax),%eax
  test   %al,%al
  je     L130
  mov    -0x14(%rbp),%eax
  add    $0x1,%eax
  mov    %eax,-0x18(%rbp)
L130:
  mov    -0x28(%rbp),%rax
  movzbl (%rax),%eax
  cmp    $0x30,%al
  jne    L110
  mov    -0x28(%rbp),%rax
  add    $0x1,%rax
  movzbl (%rax),%eax
  movsbl %al,%eax
  mov    %eax,%edi
  call   <tolower@plt>
  cmp    $0x78,%al
  jne    L110
  movl   $0x0,-0x10(%rbp)
  cmpl   $0xa,-0x14(%rbp)
  jle    L103
  mov    $0xffffffff,%eax
  jmp    L36
L80:
  mov    -0x14(%rbp),%eax
  movslq %eax,%rdx
  mov    -0x28(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%eax
  movsbl %al,%eax
  mov    %eax,%edi
  call   <hexToDec@plt>
  mov    %eax,-0x4(%rbp)
  cmpl   $0x0,-0x4(%rbp)
  jns    L229
  mov    $0xffffffff,%eax
  jmp    L36
L229:
  mov    -0x10(%rbp),%eax
  mov    -0x4(%rbp),%edx
  mov    %eax,%ecx
  shl    %cl,%edx
  mov    %edx,%eax
  or     %eax,-0x1c(%rbp)
  cmpl   $0x0,-0x1c(%rbp)
  js     L96
  mov    $0xffffffff,%eax
  jmp    L36
L96:
  addl   $0x4,-0x10(%rbp)
L103:
  mov    -0x14(%rbp),%eax
  lea    -0x1(%rax),%edx
  mov    %edx,-0x14(%rbp)
  cmp    $0x2,%eax
  jg     L80
  jmp    L129
L110:
  movl   $0x1,-0xc(%rbp)
  jmp    L16
L145:
  mov    -0x14(%rbp),%eax
  movslq %eax,%rdx
  mov    -0x28(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%eax
  movsbl %al,%eax
  mov    %eax,%edi
  call   <isdigit@plt>
  test   %rax,%rax
  je     L217
  mov    -0x14(%rbp),%eax
  movslq %eax,%rdx
  mov    -0x28(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%eax
  movsbl %al,%eax
  sub    $0x30,%eax
  imul   -0xc(%rbp),%eax
  add    %eax,-0x1c(%rbp)
  cmpl   $0x0,-0x1c(%rbp)
  js     L299
  jmp    L198
L217:
  mov    $0xffffffff,%eax
  jmp    L36
L198:
  mov    $0xffffffff,%eax
  jmp    L36
L299:
  mov    -0xc(%rbp),%edx
  mov    %edx,%eax
  shl    $0x2,%eax
  add    %edx,%eax
  add    %eax,%eax
  mov    %eax,-0xc(%rbp)
L16:
  mov    -0x14(%rbp),%eax
  lea    -0x1(%rax),%edx
  mov    %edx,-0x14(%rbp)
  test   %eax,%eax
  jg     L145
L129:
  mov    -0x1c(%rbp),%edx
  mov    -0x30(%rbp),%rax
  mov    %edx,(%rax)
  mov    -0x18(%rbp),%eax
L36:
  leave
  ret
```

assistant: ```c
int stringToNumber(const char *string, unsigned int *number, const char *delimiter) {
  int isHex = (string[0] == '0' && tolower(string[1]) == 'x');
  uint64_t num = 0;
  int index = 0;
  int i;
  if (isHex)
    for (i = 2; isxdigit(string[i]); i++)
      ;
  else
    for (i = 0; isdigit(string[i]); i++)
      ;
  while (*delimiter != '\0' && *delimiter != string[i])
    ++delimiter;
  if (*delimiter != string[i])
    return -1;
  if (*delimiter != '\0')
    index = i + 1;
  if (string[0] == '0' && tolower(string[1]) == 'x') {
    int shift = 0;
    int dec;
    if (i > 10)
      return -1;
    while (i-- > 2) {
      dec = hexToDec(string[i]);
      if (dec < 0)
        return -1;
      num |= ((uint64_t)dec << shift);
      if (num > (uint64_t)((unsigned int)-1))
        return -1;
      shift += 4;
    }
  } else {
    uint64_t multiplier = 1;
    while (i-- > 0) {
      if (isdigit(string[i]))
        num += ((uint64_t)(string[i] - '0') * multiplier);
      else
        return -1;
      if (num > (uint64_t)((unsigned int)-1))
        return -1;
      multiplier *= 10;
    }
  }
  *number = (unsigned int)num;
  return index;
}
```