user: 请显示与下面列出的汇编代码相匹配的C语言实现：

```asm
<main>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x1000,%rsp
  orq    $0x0,(%rsp)
  sub    $0x518,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,0x1508(%rsp)
  xor    %eax,%eax
  cmp    $0x3,%edi
  jle    L528
  mov    0x8(%rsi),%rdi
  mov    %rsi,%r15
  lea    D660(%rip),%rsi
  xor    %r13d,%r13d
  lea    0x1240(%rsp),%rbp
  lea    0x240(%rsp),%r12
  call   <fopen@plt>
  mov    %rax,%rbx
  test   %rax,%rax
  jne    L610
  jmp    L1248
L503:
  mov    %rbp,%rdi
  call   <RemoveLineEndings@plt>
  mov    %rbp,%rdi
  call   <strlen@plt>
  cmp    $0x1f,%eax
  jg     L450
  movl   $0x0,0x40(%rsp,%r13,4)
  mov    %r13,%rdi
  mov    %rbp,%rsi
  add    $0x1,%r13
  shl    $0x5,%rdi
  add    %r12,%rdi
  call   <strcpy@plt>
L610:
  mov    %rbx,%rdx
  mov    $0x2bc,%esi
  mov    %rbp,%rdi
  mov    %r13d,%r14d
  call   <fgets@plt>
  test   %rax,%rax
  jne    L503
  mov    0x10(%r15),%rdi
  lea    D660(%rip),%rsi
  call   <fopen@plt>
  mov    %rax,0x10(%rsp)
  test   %rax,%rax
  je     L629
  mov    0x18(%r15),%rdi
  lea    D489(%rip),%rsi
  call   <fopen@plt>
  mov    %rax,0x28(%rsp)
  test   %rax,%rax
  je     L323
  movl   $0x1,0x20(%rsp)
  mov    0x28(%rsp),%r15
  movl   $0x1,0x24(%rsp)
  movl   $0x0,0x34(%rsp)
  movl   $0x0,0x30(%rsp)
  mov    %r13,0x38(%rsp)
  cs nopw 0x0(%rax,%rax,1)
L170:
  mov    0x10(%rsp),%rdx
  mov    $0x2bc,%esi
  mov    %rbp,%rdi
  call   <fgets@plt>
  test   %rax,%rax
  je     L1113
  mov    %rbp,%rdi
  call   <RemoveLineEndings@plt>
  movzbl 0x1240(%rsp),%eax
  test   %al,%al
  je     L170
  cmp    $0x3a,%al
  je     L202
  cmp    $0x60,%al
  je     L1009
  cmp    $0x3f,%al
  jne    L994
L1009:
  mov    $0x20,%esi
  mov    %rbp,%rdi
  call   <strchr@plt>
  mov    %rax,%r12
  test   %rax,%rax
  je     L240
  movb   $0x0,(%rax)
  add    $0x1,%r12
L240:
  cmpw   $0x6c6e,0x1241(%rsp)
  lea    0x1241(%rsp),%r13
  je     L923
L798:
  lea    D209(%rip),%rsi
  mov    %r13,%rdi
  call   <strcmp@plt>
  test   %eax,%eax
  je     L897
  lea    D420(%rip),%rsi
  mov    %r13,%rdi
  call   <strcmp@plt>
  test   %eax,%eax
  je     L765
  lea    D478(%rip),%rsi
  mov    %r13,%rdi
  call   <strcmp@plt>
  test   %eax,%eax
  je     L1229
  lea    D424(%rip),%rsi
  mov    %r13,%rdi
  call   <strcmp@plt>
  test   %eax,%eax
  je     L1154
  lea    D104(%rip),%rsi
  mov    %r13,%rdi
  call   <strcmp@plt>
  test   %eax,%eax
  je     L392
  lea    D709(%rip),%rsi
  mov    %r13,%rdi
  call   <strcmp@plt>
  test   %eax,%eax
  je     L366
  lea    D768(%rip),%rsi
  mov    %r13,%rdi
  call   <strcmp@plt>
  test   %eax,%eax
  je     L1247
  lea    D849(%rip),%rsi
  mov    %r13,%rdi
  call   <strcmp@plt>
  test   %eax,%eax
  je     L1260
  lea    D872(%rip),%rsi
  mov    %r13,%rdi
  call   <strcmp@plt>
  test   %eax,%eax
  je     L1100
  lea    D433(%rip),%rsi
  mov    %r13,%rdi
  call   <strcmp@plt>
  test   %eax,%eax
  je     L1000
  lea    D853(%rip),%rsi
  mov    %r13,%rdi
  call   <strcmp@plt>
  test   %eax,%eax
  je     L268
  lea    D703(%rip),%rsi
  mov    %r13,%rdi
  call   <strcmp@plt>
  test   %eax,%eax
  je     L343
  lea    D463(%rip),%rsi
  mov    %r13,%rdi
  call   <strcmp@plt>
  test   %eax,%eax
  je     L91
  lea    D225(%rip),%rsi
  mov    %r13,%rdi
  call   <strcmp@plt>
  test   %eax,%eax
  je     L479
  lea    D321(%rip),%rsi
  mov    %r13,%rdi
  call   <strcmp@plt>
  test   %eax,%eax
  je     L712
  lea    D295(%rip),%rsi
  mov    %r13,%rdi
  call   <strcmp@plt>
  test   %eax,%eax
  je     L719
  lea    D118(%rip),%rsi
  mov    %r13,%rdi
  call   <strcmp@plt>
  test   %eax,%eax
  je     L558
  lea    D310(%rip),%rsi
  mov    %r13,%rdi
  call   <strcmp@plt>
  test   %eax,%eax
  je     L504
  lea    D793(%rip),%rsi
  mov    %r13,%rdi
  call   <strcmp@plt>
  test   %eax,%eax
  jne    L876
  mov    %r15,%rcx
  mov    $0x10,%edx
  mov    $0x1,%esi
  lea    D538(%rip),%rdi
  call   <fwrite@plt>
  jmp    L876
L528:
  lea    D795(%rip),%rdi
  call   <puts@plt>
  xor    %eax,%eax
L1191:
  mov    0x1508(%rsp),%rdx
  sub    %fs:0x28,%rdx
  jne    L362
  add    $0x1518,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
L450:
  lea    D336(%rip),%rdi
  call   <puts@plt>
  or     $0xffffffff,%eax
  jmp    L1191
L994:
  mov    %rbp,%rdx
  lea    D658(%rip),%rsi
  mov    %r15,%rdi
  xor    %eax,%eax
  call   <fprintf@plt>
  movzbl 0x1240(%rsp),%eax
  cmp    $0x3e,%al
  je     L848
  cmp    $0x5b,%al
  je     L502
  cmp    $0x3c,%al
  je     L316
  cmpl   $0x0,0x24(%rsp)
  jne    L818
  mov    %r15,%rcx
  mov    $0x5,%edx
  mov    $0x1,%esi
  xor    %r12d,%r12d
  lea    D330(%rip),%rdi
  mov    %rbp,%rbx
  call   <fwrite@plt>
  jmp    L534
L202:
  lea    0x1241(%rsp),%rdi
  mov    %r15,%rsi
  call   <fputs@plt>
L1266:
  cmpb   $0x0,0x1240(%rsp)
  je     L170
  mov    %r15,%rcx
  mov    $0x2,%edx
  mov    $0x1,%esi
  lea    D2(%rip),%rdi
  call   <fwrite@plt>
  jmp    L170
L923:
  cmpb   $0x0,0x1243(%rsp)
  jne    L798
  mov    %r15,%rcx
  mov    $0x11,%edx
  mov    $0x1,%esi
  lea    D578(%rip),%rdi
  call   <fwrite@plt>
L876:
  cmpw   $0x6e6f,0x1241(%rsp)
  je     L1210
L99:
  mov    $0x1,%eax
L539:
  cmpb   $0x3f,0x1240(%rsp)
  je     L1199
  test   %eax,%eax
  je     L526
L204:
  lea    D864(%rip),%rsi
  mov    %r13,%rdi
  call   <strcmp@plt>
  test   %eax,%eax
  je     L938
L790:
  lea    D548(%rip),%rsi
  mov    %r13,%rdi
  call   <strcmp@plt>
  test   %eax,%eax
  jne    L1266
  mov    %r12,%rdx
  lea    D316(%rip),%rsi
  mov    %r15,%rdi
  call   <fprintf@plt>
  jmp    L1266
L1113:
  mov    0x10(%rsp),%rdi
  mov    0x38(%rsp),%r13
  call   <fclose@plt>
  mov    0x28(%rsp),%r15
  mov    $0x17,%edx
  mov    $0x1,%esi
  lea    D67(%rip),%rdi
  mov    %r15,%rcx
  call   <fwrite@plt>
  test   %r14d,%r14d
  je     L1070
  xor    %ecx,%ecx
  mov    %r14d,0x38(%rsp)
  xor    %ebx,%ebx
  lea    0x40(%rsp),%rbp
  lea    0x240(%rsp),%rax
  mov    %r13,0x18(%rsp)
  mov    %r15,%r14
  mov    %ecx,%r13d
  movl   $0x0,0x10(%rsp)
  mov    %rax,0x8(%rsp)
  jmp    L683
  xchg   %ax,%ax
L123:
  mov    %r12,%rdx
  lea    D382(%rip),%rsi
  mov    %r14,%rdi
  xor    %eax,%eax
  call   <fprintf@plt>
  add    $0x1,%rbx
  cmp    0x18(%rsp),%rbx
  je     L93
L683:
  mov    0x8(%rsp),%rax
  mov    %rbx,%r8
  shl    $0x5,%r8
  lea    (%rax,%r8,1),%r12
  mov    %r12,%rdi
  call   <strlen@plt>
  mov    %r12,%rdi
  add    %eax,0x10(%rsp)
  call   <strlen@plt>
  mov    %r12,%rdi
  mov    %eax,%r9d
  mov    0x0(%rbp,%rbx,4),%eax
  sub    $0x1,%eax
  imul   %r9d,%eax
  lea    -0x1(%r13,%rax,1),%r13d
  call   <strlen@plt>
  add    %r12,%rax
  movsbl -0x1(%rax),%ecx
  movb   $0x0,-0x1(%rax)
  mov    0x20(%rsp),%eax
  test   %eax,%eax
  je     L123
  mov    %ebx,%edx
  lea    D747(%rip),%rsi
  mov    %r14,%rdi
  xor    %eax,%eax
  mov    %cl,0x24(%rsp)
  call   <fprintf@plt>
  movsbl 0x24(%rsp),%ecx
  jmp    L123
L93:
  mov    0x30(%rsp),%r12d
  mov    0x38(%rsp),%r14d
  mov    %r13d,0x18(%rsp)
  sub    %r13d,%r12d
  cmpl   $0x0,0x20(%rsp)
  jne    L134
  mov    0x28(%rsp),%rdi
  call   <fclose@plt>
  mov    0x30(%rsp),%ebx
  pxor   %xmm0,%xmm0
  mov    %r14d,%esi
  pxor   %xmm1,%xmm1
  cvtsi2ss %r12d,%xmm0
  mov    0x10(%rsp),%edx
  xor    %eax,%eax
  cvtsi2ss %ebx,%xmm1
  mov    0x18(%rsp),%ecx
  lea    D566(%rip),%rdi
  divss  %xmm1,%xmm0
  movss  %xmm0,0x20(%rsp)
  call   <printf@plt>
  movss  0x20(%rsp),%xmm0
  mov    %r12d,%edx
  mov    %ebx,%esi
  mulss  D377(%rip),%xmm0
  cvtss2sd %xmm0,%xmm0
L561:
  lea    D657(%rip),%rdi
  mov    $0x1,%eax
  xor    %ebx,%ebx
  call   <printf@plt>
  mov    0x34(%rsp),%esi
  xor    %eax,%eax
  lea    D714(%rip),%rdi
  lea    D332(%rip),%r12
  call   <printf@plt>
  mov    0x8(%rsp),%r13
  nopl   0x0(%rax)
L927:
  mov    %rbx,%rsi
  mov    0x0(%rbp,%rbx,4),%edx
  mov    %r12,%rdi
  xor    %eax,%eax
  shl    $0x5,%rsi
  add    $0x1,%rbx
  add    %r13,%rsi
  call   <printf@plt>
  cmp    %ebx,%r14d
  jg     L927
L789:
  mov    $0xa,%edi
  call   <putchar@plt>
  xor    %eax,%eax
  jmp    L1191
L502:
  mov    $0x5d,%esi
  mov    %rbp,%rdi
  call   <strchr@plt>
  lea    0x1241(%rsp),%rdx
  lea    D167(%rip),%rsi
  mov    %r15,%rdi
  movb   $0x0,(%rax)
  lea    0x1(%rax),%rbx
  cmpb   $0x0,0x1241(%rsp)
  lea    D817(%rip),%rax
  cmove  %rax,%rdx
  xor    %eax,%eax
  call   <fprintf@plt>
  addl   $0x2,0x34(%rsp)
L463:
  cmpl   $0x0,0x24(%rsp)
  je     L342
  cmp    %rbp,%rbx
  je     L818
L415:
  movl   $0x0,0x8(%rsp)
  mov    %rbx,%r13
  mov    %rbx,0x18(%rsp)
L351:
  movzbl 0x0(%r13),%eax
  test   %al,%al
  je     L113
  add    $0x1,%r13
  cmp    $0x20,%al
  je     L1246
L23:
  movzbl -0x1(%r13),%eax
  cmp    $0xa,%al
  je     L351
  movsbl %al,%edi
  call   <CharWidth@plt>
  add    %eax,0x8(%rsp)
  jmp    L351
L316:
  mov    $0x3e,%esi
  mov    %rbp,%rdi
  call   <strchr@plt>
  lea    0x1243(%rsp),%rcx
  lea    D736(%rip),%rsi
  mov    %r15,%rdi
  movb   $0x0,(%rax)
  movsbl 0x1241(%rsp),%edx
  lea    0x1(%rax),%rbx
  xor    %eax,%eax
  call   <fprintf@plt>
  addl   $0x2,0x34(%rsp)
  jmp    L463
L1229:
  mov    %r15,%rcx
  mov    $0x11,%edx
  mov    $0x1,%esi
  lea    D666(%rip),%rdi
  call   <fwrite@plt>
  jmp    L876
L848:
  mov    $0x3c,%esi
  mov    %rbp,%rdi
  call   <strchr@plt>
  lea    0x1243(%rsp),%rcx
  lea    D267(%rip),%rsi
  mov    %r15,%rdi
  movb   $0x0,(%rax)
  movsbl 0x1241(%rsp),%edx
  lea    0x1(%rax),%rbx
  xor    %eax,%eax
  call   <fprintf@plt>
  addl   $0x2,0x34(%rsp)
  jmp    L463
L134:
  mov    0x28(%rsp),%r15
  mov    $0x1c,%edx
  mov    $0x1,%esi
  xor    %ebx,%ebx
  lea    D114(%rip),%rdi
  lea    D843(%rip),%r13
  mov    %r15,%rcx
  call   <fwrite@plt>
L491:
  mov    %ebx,%edx
  mov    %r13,%rsi
  mov    %r15,%rdi
  xor    %eax,%eax
  call   <fprintf@plt>
  mov    %ebx,%eax
  add    $0x1,%ebx
  cmp    %ebx,%r14d
  jne    L491
  xor    %r13d,%r13d
  mov    %r14d,0x20(%rsp)
  mov    0x28(%rsp),%r14
  lea    D702(%rip),%r15
  mov    %ebx,0x24(%rsp)
  mov    %r13d,%ebx
  mov    %eax,%r13d
L242:
  mov    %ebx,%edx
  mov    %r15,%rsi
  mov    %r14,%rdi
  xor    %eax,%eax
  call   <fprintf@plt>
  mov    %ebx,%eax
  add    $0x1,%ebx
  cmp    %r13d,%eax
  jne    L242
  mov    0x28(%rsp),%rdi
  mov    0x24(%rsp),%ebx
  mov    0x20(%rsp),%r14d
  call   <fclose@plt>
  mov    0x30(%rsp),%r15d
  pxor   %xmm0,%xmm0
  mov    %ebx,%esi
  pxor   %xmm1,%xmm1
  cvtsi2ss %r12d,%xmm0
  mov    0x10(%rsp),%edx
  xor    %eax,%eax
  cvtsi2ss %r15d,%xmm1
  mov    0x18(%rsp),%ecx
  lea    D566(%rip),%rdi
  divss  %xmm1,%xmm0
  movss  %xmm0,0x20(%rsp)
  call   <printf@plt>
  movss  0x20(%rsp),%xmm0
  mov    %r12d,%edx
  mov    %r15d,%esi
  mulss  D377(%rip),%xmm0
  cvtss2sd %xmm0,%xmm0
  jmp    L561
L1199:
  test   %eax,%eax
  je     L599
L228:
  lea    D864(%rip),%rsi
  mov    %r13,%rdi
  call   <strcmp@plt>
  test   %eax,%eax
  je     L672
L46:
  lea    D671(%rip),%rsi
  mov    %r13,%rdi
  call   <strcmp@plt>
  test   %eax,%eax
  je     L692
L367:
  lea    D818(%rip),%rsi
  mov    %r13,%rdi
  call   <strcmp@plt>
  test   %eax,%eax
  jne    L1266
  mov    %r12,%rdx
  lea    D329(%rip),%rsi
  mov    %r15,%rdi
  call   <fprintf@plt>
  jmp    L1266
L1210:
  xor    %eax,%eax
  cmpb   $0x0,0x1243(%rsp)
  je     L539
  jmp    L99
L113:
  mov    0x18(%rsp),%rbx
L342:
  mov    $0x1,%r12d
L534:
  mov    %rbx,%rdi
  call   <strlen@plt>
  add    %eax,0x30(%rsp)
  mov    %rbp,0x18(%rsp)
L946:
  lea    0x240(%rsp),%rax
  mov    %rax,0x8(%rsp)
L59:
  cmpb   $0x0,(%rbx)
  je     L305
  test   %r14d,%r14d
  je     L22
  mov    0x8(%rsp),%r13
  xor    %ebp,%ebp
  jmp    L1099
  nopl   0x0(%rax)
L112:
  add    $0x1,%ebp
  add    $0x20,%r13
  cmp    %ebp,%r14d
  je     L22
L1099:
  mov    %r13,%rsi
  mov    %rbx,%rdi
  call   <Match@plt>
  test   %rax,%rax
  je     L112
  test   %r12d,%r12d
  jne    L236
L359:
  lea    0x80(%rbp),%edx
  lea    D155(%rip),%rsi
  mov    %r15,%rdi
  xor    %eax,%eax
  call   <fprintf@plt>
  mov    %r13,%rsi
  xor    %eax,%eax
  mov    $0x1,%r12d
  lea    D835(%rip),%rdi
  call   <printf@plt>
  mov    %r13,%rdi
  call   <strlen@plt>
  cltq
  add    %rax,%rbx
  movslq %ebp,%rax
  addl   $0x1,0x40(%rsp,%rax,4)
  cmp    %r14d,%ebp
  jne    L59
L1040:
  mov    %r15,%rcx
  mov    $0x2,%edx
  mov    $0x1,%esi
  lea    D874(%rip),%rdi
  call   <fwrite@plt>
  jmp    L924
  nopl   0x0(%rax,%rax,1)
L22:
  test   %r12d,%r12d
  jne    L1040
L924:
  movsbl (%rbx),%edx
  cmp    $0x22,%dl
  je     L882
  cmp    $0xa,%dl
  je     L284
  lea    D607(%rip),%rsi
  mov    %r15,%rdi
  xor    %eax,%eax
  call   <fprintf@plt>
L825:
  movsbl (%rbx),%edi
  mov    $0x1,%r12d
  add    $0x1,%rbx
  call   <putchar@plt>
  jmp    L946
L236:
  mov    %r15,%rcx
  mov    $0x2,%edx
  mov    $0x1,%esi
  lea    D874(%rip),%rdi
  call   <fwrite@plt>
  jmp    L359
L305:
  mov    $0xa,%edi
  mov    0x18(%rsp),%rbp
  call   <putchar@plt>
  jmp    L1266
L284:
  mov    %r15,%rcx
  mov    $0xc,%edx
  mov    $0x1,%esi
  lea    D429(%rip),%rdi
  call   <fwrite@plt>
  jmp    L825
L897:
  mov    %r15,%rcx
  mov    $0x14,%edx
  mov    $0x1,%esi
  lea    D436(%rip),%rdi
  call   <fwrite@plt>
  jmp    L876
L938:
  mov    %r12,%rdx
  lea    D7(%rip),%rsi
  mov    %r15,%rdi
  call   <fprintf@plt>
  jmp    L790
L526:
  mov    %r12,%rdx
  lea    D791(%rip),%rsi
  mov    %r15,%rdi
  call   <fprintf@plt>
  jmp    L204
L882:
  mov    $0x22,%edx
  lea    D132(%rip),%rsi
  mov    %r15,%rdi
  xor    %eax,%eax
  call   <fprintf@plt>
  jmp    L825
L765:
  mov    %r12,%rcx
  mov    %r12,%rdx
  lea    D571(%rip),%rsi
  mov    %r15,%rdi
  call   <fprintf@plt>
  jmp    L876
L1246:
  movzbl 0x0(%r13),%eax
  test   $0xdf,%al
  je     L573
  mov    %r13,%rbx
  xor    %r12d,%r12d
  nop
L1161:
  movsbl %al,%edi
  add    $0x1,%rbx
  call   <CharWidth@plt>
  add    %eax,%r12d
  movzbl (%rbx),%eax
  test   $0xdf,%al
  jne    L1161
L295:
  mov    $0x20,%edi
  call   <CharWidth@plt>
  add    0x8(%rsp),%eax
  add    %r12d,%eax
  cmp    $0x7f,%eax
  jle    L23
  movb   $0xa,-0x1(%r13)
  movl   $0x0,0x8(%rsp)
  jmp    L351
L692:
  mov    %r12,%rdx
  lea    D483(%rip),%rsi
  mov    %r15,%rdi
  call   <fprintf@plt>
  jmp    L367
L672:
  mov    %r12,%rdx
  lea    D553(%rip),%rsi
  mov    %r15,%rdi
  call   <fprintf@plt>
  jmp    L46
L599:
  mov    %r12,%rdx
  lea    D595(%rip),%rsi
  mov    %r15,%rdi
  call   <fprintf@plt>
  jmp    L228
L1248:
  lea    D355(%rip),%rdi
  call   <puts@plt>
  xor    %eax,%eax
  jmp    L1191
L629:
  lea    D822(%rip),%rdi
  call   <puts@plt>
  xor    %eax,%eax
  jmp    L1191
L818:
  mov    %r15,%rcx
  mov    $0x11,%edx
  mov    $0x1,%esi
  mov    %rbp,%rbx
  lea    D578(%rip),%rdi
  call   <fwrite@plt>
  jmp    L415
L366:
  mov    %r12,%rcx
  mov    %r12,%rdx
  lea    D216(%rip),%rsi
  mov    %r15,%rdi
  call   <fprintf@plt>
  jmp    L876
L1154:
  mov    %r15,%rcx
  mov    $0x12,%edx
  mov    $0x1,%esi
  lea    D17(%rip),%rdi
  call   <fwrite@plt>
  jmp    L876
L392:
  mov    %r12,%rcx
  mov    %r12,%rdx
  lea    D117(%rip),%rsi
  mov    %r15,%rdi
  call   <fprintf@plt>
  jmp    L876
L1070:
  cmpl   $0x0,0x20(%rsp)
  jne    L141
  mov    0x28(%rsp),%rdi
L111:
  call   <fclose@plt>
  mov    0x30(%rsp),%ebx
  pxor   %xmm0,%xmm0
  xor    %ecx,%ecx
  xor    %edx,%edx
  xor    %esi,%esi
  lea    D566(%rip),%rdi
  xor    %eax,%eax
  cvtsi2ss %ebx,%xmm0
  divss  %xmm0,%xmm0
  movss  %xmm0,0x8(%rsp)
  call   <printf@plt>
  movss  0x8(%rsp),%xmm0
  mov    %ebx,%esi
  mov    %ebx,%edx
  mulss  D377(%rip),%xmm0
  lea    D657(%rip),%rdi
  mov    $0x1,%eax
  cvtss2sd %xmm0,%xmm0
  call   <printf@plt>
  mov    0x34(%rsp),%esi
  xor    %eax,%eax
  lea    D714(%rip),%rdi
  call   <printf@plt>
  jmp    L789
L323:
  mov    0x10(%rsp),%rdi
  call   <fclose@plt>
  lea    D561(%rip),%rdi
  call   <puts@plt>
  xor    %eax,%eax
  jmp    L1191
L1247:
  mov    %r15,%rcx
  mov    $0x10,%edx
  mov    $0x1,%esi
  lea    D266(%rip),%rdi
  call   <fwrite@plt>
  jmp    L876
L573:
  xor    %r12d,%r12d
  jmp    L295
L1260:
  mov    %r12,%rdx
  lea    D110(%rip),%rsi
  mov    %r15,%rdi
  call   <fprintf@plt>
  jmp    L876
L141:
  mov    0x28(%rsp),%rbx
  mov    $0x1c,%edx
  mov    $0x1,%esi
  lea    D114(%rip),%rdi
  mov    %rbx,%rcx
  call   <fwrite@plt>
  mov    %rbx,%rdi
  jmp    L111
L1100:
  mov    %r12,%rdx
  lea    D718(%rip),%rsi
  mov    %r15,%rdi
  call   <fprintf@plt>
  jmp    L876
L1000:
  mov    %r15,%rcx
  mov    $0x14,%edx
  mov    $0x1,%esi
  lea    D565(%rip),%rdi
  call   <fwrite@plt>
  jmp    L876
L91:
  movl   $0x1,0x24(%rsp)
  jmp    L876
L343:
  movl   $0x0,0x24(%rsp)
  jmp    L876
L268:
  mov    %r15,%rcx
  mov    $0x11,%edx
  mov    $0x1,%esi
  lea    D705(%rip),%rdi
  call   <fwrite@plt>
  jmp    L876
L362:
  call   <__stack_chk_fail@plt>
L479:
  movl   $0x0,0x20(%rsp)
  jmp    L876
L504:
  mov    %r12,%rdx
  lea    D636(%rip),%rsi
  mov    %r15,%rdi
  call   <fprintf@plt>
  jmp    L876
L558:
  mov    %r12,%rdx
  lea    D290(%rip),%rsi
  mov    %r15,%rdi
  call   <fprintf@plt>
  jmp    L876
L719:
  mov    %r15,%rcx
  mov    $0x13,%edx
  mov    $0x1,%esi
  lea    D322(%rip),%rdi
  call   <fwrite@plt>
  jmp    L876
L712:
  mov    %r12,%rcx
  mov    %r12,%rdx
  lea    D785(%rip),%rsi
  mov    %r15,%rdi
  call   <fprintf@plt>
  jmp    L876
```

