user: 请从给定的汇编指令推导出C源代码:

```asm
<NumberIO_StrToHexInt>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  push   %r13
  mov    %esi,%r13d
  push   %r12
  mov    %rdx,%r12
  push   %rbx
  sub    $0x18,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,-0x28(%rbp)
  xor    %eax,%eax
  lea    0x1(%rsi),%eax
  mov    %rsp,%rcx
  mov    %rax,%rdx
  add    $0xf,%rax
  shr    $0x4,%rax
  shl    $0x4,%rax
  mov    %rax,%rsi
  and    $0xfffffffffffff000,%rsi
  sub    %rsi,%rcx
  cmp    %rcx,%rsp
  je     L19
L71:
  sub    $0x1000,%rsp
  orq    $0x0,0xff8(%rsp)
  cmp    %rcx,%rsp
  jne    L71
L19:
  and    $0xfff,%eax
  sub    %rax,%rsp
  test   %rax,%rax
  jne    L113
L97:
  mov    %rdi,%rsi
  mov    %rsp,%rdi
  mov    %rsp,%rbx
  call   <memcpy@plt>
  mov    %r13d,%ecx
  mov    %rsp,%rdx
  mov    %r13d,%esi
  mov    %rsp,%rdi
  call   <StrLib_StrRemoveWhitePrefix@plt>
  mov    %rsp,%rdi
  mov    %r13d,%esi
  call   <StrLib_StrLen@plt>
  mov    %eax,%edi
  test   %eax,%eax
  je     L60
  mov    %eax,%r8d
  xor    %eax,%eax
  nopl   0x0(%rax,%rax,1)
L103:
  movzbl (%rbx,%rax,1),%edx
  mov    %eax,%ecx
  lea    -0x30(%rdx),%esi
  cmp    $0x9,%sil
  jbe    L158
  sub    $0x41,%edx
  cmp    $0x5,%dl
  jbe    L158
  add    $0x1,%rax
  cmp    %rax,%r8
  jne    L103
L60:
  movl   $0x0,(%r12)
L146:
  mov    -0x28(%rbp),%rax
  sub    %fs:0x28,%rax
  jne    L76
  lea    -0x18(%rbp),%rsp
  pop    %rbx
  pop    %r12
  pop    %r13
  pop    %rbp
  ret
  cs nopw 0x0(%rax,%rax,1)
L158:
  movl   $0x0,(%r12)
  add    %rbx,%rax
  nopl   0x0(%rax,%rax,1)
L105:
  movsbl (%rax),%edx
  lea    -0x30(%rdx),%esi
  cmp    $0x9,%sil
  ja     L145
L23:
  mov    (%r12),%esi
  shl    $0x4,%esi
  lea    -0x30(%rsi,%rdx,1),%edx
  mov    %edx,(%r12)
L112:
  cmp    %edi,%ecx
  jae    L146
  lea    0x1(%rcx),%edx
  add    $0x1,%rax
  mov    %rdx,%rcx
  movzbl (%rbx,%rdx,1),%edx
  lea    -0x30(%rdx),%esi
  cmp    $0x9,%sil
  jbe    L105
  sub    $0x41,%edx
  cmp    $0x5,%dl
  ja     L146
  movsbl (%rax),%edx
  lea    -0x30(%rdx),%esi
  cmp    $0x9,%sil
  jbe    L23
L145:
  lea    -0x41(%rdx),%esi
  cmp    $0x5,%sil
  ja     L112
  mov    (%r12),%esi
  shl    $0x4,%esi
  lea    -0x37(%rsi,%rdx,1),%edx
  mov    %edx,(%r12)
  jmp    L112
  nopl   0x0(%rax)
L113:
  orq    $0x0,-0x8(%rsp,%rax,1)
  jmp    L97
L76:
  call   <__stack_chk_fail@plt>
```

assistant: ```c
void NumberIO_StrToHexInt(char *a_, unsigned int _a_high, int *x) {
  unsigned int i;
  unsigned int ok;
  unsigned int higha;
  char a[_a_high + 1];
  memcpy(a, a_, _a_high + 1);
  StrLib_StrRemoveWhitePrefix((char *)a, _a_high, (char *)a, _a_high);
  higha = StrLib_StrLen((char *)a, _a_high);
  i = 0;
  ok = (1 == 1);
  while (ok) {
    if (i < higha) {
      if (((a[i] >= '0') && (a[i] <= '9')) || ((a[i] >= 'A') && (a[i] <= 'F'))) {
        ok = (1 == 0);
      } else {
        i += 1;
      }
    } else {
      ok = (1 == 0);
    }
  }
  (*x) = 0;
  if (i < higha) {
    ok = (1 == 1);
    do {
      if ((a[i] >= '0') && (a[i] <= '9')) {
        (*x) = (0x010 * (*x)) + ((int)(((unsigned int)(a[i])) - ((unsigned int)('0'))));
      } else if ((a[i] >= 'A') && (a[i] <= 'F')) {
        (*x) = (0x010 * (*x)) + ((int)((((unsigned int)(a[i])) - ((unsigned int)('A'))) + 10));
      }
      if (i < higha) {
        i += 1;
        if (((a[i] < '0') || (a[i] > '9')) && ((a[i] < 'A') || (a[i] > 'F'))) {
          ok = (1 == 0);
        }
      } else {
        ok = (1 == 0);
      }
    } while (!(!ok));
  }
}
```