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    L780
  mov    %rsi,%rbp
  mov    0x8(%rsi),%rdi
  lea    D584(%rip),%rsi
  call   <fopen@plt>
  mov    %rax,%r12
  mov    $0x0,%r13d
  lea    0x1240(%rsp),%rbx
  test   %rax,%rax
  je     L1238
L788:
  mov    %r13d,%r15d
  mov    %r12,%rdx
  mov    $0x2bc,%esi
  mov    %rbx,%rdi
  call   <fgets@plt>
  test   %rax,%rax
  je     L926
  mov    %rbx,%rdi
  call   <RemoveLineEndings@plt>
  mov    %rbx,%rdi
  call   <strlen@plt>
  cmp    $0x1f,%eax
  jg     L739
  movl   $0x0,0x40(%rsp,%r13,4)
  mov    %r13,%rax
  shl    $0x5,%rax
  lea    0x240(%rsp,%rax,1),%rdi
  mov    %rbx,%rsi
  call   <strcpy@plt>
  add    $0x1,%r13
  jmp    L788
L780:
  lea    D47(%rip),%rdi
  call   <puts@plt>
  mov    $0x0,%eax
L1208:
  mov    0x1508(%rsp),%rdx
  sub    %fs:0x28,%rdx
  jne    L1149
  add    $0x1518,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
L1238:
  lea    D400(%rip),%rdi
  call   <puts@plt>
  mov    $0x0,%eax
  jmp    L1208
L739:
  lea    D532(%rip),%rdi
  call   <puts@plt>
  mov    $0xffffffff,%eax
  jmp    L1208
L926:
  mov    0x10(%rbp),%rdi
  lea    D584(%rip),%rsi
  call   <fopen@plt>
  mov    %rax,0x10(%rsp)
  test   %rax,%rax
  je     L1075
  mov    0x18(%rbp),%rdi
  lea    D114(%rip),%rsi
  call   <fopen@plt>
  mov    %rax,%r14
  test   %rax,%rax
  je     L108
  movl   $0x1,0x30(%rsp)
  movl   $0x1,0x18(%rsp)
  movl   $0x0,0x34(%rsp)
  movl   $0x0,0x2c(%rsp)
  mov    %r13,0x20(%rsp)
  jmp    L570
L1075:
  lea    D624(%rip),%rdi
  call   <puts@plt>
  mov    $0x0,%eax
  jmp    L1208
L108:
  mov    0x10(%rsp),%rdi
  call   <fclose@plt>
  lea    D458(%rip),%rdi
  call   <puts@plt>
  mov    $0x0,%eax
  jmp    L1208
L1030:
  lea    0x1241(%rsp),%rdi
  mov    %r14,%rsi
  call   <fputs@plt>
  jmp    L1140
L546:
  mov    %r14,%rcx
  mov    $0x11,%edx
  mov    $0x1,%esi
  lea    D798(%rip),%rdi
  call   <fwrite@plt>
L59:
  cmpb   $0x3f,0x1240(%rsp)
  je     L1181
  lea    0x1241(%rsp),%rdi
  lea    D765(%rip),%rsi
  call   <strcmp@plt>
  test   %eax,%eax
  je     L1011
L593:
  lea    0x1241(%rsp),%rdi
  lea    D709(%rip),%rsi
  call   <strcmp@plt>
  test   %eax,%eax
  je     L938
L1245:
  lea    0x1241(%rsp),%rdi
  lea    D839(%rip),%rsi
  call   <strcmp@plt>
  test   %eax,%eax
  je     L448
L1140:
  cmpb   $0x0,0x1240(%rsp)
  jne    L483
L570:
  lea    0x1240(%rsp),%rbx
L1062:
  mov    0x10(%rsp),%rdx
  mov    $0x2bc,%esi
  mov    %rbx,%rdi
  call   <fgets@plt>
  test   %rax,%rax
  je     L943
  mov    %rbx,%rdi
  call   <RemoveLineEndings@plt>
  movzbl 0x1240(%rsp),%eax
  test   %al,%al
  je     L1062
  cmp    $0x3a,%al
  je     L1030
  cmp    $0x60,%al
  je     L1067
  cmp    $0x3f,%al
  jne    L1125