tool_calls: name: disassemble_data
arguments: label: D660
type_guessed: string
name: disassemble_data
arguments: label: D489
type_guessed: string
name: disassemble_data
arguments: label: D209
type_guessed: string
name: disassemble_data
arguments: label: D420
type_guessed: string
name: disassemble_data
arguments: label: D478
type_guessed: string
name: disassemble_data
arguments: label: D424
type_guessed: string
name: disassemble_data
arguments: label: D104
type_guessed: string
name: disassemble_data
arguments: label: D709
type_guessed: string
name: disassemble_data
arguments: label: D768
type_guessed: string
name: disassemble_data
arguments: label: D849
type_guessed: string
name: disassemble_data
arguments: label: D872
type_guessed: string
name: disassemble_data
arguments: label: D433
type_guessed: string
name: disassemble_data
arguments: label: D853
type_guessed: string
name: disassemble_data
arguments: label: D703
type_guessed: string
name: disassemble_data
arguments: label: D463
type_guessed: string
name: disassemble_data
arguments: label: D225
type_guessed: string
name: disassemble_data
arguments: label: D321
type_guessed: string
name: disassemble_data
arguments: label: D295
type_guessed: string
name: disassemble_data
arguments: label: D118
type_guessed: string
name: disassemble_data
arguments: label: D310
type_guessed: string
name: disassemble_data
arguments: label: D793
type_guessed: string
name: disassemble_data
arguments: label: D538
type_guessed: string
name: disassemble_data
arguments: label: D795
type_guessed: string
name: disassemble_data
arguments: label: D336
type_guessed: string
name: disassemble_data
arguments: label: D658
type_guessed: string
name: disassemble_data
arguments: label: D330
type_guessed: string
name: disassemble_data
arguments: label: D2
type_guessed: string
name: disassemble_data
arguments: label: D578
type_guessed: string
name: disassemble_data
arguments: label: D864
type_guessed: string
name: disassemble_data
arguments: label: D548
type_guessed: string
name: disassemble_data
arguments: label: D316
type_guessed: string
name: disassemble_data
arguments: label: D67
type_guessed: string
name: disassemble_data
arguments: label: D382
type_guessed: string
name: disassemble_data
arguments: label: D747
type_guessed: string
name: disassemble_data
arguments: label: D566
type_guessed: string
name: disassemble_data
arguments: label: D377
type_guessed: byte[4]
name: disassemble_data
arguments: label: D657
type_guessed: string
name: disassemble_data
arguments: label: D714
type_guessed: string
name: disassemble_data
arguments: label: D332
type_guessed: string
name: disassemble_data
arguments: label: D167
type_guessed: string
name: disassemble_data
arguments: label: D817
type_guessed: string
name: disassemble_data
arguments: label: D736
type_guessed: string
name: disassemble_data
arguments: label: D666
type_guessed: string
name: disassemble_data
arguments: label: D267
type_guessed: string
name: disassemble_data
arguments: label: D114
type_guessed: string
name: disassemble_data
arguments: label: D843
type_guessed: string
name: disassemble_data
arguments: label: D702
type_guessed: string
name: disassemble_data
arguments: label: D671
type_guessed: string
name: disassemble_data
arguments: label: D818
type_guessed: string
name: disassemble_data
arguments: label: D329
type_guessed: string
name: disassemble_data
arguments: label: D155
type_guessed: string
name: disassemble_data
arguments: label: D835
type_guessed: string
name: disassemble_data
arguments: label: D874
type_guessed: string
name: disassemble_data
arguments: label: D607
type_guessed: string
name: disassemble_data
arguments: label: D429
type_guessed: string
name: disassemble_data
arguments: label: D436
type_guessed: string
name: disassemble_data
arguments: label: D7
type_guessed: string
name: disassemble_data
arguments: label: D791
type_guessed: string
name: disassemble_data
arguments: label: D132
type_guessed: string
name: disassemble_data
arguments: label: D571
type_guessed: string
name: disassemble_data
arguments: label: D483
type_guessed: string
name: disassemble_data
arguments: label: D553
type_guessed: string
name: disassemble_data
arguments: label: D595
type_guessed: string
name: disassemble_data
arguments: label: D355
type_guessed: string
name: disassemble_data
arguments: label: D822
type_guessed: string
name: disassemble_data
arguments: label: D216
type_guessed: string
name: disassemble_data
arguments: label: D17
type_guessed: string
name: disassemble_data
arguments: label: D117
type_guessed: string
name: disassemble_data
arguments: label: D561
type_guessed: string
name: disassemble_data
arguments: label: D266
type_guessed: string
name: disassemble_data
arguments: label: D110
type_guessed: string
name: disassemble_data
arguments: label: D718
type_guessed: string
name: disassemble_data
arguments: label: D565
type_guessed: string
name: disassemble_data
arguments: label: D705
type_guessed: string
name: disassemble_data
arguments: label: D636
type_guessed: string
name: disassemble_data
arguments: label: D290
type_guessed: string
name: disassemble_data
arguments: label: D322
type_guessed: string
name: disassemble_data
arguments: label: D785
type_guessed: string

