user: 请从给定的汇编指令推导出C源代码:

```asm
<main>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x1000,%rsp
  orq    $0x0,(%rsp)
  sub    $0x1000,%rsp
  orq    $0x0,(%rsp)
  sub    $0x620,%rsp
  mov    %edi,-0x2614(%rbp)
  mov    %rsi,-0x2620(%rbp)
  mov    %fs:0x28,%rax
  mov    %rax,-0x8(%rbp)
  xor    %eax,%eax
  movl   $0x1e00,-0x25fc(%rbp)
  cmpl   $0x1,-0x2614(%rbp)
  jg     L2
  mov    $0xa,%edi
  call   <putchar@plt>
  mov    -0x2620(%rbp),%rax
  mov    (%rax),%rax
  mov    %rax,%rsi
  lea    D262(%rip),%rax
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <printf@plt>
  mov    $0xa,%edi
  call   <putchar@plt>
  mov    -0x2620(%rbp),%rax
  mov    (%rax),%rax
  mov    %rax,%rsi
  lea    D581(%rip),%rax
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <printf@plt>
  lea    D621(%rip),%rax
  mov    %rax,%rdi
  call   <puts@plt>
  mov    $0x0,%eax
  jmp    L9
L2:
  mov    -0x25fc(%rbp),%edx
  lea    -0x25e0(%rbp),%rax
  mov    $0x0,%esi
  mov    %rax,%rdi
  call   <memset@plt>
  mov    -0x2620(%rbp),%rax
  add    $0x8,%rax
  mov    (%rax),%rax
  lea    D733(%rip),%rdx
  mov    %rdx,%rsi
  mov    %rax,%rdi
  call   <fopen@plt>
  mov    %rax,-0x25f8(%rbp)
  movl   $0x0,-0x2608(%rbp)
  jmp    L426
L104:
  movl   $0x0,-0x2604(%rbp)
  jmp    L589
L313:
  lea    -0x25e0(%rbp),%rsi
  mov    -0x2604(%rbp),%eax
  cltq
  mov    %rax,%rdx
  shl    $0x2,%rdx
  add    %rax,%rdx
  lea    0x0(,%rdx,4),%rax
  mov    %rax,%rdx
  mov    -0x2608(%rbp),%eax
  movslq %eax,%rcx
  mov    %rcx,%rax
  shl    $0x4,%rax
  sub    %rcx,%rax
  shl    $0x2,%rax
  add    %rdx,%rax
  add    %rsi,%rax
  lea    D292(%rip),%rdx
  mov    %rdx,%rsi
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <sprintf@plt>
  addl   $0x1,-0x2604(%rbp)
L589:
  cmpl   $0x2,-0x2604(%rbp)
  jle    L313
  addl   $0x1,-0x2608(%rbp)
L426:
  cmpl   $0x7f,-0x2608(%rbp)
  jle    L104
  jmp    L396
L185:
  mov    -0x25f8(%rbp),%rdx
  lea    -0x7e0(%rbp),%rax
  mov    $0x190,%esi
  mov    %rax,%rdi
  call   <fgets@plt>
  lea    -0x650(%rbp),%rdx
  lea    -0x7e0(%rbp),%rax
  lea    D664(%rip),%rcx
  mov    %rcx,%rsi
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <sscanf@plt>
  movb   $0x0,-0x330(%rbp)
  movb   $0x0,-0x1a0(%rbp)
  lea    -0x650(%rbp),%rax
  lea    D785(%rip),%rdx
  mov    %rdx,%rsi
  mov    %rax,%rdi
  call   <strcmp@plt>
  test   %rax,%rax
  jne    L41
  lea    -0x330(%rbp),%r8
  lea    -0x4c0(%rbp),%rdi
  lea    -0x260c(%rbp),%rcx
  lea    -0x650(%rbp),%rdx
  lea    -0x7e0(%rbp),%rax
  sub    $0x8,%rsp
  lea    -0x1a0(%rbp),%rsi
  push   %rsi
  mov    %r8,%r9
  mov    %rdi,%r8
  lea    D205(%rip),%rsi
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <sscanf@plt>
  add    $0x10,%rsp
  mov    -0x260c(%rbp),%eax
  lea    -0x25e0(%rbp),%rcx
  movslq %eax,%rdx
  mov    %rdx,%rax
  shl    $0x4,%rax
  sub    %rdx,%rax
  shl    $0x2,%rax
  add    %rax,%rcx
  lea    -0x4c0(%rbp),%rax
  mov    %rax,%rdx
  lea    D444(%rip),%rax
  mov    %rax,%rsi
  mov    %rcx,%rdi
  mov    $0x0,%eax
  call   <sprintf@plt>
  lea    -0x330(%rbp),%rax
  lea    D374(%rip),%rdx
  mov    %rdx,%rsi
  mov    %rax,%rdi
  call   <strcmp@plt>
  test   %rax,%rax
  je     L41
  movzbl -0x330(%rbp),%eax
  test   %al,%al
  je     L41
  mov    -0x260c(%rbp),%eax
  lea    -0x25e0(%rbp),%rcx
  movslq %eax,%rdx
  mov    %rdx,%rax
  shl    $0x4,%rax
  sub    %rdx,%rax
  shl    $0x2,%rax
  add    $0x14,%rax
  add    %rax,%rcx
  lea    -0x330(%rbp),%rax
  mov    %rax,%rdx
  lea    D444(%rip),%rax
  mov    %rax,%rsi
  mov    %rcx,%rdi
  mov    $0x0,%eax
  call   <sprintf@plt>
  lea    -0x1a0(%rbp),%rax
  lea    D374(%rip),%rdx
  mov    %rdx,%rsi
  mov    %rax,%rdi
  call   <strcmp@plt>
  test   %rax,%rax
  je     L41
  movzbl -0x1a0(%rbp),%eax
  test   %al,%al
  je     L41
  mov    -0x260c(%rbp),%eax
  lea    -0x25e0(%rbp),%rcx
  movslq %eax,%rdx
  mov    %rdx,%rax
  shl    $0x4,%rax
  sub    %rdx,%rax
  shl    $0x2,%rax
  add    $0x28,%rax
  add    %rax,%rcx
  lea    -0x1a0(%rbp),%rax
  mov    %rax,%rdx
  lea    D444(%rip),%rax
  mov    %rax,%rsi
  mov    %rcx,%rdi
  mov    $0x0,%eax
  call   <sprintf@plt>
L41:
  lea    -0x650(%rbp),%rax
  lea    D11(%rip),%rdx
  mov    %rdx,%rsi
  mov    %rax,%rdi
  call   <strcmp@plt>
  test   %rax,%rax
  jne    L334
  lea    -0x4c0(%rbp),%rdi
  lea    -0x260c(%rbp),%rsi
  lea    -0x650(%rbp),%rcx
  lea    -0x650(%rbp),%rdx
  lea    -0x7e0(%rbp),%rax
  mov    %rdi,%r9
  mov    %rsi,%r8
  lea    D210(%rip),%rsi
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <sscanf@plt>
  mov    -0x260c(%rbp),%eax
  lea    -0x25e0(%rbp),%rcx
  movslq %eax,%rdx
  mov    %rdx,%rax
  shl    $0x4,%rax
  sub    %rdx,%rax
  shl    $0x2,%rax
  add    %rax,%rcx
  lea    -0x4c0(%rbp),%rax
  mov    %rax,%rdx
  lea    D444(%rip),%rax
  mov    %rax,%rsi
  mov    %rcx,%rdi
  mov    $0x0,%eax
  call   <sprintf@plt>
L334:
  lea    -0x650(%rbp),%rax
  lea    D131(%rip),%rdx
  mov    %rdx,%rsi
  mov    %rax,%rdi
  call   <strcmp@plt>
  test   %rax,%rax
  jne    L513
  lea    -0x4c0(%rbp),%rdi
  lea    -0x260c(%rbp),%rsi
  lea    -0x650(%rbp),%rcx
  lea    -0x650(%rbp),%rdx
  lea    -0x7e0(%rbp),%rax
  mov    %rdi,%r9
  mov    %rsi,%r8
  lea    D210(%rip),%rsi
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <sscanf@plt>
  mov    -0x260c(%rbp),%eax
  lea    -0x25e0(%rbp),%rcx
  movslq %eax,%rdx
  mov    %rdx,%rax
  shl    $0x4,%rax
  sub    %rdx,%rax
  shl    $0x2,%rax
  add    $0x14,%rax
  add    %rax,%rcx
  lea    -0x4c0(%rbp),%rax
  mov    %rax,%rdx
  lea    D444(%rip),%rax
  mov    %rax,%rsi
  mov    %rcx,%rdi
  mov    $0x0,%eax
  call   <sprintf@plt>
L513:
  lea    -0x650(%rbp),%rax
  lea    D553(%rip),%rdx
  mov    %rdx,%rsi
  mov    %rax,%rdi
  call   <strcmp@plt>
  test   %rax,%rax
  jne    L396
  lea    -0x4c0(%rbp),%rdi
  lea    -0x260c(%rbp),%rsi
  lea    -0x650(%rbp),%rcx
  lea    -0x650(%rbp),%rdx
  lea    -0x7e0(%rbp),%rax
  mov    %rdi,%r9
  mov    %rsi,%r8
  lea    D210(%rip),%rsi
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <sscanf@plt>
  mov    -0x260c(%rbp),%eax
  lea    -0x25e0(%rbp),%rcx
  movslq %eax,%rdx
  mov    %rdx,%rax
  shl    $0x4,%rax
  sub    %rdx,%rax
  shl    $0x2,%rax
  add    $0x28,%rax
  add    %rax,%rcx
  lea    -0x4c0(%rbp),%rax
  mov    %rax,%rdx
  lea    D444(%rip),%rax
  mov    %rax,%rsi
  mov    %rcx,%rdi
  mov    $0x0,%eax
  call   <sprintf@plt>
L396:
  mov    -0x25f8(%rbp),%rax
  mov    %rax,%rdi
  call   <feof@plt>
  test   %eax,%eax
  je     L185
  movl   $0x0,-0x2608(%rbp)
  jmp    L160
L166:
  movl   $0x0,-0x2604(%rbp)
  jmp    L488
L499:
  mov    -0x2604(%rbp),%eax
  movslq %eax,%rcx
  mov    -0x2608(%rbp),%eax
  movslq %eax,%rdx
  mov    %rdx,%rax
  shl    $0x4,%rax
  sub    %rdx,%rax
  shl    $0x2,%rax
  add    %rbp,%rax
  add    %rcx,%rax
  sub    $0x25e0,%rax
  movzbl (%rax),%eax
  movsbl %al,%eax
  mov    %eax,%edi
  call   <toupper@plt>
  mov    %eax,%edx
  mov    -0x2604(%rbp),%eax
  movslq %eax,%rsi
  mov    -0x2608(%rbp),%eax
  movslq %eax,%rcx
  mov    %rcx,%rax
  shl    $0x4,%rax
  sub    %rcx,%rax
  shl    $0x2,%rax
  add    %rbp,%rax
  add    %rsi,%rax
  sub    $0x25e0,%rax
  mov    %dl,(%rax)
  addl   $0x1,-0x2604(%rbp)
L488:
  lea    -0x25e0(%rbp),%rcx
  mov    -0x2608(%rbp),%eax
  movslq %eax,%rdx
  mov    %rdx,%rax
  shl    $0x4,%rax
  sub    %rdx,%rax
  shl    $0x2,%rax
  add    %rcx,%rax
  mov    %rax,%rdi
  call   <strlen@plt>
  cmp    %eax,-0x2604(%rbp)
  jl     L499
  movl   $0x0,-0x2604(%rbp)
  jmp    L586
L112:
  mov    -0x2604(%rbp),%eax
  movslq %eax,%rcx
  mov    -0x2608(%rbp),%eax
  movslq %eax,%rdx
  mov    %rdx,%rax
  shl    $0x4,%rax
  sub    %rdx,%rax
  shl    $0x2,%rax
  add    %rbp,%rax
  add    %rcx,%rax
  sub    $0x25cc,%rax
  movzbl (%rax),%eax
  movsbl %al,%eax
  mov    %eax,%edi
  call   <toupper@plt>
  mov    %eax,%edx
  mov    -0x2604(%rbp),%eax
  movslq %eax,%rsi
  mov    -0x2608(%rbp),%eax
  movslq %eax,%rcx
  mov    %rcx,%rax
  shl    $0x4,%rax
  sub    %rcx,%rax
  shl    $0x2,%rax
  add    %rbp,%rax
  add    %rsi,%rax
  sub    $0x25cc,%rax
  mov    %dl,(%rax)
  addl   $0x1,-0x2604(%rbp)
L586:
  lea    -0x25e0(%rbp),%rcx
  mov    -0x2608(%rbp),%eax
  movslq %eax,%rdx
  mov    %rdx,%rax
  shl    $0x4,%rax
  sub    %rdx,%rax
  shl    $0x2,%rax
  add    $0x14,%rax
  add    %rcx,%rax
  mov    %rax,%rdi
  call   <strlen@plt>
  cmp    %eax,-0x2604(%rbp)
  jl     L112
  movl   $0x0,-0x2604(%rbp)
  jmp    L249
L258:
  mov    -0x2604(%rbp),%eax
  movslq %eax,%rcx
  mov    -0x2608(%rbp),%eax
  movslq %eax,%rdx
  mov    %rdx,%rax
  shl    $0x4,%rax
  sub    %rdx,%rax
  shl    $0x2,%rax
  add    %rbp,%rax
  add    %rcx,%rax
  sub    $0x25b8,%rax
  movzbl (%rax),%eax
  movsbl %al,%eax
  mov    %eax,%edi
  call   <toupper@plt>
  mov    %eax,%edx
  mov    -0x2604(%rbp),%eax
  movslq %eax,%rsi
  mov    -0x2608(%rbp),%eax
  movslq %eax,%rcx
  mov    %rcx,%rax
  shl    $0x4,%rax
  sub    %rcx,%rax
  shl    $0x2,%rax
  add    %rbp,%rax
  add    %rsi,%rax
  sub    $0x25b8,%rax
  mov    %dl,(%rax)
  addl   $0x1,-0x2604(%rbp)
L249:
  lea    -0x25e0(%rbp),%rcx
  mov    -0x2608(%rbp),%eax
  movslq %eax,%rdx
  mov    %rdx,%rax
  shl    $0x4,%rax
  sub    %rdx,%rax
  shl    $0x2,%rax
  add    $0x28,%rax
  add    %rcx,%rax
  mov    %rax,%rdi
  call   <strlen@plt>
  cmp    %eax,-0x2604(%rbp)
  jl     L258
  addl   $0x1,-0x2608(%rbp)
L160:
  cmpl   $0x7f,-0x2608(%rbp)
  jle    L166
  movl   $0x41,-0x2604(%rbp)
  jmp    L296
L256:
  mov    -0x2604(%rbp),%edx
  lea    -0x650(%rbp),%rax
  lea    D806(%rip),%rcx
  mov    %rcx,%rsi
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <sprintf@plt>
  movl   $0x0,-0x2608(%rbp)
  jmp    L319
L575:
  lea    -0x25e0(%rbp),%rcx
  mov    -0x2608(%rbp),%eax
  movslq %eax,%rdx
  mov    %rdx,%rax
  shl    $0x4,%rax
  sub    %rdx,%rax
  shl    $0x2,%rax
  lea    (%rcx,%rax,1),%rdx
  lea    -0x650(%rbp),%rax
  mov    %rax,%rsi
  mov    %rdx,%rdi
  call   <strcmp@plt>
  test   %rax,%rax
  jne    L346
  mov    -0x2604(%rbp),%eax
  lea    0x20(%rax),%edx
  lea    -0x25e0(%rbp),%rsi
  mov    -0x2608(%rbp),%eax
  movslq %eax,%rcx
  mov    %rcx,%rax
  shl    $0x4,%rax
  sub    %rcx,%rax
  shl    $0x2,%rax
  add    %rsi,%rax
  lea    D806(%rip),%rcx
  mov    %rcx,%rsi
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <sprintf@plt>
  lea    -0x25e0(%rbp),%rcx
  mov    -0x2608(%rbp),%eax
  movslq %eax,%rdx
  mov    %rdx,%rax
  shl    $0x4,%rax
  sub    %rdx,%rax
  shl    $0x2,%rax
  add    $0x14,%rax
  add    %rax,%rcx
  mov    -0x2604(%rbp),%eax
  mov    %eax,%edx
  lea    D806(%rip),%rax
  mov    %rax,%rsi
  mov    %rcx,%rdi
  mov    $0x0,%eax
  call   <sprintf@plt>
L346:
  addl   $0x1,-0x2608(%rbp)
L319:
  cmpl   $0x7f,-0x2608(%rbp)
  jle    L575
  addl   $0x1,-0x2604(%rbp)
L296:
  cmpl   $0x5a,-0x2604(%rbp)
  jle    L256
  movl   $0x0,-0x2608(%rbp)
  jmp    L406
L217:
  lea    -0x25e0(%rbp),%rcx
  mov    -0x2608(%rbp),%eax
  movslq %eax,%rdx
  mov    %rdx,%rax
  shl    $0x4,%rax
  sub    %rdx,%rax
  shl    $0x2,%rax
  add    %rcx,%rax
  lea    D629(%rip),%rdx
  mov    %rdx,%rsi
  mov    %rax,%rdi
  call   <strcmp@plt>
  test   %rax,%rax
  jne    L402
  lea    -0x25e0(%rbp),%rcx
  mov    -0x2608(%rbp),%eax
  movslq %eax,%rdx
  mov    %rdx,%rax
  shl    $0x4,%rax
  sub    %rdx,%rax
  shl    $0x2,%rax
  add    $0x14,%rax
  add    %rcx,%rax
  lea    D232(%rip),%rdx
  mov    %rdx,%rsi
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <sprintf@plt>
L402:
  lea    -0x25e0(%rbp),%rcx
  mov    -0x2608(%rbp),%eax
  movslq %eax,%rdx
  mov    %rdx,%rax
  shl    $0x4,%rax
  sub    %rdx,%rax
  shl    $0x2,%rax
  add    %rcx,%rax
  lea    D606(%rip),%rdx
  mov    %rdx,%rsi
  mov    %rax,%rdi
  call   <strcmp@plt>
  test   %rax,%rax
  jne    L272
  lea    -0x25e0(%rbp),%rcx
  mov    -0x2608(%rbp),%eax
  movslq %eax,%rdx
  mov    %rdx,%rax
  shl    $0x4,%rax
  sub    %rdx,%rax
  shl    $0x2,%rax
  add    $0x14,%rax
  add    %rcx,%rax
  lea    D116(%rip),%rdx
  mov    %rdx,%rsi
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <sprintf@plt>
L272:
  lea    -0x25e0(%rbp),%rcx
  mov    -0x2608(%rbp),%eax
  movslq %eax,%rdx
  mov    %rdx,%rax
  shl    $0x4,%rax
  sub    %rdx,%rax
  shl    $0x2,%rax
  add    %rcx,%rax
  lea    D466(%rip),%rdx
  mov    %rdx,%rsi
  mov    %rax,%rdi
  call   <strcmp@plt>
  test   %rax,%rax
  jne    L24
  lea    -0x25e0(%rbp),%rcx
  mov    -0x2608(%rbp),%eax
  movslq %eax,%rdx
  mov    %rdx,%rax
  shl    $0x4,%rax
  sub    %rdx,%rax
  shl    $0x2,%rax
  add    $0x14,%rax
  add    %rcx,%rax
  lea    D378(%rip),%rdx
  mov    %rdx,%rsi
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <sprintf@plt>
L24:
  lea    -0x25e0(%rbp),%rcx
  mov    -0x2608(%rbp),%eax
  movslq %eax,%rdx
  mov    %rdx,%rax
  shl    $0x4,%rax
  sub    %rdx,%rax
  shl    $0x2,%rax
  add    %rcx,%rax
  lea    D369(%rip),%rdx
  mov    %rdx,%rsi
  mov    %rax,%rdi
  call   <strcmp@plt>
  test   %rax,%rax
  jne    L28
  lea    -0x25e0(%rbp),%rcx
  mov    -0x2608(%rbp),%eax
  movslq %eax,%rdx
  mov    %rdx,%rax
  shl    $0x4,%rax
  sub    %rdx,%rax
  shl    $0x2,%rax
  add    $0x14,%rax
  add    %rcx,%rax
  lea    D453(%rip),%rdx
  mov    %rdx,%rsi
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <sprintf@plt>
L28:
  lea    -0x25e0(%rbp),%rcx
  mov    -0x2608(%rbp),%eax
  movslq %eax,%rdx
  mov    %rdx,%rax
  shl    $0x4,%rax
  sub    %rdx,%rax
  shl    $0x2,%rax
  add    %rcx,%rax
  lea    D638(%rip),%rdx
  mov    %rdx,%rsi
  mov    %rax,%rdi
  call   <strcmp@plt>
  test   %rax,%rax
  jne    L261
  lea    -0x25e0(%rbp),%rcx
  mov    -0x2608(%rbp),%eax
  movslq %eax,%rdx
  mov    %rdx,%rax
  shl    $0x4,%rax
  sub    %rdx,%rax
  shl    $0x2,%rax
  add    $0x14,%rax
  add    %rcx,%rax
  lea    D465(%rip),%rdx
  mov    %rdx,%rsi
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <sprintf@plt>
L261:
  lea    -0x25e0(%rbp),%rcx
  mov    -0x2608(%rbp),%eax
  movslq %eax,%rdx
  mov    %rdx,%rax
  shl    $0x4,%rax
  sub    %rdx,%rax
  shl    $0x2,%rax
  add    %rcx,%rax
  lea    D566(%rip),%rdx
  mov    %rdx,%rsi
  mov    %rax,%rdi
  call   <strcmp@plt>
  test   %rax,%rax
  jne    L294
  lea    -0x25e0(%rbp),%rcx
  mov    -0x2608(%rbp),%eax
  movslq %eax,%rdx
  mov    %rdx,%rax
  shl    $0x4,%rax
  sub    %rdx,%rax
  shl    $0x2,%rax
  add    $0x14,%rax
  add    %rcx,%rax
  lea    D292(%rip),%rdx
  mov    %rdx,%rsi
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <sprintf@plt>
L294:
  lea    -0x25e0(%rbp),%rcx
  mov    -0x2608(%rbp),%eax
  movslq %eax,%rdx
  mov    %rdx,%rax
  shl    $0x4,%rax
  sub    %rdx,%rax
  shl    $0x2,%rax
  add    %rcx,%rax
  lea    D260(%rip),%rdx
  mov    %rdx,%rsi
  mov    %rax,%rdi
  call   <strcmp@plt>
  test   %rax,%rax
  jne    L209
  lea    -0x25e0(%rbp),%rcx
  mov    -0x2608(%rbp),%eax
  movslq %eax,%rdx
  mov    %rdx,%rax
  shl    $0x4,%rax
  sub    %rdx,%rax
  shl    $0x2,%rax
  add    $0x14,%rax
  add    %rcx,%rax
  lea    D373(%rip),%rdx
  mov    %rdx,%rsi
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <sprintf@plt>
L209:
  lea    -0x25e0(%rbp),%rcx
  mov    -0x2608(%rbp),%eax
  movslq %eax,%rdx
  mov    %rdx,%rax
  shl    $0x4,%rax
  sub    %rdx,%rax
  shl    $0x2,%rax
  add    %rcx,%rax
  lea    D649(%rip),%rdx
  mov    %rdx,%rsi
  mov    %rax,%rdi
  call   <strcmp@plt>
  test   %rax,%rax
  jne    L382
  lea    -0x25e0(%rbp),%rcx
  mov    -0x2608(%rbp),%eax
  movslq %eax,%rdx
  mov    %rdx,%rax
  shl    $0x4,%rax
  sub    %rdx,%rax
  shl    $0x2,%rax
  add    $0x14,%rax
  add    %rcx,%rax
  lea    D428(%rip),%rdx
  mov    %rdx,%rsi
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <sprintf@plt>
L382:
  lea    -0x25e0(%rbp),%rcx
  mov    -0x2608(%rbp),%eax
  movslq %eax,%rdx
  mov    %rdx,%rax
  shl    $0x4,%rax
  sub    %rdx,%rax
  shl    $0x2,%rax
  add    %rcx,%rax
  lea    D101(%rip),%rdx
  mov    %rdx,%rsi
  mov    %rax,%rdi
  call   <strcmp@plt>
  test   %rax,%rax
  jne    L459
  lea    -0x25e0(%rbp),%rcx
  mov    -0x2608(%rbp),%eax
  movslq %eax,%rdx
  mov    %rdx,%rax
  shl    $0x4,%rax
  sub    %rdx,%rax
  shl    $0x2,%rax
  add    $0x14,%rax
  add    %rcx,%rax
  lea    D460(%rip),%rdx
  mov    %rdx,%rsi
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <sprintf@plt>
L459:
  lea    -0x25e0(%rbp),%rcx
  mov    -0x2608(%rbp),%eax
  movslq %eax,%rdx
  mov    %rdx,%rax
  shl    $0x4,%rax
  sub    %rdx,%rax
  shl    $0x2,%rax
  add    %rcx,%rax
  lea    D715(%rip),%rdx
  mov    %rdx,%rsi
  mov    %rax,%rdi
  call   <strcmp@plt>
  test   %rax,%rax
  jne    L5
  lea    -0x25e0(%rbp),%rcx
  mov    -0x2608(%rbp),%eax
  movslq %eax,%rdx
  mov    %rdx,%rax
  shl    $0x4,%rax
  sub    %rdx,%rax
  shl    $0x2,%rax
  add    $0x14,%rax
  add    %rcx,%rax
  lea    D5(%rip),%rdx
  mov    %rdx,%rsi
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <sprintf@plt>
L5:
  lea    -0x25e0(%rbp),%rcx
  mov    -0x2608(%rbp),%eax
  movslq %eax,%rdx
  mov    %rdx,%rax
  shl    $0x4,%rax
  sub    %rdx,%rax
  shl    $0x2,%rax
  add    %rcx,%rax
  lea    D724(%rip),%rdx
  mov    %rdx,%rsi
  mov    %rax,%rdi
  call   <strcmp@plt>
  test   %rax,%rax
  jne    L598
  lea    -0x25e0(%rbp),%rcx
  mov    -0x2608(%rbp),%eax
  movslq %eax,%rdx
  mov    %rdx,%rax
  shl    $0x4,%rax
  sub    %rdx,%rax
  shl    $0x2,%rax
  add    $0x14,%rax
  add    %rcx,%rax
  lea    D32(%rip),%rdx
  mov    %rdx,%rsi
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <sprintf@plt>
L598:
  addl   $0x1,-0x2608(%rbp)
L406:
  cmpl   $0x7f,-0x2608(%rbp)
  jle    L217
  mov    $0x80,%esi
  lea    D474(%rip),%rax
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <printf@plt>
  mov    $0x14,%esi
  lea    D486(%rip),%rax
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <printf@plt>
  mov    $0x0,%esi
  lea    D763(%rip),%rax
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <printf@plt>
  mov    $0x1,%esi
  lea    D69(%rip),%rax
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <printf@plt>
  mov    $0x2,%esi
  lea    D554(%rip),%rax
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <printf@plt>
  mov    $0x3,%esi
  lea    D729(%rip),%rax
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <printf@plt>
  mov    $0xa,%edi
  call   <putchar@plt>
  lea    D665(%rip),%rax
  mov    %rax,%rdi
  call   <puts@plt>
  movl   $0x0,-0x2600(%rbp)
  movl   $0x0,-0x2604(%rbp)
  jmp    L454
L330:
  cmpl   $0x2,-0x2604(%rbp)
  je     L620
  cmpl   $0x2,-0x2604(%rbp)
  jg     L376
  cmpl   $0x0,-0x2604(%rbp)
  je     L442
  cmpl   $0x1,-0x2604(%rbp)
  je     L391
  jmp    L376
L442:
  lea    D545(%rip),%rax
  mov    %rax,%rdi
  call   <puts@plt>
  jmp    L376
L391:
  lea    D221(%rip),%rax
  mov    %rax,%rdi
  call   <puts@plt>
  jmp    L376
L620:
  lea    D691(%rip),%rax
  mov    %rax,%rdi
  call   <puts@plt>
  nop
L376:
  movl   $0x0,-0x2608(%rbp)
  jmp    L205
L455:
  lea    -0x25e0(%rbp),%rsi
  mov    -0x2604(%rbp),%eax
  cltq
  mov    %rax,%rdx
  shl    $0x2,%rdx
  add    %rax,%rdx
  lea    0x0(,%rdx,4),%rax
  mov    %rax,%rdx
  mov    -0x2608(%rbp),%eax
  movslq %eax,%rcx
  mov    %rcx,%rax
  shl    $0x4,%rax
  sub    %rcx,%rax
  shl    $0x2,%rax
  add    %rdx,%rax
  add    %rsi,%rax
  mov    %rax,%rdi
  call   <strlen@plt>
  mov    %eax,%esi
  mov    $0x1,%edi
  call   <calloc@plt>
  mov    %rax,-0x25e8(%rbp)
  lea    -0x25e0(%rbp),%rsi
  mov    -0x2604(%rbp),%eax
  cltq
  mov    %rax,%rdx
  shl    $0x2,%rdx
  add    %rax,%rdx
  lea    0x0(,%rdx,4),%rax
  mov    %rax,%rdx
  mov    -0x2608(%rbp),%eax
  movslq %eax,%rcx
  mov    %rcx,%rax
  shl    $0x4,%rax
  sub    %rcx,%rax
  shl    $0x2,%rax
  add    %rdx,%rax
  add    %rsi,%rax
  lea    0x1(%rax),%rdx
  mov    -0x25e8(%rbp),%rax
  lea    D664(%rip),%rcx
  mov    %rcx,%rsi
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <sprintf@plt>
  mov    -0x25e8(%rbp),%rax
  mov    %rax,%rdi
  call   <strlen@plt>
  cltq
  lea    -0x1(%rax),%rdx
  mov    -0x25e8(%rbp),%rax
  add    %rdx,%rax
  movb   $0x0,(%rax)
  mov    -0x25e8(%rbp),%rax
  mov    %rax,%rdi
  call   <strlen@plt>
  test   %eax,%eax
  jle    L325
  mov    -0x2600(%rbp),%eax
  lea    0x1(%rax),%edx
  mov    %edx,-0x2600(%rbp)
  mov    -0x25e8(%rbp),%rdx
  mov    %eax,%esi
  lea    D539(%rip),%rax
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <printf@plt>
L325:
  mov    -0x25e8(%rbp),%rax
  mov    %rax,%rdi
  call   <free@plt>
  addl   $0x1,-0x2608(%rbp)
L205:
  cmpl   $0x7f,-0x2608(%rbp)
  jle    L455
  addl   $0x1,-0x2604(%rbp)
L454:
  cmpl   $0x2,-0x2604(%rbp)
  jle    L330
  mov    -0x2600(%rbp),%eax
  mov    %eax,%esi
  lea    D152(%rip),%rax
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <printf@plt>
  lea    D257(%rip),%rax
  mov    %rax,%rdi
  call   <puts@plt>
  mov    $0xa,%edi
  call   <putchar@plt>
  lea    D676(%rip),%rax
  mov    %rax,%rdi
  call   <puts@plt>
  lea    D47(%rip),%r8
  lea    D181(%rip),%rax
  mov    %rax,%rcx
  lea    D290(%rip),%rax
  mov    %rax,%rdx
  lea    D184(%rip),%rax
  mov    %rax,%rsi
  lea    D245(%rip),%rax
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <printf@plt>
  movl   $0x0,-0x2608(%rbp)
  jmp    L298
L523:
  mov    -0x2608(%rbp),%eax
  mov    %eax,%esi
  lea    D777(%rip),%rax
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <printf@plt>
  movl   $0x0,-0x2604(%rbp)
  jmp    L100
L411:
  lea    -0x25e0(%rbp),%rsi
  mov    -0x2604(%rbp),%eax
  cltq
  mov    %rax,%rdx
  shl    $0x2,%rdx
  add    %rax,%rdx
  lea    0x0(,%rdx,4),%rax
  mov    %rax,%rdx
  mov    -0x2608(%rbp),%eax
  movslq %eax,%rcx
  mov    %rcx,%rax
  shl    $0x4,%rax
  sub    %rcx,%rax
  shl    $0x2,%rax
  add    %rdx,%rax
  add    %rsi,%rax
  mov    %rax,%rdi
  call   <strlen@plt>
  mov    %eax,%esi
  mov    $0x1,%edi
  call   <calloc@plt>
  mov    %rax,-0x25f0(%rbp)
  lea    -0x25e0(%rbp),%rsi
  mov    -0x2604(%rbp),%eax
  cltq
  mov    %rax,%rdx
  shl    $0x2,%rdx
  add    %rax,%rdx
  lea    0x0(,%rdx,4),%rax
  mov    %rax,%rdx
  mov    -0x2608(%rbp),%eax
  movslq %eax,%rcx
  mov    %rcx,%rax
  shl    $0x4,%rax
  sub    %rcx,%rax
  shl    $0x2,%rax
  add    %rdx,%rax
  add    %rsi,%rax
  lea    0x1(%rax),%rdx
  mov    -0x25f0(%rbp),%rax
  lea    D664(%rip),%rcx
  mov    %rcx,%rsi
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <sprintf@plt>
  mov    -0x25f0(%rbp),%rax
  mov    %rax,%rdi
  call   <strlen@plt>
  cltq
  lea    -0x1(%rax),%rdx
  mov    -0x25f0(%rbp),%rax
  add    %rdx,%rax
  movb   $0x0,(%rax)
  mov    -0x25f0(%rbp),%rax
  mov    %rax,%rdi
  call   <strlen@plt>
  test   %eax,%eax
  jle    L32
  mov    -0x25f0(%rbp),%rax
  mov    %rax,%rsi
  lea    D320(%rip),%rax
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <printf@plt>
  jmp    L427
L32:
  lea    D62(%rip),%rax
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <printf@plt>
L427:
  cmpl   $0x1,-0x2604(%rbp)
  jg     L548
  lea    D4(%rip),%rax
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <printf@plt>
L548:
  mov    -0x25f0(%rbp),%rax
  mov    %rax,%rdi
  call   <free@plt>
  addl   $0x1,-0x2604(%rbp)
L100:
  cmpl   $0x2,-0x2604(%rbp)
  jle    L411
  lea    D368(%rip),%rax
  mov    %rax,%rdi
  call   <puts@plt>
  addl   $0x1,-0x2608(%rbp)
L298:
  cmpl   $0x7f,-0x2608(%rbp)
  jle    L523
  lea    D521(%rip),%rax
  mov    %rax,%rdi
  call   <puts@plt>
  mov    $0xa,%edi
  call   <putchar@plt>
  lea    D458(%rip),%rax
  mov    %rax,%rdi
  call   <puts@plt>
  lea    D47(%rip),%r8
  lea    D181(%rip),%rax
  mov    %rax,%rcx
  lea    D290(%rip),%rax
  mov    %rax,%rdx
  lea    D184(%rip),%rax
  mov    %rax,%rsi
  lea    D245(%rip),%rax
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <printf@plt>
  movl   $0x0,-0x2608(%rbp)
  jmp    L102
L339:
  lea    -0x25e0(%rbp),%rcx
  mov    -0x2608(%rbp),%eax
  movslq %eax,%rdx
  mov    %rdx,%rax
  shl    $0x4,%rax
  sub    %rdx,%rax
  shl    $0x2,%rax
  add    $0x28,%rax
  lea    (%rcx,%rax,1),%rsi
  lea    -0x25e0(%rbp),%rcx
  mov    -0x2608(%rbp),%eax
  movslq %eax,%rdx
  mov    %rdx,%rax
  shl    $0x4,%rax
  sub    %rdx,%rax
  shl    $0x2,%rax
  add    $0x14,%rax
  add    %rax,%rcx
  lea    -0x25e0(%rbp),%rdi
  mov    -0x2608(%rbp),%eax
  movslq %eax,%rdx
  mov    %rdx,%rax
  shl    $0x4,%rax
  sub    %rdx,%rax
  shl    $0x2,%rax
  lea    (%rdi,%rax,1),%rdx
  mov    -0x2608(%rbp),%eax
  mov    %rsi,%r8
  mov    %eax,%esi
  lea    D149(%rip),%rax
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <printf@plt>
  addl   $0x1,-0x2608(%rbp)
L102:
  cmpl   $0x7f,-0x2608(%rbp)
  jle    L339
  lea    D521(%rip),%rax
  mov    %rax,%rdi
  call   <puts@plt>
  mov    $0x0,%eax
L9:
  mov    -0x8(%rbp),%rdx
  sub    %fs:0x28,%rdx
  je     L588
  call   <__stack_chk_fail@plt>
L588:
  leave
  ret
```