L1067:
  lea    0x1240(%rsp),%rdi
  mov    $0x20,%esi
  call   <strchr@plt>
  mov    %rax,%rbx
  test   %rax,%rax
  je     L778
  movb   $0x0,(%rax)
  lea    0x1(%rax),%rbx
L778:
  lea    0x1241(%rsp),%rdi
  lea    D556(%rip),%rsi
  call   <strcmp@plt>
  test   %eax,%eax
  je     L546
  lea    0x1241(%rsp),%rdi
  lea    D356(%rip),%rsi
  call   <strcmp@plt>
  test   %eax,%eax
  je     L955
  lea    0x1241(%rsp),%rdi
  lea    D676(%rip),%rsi
  call   <strcmp@plt>
  test   %eax,%eax
  je     L1168
  lea    0x1241(%rsp),%rdi
  lea    D382(%rip),%rsi
  call   <strcmp@plt>
  test   %eax,%eax
  je     L265
  lea    0x1241(%rsp),%rdi
  lea    D896(%rip),%rsi
  call   <strcmp@plt>
  test   %eax,%eax
  je     L704
  lea    0x1241(%rsp),%rdi
  lea    D533(%rip),%rsi
  call   <strcmp@plt>
  test   %eax,%eax
  je     L196
  lea    0x1241(%rsp),%rdi
  lea    D309(%rip),%rsi
  call   <strcmp@plt>
  test   %eax,%eax
  je     L653
  lea    0x1241(%rsp),%rdi
  lea    D515(%rip),%rsi
  call   <strcmp@plt>
  test   %eax,%eax
  je     L452
  lea    0x1241(%rsp),%rdi
  lea    D895(%rip),%rsi
  call   <strcmp@plt>
  test   %eax,%eax
  je     L694
  lea    0x1241(%rsp),%rdi
  lea    D456(%rip),%rsi
  call   <strcmp@plt>
  test   %eax,%eax
  je     L368
  lea    0x1241(%rsp),%rdi
  lea    D651(%rip),%rsi
  call   <strcmp@plt>
  test   %eax,%eax
  je     L485
  lea    0x1241(%rsp),%rdi
  lea    D266(%rip),%rsi
  call   <strcmp@plt>
  test   %eax,%eax
  je     L27
  lea    0x1241(%rsp),%rdi
  lea    D26(%rip),%rsi
  call   <strcmp@plt>
  test   %eax,%eax
  je     L686
  lea    0x1241(%rsp),%rdi
  lea    D655(%rip),%rsi
  call   <strcmp@plt>
  test   %eax,%eax
  je     L856
  lea    0x1241(%rsp),%rdi
  lea    D542(%rip),%rsi
  call   <strcmp@plt>
  test   %eax,%eax
  je     L1268
  lea    0x1241(%rsp),%rdi
  lea    D91(%rip),%rsi
  call   <strcmp@plt>
  test   %eax,%eax
  je     L808
  lea    0x1241(%rsp),%rdi
  lea    D247(%rip),%rsi
  call   <strcmp@plt>
  test   %eax,%eax
  je     L774
  lea    0x1241(%rsp),%rdi
  lea    D75(%rip),%rsi
  call   <strcmp@plt>
  test   %eax,%eax
  je     L986
  lea    0x1241(%rsp),%rdi
  lea    D313(%rip),%rsi
  call   <strcmp@plt>
  test   %eax,%eax
  je     L209
  lea    0x1241(%rsp),%rdi
  lea    D767(%rip),%rsi
  call   <strcmp@plt>
  test   %eax,%eax
  jne    L59
  mov    %r14,%rcx
  mov    $0x10,%edx
  mov    $0x1,%esi
  lea    D60(%rip),%rdi
  call   <fwrite@plt>
  jmp    L59
L955:
  mov    %r14,%rcx
  mov    $0x14,%edx
  mov    $0x1,%esi
  lea    D572(%rip),%rdi
  call   <fwrite@plt>
  jmp    L59
L1168:
  mov    %rbx,%rcx
  mov    %rbx,%rdx
  lea    D115(%rip),%rsi
  mov    %r14,%rdi
  call   <fprintf@plt>
  jmp    L59
L265:
  mov    %r14,%rcx
  mov    $0x11,%edx
  mov    $0x1,%esi
  lea    D229(%rip),%rdi
  call   <fwrite@plt>
  jmp    L59
