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

```asm
<parse_hex4>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  mov    %rdi,-0x18(%rbp)
  movl   $0x0,-0x4(%rbp)
  mov    -0x18(%rbp),%rax
  movzbl (%rax),%eax
  cmp    $0x2f,%al
  jle    L238
  mov    -0x18(%rbp),%rax
  movzbl (%rax),%eax
  cmp    $0x39,%al
  jg     L238
  mov    -0x18(%rbp),%rax
  movzbl (%rax),%eax
  movsbl %al,%edx
  mov    -0x4(%rbp),%eax
  add    %edx,%eax
  sub    $0x30,%eax
  mov    %eax,-0x4(%rbp)
  jmp    L10
L238:
  mov    -0x18(%rbp),%rax
  movzbl (%rax),%eax
  cmp    $0x40,%al
  jle    L39
  mov    -0x18(%rbp),%rax
  movzbl (%rax),%eax
  cmp    $0x46,%al
  jg     L39
  mov    -0x18(%rbp),%rax
  movzbl (%rax),%eax
  movsbl %al,%edx
  mov    -0x4(%rbp),%eax
  add    %edx,%eax
  sub    $0x37,%eax
  mov    %eax,-0x4(%rbp)
  jmp    L10
L39:
  mov    -0x18(%rbp),%rax
  movzbl (%rax),%eax
  cmp    $0x60,%al
  jle    L54
  mov    -0x18(%rbp),%rax
  movzbl (%rax),%eax
  cmp    $0x66,%al
  jg     L54
  mov    -0x18(%rbp),%rax
  movzbl (%rax),%eax
  movsbl %al,%edx
  mov    -0x4(%rbp),%eax
  add    %edx,%eax
  sub    $0x57,%eax
  mov    %eax,-0x4(%rbp)
  jmp    L10
L54:
  mov    $0x0,%eax
  jmp    L323
L10:
  shll   $0x4,-0x4(%rbp)
  addq   $0x1,-0x18(%rbp)
  mov    -0x18(%rbp),%rax
  movzbl (%rax),%eax
  cmp    $0x2f,%al
  jle    L223
  mov    -0x18(%rbp),%rax
  movzbl (%rax),%eax
  cmp    $0x39,%al
  jg     L223
  mov    -0x18(%rbp),%rax
  movzbl (%rax),%eax
  movsbl %al,%edx
  mov    -0x4(%rbp),%eax
  add    %edx,%eax
  sub    $0x30,%eax
  mov    %eax,-0x4(%rbp)
  jmp    L294
L223:
  mov    -0x18(%rbp),%rax
  movzbl (%rax),%eax
  cmp    $0x40,%al
  jle    L351
  mov    -0x18(%rbp),%rax
  movzbl (%rax),%eax
  cmp    $0x46,%al
  jg     L351
  mov    -0x18(%rbp),%rax
  movzbl (%rax),%eax
  movsbl %al,%edx
  mov    -0x4(%rbp),%eax
  add    %edx,%eax
  sub    $0x37,%eax
  mov    %eax,-0x4(%rbp)
  jmp    L294
L351:
  mov    -0x18(%rbp),%rax
  movzbl (%rax),%eax
  cmp    $0x60,%al
  jle    L146
  mov    -0x18(%rbp),%rax
  movzbl (%rax),%eax
  cmp    $0x66,%al
  jg     L146
  mov    -0x18(%rbp),%rax
  movzbl (%rax),%eax
  movsbl %al,%edx
  mov    -0x4(%rbp),%eax
  add    %edx,%eax
  sub    $0x57,%eax
  mov    %eax,-0x4(%rbp)
  jmp    L294
L146:
  mov    $0x0,%eax
  jmp    L323
L294:
  shll   $0x4,-0x4(%rbp)
  addq   $0x1,-0x18(%rbp)
  mov    -0x18(%rbp),%rax
  movzbl (%rax),%eax
  cmp    $0x2f,%al
  jle    L73
  mov    -0x18(%rbp),%rax
  movzbl (%rax),%eax
  cmp    $0x39,%al
  jg     L73
  mov    -0x18(%rbp),%rax
  movzbl (%rax),%eax
  movsbl %al,%edx
  mov    -0x4(%rbp),%eax
  add    %edx,%eax
  sub    $0x30,%eax
  mov    %eax,-0x4(%rbp)
  jmp    L212
L73:
  mov    -0x18(%rbp),%rax
  movzbl (%rax),%eax
  cmp    $0x40,%al
  jle    L97
  mov    -0x18(%rbp),%rax
  movzbl (%rax),%eax
  cmp    $0x46,%al
  jg     L97
  mov    -0x18(%rbp),%rax
  movzbl (%rax),%eax
  movsbl %al,%edx
  mov    -0x4(%rbp),%eax
  add    %edx,%eax
  sub    $0x37,%eax
  mov    %eax,-0x4(%rbp)
  jmp    L212
L97:
  mov    -0x18(%rbp),%rax
  movzbl (%rax),%eax
  cmp    $0x60,%al
  jle    L131
  mov    -0x18(%rbp),%rax
  movzbl (%rax),%eax
  cmp    $0x66,%al
  jg     L131
  mov    -0x18(%rbp),%rax
  movzbl (%rax),%eax
  movsbl %al,%edx
  mov    -0x4(%rbp),%eax
  add    %edx,%eax
  sub    $0x57,%eax
  mov    %eax,-0x4(%rbp)
  jmp    L212
L131:
  mov    $0x0,%eax
  jmp    L323
L212:
  shll   $0x4,-0x4(%rbp)
  addq   $0x1,-0x18(%rbp)
  mov    -0x18(%rbp),%rax
  movzbl (%rax),%eax
  cmp    $0x2f,%al
  jle    L87
  mov    -0x18(%rbp),%rax
  movzbl (%rax),%eax
  cmp    $0x39,%al
  jg     L87
  mov    -0x18(%rbp),%rax
  movzbl (%rax),%eax
  movsbl %al,%edx
  mov    -0x4(%rbp),%eax
  add    %edx,%eax
  sub    $0x30,%eax
  mov    %eax,-0x4(%rbp)
  jmp    L245
L87:
  mov    -0x18(%rbp),%rax
  movzbl (%rax),%eax
  cmp    $0x40,%al
  jle    L296
  mov    -0x18(%rbp),%rax
  movzbl (%rax),%eax
  cmp    $0x46,%al
  jg     L296
  mov    -0x18(%rbp),%rax
  movzbl (%rax),%eax
  movsbl %al,%edx
  mov    -0x4(%rbp),%eax
  add    %edx,%eax
  sub    $0x37,%eax
  mov    %eax,-0x4(%rbp)
  jmp    L245
L296:
  mov    -0x18(%rbp),%rax
  movzbl (%rax),%eax
  cmp    $0x60,%al
  jle    L114
  mov    -0x18(%rbp),%rax
  movzbl (%rax),%eax
  cmp    $0x66,%al
  jg     L114
  mov    -0x18(%rbp),%rax
  movzbl (%rax),%eax
  movsbl %al,%edx
  mov    -0x4(%rbp),%eax
  add    %edx,%eax
  sub    $0x57,%eax
  mov    %eax,-0x4(%rbp)
  jmp    L245
L114:
  mov    $0x0,%eax
  jmp    L323
L245:
  mov    -0x4(%rbp),%eax
L323:
  pop    %rbp
  ret
```

