user: Converte this assembly snippet into its equivalent C code:

```asm
<hex2bin>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x18,%rsp
  mov    %rdi,%r14
  mov    %rsi,%r12
  movl   $0x7,0xc(%rsp)
  lea    D167(%rip),%rbp
L94:
  mov    %r14,%rbx
  lea    0x10(%r14),%r13
  lea    D69(%rip),%r15
  jmp    L86
  lea    D49(%rip),%rsi
  mov    %r12,%rdi
  call   <strcat@plt>
L29:
  add    $0x1,%rbx
  cmp    %r13,%rbx
  je     L25
L86:
  movzbl (%rbx),%esi
  lea    -0x30(%rsi),%eax
  cmp    $0x36,%al
  ja     L43
  movzbl %al,%eax
  movslq 0x0(%rbp,%rax,4),%rax
  add    %rbp,%rax
  notrack jmp *%rax
  lea    D46(%rip),%rsi
  mov    %r12,%rdi
  call   <strcat@plt>
  jmp    L29
  lea    D157(%rip),%rsi
  mov    %r12,%rdi
  call   <strcat@plt>
  jmp    L29
  lea    D22(%rip),%rsi
  mov    %r12,%rdi
  call   <strcat@plt>
  jmp    L29
  lea    D114(%rip),%rsi
  mov    %r12,%rdi
  call   <strcat@plt>
  jmp    L29
  lea    D119(%rip),%rsi
  mov    %r12,%rdi
  call   <strcat@plt>
  jmp    L29
  lea    D134(%rip),%rsi
  mov    %r12,%rdi
  call   <strcat@plt>
  jmp    L29
  lea    D48(%rip),%rsi
  mov    %r12,%rdi
  call   <strcat@plt>
  jmp    L29
  lea    D67(%rip),%rsi
  mov    %r12,%rdi
  call   <strcat@plt>
  jmp    L29
  lea    D144(%rip),%rsi
  mov    %r12,%rdi
  call   <strcat@plt>
  jmp    L29
  lea    D43(%rip),%rsi
  mov    %r12,%rdi
  call   <strcat@plt>
  jmp    L29
  lea    D45(%rip),%rsi
  mov    %r12,%rdi
  call   <strcat@plt>
  jmp    L29
  lea    D58(%rip),%rsi
  mov    %r12,%rdi
  call   <strcat@plt>
  jmp    L29
  mov    %r15,%rsi
  mov    %r12,%rdi
  call   <strcat@plt>
  jmp    L29
  lea    D175(%rip),%rsi
  mov    %r12,%rdi
  call   <strcat@plt>
  jmp    L29
  lea    D171(%rip),%rsi
  mov    %r12,%rdi
  call   <strcat@plt>
  jmp    L29
L43:
  movsbl %sil,%esi
  lea    D3(%rip),%rdi
  call   <printf@plt>
  mov    $0x0,%eax
L158:
  add    $0x18,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
L25:
  subl   $0x1,0xc(%rsp)
  jne    L94
  mov    $0x1,%eax
  jmp    L158
```

tool_calls: name: read_data
arguments: data_tag: D69
type: string
name: read_data
arguments: data_tag: D49
type: string
name: read_data
arguments: data_tag: D46
type: string
name: read_data
arguments: data_tag: D157
type: string
name: read_data
arguments: data_tag: D22
type: string
name: read_data
arguments: data_tag: D114
type: string
name: read_data
arguments: data_tag: D119
type: string
name: read_data
arguments: data_tag: D134
type: string
name: read_data
arguments: data_tag: D48
type: string
name: read_data
arguments: data_tag: D67
type: string
name: read_data
arguments: data_tag: D144
type: string
name: read_data
arguments: data_tag: D43
type: string
name: read_data
arguments: data_tag: D45
type: string
name: read_data
arguments: data_tag: D58
type: string
name: read_data
arguments: data_tag: D175
type: string
name: read_data
arguments: data_tag: D171
type: string
name: read_data
arguments: data_tag: D3
type: string

tool: D69: 1101

tool: D49: 0000

tool: D46: 0001

tool: D157: 0010

tool: D22: 0011

tool: D114: 0100

tool: D119: 0101

tool: D134: 0110

tool: D48: 0111

tool: D67: 1000

tool: D144: 1001

tool: D43: 1010

tool: D45: 1011

tool: D58: 1100

tool: D175: 1110

tool: D171: 1111

tool: D3: 
 Invalid hex digit %c 

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;
}
```