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

```asm
<main>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x1000,%rsp
  orq    $0x0,(%rsp)
  sub    $0x508,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,0x14f8(%rsp)
  xor    %eax,%eax
  cmp    $0x3,%edi
  jle    L838
  mov    0x8(%rsi),%rdi
  mov    %rsi,%r14
  lea    D227(%rip),%rsi
  xor    %ebx,%ebx
  lea    0x1230(%rsp),%rbp
  lea    0x230(%rsp),%r13
  call   <fopen@plt>
  mov    %rax,%r12
  test   %rax,%rax
  je     L829
  mov    %r14,(%rsp)
  jmp    L265
  nopl   0x0(%rax)
L1080:
  mov    %rbp,%rdi
  call   <RemoveLineEndings@plt>
  mov    %rbp,%rdi
  call   <strlen@plt>
  cmp    $0x1f,%eax
  jg     L372
  mov    %rbx,%rdi
  mov    %rbp,%rsi
  movl   $0x0,0x30(%rsp,%rbx,4)
  add    $0x1,%rbx
  shl    $0x5,%rdi
  add    %r13,%rdi
  call   <strcpy@plt>
L265:
  mov    %r12,%rdx
  mov    $0x2bc,%esi
  mov    %rbp,%rdi
  mov    %ebx,%r15d
  call   <fgets@plt>
  test   %rax,%rax
  jne    L1080
  mov    (%rsp),%r14
  lea    D227(%rip),%rsi
  mov    %ebx,0x2c(%rsp)
  mov    0x10(%r14),%rdi
  call   <fopen@plt>
  mov    %rax,0x8(%rsp)
  test   %rax,%rax
  je     L634
  mov    0x18(%r14),%rdi
  lea    D859(%rip),%rsi
  call   <fopen@plt>
  mov    %rax,%r14
  test   %rax,%rax
  je     L154
  movl   $0x1,0x14(%rsp)
  movl   $0x1,0x20(%rsp)
  movl   $0x0,0x28(%rsp)
  movl   $0x0,0x10(%rsp)
  nopl   0x0(%rax)
L121:
  mov    0x8(%rsp),%rdx
  mov    $0x2bc,%esi
  mov    %rbp,%rdi
  call   <fgets@plt>
  test   %rax,%rax
  je     L841
  mov    %rbp,%rdi
  call   <RemoveLineEndings@plt>
  movzbl 0x1230(%rsp),%eax
  test   %al,%al
  je     L121
  cmp    $0x3a,%al
  je     L596
  cmp    $0x60,%al
  je     L824
  cmp    $0x3f,%al
  jne    L1121
L824:
  mov    $0x20,%esi
  mov    %rbp,%rdi
  call   <strchr@plt>
  mov    %rax,%r12
  test   %rax,%rax
  je     L1242
  movb   $0x0,(%rax)
  add    $0x1,%r12
L1242:
  cmpw   $0x6c6e,0x1231(%rsp)
  lea    0x1231(%rsp),%r13
  je     L1120
L803:
  lea    D713(%rip),%rsi
  mov    %r13,%rdi
  call   <strcmp@plt>
  test   %eax,%eax
  je     L784
  lea    D432(%rip),%rsi
  mov    %r13,%rdi
  call   <strcmp@plt>
  test   %eax,%eax
  je     L512
  lea    D778(%rip),%rsi
  mov    %r13,%rdi
  call   <strcmp@plt>
  test   %eax,%eax
  je     L754
  lea    D568(%rip),%rsi
  mov    %r13,%rdi
  call   <strcmp@plt>
  test   %eax,%eax
  je     L954
  lea    D207(%rip),%rsi
  mov    %r13,%rdi
  call   <strcmp@plt>
  test   %eax,%eax
  je     L968
  lea    D306(%rip),%rsi
  mov    %r13,%rdi
  call   <strcmp@plt>
  test   %eax,%eax
  je     L200
  lea    D716(%rip),%rsi
  mov    %r13,%rdi
  call   <strcmp@plt>
  test   %eax,%eax
  je     L569
  lea    D196(%rip),%rsi
  mov    %r13,%rdi
  call   <strcmp@plt>
  test   %eax,%eax
  je     L165
  lea    D797(%rip),%rsi
  mov    %r13,%rdi
  call   <strcmp@plt>
  test   %eax,%eax
  je     L762
  lea    D880(%rip),%rsi
  mov    %r13,%rdi
  call   <strcmp@plt>
  test   %eax,%eax
  je     L865
  lea    D431(%rip),%rsi
  mov    %r13,%rdi
  call   <strcmp@plt>
  test   %eax,%eax
  je     L104
  lea    D782(%rip),%rsi
  mov    %r13,%rdi
  call   <strcmp@plt>
  test   %eax,%eax
  je     L21
  lea    D594(%rip),%rsi
  mov    %r13,%rdi
  call   <strcmp@plt>
  test   %eax,%eax
  je     L223
  lea    D190(%rip),%rsi
  mov    %r13,%rdi
  call   <strcmp@plt>
  test   %eax,%eax
  je     L497
  lea    D7(%rip),%rsi
  mov    %r13,%rdi
  call   <strcmp@plt>
  test   %eax,%eax
  je     L483
  lea    D317(%rip),%rsi
  mov    %r13,%rdi
  call   <strcmp@plt>
  test   %eax,%eax
  je     L1013
  lea    D334(%rip),%rsi
  mov    %r13,%rdi
  call   <strcmp@plt>
  test   %eax,%eax
  je     L494
  lea    D46(%rip),%rsi
  mov    %r13,%rdi
  call   <strcmp@plt>
  test   %eax,%eax
  je     L1041
  lea    D808(%rip),%rsi
  mov    %r13,%rdi
  call   <strcmp@plt>
  test   %eax,%eax
  jne    L359
  mov    %r14,%rcx
  mov    $0x10,%edx
  mov    $0x1,%esi
  lea    D57(%rip),%rdi
  call   <fwrite@plt>
  jmp    L359
L838:
  lea    D515(%rip),%rdi
  call   <puts@plt>
  xor    %eax,%eax
L261:
  mov    0x14f8(%rsp),%rdx
  sub    %fs:0x28,%rdx
  jne    L234
  add    $0x1508,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
L372:
  lea    D742(%rip),%rdi
  call   <puts@plt>
  or     $0xffffffff,%eax
  jmp    L261
L1121:
  mov    %rbp,%rdx
  lea    D763(%rip),%rsi
  mov    %r14,%rdi
  xor    %eax,%eax
  call   <fprintf@plt>
  movzbl 0x1230(%rsp),%eax
  cmp    $0x3e,%al
  je     L594
  cmp    $0x5b,%al
  je     L606
  cmp    $0x3c,%al
  je     L1245
  cmpl   $0x0,0x20(%rsp)
  jne    L743
  mov    %r14,%rcx
  mov    $0x5,%edx
  mov    $0x1,%esi
  xor    %r12d,%r12d
  lea    D621(%rip),%rdi
  mov    %rbp,%rbx
  call   <fwrite@plt>
  jmp    L434
L596:
  lea    0x1231(%rsp),%rdi
  mov    %r14,%rsi
  call   <fputs@plt>
L152:
  cmpb   $0x0,0x1230(%rsp)
  je     L121
  mov    %r14,%rcx
  mov    $0x2,%edx
  mov    $0x1,%esi
  lea    D605(%rip),%rdi
  call   <fwrite@plt>
  jmp    L121
L1120:
  cmpb   $0x0,0x1233(%rsp)
  jne    L803
  mov    %r14,%rcx
  mov    $0x11,%edx
  mov    $0x1,%esi
  lea    D608(%rip),%rdi
  call   <fwrite@plt>
L359:
  cmpw   $0x6e6f,0x1231(%rsp)
  je     L633
L457:
  mov    $0x1,%eax
L948:
  cmpb   $0x3f,0x1230(%rsp)
  je     L428
  test   %eax,%eax
  je     L305
L558:
  lea    D273(%rip),%rsi
  mov    %r13,%rdi
  call   <strcmp@plt>
  test   %eax,%eax
  je     L917
L766:
  lea    D805(%rip),%rsi
  mov    %r13,%rdi
  call   <strcmp@plt>
  test   %eax,%eax
  jne    L152
  mov    %r12,%rdx
  lea    D495(%rip),%rsi
  mov    %r14,%rdi
  call   <fprintf@plt>
  jmp    L152
L841:
  mov    0x8(%rsp),%rdi
  call   <fclose@plt>
  mov    %r14,%rcx
  mov    $0x17,%edx
  mov    $0x1,%esi
  lea    D368(%rip),%rdi
  call   <fwrite@plt>
  test   %r15d,%r15d
  je     L699
  mov    0x14(%rsp),%ecx
  test   %ecx,%ecx
  jne    L652
  lea    0x230(%rsp),%rax
  lea    0x30(%rsp),%rbp
  mov    %r15d,0x18(%rsp)
  mov    %rax,0x8(%rsp)
  mov    %rax,%rbx
  mov    0x2c(%rsp),%eax
  mov    %rbp,%r12
  mov    %rbp,0x20(%rsp)
  lea    D324(%rip),%r13
  mov    %ecx,%ebp
  sub    $0x1,%eax
  shl    $0x5,%rax
  lea    0x250(%rsp,%rax,1),%rax
  mov    %rax,(%rsp)
  xor    %eax,%eax
  mov    %eax,%r15d
  nopw   0x0(%rax,%rax,1)
L327:
  mov    %rbx,%rdi
  add    $0x4,%r12
  call   <strlen@plt>
  mov    %rbx,%rdi
  add    %eax,%ebp
  call   <strlen@plt>
  mov    %rbx,%rdi
  mov    %eax,%r8d
  mov    -0x4(%r12),%eax
  sub    $0x1,%eax
  imul   %r8d,%eax
  lea    -0x1(%r15,%rax,1),%r15d
  call   <strlen@plt>
  mov    %rbx,%rdx
  mov    %r13,%rsi
  mov    %r14,%rdi
  add    %rbx,%rax
  add    $0x20,%rbx
  movsbl -0x1(%rax),%ecx
  movb   $0x0,-0x1(%rax)
  xor    %eax,%eax
  call   <fprintf@plt>
  cmp    %rbx,(%rsp)
  jne    L327
  mov    0x10(%rsp),%ebx
  mov    %r15d,%ecx
  mov    %r14,%rdi
  mov    %ebp,0x14(%rsp)
  mov    0x18(%rsp),%r15d
  mov    %ecx,%r13d
  mov    0x20(%rsp),%rbp
  mov    %ebx,%r12d
  sub    %ecx,%r12d
  call   <fclose@plt>
  pxor   %xmm0,%xmm0
  pxor   %xmm1,%xmm1
  mov    %r13d,%ecx
  cvtsi2ss %ebx,%xmm1
  mov    0x14(%rsp),%edx
  mov    %r15d,%esi
  xor    %eax,%eax
  cvtsi2ss %r12d,%xmm0
  lea    D735(%rip),%rdi
  divss  %xmm1,%xmm0
  movss  %xmm0,(%rsp)
  call   <printf@plt>
  movss  (%rsp),%xmm0
  mov    %r12d,%edx
  mulss  D10(%rip),%xmm0
  cvtss2sd %xmm0,%xmm0
L901:
  mov    %ebx,%esi
  lea    D475(%rip),%rdi
  mov    $0x1,%eax
  xor    %r12d,%r12d
  call   <printf@plt>
  mov    0x28(%rsp),%esi
  xor    %eax,%eax
  lea    D246(%rip),%rdi
  lea    D890(%rip),%r13
  call   <printf@plt>
  mov    0x8(%rsp),%rbx
  nopw   0x0(%rax,%rax,1)
L168:
  mov    %r12,%rsi
  mov    0x0(%rbp,%r12,4),%edx
  mov    %r13,%rdi
  xor    %eax,%eax
  shl    $0x5,%rsi
  add    $0x1,%r12
  add    %rbx,%rsi
  call   <printf@plt>
  cmp    %r12d,%r15d
  jg     L168
L566:
  mov    $0xa,%edi
  call   <putchar@plt>
  xor    %eax,%eax
  jmp    L261
L606:
  mov    $0x5d,%esi
  mov    %rbp,%rdi
  call   <strchr@plt>
  lea    0x1231(%rsp),%rdx
  lea    D339(%rip),%rsi
  mov    %r14,%rdi
  movb   $0x0,(%rax)
  lea    0x1(%rax),%rbx
  cmpb   $0x0,0x1231(%rsp)
  lea    D157(%rip),%rax
  cmove  %rax,%rdx
  xor    %eax,%eax
  call   <fprintf@plt>
  addl   $0x2,0x28(%rsp)
L34:
  cmpl   $0x0,0x20(%rsp)
  je     L741
  cmp    %rbp,%rbx
  je     L743
L87:
  movl   $0x0,(%rsp)
  mov    %rbx,%r13
  mov    %rbx,0x18(%rsp)
L139:
  movzbl 0x0(%r13),%eax
  test   %al,%al
  je     L256
  add    $0x1,%r13
  cmp    $0x20,%al
  je     L66
L89:
  movzbl -0x1(%r13),%eax
  cmp    $0xa,%al
  je     L139
  movsbl %al,%edi
  call   <CharWidth@plt>
  add    %eax,(%rsp)
  jmp    L139
L1245:
  mov    $0x3e,%esi
  mov    %rbp,%rdi
  call   <strchr@plt>
  lea    0x1233(%rsp),%rcx
  lea    D873(%rip),%rsi
  mov    %r14,%rdi
  movb   $0x0,(%rax)
  movsbl 0x1231(%rsp),%edx
  lea    0x1(%rax),%rbx
  xor    %eax,%eax
  call   <fprintf@plt>
  addl   $0x2,0x28(%rsp)
  jmp    L34
L754:
  mov    %r14,%rcx
  mov    $0x11,%edx
  mov    $0x1,%esi
  lea    D865(%rip),%rdi
  call   <fwrite@plt>
  jmp    L359
L652:
  lea    D324(%rip),%r13
  xor    %ebx,%ebx
  xor    %ecx,%ecx
  mov    %r15d,0x14(%rsp)
  lea    0x230(%rsp),%rax
  movl   $0x0,(%rsp)
  mov    %rbx,%r15
  lea    0x30(%rsp),%rbp
  mov    %rax,0x8(%rsp)
  mov    %ecx,%ebx
  mov    %r13,0x18(%rsp)
L1223:
  mov    0x8(%rsp),%rax
  mov    %r15,%r8
  shl    $0x5,%r8
  lea    (%rax,%r8,1),%r13
  mov    %r13,%rdi
  call   <strlen@plt>
  mov    %r13,%rdi
  add    %eax,(%rsp)
  call   <strlen@plt>
  mov    %r13,%rdi
  mov    %eax,%r10d
  mov    0x0(%rbp,%r15,4),%eax
  sub    $0x1,%eax
  imul   %r10d,%eax
  lea    -0x1(%rbx,%rax,1),%ebx
  call   <strlen@plt>
  mov    %r15d,%edx
  mov    %r14,%rdi
  add    $0x1,%r15
  add    %r13,%rax
  lea    D29(%rip),%rsi
  movzbl -0x1(%rax),%r12d
  movb   $0x0,-0x1(%rax)
  xor    %eax,%eax
  call   <fprintf@plt>
  mov    0x18(%rsp),%rsi
  movsbl %r12b,%ecx
  xor    %eax,%eax
  mov    %r13,%rdx
  mov    %r14,%rdi
  call   <fprintf@plt>
  cmp    %r15d,0x14(%rsp)
  jg     L1223
  mov    0x10(%rsp),%eax
  mov    %r14,%rcx
  mov    $0x1c,%edx
  mov    $0x1,%esi
  lea    D272(%rip),%rdi
  mov    0x14(%rsp),%r15d
  mov    %ebx,0x14(%rsp)
  lea    D124(%rip),%r13
  sub    %ebx,%eax
  mov    %eax,0x18(%rsp)
  call   <fwrite@plt>
  xor    %r8d,%r8d
  mov    %r8d,%ebx
L59:
  mov    %ebx,%edx
  mov    %r13,%rsi
  mov    %r14,%rdi
  xor    %eax,%eax
  call   <fprintf@plt>
  mov    %ebx,%r12d
  add    $0x1,%ebx
  cmp    %ebx,%r15d
  jne    L59
  mov    %ebx,%r8d
  lea    D815(%rip),%r13
  xor    %ebx,%ebx
  mov    %r8d,0x20(%rsp)
L585:
  mov    %ebx,%edx
  mov    %r13,%rsi
  mov    %r14,%rdi
  xor    %eax,%eax
  call   <fprintf@plt>
  mov    %ebx,%eax
  add    $0x1,%ebx
  cmp    %r12d,%eax
  jne    L585
  mov    %r14,%rdi
  call   <fclose@plt>
  mov    0x18(%rsp),%r14d
  mov    0x10(%rsp),%ebx
  xor    %eax,%eax
  pxor   %xmm0,%xmm0
  pxor   %xmm1,%xmm1
  mov    (%rsp),%edx
  mov    0x14(%rsp),%ecx
  cvtsi2ss %ebx,%xmm1
  mov    0x20(%rsp),%esi
  lea    D735(%rip),%rdi
  cvtsi2ss %r14d,%xmm0
  divss  %xmm1,%xmm0
  movss  %xmm0,0x10(%rsp)
  call   <printf@plt>
  movss  0x10(%rsp),%xmm0
  mov    %r14d,%edx
  mulss  D10(%rip),%xmm0
  cvtss2sd %xmm0,%xmm0
  jmp    L901
L594:
  mov    $0x3c,%esi
  mov    %rbp,%rdi
  call   <strchr@plt>
  lea    0x1233(%rsp),%rcx
  lea    D770(%rip),%rsi
  mov    %r14,%rdi
  movb   $0x0,(%rax)
  movsbl 0x1231(%rsp),%edx
  lea    0x1(%rax),%rbx
  xor    %eax,%eax
  call   <fprintf@plt>
  addl   $0x2,0x28(%rsp)
  jmp    L34
L428:
  test   %eax,%eax
  je     L350
L922:
  lea    D273(%rip),%rsi
  mov    %r13,%rdi
  call   <strcmp@plt>
  test   %eax,%eax
  je     L385
L384:
  lea    D482(%rip),%rsi
  mov    %r13,%rdi
  call   <strcmp@plt>
  test   %eax,%eax
  je     L1006
L1083:
  lea    D178(%rip),%rsi
  mov    %r13,%rdi
  call   <strcmp@plt>
  test   %eax,%eax
  jne    L152
  mov    %r12,%rdx
  lea    D415(%rip),%rsi
  mov    %r14,%rdi
  call   <fprintf@plt>
  jmp    L152
L633:
  xor    %eax,%eax
  cmpb   $0x0,0x1233(%rsp)
  je     L948
  jmp    L457
L256:
  mov    0x18(%rsp),%rbx
L741:
  mov    $0x1,%r12d
L434:
  mov    %rbx,%rdi
  call   <strlen@plt>
  add    %eax,0x10(%rsp)
  mov    %rbp,0x18(%rsp)
L310:
  lea    0x230(%rsp),%rax
  mov    %rax,(%rsp)
L62:
  cmpb   $0x0,(%rbx)
  je     L867
  test   %r15d,%r15d
  je     L149
  mov    (%rsp),%r13
  xor    %ebp,%ebp
  jmp    L898
  nop
L375:
  add    $0x1,%ebp
  add    $0x20,%r13
  cmp    %ebp,%r15d
  je     L149
L898:
  mov    %r13,%rsi
  mov    %rbx,%rdi
  call   <Match@plt>
  test   %rax,%rax
  je     L375
  test   %r12d,%r12d
  jne    L697
L908:
  lea    0x80(%rbp),%edx
  lea    D874(%rip),%rsi
  mov    %r14,%rdi
  xor    %eax,%eax
  call   <fprintf@plt>
  mov    %r13,%rsi
  xor    %eax,%eax
  mov    $0x1,%r12d
  lea    D269(%rip),%rdi
  call   <printf@plt>
  mov    %r13,%rdi
  call   <strlen@plt>
  cltq
  add    %rax,%rbx
  movslq %ebp,%rax
  addl   $0x1,0x30(%rsp,%rax,4)
  cmp    %r15d,%ebp
  jne    L62
L52:
  mov    %r14,%rcx
  mov    $0x2,%edx
  mov    $0x1,%esi
  lea    D199(%rip),%rdi
  call   <fwrite@plt>
  jmp    L581
L149:
  test   %r12d,%r12d
  jne    L52
L581:
  movsbl (%rbx),%edx
  cmp    $0x22,%dl
  je     L1009
  cmp    $0xa,%dl
  je     L502
  lea    D488(%rip),%rsi
  mov    %r14,%rdi
  xor    %eax,%eax
  call   <fprintf@plt>
L991:
  movsbl (%rbx),%edi
  mov    $0x1,%r12d
  add    $0x1,%rbx
  call   <putchar@plt>
  jmp    L310
L697:
  mov    %r14,%rcx
  mov    $0x2,%edx
  mov    $0x1,%esi
  lea    D199(%rip),%rdi
  call   <fwrite@plt>
  jmp    L908
L867:
  mov    $0xa,%edi
  mov    0x18(%rsp),%rbp
  call   <putchar@plt>
  jmp    L152
L502:
  mov    %r14,%rcx
  mov    $0xc,%edx
  mov    $0x1,%esi
  lea    D618(%rip),%rdi
  call   <fwrite@plt>
  jmp    L991
L784:
  mov    %r14,%rcx
  mov    $0x14,%edx
  mov    $0x1,%esi
  lea    D773(%rip),%rdi
  call   <fwrite@plt>
  jmp    L359
L917:
  mov    %r12,%rdx
  lea    D457(%rip),%rsi
  mov    %r14,%rdi
  call   <fprintf@plt>
  jmp    L766
L305:
  mov    %r12,%rdx
  lea    D828(%rip),%rsi
  mov    %r14,%rdi
  call   <fprintf@plt>
  jmp    L558
L1009:
  mov    $0x22,%edx
  lea    D380(%rip),%rsi
  mov    %r14,%rdi
  xor    %eax,%eax
  call   <fprintf@plt>
  jmp    L991
L512:
  mov    %r12,%rcx
  mov    %r12,%rdx
  lea    D611(%rip),%rsi
  mov    %r14,%rdi
  call   <fprintf@plt>
  jmp    L359
L66:
  movzbl 0x0(%r13),%eax
  test   $0xdf,%al
  je     L1022
  mov    %r13,%rbx
  xor    %r12d,%r12d
  nop
L295:
  movsbl %al,%edi
  add    $0x1,%rbx
  call   <CharWidth@plt>
  add    %eax,%r12d
  movzbl (%rbx),%eax
  test   $0xdf,%al
  jne    L295
L82:
  mov    $0x20,%edi
  call   <CharWidth@plt>
  add    (%rsp),%eax
  add    %r12d,%eax
  cmp    $0x7f,%eax
  jle    L89
  movb   $0xa,-0x1(%r13)
  movl   $0x0,(%rsp)
  jmp    L139
L1006:
  mov    %r12,%rdx
  lea    D586(%rip),%rsi
  mov    %r14,%rdi
  call   <fprintf@plt>
  jmp    L1083
L385:
  mov    %r12,%rdx
  lea    D203(%rip),%rsi
  mov    %r14,%rdi
  call   <fprintf@plt>
  jmp    L384
L350:
  mov    %r12,%rdx
  lea    D372(%rip),%rsi
  mov    %r14,%rdi
  call   <fprintf@plt>
  jmp    L922
L829:
  lea    D536(%rip),%rdi
  call   <puts@plt>
  xor    %eax,%eax
  jmp    L261
L634:
  lea    D560(%rip),%rdi
  call   <puts@plt>
  xor    %eax,%eax
  jmp    L261
L743:
  mov    %r14,%rcx
  mov    $0x11,%edx
  mov    $0x1,%esi
  mov    %rbp,%rbx
  lea    D608(%rip),%rdi
  call   <fwrite@plt>
  jmp    L87
L200:
  mov    %r12,%rcx
  mov    %r12,%rdx
  lea    D247(%rip),%rsi
  mov    %r14,%rdi
  call   <fprintf@plt>
  jmp    L359
L954:
  mov    %r14,%rcx
  mov    $0x12,%edx
  mov    $0x1,%esi
  lea    D418(%rip),%rdi
  call   <fwrite@plt>
  jmp    L359
L968:
  mov    %r12,%rcx
  mov    %r12,%rdx
  lea    D274(%rip),%rsi
  mov    %r14,%rdi
  call   <fprintf@plt>
  jmp    L359
L699:
  cmpl   $0x0,0x14(%rsp)
  jne    L1097
L696:
  mov    %r14,%rdi
  call   <fclose@plt>
  mov    0x10(%rsp),%ebx
  pxor   %xmm0,%xmm0
  xor    %ecx,%ecx
  xor    %edx,%edx
  xor    %esi,%esi
  lea    D735(%rip),%rdi
  xor    %eax,%eax
  cvtsi2ss %ebx,%xmm0
  divss  %xmm0,%xmm0
  movss  %xmm0,(%rsp)
  call   <printf@plt>
  movss  (%rsp),%xmm0
  mov    %ebx,%esi
  mov    %ebx,%edx
  mulss  D10(%rip),%xmm0
  lea    D475(%rip),%rdi
  mov    $0x1,%eax
  cvtss2sd %xmm0,%xmm0
  call   <printf@plt>
  mov    0x28(%rsp),%esi
  xor    %eax,%eax
  lea    D246(%rip),%rdi
  call   <printf@plt>
  jmp    L566
L154:
  mov    0x8(%rsp),%rdi
  call   <fclose@plt>
  lea    D854(%rip),%rdi
  call   <puts@plt>
  xor    %eax,%eax
  jmp    L261
L569:
  mov    %r14,%rcx
  mov    $0x10,%edx
  mov    $0x1,%esi
  lea    D804(%rip),%rdi
  call   <fwrite@plt>
  jmp    L359
L1022:
  xor    %r12d,%r12d
  jmp    L82
L165:
  mov    %r12,%rdx
  lea    D267(%rip),%rsi
  mov    %r14,%rdi
  call   <fprintf@plt>
  jmp    L359
L1097:
  mov    %r14,%rcx
  mov    $0x1c,%edx
  mov    $0x1,%esi
  lea    D272(%rip),%rdi
  call   <fwrite@plt>
  jmp    L696
L762:
  mov    %r12,%rdx
  lea    D384(%rip),%rsi
  mov    %r14,%rdi
  call   <fprintf@plt>
  jmp    L359
L865:
  mov    %r14,%rcx
  mov    $0x14,%edx
  mov    $0x1,%esi
  lea    D148(%rip),%rdi
  call   <fwrite@plt>
  jmp    L359
L223:
  movl   $0x1,0x20(%rsp)
  jmp    L359
L21:
  movl   $0x0,0x20(%rsp)
  jmp    L359
L104:
  mov    %r14,%rcx
  mov    $0x11,%edx
  mov    $0x1,%esi
  lea    D65(%rip),%rdi
  call   <fwrite@plt>
  jmp    L359
L234:
  call   <__stack_chk_fail@plt>
L497:
  movl   $0x0,0x14(%rsp)
  jmp    L359
L1041:
  mov    %r12,%rdx
  lea    D91(%rip),%rsi
  mov    %r14,%rdi
  call   <fprintf@plt>
  jmp    L359
L494:
  mov    %r12,%rdx
  lea    D638(%rip),%rsi
  mov    %r14,%rdi
  call   <fprintf@plt>
  jmp    L359
L1013:
  mov    %r14,%rcx
  mov    $0x13,%edx
  mov    $0x1,%esi
  lea    D644(%rip),%rdi
  call   <fwrite@plt>
  jmp    L359
L483:
  mov    %r12,%rcx
  mov    %r12,%rdx
  lea    D33(%rip),%rsi
  mov    %r14,%rdi
  call   <fprintf@plt>
  jmp    L359
```

