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

```asm
<handle_jis>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  lea    -0x8000(%rsp),%r11
L63:
  sub    $0x1000,%rsp
  orq    $0x0,(%rsp)
  cmp    %r11,%rsp
  jne    L63
  sub    $0xff0,%rsp
  mov    %rdi,-0x8fe8(%rbp)
  mov    %esi,-0x8fec(%rbp)
  mov    %fs:0x28,%rax
  mov    %rax,-0x8(%rbp)
  xor    %eax,%eax
  cmpl   $0x0,-0x8fec(%rbp)
  je     L58
  lea    D31(%rip),%rax
  jmp    L187
L58:
  lea    D4(%rip),%rax
L187:
  mov    %rax,-0x8fa8(%rbp)
  lea    -0x8e20(%rbp),%rax
  mov    $0x8a10,%edx
  mov    $0x0,%esi
  mov    %rax,%rdi
  call   <memset@plt>
  lea    -0x8fa0(%rbp),%rax
  mov    $0x178,%edx
  mov    $0x0,%esi
  mov    %rax,%rdi
  call   <memset@plt>
  movl   $0x0,-0x8fd8(%rbp)
  movl   $0x0,-0x8fd4(%rbp)
  movl   $0x0,-0x8fc8(%rbp)
L213:
  mov    -0x8fe8(%rbp),%rdx
  lea    -0x410(%rbp),%rax
  mov    $0x400,%esi
  mov    %rax,%rdi
  call   <getline@plt>
  test   %eax,%eax
  je     L115
  movzbl -0x410(%rbp),%eax
  test   %al,%al
  je     L137
  movzbl -0x410(%rbp),%eax
  cmp    $0x23,%al
  je     L137
  lea    -0x410(%rbp),%rax
  mov    %rax,-0x8fb0(%rbp)
  cmpl   $0x0,-0x8fec(%rbp)
  je     L79
  mov    -0x8fb0(%rbp),%rax
  lea    -0x8fb0(%rbp),%rcx
  mov    $0x0,%edx
  mov    %rcx,%rsi
  mov    %rax,%rdi
  call   <strtol@plt>
  mov    %eax,-0x8fc0(%rbp)
L79:
  mov    -0x8fb0(%rbp),%rax
  lea    -0x8fb0(%rbp),%rcx
  mov    $0x0,%edx
  mov    %rcx,%rsi
  mov    %rax,%rdi
  call   <strtol@plt>
  mov    %eax,-0x8fc0(%rbp)
  mov    -0x8fb0(%rbp),%rax
  lea    -0x8fb0(%rbp),%rcx
  mov    $0x0,%edx
  mov    %rcx,%rsi
  mov    %rax,%rdi
  call   <strtol@plt>
  mov    %eax,-0x8fbc(%rbp)
  mov    -0x8fc0(%rbp),%eax
  sar    $0x8,%eax
  and    $0xff,%eax
  mov    %eax,-0x8fb8(%rbp)
  mov    -0x8fc0(%rbp),%eax
  movzbl %al,%eax
  mov    %eax,-0x8fb4(%rbp)
  subl   $0x21,-0x8fb8(%rbp)
  subl   $0x21,-0x8fb4(%rbp)
  mov    -0x8fb8(%rbp),%eax
  cmp    -0x8fd8(%rbp),%eax
  jle    L182
  mov    -0x8fb8(%rbp),%eax
  mov    %eax,-0x8fd8(%rbp)
L182:
  mov    -0x8fb4(%rbp),%eax
  cmp    -0x8fd4(%rbp),%eax
  jle    L234
  mov    -0x8fb4(%rbp),%eax
  mov    %eax,-0x8fd4(%rbp)
L234:
  mov    -0x8fb8(%rbp),%eax
  cltq
  mov    -0x8fa0(%rbp,%rax,4),%eax
  cmp    %eax,-0x8fb4(%rbp)
  jle    L172
  mov    -0x8fb8(%rbp),%eax
  cltq
  mov    -0x8fb4(%rbp),%edx
  mov    %edx,-0x8fa0(%rbp,%rax,4)
L172:
  mov    -0x8fb8(%rbp),%eax
  imul   $0x5e,%eax,%edx
  mov    -0x8fb4(%rbp),%eax
  add    %edx,%eax
  cltq
  mov    -0x8fbc(%rbp),%edx
  mov    %edx,-0x8e20(%rbp,%rax,4)
  addl   $0x1,-0x8fc8(%rbp)
  jmp    L213
L137:
  nop
  jmp    L213
L115:
  nop
  mov    -0x8fd8(%rbp),%eax
  mov    %eax,%esi
  lea    D15(%rip),%rax
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <printf@plt>
  movl   $0x0,-0x8fc4(%rbp)
  movl   $0x0,-0x8fd0(%rbp)
  jmp    L220
L158:
  mov    -0x8fd0(%rbp),%eax
  cltq
  mov    -0x8fa0(%rbp,%rax,4),%eax
  test   %eax,%eax
  jne    L131
  mov    -0x8fd0(%rbp),%eax
  mov    %eax,%esi
  lea    D76(%rip),%rax
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <printf@plt>
  jmp    L39
L131:
  addl   $0x1,-0x8fc4(%rbp)
L39:
  addl   $0x1,-0x8fd0(%rbp)
L220:
  mov    -0x8fd0(%rbp),%eax
  cmp    -0x8fd8(%rbp),%eax
  jle    L158
  mov    -0x8fc8(%rbp),%eax
  imul   $0x64,%eax,%eax
  mov    -0x8fd4(%rbp),%edx
  add    $0x1,%edx
  mov    %edx,%ecx
  imul   -0x8fc4(%rbp),%ecx
  cltd
  idiv   %ecx
  mov    %eax,%esi
  lea    D29(%rip),%rax
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <printf@plt>
  mov    -0x8fd4(%rbp),%eax
  add    $0x1,%eax
  imul   -0x8fc4(%rbp),%eax
  mov    %eax,%edx
  mov    -0x8fa8(%rbp),%rax
  mov    %rax,%rsi
  lea    D26(%rip),%rax
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <printf@plt>
  movl   $0x0,-0x8fc4(%rbp)
  movl   $0x0,-0x8fd0(%rbp)
  jmp    L171
L126:
  mov    -0x8fd0(%rbp),%eax
  cltq
  mov    -0x8fa0(%rbp,%rax,4),%eax
  test   %eax,%eax
  je     L52
  movl   $0x0,-0x8fcc(%rbp)
  jmp    L142
L111:
  mov    -0x8fd0(%rbp),%eax
  imul   $0x5e,%eax,%edx
  mov    -0x8fcc(%rbp),%eax
  add    %edx,%eax
  cltq
  mov    -0x8e20(%rbp,%rax,4),%eax
  mov    %eax,%esi
  lea    D72(%rip),%rax
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <printf@plt>
  mov    -0x8fc4(%rbp),%eax
  lea    0x1(%rax),%edx
  mov    %edx,-0x8fc4(%rbp)
  and    $0x7,%eax
  cmp    $0x7,%eax
  jne    L166
  mov    $0xa,%edi
  call   <putchar@plt>
L166:
  addl   $0x1,-0x8fcc(%rbp)
L142:
  mov    -0x8fcc(%rbp),%eax
  cmp    -0x8fd4(%rbp),%eax
  jle    L111
L52:
  addl   $0x1,-0x8fd0(%rbp)
L171:
  mov    -0x8fd0(%rbp),%eax
  cmp    -0x8fd8(%rbp),%eax
  jle    L126
  mov    -0x8fc4(%rbp),%eax
  and    $0x7,%eax
  test   %eax,%eax
  je     L24
  mov    $0xa,%edi
  call   <putchar@plt>
L24:
  lea    D52(%rip),%rax
  mov    %rax,%rdi
  call   <puts@plt>
  nop
  mov    -0x8(%rbp),%rax
  sub    %fs:0x28,%rax
  je     L98
  call   <__stack_chk_fail@plt>
L98:
  leave
  ret
```