L704:
  mov    %r14,%rcx
  mov    $0x12,%edx
  mov    $0x1,%esi
  lea    D928(%rip),%rdi
  call   <fwrite@plt>
  jmp    L59
L196:
  mov    %rbx,%rcx
  mov    %rbx,%rdx
  lea    D359(%rip),%rsi
  mov    %r14,%rdi
  call   <fprintf@plt>
  jmp    L59
L653:
  mov    %rbx,%rcx
  mov    %rbx,%rdx
  lea    D396(%rip),%rsi
  mov    %r14,%rdi
  call   <fprintf@plt>
  jmp    L59
L452:
  mov    %r14,%rcx
  mov    $0x10,%edx
  mov    $0x1,%esi
  lea    D555(%rip),%rdi
  call   <fwrite@plt>
  jmp    L59
L694:
  mov    %rbx,%rdx
  lea    D931(%rip),%rsi
  mov    %r14,%rdi
  call   <fprintf@plt>
  jmp    L59
L368:
  mov    %rbx,%rdx
  lea    D206(%rip),%rsi
  mov    %r14,%rdi
  call   <fprintf@plt>
  jmp    L59
L485:
  mov    %r14,%rcx
  mov    $0x14,%edx
  mov    $0x1,%esi
  lea    D399(%rip),%rdi
  call   <fwrite@plt>
  jmp    L59
L27:
  mov    %r14,%rcx
  mov    $0x11,%edx
  mov    $0x1,%esi
  lea    D914(%rip),%rdi
  call   <fwrite@plt>
  jmp    L59
L808:
  mov    %rbx,%rcx
  mov    %rbx,%rdx
  lea    D817(%rip),%rsi
  mov    %r14,%rdi
  call   <fprintf@plt>
  jmp    L59
L774:
  mov    %r14,%rcx
  mov    $0x13,%edx
  mov    $0x1,%esi
  lea    D796(%rip),%rdi
  call   <fwrite@plt>
  jmp    L59
L986:
  mov    %rbx,%rdx
  lea    D392(%rip),%rsi
  mov    %r14,%rdi
  call   <fprintf@plt>
  jmp    L59
L209:
  mov    %rbx,%rdx
  lea    D231(%rip),%rsi
  mov    %r14,%rdi
  call   <fprintf@plt>
  jmp    L59
L686:
  mov    %eax,0x18(%rsp)
  jmp    L59
L856:
  movl   $0x1,0x18(%rsp)
  jmp    L59
L1268:
  mov    %eax,0x30(%rsp)
  jmp    L59
L1181:
  lea    0x1241(%rsp),%rdi
  lea    D765(%rip),%rsi
  call   <strcmp@plt>
  test   %eax,%eax
  je     L1026
L177:
  lea    0x1241(%rsp),%rdi
  lea    D709(%rip),%rsi
  call   <strcmp@plt>
  test   %eax,%eax
  je     L999
L550:
  lea    0x1241(%rsp),%rdi
  lea    D418(%rip),%rsi
  call   <strcmp@plt>
  test   %eax,%eax
  je     L420
L817:
  lea    0x1241(%rsp),%rdi
  lea    D528(%rip),%rsi
  call   <strcmp@plt>
  test   %eax,%eax
  jne    L1140
  mov    %rbx,%rdx
  lea    D642(%rip),%rsi
  mov    %r14,%rdi
  call   <fprintf@plt>
  jmp    L1140
L1026:
  mov    %rbx,%rdx
  lea    D189(%rip),%rsi
  mov    %r14,%rdi
  call   <fprintf@plt>
  jmp    L177
L999:
  mov    %rbx,%rdx
  lea    D215(%rip),%rsi
  mov    %r14,%rdi
  call   <fprintf@plt>
  jmp    L550
L420:
  mov    %rbx,%rdx
  lea    D73(%rip),%rsi
  mov    %r14,%rdi
  call   <fprintf@plt>
  jmp    L817
L1011:
  mov    %rbx,%rdx
  lea    D633(%rip),%rsi
  mov    %r14,%rdi
  call   <fprintf@plt>
  jmp    L593
L938:
  mov    %rbx,%rdx
  lea    D627(%rip),%rsi
  mov    %r14,%rdi
  call   <fprintf@plt>
  jmp    L1245