tool_calls: name: parse_data
arguments: data_tag: D262
type_guessed: string
name: parse_data
arguments: data_tag: D581
type_guessed: string
name: parse_data
arguments: data_tag: D621
type_guessed: string
name: parse_data
arguments: data_tag: D733
type_guessed: string
name: parse_data
arguments: data_tag: D292
type_guessed: string
name: parse_data
arguments: data_tag: D664
type_guessed: string
name: parse_data
arguments: data_tag: D785
type_guessed: string
name: parse_data
arguments: data_tag: D205
type_guessed: string
name: parse_data
arguments: data_tag: D444
type_guessed: string
name: parse_data
arguments: data_tag: D374
type_guessed: string
name: parse_data
arguments: data_tag: D11
type_guessed: string
name: parse_data
arguments: data_tag: D210
type_guessed: string
name: parse_data
arguments: data_tag: D131
type_guessed: string
name: parse_data
arguments: data_tag: D553
type_guessed: string
name: parse_data
arguments: data_tag: D806
type_guessed: string
name: parse_data
arguments: data_tag: D629
type_guessed: string
name: parse_data
arguments: data_tag: D232
type_guessed: string
name: parse_data
arguments: data_tag: D606
type_guessed: string
name: parse_data
arguments: data_tag: D116
type_guessed: string
name: parse_data
arguments: data_tag: D466
type_guessed: string
name: parse_data
arguments: data_tag: D378
type_guessed: string
name: parse_data
arguments: data_tag: D369
type_guessed: string
name: parse_data
arguments: data_tag: D453
type_guessed: string
name: parse_data
arguments: data_tag: D638
type_guessed: string
name: parse_data
arguments: data_tag: D465
type_guessed: string
name: parse_data
arguments: data_tag: D566
type_guessed: string
name: parse_data
arguments: data_tag: D260
type_guessed: string
name: parse_data
arguments: data_tag: D373
type_guessed: string
name: parse_data
arguments: data_tag: D649
type_guessed: string
name: parse_data
arguments: data_tag: D428
type_guessed: string
name: parse_data
arguments: data_tag: D101
type_guessed: string
name: parse_data
arguments: data_tag: D460
type_guessed: string
name: parse_data
arguments: data_tag: D715
type_guessed: string
name: parse_data
arguments: data_tag: D5
type_guessed: string
name: parse_data
arguments: data_tag: D724
type_guessed: string
name: parse_data
arguments: data_tag: D32
type_guessed: string
name: parse_data
arguments: data_tag: D474
type_guessed: string
name: parse_data
arguments: data_tag: D486
type_guessed: string
name: parse_data
arguments: data_tag: D763
type_guessed: string
name: parse_data
arguments: data_tag: D69
type_guessed: string
name: parse_data
arguments: data_tag: D554
type_guessed: string
name: parse_data
arguments: data_tag: D729
type_guessed: string
name: parse_data
arguments: data_tag: D665
type_guessed: string
name: parse_data
arguments: data_tag: D545
type_guessed: string
name: parse_data
arguments: data_tag: D221
type_guessed: string
name: parse_data
arguments: data_tag: D691
type_guessed: string
name: parse_data
arguments: data_tag: D539
type_guessed: string
name: parse_data
arguments: data_tag: D152
type_guessed: string
name: parse_data
arguments: data_tag: D257
type_guessed: string
name: parse_data
arguments: data_tag: D676
type_guessed: string
name: parse_data
arguments: data_tag: D47
type_guessed: string
name: parse_data
arguments: data_tag: D181
type_guessed: string
name: parse_data
arguments: data_tag: D290
type_guessed: string
name: parse_data
arguments: data_tag: D184
type_guessed: string
name: parse_data
arguments: data_tag: D245
type_guessed: string
name: parse_data
arguments: data_tag: D777
type_guessed: string
name: parse_data
arguments: data_tag: D320
type_guessed: string
name: parse_data
arguments: data_tag: D62
type_guessed: string
name: parse_data
arguments: data_tag: D4
type_guessed: string
name: parse_data
arguments: data_tag: D368
type_guessed: string
name: parse_data
arguments: data_tag: D521
type_guessed: string
name: parse_data
arguments: data_tag: D458
type_guessed: string
name: parse_data
arguments: data_tag: D149
type_guessed: string

