user: What is the c source code of the assembly code below:

```asm
<load_hex_table>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x18,%rsp
  mov    %rdi,%r12
  mov    %rsi,%r13
  mov    %edx,%r15d
  mov    %rcx,%rbx
  mov    %rcx,0x8(%rsp)
  test   %rdi,%rdi
  setne  %dil
  movzbl %dil,%edi
  call   <assert@plt>
  test   %r13,%r13
  setne  %dil
  movzbl %dil,%edi
  call   <assert@plt>
  test   %rbx,%rbx
  je     L87
  movl   $0x0,(%rbx)
L87:
  test   %r15d,%r15d
  jle    L125
  mov    %r13,%rax
  lea    -0x1(%r15),%ecx
  add    %r13,%rcx
L132:
  movb   $0x0,(%rax)
  mov    %rax,%rdx
  add    $0x1,%rax
  cmp    %rcx,%rdx
  jne    L132
L125:
  movzbl (%r12),%eax
  cmp    $0x20,%al
  je     L154
  cmp    $0x9,%al
  jne    L138
L154:
  add    $0x1,%r12
  movzbl (%r12),%eax
  cmp    $0x20,%al
  je     L154
  cmp    $0x9,%al
  je     L154
L138:
  mov    $0x2,%edx
  lea    D37(%rip),%rsi
  mov    %r12,%rdi
  call   <strncmp@plt>
  test   %rax,%rax
  jne    L186
  add    $0x2,%r12
L54:
  mov    $0x0,%r14d
  mov    %r12,%rbx
  test   %r15d,%r15d
  jle    L91
L50:
  mov    %r12,%rbx
L121:
  mov    %rbx,%r12
  add    $0x1,%rbx
  movzbl -0x1(%rbx),%ebp
  cmp    $0x20,%bpl
  je     L121
  cmp    $0x9,%bpl
  je     L121
  test   %bpl,%bpl
  je     L91
  movsbl %bpl,%ebp
  mov    %ebp,%edi
  call   <get_hex_digit@plt>
  cmp    $0xffffffff,%eax
  je     L205
  shl    $0x4,%eax
  mov    %eax,%ebp
  add    $0x2,%r12
  movzbl (%rbx),%ebx
  test   %bl,%bl
  je     L53
  movsbl %bl,%ebx
  mov    %ebx,%edi
  call   <get_hex_digit@plt>
  cmp    $0xffffffff,%eax
  je     L146
  add    %eax,%ebp
  mov    %bpl,0x0(%r13)
  add    $0x1,%r14d
  add    $0x1,%r13
  cmp    %r14d,%r15d
  jne    L50
L183:
  add    $0x1,%r12
  movzbl -0x1(%r12),%eax
  cmp    $0x20,%al
  je     L183
  cmp    $0x9,%al
  je     L183
  mov    %r15d,%r14d
  test   %al,%al
  je     L164
  lea    D45(%rip),%rdi
  call   <puts@plt>
  mov    $0x0,%ebx
  jmp    L68
L186:
  cmpb   $0x22,(%r12)
  jne    L54
  mov    %r15d,%edx
  mov    %r13,%rsi
  mov    %r12,%rdi
  call   <load_char_table@plt>
  mov    %eax,%ebx
  mov    0x8(%rsp),%r14
  test   %r14,%r14
  je     L68
  cmp    $0x1,%eax
  jne    L68
  movslq %r15d,%r15
  movb   $0x0,-0x1(%r13,%r15,1)
  mov    %r13,%rdi
  call   <strlen@plt>
  mov    %eax,(%r14)
  jmp    L68
L205:
  mov    %ebp,%esi
  lea    D46(%rip),%rdi
  mov    $0x0,%eax
  call   <printf@plt>
  mov    $0x0,%ebx
  jmp    L68
L53:
  lea    D16(%rip),%rdi
  call   <puts@plt>
  mov    $0x0,%ebx
  jmp    L68
L146:
  mov    %ebx,%esi
  lea    D46(%rip),%rdi
  mov    $0x0,%eax
  call   <printf@plt>
  mov    $0x0,%ebx
  jmp    L68
L91:
  cmp    %r14d,%r15d
  je     L3
L164:
  mov    $0x1,%ebx
  mov    0x8(%rsp),%rax
  test   %rax,%rax
  je     L68
  mov    %r14d,(%rax)
L68:
  mov    %ebx,%eax
  add    $0x18,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
L3:
  mov    %r14d,%r15d
  mov    %rbx,%r12
  jmp    L183
```

tool_calls: name: read_data
arguments: data_tag: D37
type_guessed: string
name: read_data
arguments: data_tag: D45
type_guessed: string
name: read_data
arguments: data_tag: D46
type_guessed: string
name: read_data
arguments: data_tag: D16
type_guessed: string

tool: D37: 0x

tool: D45: load_hex_table: too long hex value

tool: D46: load_hex_table: invalid character '%c'


tool: D16: load_hex_table: incomplete hex byte

assistant: ```c
int load_hex_table(const char *data, unsigned char *table, int maxlen, int *length) {
  int i, tmp, res;
  char c;
  assert(data != NULL);
  assert(table != NULL);
  if (length != NULL) {
    *length = 0;
  }
  for (i = 0; i < maxlen; i++) {
    table[i] = '\0';
  }
  while (*data == ' ' || *data == '\t')
    data++;
  if (strncmp(data, "0x", 2) == 0) {
    data += 2;
  } else if (*data == '"') {
    res = load_char_table(data, (char *)table, maxlen);
    if (length != NULL && res == 1) {
      table[maxlen - 1] = '\0';
      *length = strlen((char *)table);
    }
    return res;
  }
  for (i = 0; i < maxlen; i++) {
    do {
      c = *data++;
    } while (c == ' ' || c == '\t');
    if (c == '\0')
      break;
    tmp = get_hex_digit(c);
    if (tmp == -1) {
      printf("load_hex_table: invalid character '%c'\n", c);
      return 0;
    }
    res = tmp * 16;
    c = *data++;
    if (c == '\0') {
      printf("load_hex_table: incomplete hex byte\n");
      return 0;
    }
    tmp = get_hex_digit(c);
    if (tmp == -1) {
      printf("load_hex_table: invalid character '%c'\n", c);
      return 0;
    }
    res += tmp;
    table[i] = res;
  }
  if (i == maxlen) {
    do {
      c = *data++;
    } while (c == ' ' || c == '\t');
    if (c != '\0') {
      printf("load_hex_table: too long hex value\n");
      return 0;
    }
  }
  if (length != NULL) {
    *length = i;
  }
  return 1;
}
```