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

```asm
<load_char_table>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x60,%rsp
  mov    %rdi,-0x48(%rbp)
  mov    %rsi,-0x50(%rbp)
  mov    %edx,-0x54(%rbp)
  mov    %fs:0x28,%rax
  mov    %rax,-0x8(%rbp)
  xor    %eax,%eax
  cmpq   $0x0,-0x48(%rbp)
  setne  %al
  movzbl %al,%eax
  mov    %eax,%edi
  call   <assert@plt>
  cmpq   $0x0,-0x50(%rbp)
  setne  %al
  movzbl %al,%eax
  mov    %eax,%edi
  call   <assert@plt>
  movl   $0x0,-0x2c(%rbp)
  jmp    L323
L240:
  mov    -0x2c(%rbp),%eax
  movslq %eax,%rdx
  mov    -0x50(%rbp),%rax
  add    %rdx,%rax
  movb   $0x0,(%rax)
  addl   $0x1,-0x2c(%rbp)
L323:
  mov    -0x2c(%rbp),%eax
  cmp    -0x54(%rbp),%eax
  jl     L240
  movl   $0x0,-0x20(%rbp)
  movl   $0x0,-0x1c(%rbp)
  movl   $0x0,-0x18(%rbp)
  movl   $0x0,-0x24(%rbp)
  jmp    L382
L5:
  addl   $0x1,-0x24(%rbp)
L382:
  mov    -0x24(%rbp),%eax
  movslq %eax,%rdx
  mov    -0x48(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%eax
  cmp    $0x20,%al
  je     L5
  mov    -0x24(%rbp),%eax
  movslq %eax,%rdx
  mov    -0x48(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%eax
  cmp    $0x9,%al
  je     L5
  mov    -0x48(%rbp),%rax
  mov    %rax,%rdi
  call   <strlen@plt>
  sub    -0x24(%rbp),%eax
  mov    %eax,-0x14(%rbp)
  mov    -0x24(%rbp),%eax
  mov    %eax,-0x2c(%rbp)
  jmp    L360
L423:
  mov    -0x2c(%rbp),%eax
  movslq %eax,%rdx
  mov    -0x48(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%eax
  movsbl %al,%eax
  mov    %eax,-0x30(%rbp)
  mov    -0x30(%rbp),%eax
  test   %eax,%eax
  jne    L288
  cmpl   $0x1,-0x1c(%rbp)
  jne    L406
  cmpl   $0x1,-0x18(%rbp)
  je     L68
L406:
  lea    D9(%rip),%rax
  mov    %rax,%rdi
  call   <puts@plt>
  mov    $0x0,%eax
  jmp    L468
L288:
  mov    -0x30(%rbp),%eax
  cmp    $0x22,%eax
  jne    L3
  cmpl   $0x0,-0x1c(%rbp)
  jne    L271
  movl   $0x1,-0x1c(%rbp)
  jmp    L54
L271:
  cmpl   $0x0,-0x18(%rbp)
  jne    L21
  movl   $0x1,-0x18(%rbp)
  jmp    L54
L21:
  lea    D33(%rip),%rax
  mov    %rax,%rdi
  call   <puts@plt>
  mov    $0x0,%eax
  jmp    L468
L3:
  cmpl   $0x0,-0x1c(%rbp)
  jne    L422
  mov    -0x30(%rbp),%eax
  mov    %eax,%esi
  lea    D46(%rip),%rax
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <printf@plt>
  mov    $0x0,%eax
  jmp    L468
L422:
  mov    -0x30(%rbp),%eax
  cmp    $0x5c,%eax
  jne    L237
  mov    -0x14(%rbp),%eax
  sub    $0x1,%eax
  cmp    %eax,-0x2c(%rbp)
  jne    L327
  lea    D24(%rip),%rax
  mov    %rax,%rdi
  call   <puts@plt>
  mov    $0x0,%eax
  jmp    L468
L327:
  addl   $0x1,-0x2c(%rbp)
  mov    -0x2c(%rbp),%eax
  movslq %eax,%rdx
  mov    -0x48(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%eax
  cmp    $0x30,%al
  jne    L253
  movb   $0x0,-0x31(%rbp)
  jmp    L356
L253:
  mov    -0x2c(%rbp),%eax
  movslq %eax,%rdx
  mov    -0x48(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%eax
  cmp    $0x6e,%al
  jne    L219
  movb   $0xa,-0x31(%rbp)
  jmp    L356
L219:
  mov    -0x2c(%rbp),%eax
  movslq %eax,%rdx
  mov    -0x48(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%eax
  cmp    $0x72,%al
  jne    L81
  movb   $0xd,-0x31(%rbp)
  jmp    L356
L81:
  mov    -0x2c(%rbp),%eax
  movslq %eax,%rdx
  mov    -0x48(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%eax
  cmp    $0x5c,%al
  jne    L50
  movb   $0x5c,-0x31(%rbp)
  jmp    L356
L50:
  mov    -0x2c(%rbp),%eax
  movslq %eax,%rdx
  mov    -0x48(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%eax
  cmp    $0x22,%al
  jne    L216
  movb   $0x22,-0x31(%rbp)
  jmp    L356
L216:
  mov    -0x14(%rbp),%eax
  sub    $0x3,%eax
  cmp    %eax,-0x2c(%rbp)
  jl     L167
  lea    D24(%rip),%rax
  mov    %rax,%rdi
  call   <puts@plt>
  mov    $0x0,%eax
  jmp    L468
L167:
  movl   $0x0,-0x28(%rbp)
  jmp    L346
L4:
  mov    -0x2c(%rbp),%eax
  movslq %eax,%rdx
  mov    -0x48(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%eax
  mov    %al,-0x31(%rbp)
  addl   $0x1,-0x2c(%rbp)
  cmpb   $0x2f,-0x31(%rbp)
  jle    L107
  cmpb   $0x39,-0x31(%rbp)
  jle    L234
L107:
  lea    D41(%rip),%rax
  mov    %rax,%rdi
  call   <puts@plt>
  mov    $0x0,%eax
  jmp    L468
L234:
  mov    -0x28(%rbp),%eax
  cltq
  movzbl -0x31(%rbp),%edx
  mov    %dl,-0xd(%rbp,%rax,1)
  addl   $0x1,-0x28(%rbp)
L346:
  cmpl   $0x2,-0x28(%rbp)
  jle    L4
  subl   $0x1,-0x2c(%rbp)
  movb   $0x0,-0xa(%rbp)
  lea    -0x30(%rbp),%rdx
  lea    -0xd(%rbp),%rax
  lea    D83(%rip),%rcx
  mov    %rcx,%rsi
  mov    %rax,%rdi
  call   <sscanf@plt>
  cmp    $0x1,%eax
  je     L170
  lea    D41(%rip),%rax
  mov    %rax,%rdi
  call   <puts@plt>
  mov    $0x0,%eax
  jmp    L468
L170:
  mov    -0x30(%rbp),%eax
  mov    %al,-0x31(%rbp)
  jmp    L356
L237:
  mov    -0x30(%rbp),%eax
  mov    %al,-0x31(%rbp)
L356:
  mov    -0x20(%rbp),%eax
  cmp    -0x54(%rbp),%eax
  jne    L204
  lea    D24(%rip),%rax
  mov    %rax,%rdi
  call   <puts@plt>
  mov    $0x0,%eax
  jmp    L468
L204:
  mov    -0x20(%rbp),%eax
  movslq %eax,%rdx
  mov    -0x50(%rbp),%rax
  add    %rax,%rdx
  movzbl -0x31(%rbp),%eax
  mov    %al,(%rdx)
  addl   $0x1,-0x20(%rbp)
L54:
  addl   $0x1,-0x2c(%rbp)
L360:
  mov    -0x2c(%rbp),%eax
  cmp    -0x14(%rbp),%eax
  jle    L423
  jmp    L441
L68:
  nop
L441:
  mov    -0x20(%rbp),%eax
  cmp    -0x54(%rbp),%eax
  jge    L0
  mov    -0x20(%rbp),%eax
  movslq %eax,%rdx
  mov    -0x50(%rbp),%rax
  add    %rdx,%rax
  movb   $0x0,(%rax)
L0:
  mov    $0x1,%eax
L468:
  mov    -0x8(%rbp),%rdx
  sub    %fs:0x28,%rdx
  je     L100
  call   <__stack_chk_fail@plt>
L100:
  leave
  ret
```