L448:
  mov    %rbx,%rdx
  lea    D174(%rip),%rsi
  mov    %r14,%rdi
  call   <fprintf@plt>
  jmp    L1140
L1125:
  lea    0x1240(%rsp),%rdx
  lea    D794(%rip),%rsi
  mov    %r14,%rdi
  mov    $0x0,%eax
  call   <fprintf@plt>
  movzbl 0x1240(%rsp),%eax
  cmp    $0x3e,%al
  je     L698
  cmp    $0x5b,%al
  je     L616
  cmp    $0x3c,%al
  je     L1002
  cmpl   $0x0,0x18(%rsp)
  jne    L100
  mov    %r14,%rcx
  mov    $0x5,%edx
  mov    $0x1,%esi
  lea    D442(%rip),%rdi
  call   <fwrite@plt>
  mov    0x18(%rsp),%eax
  mov    %eax,0x8(%rsp)
  lea    0x1240(%rsp),%r12
  jmp    L533
L1002:
  lea    0x1240(%rsp),%rdi
  mov    $0x3e,%esi
  call   <strchr@plt>
  lea    0x1(%rax),%r12
  movb   $0x0,(%rax)
  lea    0x1243(%rsp),%rcx
  movsbl 0x1241(%rsp),%edx
  lea    D150(%rip),%rsi
  mov    %r14,%rdi
  mov    $0x0,%eax
  call   <fprintf@plt>
  addl   $0x2,0x34(%rsp)
L783:
  lea    0x1240(%rsp),%rax
  cmp    %rax,%r12
  jne    L229
  cmpl   $0x0,0x18(%rsp)
  jne    L193
L229:
  movl   $0x1,0x8(%rsp)
  cmpl   $0x0,0x18(%rsp)
  jne    L741
L533:
  mov    %r12,%rdi
  call   <strlen@plt>
  add    %eax,0x2c(%rsp)
  jmp    L63
L698:
  lea    0x1240(%rsp),%rdi
  mov    $0x3c,%esi
  call   <strchr@plt>
  lea    0x1(%rax),%r12
  movb   $0x0,(%rax)
  lea    0x1243(%rsp),%rcx
  movsbl 0x1241(%rsp),%edx
  lea    D745(%rip),%rsi
  mov    %r14,%rdi
  mov    $0x0,%eax
  call   <fprintf@plt>
  addl   $0x2,0x34(%rsp)
  jmp    L783
L616:
  lea    0x1240(%rsp),%rdi
  mov    $0x5d,%esi
  call   <strchr@plt>
  lea    0x1(%rax),%r12
  movb   $0x0,(%rax)
  lea    0x1241(%rsp),%rdx
  cmpb   $0x0,0x1241(%rsp)
  lea    D54(%rip),%rax
  cmove  %rax,%rdx
  lea    D147(%rip),%rsi
  mov    %r14,%rdi
  mov    $0x0,%eax
  call   <fprintf@plt>
  addl   $0x2,0x34(%rsp)
  jmp    L783
L100:
  lea    0x1240(%rsp),%r12
L193:
  mov    %r14,%rcx
  mov    $0x11,%edx
  mov    $0x1,%esi
  lea    D798(%rip),%rdi
  call   <fwrite@plt>
L741:
  lea    0x1(%r12),%rbx
  mov    $0x0,%eax
  mov    %r12,0x8(%rsp)
  mov    %r14,0x38(%rsp)
  mov    %eax,%r14d
  jmp    L258
L828:
  movzbl 0x0(%r13),%eax
  test   $0xdf,%al
  je     L343
  mov    %r13,%rbp
  mov    $0x0,%r12d
L819:
  movsbl %al,%edi
  call   <CharWidth@plt>
  add    %eax,%r12d
  add    $0x1,%rbp
  movzbl 0x0(%rbp),%eax
  test   $0xdf,%al
  jne    L819
L682:
  mov    $0x20,%edi
  call   <CharWidth@plt>
  add    %r14d,%eax
  add    %r12d,%eax
  cmp    $0x7f,%eax
  jle    L835
  movb   $0xa,-0x1(%r13)
  mov    $0x0,%r14d
L859:
  add    $0x1,%rbx
L258:
  mov    %rbx,%r13
  movzbl -0x1(%rbx),%eax
  test   %al,%al
  je     L731
  cmp    $0x20,%al
  je     L828
