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

```asm
<hex_to_base4>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x8,%rsp
  mov    %rdi,%rbp
  mov    %rsi,%r12
  mov    $0x8,%edx
  mov    $0x0,%esi
  mov    %r12,%rdi
  call   <memset@plt>
  mov    $0x0,%ebx
  lea    D3(%rip),%r15
  lea    D172(%rip),%r13
  lea    D37(%rip),%r14
  jmp    L121
  lea    D123(%rip),%rsi
  mov    %r12,%rdi
  call   <strcat@plt>
L163:
  add    $0x1,%rbx
L121:
  mov    %rbp,%rdi
  call   <strlen@plt>
  cmp    %ebx,%eax
  jle    L136
  movzbl 0x0(%rbp,%rbx,1),%eax
  sub    $0x30,%eax
  cmp    $0x36,%al
  ja     L91
  movzbl %al,%eax
  movslq 0x0(%r13,%rax,4),%rax
  add    %r13,%rax
  notrack jmp *%rax
  lea    D162(%rip),%rsi
  mov    %r12,%rdi
  call   <strcat@plt>
  jmp    L163
  lea    D100(%rip),%rsi
  mov    %r12,%rdi
  call   <strcat@plt>
  jmp    L163
  lea    D158(%rip),%rsi
  mov    %r12,%rdi
  call   <strcat@plt>
  jmp    L163
  lea    D47(%rip),%rsi
  mov    %r12,%rdi
  call   <strcat@plt>
  jmp    L163
  lea    D105(%rip),%rsi
  mov    %r12,%rdi
  call   <strcat@plt>
  jmp    L163
  lea    D94(%rip),%rsi
  mov    %r12,%rdi
  call   <strcat@plt>
  jmp    L163
  lea    D144(%rip),%rsi
  mov    %r12,%rdi
  call   <strcat@plt>
  jmp    L163
  lea    D136(%rip),%rsi
  mov    %r12,%rdi
  call   <strcat@plt>
  jmp    L163
  lea    D85(%rip),%rsi
  mov    %r12,%rdi
  call   <strcat@plt>
  jmp    L163
  lea    D177(%rip),%rsi
  mov    %r12,%rdi
  call   <strcat@plt>
  jmp    L163
  lea    D149(%rip),%rsi
  mov    %r12,%rdi
  call   <strcat@plt>
  jmp    L163
  lea    D56(%rip),%rsi
  mov    %r12,%rdi
  call   <strcat@plt>
  jmp    L163
  lea    D33(%rip),%rsi
  mov    %r12,%rdi
  call   <strcat@plt>
  jmp    L163
  lea    D152(%rip),%rsi
  mov    %r12,%rdi
  call   <strcat@plt>
  jmp    L163
  mov    %r14,%rsi
  mov    %r12,%rdi
  call   <strcat@plt>
  jmp    L163
L91:
  mov    %r15,%rdi
  call   <printf@plt>
  jmp    L163
L136:
  add    $0x8,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
```

tool_calls: name: retrieve_data
arguments: data_label: D3
type: string
name: retrieve_data
arguments: data_label: D37
type: string
name: retrieve_data
arguments: data_label: D123
type: string
name: retrieve_data
arguments: data_label: D162
type: string
name: retrieve_data
arguments: data_label: D100
type: string
name: retrieve_data
arguments: data_label: D158
type: string
name: retrieve_data
arguments: data_label: D47
type: string
name: retrieve_data
arguments: data_label: D105
type: string
name: retrieve_data
arguments: data_label: D94
type: string
name: retrieve_data
arguments: data_label: D144
type: string
name: retrieve_data
arguments: data_label: D136
type: string
name: retrieve_data
arguments: data_label: D85
type: string
name: retrieve_data
arguments: data_label: D177
type: string
name: retrieve_data
arguments: data_label: D149
type: string
name: retrieve_data
arguments: data_label: D56
type: string
name: retrieve_data
arguments: data_label: D33
type: string
name: retrieve_data
arguments: data_label: D152
type: string

tool: D3: Some wierd number is in the key 


tool: D37: 33

tool: D123: 00

tool: D162: 01

tool: D100: 02

tool: D158: 03

tool: D47: 10

tool: D105: 11

tool: D94: 12

tool: D144: 13

tool: D136: 20

tool: D85: 21

tool: D177: 22

tool: D149: 23

tool: D56: 30

tool: D33: 31

tool: D152: 32

assistant: ```c
void hex_to_base4(char *hexstr, char *base4str) {
  int i = 0;
  memset(base4str, 0, sizeof(base4str));
  for (i = 0; i < strlen(hexstr); i++) {
    switch (hexstr[i]) {
    case '0':
      strcat(base4str, "00");
      break;
    case '1':
      strcat(base4str, "01");
      break;
    case '2':
      strcat(base4str, "02");
      break;
    case '3':
      strcat(base4str, "03");
      break;
    case '4':
      strcat(base4str, "10");
      break;
    case '5':
      strcat(base4str, "11");
      break;
    case '6':
      strcat(base4str, "12");
      break;
    case '7':
      strcat(base4str, "13");
      break;
    case '8':
      strcat(base4str, "20");
      break;
    case '9':
      strcat(base4str, "21");
      break;
    case 'a':
      strcat(base4str, "22");
      break;
    case 'b':
      strcat(base4str, "23");
      break;
    case 'c':
      strcat(base4str, "30");
      break;
    case 'd':
      strcat(base4str, "31");
      break;
    case 'e':
      strcat(base4str, "32");
      break;
    case 'f':
      strcat(base4str, "33");
      break;
    default:
      printf("Some wierd number is in the key \n");
      break;
    }
  }
}
```