user: 这段汇编代码用C语言表示是什么样的：

```asm
<atohex>:
  endbr64
  movzbl (%rdi),%edx
  mov    %rdi,%rcx
  cmp    $0x20,%dl
  jg     L388
  mov    $0x1,%eax
  nopl   0x0(%rax,%rax,1)
L306:
  mov    %eax,%esi
  add    $0x1,%rax
  movzbl -0x1(%rcx,%rax,1),%edx
  cmp    $0x20,%dl
  jle    L306
  lea    -0x30(%rdx),%eax
  cmp    $0x9,%al
  jbe    L15
L1:
  lea    -0x61(%rdx),%eax
  cmp    $0x5,%al
  jbe    L379
  lea    -0x41(%rdx),%eax
  cmp    $0x5,%al
  ja     L422
  sub    $0x37,%edx
  movsbl %dl,%eax
L77:
  lea    0x1(%rsi),%edx
  movslq %edx,%rdx
  movzbl (%rcx,%rdx,1),%edx
  cmp    $0x20,%dl
  jle    L362
  lea    -0x30(%rdx),%edi
  shl    $0x4,%eax
  cmp    $0x9,%dil
  jbe    L304
  lea    -0x61(%rdx),%edi
  cmp    $0x5,%dil
  jbe    L105
  lea    -0x41(%rdx),%edi
  cmp    $0x5,%dil
  ja     L422
  sub    $0x37,%edx
  movsbl %dl,%edx
  add    %edx,%eax
L435:
  lea    0x2(%rsi),%edx
  movslq %edx,%rdx
  movzbl (%rcx,%rdx,1),%edx
  cmp    $0x20,%dl
  jle    L362
  lea    -0x30(%rdx),%edi
  shl    $0x4,%eax
  cmp    $0x9,%dil
  jbe    L275
  lea    -0x61(%rdx),%edi
  cmp    $0x5,%dil
  jbe    L410
  lea    -0x41(%rdx),%edi
  cmp    $0x5,%dil
  ja     L422
  sub    $0x37,%edx
  movsbl %dl,%edx
  add    %edx,%eax
L39:
  lea    0x3(%rsi),%edx
  movslq %edx,%rdx
  movzbl (%rcx,%rdx,1),%edx
  cmp    $0x20,%dl
  jle    L362
  lea    -0x30(%rdx),%edi
  shl    $0x4,%eax
  cmp    $0x9,%dil
  jbe    L340
  lea    -0x61(%rdx),%edi
  cmp    $0x5,%dil
  jbe    L198
  lea    -0x41(%rdx),%edi
  cmp    $0x5,%dil
  ja     L422
  sub    $0x37,%edx
  movsbl %dl,%edx
  add    %edx,%eax
L368:
  lea    0x4(%rsi),%edx
  movslq %edx,%rdx
  movzbl (%rcx,%rdx,1),%edx
  cmp    $0x20,%dl
  jle    L362
  lea    -0x30(%rdx),%edi
  shl    $0x4,%eax
  cmp    $0x9,%dil
  jbe    L250
  lea    -0x61(%rdx),%edi
  cmp    $0x5,%dil
  jbe    L269
  lea    -0x41(%rdx),%edi
  cmp    $0x5,%dil
  ja     L422
  sub    $0x37,%edx
  movsbl %dl,%edx
  add    %edx,%eax
  jmp    L300
  nopl   (%rax)
L15:
  movsbl %al,%eax
  jmp    L77
L362:
  ret
  nopl   0x0(%rax)
L304:
  movsbl %dil,%edi
  add    %edi,%eax
  jmp    L435
  nopl   0x0(%rax,%rax,1)
L275:
  movsbl %dil,%edi
  add    %edi,%eax
  jmp    L39
  nopl   0x0(%rax,%rax,1)
L340:
  movsbl %dil,%edi
  add    %edi,%eax
  jmp    L368
  nopl   0x0(%rax,%rax,1)
L250:
  movsbl %dil,%edi
  add    %edi,%eax
L300:
  lea    0x5(%rsi),%edx
  movslq %edx,%rdx
  movzbl (%rcx,%rdx,1),%edx
  cmp    $0x20,%dl
  jle    L362
  lea    -0x30(%rdx),%edi
  shl    $0x4,%eax
  cmp    $0x9,%dil
  jbe    L254
  lea    -0x61(%rdx),%edi
  cmp    $0x5,%dil
  jbe    L327
  lea    -0x41(%rdx),%edi
  cmp    $0x5,%dil
  ja     L422
  sub    $0x37,%edx
  movsbl %dl,%edx
  add    %edx,%eax
  jmp    L279
  nopl   (%rax)
L254:
  movsbl %dil,%edi
  add    %edi,%eax
L279:
  lea    0x6(%rsi),%edx
  movslq %edx,%rdx
  movzbl (%rcx,%rdx,1),%edx
  cmp    $0x20,%dl
  jle    L362
  lea    -0x30(%rdx),%edi
  shl    $0x4,%eax
  cmp    $0x9,%dil
  jbe    L462
  lea    -0x61(%rdx),%edi
  cmp    $0x5,%dil
  jbe    L202
  lea    -0x41(%rdx),%edi
  cmp    $0x5,%dil
  ja     L422
  sub    $0x37,%edx
  movsbl %dl,%edx
  add    %edx,%eax
  jmp    L372
  nopl   0x0(%rax)
L462:
  movsbl %dil,%edi
  add    %edi,%eax
L372:
  add    $0x7,%esi
  movslq %esi,%rsi
  movzbl (%rcx,%rsi,1),%edx
  cmp    $0x20,%dl
  jle    L362
  lea    -0x30(%rdx),%ecx
  shl    $0x4,%eax
  cmp    $0x9,%cl
  ja     L60
  movsbl %cl,%ecx
  add    %ecx,%eax
  ret
  nopw   0x0(%rax,%rax,1)
L60:
  lea    -0x61(%rdx),%ecx
  cmp    $0x5,%cl
  jbe    L489
  lea    -0x41(%rdx),%ecx
  cmp    $0x5,%cl
  ja     L422
  sub    $0x37,%edx
  movsbl %dl,%edx
  add    %edx,%eax
  ret
  nopl   0x0(%rax)
L379:
  sub    $0x57,%edx
  movsbl %dl,%eax
  jmp    L77
  nopl   0x0(%rax,%rax,1)
L105:
  sub    $0x57,%edx
  movsbl %dl,%edx
  add    %edx,%eax
  jmp    L435
  nopl   (%rax)
L410:
  sub    $0x57,%edx
  movsbl %dl,%edx
  add    %edx,%eax
  jmp    L39
  nopl   (%rax)
L198:
  sub    $0x57,%edx
  movsbl %dl,%edx
  add    %edx,%eax
  jmp    L368
  nopl   (%rax)
L269:
  sub    $0x57,%edx
  movsbl %dl,%edx
  add    %edx,%eax
  jmp    L300
  nopl   (%rax)
L327:
  sub    $0x57,%edx
  movsbl %dl,%edx
  add    %edx,%eax
  jmp    L279
  nopl   (%rax)
L202:
  sub    $0x57,%edx
  movsbl %dl,%edx
  add    %edx,%eax
  jmp    L372
  nopl   (%rax)
L489:
  sub    $0x57,%edx
  movsbl %dl,%edx
  add    %edx,%eax
  ret
  nopl   0x0(%rax)
L388:
  lea    -0x30(%rdx),%eax
  xor    %esi,%esi
  cmp    $0x9,%al
  jbe    L15
  jmp    L1
L422:
  mov    $0xffffffff,%eax
  ret
```

assistant: ```c
int atohex(char *str) {
  int val, i, mi;
  char c;
  val = i = 0;
  while (str[i] <= ' ')
    i++;
  mi = i;
  while (str[i] > ' ' && (i - mi) < 8) {
    val <<= 4;
    c = str[i];
    if (c >= '0' && c <= '9') {
      val += c - '0';
    } else if (c >= 'a' && c <= 'f') {
      val += c - 'a' + 10;
    } else if (c >= 'A' && c <= 'F') {
      val += c - 'A' + 10;
    } else {
      return -1;
    }
    i++;
  }
  return val;
}
```