L835:
  movzbl -0x1(%r13),%eax
  cmp    $0xa,%al
  je     L859
  movsbl %al,%edi
  call   <CharWidth@plt>
  add    %eax,%r14d
  jmp    L859
L343:
  mov    $0x0,%r12d
  jmp    L682
L731:
  mov    0x8(%rsp),%r12
  mov    0x38(%rsp),%r14
  movl   $0x1,0x8(%rsp)
  jmp    L533
L82:
  cmpl   $0x0,0x8(%rsp)
  jne    L990
L1121:
  lea    0x80(%rbp),%edx
  lea    D348(%rip),%rsi
  mov    %r14,%rdi
  mov    $0x0,%eax
  call   <fprintf@plt>
  mov    %r13,%rsi
  lea    D589(%rip),%rdi
  mov    $0x0,%eax
  call   <printf@plt>
  mov    %r13,%rdi
  call   <strlen@plt>
  cltq
  add    %rax,%r12
  movslq %ebp,%rax
  addl   $0x1,0x40(%rsp,%rax,4)
  movl   $0x1,0x8(%rsp)
L402:
  cmp    %ebp,%r15d
  je     L714
L63:
  cmpb   $0x0,(%r12)
  je     L347
  lea    0x240(%rsp),%rbx
  mov    $0x0,%ebp
  test   %r15d,%r15d
  jle    L402
L442:
  mov    %rbx,%r13
  mov    %rbx,%rsi
  mov    %r12,%rdi
  call   <Match@plt>
  test   %rax,%rax
  jne    L82
  add    $0x1,%ebp
  add    $0x20,%rbx
  cmp    %ebp,%r15d
  jne    L442
L714:
  cmpl   $0x0,0x8(%rsp)
  jne    L728
L342:
  movzbl (%r12),%edx
  cmp    $0x22,%dl
  je     L496
  cmp    $0xa,%dl
  je     L555
  movsbl %dl,%edx
  lea    D665(%rip),%rsi
  mov    %r14,%rdi
  mov    $0x0,%eax
  call   <fprintf@plt>
L1273:
  movsbl (%r12),%edi
  call   <putchar@plt>
  add    $0x1,%r12
  movl   $0x1,0x8(%rsp)
  jmp    L63
L990:
  mov    %r14,%rcx
  mov    $0x2,%edx
  mov    $0x1,%esi
  lea    D706(%rip),%rdi
  call   <fwrite@plt>
  jmp    L1121
L728:
  mov    %r14,%rcx
  mov    $0x2,%edx
  mov    $0x1,%esi
  lea    D706(%rip),%rdi
  call   <fwrite@plt>
  jmp    L342
L496:
  mov    $0x22,%edx
  lea    D344(%rip),%rsi
  mov    %r14,%rdi
  mov    $0x0,%eax
  call   <fprintf@plt>
  jmp    L1273
L555:
  mov    %r14,%rcx
  mov    $0xc,%edx
  mov    $0x1,%esi
  lea    D701(%rip),%rdi
  call   <fwrite@plt>
  jmp    L1273
L347:
  mov    $0xa,%edi
  call   <putchar@plt>
  jmp    L1140
L483:
  mov    %r14,%rcx
  mov    $0x2,%edx
  mov    $0x1,%esi
  lea    D387(%rip),%rdi
  call   <fwrite@plt>
  jmp    L570
L943:
  mov    0x20(%rsp),%r13
  mov    0x10(%rsp),%rdi
  call   <fclose@plt>
  mov    %r14,%rcx
  mov    $0x17,%edx
  mov    $0x1,%esi
  lea    D390(%rip),%rdi
  call   <fwrite@plt>
  test   %r15d,%r15d
  jle    L71
  mov    %r13d,%eax
  mov    %rax,0x18(%rsp)
  mov    $0x0,%ebp
  mov    $0x0,%r13d
  movl   $0x0,0x10(%rsp)
  lea    0x240(%rsp),%rax
  mov    %rax,0x20(%rsp)
  mov    %r15d,0x38(%rsp)
  mov    0x30(%rsp),%r15d
  jmp    L277
L133:
  movsbl %r12b,%ecx
  mov    %rbx,%rdx
  lea    D384(%rip),%rsi
  mov    %r14,%rdi
  mov    $0x0,%eax
  call   <fprintf@plt>
  add    $0x1,%rbp
  cmp    %rbp,0x18(%rsp)
  je     L455
