user: 请将以下的汇编代码转换成C语言代码:

```asm
<nam2num>:
  endbr64
  movsbl (%rdi),%ecx
  mov    %rdi,%rdx
  mov    $0xffffffff,%eax
  test   %ecx,%ecx
  je     L297
  lea    -0x61(%rcx),%eax
  cmp    $0x19,%eax
  ja     L270
  sub    $0x56,%ecx
  movslq %ecx,%rax
L71:
  movsbl 0x1(%rdx),%ecx
  test   %ecx,%ecx
  je     L297
  lea    -0x61(%rcx),%esi
  cmp    $0x19,%esi
  jbe    L373
  lea    -0x41(%rcx),%esi
  cmp    $0x19,%esi
  jbe    L361
  lea    -0x30(%rcx),%esi
  cmp    $0x9,%esi
  jbe    L41
  cmp    $0x5f,%ecx
  setne  %cl
  movzbl %cl,%ecx
  add    $0x25,%rcx
  jmp    L94
  nopl   0x0(%rax)
L80:
  sub    $0x56,%ecx
  movslq %ecx,%rcx
L193:
  lea    (%rax,%rax,4),%rsi
  movsbl 0x5(%rdx),%edx
  lea    (%rcx,%rsi,8),%rcx
  sub    %rax,%rcx
  mov    %rcx,%rax
  test   %edx,%edx
  je     L297
  lea    -0x61(%rdx),%ecx
  cmp    $0x19,%ecx
  ja     L262
  sub    $0x56,%edx
  movslq %edx,%rdx
L58:
  lea    (%rax,%rax,4),%rcx
  lea    (%rdx,%rcx,8),%rdx
  sub    %rax,%rdx
  mov    %rdx,%rax
L297:
  ret
  nopl   (%rax)
L270:
  lea    -0x41(%rcx),%eax
  cmp    $0x19,%eax
  jbe    L207
  lea    -0x30(%rcx),%eax
  cmp    $0x9,%eax
  jbe    L163
  xor    %eax,%eax
  cmp    $0x5f,%ecx
  setne  %al
  add    $0x25,%rax
  jmp    L71
  nopl   0x0(%rax)
L373:
  sub    $0x56,%ecx
  movslq %ecx,%rcx
L94:
  lea    (%rax,%rax,4),%rsi
  lea    (%rcx,%rsi,8),%rcx
  sub    %rax,%rcx
  mov    %rcx,%rax
  movsbl 0x2(%rdx),%ecx
  test   %ecx,%ecx
  je     L297
  lea    -0x61(%rcx),%esi
  cmp    $0x19,%esi
  jbe    L411
  lea    -0x41(%rcx),%esi
  cmp    $0x19,%esi
  jbe    L93
  lea    -0x30(%rcx),%esi
  cmp    $0x9,%esi
  jbe    L358
  cmp    $0x5f,%ecx
  setne  %cl
  movzbl %cl,%ecx
  add    $0x25,%rcx
  jmp    L179
  nopl   0x0(%rax,%rax,1)
L411:
  sub    $0x56,%ecx
  movslq %ecx,%rcx
L179:
  lea    (%rax,%rax,4),%rsi
  lea    (%rcx,%rsi,8),%rcx
  sub    %rax,%rcx
  mov    %rcx,%rax
  movsbl 0x3(%rdx),%ecx
  test   %ecx,%ecx
  je     L297
  lea    -0x61(%rcx),%esi
  cmp    $0x19,%esi
  jbe    L225
  lea    -0x41(%rcx),%esi
  cmp    $0x19,%esi
  jbe    L73
  lea    -0x30(%rcx),%esi
  cmp    $0x9,%esi
  jbe    L126
  cmp    $0x5f,%ecx
  setne  %cl
  movzbl %cl,%ecx
  add    $0x25,%rcx
  jmp    L295
  nopw   0x0(%rax,%rax,1)
L225:
  sub    $0x56,%ecx
  movslq %ecx,%rcx
L295:
  lea    (%rax,%rax,4),%rsi
  lea    (%rcx,%rsi,8),%rcx
  sub    %rax,%rcx
  mov    %rcx,%rax
  movsbl 0x4(%rdx),%ecx
  test   %ecx,%ecx
  je     L297
  lea    -0x61(%rcx),%esi
  cmp    $0x19,%esi
  jbe    L80
  lea    -0x41(%rcx),%esi
  cmp    $0x19,%esi
  jbe    L227
  lea    -0x30(%rcx),%esi
  cmp    $0x9,%esi
  jbe    L11
  cmp    $0x5f,%ecx
  setne  %cl
  movzbl %cl,%ecx
  add    $0x25,%rcx
  jmp    L193
  cs nopw 0x0(%rax,%rax,1)
L262:
  lea    -0x41(%rdx),%ecx
  cmp    $0x19,%ecx
  jbe    L371
  lea    -0x30(%rdx),%ecx
  cmp    $0x9,%ecx
  ja     L81
  sub    $0x2f,%edx
  movslq %edx,%rdx
  jmp    L58
  nop
L207:
  sub    $0x36,%ecx
  movslq %ecx,%rax
  jmp    L71
  nopl   0x0(%rax,%rax,1)
L361:
  sub    $0x36,%ecx
  movslq %ecx,%rcx
  jmp    L94
  nopl   0x0(%rax,%rax,1)
L93:
  sub    $0x36,%ecx
  movslq %ecx,%rcx
  jmp    L179
  nopl   0x0(%rax,%rax,1)
L73:
  sub    $0x36,%ecx
  movslq %ecx,%rcx
  jmp    L295
  nopl   0x0(%rax,%rax,1)
L227:
  sub    $0x36,%ecx
  movslq %ecx,%rcx
  jmp    L193
  nopl   0x0(%rax,%rax,1)
L371:
  sub    $0x36,%edx
  movslq %edx,%rdx
  jmp    L58
  nopl   0x0(%rax,%rax,1)
L163:
  sub    $0x2f,%ecx
  movslq %ecx,%rax
  jmp    L71
  nopl   0x0(%rax,%rax,1)
L41:
  sub    $0x2f,%ecx
  movslq %ecx,%rcx
  jmp    L94
  nopl   0x0(%rax,%rax,1)
L358:
  sub    $0x2f,%ecx
  movslq %ecx,%rcx
  jmp    L179
  nopl   0x0(%rax,%rax,1)
L126:
  sub    $0x2f,%ecx
  movslq %ecx,%rcx
  jmp    L295
  nopl   0x0(%rax,%rax,1)
L11:
  sub    $0x2f,%ecx
  movslq %ecx,%rcx
  jmp    L193
  nopl   0x0(%rax,%rax,1)
L81:
  cmp    $0x5f,%edx
  setne  %dl
  movzbl %dl,%edx
  add    $0x25,%rdx
  jmp    L58
```

assistant: ```c
unsigned long nam2num(const char *name) {
  unsigned long retval;
  int c, i;
  if (!(c = name[0])) {
    return 0xFFFFFFFF;
  }
  i = retval = 0;
  do {
    if (c >= 'a' && c <= 'z') {
      c += (11 - 'a');
    } else if (c >= 'A' && c <= 'Z') {
      c += (11 - 'A');
    } else if (c >= '0' && c <= '9') {
      c -= ('0' - 1);
    } else {
      c = c == '_' ? 37 : 38;
    }
    retval = retval * 39 + c;
  } while (i < 5 && (c = name[++i]));
  return retval;
}
```