user: What would the C source look like for the assembly code provided here:

```asm
<handle_jis>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  lea    -0x8000(%rsp),%r11
L163:
  sub    $0x1000,%rsp
  orq    $0x0,(%rsp)
  cmp    %r11,%rsp
  jne    L163
  sub    $0xfe8,%rsp
  lea    D49(%rip),%rdx
  mov    %fs:0x28,%rax
  mov    %rax,0x8fd8(%rsp)
  mov    %esi,%eax
  mov    %rdi,%r15
  mov    %esi,%r13d
  lea    0x8bd0(%rsp),%rbp
  lea    0x38(%rsp),%r14
  test   %eax,%eax
  lea    D77(%rip),%rax
  cmovne %rdx,%rax
  mov    $0x8a10,%edx
  xor    %esi,%esi
  xor    %r12d,%r12d
  mov    %rax,0x18(%rsp)
  lea    0x1c0(%rsp),%rax
  mov    %rax,%rdi
  mov    %rax,0x28(%rsp)
  call   <memset@plt>
  lea    0x40(%rsp),%rax
  mov    $0x178,%edx
  xor    %esi,%esi
  mov    %rax,%rdi
  mov    %rax,0x8(%rsp)
  call   <memset@plt>
  movl   $0x0,0x10(%rsp)
  movl   $0x0,0x20(%rsp)
  nopl   (%rax)
L184:
  mov    %r15,%rdx
  mov    $0x400,%esi
  mov    %rbp,%rdi
  call   <getline@plt>
  mov    %eax,%ebx
  test   %eax,%eax
  je     L144
  movzbl 0x8bd0(%rsp),%eax
  test   %al,%al
  je     L184
  cmp    $0x23,%al
  je     L184
  mov    %rbp,0x38(%rsp)
  mov    %rbp,%rdi
  test   %r13d,%r13d
  jne    L84
L159:
  xor    %edx,%edx
  mov    %r14,%rsi
  call   <strtol@plt>
  mov    0x38(%rsp),%rdi
  xor    %edx,%edx
  mov    %r14,%rsi
  mov    %eax,%ebx
  call   <strtol@plt>
  movzbl %bh,%edx
  sub    $0x21,%edx
  mov    %eax,%ecx
  movzbl %bl,%eax
  mov    0x20(%rsp),%ebx
  sub    $0x21,%eax
  cmp    %edx,%r12d
  movslq %edx,%rsi
  cmovl  %edx,%r12d
  cmp    %eax,%ebx
  cmovl  %eax,%ebx
  mov    %ebx,0x20(%rsp)
  cmp    %eax,0x40(%rsp,%rsi,4)
  jge    L119
  mov    %eax,0x40(%rsp,%rsi,4)
L119:
  imul   $0x5e,%edx,%edx
  addl   $0x1,0x10(%rsp)
  add    %eax,%edx
  movslq %edx,%rdx
  mov    %ecx,0x1c0(%rsp,%rdx,4)
  jmp    L184
  nopw   0x0(%rax,%rax,1)
L84:
  xor    %edx,%edx
  mov    %r14,%rsi
  call   <strtol@plt>
  mov    0x38(%rsp),%rdi
  jmp    L159
  nopl   0x0(%rax)
L144:
  mov    %r12d,%esi
  lea    0x1(%r12),%r13d
  xor    %eax,%eax
  xor    %r14d,%r14d
  lea    D5(%rip),%rdi
  movslq %r13d,%r15
  xor    %ebp,%ebp
  call   <printf@plt>
  lea    D57(%rip),%r12
  jmp    L181
  nopw   0x0(%rax,%rax,1)
L207:
  add    $0x1,%rbp
  add    $0x1,%r14d
  cmp    %rbp,%r15
  je     L123
L181:
  mov    0x8(%rsp),%rax
  mov    %ebp,%esi
  mov    (%rax,%rbp,4),%edx
  test   %edx,%edx
  jne    L207
  mov    %r12,%rdi
  xor    %eax,%eax
  add    $0x1,%rbp
  call   <printf@plt>
  cmp    %rbp,%r15
  jne    L181
L123:
  mov    0x20(%rsp),%eax
  lea    D35(%rip),%rdi
  xor    %r12d,%r12d
  lea    D45(%rip),%r15
  add    $0x1,%eax
  imul   %eax,%r14d
  mov    %eax,0x24(%rsp)
  imul   $0x64,0x10(%rsp),%eax
  cltd
  idiv   %r14d
  mov    %eax,%esi
  xor    %eax,%eax
  call   <printf@plt>
  mov    0x18(%rsp),%rsi
  mov    %r14d,%edx
  xor    %eax,%eax
  lea    D71(%rip),%rdi
  call   <printf@plt>
  mov    0x28(%rsp),%rax
  mov    0x8(%rsp),%rbp
  mov    %rax,0x10(%rsp)
  imul   $0x5e,%r13d,%eax
  mov    %eax,0x18(%rsp)
  jmp    L64
  nop
L37:
  addq   $0x178,0x10(%rsp)
  add    $0x4,%rbp
  add    $0x5e,%r12d
  cmp    %r12d,0x18(%rsp)
  je     L92
L64:
  mov    0x0(%rbp),%eax
  test   %eax,%eax
  je     L37
  mov    0x24(%rsp),%eax
  mov    0x10(%rsp),%r13
  mov    %ebx,%r14d
  add    %ebx,%eax
  mov    %eax,0x8(%rsp)
  jmp    L71
  nopl   0x0(%rax,%rax,1)
L52:
  add    $0x4,%r13
  cmp    %r14d,0x8(%rsp)
  je     L201
L71:
  mov    0x0(%r13),%esi
  mov    %r15,%rdi
  xor    %eax,%eax
  call   <printf@plt>
  mov    %r14d,%eax
  add    $0x1,%r14d
  and    $0x7,%eax
  cmp    $0x7,%eax
  jne    L52
  mov    $0xa,%edi
  add    $0x4,%r13
  call   <putchar@plt>
  cmp    %r14d,0x8(%rsp)
  jne    L71
L201:
  mov    0x20(%rsp),%eax
  lea    0x1(%rax,%rbx,1),%ebx
  jmp    L37
  nop
L92:
  and    $0x7,%ebx
  jne    L28
L30:
  lea    D53(%rip),%rdi
  call   <puts@plt>
  mov    0x8fd8(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L160
  add    $0x8fe8,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
  cs nopw 0x0(%rax,%rax,1)
L28:
  mov    $0xa,%edi
  call   <putchar@plt>
  jmp    L30
L160:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: retrieve_data
arguments: data_tag: D49
data_type: string
name: retrieve_data
arguments: data_tag: D77
data_type: string
name: retrieve_data
arguments: data_tag: D5
data_type: string
name: retrieve_data
arguments: data_tag: D57
data_type: string
name: retrieve_data
arguments: data_tag: D35
data_type: string
name: retrieve_data
arguments: data_tag: D45
data_type: string
name: retrieve_data
arguments: data_tag: D71
data_type: string
name: retrieve_data
arguments: data_tag: D53
data_type: string

tool: D49: jis208

tool: D77: jis212

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

tool: D57:  %d

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


tool: D45: 0x%04x, 

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


tool: D53: };


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