user: Translate the below assembly code into C programming language:

```asm
<handle_jis>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  lea    -0x8000(%rsp),%r11
L43:
  sub    $0x1000,%rsp
  orq    $0x0,(%rsp)
  cmp    %r11,%rsp
  jne    L43
  sub    $0xfd8,%rsp
  mov    %rdi,0x8(%rsp)
  mov    %esi,0x14(%rsp)
  mov    %fs:0x28,%rax
  mov    %rax,0x8fc8(%rsp)
  xor    %eax,%eax
  test   %esi,%esi
  lea    D70(%rip),%rdx
  lea    D46(%rip),%rax
  cmovne %rdx,%rax
  mov    %rax,0x18(%rsp)
  lea    0x1b0(%rsp),%rdi
  mov    $0x8a10,%edx
  mov    $0x0,%esi
  call   <memset@plt>
  lea    0x30(%rsp),%rdi
  mov    $0x178,%edx
  mov    $0x0,%esi
  call   <memset@plt>
  mov    $0x0,%ebp
  mov    $0x0,%r12d
  mov    $0x0,%r13d
  lea    0x8bc0(%rsp),%r14
  jmp    L28
L76:
  lea    0x28(%rsp),%rsi
  mov    $0x0,%edx
  mov    %r14,%rdi
  call   <strtol@plt>
  jmp    L171
L217:
  imul   $0x5e,%eax,%eax
  add    %ebx,%eax
  cltq
  mov    %edx,0x1b0(%rsp,%rax,4)
  add    $0x1,%ebp
L28:
  mov    0x8(%rsp),%rdx
  mov    $0x400,%esi
  mov    %r14,%rdi
  call   <getline@plt>
  mov    %eax,%ebx
  test   %eax,%eax
  je     L1
  movzbl 0x8bc0(%rsp),%eax
  test   %al,%al
  je     L28
  cmp    $0x23,%al
  je     L28
  mov    %r14,0x28(%rsp)
  cmpl   $0x0,0x14(%rsp)
  jne    L76
L171:
  lea    0x28(%rsp),%r15
  mov    $0x0,%edx
  mov    %r15,%rsi
  mov    0x28(%rsp),%rdi
  call   <strtol@plt>
  mov    %eax,%ebx
  mov    $0x0,%edx
  mov    %r15,%rsi
  mov    0x28(%rsp),%rdi
  call   <strtol@plt>
  mov    %eax,%edx
  movzbl %bh,%eax
  movzbl %bl,%ebx
  sub    $0x21,%eax
  sub    $0x21,%ebx
  cmp    %eax,%r13d
  cmovl  %eax,%r13d
  cmp    %ebx,%r12d
  cmovl  %ebx,%r12d
  movslq %eax,%rcx
  cmp    %ebx,0x30(%rsp,%rcx,4)
  jge    L217
  mov    %ebx,0x30(%rsp,%rcx,4)
  jmp    L217
L1:
  mov    %r13d,%esi
  lea    D12(%rip),%rdi
  mov    $0x0,%eax
  call   <printf@plt>
  test   %r13d,%r13d
  js     L146
  mov    %ebx,%r15d
  mov    $0x0,%r14d
  jmp    L248
L14:
  lea    D88(%rip),%rdi
  mov    $0x0,%eax
  call   <printf@plt>
L74:
  add    $0x1,%r14
  cmp    %r14d,%r13d
  jl     L94
L248:
  mov    %r14d,%esi
  cmpl   $0x0,0x30(%rsp,%r14,4)
  je     L14
  add    $0x1,%r15d
  jmp    L74
L49:
  add    $0x1,%rbp
  cmp    %ebp,%r12d
  jl     L207
L201:
  mov    (%r14,%rbp,4),%esi
  lea    D22(%rip),%rdi
  mov    $0x0,%eax
  call   <printf@plt>
  mov    %ebx,%eax
  add    $0x1,%ebx
  and    $0x7,%eax
  cmp    $0x7,%eax
  jne    L49
  mov    $0xa,%edi
  call   <putchar@plt>
  jmp    L49
L207:
  add    $0x1,%r15
  add    $0x178,%r14
  cmp    %r15d,%r13d
  jl     L137
L7:
  cmpl   $0x0,0x30(%rsp,%r15,4)
  je     L207
  test   %r12d,%r12d
  js     L207
  mov    $0x0,%ebp
  jmp    L201
L137:
  test   $0x7,%bl
  jne    L231
L246:
  lea    D79(%rip),%rdi
  call   <puts@plt>
  mov    0x8fc8(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L8
  add    $0x8fd8,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
L231:
  mov    $0xa,%edi
  call   <putchar@plt>
  jmp    L246
L146:
  imul   $0x64,%ebp,%eax
  mov    $0x0,%ecx
  cltd
  idiv   %ecx
  mov    %eax,%esi
  lea    D6(%rip),%rdi
  mov    $0x0,%eax
  call   <printf@plt>
  mov    $0x0,%edx
  mov    0x18(%rsp),%rsi
  lea    D10(%rip),%rdi
  mov    $0x0,%eax
  call   <printf@plt>
  jmp    L246
L94:
  lea    0x1(%r12),%r14d
  imul   %r15d,%r14d
  imul   $0x64,%ebp,%eax
  cltd
  idiv   %r14d
  mov    %eax,%esi
  lea    D6(%rip),%rdi
  mov    $0x0,%eax
  call   <printf@plt>
  mov    %r14d,%edx
  mov    0x18(%rsp),%rsi
  lea    D10(%rip),%rdi
  mov    $0x0,%eax
  call   <printf@plt>
  lea    0x1b0(%rsp),%r14
  mov    $0x0,%r15d
  jmp    L7
L8:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: unpack_data
arguments: tag: D70
datatype: string
name: unpack_data
arguments: tag: D46
datatype: string
name: unpack_data
arguments: tag: D12
datatype: string
name: unpack_data
arguments: tag: D88
datatype: string
name: unpack_data
arguments: tag: D22
datatype: string
name: unpack_data
arguments: tag: D79
datatype: string
name: unpack_data
arguments: tag: D6
datatype: string
name: unpack_data
arguments: tag: D10
datatype: string

tool: D70: jis208

tool: D46: jis212

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

tool: D88:  %d

tool: D22: 0x%04x, 

tool: D79: };


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


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


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