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

```asm
<AsciiToHex>:
  endbr64
  movl   $0x0,(%rsi)
  cmpb   $0x30,(%rdi)
  mov    %rdi,%rax
  mov    %rsi,%rdx
  je     L216
L289:
  movsbl (%rax),%ecx
  test   %cl,%cl
  je     L205
L46:
  lea    -0x30(%rcx),%esi
  cmp    $0x9,%sil
  jbe    L25
  lea    -0x61(%rcx),%esi
  cmp    $0x5,%sil
  jbe    L271
  lea    -0x41(%rcx),%esi
  cmp    $0x5,%sil
  ja     L243
  sub    $0x37,%ecx
L334:
  mov    %ecx,(%rdx)
  cmpb   $0x0,0x1(%rax)
  je     L205
  shl    $0x4,%ecx
  mov    %ecx,(%rdx)
  movsbl 0x1(%rax),%esi
  lea    -0x30(%rsi),%edi
  cmp    $0x9,%dil
  jbe    L149
  lea    -0x61(%rsi),%edi
  cmp    $0x5,%dil
  jbe    L421
  lea    -0x41(%rsi),%edi
  cmp    $0x5,%dil
  ja     L243
  lea    -0x37(%rcx,%rsi,1),%ecx
L311:
  mov    %ecx,(%rdx)
  cmpb   $0x0,0x2(%rax)
  je     L205
  shl    $0x4,%ecx
  mov    %ecx,(%rdx)
  movsbl 0x2(%rax),%esi
  lea    -0x30(%rsi),%edi
  cmp    $0x9,%dil
  jbe    L476
  lea    -0x61(%rsi),%edi
  cmp    $0x5,%dil
  jbe    L519
  lea    -0x41(%rsi),%edi
  cmp    $0x5,%dil
  ja     L243
  lea    -0x37(%rcx,%rsi,1),%ecx
L504:
  mov    %ecx,(%rdx)
  cmpb   $0x0,0x3(%rax)
  je     L205
  shl    $0x4,%ecx
  mov    %ecx,(%rdx)
  movsbl 0x3(%rax),%esi
  lea    -0x30(%rsi),%edi
  cmp    $0x9,%dil
  jbe    L377
  lea    -0x61(%rsi),%edi
  cmp    $0x5,%dil
  jbe    L338
  lea    -0x41(%rsi),%edi
  cmp    $0x5,%dil
  ja     L243
  lea    -0x37(%rcx,%rsi,1),%ecx
L308:
  mov    %ecx,(%rdx)
  cmpb   $0x0,0x4(%rax)
  je     L205
  shl    $0x4,%ecx
  mov    %ecx,(%rdx)
  movsbl 0x4(%rax),%esi
  lea    -0x30(%rsi),%edi
  cmp    $0x9,%dil
  jbe    L58
  lea    -0x61(%rsi),%edi
  cmp    $0x5,%dil
  jbe    L356
  lea    -0x41(%rsi),%edi
  cmp    $0x5,%dil
  ja     L243
  lea    -0x37(%rcx,%rsi,1),%ecx
  jmp    L194
  nopl   0x0(%rax)
L113:
  lea    -0x30(%rcx,%rsi,1),%ecx
L381:
  mov    %ecx,(%rdx)
  cmpb   $0x0,0x7(%rax)
  je     L205
  shl    $0x4,%ecx
  mov    %ecx,(%rdx)
  movsbl 0x7(%rax),%eax
  lea    -0x30(%rax),%esi
  cmp    $0x9,%sil
  ja     L416
  lea    -0x30(%rcx,%rax,1),%eax
  mov    %eax,(%rdx)
L205:
  mov    $0x1,%eax
  ret
  xchg   %ax,%ax
L25:
  sub    $0x30,%ecx
  jmp    L334
  nopl   0x0(%rax,%rax,1)
L149:
  lea    -0x30(%rcx,%rsi,1),%ecx
  jmp    L311
  nopl   0x0(%rax)
L476:
  lea    -0x30(%rcx,%rsi,1),%ecx
  jmp    L504
  nopl   0x0(%rax)
L377:
  lea    -0x30(%rcx,%rsi,1),%ecx
  jmp    L308
  nopl   0x0(%rax)
L58:
  lea    -0x30(%rcx,%rsi,1),%ecx
L194:
  mov    %ecx,(%rdx)
  cmpb   $0x0,0x5(%rax)
  je     L205
  shl    $0x4,%ecx
  mov    %ecx,(%rdx)
  movsbl 0x5(%rax),%esi
  lea    -0x30(%rsi),%edi
  cmp    $0x9,%dil
  jbe    L124
  lea    -0x61(%rsi),%edi
  cmp    $0x5,%dil
  jbe    L152
  lea    -0x41(%rsi),%edi
  cmp    $0x5,%dil
  ja     L243
  lea    -0x37(%rcx,%rsi,1),%ecx
  jmp    L39
  xchg   %ax,%ax
L124:
  lea    -0x30(%rcx,%rsi,1),%ecx
L39:
  mov    %ecx,(%rdx)
  cmpb   $0x0,0x6(%rax)
  je     L205
  shl    $0x4,%ecx
  mov    %ecx,(%rdx)
  movsbl 0x6(%rax),%esi
  lea    -0x30(%rsi),%edi
  cmp    $0x9,%dil
  jbe    L113
  lea    -0x61(%rsi),%edi
  cmp    $0x5,%dil
  jbe    L64
  lea    -0x41(%rsi),%edi
  cmp    $0x5,%dil
  ja     L243
  lea    -0x37(%rcx,%rsi,1),%ecx
  jmp    L381
  nopl   0x0(%rax)
L416:
  lea    -0x61(%rax),%esi
  cmp    $0x5,%sil
  jbe    L516
  lea    -0x41(%rax),%esi
  cmp    $0x5,%sil
  ja     L243
  lea    -0x37(%rcx,%rax,1),%eax
  mov    %eax,(%rdx)
  jmp    L205
  nopl   (%rax)
L216:
  movzbl 0x1(%rdi),%ecx
  and    $0xffffffdf,%ecx
  cmp    $0x58,%cl
  jne    L432
  add    $0x2,%rax
  jmp    L289
  nopl   0x0(%rax)
L271:
  sub    $0x57,%ecx
  jmp    L334
L421:
  lea    -0x57(%rcx,%rsi,1),%ecx
  jmp    L311
  nopl   0x0(%rax)
L519:
  lea    -0x57(%rcx,%rsi,1),%ecx
  jmp    L504
  nopl   0x0(%rax)
L338:
  lea    -0x57(%rcx,%rsi,1),%ecx
  jmp    L308
  nopl   0x0(%rax)
L356:
  lea    -0x57(%rcx,%rsi,1),%ecx
  jmp    L194
  nopl   0x0(%rax)
L152:
  lea    -0x57(%rcx,%rsi,1),%ecx
  jmp    L39
  nopl   0x0(%rax)
L64:
  lea    -0x57(%rcx,%rsi,1),%ecx
  jmp    L381
  nopl   0x0(%rax)
L516:
  lea    -0x57(%rcx,%rax,1),%eax
  mov    %eax,(%rdx)
  jmp    L205
  nopl   0x0(%rax,%rax,1)
L432:
  mov    $0x30,%ecx
  jmp    L46
L243:
  xor    %eax,%eax
  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;
}
```