// File: /workspace/github_cpp_makefile_star2_O1/Luthaf[P]zeopp/networkio.cc
// Function: writeToXYZ(char*, ATOM_NETWORK*, bool, bool)
bool writeToXYZ(char *filename, ATOM_NETWORK *cell, bool is_supercell, bool is_duplicate_perimeter_atoms){
  int num_cells = SUPERCELL_SIZE; //defined in networkio.h
  if(!is_supercell) num_cells = 1;
  fstream output;
  output.open(filename, fstream::out);
  if(!output.is_open()){
    cerr << "Error: Failed to open .xyz output file " << filename << endl;
    //cerr << "Exiting ..." << "\n";
    //exit(1);
    return false;
  }
  else{
    cout << "Writing atom network information to " << filename << "\n";

    //1) construct a new vector of atoms, which contains any supercell projections and duplicates
    vector<ATOM> new_atoms;
    for(int i=0; i<cell->numAtoms; i++) {
      ATOM atom = cell->atoms.at(i);
      Point orig_abc(atom.a_coord, atom.b_coord, atom.c_coord);
      Point uc_abc = cell->shiftABCInUC(orig_abc);
      //first, determine all the supercell images of this atom as required
      for(int a=0; a<num_cells; a++) {
        for(int b=0; b<num_cells; b++) {
          for(int c=0; c<num_cells; c++) {
            atom.a_coord=uc_abc[0]+a;
            atom.b_coord=uc_abc[1]+b;
            atom.c_coord=uc_abc[2]+c;
            // Do xyz conversion later, when needed for output
            new_atoms.push_back(atom);
            //now we have this atom, be it the original or a supercell projection, find the duplicates
            if(is_duplicate_perimeter_atoms) {
              double dupe_thresh = 0.001;
              if(atom.a_coord<dupe_thresh) {
                ATOM dupe = atom;
                dupe.a_coord = atom.a_coord+num_cells;
                new_atoms.push_back(dupe);
              }
              if(atom.b_coord<dupe_thresh) {
                ATOM dupe = atom;
                dupe.b_coord = atom.b_coord+num_cells;
                new_atoms.push_back(dupe);
              }
              if(atom.c_coord<dupe_thresh) {
                ATOM dupe = atom;
                dupe.c_coord = atom.c_coord+num_cells;
                new_atoms.push_back(dupe);
              }
              if(atom.a_coord<dupe_thresh && atom.b_coord<dupe_thresh) {
                ATOM dupe = atom;
                dupe.a_coord = atom.a_coord+num_cells;
                dupe.b_coord = atom.b_coord+num_cells;
                new_atoms.push_back(dupe);
              }
              if(atom.a_coord<dupe_thresh && atom.c_coord<dupe_thresh) {
                ATOM dupe = atom;
                dupe.a_coord = atom.a_coord+num_cells;
                dupe.c_coord = atom.c_coord+num_cells;
                new_atoms.push_back(dupe);
              }
              if(atom.b_coord<dupe_thresh && atom.c_coord<dupe_thresh) {
                ATOM dupe = atom;
                dupe.b_coord = atom.b_coord+num_cells;
                dupe.c_coord = atom.c_coord+num_cells;
                new_atoms.push_back(dupe);
              }
              if(atom.a_coord<dupe_thresh && atom.b_coord<dupe_thresh && atom.c_coord<dupe_thresh) {
                ATOM dupe = atom;
                dupe.a_coord = atom.a_coord+num_cells;
                dupe.b_coord = atom.b_coord+num_cells;
                dupe.c_coord = atom.c_coord+num_cells;
                new_atoms.push_back(dupe);
              }
              if(atom.a_coord>((double)(num_cells))-dupe_thresh) {
                ATOM dupe = atom;
                dupe.a_coord = atom.a_coord-num_cells;
                new_atoms.push_back(dupe);
              }
              if(atom.b_coord>((double)(num_cells))-dupe_thresh) {
                ATOM dupe = atom;
                dupe.b_coord = atom.b_coord-num_cells;
                new_atoms.push_back(dupe);
              }
              if(atom.c_coord>((double)(num_cells))-dupe_thresh) {
                ATOM dupe = atom;
                dupe.c_coord = atom.c_coord-num_cells;
                new_atoms.push_back(dupe);
              }
              if(atom.a_coord>((double)(num_cells))-dupe_thresh && atom.b_coord>((double)(num_cells))-dupe_thresh) {
                ATOM dupe = atom;
                dupe.a_coord = atom.a_coord-num_cells;
                dupe.b_coord = atom.b_coord-num_cells;
                new_atoms.push_back(dupe);
              }
              if(atom.a_coord>((double)(num_cells))-dupe_thresh && atom.c_coord>((double)(num_cells))-dupe_thresh) {
                ATOM dupe = atom;
                dupe.a_coord = atom.a_coord-num_cells;
                dupe.c_coord = atom.c_coord-num_cells;
                new_atoms.push_back(dupe);
              }
              if(atom.b_coord>((double)(num_cells))-dupe_thresh && atom.c_coord>((double)(num_cells))-dupe_thresh) {
                ATOM dupe = atom;
                dupe.b_coord = atom.b_coord-num_cells;
                dupe.c_coord = atom.c_coord-num_cells;
                new_atoms.push_back(dupe);
              }
              if(atom.a_coord>((double)(num_cells))-dupe_thresh && atom.b_coord>((double)(num_cells))-dupe_thresh && atom.c_coord>((double)(num_cells))-dupe_thresh) {
                ATOM dupe = atom;
                dupe.a_coord = atom.a_coord-num_cells;
                dupe.b_coord = atom.b_coord-num_cells;
                dupe.c_coord = atom.c_coord-num_cells;
                new_atoms.push_back(dupe);
              }
            }
          }
        }
      }
    }

    //2) write atom data
    output << new_atoms.size() << "\n" << "\n";
    for(int i=0; i<new_atoms.size(); i++) {
      Point p = cell->abc_to_xyz(new_atoms.at(i).a_coord, new_atoms.at(i).b_coord, new_atoms.at(i).c_coord);
      output << new_atoms.at(i).type << " " << p[0] << " " << p[1] << " " << p[2] << "\n";
    }
  }
  output.close();
  return true;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x408, %rsp            # imm = 0x408
movl %ecx, 0x1b4(%rsp)
movl %edx, %r15d
movq %rsi, 0x178(%rsp)
movq %rdi, %rbx
leaq 0x1f8(%rsp), %r14
movq %r14, %rdi
callq 0x4520
movq %r14, %rdi
movq %rbx, %rsi
movl $0x10, %edx
callq 0x43d0
leaq 0x278(%rsp), %rdi
callq 0x4120
movl %eax, %ebp
testb %al, %al
je 0x2d06f
movq 0x169f86(%rip), %r14    # 0x196fc0
leaq 0x123319(%rip), %rsi    # 0x15035a
movl $0x24, %edx
movq %r14, %rdi
callq 0x44e0
testq %rbx, %rbx
je 0x2d0b2
movq %rbx, %rdi
callq 0x41e0
movq 0x169f5e(%rip), %rdi    # 0x196fc0
movq %rbx, %rsi
movq %rax, %rdx
callq 0x44e0
jmp 0x2d0ca
movq 0x169f7a(%rip), %r14    # 0x196ff0
leaq 0x123600(%rip), %rsi    # 0x15067d
movl $0x27, %edx
movq %r14, %rdi
callq 0x44e0
testq %rbx, %rbx
je 0x2e5eb
movq %rbx, %rdi
callq 0x41e0
movq 0x169f4e(%rip), %rdi    # 0x196ff0
movq %rbx, %rsi
movq %rax, %rdx
callq 0x44e0
jmp 0x2e603
movq (%r14), %rax
movq -0x18(%rax), %rax
leaq (%r14,%rax), %rdi
movl 0x20(%r14,%rax), %esi
orl $0x1, %esi
callq 0x4710
movq 0x169eef(%rip), %rdi    # 0x196fc0
leaq 0x128456(%rip), %rsi    # 0x15552e
movl $0x1, %edx
callq 0x44e0
movb %bpl, 0x27(%rsp)
xorpd %xmm0, %xmm0
movapd %xmm0, 0x180(%rsp)
movq $0x0, 0x190(%rsp)
movq 0x178(%rsp), %rcx
cmpl $0x0, 0x110(%rcx)
jle 0x2e40f
movl %r15d, %eax
incl %eax
movl $0x80, %ebp
leaq 0xd0(%rsp), %rdx
leaq (%rdx,%rbp), %r15
leaq 0x80(%rsp), %r12
leaq 0xa0(%rsp), %r13
leaq 0x30(%rsp), %rdx
addq %rdx, %rbp
movl %eax, 0x174(%rsp)
xorps %xmm0, %xmm0
cvtsi2sd %eax, %xmm0
movsd 0x12297f(%rip), %xmm1   # 0x14fad8
movsd %xmm0, 0x28(%rsp)
addsd %xmm0, %xmm1
movsd %xmm1, 0x168(%rsp)
xorl %esi, %esi
leaq 0x180(%rsp), %rbx
movq 0x2f0(%rcx), %r14
movq 0x2f8(%rcx), %rdx
subq %r14, %rdx
sarq $0x3, %rdx
movabsq $-0x79435e50d79435e5, %rax # imm = 0x86BCA1AF286BCA1B
imulq %rax, %rdx
cmpq %rsi, %rdx
jbe 0x2e660
movq %rsi, 0x1b8(%rsp)
imulq $0x98, %rsi, %rcx
movupd (%r14,%rcx), %xmm0
movupd 0x10(%r14,%rcx), %xmm1
movupd 0x20(%r14,%rcx), %xmm2
movups 0x30(%r14,%rcx), %xmm3
movaps %xmm3, 0x100(%rsp)
movapd %xmm2, 0xf0(%rsp)
movapd %xmm1, 0xe0(%rsp)
movapd %xmm0, 0xd0(%rsp)
leaq 0x120(%rsp), %rax
movq %rax, 0x110(%rsp)
movq 0x40(%r14,%rcx), %rsi
movq %rcx, 0x1a0(%rsp)
movq 0x48(%r14,%rcx), %rdx
addq %rsi, %rdx
leaq 0x110(%rsp), %rdi
callq 0xf32a
addq 0x1a0(%rsp), %r14
leaq 0x140(%rsp), %rax
movq %rax, 0x130(%rsp)
movq 0x60(%r14), %rsi
movq 0x68(%r14), %rdx
addq %rsi, %rdx
leaq 0x130(%rsp), %rdi
callq 0xf32a
movb 0x90(%r14), %al
movb %al, 0x10(%r15)
movups 0x80(%r14), %xmm0
movups %xmm0, (%r15)
movsd 0xe8(%rsp), %xmm0
movsd 0xf0(%rsp), %xmm1
movsd 0xf8(%rsp), %xmm2
leaq 0x1e0(%rsp), %rdi
callq 0x85436
movq 0x1f0(%rsp), %rax
movq %rax, 0x10(%rsp)
movupd 0x1e0(%rsp), %xmm0
movupd %xmm0, (%rsp)
leaq 0x1c8(%rsp), %rdi
movq 0x178(%rsp), %rsi
callq 0x53d90
xorl %eax, %eax
movl %eax, 0x1ac(%rsp)
xorps %xmm0, %xmm0
cvtsi2sd %eax, %xmm0
movsd %xmm0, 0x1c0(%rsp)
xorl %eax, %eax
movl %eax, 0x1b0(%rsp)
xorps %xmm0, %xmm0
cvtsi2sd %eax, %xmm0
movsd %xmm0, 0x1a0(%rsp)
xorl %r14d, %r14d
leaq 0x1c8(%rsp), %rdi
xorl %esi, %esi
callq 0x85478
movsd (%rax), %xmm0
addsd 0x1c0(%rsp), %xmm0
movsd %xmm0, 0xe8(%rsp)
leaq 0x1c8(%rsp), %rdi
movl $0x1, %esi
callq 0x85478
movsd (%rax), %xmm0
addsd 0x1a0(%rsp), %xmm0
movsd %xmm0, 0xf0(%rsp)
leaq 0x1c8(%rsp), %rdi
movl $0x2, %esi
callq 0x85478
xorps %xmm0, %xmm0
cvtsi2sd %r14d, %xmm0
addsd (%rax), %xmm0
movsd %xmm0, 0xf8(%rsp)
movq %rbx, %rdi
leaq 0xd0(%rsp), %rsi
callq 0xe936
cmpb $0x0, 0x1b4(%rsp)
je 0x2e365
movsd 0x121cba(%rip), %xmm0   # 0x14f048
ucomisd 0xe8(%rsp), %xmm0
jbe 0x2d491
movapd 0xd0(%rsp), %xmm0
movapd 0xe0(%rsp), %xmm1
movapd 0xf0(%rsp), %xmm2
movaps 0x100(%rsp), %xmm3
movaps %xmm3, 0x60(%rsp)
movapd %xmm2, 0x50(%rsp)
movapd %xmm1, 0x40(%rsp)
movapd %xmm0, 0x30(%rsp)
movq %r12, 0x70(%rsp)
movq 0x110(%rsp), %rsi
movq 0x118(%rsp), %rdx
addq %rsi, %rdx
leaq 0x70(%rsp), %rdi
callq 0xf32a
movq %r13, 0x90(%rsp)
movq 0x130(%rsp), %rsi
movq 0x138(%rsp), %rdx
addq %rsi, %rdx
leaq 0x90(%rsp), %rdi
callq 0xf32a
movb 0x10(%r15), %al
movb %al, 0x10(%rbp)
movups (%r15), %xmm0
movups %xmm0, (%rbp)
movsd 0xe8(%rsp), %xmm0
addsd 0x28(%rsp), %xmm0
movsd %xmm0, 0x48(%rsp)
movq %rbx, %rdi
leaq 0x30(%rsp), %rsi
callq 0xe936
movq 0x90(%rsp), %rdi
cmpq %r13, %rdi
je 0x2d46f
movq 0xa0(%rsp), %rsi
incq %rsi
callq 0x4470
movq 0x70(%rsp), %rdi
cmpq %r12, %rdi
je 0x2d489
movq 0x80(%rsp), %rsi
incq %rsi
callq 0x4470
movsd 0x121bb7(%rip), %xmm0   # 0x14f048
ucomisd 0xf0(%rsp), %xmm0
jbe 0x2d594
movapd 0xd0(%rsp), %xmm0
movapd 0xe0(%rsp), %xmm1
movapd 0xf0(%rsp), %xmm2
movaps 0x100(%rsp), %xmm3
movaps %xmm3, 0x60(%rsp)
movapd %xmm2, 0x50(%rsp)
movapd %xmm1, 0x40(%rsp)
movapd %xmm0, 0x30(%rsp)
movq %r12, 0x70(%rsp)
movq 0x110(%rsp), %rsi
movq 0x118(%rsp), %rdx
addq %rsi, %rdx
leaq 0x70(%rsp), %rdi
callq 0xf32a
movq %r13, 0x90(%rsp)
movq 0x130(%rsp), %rsi
movq 0x138(%rsp), %rdx
addq %rsi, %rdx
leaq 0x90(%rsp), %rdi
callq 0xf32a
movb 0x10(%r15), %al
movb %al, 0x10(%rbp)
movups (%r15), %xmm0
movups %xmm0, (%rbp)
movsd 0xf0(%rsp), %xmm0
addsd 0x28(%rsp), %xmm0
movsd %xmm0, 0x50(%rsp)
movq %rbx, %rdi
leaq 0x30(%rsp), %rsi
callq 0xe936
movq 0x90(%rsp), %rdi
cmpq %r13, %rdi
je 0x2d572
movq 0xa0(%rsp), %rsi
incq %rsi
callq 0x4470
movq 0x70(%rsp), %rdi
cmpq %r12, %rdi
je 0x2d58c
movq 0x80(%rsp), %rsi
incq %rsi
callq 0x4470
movsd 0x121ab4(%rip), %xmm0   # 0x14f048
ucomisd 0xf8(%rsp), %xmm0
jbe 0x2d697
movapd 0xd0(%rsp), %xmm0
movapd 0xe0(%rsp), %xmm1
movapd 0xf0(%rsp), %xmm2
movaps 0x100(%rsp), %xmm3
movaps %xmm3, 0x60(%rsp)
movapd %xmm2, 0x50(%rsp)
movapd %xmm1, 0x40(%rsp)
movapd %xmm0, 0x30(%rsp)
movq %r12, 0x70(%rsp)
movq 0x110(%rsp), %rsi
movq 0x118(%rsp), %rdx
addq %rsi, %rdx
leaq 0x70(%rsp), %rdi
callq 0xf32a
movq %r13, 0x90(%rsp)
movq 0x130(%rsp), %rsi
movq 0x138(%rsp), %rdx
addq %rsi, %rdx
leaq 0x90(%rsp), %rdi
callq 0xf32a
movb 0x10(%r15), %al
movb %al, 0x10(%rbp)
movups (%r15), %xmm0
movups %xmm0, (%rbp)
movsd 0xf8(%rsp), %xmm0
addsd 0x28(%rsp), %xmm0
movsd %xmm0, 0x58(%rsp)
movq %rbx, %rdi
leaq 0x30(%rsp), %rsi
callq 0xe936
movq 0x90(%rsp), %rdi
cmpq %r13, %rdi
je 0x2d675
movq 0xa0(%rsp), %rsi
incq %rsi
callq 0x4470
movq 0x70(%rsp), %rdi
cmpq %r12, %rdi
je 0x2d68f
movq 0x80(%rsp), %rsi
incq %rsi
callq 0x4470
movsd 0x1219b1(%rip), %xmm0   # 0x14f048
ucomisd 0xe8(%rsp), %xmm0
jbe 0x2d7c0
ucomisd 0xf0(%rsp), %xmm0
jbe 0x2d7c0
movapd 0xd0(%rsp), %xmm0
movapd 0xe0(%rsp), %xmm1
movapd 0xf0(%rsp), %xmm2
movaps 0x100(%rsp), %xmm3
movaps %xmm3, 0x60(%rsp)
movapd %xmm2, 0x50(%rsp)
movapd %xmm1, 0x40(%rsp)
movapd %xmm0, 0x30(%rsp)
movq %r12, 0x70(%rsp)
movq 0x110(%rsp), %rsi
movq 0x118(%rsp), %rdx
addq %rsi, %rdx
leaq 0x70(%rsp), %rdi
callq 0xf32a
movq %r13, 0x90(%rsp)
movq 0x130(%rsp), %rsi
movq 0x138(%rsp), %rdx
addq %rsi, %rdx
leaq 0x90(%rsp), %rdi
callq 0xf32a
movb 0x10(%r15), %al
movb %al, 0x10(%rbp)
movups (%r15), %xmm0
movups %xmm0, (%rbp)
movsd 0xe8(%rsp), %xmm0
movsd 0x28(%rsp), %xmm1
addsd %xmm1, %xmm0
movsd %xmm0, 0x48(%rsp)
movsd 0xf0(%rsp), %xmm0
addsd %xmm1, %xmm0
movsd %xmm0, 0x50(%rsp)
movq %rbx, %rdi
leaq 0x30(%rsp), %rsi
callq 0xe936
movq 0x90(%rsp), %rdi
cmpq %r13, %rdi
je 0x2d79e
movq 0xa0(%rsp), %rsi
incq %rsi
callq 0x4470
movq 0x70(%rsp), %rdi
cmpq %r12, %rdi
je 0x2d7b8
movq 0x80(%rsp), %rsi
incq %rsi
callq 0x4470
movsd 0x121888(%rip), %xmm0   # 0x14f048
ucomisd 0xe8(%rsp), %xmm0
jbe 0x2d8e9
ucomisd 0xf8(%rsp), %xmm0
jbe 0x2d8e9
movapd 0xd0(%rsp), %xmm0
movapd 0xe0(%rsp), %xmm1
movapd 0xf0(%rsp), %xmm2
movaps 0x100(%rsp), %xmm3
movaps %xmm3, 0x60(%rsp)
movapd %xmm2, 0x50(%rsp)
movapd %xmm1, 0x40(%rsp)
movapd %xmm0, 0x30(%rsp)
movq %r12, 0x70(%rsp)
movq 0x110(%rsp), %rsi
movq 0x118(%rsp), %rdx
addq %rsi, %rdx
leaq 0x70(%rsp), %rdi
callq 0xf32a
movq %r13, 0x90(%rsp)
movq 0x130(%rsp), %rsi
movq 0x138(%rsp), %rdx
addq %rsi, %rdx
leaq 0x90(%rsp), %rdi
callq 0xf32a
movb 0x10(%r15), %al
movb %al, 0x10(%rbp)
movups (%r15), %xmm0
movups %xmm0, (%rbp)
movsd 0xe8(%rsp), %xmm0
movsd 0x28(%rsp), %xmm1
addsd %xmm1, %xmm0
movsd %xmm0, 0x48(%rsp)
movsd 0xf8(%rsp), %xmm0
addsd %xmm1, %xmm0
movsd %xmm0, 0x58(%rsp)
movq %rbx, %rdi
leaq 0x30(%rsp), %rsi
callq 0xe936
movq 0x90(%rsp), %rdi
cmpq %r13, %rdi
je 0x2d8c7
movq 0xa0(%rsp), %rsi
incq %rsi
callq 0x4470
movq 0x70(%rsp), %rdi
cmpq %r12, %rdi
je 0x2d8e1
movq 0x80(%rsp), %rsi
incq %rsi
callq 0x4470
movsd 0x12175f(%rip), %xmm0   # 0x14f048
ucomisd 0xf0(%rsp), %xmm0
jbe 0x2da12
ucomisd 0xf8(%rsp), %xmm0
jbe 0x2da12
movapd 0xd0(%rsp), %xmm0
movapd 0xe0(%rsp), %xmm1
movapd 0xf0(%rsp), %xmm2
movaps 0x100(%rsp), %xmm3
movaps %xmm3, 0x60(%rsp)
movapd %xmm2, 0x50(%rsp)
movapd %xmm1, 0x40(%rsp)
movapd %xmm0, 0x30(%rsp)
movq %r12, 0x70(%rsp)
movq 0x110(%rsp), %rsi
movq 0x118(%rsp), %rdx
addq %rsi, %rdx
leaq 0x70(%rsp), %rdi
callq 0xf32a
movq %r13, 0x90(%rsp)
movq 0x130(%rsp), %rsi
movq 0x138(%rsp), %rdx
addq %rsi, %rdx
leaq 0x90(%rsp), %rdi
callq 0xf32a
movb 0x10(%r15), %al
movb %al, 0x10(%rbp)
movups (%r15), %xmm0
movups %xmm0, (%rbp)
movsd 0xf0(%rsp), %xmm0
movsd 0x28(%rsp), %xmm1
addsd %xmm1, %xmm0
movsd %xmm0, 0x50(%rsp)
movsd 0xf8(%rsp), %xmm0
addsd %xmm1, %xmm0
movsd %xmm0, 0x58(%rsp)
movq %rbx, %rdi
leaq 0x30(%rsp), %rsi
callq 0xe936
movq 0x90(%rsp), %rdi
cmpq %r13, %rdi
je 0x2d9f0
movq 0xa0(%rsp), %rsi
incq %rsi
callq 0x4470
movq 0x70(%rsp), %rdi
cmpq %r12, %rdi
je 0x2da0a
movq 0x80(%rsp), %rsi
incq %rsi
callq 0x4470
movsd 0x121636(%rip), %xmm0   # 0x14f048
ucomisd 0xe8(%rsp), %xmm0
jbe 0x2db55
ucomisd 0xf0(%rsp), %xmm0
jbe 0x2db55
ucomisd 0xf8(%rsp), %xmm0
jbe 0x2db55
movapd 0xd0(%rsp), %xmm0
movapd 0xe0(%rsp), %xmm1
movapd 0xf0(%rsp), %xmm2
movaps 0x100(%rsp), %xmm3
movaps %xmm3, 0x60(%rsp)
movapd %xmm2, 0x50(%rsp)
movapd %xmm1, 0x40(%rsp)
movapd %xmm0, 0x30(%rsp)
movq %r12, 0x70(%rsp)
movq 0x110(%rsp), %rsi
movq 0x118(%rsp), %rdx
addq %rsi, %rdx
leaq 0x70(%rsp), %rdi
callq 0xf32a
movq %r13, 0x90(%rsp)
movq 0x130(%rsp), %rsi
movq 0x138(%rsp), %rdx
addq %rsi, %rdx
leaq 0x90(%rsp), %rdi
callq 0xf32a
movb 0x10(%r15), %al
movb %al, 0x10(%rbp)
movups (%r15), %xmm0
movups %xmm0, (%rbp)
movsd 0xe8(%rsp), %xmm0
movsd 0x28(%rsp), %xmm1
addsd %xmm1, %xmm0
movsd %xmm0, 0x48(%rsp)
movsd 0xf0(%rsp), %xmm0
addsd %xmm1, %xmm0
movsd %xmm0, 0x50(%rsp)
movsd 0xf8(%rsp), %xmm0
addsd %xmm1, %xmm0
movsd %xmm0, 0x58(%rsp)
movq %rbx, %rdi
leaq 0x30(%rsp), %rsi
callq 0xe936
movq 0x90(%rsp), %rdi
cmpq %r13, %rdi
je 0x2db3b
movq 0xa0(%rsp), %rsi
incq %rsi
callq 0x4470
movq 0x70(%rsp), %rdi
cmpq %r12, %rdi
je 0x2db55
movq 0x80(%rsp), %rsi
incq %rsi
callq 0x4470
movsd 0xe8(%rsp), %xmm0
movsd 0x168(%rsp), %xmm1
ucomisd %xmm1, %xmm0
jbe 0x2dc66
movapd 0xd0(%rsp), %xmm0
movapd 0xe0(%rsp), %xmm1
movapd 0xf0(%rsp), %xmm2
movaps 0x100(%rsp), %xmm3
movaps %xmm3, 0x60(%rsp)
movapd %xmm2, 0x50(%rsp)
movapd %xmm1, 0x40(%rsp)
movapd %xmm0, 0x30(%rsp)
movq %r12, 0x70(%rsp)
movq 0x110(%rsp), %rsi
movq 0x118(%rsp), %rdx
addq %rsi, %rdx
leaq 0x70(%rsp), %rdi
callq 0xf32a
movq %r13, 0x90(%rsp)
movq 0x130(%rsp), %rsi
movq 0x138(%rsp), %rdx
addq %rsi, %rdx
leaq 0x90(%rsp), %rdi
callq 0xf32a
movb 0x10(%r15), %al
movb %al, 0x10(%rbp)
movups (%r15), %xmm0
movups %xmm0, (%rbp)
movsd 0xe8(%rsp), %xmm0
subsd 0x28(%rsp), %xmm0
movsd %xmm0, 0x48(%rsp)
movq %rbx, %rdi
leaq 0x30(%rsp), %rsi
callq 0xe936
movq 0x90(%rsp), %rdi
cmpq %r13, %rdi
je 0x2dc43
movq 0xa0(%rsp), %rsi
incq %rsi
callq 0x4470
movq 0x70(%rsp), %rdi
cmpq %r12, %rdi
je 0x2dc5d
movq 0x80(%rsp), %rsi
incq %rsi
callq 0x4470
movsd 0x168(%rsp), %xmm1
movsd 0xf0(%rsp), %xmm0
ucomisd %xmm1, %xmm0
jbe 0x2dd6e
movapd 0xd0(%rsp), %xmm0
movapd 0xe0(%rsp), %xmm1
movapd 0xf0(%rsp), %xmm2
movaps 0x100(%rsp), %xmm3
movaps %xmm3, 0x60(%rsp)
movapd %xmm2, 0x50(%rsp)
movapd %xmm1, 0x40(%rsp)
movapd %xmm0, 0x30(%rsp)
movq %r12, 0x70(%rsp)
movq 0x110(%rsp), %rsi
movq 0x118(%rsp), %rdx
addq %rsi, %rdx
leaq 0x70(%rsp), %rdi
callq 0xf32a
movq %r13, 0x90(%rsp)
movq 0x130(%rsp), %rsi
movq 0x138(%rsp), %rdx
addq %rsi, %rdx
leaq 0x90(%rsp), %rdi
callq 0xf32a
movb 0x10(%r15), %al
movb %al, 0x10(%rbp)
movups (%r15), %xmm0
movups %xmm0, (%rbp)
movsd 0xf0(%rsp), %xmm0
subsd 0x28(%rsp), %xmm0
movsd %xmm0, 0x50(%rsp)
movq %rbx, %rdi
leaq 0x30(%rsp), %rsi
callq 0xe936
movq 0x90(%rsp), %rdi
cmpq %r13, %rdi
je 0x2dd4b
movq 0xa0(%rsp), %rsi
incq %rsi
callq 0x4470
movq 0x70(%rsp), %rdi
cmpq %r12, %rdi
je 0x2dd65
movq 0x80(%rsp), %rsi
incq %rsi
callq 0x4470
movsd 0x168(%rsp), %xmm1
movsd 0xf8(%rsp), %xmm0
ucomisd %xmm1, %xmm0
jbe 0x2de76
movapd 0xd0(%rsp), %xmm0
movapd 0xe0(%rsp), %xmm1
movapd 0xf0(%rsp), %xmm2
movaps 0x100(%rsp), %xmm3
movaps %xmm3, 0x60(%rsp)
movapd %xmm2, 0x50(%rsp)
movapd %xmm1, 0x40(%rsp)
movapd %xmm0, 0x30(%rsp)
movq %r12, 0x70(%rsp)
movq 0x110(%rsp), %rsi
movq 0x118(%rsp), %rdx
addq %rsi, %rdx
leaq 0x70(%rsp), %rdi
callq 0xf32a
movq %r13, 0x90(%rsp)
movq 0x130(%rsp), %rsi
movq 0x138(%rsp), %rdx
addq %rsi, %rdx
leaq 0x90(%rsp), %rdi
callq 0xf32a
movb 0x10(%r15), %al
movb %al, 0x10(%rbp)
movups (%r15), %xmm0
movups %xmm0, (%rbp)
movsd 0xf8(%rsp), %xmm0
subsd 0x28(%rsp), %xmm0
movsd %xmm0, 0x58(%rsp)
movq %rbx, %rdi
leaq 0x30(%rsp), %rsi
callq 0xe936
movq 0x90(%rsp), %rdi
cmpq %r13, %rdi
je 0x2de53
movq 0xa0(%rsp), %rsi
incq %rsi
callq 0x4470
movq 0x70(%rsp), %rdi
cmpq %r12, %rdi
je 0x2de6d
movq 0x80(%rsp), %rsi
incq %rsi
callq 0x4470
movsd 0x168(%rsp), %xmm1
movsd 0xe8(%rsp), %xmm0
ucomisd %xmm1, %xmm0
jbe 0x2dfa8
movsd 0xf0(%rsp), %xmm0
ucomisd %xmm1, %xmm0
jbe 0x2dfa8
movapd 0xd0(%rsp), %xmm0
movapd 0xe0(%rsp), %xmm1
movapd 0xf0(%rsp), %xmm2
movaps 0x100(%rsp), %xmm3
movaps %xmm3, 0x60(%rsp)
movapd %xmm2, 0x50(%rsp)
movapd %xmm1, 0x40(%rsp)
movapd %xmm0, 0x30(%rsp)
movq %r12, 0x70(%rsp)
movq 0x110(%rsp), %rsi
movq 0x118(%rsp), %rdx
addq %rsi, %rdx
leaq 0x70(%rsp), %rdi
callq 0xf32a
movq %r13, 0x90(%rsp)
movq 0x130(%rsp), %rsi
movq 0x138(%rsp), %rdx
addq %rsi, %rdx
leaq 0x90(%rsp), %rdi
callq 0xf32a
movb 0x10(%r15), %al
movb %al, 0x10(%rbp)
movups (%r15), %xmm0
movups %xmm0, (%rbp)
movsd 0xe8(%rsp), %xmm0
movsd 0xf0(%rsp), %xmm1
movsd 0x28(%rsp), %xmm2
subsd %xmm2, %xmm0
movsd %xmm0, 0x48(%rsp)
subsd %xmm2, %xmm1
movsd %xmm1, 0x50(%rsp)
movq %rbx, %rdi
leaq 0x30(%rsp), %rsi
callq 0xe936
movq 0x90(%rsp), %rdi
cmpq %r13, %rdi
je 0x2df85
movq 0xa0(%rsp), %rsi
incq %rsi
callq 0x4470
movq 0x70(%rsp), %rdi
cmpq %r12, %rdi
je 0x2df9f
movq 0x80(%rsp), %rsi
incq %rsi
callq 0x4470
movsd 0x168(%rsp), %xmm1
movsd 0xe8(%rsp), %xmm0
ucomisd %xmm1, %xmm0
jbe 0x2e0da
movsd 0xf8(%rsp), %xmm0
ucomisd %xmm1, %xmm0
jbe 0x2e0da
movapd 0xd0(%rsp), %xmm0
movapd 0xe0(%rsp), %xmm1
movapd 0xf0(%rsp), %xmm2
movaps 0x100(%rsp), %xmm3
movaps %xmm3, 0x60(%rsp)
movapd %xmm2, 0x50(%rsp)
movapd %xmm1, 0x40(%rsp)
movapd %xmm0, 0x30(%rsp)
movq %r12, 0x70(%rsp)
movq 0x110(%rsp), %rsi
movq 0x118(%rsp), %rdx
addq %rsi, %rdx
leaq 0x70(%rsp), %rdi
callq 0xf32a
movq %r13, 0x90(%rsp)
movq 0x130(%rsp), %rsi
movq 0x138(%rsp), %rdx
addq %rsi, %rdx
leaq 0x90(%rsp), %rdi
callq 0xf32a
movb 0x10(%r15), %al
movb %al, 0x10(%rbp)
movups (%r15), %xmm0
movups %xmm0, (%rbp)
movsd 0xe8(%rsp), %xmm0
movsd 0xf8(%rsp), %xmm1
movsd 0x28(%rsp), %xmm2
subsd %xmm2, %xmm0
movsd %xmm0, 0x48(%rsp)
subsd %xmm2, %xmm1
movsd %xmm1, 0x58(%rsp)
movq %rbx, %rdi
leaq 0x30(%rsp), %rsi
callq 0xe936
movq 0x90(%rsp), %rdi
cmpq %r13, %rdi
je 0x2e0b7
movq 0xa0(%rsp), %rsi
incq %rsi
callq 0x4470
movq 0x70(%rsp), %rdi
cmpq %r12, %rdi
je 0x2e0d1
movq 0x80(%rsp), %rsi
incq %rsi
callq 0x4470
movsd 0x168(%rsp), %xmm1
movsd 0xf0(%rsp), %xmm0
ucomisd %xmm1, %xmm0
jbe 0x2e20c
movsd 0xf8(%rsp), %xmm0
ucomisd %xmm1, %xmm0
jbe 0x2e20c
movapd 0xd0(%rsp), %xmm0
movapd 0xe0(%rsp), %xmm1
movapd 0xf0(%rsp), %xmm2
movaps 0x100(%rsp), %xmm3
movaps %xmm3, 0x60(%rsp)
movapd %xmm2, 0x50(%rsp)
movapd %xmm1, 0x40(%rsp)
movapd %xmm0, 0x30(%rsp)
movq %r12, 0x70(%rsp)
movq 0x110(%rsp), %rsi
movq 0x118(%rsp), %rdx
addq %rsi, %rdx
leaq 0x70(%rsp), %rdi
callq 0xf32a
movq %r13, 0x90(%rsp)
movq 0x130(%rsp), %rsi
movq 0x138(%rsp), %rdx
addq %rsi, %rdx
leaq 0x90(%rsp), %rdi
callq 0xf32a
movb 0x10(%r15), %al
movb %al, 0x10(%rbp)
movups (%r15), %xmm0
movups %xmm0, (%rbp)
movsd 0xf0(%rsp), %xmm0
movsd 0xf8(%rsp), %xmm1
movsd 0x28(%rsp), %xmm2
subsd %xmm2, %xmm0
movsd %xmm0, 0x50(%rsp)
subsd %xmm2, %xmm1
movsd %xmm1, 0x58(%rsp)
movq %rbx, %rdi
leaq 0x30(%rsp), %rsi
callq 0xe936
movq 0x90(%rsp), %rdi
cmpq %r13, %rdi
je 0x2e1e9
movq 0xa0(%rsp), %rsi
incq %rsi
callq 0x4470
movq 0x70(%rsp), %rdi
cmpq %r12, %rdi
je 0x2e203
movq 0x80(%rsp), %rsi
incq %rsi
callq 0x4470
movsd 0x168(%rsp), %xmm1
movsd 0xe8(%rsp), %xmm0
ucomisd %xmm1, %xmm0
jbe 0x2e365
movsd 0xf0(%rsp), %xmm0
ucomisd 0x168(%rsp), %xmm0
jbe 0x2e365
movsd 0xf8(%rsp), %xmm0
ucomisd 0x168(%rsp), %xmm0
jbe 0x2e365
movapd 0xd0(%rsp), %xmm0
movapd 0xe0(%rsp), %xmm1
movapd 0xf0(%rsp), %xmm2
movaps 0x100(%rsp), %xmm3
movaps %xmm3, 0x60(%rsp)
movapd %xmm2, 0x50(%rsp)
movapd %xmm1, 0x40(%rsp)
movapd %xmm0, 0x30(%rsp)
movq %r12, 0x70(%rsp)
movq 0x110(%rsp), %rsi
movq 0x118(%rsp), %rdx
addq %rsi, %rdx
leaq 0x70(%rsp), %rdi
callq 0xf32a
movq %r13, 0x90(%rsp)
movq 0x130(%rsp), %rsi
movq 0x138(%rsp), %rdx
addq %rsi, %rdx
leaq 0x90(%rsp), %rdi
callq 0xf32a
movb 0x10(%r15), %al
movb %al, 0x10(%rbp)
movups (%r15), %xmm0
movups %xmm0, (%rbp)
movsd 0xe8(%rsp), %xmm0
movsd 0xf0(%rsp), %xmm1
movsd 0x28(%rsp), %xmm2
subsd %xmm2, %xmm0
movsd %xmm0, 0x48(%rsp)
subsd %xmm2, %xmm1
movsd %xmm1, 0x50(%rsp)
movsd 0xf8(%rsp), %xmm0
subsd %xmm2, %xmm0
movsd %xmm0, 0x58(%rsp)
movq %rbx, %rdi
leaq 0x30(%rsp), %rsi
callq 0xe936
movq 0x90(%rsp), %rdi
cmpq %r13, %rdi
je 0x2e34b
movq 0xa0(%rsp), %rsi
incq %rsi
callq 0x4470
movq 0x70(%rsp), %rdi
cmpq %r12, %rdi
je 0x2e365
movq 0x80(%rsp), %rsi
incq %rsi
callq 0x4470
incl %r14d
cmpl %r14d, 0x174(%rsp)
jne 0x2d2f4
movl 0x1b0(%rsp), %eax
incl %eax
cmpl 0x174(%rsp), %eax
jne 0x2d2da
movl 0x1ac(%rsp), %eax
incl %eax
cmpl 0x174(%rsp), %eax
jne 0x2d2c1
movq 0x130(%rsp), %rdi
leaq 0x140(%rsp), %rax
cmpq %rax, %rdi
je 0x2e3c7
movq 0x140(%rsp), %rsi
incq %rsi
callq 0x4470
movq 0x110(%rsp), %rdi
leaq 0x120(%rsp), %rax
cmpq %rax, %rdi
je 0x2e3ec
movq 0x120(%rsp), %rsi
incq %rsi
callq 0x4470
movq 0x1b8(%rsp), %rsi
incq %rsi
movq 0x178(%rsp), %rcx
movslq 0x110(%rcx), %rax
cmpq %rax, %rsi
jl 0x2d176
leaq 0x208(%rsp), %rdi
movq 0x188(%rsp), %rsi
subq 0x180(%rsp), %rsi
sarq $0x3, %rsi
movabsq $-0x79435e50d79435e5, %rax # imm = 0x86BCA1AF286BCA1B
imulq %rax, %rsi
callq 0x42b0
movq %rax, %r14
leaq 0x1270e6(%rip), %rsi    # 0x15552e
movl $0x1, %edx
movq %rax, %rdi
callq 0x44e0
leaq 0x1270d2(%rip), %rsi    # 0x15552e
movl $0x1, %edx
movq %r14, %rdi
callq 0x44e0
movq 0x180(%rsp), %rax
cmpq %rax, 0x188(%rsp)
je 0x2e5ca
xorl %ebx, %ebx
leaq 0xd0(%rsp), %r15
leaq 0x128ff6(%rip), %r12    # 0x157486
leaq 0x127097(%rip), %r13    # 0x15552e
xorl %r14d, %r14d
movsd 0x18(%rax,%rbx), %xmm0
movsd 0x20(%rax,%rbx), %xmm1
movsd 0x28(%rax,%rbx), %xmm2
movq %r15, %rdi
movq 0x178(%rsp), %rsi
callq 0x53092
movq 0x180(%rsp), %rax
movq 0x188(%rsp), %rdx
subq %rax, %rdx
sarq $0x3, %rdx
movabsq $-0x79435e50d79435e5, %rcx # imm = 0x86BCA1AF286BCA1B
imulq %rcx, %rdx
cmpq %r14, %rdx
jbe 0x2e64f
movq 0x40(%rax,%rbx), %rsi
movq 0x48(%rax,%rbx), %rdx
leaq 0x208(%rsp), %rdi
callq 0x44e0
movq %rax, %rbp
movl $0x1, %edx
movq %rax, %rdi
movq %r12, %rsi
callq 0x44e0
movq %r15, %rdi
xorl %esi, %esi
callq 0x85478
movsd (%rax), %xmm0
movq %rbp, %rdi
callq 0x46b0
movq %rax, %rbp
movl $0x1, %edx
movq %rax, %rdi
movq %r12, %rsi
callq 0x44e0
movq %r15, %rdi
movl $0x1, %esi
callq 0x85478
movsd (%rax), %xmm0
movq %rbp, %rdi
callq 0x46b0
movq %rax, %rbp
movl $0x1, %edx
movq %rax, %rdi
movq %r12, %rsi
callq 0x44e0
movq %r15, %rdi
movl $0x2, %esi
callq 0x85478
movsd (%rax), %xmm0
movq %rbp, %rdi
callq 0x46b0
movl $0x1, %edx
movq %rax, %rdi
movq %r13, %rsi
callq 0x44e0
incq %r14
movq 0x180(%rsp), %rax
movq 0x188(%rsp), %rcx
subq %rax, %rcx
sarq $0x3, %rcx
movabsq $-0x79435e50d79435e5, %rdx # imm = 0x86BCA1AF286BCA1B
imulq %rdx, %rcx
addq $0x98, %rbx
cmpq %r14, %rcx
ja 0x2e49a
leaq 0x180(%rsp), %rdi
callq 0xf236
leaq 0x1f8(%rsp), %rdi
callq 0x4090
movb 0x27(%rsp), %bpl
jmp 0x2e62e
movq (%r14), %rax
movq -0x18(%rax), %rax
leaq (%r14,%rax), %rdi
movl 0x20(%r14,%rax), %esi
orl $0x1, %esi
callq 0x4710
movq (%r14), %rax
addq -0x18(%rax), %r14
movq %r14, %rdi
movl $0xa, %esi
callq 0x4420
movsbl %al, %esi
movq 0x1689cf(%rip), %rdi    # 0x196ff0
callq 0x4040
movq %rax, %rdi
callq 0x42c0
leaq 0x1f8(%rsp), %rdi
callq 0x4110
movl %ebp, %eax
addq $0x408, %rsp            # imm = 0x408
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x12104f(%rip), %rdi    # 0x14f6a5
movq %r14, %rsi
xorl %eax, %eax
callq 0x4630
leaq 0x12103e(%rip), %rdi    # 0x14f6a5
xorl %eax, %eax
callq 0x4630
jmp 0x2e690
jmp 0x2e716
jmp 0x2e716
movq %rax, %rbx
jmp 0x2e73e
jmp 0x2e690
jmp 0x2e690
jmp 0x2e690
movq %rax, %rbx
jmp 0x2e770
movq %rax, %rbx
jmp 0x2e763
jmp 0x2e6f7
jmp 0x2e716
jmp 0x2e6e6
jmp 0x2e716
jmp 0x2e6f7
jmp 0x2e6e6
jmp 0x2e6f7
jmp 0x2e716
jmp 0x2e716
jmp 0x2e6e6
jmp 0x2e6e6
jmp 0x2e6f7
jmp 0x2e6e6
jmp 0x2e716
jmp 0x2e6f7
jmp 0x2e716
jmp 0x2e6e6
jmp 0x2e6e6
jmp 0x2e6f7
jmp 0x2e6f7
jmp 0x2e716
jmp 0x2e716
jmp 0x2e6f7
jmp 0x2e6e6
jmp 0x2e716
jmp 0x2e6f7
jmp 0x2e6e6
jmp 0x2e716
jmp 0x2e716
jmp 0x2e6e6
jmp 0x2e6f7
jmp 0x2e6f7
jmp 0x2e6e6
jmp 0x2e716
jmp 0x2e6f7
jmp 0x2e6e6
jmp 0x2e716
jmp 0x2e716
jmp 0x2e6e6
movq %rax, %rbx
leaq 0x30(%rsp), %rdi
callq 0x2f814
jmp 0x2e719
jmp 0x2e6f7
movq %rax, %rbx
movq 0x70(%rsp), %rdi
cmpq %r12, %rdi
je 0x2e719
movq 0x80(%rsp), %rsi
incq %rsi
callq 0x4470
jmp 0x2e719
movq %rax, %rbx
movq 0x130(%rsp), %rdi
leaq 0x140(%rsp), %rax
cmpq %rax, %rdi
je 0x2e73e
movq 0x140(%rsp), %rsi
incq %rsi
callq 0x4470
movq 0x110(%rsp), %rdi
leaq 0x120(%rsp), %rax
cmpq %rax, %rdi
je 0x2e763
movq 0x120(%rsp), %rsi
incq %rsi
callq 0x4470
leaq 0x180(%rsp), %rdi
callq 0xf236
leaq 0x1f8(%rsp), %rdi
callq 0x4110
movq %rbx, %rdi
callq 0x4780