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

```asm
<hex2bin>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  mov    %rdi,%r13
  push   %r12
  lea    0x10(%rdi),%r12
  push   %rbp
  mov    %rsi,%rbp
  push   %rbx
  lea    D56(%rip),%rbx
  sub    $0x18,%rsp
  movl   $0x7,0xc(%rsp)
L76:
  mov    %r13,%r14
  lea    D41(%rip),%r15
  nopl   (%rax)
L115:
  movsbl (%r14),%esi
  lea    -0x30(%rsi),%eax
  cmp    $0x36,%al
  ja     L144
  movzbl %al,%eax
  movslq (%rbx,%rax,4),%rax
  add    %rbx,%rax
  notrack jmp *%rax
L144:
  lea    D50(%rip),%rdi
  call   <printf@plt>
  add    $0x18,%rsp
  xor    %eax,%eax
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
  nopl   (%rax)
  lea    D120(%rip),%rsi
  mov    %rbp,%rdi
  call   <strcat@plt>
  nop
L124:
  add    $0x1,%r14
  cmp    %r12,%r14
  jne    L115
  subl   $0x1,0xc(%rsp)
  jne    L76
  add    $0x18,%rsp
  mov    $0x1,%eax
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
  nopl   0x0(%rax)
  lea    D52(%rip),%rsi
  mov    %rbp,%rdi
  call   <strcat@plt>
  jmp    L124
  nopl   0x0(%rax)
  mov    %r15,%rsi
  mov    %rbp,%rdi
  call   <strcat@plt>
  jmp    L124
  nopl   (%rax)
  lea    D161(%rip),%rsi
  mov    %rbp,%rdi
  call   <strcat@plt>
  jmp    L124
  nopl   0x0(%rax)
  lea    D74(%rip),%rsi
  mov    %rbp,%rdi
  call   <strcat@plt>
  jmp    L124
  nopl   0x0(%rax)
  lea    D115(%rip),%rsi
  mov    %rbp,%rdi
  call   <strcat@plt>
  jmp    L124
  nopl   0x0(%rax)
  lea    D169(%rip),%rsi
  mov    %rbp,%rdi
  call   <strcat@plt>
  jmp    L124
  nopl   0x0(%rax)
  lea    D131(%rip),%rsi
  mov    %rbp,%rdi
  call   <strcat@plt>
  jmp    L124
  nopl   0x0(%rax)
  lea    D130(%rip),%rsi
  mov    %rbp,%rdi
  call   <strcat@plt>
  jmp    L124
  nopl   0x0(%rax)
  lea    D150(%rip),%rsi
  mov    %rbp,%rdi
  call   <strcat@plt>
  jmp    L124
  nopl   0x0(%rax)
  lea    D178(%rip),%rsi
  mov    %rbp,%rdi
  call   <strcat@plt>
  jmp    L124
  nopl   0x0(%rax)
  lea    D33(%rip),%rsi
  mov    %rbp,%rdi
  call   <strcat@plt>
  jmp    L124
  nopl   0x0(%rax)
  lea    D83(%rip),%rsi
  mov    %rbp,%rdi
  call   <strcat@plt>
  jmp    L124
  nopl   0x0(%rax)
  lea    D81(%rip),%rsi
  mov    %rbp,%rdi
  call   <strcat@plt>
  jmp    L124
  nopl   0x0(%rax)
  lea    D82(%rip),%rsi
  mov    %rbp,%rdi
  call   <strcat@plt>
  jmp    L124
  nopl   0x0(%rax)
  lea    D20(%rip),%rsi
  mov    %rbp,%rdi
  call   <strcat@plt>
  jmp    L124
```

tool_calls: name: parse_data
arguments: label: D41
datatype: string
name: parse_data
arguments: label: D50
datatype: string
name: parse_data
arguments: label: D120
datatype: string
name: parse_data
arguments: label: D52
datatype: string
name: parse_data
arguments: label: D161
datatype: string
name: parse_data
arguments: label: D74
datatype: string
name: parse_data
arguments: label: D115
datatype: string
name: parse_data
arguments: label: D169
datatype: string
name: parse_data
arguments: label: D131
datatype: string
name: parse_data
arguments: label: D130
datatype: string
name: parse_data
arguments: label: D150
datatype: string
name: parse_data
arguments: label: D178
datatype: string
name: parse_data
arguments: label: D33
datatype: string
name: parse_data
arguments: label: D83
datatype: string
name: parse_data
arguments: label: D81
datatype: string
name: parse_data
arguments: label: D82
datatype: string
name: parse_data
arguments: label: D20
datatype: string

tool: D41: 1101

tool: D50: 
 Invalid hex digit %c 

tool: D120: 1111

tool: D52: 1110

tool: D161: 1100

tool: D74: 1011

tool: D115: 1010

tool: D169: 1001

tool: D131: 1000

tool: D130: 0111

tool: D150: 0110

tool: D178: 0101

tool: D33: 0100

tool: D83: 0011

tool: D81: 0010

tool: D82: 0001

tool: D20: 0000

assistant: ```c
int hex2bin(char *hex, char *bin) {
  int i, j;
  for (j = 0; j < 7; j++)
    for (i = 0; i < 16; i++) {
      switch (hex[i]) {
      case '0':
        strcat(bin, "0000");
        break;
      case '1':
        strcat(bin, "0001");
        break;
      case '2':
        strcat(bin, "0010");
        break;
      case '3':
        strcat(bin, "0011");
        break;
      case '4':
        strcat(bin, "0100");
        break;
      case '5':
        strcat(bin, "0101");
        break;
      case '6':
        strcat(bin, "0110");
        break;
      case '7':
        strcat(bin, "0111");
        break;
      case '8':
        strcat(bin, "1000");
        break;
      case '9':
        strcat(bin, "1001");
        break;
      case 'a':
        strcat(bin, "1010");
        break;
      case 'b':
        strcat(bin, "1011");
        break;
      case 'c':
        strcat(bin, "1100");
        break;
      case 'd':
        strcat(bin, "1101");
        break;
      case 'e':
        strcat(bin, "1110");
        break;
      case 'f':
        strcat(bin, "1111");
        break;
      default:
        printf("\n Invalid hex digit %c ", hex[i]);
        return 0;
      }
    }
  return 1;
}
```