L277:
  mov    %ebp,0x8(%rsp)
  mov    %rbp,%rbx
  shl    $0x5,%rbx
  add    0x20(%rsp),%rbx
  mov    %rbx,%rdi
  call   <strlen@plt>
  add    %eax,0x10(%rsp)
  mov    %rbx,%rdi
  call   <strlen@plt>
  mov    %eax,%edx
  mov    0x40(%rsp,%rbp,4),%eax
  sub    $0x1,%eax
  imul   %edx,%eax
  lea    -0x1(%r13,%rax,1),%r13d
  mov    %rbx,%rdi
  call   <strlen@plt>
  add    %rbx,%rax
  movzbl -0x1(%rax),%r12d
  movb   $0x0,-0x1(%rax)
  test   %r15d,%r15d
  je     L133
  mov    0x8(%rsp),%edx
  lea    D927(%rip),%rsi
  mov    %r14,%rdi
  mov    $0x0,%eax
  call   <fprintf@plt>
  jmp    L133
L455:
  mov    0x38(%rsp),%r15d
  cmpl   $0x0,0x30(%rsp)
  jne    L520
L118:
  mov    %r14,%rdi
  call   <fclose@plt>
  mov    0x2c(%rsp),%r14d
  mov    %r14d,%ebp
  sub    %r13d,%ebp
  pxor   %xmm1,%xmm1
  cvtsi2ss %ebp,%xmm1
  pxor   %xmm0,%xmm0
  cvtsi2ss %r14d,%xmm0
  divss  %xmm0,%xmm1
  movd   %xmm1,%ebx
  mov    %r13d,%ecx
  mov    0x10(%rsp),%edx
  mov    %r15d,%esi
  lea    D477(%rip),%rdi
  mov    $0x0,%eax
  call   <printf@plt>
  movd   %ebx,%xmm0
  mulss  D194(%rip),%xmm0
  cvtss2sd %xmm0,%xmm0
  mov    %ebp,%edx
  mov    %r14d,%esi
  lea    D78(%rip),%rdi
  mov    $0x1,%eax
  call   <printf@plt>
  mov    0x34(%rsp),%esi
  lea    D475(%rip),%rdi
  mov    $0x0,%eax
  call   <printf@plt>
  test   %r15d,%r15d
  jle    L290
L758:
  mov    $0x0,%ebx
  lea    D327(%rip),%rbp
L294:
  mov    0x40(%rsp,%rbx,4),%edx
  mov    %rbx,%rax
  shl    $0x5,%rax
  lea    0x240(%rsp,%rax,1),%rsi
  mov    %rbp,%rdi
  mov    $0x0,%eax
  call   <printf@plt>
  add    $0x1,%rbx
  cmp    %ebx,%r15d
  jg     L294
L290:
  mov    $0xa,%edi
  call   <putchar@plt>
  mov    $0x0,%eax
  jmp    L1208
L520:
  mov    %r14,%rcx
  mov    $0x1c,%edx
  mov    $0x1,%esi
  lea    D804(%rip),%rdi
  call   <fwrite@plt>
  test   %r15d,%r15d
  jle    L187
  mov    $0x0,%ebx
  lea    D856(%rip),%rbp
L887:
  mov    %ebx,%edx
  mov    %rbp,%rsi
  mov    %r14,%rdi
  mov    $0x0,%eax
  call   <fprintf@plt>
  mov    %ebx,%r12d
  add    $0x1,%ebx
  cmp    %ebx,%r15d
  jne    L887
  mov    $0x0,%ebp