tool: D262: %s is to prepare a hader file from a map file.


tool: D581: Ex:
	mkdir kbdmap
	files included in the us.map.gz are;
		compose.latin1
		euro1.map
		linux-keys-bare.inc
		linux-with-alt-and-altgr.inc
		qwerty-layout.inc
	copy all_of_them_and_the_us.map.gz to kbdmap
	gunzip us.map.gz
	cat * > usmap
	%s usmap > usmap.h



tool: D621: Alper Akcan, distchx@yahoo.com


tool: D733: rt

tool: D292: ""

tool: D664: %s

tool: D785: keycode

tool: D205: %s %d = %s %s %s

tool: D444: "%s"

tool: D374: #

tool: D11: plain

tool: D210: %s %s %d = %s

tool: D131: shift

tool: D553: altgr

tool: D806: "%c"

tool: D629: "KP_0"

tool: D232: "INSERT"

tool: D606: "KP_1"

tool: D116: "END"

tool: D466: "KP_2"

tool: D378: "DOWN"

tool: D369: "KP_3"

tool: D453: "PAGEDOWN"

tool: D638: "KP_4"

tool: D465: "LEFT"

tool: D566: "KP_5"

tool: D260: "KP_6"

tool: D373: "RIGHT"

tool: D649: "KP_7"