tool: D660: rb

tool: D489: wb

tool: D209: end

tool: D420: poke

tool: D478: asm

tool: D424: p

tool: D104: goto

tool: D709: call

tool: D768: return

tool: D849: choose

tool: D872: scene

tool: D433: transition

tool: D853: noskip

tool: D703: manualwrap

tool: D463: autowrap

tool: D225: nodictionarytable

tool: D321: monotext

tool: D295: clear

tool: D118: upload

tool: D310: image

tool: D793: ground

tool: D538: .byt SCR::GROUND

tool: D795: syntax: mkdialog dictionary.txt in.txt out.s

tool: D336: Dictionary has a word that's too long

tool: D658: ; %s


tool: D330: .byt 

tool: D2: 


tool: D578: .byt SCR::NEWLINE

tool: D864: off

tool: D548: toggle

tool: D316: .byt SCR::FLAG_TOGGLE, EventFlags::%s

tool: D67: 
CutsceneDictionary:


tool: D382: .byt "%s", '%c'|128


tool: D747: DictionaryWord%i: 

tool: D566: Dictionary entries: %i (size %i, %i saved by dictionary)


tool: {"D377": [0x00,0x00,0xc8,0x42]}

tool: D657: Script size: %i ---> %i (%.2f%%)


tool: D714: Commands: %i