L372:
  mov    %ebp,%edx
  lea    D575(%rip),%rsi
  mov    %r14,%rdi
  mov    $0x0,%eax
  call   <fprintf@plt>
  mov    %ebp,%eax
  add    $0x1,%ebp
  cmp    %eax,%r12d
  jne    L372
  mov    %r14,%rdi
  call   <fclose@plt>
  mov    0x2c(%rsp),%r14d
  mov    %r14d,%r12d
  sub    %r13d,%r12d
  pxor   %xmm1,%xmm1
  cvtsi2ss %r12d,%xmm1
  pxor   %xmm0,%xmm0
  cvtsi2ss %r14d,%xmm0
  divss  %xmm0,%xmm1
  movd   %xmm1,%ebp
  mov    %r13d,%ecx
  mov    0x10(%rsp),%edx
  mov    %ebx,%esi
  lea    D477(%rip),%rdi
  mov    $0x0,%eax
  call   <printf@plt>
  movd   %ebp,%xmm0
  mulss  D194(%rip),%xmm0
  cvtss2sd %xmm0,%xmm0
  mov    %r12d,%edx
  mov    %r14d,%esi
  lea    D78(%rip),%rdi
  mov    $0x1,%eax
  call   <printf@plt>
  mov    0x34(%rsp),%esi
  lea    D475(%rip),%rdi
  mov    $0x0,%eax
  call   <printf@plt>
  jmp    L758
L918:
  mov    %r14,%rcx
  mov    $0x1c,%edx
  mov    $0x1,%esi
  lea    D804(%rip),%rdi
  call   <fwrite@plt>
  mov    $0x0,%r13d
  movl   $0x0,0x10(%rsp)
L187:
  mov    %r14,%rdi
  call   <fclose@plt>
  mov    0x2c(%rsp),%eax
  mov    %eax,%r14d
  sub    %r13d,%r14d
  mov    %r14d,%ebp
  pxor   %xmm1,%xmm1
  cvtsi2ss %r14d,%xmm1
  mov    %eax,%r14d
  pxor   %xmm0,%xmm0
  cvtsi2ss %eax,%xmm0
  divss  %xmm0,%xmm1
  movd   %xmm1,%ebx
  mov    %r13d,%ecx
  mov    0x10(%rsp),%edx
  mov    %r15d,%esi
  lea    D477(%rip),%rdi
  mov    $0x0,%eax
  call   <printf@plt>
  movd   %ebx,%xmm0
  mulss  D194(%rip),%xmm0
  cvtss2sd %xmm0,%xmm0
  mov    %ebp,%edx
  mov    %r14d,%esi
  lea    D78(%rip),%rdi
  mov    $0x1,%eax
  call   <printf@plt>
  mov    0x34(%rsp),%esi
  lea    D475(%rip),%rdi
  mov    $0x0,%eax
  call   <printf@plt>
  jmp    L290
L71:
  mov    0x30(%rsp),%eax
  test   %eax,%eax
  jne    L918
  mov    %eax,%r13d
  mov    %eax,0x10(%rsp)
  jmp    L118
