user: What is the c source code of the assembly code below?

```asm
<AsciiToHex>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  mov    %rdi,-0x18(%rbp)
  mov    %rsi,-0x20(%rbp)
  mov    -0x20(%rbp),%rax
  movl   $0x0,(%rax)
  mov    -0x18(%rbp),%rax
  movzbl (%rax),%eax
  cmp    $0x30,%al
  jne    L101
  mov    -0x18(%rbp),%rax
  add    $0x1,%rax
  movzbl (%rax),%eax
  cmp    $0x78,%al
  je     L142
  mov    -0x18(%rbp),%rax
  add    $0x1,%rax
  movzbl (%rax),%eax
  cmp    $0x58,%al
  jne    L101
L142:
  addq   $0x2,-0x18(%rbp)
L101:
  movl   $0x0,-0x4(%rbp)
  jmp    L98
L48:
  mov    -0x20(%rbp),%rax
  mov    (%rax),%eax
  shl    $0x4,%eax
  mov    %eax,%edx
  mov    -0x20(%rbp),%rax
  mov    %edx,(%rax)
  mov    -0x4(%rbp),%eax
  movslq %eax,%rdx
  mov    -0x18(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%eax
  cmp    $0x2f,%al
  jle    L59
  mov    -0x4(%rbp),%eax
  movslq %eax,%rdx
  mov    -0x18(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%eax
  cmp    $0x39,%al
  jg     L59
  mov    -0x20(%rbp),%rax
  mov    (%rax),%edx
  mov    -0x4(%rbp),%eax
  movslq %eax,%rcx
  mov    -0x18(%rbp),%rax
  add    %rcx,%rax
  movzbl (%rax),%eax
  movsbl %al,%eax
  add    %edx,%eax
  lea    -0x30(%rax),%edx
  mov    -0x20(%rbp),%rax
  mov    %edx,(%rax)
  jmp    L108
L59:
  mov    -0x4(%rbp),%eax
  movslq %eax,%rdx
  mov    -0x18(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%eax
  cmp    $0x60,%al
  jle    L115
  mov    -0x4(%rbp),%eax
  movslq %eax,%rdx
  mov    -0x18(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%eax
  cmp    $0x66,%al
  jg     L115
  mov    -0x20(%rbp),%rax
  mov    (%rax),%edx
  mov    -0x4(%rbp),%eax
  movslq %eax,%rcx
  mov    -0x18(%rbp),%rax
  add    %rcx,%rax
  movzbl (%rax),%eax
  movsbl %al,%eax
  add    %edx,%eax
  lea    -0x57(%rax),%edx
  mov    -0x20(%rbp),%rax
  mov    %edx,(%rax)
  jmp    L108
L115:
  mov    -0x4(%rbp),%eax
  movslq %eax,%rdx
  mov    -0x18(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%eax
  cmp    $0x40,%al
  jle    L149
  mov    -0x4(%rbp),%eax
  movslq %eax,%rdx
  mov    -0x18(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%eax
  cmp    $0x46,%al
  jg     L149
  mov    -0x20(%rbp),%rax
  mov    (%rax),%edx
  mov    -0x4(%rbp),%eax
  movslq %eax,%rcx
  mov    -0x18(%rbp),%rax
  add    %rcx,%rax
  movzbl (%rax),%eax
  movsbl %al,%eax
  add    %edx,%eax
  lea    -0x37(%rax),%edx
  mov    -0x20(%rbp),%rax
  mov    %edx,(%rax)
  jmp    L108
L149:
  mov    $0x0,%eax
  jmp    L70
L108:
  addl   $0x1,-0x4(%rbp)
L98:
  cmpl   $0x7,-0x4(%rbp)
  jg     L47
  mov    -0x4(%rbp),%eax
  movslq %eax,%rdx
  mov    -0x18(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%eax
  test   %al,%al
  jne    L48
L47:
  mov    $0x1,%eax
L70:
  pop    %rbp
  ret
```

assistant: ```c
unsigned int AsciiToHex(char *s, unsigned int *val) {
  int n;
  *val = 0;
  if (s[0] == '0' && ((s[1] == 'x') || (s[1] == 'X')))
    s += 2;
  n = 0;
  while ((n < 8) && (s[n] != 0)) {
    *val <<= 4;
    if ((s[n] >= '0') && (s[n] <= '9'))
      *val += (s[n] - '0');
    else if ((s[n] >= 'a') && (s[n] <= 'f'))
      *val += (s[n] - 0x57);
    else if ((s[n] >= 'A') && (s[n] <= 'F'))
      *val += (s[n] - 0x37);
    else
      return 0;
    n++;
  }
  return 1;
}
```