tool: D332: %s%i,

tool: D167: .byt SCR::NARRATE, CHAR::%s

tool: D817: NONE

tool: D736: .byt SCR::SAY, SCR::SPEAKER_%c|CHAR::%s

tool: D666: .byt SCR::RUN_ASM

tool: D267: .byt SCR::THINK, SCR::SPEAKER_%c|CHAR::%s

tool: D114: 
CutsceneDictionaryTable:


tool: D843: .byt <DictionaryWord%i


tool: D702: .byt >DictionaryWord%i


tool: D671: item

tool: D818: notitem

tool: D329: .byt SCR::IF_NOT_ITEM, InventoryItem::%s

tool: D155: $%.2x

tool: D835: [%s]

tool: D874: , 

tool: D607: "%c"

tool: D429: SCR::NEWLINE

tool: D436: .byt SCR::END_SCRIPT

tool: D7: .byt SCR::FLAG_OFF, EventFlags::%s

tool: D791: .byt SCR::FLAG_ON, EventFlags::%s

tool: D132: '"'

tool: D571: .byt SCR::POKE, <%s, >%s

tool: D483: .byt SCR::IF_ITEM, InventoryItem::%s

tool: D553: .byt SCR::IF_FLAG_OFF, EventFlags::%s

tool: D595: .byt SCR::IF_FLAG_ON, EventFlags::%s