tool_calls: name: extract_symbolic_data
arguments: tag: D227
type: string
name: extract_symbolic_data
arguments: tag: D859
type: string
name: extract_symbolic_data
arguments: tag: D713
type: string
name: extract_symbolic_data
arguments: tag: D432
type: string
name: extract_symbolic_data
arguments: tag: D778
type: string
name: extract_symbolic_data
arguments: tag: D568
type: string
name: extract_symbolic_data
arguments: tag: D207
type: string
name: extract_symbolic_data
arguments: tag: D306
type: string
name: extract_symbolic_data
arguments: tag: D716
type: string
name: extract_symbolic_data
arguments: tag: D196
type: string
name: extract_symbolic_data
arguments: tag: D797
type: string
name: extract_symbolic_data
arguments: tag: D880
type: string
name: extract_symbolic_data
arguments: tag: D431
type: string
name: extract_symbolic_data
arguments: tag: D782
type: string
name: extract_symbolic_data
arguments: tag: D594
type: string
name: extract_symbolic_data
arguments: tag: D190
type: string
name: extract_symbolic_data
arguments: tag: D7
type: string
name: extract_symbolic_data
arguments: tag: D317
type: string
name: extract_symbolic_data
arguments: tag: D334
type: string
name: extract_symbolic_data
arguments: tag: D46
type: string
name: extract_symbolic_data
arguments: tag: D808
type: string
name: extract_symbolic_data
arguments: tag: D57
type: string
name: extract_symbolic_data
arguments: tag: D515
type: string
name: extract_symbolic_data
arguments: tag: D742
type: string
name: extract_symbolic_data
arguments: tag: D763
type: string
name: extract_symbolic_data
arguments: tag: D621
type: string
name: extract_symbolic_data
arguments: tag: D605
type: string
name: extract_symbolic_data
arguments: tag: D608
type: string
name: extract_symbolic_data
arguments: tag: D273
type: string
name: extract_symbolic_data
arguments: tag: D805
type: string
name: extract_symbolic_data
arguments: tag: D495
type: string
name: extract_symbolic_data
arguments: tag: D368
type: string
name: extract_symbolic_data
arguments: tag: D324
type: string
name: extract_symbolic_data
arguments: tag: D735
type: string
name: extract_symbolic_data
arguments: tag: D10
type: byte[4]
name: extract_symbolic_data
arguments: tag: D475
type: string
name: extract_symbolic_data
arguments: tag: D246
type: string
name: extract_symbolic_data
arguments: tag: D890
type: string
name: extract_symbolic_data
arguments: tag: D339
type: string
name: extract_symbolic_data
arguments: tag: D157
type: string
name: extract_symbolic_data
arguments: tag: D873
type: string
name: extract_symbolic_data
arguments: tag: D865
type: string
name: extract_symbolic_data
arguments: tag: D29
type: string
name: extract_symbolic_data
arguments: tag: D272
type: string
name: extract_symbolic_data
arguments: tag: D124
type: string
name: extract_symbolic_data
arguments: tag: D815
type: string
name: extract_symbolic_data
arguments: tag: D770
type: string
name: extract_symbolic_data
arguments: tag: D482
type: string
name: extract_symbolic_data
arguments: tag: D178
type: string
name: extract_symbolic_data
arguments: tag: D415
type: string
name: extract_symbolic_data
arguments: tag: D874
type: string
name: extract_symbolic_data
arguments: tag: D269
type: string
name: extract_symbolic_data
arguments: tag: D199
type: string
name: extract_symbolic_data
arguments: tag: D488
type: string
name: extract_symbolic_data
arguments: tag: D618
type: string
name: extract_symbolic_data
arguments: tag: D773
type: string
name: extract_symbolic_data
arguments: tag: D457
type: string
name: extract_symbolic_data
arguments: tag: D828
type: string
name: extract_symbolic_data
arguments: tag: D380
type: string
name: extract_symbolic_data
arguments: tag: D611
type: string
name: extract_symbolic_data
arguments: tag: D586
type: string
name: extract_symbolic_data
arguments: tag: D203
type: string
name: extract_symbolic_data
arguments: tag: D372
type: string
name: extract_symbolic_data
arguments: tag: D536
type: string
name: extract_symbolic_data
arguments: tag: D560
type: string
name: extract_symbolic_data
arguments: tag: D247
type: string
name: extract_symbolic_data
arguments: tag: D418
type: string
name: extract_symbolic_data
arguments: tag: D274
type: string
name: extract_symbolic_data
arguments: tag: D854
type: string
name: extract_symbolic_data
arguments: tag: D804
type: string
name: extract_symbolic_data
arguments: tag: D267
type: string
name: extract_symbolic_data
arguments: tag: D384
type: string
name: extract_symbolic_data
arguments: tag: D148
type: string
name: extract_symbolic_data
arguments: tag: D65
type: string
name: extract_symbolic_data
arguments: tag: D91
type: string
name: extract_symbolic_data
arguments: tag: D638
type: string
name: extract_symbolic_data
arguments: tag: D644
type: string
name: extract_symbolic_data
arguments: tag: D33
type: string