tool_calls: name: parse_data
arguments: label: D31
type: string
name: parse_data
arguments: label: D4
type: string
name: parse_data
arguments: label: D15
type: string
name: parse_data
arguments: label: D76
type: string
name: parse_data
arguments: label: D29
type: string
name: parse_data
arguments: label: D26
type: string
name: parse_data
arguments: label: D72
type: string
name: parse_data
arguments: label: D52
type: string

tool: D31: jis208

tool: D4: jis212

tool: D15: /* max row = %d. The following rows are excluded:

tool: D76:  %d

tool: D29: , density=%d%% */


tool: D26: const unsigned short table_%s[%d] = {


tool: D72: 0x%04x, 

tool: D52: };


assistant: ```c
void handle_jis(FILE *f, int is_jis208) {
  int c1, c2, b1, b2, b1_max, b2_max, i, j, nb, n;
  int table[94 * 94];
  int table_b2_max[94];
  char line[1024];
  const char *p;
  const char *name = is_jis208 ? "jis208" : "jis212";
  memset(table, 0, sizeof(table));
  memset(table_b2_max, 0, sizeof(table_b2_max));
  b1_max = 0;
  b2_max = 0;
  nb = 0;
  for (;;) {
    if (!getline(line, sizeof(line), f))
      break;
    if (line[0] == '\0' || line[0] == '#')
      continue;
    p = line;
    if (is_jis208)
      c1 = strtol(p, (char **)&p, 0);
    c1 = strtol(p, (char **)&p, 0);
    c2 = strtol(p, (char **)&p, 0);
    b1 = (c1 >> 8) & 0xff;
    b2 = (c1)&0xff;
    b1 = b1 - 0x21;
    b2 = b2 - 0x21;
    if (b1 > b1_max)
      b1_max = b1;
    if (b2 > b2_max)
      b2_max = b2;
    if (b2 > table_b2_max[b1])
      table_b2_max[b1] = b2;
    table[b1 * 94 + b2] = c2;
    nb++;
  }
  printf("/* max row = %d. The following rows are excluded:", b1_max);
  n = 0;
  for (i = 0; i <= b1_max; i++) {
    if (table_b2_max[i] == 0) {
      printf(" %d", i);
    } else {
      n++;
    }
  }
  printf(", density=%d%% */\n", nb * 100 / (n * (b2_max + 1)));
  printf("const unsigned short table_%s[%d] = {\n", name, n * (b2_max + 1));
  n = 0;
  for (i = 0; i <= b1_max; i++) {
    if (table_b2_max[i] != 0) {
      for (j = 0; j <= b2_max; j++) {
        printf("0x%04x, ", table[i * 94 + j]);
        if ((n++ & 7) == 7)
          printf("\n");
      }
    }
  }
  if ((n & 7) != 0)
    printf("\n");
  printf("};\n\n");
}
```