tool: D355: dictionary not found

tool: D822: input file not found

tool: D216: .byt SCR::CALL, <%s, >%s

tool: D17: .byt SCR::END_PAGE

tool: D117: .byt SCR::GOTO, <%s, >%s

tool: D561: output file couldn't be opened

tool: D266: .byt SCR::RETURN

tool: D110: .byt SCR::CHOICES, CHOICELIST::%s

tool: D718: .byt SCR::SCENE, SCENES::%s

tool: D565: .byt SCR::TRANSITION

tool: D705: .byt SCR::NO_SKIP

tool: D636: .byt SCR::IMAGE, %s

tool: D290: .byt SCR::UPLOAD, %s

tool: D322: .byt SCR::CLEAR_ALL

tool: D785: .byt SCR::MONO_TEXT, <%s, >%s

assistant: ```c
int main(int argc, char *argv[]) {
  if (argc < 4) {
    puts("syntax: mkdialog dictionary.txt in.txt out.s");
    return 0;
  }
  char Buffer[700];
  char *Text;
  int Size = 0, Uncompressed = 0, CommandSize = 0;
  int i;
  char Dictionary[128][32];
  int DictionaryUse[128];
  int DictionaryLen = 0;
  int AutoWordWrap = 1;
  int MakeDictionaryTable = 1;
  FILE *InputFile = fopen(argv[1], "rb");
  if (!InputFile) {
    puts("dictionary not found");
    return 0;
  }
  while (fgets(Buffer, sizeof(Buffer), InputFile)) {
    RemoveLineEndings(Buffer);
    if (strlen(Buffer) > 31) {
      puts("Dictionary has a word that's too long");
      return -1;
    }
    DictionaryUse[DictionaryLen] = 0;
    strcpy(Dictionary[DictionaryLen], Buffer);
    DictionaryLen++;
  }
  InputFile = fopen(argv[2], "rb");
  if (!InputFile) {
    puts("input file not found");
    return 0;
  }
  FILE *OutputFile = fopen(argv[3], "wb");
  if (!OutputFile) {
    fclose(InputFile);
    puts("output file couldn't be opened");
    return 0;
  }
  while (fgets(Buffer, sizeof(Buffer), InputFile)) {
    RemoveLineEndings(Buffer);
    int AlreadyStarted = 0;
    if (!*Buffer)
      continue;
    if (Buffer[0] == ':')
      fprintf(OutputFile, "%s", Buffer + 1);
    else if (Buffer[0] == '`' || Buffer[0] == '?') {
      char *Arg = strchr(Buffer, ' ');
      if (Arg)
        *(Arg++) = 0;
      char *Command = Buffer + 1;
      if (!strcmp(Command, "nl"))
        fprintf(OutputFile, ".byt SCR::NEWLINE");
      else if (!strcmp(Command, "end"))
        fprintf(OutputFile, ".byt SCR::END_SCRIPT");
      else if (!strcmp(Command, "poke"))
        fprintf(OutputFile, ".byt SCR::POKE, <%s, >%s", Arg, Arg);
      else if (!strcmp(Command, "asm"))
        fprintf(OutputFile, ".byt SCR::RUN_ASM");
      else if (!strcmp(Command, "p"))
        fprintf(OutputFile, ".byt SCR::END_PAGE");
      else if (!strcmp(Command, "goto"))
        fprintf(OutputFile, ".byt SCR::GOTO, <%s, >%s", Arg, Arg);
      else if (!strcmp(Command, "call"))
        fprintf(OutputFile, ".byt SCR::CALL, <%s, >%s", Arg, Arg);
      else if (!strcmp(Command, "return"))
        fprintf(OutputFile, ".byt SCR::RETURN");
      else if (!strcmp(Command, "choose"))
        fprintf(OutputFile, ".byt SCR::CHOICES, CHOICELIST::%s", Arg);
      else if (!strcmp(Command, "scene"))
        fprintf(OutputFile, ".byt SCR::SCENE, SCENES::%s", Arg);
      else if (!strcmp(Command, "transition"))
        fprintf(OutputFile, ".byt SCR::TRANSITION");
      else if (!strcmp(Command, "noskip"))
        fprintf(OutputFile, ".byt SCR::NO_SKIP");
      else if (!strcmp(Command, "manualwrap"))
        AutoWordWrap = 0;
      else if (!strcmp(Command, "autowrap"))
        AutoWordWrap = 1;
      else if (!strcmp(Command, "nodictionarytable"))
        MakeDictionaryTable = 0;
      else if (!strcmp(Command, "monotext"))
        fprintf(OutputFile, ".byt SCR::MONO_TEXT, <%s, >%s", Arg, Arg);
      else if (!strcmp(Command, "clear"))
        fprintf(OutputFile, ".byt SCR::CLEAR_ALL");
      else if (!strcmp(Command, "upload"))
        fprintf(OutputFile, ".byt SCR::UPLOAD, %s", Arg);
      else if (!strcmp(Command, "image"))
        fprintf(OutputFile, ".byt SCR::IMAGE, %s", Arg);
      else if (!strcmp(Command, "ground"))
        fprintf(OutputFile, ".byt SCR::GROUND");
      if (Buffer[0] == '?') {
        if (!strcmp(Command, "on"))
          fprintf(OutputFile, ".byt SCR::IF_FLAG_ON, EventFlags::%s", Arg);
        if (!strcmp(Command, "off"))
          fprintf(OutputFile, ".byt SCR::IF_FLAG_OFF, EventFlags::%s", Arg);
        if (!strcmp(Command, "item"))
          fprintf(OutputFile, ".byt SCR::IF_ITEM, InventoryItem::%s", Arg);
        if (!strcmp(Command, "notitem"))
          fprintf(OutputFile, ".byt SCR::IF_NOT_ITEM, InventoryItem::%s", Arg);
      } else {
        if (!strcmp(Command, "on"))
          fprintf(OutputFile, ".byt SCR::FLAG_ON, EventFlags::%s", Arg);
        if (!strcmp(Command, "off"))
          fprintf(OutputFile, ".byt SCR::FLAG_OFF, EventFlags::%s", Arg);
        if (!strcmp(Command, "toggle"))
          fprintf(OutputFile, ".byt SCR::FLAG_TOGGLE, EventFlags::%s", Arg);
      }
    } else {
      Text = Buffer;
      fprintf(OutputFile, "; %s\r\n", Text);
      switch (Buffer[0]) {
      case '<':
        Text = strchr(Buffer, '>') + 1;
        Text[-1] = 0;
        fprintf(OutputFile, ".byt SCR::SAY, SCR::SPEAKER_%c|CHAR::%s", Buffer[1], Buffer + 3);
        CommandSize += 2;
        AlreadyStarted = 1;
        break;
      case '>':
        Text = strchr(Buffer, '<') + 1;
        Text[-1] = 0;
        fprintf(OutputFile, ".byt SCR::THINK, SCR::SPEAKER_%c|CHAR::%s", Buffer[1], Buffer + 3);
        CommandSize += 2;
        AlreadyStarted = 1;
        break;
      case '[':
        Text = strchr(Buffer, ']') + 1;
        Text[-1] = 0;
        fprintf(OutputFile, ".byt SCR::NARRATE, CHAR::%s", Buffer[1] ? (Buffer + 1) : "NONE");
        CommandSize += 2;
        AlreadyStarted = 1;
        break;
      }
      if (AutoWordWrap && Text == Buffer) {
        fprintf(OutputFile, ".byt SCR::NEWLINE");
        AlreadyStarted = 1;
      }
      if (!AlreadyStarted) {
        fprintf(OutputFile, ".byt ");
      }
      if (AutoWordWrap) {
        char *Peek;
        int CurXPos = 0;
        for (Peek = Text; *Peek; Peek++) {
          if (*Peek == ' ') {
            int WordLength = 0;
            char *Word = Peek + 1;
            for (; *Word != ' ' && *Word; Word++)
              WordLength += CharWidth(*Word);
            if (CurXPos + CharWidth(' ') + WordLength >= 128) {
              *Peek = '\n';
              CurXPos = 0;
            }
          }
          if (*Peek != '\n')
            CurXPos += CharWidth(*Peek);
        }
      }
      Uncompressed += strlen(Text);
      while (*Text) {
        for (i = 0; i < DictionaryLen; i++) {
          if (Match(Text, Dictionary[i])) {
            if (AlreadyStarted)
              fprintf(OutputFile, ", ");
            fprintf(OutputFile, "$%.2x", 0x80 + i);
            AlreadyStarted = 1;
            printf("[%s]", Dictionary[i]);
            Text += strlen(Dictionary[i]);
            DictionaryUse[i]++;
            Size++;
            break;
          }
        }
        if (i == DictionaryLen) {
          if (AlreadyStarted)
            fprintf(OutputFile, ", ");
          AlreadyStarted = 1;
          if (*Text == '"')
            fprintf(OutputFile, "'\"'", *Text);
          else if (*Text == '\n')
            fprintf(OutputFile, "SCR::NEWLINE");
          else
            fprintf(OutputFile, "\"%c\"", *Text);
          putchar(*Text);
          Text++;
        }
        Size++;
      }
      putchar('\n');
    }
    if (*Buffer)
      fprintf(OutputFile, "\r\n");
  }
  fclose(InputFile);
  int DictionarySize = 0, DictionarySavings = 0;
  fprintf(OutputFile, "\r\nCutsceneDictionary:\r\n");
  for (i = 0; i < DictionaryLen; i++) {
    DictionarySize += strlen(Dictionary[i]);
    DictionarySavings += strlen(Dictionary[i]) * (DictionaryUse[i] - 1) - 1;
    char *Last = strrchr(Dictionary[i], 0);
    char LastChar = Last[-1];
    Last[-1] = 0;
    if (MakeDictionaryTable)
      fprintf(OutputFile, "DictionaryWord%i: ", i);
    fprintf(OutputFile, ".byt \"%s\", '%c'|128\r\n", Dictionary[i], LastChar);
  }
  if (MakeDictionaryTable) {
    fprintf(OutputFile, "\r\nCutsceneDictionaryTable:\r\n");
    for (i = 0; i < DictionaryLen; i++) {
      fprintf(OutputFile, ".byt <DictionaryWord%i\r\n", i);
    }
    for (i = 0; i < DictionaryLen; i++) {
      fprintf(OutputFile, ".byt >DictionaryWord%i\r\n", i);
    }
  }
  fclose(OutputFile);
  float Saving = Uncompressed - DictionarySavings;
  Saving = Saving / Uncompressed * 100;
  printf("Dictionary entries: %i (size %i, %i saved by dictionary)\n", DictionaryLen, DictionarySize, DictionarySavings);
  printf("Script size: %i ---> %i (%.2f%%)\n", Uncompressed, Uncompressed - DictionarySavings, Saving);
  printf("Commands: %i\n", CommandSize);
  for (i = 0; i < DictionaryLen; i++)
    printf("%s%i,", Dictionary[i], DictionaryUse[i]);
  putchar('\n');
  return 0;
}
```