tool: D428: "HOME"

tool: D101: "KP_8"

tool: D460: "UP"

tool: D715: "KP_9"

tool: D5: "PAGEUP"

tool: D724: "KP_PERIOD"

tool: D32: "REMOVE"

tool: D474: #define KEYCODE_KEYS	%d


tool: D486: #define KEYCODE_MAXNAMELEN	%d


tool: D763: #define KEYCODE_PLAIN	%d


tool: D69: #define KEYCODE_SHIFT	%d


tool: D554: #define KEYCODE_ALTGR	%d


tool: D729: #define KEYCODE_FLAGS	%d


tool: D665: typedef enum {

tool: D545: /* Plain */

tool: D221: /* Shift */

tool: D691: /* ALTGR */

tool: D539: /* %3d */  XYNTHK_%s,


tool: D152: /* %3d */  XYNTHK_CODES


tool: D257: } XYNTHK_CODE;

tool: D676: static XYNTHK_CODE kbd_keycodes_[KEYCODE_KEYS][KEYCODE_FLAGS][KEYCODE_MACNAMELEN] = {

tool: D47: altgr name 

tool: D181: shift name,

tool: D290: plain name,

tool: D184: keycode,

tool: D245: /*%10s %18s %18s %17s*/


tool: D777: /* %3d */  {

tool: D320: XYNTHK_%s

tool: D62: XYNTH_NOCODE

tool: D4: ,	

tool: D368: },

tool: D521: };

