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

```asm
<stringToNumber>:
  endbr64
  push   %r15
  push   %r14
  mov    %rdx,%r14
  push   %r13
  push   %r12
  mov    %rsi,%r12
  push   %rbp
  push   %rbx
  mov    %rdi,%rbx
  sub    $0x18,%rsp
  movsbl (%rdi),%edi
  cmp    $0x30,%dil
  je     L8
L36:
  xor    %r13d,%r13d
  jmp    L105
  nopl   (%rax)
L209:
  movsbl (%rbx,%r13,1),%edi
L105:
  call   <isdigit@plt>
  mov    %r13d,%ebp
  add    $0x1,%r13
  test   %rax,%rax
  jne    L209
  movslq %ebp,%r13
  add    %rbx,%r13
L25:
  movzbl (%r14),%eax
  movzbl 0x0(%r13),%edx
  test   %al,%al
  jne    L90
  jmp    L85
  nopl   0x0(%rax,%rax,1)
L52:
  movzbl 0x1(%r14),%eax
  add    $0x1,%r14
  test   %al,%al
  je     L85
L90:
  cmp    %dl,%al
  jne    L52
  cmpb   $0x30,(%rbx)
  lea    0x1(%rbp),%r13d
  jne    L167
L16:
  movsbl 0x1(%rbx),%edi
  call   <tolower@plt>
  cmp    $0x78,%al
  jne    L167
  cmp    $0xa,%ebp
  jg     L183
  cmp    $0x2,%ebp
  jg     L65
L7:
  xor    %ebx,%ebx
L2:
  mov    %ebx,(%r12)
  jmp    L107
  nopl   (%rax)
L85:
  test   %dl,%dl
  jne    L183
  xor    %r13d,%r13d
  cmpb   $0x30,(%rbx)
  je     L16
L167:
  lea    -0x1(%rbp),%eax
  test   %ebp,%ebp
  je     L7
  movslq %ebp,%rbp
  movslq %eax,%r15
  mov    %eax,%eax
  mov    $0x1,%r14d
  lea    -0x2(%rbx,%rbp,1),%rbp
  add    %rbx,%r15
  xor    %ebx,%ebx
  sub    %rax,%rbp
  jmp    L53
L51:
  movsbl (%r15),%eax
  sub    $0x30,%eax
  imul   %r14d,%eax
  add    %eax,%ebx
  jns    L183
  lea    (%r14,%r14,4),%r14d
  sub    $0x1,%r15
  add    %r14d,%r14d
  cmp    %r15,%rbp
  je     L2
L53:
  movsbl (%r15),%edi
  call   <isdigit@plt>
  test   %rax,%rax
  jne    L51
L183:
  mov    $0xffffffff,%r13d
L107:
  add    $0x18,%rsp
  mov    %r13d,%eax
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
  nopl   (%rax)
L8:
  movsbl 0x1(%rbx),%edi
  call   <tolower@plt>
  cmp    $0x78,%al
  je     L123
  movsbl (%rbx),%edi
  jmp    L36
L123:
  mov    %ebx,%eax
  lea    0x2(%rbx),%r15
  neg    %eax
  mov    %eax,0xc(%rsp)
  nopl   0x0(%rax)
L80:
  mov    0xc(%rsp),%eax
  movsbl (%r15),%edi
  mov    %r15,%r13
  lea    (%rax,%r15,1),%ebp
  add    $0x1,%r15
  call   <isxdigit@plt>
  test   %rax,%rax
  jne    L80
  jmp    L25
L65:
  lea    -0x1(%rbp),%eax
  cltq
  movsbl (%rbx,%rax,1),%edi
  call   <hexToDec@plt>
  jmp    L183
```

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;
}
```