user: 请将这段汇编代码片段转换成等效的C代码:

```asm
<load_hex_table>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x30,%rsp
  mov    %rdi,-0x18(%rbp)
  mov    %rsi,-0x20(%rbp)
  mov    %edx,-0x24(%rbp)
  mov    %rcx,-0x30(%rbp)
  cmpq   $0x0,-0x18(%rbp)
  setne  %al
  movzbl %al,%eax
  mov    %eax,%edi
  call   <assert@plt>
  cmpq   $0x0,-0x20(%rbp)
  setne  %al
  movzbl %al,%eax
  mov    %eax,%edi
  call   <assert@plt>
  cmpq   $0x0,-0x30(%rbp)
  je     L245
  mov    -0x30(%rbp),%rax
  movl   $0x0,(%rax)
L245:
  movl   $0x0,-0xc(%rbp)
  jmp    L2
L82:
  mov    -0xc(%rbp),%eax
  movslq %eax,%rdx
  mov    -0x20(%rbp),%rax
  add    %rdx,%rax
  movb   $0x0,(%rax)
  addl   $0x1,-0xc(%rbp)
L2:
  mov    -0xc(%rbp),%eax
  cmp    -0x24(%rbp),%eax
  jl     L82
  jmp    L50
L37:
  addq   $0x1,-0x18(%rbp)
L50:
  mov    -0x18(%rbp),%rax
  movzbl (%rax),%eax
  cmp    $0x20,%al
  je     L37
  mov    -0x18(%rbp),%rax
  movzbl (%rax),%eax
  cmp    $0x9,%al
  je     L37
  mov    -0x18(%rbp),%rax
  mov    $0x2,%edx
  lea    D10(%rip),%rcx
  mov    %rcx,%rsi
  mov    %rax,%rdi
  call   <strncmp@plt>
  test   %rax,%rax
  jne    L60
  addq   $0x2,-0x18(%rbp)
  jmp    L232
L60:
  mov    -0x18(%rbp),%rax
  movzbl (%rax),%eax
  cmp    $0x22,%al
  jne    L232
  mov    -0x24(%rbp),%edx
  mov    -0x20(%rbp),%rcx
  mov    -0x18(%rbp),%rax
  mov    %rcx,%rsi
  mov    %rax,%rdi
  call   <load_char_table@plt>
  mov    %eax,-0x8(%rbp)
  cmpq   $0x0,-0x30(%rbp)
  je     L94
  cmpl   $0x1,-0x8(%rbp)
  jne    L94
  mov    -0x24(%rbp),%eax
  cltq
  lea    -0x1(%rax),%rdx
  mov    -0x20(%rbp),%rax
  add    %rdx,%rax
  movb   $0x0,(%rax)
  mov    -0x20(%rbp),%rax
  mov    %rax,%rdi
  call   <strlen@plt>
  mov    -0x30(%rbp),%rdx
  mov    %eax,(%rdx)
L94:
  mov    -0x8(%rbp),%eax
  jmp    L210
L232:
  movl   $0x0,-0xc(%rbp)
  jmp    L240
L0:
  mov    -0x18(%rbp),%rax
  lea    0x1(%rax),%rdx
  mov    %rdx,-0x18(%rbp)
  movzbl (%rax),%eax
  mov    %al,-0xd(%rbp)
  cmpb   $0x20,-0xd(%rbp)
  je     L0
  cmpb   $0x9,-0xd(%rbp)
  je     L0
  cmpb   $0x0,-0xd(%rbp)
  je     L298
  movsbl -0xd(%rbp),%eax
  mov    %eax,%edi
  call   <get_hex_digit@plt>
  mov    %eax,-0x4(%rbp)
  cmpl   $0xffffffff,-0x4(%rbp)
  jne    L72
  movsbl -0xd(%rbp),%eax
  mov    %eax,%esi
  lea    D13(%rip),%rax
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <printf@plt>
  mov    $0x0,%eax
  jmp    L210
L72:
  mov    -0x4(%rbp),%eax
  shl    $0x4,%eax
  mov    %eax,-0x8(%rbp)
  mov    -0x18(%rbp),%rax
  lea    0x1(%rax),%rdx
  mov    %rdx,-0x18(%rbp)
  movzbl (%rax),%eax
  mov    %al,-0xd(%rbp)
  cmpb   $0x0,-0xd(%rbp)
  jne    L258
  lea    D28(%rip),%rax
  mov    %rax,%rdi
  call   <puts@plt>
  mov    $0x0,%eax
  jmp    L210
L258:
  movsbl -0xd(%rbp),%eax
  mov    %eax,%edi
  call   <get_hex_digit@plt>
  mov    %eax,-0x4(%rbp)
  cmpl   $0xffffffff,-0x4(%rbp)
  jne    L154
  movsbl -0xd(%rbp),%eax
  mov    %eax,%esi
  lea    D13(%rip),%rax
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <printf@plt>
  mov    $0x0,%eax
  jmp    L210
L154:
  mov    -0x4(%rbp),%eax
  add    %eax,-0x8(%rbp)
  mov    -0xc(%rbp),%eax
  movslq %eax,%rdx
  mov    -0x20(%rbp),%rax
  add    %rdx,%rax
  mov    -0x8(%rbp),%edx
  mov    %dl,(%rax)
  addl   $0x1,-0xc(%rbp)
L240:
  mov    -0xc(%rbp),%eax
  cmp    -0x24(%rbp),%eax
  jl     L0
  jmp    L244
L298:
  nop
L244:
  mov    -0xc(%rbp),%eax
  cmp    -0x24(%rbp),%eax
  jne    L54
L176:
  mov    -0x18(%rbp),%rax
  lea    0x1(%rax),%rdx
  mov    %rdx,-0x18(%rbp)
  movzbl (%rax),%eax
  mov    %al,-0xd(%rbp)
  cmpb   $0x20,-0xd(%rbp)
  je     L176
  cmpb   $0x9,-0xd(%rbp)
  je     L176
  cmpb   $0x0,-0xd(%rbp)
  je     L54
  lea    D15(%rip),%rax
  mov    %rax,%rdi
  call   <puts@plt>
  mov    $0x0,%eax
  jmp    L210
L54:
  cmpq   $0x0,-0x30(%rbp)
  je     L76
  mov    -0x30(%rbp),%rax
  mov    -0xc(%rbp),%edx
  mov    %edx,(%rax)
L76:
  mov    $0x1,%eax
L210:
  leave
  ret
```

tool_calls: name: disassemble_data
arguments: tag: D10
type: string
name: disassemble_data
arguments: tag: D13
type: string
name: disassemble_data
arguments: tag: D28
type: string
name: disassemble_data
arguments: tag: D15
type: string

tool: D10: 0x

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


tool: D28: load_hex_table: incomplete hex byte

tool: D15: load_hex_table: too long hex value

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