tool_calls: name: retrieve_data
arguments: data_label: D9
datatype: string
name: retrieve_data
arguments: data_label: D33
datatype: string
name: retrieve_data
arguments: data_label: D46
datatype: string
name: retrieve_data
arguments: data_label: D24
datatype: string
name: retrieve_data
arguments: data_label: D41
datatype: string
name: retrieve_data
arguments: data_label: D83
datatype: string

tool: D9: load_char_table: Unexpected end of string

tool: D33: load_char_table: Unexpected '"'

tool: D46: load_char_table: Unrecognized character '%c'


tool: D24: load_char_table: String longer than expected

tool: D41: load_char_table: Invalid octal number

tool: D83: %03o

assistant: ```c
int load_char_table(const char *data, char *table, int maxlen) {
  int i, j, startpos;
  char temp[5];
  int val, write, len;
  char ch;
  int start, stop;
  assert(data != NULL);
  assert(table != NULL);
  for (i = 0; i < maxlen; i++) {
    table[i] = '\0';
  }
  write = 0;
  start = 0;
  stop = 0;
  startpos = 0;
  while (data[startpos] == ' ' || data[startpos] == '\t')
    startpos++;
  len = strlen(data) - startpos;
  for (i = startpos; i <= len; i++) {
    val = data[i];
    if (val == '\0') {
      if (start == 1 && stop == 1)
        break;
      printf("load_char_table: Unexpected end of string\n");
      return 0;
    }
    if (val == '"') {
      if (start == 0) {
        start = 1;
        continue;
      } else if (stop == 0) {
        stop = 1;
        continue;
      } else {
        printf("load_char_table: Unexpected '\"'\n");
        return 0;
      }
    } else {
      if (start == 0) {
        printf("load_char_table: Unrecognized "
               "character '%c'\n",
               val);
        return 0;
      }
    }
    if (val == '\\') {
      if (i == len - 1) {
        printf("load_char_table: String longer "
               "than expected\n");
        return 0;
      }
      i++;
      if (data[i] == '0') {
        ch = '\0';
      } else if (data[i] == 'n') {
        ch = '\n';
      } else if (data[i] == 'r') {
        ch = '\r';
      } else if (data[i] == '\\') {
        ch = '\\';
      } else if (data[i] == '"') {
        ch = '"';
      } else {
        if (i >= len - 3) {
          printf("load_char_table: String "
                 "longer than expected\n");
          return 0;
        }
        for (j = 0; j < 3; j++) {
          ch = data[i];
          i++;
          if (ch < '0' || ch > '9') {
            printf("load_char_table: "
                   "Invalid octal "
                   "number\n");
            return 0;
          }
          temp[j] = ch;
        }
        i--;
        temp[3] = '\0';
        if (sscanf(temp, "%03o", &val) != 1) {
          printf("load_char_table: Invalid "
                 "octal number\n");
          return 0;
        }
        ch = val;
      }
    } else {
      ch = val;
    }
    if (write == maxlen) {
      printf("load_char_table: String longer than "
             "expected\n");
      return 0;
    }
    table[write] = ch;
    write++;
  }
  if (write < maxlen) {
    table[write] = '\0';
  }
  return 1;
}
```