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

```asm
<main>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x108,%rsp
  mov    %edi,0x8(%rsp)
  mov    %rsi,%rbp
  mov    %fs:0x28,%rax
  mov    %rax,0xf8(%rsp)
  xor    %eax,%eax
  mov    $0x32,%edi
  call   <malloc@plt>
  mov    %rax,%r12
  mov    $0x32,%edi
  call   <malloc@plt>
  mov    %rax,0x10(%rsp)
  mov    $0x32,%edi
  call   <malloc@plt>
  mov    %rax,%r14
  mov    $0xc8,%edi
  call   <malloc@plt>
  mov    %rax,0x48(%rsp)
  mov    $0xc8,%edi
  call   <malloc@plt>
  mov    %rax,0x98(%rsp)
  mov    $0xc8,%edi
  call   <malloc@plt>
  mov    %rax,0xa8(%rsp)
  mov    $0x1,%edi
  call   <malloc@plt>
  mov    %rax,0x78(%rsp)
  mov    $0x40,%edi
  call   <malloc@plt>
  mov    %rax,%r15
  mov    $0x40,%edi
  call   <malloc@plt>
  mov    %rax,%r13
  mov    $0x10,%edi
  call   <malloc@plt>
  mov    %rax,0x60(%rsp)
  mov    $0x14,%edi
  call   <malloc@plt>
  mov    %rax,0x50(%rsp)
  mov    $0x14,%edi
  call   <malloc@plt>
  mov    %rax,0x58(%rsp)
  lea    D652(%rip),%rsi
  lea    D98(%rip),%rdi
  call   <fopen@plt>
  test   %rax,%rax
  je     L441
  mov    %rax,%rbx
  lea    0xcc(%rsp),%rdx
  lea    D139(%rip),%rsi
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <fscanf@plt>
  test   %ax,%ax
  je     L28
  lea    0xce(%rsp),%rdx
  lea    D633(%rip),%rsi
  mov    %rbx,%rdi
  mov    $0x0,%eax
  call   <fscanf@plt>
  test   %ax,%ax
  je     L182
  lea    0xd0(%rsp),%rdx
  lea    D181(%rip),%rsi
  mov    %rbx,%rdi
  mov    $0x0,%eax
  call   <fscanf@plt>
  test   %ax,%ax
  je     L96
  lea    0xd8(%rsp),%rdx
  lea    D592(%rip),%rsi
  mov    %rbx,%rdi
  mov    $0x0,%eax
  call   <fscanf@plt>
  test   %ax,%ax
  je     L311
  lea    0xe0(%rsp),%rdx
  lea    D389(%rip),%rsi
  mov    %rbx,%rdi
  mov    $0x0,%eax
  call   <fscanf@plt>
  test   %ax,%ax
  je     L162
  lea    0xe8(%rsp),%rdx
  lea    D232(%rip),%rsi
  mov    %rbx,%rdi
  mov    $0x0,%eax
  call   <fscanf@plt>
  test   %ax,%ax
  je     L313
  lea    0xf0(%rsp),%rdx
  lea    D666(%rip),%rsi
  mov    %rbx,%rdi
  mov    $0x0,%eax
  call   <fscanf@plt>
  test   %ax,%ax
  je     L321
  mov    %rbx,%rdi
  call   <fclose@plt>
  lea    D503(%rip),%rdi
  call   <puts@plt>
  movswl 0xcc(%rsp),%esi
  lea    D139(%rip),%rdi
  mov    $0x0,%eax
  call   <printf@plt>
  movswl 0xce(%rsp),%esi
  lea    D633(%rip),%rdi
  mov    $0x0,%eax
  call   <printf@plt>
  movsd  0xd0(%rsp),%xmm0
  lea    D181(%rip),%rdi
  mov    $0x1,%eax
  call   <printf@plt>
  movsd  0xd8(%rsp),%xmm0
  lea    D592(%rip),%rdi
  mov    $0x1,%eax
  call   <printf@plt>
  movsd  0xe0(%rsp),%xmm0
  lea    D389(%rip),%rdi
  mov    $0x1,%eax
  call   <printf@plt>
  movsd  0xe8(%rsp),%xmm0
  lea    D232(%rip),%rdi
  mov    $0x1,%eax
  call   <printf@plt>
  movsd  0xf0(%rsp),%xmm0
  lea    D666(%rip),%rdi
  mov    $0x1,%eax
  call   <printf@plt>
  mov    $0xa,%edi
  call   <putchar@plt>
  cmpl   $0x1,0x8(%rsp)
  jle    L286
  mov    0x8(%rbp),%rsi
  mov    %r12,%rdi
  call   <strcpy@plt>
  cmpl   $0x2,0x8(%rsp)
  jle    L315
  mov    0x10(%rbp),%rax
  movzbl (%rax),%eax
  mov    0x78(%rsp),%rdx
  mov    %al,(%rdx)
L243:
  mov    %r12,%rsi
  mov    0x10(%rsp),%rbx
  mov    %rbx,%rdi
  call   <strcpy@plt>
  lea    D423(%rip),%rsi
  mov    %rbx,%rdi
  call   <strcat@plt>
  mov    %r12,%rsi
  mov    %r14,%rdi
  call   <strcpy@plt>
  lea    D338(%rip),%rsi
  mov    %r14,%rdi
  call   <strcat@plt>
  lea    D652(%rip),%rsi
  mov    %rbx,%rdi
  call   <fopen@plt>
  mov    %rax,0x30(%rsp)
  test   %rax,%rax
  je     L118
  lea    D492(%rip),%rsi
  mov    %r14,%rdi
  call   <fopen@plt>
  mov    %rax,0x70(%rsp)
  test   %rax,%rax
  je     L340
  lea    D367(%rip),%rsi
  mov    0x30(%rsp),%rdi
  mov    $0x0,%eax
  call   <fscanf@plt>
  mov    0x78(%rsp),%rax
  cmpb   $0x79,(%rax)
  je     L220
  mov    0x70(%rsp),%rcx
  mov    $0xf,%edx
  mov    $0x1,%esi
  lea    D40(%rip),%rdi
  call   <fwrite@plt>
  jmp    L412
L441:
  lea    D159(%rip),%rdi
  call   <puts@plt>
  jmp    L85
L28:
  lea    D340(%rip),%rdi
  call   <puts@plt>
L85:
  mov    $0xffffffff,%eax
  jmp    L264
L182:
  lea    D558(%rip),%rdi
  call   <puts@plt>
  jmp    L85
L96:
  lea    D364(%rip),%rdi
  call   <puts@plt>
  jmp    L85
L311:
  lea    D331(%rip),%rdi
  call   <puts@plt>
  jmp    L85
L162:
  lea    D179(%rip),%rdi
  call   <puts@plt>
  jmp    L85
L313:
  lea    D574(%rip),%rdi
  call   <puts@plt>
  jmp    L85
L321:
  lea    D67(%rip),%rdi
  call   <puts@plt>
  jmp    L85
L286:
  lea    D174(%rip),%rdi
  mov    $0x0,%eax
  call   <printf@plt>
  mov    %r12,%rsi
  lea    D649(%rip),%rdi
  call   <scanf@plt>
L315:
  lea    D217(%rip),%rdi
  call   <puts@plt>
  mov    0x78(%rsp),%rsi
  lea    D649(%rip),%rdi
  call   <scanf@plt>
  jmp    L243
L118:
  mov    0x10(%rsp),%rsi
  lea    D28(%rip),%rdi
  call   <printf@plt>
  jmp    L85
L340:
  mov    %r14,%rsi
  lea    D28(%rip),%rdi
  call   <printf@plt>
  jmp    L85
L220:
  mov    0x70(%rsp),%r12
  mov    %r12,%rcx
  mov    $0x9,%edx
  mov    $0x1,%esi
  lea    D547(%rip),%rdi
  call   <fwrite@plt>
  mov    $0x1,%ebx
  lea    D488(%rip),%rbp
L316:
  mov    %ebx,%ecx
  mov    %ebx,%edx
  mov    %rbp,%rsi
  mov    %r12,%rdi
  mov    $0x0,%eax
  call   <fprintf@plt>
  add    $0x1,%ebx
  cmp    $0x21,%ebx
  jne    L316
  mov    $0x1,%ebx
  lea    D399(%rip),%rbp
  mov    0x70(%rsp),%r12
L384:
  mov    %ebx,%ecx
  mov    %ebx,%edx
  mov    %rbp,%rsi
  mov    %r12,%rdi
  mov    $0x0,%eax
  call   <fprintf@plt>
  add    $0x1,%ebx
  cmp    $0xb,%ebx
  jne    L384
  mov    0x70(%rsp),%rsi
  mov    $0xa,%edi
  call   <fputc@plt>
  jmp    L412
L226:
  mov    0x60(%rsp),%rcx
  movzwl (%rcx),%eax
  mov    %ax,0x3c(%rsp)
  movswl 0x2(%rcx),%eax
  pxor   %xmm1,%xmm1
  cvtsi2sd %eax,%xmm1
  movsd  D330(%rip),%xmm0
  mulsd  %xmm0,%xmm1
  cvttsd2si %xmm1,%edx
  mov    %edx,0x68(%rsp)
  movzwl 0x4(%rcx),%ebx
  mov    %bx,0x18(%rsp)
  movswl 0x6(%rcx),%eax
  pxor   %xmm1,%xmm1
  cvtsi2sd %eax,%xmm1
  mulsd  %xmm0,%xmm1
  cvttsd2si %xmm1,%r14d
  movswl 0xa(%rcx),%eax
  pxor   %xmm1,%xmm1
  cvtsi2sd %eax,%xmm1
  mulsd  %xmm0,%xmm1
  cvttsd2si %xmm1,%eax
  mov    0xe0(%rsp),%rbx
  movswl 0xc(%rcx),%edx
  movswl 0x8(%rcx),%edi
  mov    %edx,%r12d
  mov    %edi,0x10(%rsp)
  sub    %edi,%r12d
  movswl %ax,%edx
  movswl 0xe(%rcx),%eax
  pxor   %xmm1,%xmm1
  cvtsi2sd %eax,%xmm1
  mulsd  %xmm1,%xmm0
  cvttsd2si %xmm0,%eax
  cwtl
  mov    %edx,0x90(%rsp)
  mov    %edx,%ebp
  sub    %eax,%ebp
  mov    %r12d,%eax
  imul   %r12d,%eax
  mov    %ebp,%esi
  imul   %ebp,%esi
  add    %esi,%eax
  pxor   %xmm0,%xmm0
  cvtsi2sd %eax,%xmm0
  call   <sqrt@plt>
  cwtl
  pxor   %xmm0,%xmm0
  cvtsi2sd %eax,%xmm0
  movq   %rbx,%xmm3
  divsd  %xmm0,%xmm3
  movapd %xmm3,%xmm6
  movsd  0xf0(%rsp),%xmm2
  movapd %xmm2,%xmm3
  movsd  %xmm6,0x28(%rsp)
  divsd  %xmm6,%xmm3
  movsd  %xmm3,0x80(%rsp)
  mov    0xe8(%rsp),%rbx
  movsd  0xe0(%rsp),%xmm0
  movapd %xmm0,%xmm1
  mulsd  %xmm0,%xmm1
  movq   %rbx,%xmm4
  movq   %rbx,%xmm7
  mulsd  %xmm4,%xmm4
  addsd  %xmm4,%xmm1
  mulsd  %xmm2,%xmm2
  subsd  %xmm2,%xmm1
  addsd  %xmm0,%xmm0
  mulsd  %xmm7,%xmm0
  divsd  %xmm0,%xmm1
  cvttsd2si %xmm1,%edi
  movswl %di,%edi
  call   <acos@plt>
  call   <sin@plt>
  movapd %xmm0,%xmm1
  movq   %rbx,%xmm0
  xorpd  D306(%rip),%xmm0
  mulsd  %xmm1,%xmm0
  movsd  %xmm0,0x8(%rsp)
  mov    0xe0(%rsp),%rbx
  movsd  0xe8(%rsp),%xmm2
  movsd  0xf0(%rsp),%xmm1
  movq   %rbx,%xmm4
  movq   %rbx,%xmm7
  mulsd  %xmm4,%xmm4
  movapd %xmm4,%xmm0
  movapd %xmm2,%xmm4
  mulsd  %xmm2,%xmm4
  addsd  %xmm4,%xmm0
  mulsd  %xmm1,%xmm1
  subsd  %xmm1,%xmm0
  movq   %rbx,%xmm4
  addsd  %xmm7,%xmm4
  movapd %xmm4,%xmm1
  mulsd  %xmm2,%xmm1
  divsd  %xmm1,%xmm0
  cvttsd2si %xmm0,%edi
  movswl %di,%edi
  call   <acos@plt>
  call   <cos@plt>
  movapd %xmm0,%xmm4
  mulsd  0xe8(%rsp),%xmm4
  movapd %xmm4,%xmm1
  movq   %rbx,%xmm4
  subsd  %xmm1,%xmm4
  movsd  0x8(%rsp),%xmm1
  divsd  %xmm4,%xmm1
  movapd %xmm1,%xmm0
  call   <atan@plt>
  movsd  %xmm0,0x88(%rsp)
  pxor   %xmm0,%xmm0
  cvtsi2sd %ebp,%xmm0
  pxor   %xmm1,%xmm1
  cvtsi2sd %r12d,%xmm1
  divsd  %xmm1,%xmm0
  call   <atan@plt>
  movsd  %xmm0,0x8(%rsp)
  movswl 0x68(%rsp),%ebx
  movswl %r14w,%r14d
  mov    %ebx,%eax
  sub    %r14d,%eax
  pxor   %xmm0,%xmm0
  cvtsi2sd %eax,%xmm0
  movswl 0x18(%rsp),%eax
  movswl 0x3c(%rsp),%r14d
  sub    %r14d,%eax
  pxor   %xmm1,%xmm1
  cvtsi2sd %eax,%xmm1
  divsd  %xmm1,%xmm0
  call   <atan@plt>
  movsd  %xmm0,0x40(%rsp)
  movsd  D628(%rip),%xmm0
  mulsd  0xd0(%rsp),%xmm0
  movsd  0x40(%rsp),%xmm1
  movsd  0x8(%rsp),%xmm4
  subsd  %xmm4,%xmm1
  addsd  %xmm1,%xmm0
  movsd  %xmm0,0x20(%rsp)
  lea    0xb8(%rsp),%r12
  lea    0xb0(%rsp),%rbp
  movsd  0x88(%rsp),%xmm7
  subsd  %xmm4,%xmm7
  movapd %xmm7,%xmm0
  mov    %rbp,%rsi
  mov    %r12,%rdi
  call   <sincos@plt>
  pxor   %xmm1,%xmm1
  cvtsi2sdl 0x90(%rsp),%xmm1
  movsd  0x80(%rsp),%xmm3
  movapd %xmm3,%xmm0
  mulsd  0xb8(%rsp),%xmm0
  movapd %xmm1,%xmm7
  subsd  %xmm0,%xmm7
  movsd  0x28(%rsp),%xmm6
  divsd  0xd8(%rsp),%xmm6
  movsd  %xmm6,0x18(%rsp)
  pxor   %xmm2,%xmm2
  cvtsi2sd %r14d,%xmm2
  pxor   %xmm1,%xmm1
  cvtsi2sdl 0x10(%rsp),%xmm1
  mulsd  0xb0(%rsp),%xmm3
  subsd  %xmm3,%xmm1
  subsd  %xmm1,%xmm2
  movapd %xmm2,%xmm3
  movsd  %xmm2,0x10(%rsp)
  mulsd  %xmm2,%xmm3
  pxor   %xmm5,%xmm5
  cvtsi2sd %ebx,%xmm5
  movsd  %xmm5,0x80(%rsp)
  movsd  %xmm7,0x88(%rsp)
  subsd  %xmm7,%xmm5
  movapd %xmm5,%xmm0
  mulsd  %xmm5,%xmm0
  movsd  %xmm3,0x28(%rsp)
  addsd  %xmm3,%xmm0
  call   <sqrt@plt>
  cwtl
  pxor   %xmm0,%xmm0
  cvtsi2sd %eax,%xmm0
  movapd %xmm0,%xmm1
  mulsd  0x18(%rsp),%xmm1
  movq   %xmm1,%rbx
  movsd  0x88(%rsp),%xmm7
  subsd  0x80(%rsp),%xmm7
  movapd %xmm7,%xmm0
  mulsd  %xmm7,%xmm0
  addsd  0x28(%rsp),%xmm0
  call   <sqrt@plt>
  cwtl
  pxor   %xmm1,%xmm1
  cvtsi2sd %eax,%xmm1
  movsd  0x10(%rsp),%xmm0
  divsd  %xmm1,%xmm0
  cvttsd2si %xmm0,%edi
  movswl %di,%edi
  call   <acos@plt>
  subsd  0x8(%rsp),%xmm0
  mov    %rbp,%rsi
  mov    %r12,%rdi
  call   <sincos@plt>
  movq   %rbx,%xmm6
  mulsd  0xb0(%rsp),%xmm6
  movapd %xmm6,%xmm0
  addsd  D667(%rip),%xmm0
  movapd %xmm0,%xmm3
  subsd  D656(%rip),%xmm3
  movq   %rbx,%xmm6
  mulsd  0xb8(%rsp),%xmm6
  movsd  D66(%rip),%xmm1
  subsd  %xmm6,%xmm1
  movsd  D125(%rip),%xmm6
  subsd  %xmm1,%xmm6
  movapd %xmm3,%xmm0
  movsd  %xmm3,0x8(%rsp)
  mulsd  %xmm3,%xmm0
  movapd %xmm6,%xmm1
  movsd  %xmm6,0x10(%rsp)
  mulsd  %xmm6,%xmm1
  addsd  %xmm1,%xmm0
  call   <sqrt@plt>
  cwtl
  pxor   %xmm4,%xmm4
  cvtsi2sd %eax,%xmm4
  movq   %xmm4,%rbx
  movsd  0x8(%rsp),%xmm0
  divsd  0x10(%rsp),%xmm0
  call   <atan@plt>
  addsd  0x20(%rsp),%xmm0
  mov    %rbp,%rsi
  mov    %r12,%rdi
  call   <sincos@plt>
  movswl 0xcc(%rsp),%eax
  pxor   %xmm0,%xmm0
  cvtsi2sd %eax,%xmm0
  movq   %rbx,%xmm1
  mulsd  0xb8(%rsp),%xmm1
  addsd  D656(%rip),%xmm1
  subsd  %xmm1,%xmm0
  cvttsd2si %xmm0,%edx
  movswl 0xce(%rsp),%eax
  pxor   %xmm2,%xmm2
  cvtsi2sd %eax,%xmm2
  movq   %rbx,%xmm1
  mulsd  0xb0(%rsp),%xmm1
  movsd  D125(%rip),%xmm0
  subsd  %xmm1,%xmm0
  subsd  %xmm0,%xmm2
  cvttsd2si %xmm2,%eax
  movsd  0x20(%rsp),%xmm3
  xorpd  D306(%rip),%xmm3
  movsd  %xmm3,0x28(%rsp)
  lea    0x40(%r15),%r12
  mov    %r15,%rbp
  mov    %r13,%rdi
  sub    %r15,%rdi
  mov    %rdi,0xa0(%rsp)
  movswl %dx,%edx
  cwtl
  mov    %r15,0x80(%rsp)
  mov    %r13,0x88(%rsp)
  mov    %r15,0x90(%rsp)
  mov    %rdi,%r15
  mov    %edx,%ebx
  mov    %eax,%r13d
  jmp    L233
L280:
  mov    %ax,(%r14)
  add    $0x2,%rbp
  cmp    %r12,%rbp
  je     L405
L233:
  movzwl 0x0(%rbp),%eax
  lea    0x0(%rbp,%r15,1),%r14
  cmp    $0xffff,%ax
  je     L280
  movswl (%r14),%edx
  pxor   %xmm0,%xmm0
  cvtsi2sd %edx,%xmm0
  mulsd  D330(%rip),%xmm0
  cwtl
  pxor   %xmm1,%xmm1
  cvtsi2sd %eax,%xmm1
  subsd  D132(%rip),%xmm1
  movsd  %xmm1,0x10(%rsp)
  subsd  D634(%rip),%xmm0
  movsd  %xmm0,0x18(%rsp)
  movsd  0x20(%rsp),%xmm0
  call   <cos@plt>
  movsd  %xmm0,0x8(%rsp)
  movsd  0x28(%rsp),%xmm0
  call   <sin@plt>
  movapd %xmm0,%xmm1
  movsd  0x8(%rsp),%xmm5
  movapd %xmm5,%xmm6
  movsd  0x10(%rsp),%xmm7
  mulsd  %xmm7,%xmm6
  movsd  0x18(%rsp),%xmm4
  movapd %xmm4,%xmm2
  mulsd  %xmm0,%xmm2
  addsd  %xmm6,%xmm2
  mulsd  %xmm4,%xmm5
  movapd %xmm5,%xmm0
  mulsd  %xmm7,%xmm1
  subsd  %xmm1,%xmm0
  addsd  D132(%rip),%xmm2
  movapd %xmm2,%xmm1
  addsd  D634(%rip),%xmm0
  pxor   %xmm2,%xmm2
  cvtsi2sd %ebx,%xmm2
  addsd  %xmm2,%xmm1
  cvttsd2si %xmm1,%eax
  mov    %ax,0x0(%rbp)
  pxor   %xmm1,%xmm1
  cvtsi2sd %r13d,%xmm1
  addsd  %xmm1,%xmm0
  cvttsd2si %xmm0,%eax
  jmp    L280
L405:
  mov    0x80(%rsp),%r15
  mov    0x88(%rsp),%r13
  mov    0x90(%rsp),%rbx
  movsd  D628(%rip),%xmm0
  mulsd  0xd0(%rsp),%xmm0
  addsd  0x40(%rsp),%xmm0
  movsd  %xmm0,0x20(%rsp)
  xorpd  D306(%rip),%xmm0
  movsd  %xmm0,0x28(%rsp)
  movzwl 0xcc(%rsp),%edx
  sub    0x3c(%rsp),%dx
  movzwl 0xce(%rsp),%eax
  sub    0x68(%rsp),%ax
  mov    0x50(%rsp),%rdi
  lea    0x14(%rdi),%rsi
  mov    %rdi,%rbp
  mov    0x58(%rsp),%rcx
  sub    %rdi,%rcx
  movswl %dx,%edx
  mov    %edx,0x3c(%rsp)
  cwtl
  mov    %eax,0x40(%rsp)
  mov    %r15,0x68(%rsp)
  mov    %rbx,0x80(%rsp)
  mov    %rsi,%r15
  mov    %rcx,%rbx
  jmp    L131
L279:
  mov    %ax,(%r14)
  add    $0x2,%rbp
  cmp    %r15,%rbp
  je     L304
L131:
  movzwl 0x0(%rbp),%eax
  lea    (%rbx,%rbp,1),%r14
  cmp    $0xffff,%ax
  je     L279
  movswl (%r14),%edx
  pxor   %xmm0,%xmm0
  cvtsi2sd %edx,%xmm0
  mulsd  D330(%rip),%xmm0
  cwtl
  pxor   %xmm1,%xmm1
  cvtsi2sd %eax,%xmm1
  subsd  D132(%rip),%xmm1
  movsd  %xmm1,0x10(%rsp)
  subsd  D634(%rip),%xmm0
  movsd  %xmm0,0x18(%rsp)
  movsd  0x20(%rsp),%xmm0
  call   <cos@plt>
  movsd  %xmm0,0x8(%rsp)
  movsd  0x28(%rsp),%xmm0
  call   <sin@plt>
  movapd %xmm0,%xmm1
  movsd  0x8(%rsp),%xmm6
  movapd %xmm6,%xmm4
  movsd  0x10(%rsp),%xmm5
  mulsd  %xmm5,%xmm4
  movsd  0x18(%rsp),%xmm3
  movapd %xmm3,%xmm2
  mulsd  %xmm0,%xmm2
  addsd  %xmm4,%xmm2
  mulsd  %xmm3,%xmm6
  movapd %xmm6,%xmm0
  mulsd  %xmm5,%xmm1
  subsd  %xmm1,%xmm0
  addsd  D132(%rip),%xmm2
  movapd %xmm2,%xmm1
  addsd  D634(%rip),%xmm0
  pxor   %xmm2,%xmm2
  cvtsi2sdl 0x3c(%rsp),%xmm2
  addsd  %xmm2,%xmm1
  cvttsd2si %xmm1,%eax
  mov    %ax,0x0(%rbp)
  pxor   %xmm1,%xmm1
  cvtsi2sdl 0x40(%rsp),%xmm1
  addsd  %xmm1,%xmm0
  cvttsd2si %xmm0,%eax
  jmp    L279
L304:
  mov    0x68(%rsp),%r15
  mov    0x80(%rsp),%rbx
  mov    0x78(%rsp),%rax
  cmpb   $0x79,(%rax)
  jne    L193
  movswl 0x2(%r15),%r9d
  movswl 0x0(%r13),%r8d
  movswl (%r15),%ecx
  sub    $0x8,%rsp
  mov    0x60(%rsp),%rdx
  movswl 0x12(%rdx),%eax
  push   %rax
  mov    0x60(%rsp),%rbx
  movswl 0x12(%rbx),%eax
  push   %rax
  movswl 0x10(%rdx),%eax
  push   %rax
  movswl 0x10(%rbx),%eax
  push   %rax
  movswl 0xe(%rdx),%eax
  push   %rax
  movswl 0xe(%rbx),%eax
  push   %rax
  movswl 0xc(%rdx),%eax
  push   %rax
  movswl 0xc(%rbx),%eax
  push   %rax
  movswl 0xa(%rdx),%eax
  push   %rax
  movswl 0xa(%rbx),%eax
  push   %rax
  movswl 0x8(%rdx),%eax
  push   %rax
  movswl 0x8(%rbx),%eax
  push   %rax
  movswl 0x6(%rdx),%eax
  push   %rax
  movswl 0x6(%rbx),%eax
  push   %rax
  movswl 0x4(%rdx),%eax
  push   %rax
  movswl 0x4(%rbx),%eax
  push   %rax
  movswl 0x2(%rdx),%eax
  push   %rax
  movswl 0x2(%rbx),%eax
  push   %rax
  movswl (%rdx),%eax
  push   %rax
  movswl (%rbx),%eax
  push   %rax
  movswl 0x3e(%r13),%eax
  push   %rax
  movswl 0x3e(%r15),%eax
  push   %rax
  movswl 0x3c(%r13),%eax
  push   %rax
  movswl 0x3c(%r15),%eax
  push   %rax
  movswl 0x3a(%r13),%eax
  push   %rax
  movswl 0x3a(%r15),%eax
  push   %rax
  movswl 0x38(%r13),%eax
  push   %rax
  movswl 0x38(%r15),%eax
  push   %rax
  movswl 0x36(%r13),%eax
  push   %rax
  movswl 0x36(%r15),%eax
  push   %rax
  movswl 0x34(%r13),%eax
  push   %rax
  movswl 0x34(%r15),%eax
  push   %rax
  movswl 0x32(%r13),%eax
  push   %rax
  movswl 0x32(%r15),%eax
  push   %rax
  movswl 0x30(%r13),%eax
  push   %rax
  movswl 0x30(%r15),%eax
  push   %rax
  movswl 0x2e(%r13),%eax
  push   %rax
  movswl 0x2e(%r15),%eax
  push   %rax
  movswl 0x2c(%r13),%eax
  push   %rax
  movswl 0x2c(%r15),%eax
  push   %rax
  movswl 0x2a(%r13),%eax
  push   %rax
  movswl 0x2a(%r15),%eax
  push   %rax
  movswl 0x28(%r13),%eax
  push   %rax
  movswl 0x28(%r15),%eax
  push   %rax
  movswl 0x26(%r13),%eax
  push   %rax
  movswl 0x26(%r15),%eax
  push   %rax
  movswl 0x24(%r13),%eax
  push   %rax
  movswl 0x24(%r15),%eax
  push   %rax
  movswl 0x22(%r13),%eax
  push   %rax
  movswl 0x22(%r15),%eax
  push   %rax
  movswl 0x20(%r13),%eax
  push   %rax
  movswl 0x20(%r15),%eax
  push   %rax
  movswl 0x1e(%r13),%eax
  push   %rax
  movswl 0x1e(%r15),%eax
  push   %rax
  movswl 0x1c(%r13),%eax
  push   %rax
  movswl 0x1c(%r15),%eax
  push   %rax
  movswl 0x1a(%r13),%eax
  push   %rax
  movswl 0x1a(%r15),%eax
  push   %rax
  movswl 0x18(%r13),%eax
  push   %rax
  movswl 0x18(%r15),%eax
  push   %rax
  movswl 0x16(%r13),%eax
  push   %rax
  movswl 0x16(%r15),%eax
  push   %rax
  movswl 0x14(%r13),%eax
  push   %rax
  movswl 0x14(%r15),%eax
  push   %rax
  movswl 0x12(%r13),%eax
  push   %rax
  movswl 0x12(%r15),%eax
  push   %rax
  movswl 0x10(%r13),%eax
  push   %rax
  movswl 0x10(%r15),%eax
  push   %rax
  movswl 0xe(%r13),%eax
  push   %rax
  movswl 0xe(%r15),%eax
  push   %rax
  movswl 0xc(%r13),%eax
  push   %rax
  movswl 0xc(%r15),%eax
  push   %rax
  movswl 0xa(%r13),%eax
  push   %rax
  movswl 0xa(%r15),%eax
  push   %rax
  movswl 0x8(%r13),%eax
  push   %rax
  movswl 0x8(%r15),%eax
  push   %rax
  movswl 0x6(%r13),%eax
  push   %rax
  movswl 0x6(%r15),%eax
  push   %rax
  movswl 0x4(%r13),%eax
  push   %rax
  movswl 0x4(%r15),%eax
  push   %rax
  movswl 0x2(%r13),%eax
  push   %rax
  mov    0x2d8(%rsp),%rdx
  lea    D511(%rip),%rsi
  mov    0x300(%rsp),%rdi
  mov    $0x0,%eax
  call   <fprintf@plt>
  add    $0x290,%rsp
L412:
  mov    0x30(%rsp),%rdi
  call   <feof@plt>
  test   %rax,%rax
  jne    L293
  sub    $0x8,%rsp
  mov    0x60(%rsp),%rcx
  lea    0x12(%rcx),%rax
  push   %rax
  mov    0x60(%rsp),%rsi
  lea    0x12(%rsi),%rax
  push   %rax
  lea    0x10(%rcx),%rax
  push   %rax
  lea    0x10(%rsi),%rax
  push   %rax
  lea    0xe(%rcx),%rax
  push   %rax
  lea    0xe(%rsi),%rax
  push   %rax
  lea    0xc(%rcx),%rax
  push   %rax
  lea    0xc(%rsi),%rax
  push   %rax
  lea    0xa(%rcx),%rax
  push   %rax
  lea    0xa(%rsi),%rax
  push   %rax
  lea    0x8(%rcx),%rax
  push   %rax
  lea    0x8(%rsi),%rax
  push   %rax
  lea    0x6(%rcx),%rax
  push   %rax
  lea    0x6(%rsi),%rax
  push   %rax
  lea    0x4(%rcx),%rax
  push   %rax
  lea    0x4(%rsi),%rax
  push   %rax
  lea    0x2(%rcx),%rax
  push   %rax
  lea    0x2(%rsi),%rax
  push   %rax
  push   %rcx
  push   %rsi
  mov    0x108(%rsp),%rdi
  lea    0xe(%rdi),%rax
  push   %rax
  lea    0xc(%rdi),%rax
  push   %rax
  lea    0xa(%rdi),%rax
  push   %rax
  lea    0x8(%rdi),%rax
  push   %rax
  lea    0x6(%rdi),%rax
  push   %rax
  lea    0x4(%rdi),%rax
  push   %rax
  lea    0x2(%rdi),%rax
  push   %rax
  push   %rdi
  lea    0x3e(%r13),%rax
  push   %rax
  lea    0x3e(%r15),%rax
  push   %rax
  lea    0x3c(%r13),%rax
  push   %rax
  lea    0x3c(%r15),%rax
  push   %rax
  lea    0x3a(%r13),%rax
  push   %rax
  lea    0x3a(%r15),%rax
  push   %rax
  lea    0x38(%r13),%rax
  push   %rax
  lea    0x38(%r15),%rax
  push   %rax
  lea    0x36(%r13),%rax
  push   %rax
  lea    0x36(%r15),%rax
  push   %rax
  lea    0x34(%r13),%rax
  push   %rax
  lea    0x34(%r15),%rax
  push   %rax
  lea    0x32(%r13),%rax
  push   %rax
  lea    0x32(%r15),%rax
  push   %rax
  lea    0x30(%r13),%rax
  push   %rax
  lea    0x30(%r15),%rax
  push   %rax
  lea    0x2e(%r13),%rax
  push   %rax
  lea    0x2e(%r15),%rax
  push   %rax
  lea    0x2c(%r13),%rax
  push   %rax
  lea    0x2c(%r15),%rax
  push   %rax
  lea    0x2a(%r13),%rax
  push   %rax
  lea    0x2a(%r15),%rax
  push   %rax
  lea    0x28(%r13),%rax
  push   %rax
  lea    0x28(%r15),%rax
  push   %rax
  lea    0x26(%r13),%rax
  push   %rax
  lea    0x26(%r15),%rax
  push   %rax
  lea    0x24(%r13),%rax
  push   %rax
  lea    0x24(%r15),%rax
  push   %rax
  lea    0x22(%r13),%rax
  push   %rax
  lea    0x22(%r15),%rax
  push   %rax
  lea    0x20(%r13),%rax
  push   %rax
  lea    0x20(%r15),%rax
  push   %rax
  lea    0x1e(%r13),%rax
  push   %rax
  lea    0x1e(%r15),%rax
  push   %rax
  lea    0x1c(%r13),%rax
  push   %rax
  lea    0x1c(%r15),%rax
  push   %rax
  lea    0x1a(%r13),%rax
  push   %rax
  lea    0x1a(%r15),%rax
  push   %rax
  lea    0x18(%r13),%rax
  push   %rax
  lea    0x18(%r15),%rax
  push   %rax
  lea    0x16(%r13),%rax
  push   %rax
  lea    0x16(%r15),%rax
  push   %rax
  lea    0x14(%r13),%rax
  push   %rax
  lea    0x14(%r15),%rax
  push   %rax
  lea    0x12(%r13),%rax
  push   %rax
  lea    0x12(%r15),%rax
  push   %rax
  lea    0x10(%r13),%rax
  push   %rax
  lea    0x10(%r15),%rax
  push   %rax
  lea    0xe(%r13),%rax
  push   %rax
  lea    0xe(%r15),%rax
  push   %rax
  lea    0xc(%r13),%rax
  push   %rax
  lea    0xc(%r15),%rax
  push   %rax
  lea    0xa(%r13),%rax
  push   %rax
  lea    0xa(%r15),%rax
  push   %rax
  lea    0x8(%r13),%rax
  push   %rax
  lea    0x8(%r15),%rax
  push   %rax
  lea    0x6(%r13),%rax
  push   %rax
  lea    0x6(%r15),%rax
  push   %rax
  lea    0x4(%r13),%rax
  push   %rax
  lea    0x4(%r15),%rax
  push   %rax
  lea    0x2(%r13),%rax
  push   %rax
  lea    0x2(%r15),%r9
  mov    %r13,%r8
  mov    %r15,%rcx
  mov    0x318(%rsp),%rbx
  mov    %rbx,%rdx
  lea    D481(%rip),%rsi
  mov    0x300(%rsp),%rdi
  mov    $0x0,%eax
  call   <fscanf@plt>
  add    $0x2d0,%rsp
  cmp    $0x5d,%ax
  je     L226
  movswl %ax,%edx
  mov    %rbx,%rsi
  lea    D325(%rip),%rdi
  mov    $0x0,%eax
  call   <printf@plt>
  jmp    L412
L193:
  lea    D548(%rip),%r14
  mov    %r14,%rsi
  mov    0x48(%rsp),%rbp
  mov    %rbp,%rdi
  call   <strpbrk@plt>
  mov    %rbp,%rsi
  sub    %rbp,%rax
  mov    %rax,%rbp
  movswl %ax,%edx
  mov    0x98(%rsp),%rdi
  call   <strncpy@plt>
  movswq %bp,%rbp
  mov    0x98(%rsp),%rax
  movb   $0x0,(%rax,%rbp,1)
  mov    $0x5f,%esi
  mov    0x48(%rsp),%rdi
  call   <strchr@plt>
  mov    %rax,%rbp
  mov    %r14,%rsi
  mov    0x48(%rsp),%rdi
  call   <strpbrk@plt>
  mov    %rax,%rsi
  sub    %rax,%rbp
  movswl %bp,%edx
  mov    0xa8(%rsp),%r14
  mov    %r14,%rdi
  call   <strncpy@plt>
  movswq %bp,%rbp
  movb   $0x0,(%r14,%rbp,1)
  mov    %r15,0x8(%rsp)
  mov    %r13,0x10(%rsp)
  mov    0x98(%rsp),%rbp
  mov    %r14,%r13
  mov    0x70(%rsp),%r14
  mov    0xa0(%rsp),%r15
  jmp    L53
L40:
  add    $0x2,%rbx
  cmp    %r12,%rbx
  je     L186
L53:
  movzwl (%rbx),%r8d
  cmp    $0xffff,%r8w
  je     L40
  movswl (%rbx,%r15,1),%r9d
  movswl %r8w,%r8d
  mov    %r13,%rcx
  mov    %rbp,%rdx
  lea    D302(%rip),%rsi
  mov    %r14,%rdi
  mov    $0x0,%eax
  call   <fprintf@plt>
  jmp    L40
L186:
  mov    0x8(%rsp),%r15
  mov    0x10(%rsp),%r13
  jmp    L412
L293:
  mov    0x30(%rsp),%rdi
  call   <fclose@plt>
  mov    0x70(%rsp),%rdi
  call   <fclose@plt>
  mov    $0x0,%eax
L264:
  mov    0xf8(%rsp),%rdx
  sub    %fs:0x28,%rdx
  jne    L205
  add    $0x108,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
L205:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: read_data
arguments: data_label: D652
data_type: string
name: read_data
arguments: data_label: D98
data_type: string
name: read_data
arguments: data_label: D139
data_type: string
name: read_data
arguments: data_label: D633
data_type: string
name: read_data
arguments: data_label: D181
data_type: string
name: read_data
arguments: data_label: D592
data_type: string
name: read_data
arguments: data_label: D389
data_type: string
name: read_data
arguments: data_label: D232
data_type: string
name: read_data
arguments: data_label: D666
data_type: string
name: read_data
arguments: data_label: D503
data_type: string
name: read_data
arguments: data_label: D423
data_type: string
name: read_data
arguments: data_label: D338
data_type: string
name: read_data
arguments: data_label: D492
data_type: string
name: read_data
arguments: data_label: D367
data_type: string
name: read_data
arguments: data_label: D40
data_type: string
name: read_data
arguments: data_label: D159
data_type: string
name: read_data
arguments: data_label: D340
data_type: string
name: read_data
arguments: data_label: D558
data_type: string
name: read_data
arguments: data_label: D364
data_type: string
name: read_data
arguments: data_label: D331
data_type: string
name: read_data
arguments: data_label: D179
data_type: string
name: read_data
arguments: data_label: D574
data_type: string
name: read_data
arguments: data_label: D67
data_type: string
name: read_data
arguments: data_label: D174
data_type: string
name: read_data
arguments: data_label: D649
data_type: string
name: read_data
arguments: data_label: D217
data_type: string
name: read_data
arguments: data_label: D28
data_type: string
name: read_data
arguments: data_label: D547
data_type: string
name: read_data
arguments: data_label: D488
data_type: string
name: read_data
arguments: data_label: D399
data_type: string
name: read_data
arguments: data_label: D330
data_type: byte[8]
name: read_data
arguments: data_label: D306
data_type: byte[16]
name: read_data
arguments: data_label: D628
data_type: byte[8]
name: read_data
arguments: data_label: D667
data_type: f64
name: read_data
arguments: data_label: D656
data_type: f64
name: read_data
arguments: data_label: D66
data_type: f64
name: read_data
arguments: data_label: D125
data_type: f64
name: read_data
arguments: data_label: D132
data_type: byte[8]
name: read_data
arguments: data_label: D634
data_type: f64
name: read_data
arguments: data_label: D511
data_type: string
name: read_data
arguments: data_label: D481
data_type: string
name: read_data
arguments: data_label: D325
data_type: string
name: read_data
arguments: data_label: D548
data_type: string
name: read_data
arguments: data_label: D302
data_type: string

tool: D652: r

tool: D98: settings.txt

tool: D139: OverlayX = %hd


tool: D633: OverlayY = %hd


tool: D181: Angle = %lf


tool: D592: UsScale = %lf


tool: D389: distance_btwn_lower_dots = %lf


tool: D232: tip_of_transducer_to_lower_right_dot = %lf


tool: D666: tip_of_transducer_to_lower_left_dot = %lf


tool: D503: Using these settings:

tool: D423: .txt

tool: D338: _output.txt

tool: D492: w

tool: D367: Filename Raw.R1.X Raw.R1.Y Raw.R2.X Raw.R2.Y Raw.R3.X Raw.R3.Y Raw.R4.X Raw.R4.Y Raw.R5.X Raw.R5.Y Raw.R6.X Raw.R6.Y Raw.R7.X Raw.R7.Y Raw.R8.X Raw.R8.Y Raw.R9.X Raw.R9.Y Raw.R10.X Raw.R10.Y Raw.R11.X Raw.R11.Y Raw.R12.X Raw.R12.Y Raw.R13.X Raw.R13.Y Raw.R14.X Raw.R14.Y Raw.R15.X Raw.R15.Y Raw.R16.X Raw.R16.Y Raw.R17.X Raw.R17.Y Raw.R18.X Raw.R18.Y Raw.R19.X Raw.R19.Y Raw.R20.X Raw.R20.Y Raw.R21.X Raw.R21.Y Raw.R22.X Raw.R22.Y Raw.R23.X Raw.R23.Y Raw.R24.X Raw.R24.Y Raw.R25.X Raw.R25.Y Raw.R26.X Raw.R26.Y Raw.R27.X Raw.R27.Y Raw.R28.X Raw.R28.Y Raw.R29.X Raw.R29.Y Raw.R30.X Raw.R30.Y Raw.R31.X Raw.R31.Y Raw.R32.X Raw.R32.Y UL.x UL.y UR.x UR.y LL.x LL.y LR.x LR.y Aux1.x Aux1.y Aux2.x Aux2.y Aux3.x Aux3.y Aux4.x Aux4.y Aux5.x Aux5.y Aux6.x Aux6.y Aux7.x Aux7.y Aux8.x Aux8.y Aux9.x Aux9.y Aux10.x Aux10.y

tool: D40: word	token	X	Y


tool: D159: Couldn't open settings.txt

tool: D340: Error reading value of: OverlayX

tool: D558: Error reading value of: OverlayY

tool: D364: Error reading value of: Angle

tool: D331: Error reading value of: UsScale

tool: D179: Error reading value of: distance_btwn_lower_dots

tool: D574: Error reading value of: tip_of_transducer_to_lower_right_dot

tool: D67: Error reading value of: tip_of_transducer_to_lower_left_dot

tool: D174: Enter the filename (without '.txt'): 

tool: D649: %s

tool: D217: Would you like tab-delimited format instead of R/SSANOVA format? (y/n)

tool: D28: Unable to open file: %s


tool: D547: Filename	

tool: D488: x.%i	y.%i	

tool: D399: aux.x.%i	aux.y.%i	

tool: {"D330": [0x44,0x44,0x44,0x44,0x44,0xc4,0xf1,0x3f]}

tool: {"D306": [0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00]}

tool: {"D628": [0x39,0x9d,0x52,0xa2,0x46,0xdf,0x91,0x3f]}

tool: D667: 390

tool: D656: 360.5

tool: D66: 416

tool: D125: 267

tool: {"D132": [0x00,0x00,0x00,0x00,0x00,0x80,0x76,0x40]}

tool: D634: 266.5

tool: D511: %s	%hd	%hd	%hd	%hd	%hd	%hd	%hd	%hd	%hd	%hd	%hd	%hd	%hd	%hd	%hd	%hd	%hd	%hd	%hd	%hd	%hd	%hd	%hd	%hd	%hd	%hd	%hd	%hd	%hd	%hd	%hd	%hd	%hd	%hd	%hd	%hd	%hd	%hd	%hd	%hd	%hd	%hd	%hd	%hd	%hd	%hd	%hd	%hd	%hd	%hd	%hd	%hd	%hd	%hd	%hd	%hd	%hd	%hd	%hd	%hd	%hd	%hd	%hd	%hd	%hd	%hd	%hd	%hd	%hd	%hd	%hd	%hd	%hd	%hd	%hd	%hd	%hd	%hd	%hd	%hd	%hd	%hd	%hd	%hd


tool: D481: %s	%hd	%hd	%hd	%hd	%hd	%hd	%hd	%hd	%hd	%hd	%hd	%hd	%hd	%hd	%hd	%hd	%hd	%hd	%hd	%hd	%hd	%hd	%hd	%hd	%hd	%hd	%hd	%hd	%hd	%hd	%hd	%hd	%hd	%hd	%hd	%hd	%hd	%hd	%hd	%hd	%hd	%hd	%hd	%hd	%hd	%hd	%hd	%hd	%hd	%hd	%hd	%hd	%hd	%hd	%hd	%hd	%hd	%hd	%hd	%hd	%hd	%hd	%hd	%hd	%hd	%hd	%hd	%hd	%hd	%hd	%hd	%hd	%hd	%hd	%hd	%hd	%hd	%hd	%hd	%hd	%hd	%hd	%hd	%hd	%hd	%hd	%hd	%hd	%hd	%hd	%hd	%hd


tool: D325: 
For the entry "%s", only %d items were read, whereas I was expecting 93. I'm going to skip that line and finish the rest of the file.



tool: D548: 1234567890

tool: D302: %s	%s	%hd	%hd


assistant: ```c
int main(int argc, char *argv[]) {
  FILE *in, *out, *settings;
  char *filebase = (char *)malloc(50);
  char *infile = (char *)malloc(50);
  char *outfile = (char *)malloc(50);
  char *fn = (char *)malloc(200);
  short ct;
  short ulx, uly, urx, ury, llx, lly, lrx, lry, tmp;
  short OverlayX, OverlayY;
  double Angle, UsScale, tranlrmm, ortranrmm, ortranlmm;
  short XOffset, YOffset;
  double AngleOffset;
  short i, nread, len;
  double X, Y, tmpX, tmpY;
  char *token = (char *)malloc(200);
  char *item = (char *)malloc(200);
  char *tabdelimited = (char *)malloc(1);
  short *x = (short *)malloc(sizeof(short) * 32);
  short *y = (short *)malloc(sizeof(short) * 32);
  short *pt = (short *)malloc(sizeof(short) * 8);
  short *ax = (short *)malloc(sizeof(short) * 10);
  short *ay = (short *)malloc(sizeof(short) * 10);
  settings = fopen("settings.txt", "r");
  if (settings == NULL) {
    printf("Couldn\'t open settings.txt\n");
    return -1;
  }
  if (fscanf(settings, "OverlayX = %hd\n", &OverlayX) == 0) {
    printf("Error reading value of: OverlayX\n");
    return -1;
  }
  if (fscanf(settings, "OverlayY = %hd\n", &OverlayY) == 0) {
    printf("Error reading value of: OverlayY\n");
    return -1;
  }
  if (fscanf(settings, "Angle = %lf\n", &Angle) == 0) {
    printf("Error reading value of: Angle\n");
    return -1;
  }
  if (fscanf(settings, "UsScale = %lf\n", &UsScale) == 0) {
    printf("Error reading value of: UsScale\n");
    return -1;
  }
  if (fscanf(settings, "distance_btwn_lower_dots = %lf\n", &tranlrmm) == 0) {
    printf("Error reading value of: distance_btwn_lower_dots\n");
    return -1;
  }
  if (fscanf(settings, "tip_of_transducer_to_lower_right_dot = %lf\n", &ortranrmm) == 0) {
    printf("Error reading value of: tip_of_transducer_to_lower_right_dot\n");
    return -1;
  }
  if (fscanf(settings, "tip_of_transducer_to_lower_left_dot = %lf\n", &ortranlmm) == 0) {
    printf("Error reading value of: tip_of_transducer_to_lower_left_dot\n");
    return -1;
  }
  fclose(settings);
  printf("Using these settings:\n");
  printf("OverlayX = %hd\n", OverlayX);
  printf("OverlayY = %hd\n", OverlayY);
  printf("Angle = %lf\n", Angle);
  printf("UsScale = %lf\n", UsScale);
  printf("distance_btwn_lower_dots = %lf\n", tranlrmm);
  printf("tip_of_transducer_to_lower_right_dot = %lf\n", ortranrmm);
  printf("tip_of_transducer_to_lower_left_dot = %lf\n", ortranlmm);
  printf("\n");
  if (argc < 2) {
    printf("Enter the filename (without \'.txt\'): ");
    scanf("%s", filebase);
  } else {
    strcpy(filebase, argv[1]);
  }
  if (argc < 3) {
    printf("Would you like tab-delimited format instead of R/SSANOVA format? (y/n)\n");
    scanf("%s", tabdelimited);
  } else {
    *tabdelimited = *argv[2];
  }
  strcpy(infile, filebase);
  strcat(infile, ".txt");
  strcpy(outfile, filebase);
  strcat(outfile, "_output.txt");
  in = fopen(infile, "r");
  if (in == NULL) {
    printf("Unable to open file: %s\n", infile);
    return -1;
  }
  out = fopen(outfile, "w");
  if (out == NULL) {
    printf("Unable to open file: %s\n", outfile);
    return -1;
  }
  fscanf(in, "Filename Raw.R1.X Raw.R1.Y Raw.R2.X Raw.R2.Y Raw.R3.X Raw.R3.Y Raw.R4.X Raw.R4.Y Raw.R5.X Raw.R5.Y Raw.R6.X Raw.R6.Y Raw.R7.X Raw.R7.Y Raw.R8.X Raw.R8.Y Raw.R9.X Raw.R9.Y Raw.R10.X Raw.R10.Y Raw.R11.X Raw.R11.Y Raw.R12.X Raw.R12.Y Raw.R13.X Raw.R13.Y Raw.R14.X Raw.R14.Y Raw.R15.X Raw.R15.Y Raw.R16.X Raw.R16.Y Raw.R17.X Raw.R17.Y Raw.R18.X Raw.R18.Y Raw.R19.X Raw.R19.Y Raw.R20.X Raw.R20.Y Raw.R21.X Raw.R21.Y Raw.R22.X Raw.R22.Y Raw.R23.X Raw.R23.Y Raw.R24.X Raw.R24.Y Raw.R25.X Raw.R25.Y Raw.R26.X Raw.R26.Y Raw.R27.X Raw.R27.Y Raw.R28.X Raw.R28.Y Raw.R29.X Raw.R29.Y Raw.R30.X Raw.R30.Y Raw.R31.X Raw.R31.Y Raw.R32.X Raw.R32.Y UL.x UL.y UR.x UR.y LL.x LL.y LR.x LR.y Aux1.x Aux1.y Aux2.x Aux2.y Aux3.x Aux3.y Aux4.x Aux4.y Aux5.x Aux5.y Aux6.x Aux6.y Aux7.x Aux7.y Aux8.x Aux8.y Aux9.x Aux9.y Aux10.x Aux10.y");
  double orheaddist, orheadangle, vidoriginx, vidoriginy, vidscale, imagecenterx = 360.5, imagecentery = 267.0, tranangle, usoriginx = 390, usoriginy = 416, ortrandist, ortranangle, headangle, htangle, headx, heady, centerheaddist, centerheadangle, rotatedheadx, rotatedheady;
  if (*tabdelimited == 'y') {
    fprintf(out, "Filename\t");
    for (i = 0; i < 32; i++) {
      fprintf(out, "x.%i\ty.%i\t", i + 1, i + 1);
    }
    for (i = 0; i < 10; i++) {
      fprintf(out, "aux.x.%i\taux.y.%i\t", i + 1, i + 1);
    }
    fprintf(out, "\n");
  } else {
    fprintf(out, "word\ttoken\tX\tY\n");
  }
  while (0 == feof(in)) {
    nread = fscanf(in, "%s\t%hd\t%hd\t%hd\t%hd\t%hd\t%hd\t%hd\t%hd\t%hd\t%hd\t%hd\t%hd\t%hd\t%hd\t%hd\t%hd\t%hd\t%hd\t%hd\t%hd\t%hd\t%hd\t%hd\t%hd\t%hd\t%hd\t%hd\t%hd\t%hd\t%hd\t%hd\t%hd\t%hd\t%hd\t%hd\t%hd\t%hd\t%hd\t%hd\t%hd\t%hd\t%hd\t%hd\t%hd\t%hd\t%hd\t%hd\t%hd\t%hd\t%hd\t%hd\t%hd\t%hd\t%hd\t%hd\t%hd\t%hd\t%hd\t%hd\t%hd\t%hd\t%hd\t%hd\t%hd\t%hd\t%hd\t%hd\t%hd\t%hd\t%hd\t%hd\t%hd\t%hd\t%hd\t%hd\t%hd\t%hd\t%hd\t%hd\t%hd\t%hd\t%hd\t%hd\t%hd\t%hd\t%hd\t%hd\t%hd\t%hd\t%hd\t%hd\t%hd\n", fn, x, y, x + 1, y + 1, x + 2, y + 2, x + 3, y + 3, x + 4, y + 4, x + 5, y + 5, x + 6, y + 6, x + 7, y + 7, x + 8, y + 8, x + 9, y + 9, x + 10, y + 10, x + 11, y + 11, x + 12, y + 12, x + 13, y + 13, x + 14, y + 14, x + 15, y + 15, x + 16, y + 16, x + 17, y + 17, x + 18, y + 18, x + 19, y + 19, x + 20, y + 20, x + 21, y + 21, x + 22, y + 22, x + 23, y + 23, x + 24, y + 24, x + 25, y + 25, x + 26, y + 26, x + 27, y + 27, x + 28, y + 28, x + 29, y + 29, x + 30, y + 30, x + 31, y + 31, pt, pt + 1, pt + 2, pt + 3, pt + 4, pt + 5, pt + 6, pt + 7, ax, ay, ax + 1, ay + 1, ax + 2, ay + 2, ax + 3, ay + 3, ax + 4, ay + 4, ax + 5, ay + 5, ax + 6, ay + 6, ax + 7, ay + 7, ax + 8, ay + 8, ax + 9, ay + 9);
    if (nread != 93) {
      printf("\nFor the entry \"%s\", only %d items were read, whereas I was expecting 93. I\'m going to skip that line and finish the rest of the file.\n\n", fn, nread);
      continue;
    }
    ulx = *(pt + 0);
    uly = *(pt + 1) * ((double)533 / (double)480);
    urx = *(pt + 2);
    ury = *(pt + 3) * ((double)533 / (double)480);
    llx = *(pt + 4);
    lly = *(pt + 5) * ((double)533 / (double)480);
    lrx = *(pt + 6);
    lry = *(pt + 7) * ((double)533 / (double)480);
    vidscale = tranlrmm / sqrt((lrx - llx) * (lrx - llx) + (lly - lry) * (lly - lry));
    ortrandist = ortranlmm / vidscale;
    ortranangle = atan(-1.0f * ortranrmm * sin(acos((tranlrmm * tranlrmm + ortranrmm * ortranrmm - ortranlmm * ortranlmm) / (2.0f * tranlrmm * ortranrmm))) / (tranlrmm - ortranrmm * cos(acos((tranlrmm * tranlrmm + ortranrmm * ortranrmm - ortranlmm * ortranlmm) / (2 * tranlrmm * ortranrmm)))));
    tranangle = atan((double)(lly - lry) / (double)(lrx - llx));
    headangle = atan((double)(uly - ury) / (double)(urx - ulx));
    htangle = headangle - tranangle;
    AngleOffset = htangle - Angle * (-3.1415926535897932384626433832795 / 180.0f);
    vidoriginx = llx - (ortrandist * cos(ortranangle - tranangle));
    vidoriginy = lly - (ortrandist * sin(ortranangle - tranangle));
    orheaddist = vidscale / UsScale * sqrt((ulx - vidoriginx) * (ulx - vidoriginx) + (uly - vidoriginy) * (uly - vidoriginy));
    orheadangle = acos((ulx - vidoriginx) / (sqrt((ulx - vidoriginx) * (ulx - vidoriginx) + (vidoriginy - uly) * (vidoriginy - uly)))) - tranangle;
    headx = usoriginx + orheaddist * cos(orheadangle);
    heady = usoriginy - orheaddist * sin(orheadangle);
    centerheaddist = sqrt((headx - imagecenterx) * (headx - imagecenterx) + (imagecentery - heady) * (imagecentery - heady));
    centerheadangle = atan((headx - imagecenterx) / (imagecentery - heady));
    rotatedheadx = imagecenterx + (centerheaddist * sin(centerheadangle + AngleOffset));
    rotatedheady = imagecentery - (centerheaddist * cos(centerheadangle + AngleOffset));
    XOffset = (short)(OverlayX - rotatedheadx);
    YOffset = (short)(OverlayY - rotatedheady);
    AngleOffset *= -1;
    for (i = 0; i < 32; i++) {
      X = (double)*(x + i);
      Y = (double)*(y + i);
      if (X != -1) {
        Y *= (double)533 / (double)480;
        X -= 360;
        Y -= 266.5;
        tmpX = X * cos(AngleOffset) + Y * sin(AngleOffset);
        tmpY = Y * cos(AngleOffset) - X * sin(AngleOffset);
        X = tmpX + 360;
        Y = tmpY + 266.5;
        X += XOffset;
        Y += YOffset;
        *(x + i) = (int)X;
        *(y + i) = (int)Y;
      } else {
        *(x + i) = -1;
        *(y + i) = -1;
      }
    }
    AngleOffset = headangle - Angle * (-3.1415926535897932384626433832795 / 180.0f);
    AngleOffset *= -1;
    XOffset = OverlayX - ulx;
    YOffset = OverlayY - uly;
    for (i = 0; i < 10; i++) {
      X = (double)*(ax + i);
      Y = (double)*(ay + i);
      if (X != -1) {
        Y *= (double)533 / (double)480;
        X -= 360;
        Y -= 266.5;
        tmpX = X * cos(AngleOffset) + Y * sin(AngleOffset);
        tmpY = Y * cos(AngleOffset) - X * sin(AngleOffset);
        X = tmpX + 360;
        Y = tmpY + 266.5;
        X += XOffset;
        Y += YOffset;
        *(ax + i) = (int)X;
        *(ay + i) = (int)Y;
      } else {
        *(ax + i) = -1;
        *(ay + i) = -1;
      }
    }
    if (*tabdelimited == 'y') {
      fprintf(out, "%s\t%hd\t%hd\t%hd\t%hd\t%hd\t%hd\t%hd\t%hd\t%hd\t%hd\t%hd\t%hd\t%hd\t%hd\t%hd\t%hd\t%hd\t%hd\t%hd\t%hd\t%hd\t%hd\t%hd\t%hd\t%hd\t%hd\t%hd\t%hd\t%hd\t%hd\t%hd\t%hd\t%hd\t%hd\t%hd\t%hd\t%hd\t%hd\t%hd\t%hd\t%hd\t%hd\t%hd\t%hd\t%hd\t%hd\t%hd\t%hd\t%hd\t%hd\t%hd\t%hd\t%hd\t%hd\t%hd\t%hd\t%hd\t%hd\t%hd\t%hd\t%hd\t%hd\t%hd\t%hd\t%hd\t%hd\t%hd\t%hd\t%hd\t%hd\t%hd\t%hd\t%hd\t%hd\t%hd\t%hd\t%hd\t%hd\t%hd\t%hd\t%hd\t%hd\t%hd\t%hd\n", fn, *(x), *(y), *(x + 1), *(y + 1), *(x + 2), *(y + 2), *(x + 3), *(y + 3), *(x + 4), *(y + 4), *(x + 5), *(y + 5), *(x + 6), *(y + 6), *(x + 7), *(y + 7), *(x + 8), *(y + 8), *(x + 9), *(y + 9), *(x + 10), *(y + 10), *(x + 11), *(y + 11), *(x + 12), *(y + 12), *(x + 13), *(y + 13), *(x + 14), *(y + 14), *(x + 15), *(y + 15), *(x + 16), *(y + 16), *(x + 17), *(y + 17), *(x + 18), *(y + 18), *(x + 19), *(y + 19), *(x + 20), *(y + 20), *(x + 21), *(y + 21), *(x + 22), *(y + 22), *(x + 23), *(y + 23), *(x + 24), *(y + 24), *(x + 25), *(y + 25), *(x + 26), *(y + 26), *(x + 27), *(y + 27), *(x + 28), *(y + 28), *(x + 29), *(y + 29), *(x + 30), *(y + 30), *(x + 31), *(y + 31), *(ax), *(ay), *(ax + 1), *(ay + 1), *(ax + 2), *(ay + 2), *(ax + 3), *(ay + 3), *(ax + 4), *(ay + 4), *(ax + 5), *(ay + 5), *(ax + 6), *(ay + 6), *(ax + 7), *(ay + 7), *(ax + 8), *(ay + 8), *(ax + 9), *(ay + 9));
    } else {
      len = strpbrk(fn, "1234567890") - fn;
      strncpy(token, fn, len);
      *(token + len) = '\0';
      len = strchr(fn, '_') - strpbrk(fn, "1234567890");
      strncpy(item, strpbrk(fn, "1234567890"), len);
      *(item + len) = '\0';
      for (i = 0; i < 32; i++) {
        if (*(x + i) != -1) {
          fprintf(out, "%s\t%s\t%hd\t%hd\n", token, item, *(x + i), *(y + i));
        }
      }
    }
  }
  fclose(in);
  fclose(out);
}
```