L1149:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: read_data
arguments: data_label: D584
type: string
name: read_data
arguments: data_label: D47
type: string
name: read_data
arguments: data_label: D400
type: string
name: read_data
arguments: data_label: D532
type: string
name: read_data
arguments: data_label: D114
type: string
name: read_data
arguments: data_label: D624
type: string
name: read_data
arguments: data_label: D458
type: string
name: read_data
arguments: data_label: D798
type: string
name: read_data
arguments: data_label: D765
type: string
name: read_data
arguments: data_label: D709
type: string
name: read_data
arguments: data_label: D839
type: string
name: read_data
arguments: data_label: D556
type: string
name: read_data
arguments: data_label: D356
type: string
name: read_data
arguments: data_label: D676
type: string
name: read_data
arguments: data_label: D382
type: string
name: read_data
arguments: data_label: D896
type: string
name: read_data
arguments: data_label: D533
type: string
name: read_data
arguments: data_label: D309
type: string
name: read_data
arguments: data_label: D515
type: string
name: read_data
arguments: data_label: D895
type: string
name: read_data
arguments: data_label: D456
type: string
name: read_data
arguments: data_label: D651
type: string
name: read_data
arguments: data_label: D266
type: string
name: read_data
arguments: data_label: D26
type: string
name: read_data
arguments: data_label: D655
type: string
name: read_data
arguments: data_label: D542
type: string
name: read_data
arguments: data_label: D91
type: string
name: read_data
arguments: data_label: D247
type: string
name: read_data
arguments: data_label: D75
type: string
name: read_data
arguments: data_label: D313
type: string
name: read_data
arguments: data_label: D767
type: string
name: read_data
arguments: data_label: D60
type: string
name: read_data
arguments: data_label: D572
type: string
name: read_data
arguments: data_label: D115
type: string
name: read_data
arguments: data_label: D229
type: string
name: read_data
arguments: data_label: D928
type: string
name: read_data
arguments: data_label: D359
type: string
name: read_data
arguments: data_label: D396
type: string
name: read_data
arguments: data_label: D555
type: string
name: read_data
arguments: data_label: D931
type: string
name: read_data
arguments: data_label: D206
type: string
name: read_data
arguments: data_label: D399
type: string
name: read_data
arguments: data_label: D914
type: string
name: read_data
arguments: data_label: D817
type: string
name: read_data
arguments: data_label: D796
type: string
name: read_data
arguments: data_label: D392
type: string
name: read_data
arguments: data_label: D231
type: string
name: read_data
arguments: data_label: D418
type: string
name: read_data
arguments: data_label: D528
type: string
name: read_data
arguments: data_label: D642
type: string
name: read_data
arguments: data_label: D189
type: string
name: read_data
arguments: data_label: D215
type: string
name: read_data
arguments: data_label: D73
type: string
name: read_data
arguments: data_label: D633
type: string
name: read_data
arguments: data_label: D627
type: string
name: read_data
arguments: data_label: D174
type: string
name: read_data
arguments: data_label: D794
type: string
name: read_data
arguments: data_label: D442
type: string
name: read_data
arguments: data_label: D150
type: string
name: read_data
arguments: data_label: D745
type: string
name: read_data
arguments: data_label: D54
type: string
name: read_data
arguments: data_label: D147
type: string
name: read_data
arguments: data_label: D348
type: string
name: read_data
arguments: data_label: D589
type: string
name: read_data
arguments: data_label: D665
type: string
name: read_data
arguments: data_label: D706
type: string
name: read_data
arguments: data_label: D344
type: string
name: read_data
arguments: data_label: D701
type: string
name: read_data
arguments: data_label: D387
type: string
name: read_data
arguments: data_label: D390
type: string
name: read_data
arguments: data_label: D384
type: string
name: read_data
arguments: data_label: D927
type: string
name: read_data
arguments: data_label: D477
type: string
name: read_data
arguments: data_label: D194
type: byte[4]
name: read_data
arguments: data_label: D78
type: string
name: read_data
arguments: data_label: D475
type: string
name: read_data
arguments: data_label: D327
type: string
name: read_data
arguments: data_label: D804
type: string
name: read_data
arguments: data_label: D856
type: string
name: read_data
arguments: data_label: D575
type: string

tool: D584: rb

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

tool: D400: dictionary not found

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

tool: D114: wb

tool: D624: input file not found

tool: D458: output file couldn't be opened

tool: D798: .byt SCR::NEWLINE

tool: D765: on

tool: D709: off

tool: D839: toggle

tool: D556: nl

tool: D356: end

tool: D676: poke

tool: D382: asm

tool: D896: p

tool: D533: goto

tool: D309: call

tool: D515: return

tool: D895: choose

tool: D456: scene

tool: D651: transition

tool: D266: noskip

tool: D26: manualwrap

tool: D655: autowrap

tool: D542: nodictionarytable

tool: D91: monotext

tool: D247: clear

tool: D75: upload

tool: D313: image

tool: D767: ground

tool: D60: .byt SCR::GROUND

tool: D572: .byt SCR::END_SCRIPT

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

tool: D229: .byt SCR::RUN_ASM

tool: D928: .byt SCR::END_PAGE

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

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

tool: D555: .byt SCR::RETURN

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

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

tool: D399: .byt SCR::TRANSITION

tool: D914: .byt SCR::NO_SKIP

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

tool: D796: .byt SCR::CLEAR_ALL

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

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

tool: D418: item

tool: D528: notitem

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

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

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

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

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

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

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

tool: D794: ; %s


tool: D442: .byt 

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

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

tool: D54: NONE

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

tool: D348: $%.2x

tool: D589: [%s]

tool: D665: "%c"

tool: D706: , 

tool: D344: '"'

tool: D701: SCR::NEWLINE

tool: D387: 


tool: D390: 
CutsceneDictionary:


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


tool: D927: DictionaryWord%i: 

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


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

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


tool: D475: Commands: %i


tool: D327: %s%i,

tool: D804: 
CutsceneDictionaryTable:


tool: D856: .byt <DictionaryWord%i


tool: D575: .byt >DictionaryWord%i


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