tool: D458: static char kbd_keycodes[KEYCODE_KEYS][KEYCODE_FLAGS][KEYCODE_MAXNAMELEN] = {

tool: D149: /* %3d */  {%18s,%18s,%18s},


assistant: ```c
int main(int argc, char *argv[]) {
  int i;
  int j;
  int k;
  FILE *mapfile;
  char codenames[128][3][20];
  int size = sizeof(codenames);
  char buf[400];
  char buf1[400];
  char buf2[400];
  char buf3[400];
  char buf4[400];
  int int1;
  if (argc < 2) {
    printf("\n");
    printf("%s is to prepare a hader file from a map file.\n", argv[0]);
    printf("\n");
    printf("Ex:\n"
           "\tmkdir kbdmap\n"
           "\tfiles included in the us.map.gz are;\n"
           "\t\tcompose.latin1\n"
           "\t\teuro1.map\n"
           "\t\tlinux-keys-bare.inc\n"
           "\t\tlinux-with-alt-and-altgr.inc\n"
           "\t\tqwerty-layout.inc\n"
           "\tcopy all_of_them_and_the_us.map.gz to kbdmap\n"
           "\tgunzip us.map.gz\n"
           "\tcat * > usmap\n"
           "\t%s usmap > usmap.h\n\n",
           argv[0]);
    printf("Alper Akcan, distchx@yahoo.com\n\n");
    return 0;
  }
  memset(codenames, 0, size);
  mapfile = fopen(argv[1], "rt");
  for (i = 0; i < 128; i++) {
    for (j = 0; j < 3; j++) {
      sprintf(codenames[i][j], "\"\"");
    }
  }
  while (!feof(mapfile)) {
    fgets(buf, 400, mapfile);
    sscanf(buf, "%s", buf1);
    buf3[0] = '\0';
    buf4[0] = '\0';
    if (strcmp(buf1, "keycode") == 0) {
      sscanf(buf, "%s %d = %s %s %s", buf1, &int1, buf2, buf3, buf4);
      sprintf(codenames[int1][0], "\"%s\"", buf2);
      if ((strcmp(buf3, "#") != 0) && (buf3[0] != '\0')) {
        sprintf(codenames[int1][1], "\"%s\"", buf3);
        if ((strcmp(buf4, "#") != 0) && (buf4[0] != '\0')) {
          sprintf(codenames[int1][2], "\"%s\"", buf4);
        }
      }
    }
    if (strcmp(buf1, "plain") == 0) {
      sscanf(buf, "%s %s %d = %s", buf1, buf1, &int1, buf2);
      sprintf(codenames[int1][0], "\"%s\"", buf2);
    }
    if (strcmp(buf1, "shift") == 0) {
      sscanf(buf, "%s %s %d = %s", buf1, buf1, &int1, buf2);
      sprintf(codenames[int1][1], "\"%s\"", buf2);
    }
    if (strcmp(buf1, "altgr") == 0) {
      sscanf(buf, "%s %s %d = %s", buf1, buf1, &int1, buf2);
      sprintf(codenames[int1][2], "\"%s\"", buf2);
    }
  }
  for (i = 0; i < 128; i++) {
    for (j = 0; j < strlen(codenames[i][0]); j++) {
      codenames[i][0][j] = toupper(codenames[i][0][j]);
    }
    for (j = 0; j < strlen(codenames[i][1]); j++) {
      codenames[i][1][j] = toupper(codenames[i][1][j]);
    }
    for (j = 0; j < strlen(codenames[i][2]); j++) {
      codenames[i][2][j] = toupper(codenames[i][2][j]);
    }
  }
  for (j = 65; j < 91; j++) {
    sprintf(buf1, "\"%c\"", j);
    for (i = 0; i < 128; i++) {
      if (strcmp(codenames[i][0], buf1) == 0) {
        sprintf(codenames[i][0], "\"%c\"", j + 32);
        sprintf(codenames[i][1], "\"%c\"", j);
      }
    }
  }
  for (i = 0; i < 128; i++) {
    if (strcmp(codenames[i][0], "\"KP_0\"") == 0) {
      sprintf(codenames[i][1], "\"INSERT\"");
    }
    if (strcmp(codenames[i][0], "\"KP_1\"") == 0) {
      sprintf(codenames[i][1], "\"END\"");
    }
    if (strcmp(codenames[i][0], "\"KP_2\"") == 0) {
      sprintf(codenames[i][1], "\"DOWN\"");
    }
    if (strcmp(codenames[i][0], "\"KP_3\"") == 0) {
      sprintf(codenames[i][1], "\"PAGEDOWN\"");
    }
    if (strcmp(codenames[i][0], "\"KP_4\"") == 0) {
      sprintf(codenames[i][1], "\"LEFT\"");
    }
    if (strcmp(codenames[i][0], "\"KP_5\"") == 0) {
      sprintf(codenames[i][1], "\"\"");
    }
    if (strcmp(codenames[i][0], "\"KP_6\"") == 0) {
      sprintf(codenames[i][1], "\"RIGHT\"");
    }
    if (strcmp(codenames[i][0], "\"KP_7\"") == 0) {
      sprintf(codenames[i][1], "\"HOME\"");
    }
    if (strcmp(codenames[i][0], "\"KP_8\"") == 0) {
      sprintf(codenames[i][1], "\"UP\"");
    }
    if (strcmp(codenames[i][0], "\"KP_9\"") == 0) {
      sprintf(codenames[i][1], "\"PAGEUP\"");
    }
    if (strcmp(codenames[i][0], "\"KP_PERIOD\"") == 0) {
      sprintf(codenames[i][1], "\"REMOVE\"");
    }
  }
  printf("#define KEYCODE_KEYS\t%d\n", 128);
  printf("#define KEYCODE_MAXNAMELEN\t%d\n", 20);
  printf("#define KEYCODE_PLAIN\t%d\n", 0);
  printf("#define KEYCODE_SHIFT\t%d\n", 1);
  printf("#define KEYCODE_ALTGR\t%d\n", 2);
  printf("#define KEYCODE_FLAGS\t%d\n", 3);
  printf("\n");
  printf("typedef enum {\n");
  k = 0;
  for (j = 0; j < 3; j++) {
    switch (j) {
    case 0:
      printf("/* Plain */\n");
      break;
    case 1:
      printf("/* Shift */\n");
      break;
    case 2:
      printf("/* ALTGR */\n");
      break;
    }
    for (i = 0; i < 128; i++) {
      char *name;
      name = (char *)calloc(sizeof(char), strlen(codenames[i][j]));
      sprintf(name, "%s", codenames[i][j] + 1);
      name[strlen(name) - 1] = '\0';
      if (strlen(name) > 0) {
        printf("/* %3d */  XYNTHK_%s,\n", k++, name);
      }
      free(name);
    }
  }
  printf("/* %3d */  XYNTHK_CODES\n", k);
  printf("} XYNTHK_CODE;\n");
  printf("\n");
  printf("static XYNTHK_CODE kbd_keycodes_[KEYCODE_KEYS][KEYCODE_FLAGS][KEYCODE_MACNAMELEN] = {\n");
  printf("/*%10s %18s %18s %17s*/\n", "keycode,", "plain name,", "shift name,", "altgr name ");
  for (i = 0; i < 128; i++) {
    printf("/* %3d */  {", i);
    for (j = 0; j < 3; j++) {
      char *name;
      name = (char *)calloc(sizeof(char), strlen(codenames[i][j]));
      sprintf(name, "%s", codenames[i][j] + 1);
      name[strlen(name) - 1] = '\0';
      if (strlen(name) > 0) {
        printf("XYNTHK_%s", name);
      } else {
        printf("XYNTH_NOCODE");
      }
      if (j < 2) {
        printf(",\t");
      }
      free(name);
    }
    printf("},\n");
  }
  printf("};\n");
  printf("\n");
  printf("static char kbd_keycodes[KEYCODE_KEYS][KEYCODE_FLAGS][KEYCODE_MAXNAMELEN] = {\n");
  printf("/*%10s %18s %18s %17s*/\n", "keycode,", "plain name,", "shift name,", "altgr name ");
  for (i = 0; i < 128; i++) {
    printf("/* %3d */  {%18s,%18s,%18s},\n", i, codenames[i][0], codenames[i][1], codenames[i][2]);
  }
  printf("};\n");
  return 0;
}
```