assistant: ```c
unsigned parse_hex4(const char *str) {
  unsigned h = 0;
  if ((*str >= '0') && (*str <= '9')) {
    h += (*str) - '0';
  } else if ((*str >= 'A') && (*str <= 'F')) {
    h += 10 + (*str) - 'A';
  } else if ((*str >= 'a') && (*str <= 'f')) {
    h += 10 + (*str) - 'a';
  } else {
    return 0;
  }
  h = h << 4;
  str++;
  if ((*str >= '0') && (*str <= '9')) {
    h += (*str) - '0';
  } else if ((*str >= 'A') && (*str <= 'F')) {
    h += 10 + (*str) - 'A';
  } else if ((*str >= 'a') && (*str <= 'f')) {
    h += 10 + (*str) - 'a';
  } else {
    return 0;
  }
  h = h << 4;
  str++;
  if ((*str >= '0') && (*str <= '9')) {
    h += (*str) - '0';
  } else if ((*str >= 'A') && (*str <= 'F')) {
    h += 10 + (*str) - 'A';
  } else if ((*str >= 'a') && (*str <= 'f')) {
    h += 10 + (*str) - 'a';
  } else {
    return 0;
  }
  h = h << 4;
  str++;
  if ((*str >= '0') && (*str <= '9')) {
    h += (*str) - '0';
  } else if ((*str >= 'A') && (*str <= 'F')) {
    h += 10 + (*str) - 'A';
  } else if ((*str >= 'a') && (*str <= 'f')) {
    h += 10 + (*str) - 'a';
  } else {
    return 0;
  }
  return h;
}
```