user: Please show me the C implementation that matches the assembly code listed below:

```asm
<NumberIO_StrToHexInt>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  push   %r13
  push   %r12
  push   %rbx
  sub    $0x18,%rsp
  mov    %rdi,%rcx
  mov    %esi,%r13d
  mov    %rdx,%r12
  mov    %fs:0x28,%rax
  mov    %rax,-0x28(%rbp)
  xor    %eax,%eax
  lea    0x1(%rsi),%edx
  mov    %edx,%eax
  add    $0xf,%rax
  shr    $0x4,%rax
  shl    $0x4,%rax
  mov    %rax,%rdi
  and    $0xfffffffffffff000,%rdi
  mov    %rsp,%rsi
  sub    %rdi,%rsi
L155:
  cmp    %rsi,%rsp
  je     L86
  sub    $0x1000,%rsp
  orq    $0x0,0xff8(%rsp)
  jmp    L155
L86:
  mov    %rax,%rsi
  and    $0xfff,%esi
  sub    %rsi,%rsp
  test   %rsi,%rsi
  je     L61
  orq    $0x0,-0x8(%rsp,%rsi,1)
L61:
  mov    %rsp,%rbx
  mov    %rcx,%rsi
  mov    %rsp,%rdi
  call   <memcpy@plt>
  mov    %r13d,%ecx
  mov    %rsp,%rdx
  mov    %r13d,%esi
  mov    %rsp,%rdi
  call   <StrLib_StrRemoveWhitePrefix@plt>
  mov    %r13d,%esi
  mov    %rsp,%rdi
  call   <StrLib_StrLen@plt>
  mov    %eax,%esi
  test   %eax,%eax
  je     L4
  mov    %eax,%r8d
  mov    $0x0,%eax
L118:
  mov    %eax,%ecx
  movzbl (%rbx,%rax,1),%edx
  lea    -0x30(%rdx),%edi
  cmp    $0x9,%dil
  jbe    L22
  sub    $0x41,%edx
  cmp    $0x5,%dl
  jbe    L22
  add    $0x1,%rax
  cmp    %r8,%rax
  jne    L118
L4:
  movl   $0x0,(%r12)
L9:
  mov    -0x28(%rbp),%rax
  sub    %fs:0x28,%rax
  jne    L53
  lea    -0x18(%rbp),%rsp
  pop    %rbx
  pop    %r12
  pop    %r13
  pop    %rbp
  ret
L22:
  movl   $0x0,(%r12)
  cmp    %ecx,%esi
  jbe    L9
  mov    %eax,%eax
  add    %rbx,%rax
L147:
  movzbl (%rax),%edx
  lea    -0x30(%rdx),%edi
  cmp    $0x9,%dil
  ja     L84
  mov    (%r12),%edi
  shl    $0x4,%edi
  movsbl %dl,%edx
  lea    -0x30(%rdi,%rdx,1),%edx
  mov    %edx,(%r12)
L90:
  cmp    %esi,%ecx
  je     L9
  add    $0x1,%ecx
  mov    %ecx,%edx
  movzbl (%rbx,%rdx,1),%edx
  add    $0x1,%rax
  lea    -0x30(%rdx),%edi
  cmp    $0x9,%dil
  jbe    L147
  sub    $0x41,%edx
  cmp    $0x5,%dl
  jbe    L147
  jmp    L9
L84:
  lea    -0x41(%rdx),%edi
  cmp    $0x5,%dil
  ja     L90
  mov    (%r12),%edi
  shl    $0x4,%edi
  movsbl %dl,%edx
  lea    -0x37(%rdi,%rdx,1),%edx
  mov    %edx,(%r12)
  jmp    L90
L53:
  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));
  }
}
```