user: Please show me the C implementation that matches the assembly code listed below:

```asm
<get_hex_digit>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x20,%rsp
  mov    %rdi,-0x18(%rbp)
  mov    %fs:0x28,%rax
  mov    %rax,-0x8(%rbp)
  xor    %eax,%eax
  mov    -0x18(%rbp),%rax
  movzbl (%rax),%eax
  mov    %al,-0xa(%rbp)
  movb   $0x0,-0x9(%rbp)
  lea    -0xa(%rbp),%rax
  lea    D62(%rip),%rdx
  mov    %rdx,%rsi
  mov    %rax,%rdi
  call   <strcmp@plt>
  test   %eax,%eax
  je     L32
  lea    -0xa(%rbp),%rax
  lea    D112(%rip),%rdx
  mov    %rdx,%rsi
  mov    %rax,%rdi
  call   <strcmp@plt>
  test   %eax,%eax
  jne    L22
L32:
  mov    $0xa,%eax
  jmp    L90
L22:
  lea    -0xa(%rbp),%rax
  lea    D99(%rip),%rdx
  mov    %rdx,%rsi
  mov    %rax,%rdi
  call   <strcmp@plt>
  test   %eax,%eax
  je     L73
  lea    -0xa(%rbp),%rax
  lea    D74(%rip),%rdx
  mov    %rdx,%rsi
  mov    %rax,%rdi
  call   <strcmp@plt>
  test   %eax,%eax
  jne    L13
L73:
  mov    $0xb,%eax
  jmp    L90
L13:
  lea    -0xa(%rbp),%rax
  lea    D19(%rip),%rdx
  mov    %rdx,%rsi
  mov    %rax,%rdi
  call   <strcmp@plt>
  test   %eax,%eax
  je     L132
  lea    -0xa(%rbp),%rax
  lea    D100(%rip),%rdx
  mov    %rdx,%rsi
  mov    %rax,%rdi
  call   <strcmp@plt>
  test   %eax,%eax
  jne    L112
L132:
  mov    $0xc,%eax
  jmp    L90
L112:
  lea    -0xa(%rbp),%rax
  lea    D9(%rip),%rdx
  mov    %rdx,%rsi
  mov    %rax,%rdi
  call   <strcmp@plt>
  test   %eax,%eax
  je     L42
  lea    -0xa(%rbp),%rax
  lea    D52(%rip),%rdx
  mov    %rdx,%rsi
  mov    %rax,%rdi
  call   <strcmp@plt>
  test   %eax,%eax
  jne    L188
L42:
  mov    $0xd,%eax
  jmp    L90
L188:
  lea    -0xa(%rbp),%rax
  lea    D46(%rip),%rdx
  mov    %rdx,%rsi
  mov    %rax,%rdi
  call   <strcmp@plt>
  test   %eax,%eax
  je     L0
  lea    -0xa(%rbp),%rax
  lea    D82(%rip),%rdx
  mov    %rdx,%rsi
  mov    %rax,%rdi
  call   <strcmp@plt>
  test   %eax,%eax
  jne    L186
L0:
  mov    $0xe,%eax
  jmp    L90
L186:
  lea    -0xa(%rbp),%rax
  lea    D53(%rip),%rdx
  mov    %rdx,%rsi
  mov    %rax,%rdi
  call   <strcmp@plt>
  test   %eax,%eax
  je     L51
  lea    -0xa(%rbp),%rax
  lea    D27(%rip),%rdx
  mov    %rdx,%rsi
  mov    %rax,%rdi
  call   <strcmp@plt>
  test   %eax,%eax
  jne    L76
L51:
  mov    $0xf,%eax
  jmp    L90
L76:
  lea    -0xa(%rbp),%rax
  mov    %rax,%rdi
  call   <atoi@plt>
L90:
  mov    -0x8(%rbp),%rdx
  sub    %fs:0x28,%rdx
  je     L7
  call   <__stack_chk_fail@plt>
L7:
  leave
  ret
```

tool_calls: name: read_data
arguments: data_label: D62
type: string
name: read_data
arguments: data_label: D112
type: string
name: read_data
arguments: data_label: D99
type: string
name: read_data
arguments: data_label: D74
type: string
name: read_data
arguments: data_label: D19
type: string
name: read_data
arguments: data_label: D100
type: string
name: read_data
arguments: data_label: D9
type: string
name: read_data
arguments: data_label: D52
type: string
name: read_data
arguments: data_label: D46
type: string
name: read_data
arguments: data_label: D82
type: string
name: read_data
arguments: data_label: D53
type: string
name: read_data
arguments: data_label: D27
type: string

tool: D62: a

tool: D112: A

tool: D99: b

tool: D74: B

tool: D19: c

tool: D100: C

tool: D9: d

tool: D52: D

tool: D46: e

tool: D82: E

tool: D53: f

tool: D27: F

assistant: ```c
int get_hex_digit(char *d) {
  char c[2];
  c[0] = *d;
  c[1] = 0;
  if (!strcmp(c, "a") || !strcmp(c, "A"))
    return 10;
  if (!strcmp(c, "b") || !strcmp(c, "B"))
    return 11;
  if (!strcmp(c, "c") || !strcmp(c, "C"))
    return 12;
  if (!strcmp(c, "d") || !strcmp(c, "D"))
    return 13;
  if (!strcmp(c, "e") || !strcmp(c, "E"))
    return 14;
  if (!strcmp(c, "f") || !strcmp(c, "F"))
    return 15;
  return (atoi(c));
}
```