tool: D227: rb

tool: D859: wb

tool: D713: end

tool: D432: poke

tool: D778: asm

tool: D568: p

tool: D207: goto

tool: D306: call

tool: D716: return

tool: D196: choose

tool: D797: scene

tool: D880: transition

tool: D431: noskip

tool: D782: manualwrap

tool: D594: autowrap

tool: D190: nodictionarytable

tool: D7: monotext

tool: D317: clear

tool: D334: upload

tool: D46: image

tool: D808: ground

tool: D57: .byt SCR::GROUND

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

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

tool: D763: ; %s


tool: D621: .byt 

tool: D605: 


tool: D608: .byt SCR::NEWLINE

tool: D273: off

tool: D805: toggle

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

tool: D368: 
CutsceneDictionary:


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


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


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

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


tool: D246: Commands: %i


tool: D890: %s%i,

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

tool: D157: NONE

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

tool: D865: .byt SCR::RUN_ASM

tool: D29: DictionaryWord%i: 

tool: D272: 
CutsceneDictionaryTable:


tool: D124: .byt <DictionaryWord%i


tool: D815: .byt >DictionaryWord%i


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

tool: D482: item

tool: D178: notitem

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

tool: D874: $%.2x

tool: D269: [%s]

tool: D199: , 

tool: D488: "%c"

tool: D618: SCR::NEWLINE

tool: D773: .byt SCR::END_SCRIPT

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

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

tool: D380: '"'

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

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

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

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

tool: D536: dictionary not found

tool: D560: input file not found

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

tool: D418: .byt SCR::END_PAGE

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

tool: D854: output file couldn't be opened

tool: D804: .byt SCR::RETURN

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

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

tool: D148: .byt SCR::TRANSITION

tool: D65: .byt SCR::NO_SKIP

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

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

tool: D644: .byt SCR::CLEAR_ALL

tool: D33: .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;
}
```