// File: /workspace/github_cpp_makefile_star2_O3/Luthaf[P]zeopp/networkstorage.cc
// Function: place_molecule(std::vector<MOLECULE, std::allocator<MOLECULE>>*, std::vector<CONNECTION, std::allocator<CONNECTION>>*, ATOM_NETWORK*, std::vector<bool, std::allocator<bool>>*, std::vector<bool, std::allocator<bool>>*, std::vector<MOLECULE, std::allocator<MOLECULE>>*, int, double*)
int place_molecule(vector<MOLECULE> *molecules, vector<CONNECTION> *two_way_connections, ATOM_NETWORK *cell, vector<bool> *placed, vector<bool> *connected, vector<MOLECULE> *framework, int num_placed, double *sum_edge_lengths) {
  bool verbose = false;
  //1) if no molecules have been placed yet, just fix the first one in position with its first edge at the origin
  if(num_placed==0) {
if(verbose) printf("DEBUG: detected that no molecules have yet been placed - positioning first molecule with first edge at the origin\n");
    int v_index = two_way_connections->at(0).v1;
    int e_index = two_way_connections->at(0).e1;
    MOLECULE placing = molecules->at(v_index);
    int site_index = placing.permutation.at(e_index);
    int atom_index = placing.sites.at(site_index);
    XYZ site = placing.atoms_xyz.at(atom_index);
    XYZ shift = site.scale(-1);
if(verbose) printf("DEBUG: v=%d, e=%d; site=%.3f %.3f %.3f; shift=%.3f %.3f %.3f\n", v_index, e_index, site.x, site.y, site.z, shift.x, shift.y, shift.z);
    framework->at(v_index) = (translate(placing, shift));
    placed->at(v_index) = true;
    return num_placed+1;
  }
  //2) otherwise, need to find a new molecule to place
if(verbose) printf("DEBUG: detected that %d molecules have already been placed\n", num_placed);
  int num_molecules = molecules->size();
  int num_connections = two_way_connections->size();
  int molecule_index = -1;
  for(int i=0; i<num_molecules && molecule_index==-1; i++) {
    if(!placed->at(i)) { //if this molecule has not yet been placed - it is a candidate for placement, but we must have an adjacent molecule already placed which we can attach it to
      int connection_index = -1;
      for(int j=0; j<num_connections && connection_index==-1; j++) { //is there any two way connection which connects this new molecule and any previously placed one?
        if(!connected->at(j)) { //if this connection was already made, we don't need to check it again
          CONNECTION c = two_way_connections->at(j);
          int placing_edge_index = -1, fixed_edge_index = -1;
          int placing_vertex_index = -1, fixed_vertex_index = -1;
          if(c.v1==i) { //vertex 1 in this connection is the molecule we are placing
            if(placed->at(c.v2)) { //vertex 2 in this connection is a molecule which has already been placed
              placing_edge_index = c.e1;
              fixed_edge_index = c.e2;
              placing_vertex_index = c.v1;
              fixed_vertex_index = c.v2;
            }
          } else if(c.v2==i) { //vertex 2 in this connection is the molecule we are placing
            if(placed->at(c.v1)) { //vertex 1 in this connection is a molecule which has already been placed
              placing_edge_index = c.e2;
              fixed_edge_index = c.e1;
              placing_vertex_index = c.v2;
              fixed_vertex_index = c.v1;
            }
          }
          if(fixed_edge_index!=-1 && placing_edge_index!=-1 && fixed_vertex_index!=-1 && placing_vertex_index!=-1) { //this connection connects this molecule and a fixed molecule, and we have stored the relevant edge and vertex indices - we can proceed to place this molecule!
if(verbose) printf("DEBUG: found that new vertex %d edge %d is connected to fixed vertex %d edge %d\n", placing_vertex_index, placing_edge_index, fixed_vertex_index, fixed_edge_index);
            MOLECULE placing = molecules->at(placing_vertex_index);
            int placing_site_index = placing.permutation.at(placing_edge_index);
            int placing_atom_index = placing.sites.at(placing_site_index);
            MOLECULE fixed = framework->at(fixed_vertex_index);
            int fixed_site_index = fixed.permutation.at(fixed_edge_index);
            int fixed_atom_index = fixed.sites.at(fixed_site_index);
if(verbose) printf("DEBUG: %s in placing connecting to %s in fixed\n", placing.atoms_type.at(placing_atom_index).c_str(), fixed.atoms_type.at(fixed_atom_index).c_str());
            if(placing.atoms_type.at(placing_atom_index)!=fixed.atoms_type.at(fixed_atom_index)) {//only make the connection if the sites are the same type!
if(verbose) printf("DEBUG: trying to connect conflicting connection sites - aborting construction attempt\n");
              return num_placed;
            }
//if(1) exit(1);
            XYZ placing_site = placing.atoms_xyz.at(placing_atom_index);
            XYZ fixed_site = fixed.atoms_xyz.at(fixed_atom_index);
            XYZ shift = fixed_site-placing_site;
if(verbose) printf("DEBUG: site index in fixed = %d, site_index in placing = %d\n", fixed_site_index, placing_site_index);
if(verbose) printf("DEBUG: fixed_site=%.3f %.3f %.3f; placing_site=%.3f %.3f %.3f; shift=%.3f %.3f %.3f\n", fixed_site.x, fixed_site.y, fixed_site.z, placing_site.x, placing_site.y, placing_site.z, shift.x, shift.y, shift.z);
            framework->at(placing_vertex_index) = (translate(placing, shift));
            placed->at(placing_vertex_index) = true; //record this new vertex as now being fixed in place
            connected->at(j) = true; //record that this connection was used
            double com_dist = (fixed.com - framework->at(placing_vertex_index).com).magnitude();
if(verbose) printf("DEBUG: made a connection indicating a topological edge length of %.3f\n", com_dist);
            XYZ start_abc = cell->vertices.at(fixed_vertex_index).abc;
            XYZ end_abc = cell->vertices.at(fixed_vertex_index).edges.at(fixed_edge_index);
if(verbose) printf("\tDEBUG: this edge in the underlying net goes from fractional %.3f %.3f %.3f to fractional %.3f %.3f %.3f\n", start_abc.x, start_abc.y, start_abc.z, end_abc.x, end_abc.y, end_abc.z);
            XYZ shift_abc = end_abc-start_abc;
            XYZ shift_xyz = framework->at(placing_vertex_index).com-fixed.com;
if(verbose) printf("\tDEBUG: this edge in the underlying net had a fractional shift %.3f %.3f %.3f; here we observe a cartesian shift %.3f %.3f %.3f\n", shift_abc.x, shift_abc.y, shift_abc.z, shift_xyz.x, shift_xyz.y, shift_xyz.z);
            XYZ unit_cell_parameter_suggestion(shift_xyz.x/shift_abc.x, shift_xyz.y/shift_abc.y, shift_xyz.z/shift_abc.z);
if(verbose) printf("\tDEBUG: suggests unit cell dimensions %.3f %.3f %.3f\n", unit_cell_parameter_suggestion.x, unit_cell_parameter_suggestion.y, unit_cell_parameter_suggestion.z);
            (*sum_edge_lengths)+=com_dist;
            return num_placed+1;
          }
        }
      }
      if(connection_index==-1) {
if(verbose) printf("DEBUG: could not find any connection between vertex %d and any fixed vertex\n", i);
      }
    }
  }
  printf("WARNING: could not find a molecule which has not been placed and which is adjacent to an already placed molecule - this may happen if the net is interpenetrated (not currently handled with the connection-based alignment method)\n");
  return num_placed;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x478, %rsp            # imm = 0x478
movq %r9, 0x28(%rsp)
movq %rcx, 0x18(%rsp)
movq %rsi, %rbp
cmpl $0x0, 0x4b0(%rsp)
je 0x5a122
movq %rdx, 0x1d0(%rsp)
movq 0x8(%rdi), %rcx
movq %rdi, 0x1d8(%rsp)
subq (%rdi), %rcx
sarq $0x3, %rcx
movabsq $-0x30c30c30c30c30c3, %rax # imm = 0xCF3CF3CF3CF3CF3D
imulq %rax, %rcx
movq %rcx, 0x40(%rsp)
testl %ecx, %ecx
jle 0x5a10a
movq %r8, %r14
movq 0x8(%rbp), %r13
subq (%rbp), %r13
sarq $0x2, %r13
movabsq $0x6db6db6db6db6db7, %rax # imm = 0x6DB6DB6DB6DB6DB7
imulq %rax, %r13
movl $0x7fffffff, %eax       # imm = 0x7FFFFFFF
andq %rax, 0x40(%rsp)
movq %r13, 0x1e0(%rsp)
andq %rax, %r13
xorl %esi, %esi
movq %r8, 0x48(%rsp)
movq 0x18(%rsp), %rdi
movq %rsi, 0x20(%rsp)
callq 0xee36
testq %rdx, (%rax)
jne 0x5a0f7
cmpl $0x0, 0x1e0(%rsp)
jle 0x5a0f7
movl $0xc, %ebx
xorl %r15d, %r15d
movq %r14, %rdi
movq %r15, %rsi
callq 0xee36
testq %rdx, (%rax)
jne 0x5a0e7
movq (%rbp), %rax
movq 0x8(%rbp), %rdx
subq %rax, %rdx
sarq $0x2, %rdx
movabsq $0x6db6db6db6db6db7, %rcx # imm = 0x6DB6DB6DB6DB6DB7
imulq %rcx, %rdx
cmpq %r15, %rdx
jbe 0x5aec0
movq %rbp, %r12
movl -0xc(%rax,%rbx), %r14d
movl -0x8(%rax,%rbx), %ebp
movl -0x4(%rax,%rbx), %ecx
movl (%rax,%rbx), %esi
movq 0x20(%rsp), %rax
cmpq %r14, %rax
jne 0x5a06c
movl %esi, 0x30(%rsp)
movl %ecx, 0x38(%rsp)
movslq %ebp, %rsi
movq 0x18(%rsp), %rdi
callq 0xee36
testq %rdx, (%rax)
je 0x5a0b3
movl 0x38(%rsp), %edx
movl 0x30(%rsp), %esi
movl %r14d, %ecx
movl %ebp, %edi
jmp 0x5a0c7
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
cmpq %rbp, %rax
jne 0x5a0b8
movl %esi, 0x30(%rsp)
movl %ecx, 0x38(%rsp)
movslq %r14d, %rsi
movq 0x18(%rsp), %rdi
callq 0xee36
movl $0xffffffff, %esi       # imm = 0xFFFFFFFF
movl $0xffffffff, %ecx       # imm = 0xFFFFFFFF
movl $0xffffffff, %edi       # imm = 0xFFFFFFFF
testq %rdx, (%rax)
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
je 0x5a0c7
movl 0x30(%rsp), %edx
movl 0x38(%rsp), %esi
movl %ebp, %ecx
movl %r14d, %edi
jmp 0x5a0c7
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
movl $0xffffffff, %esi       # imm = 0xFFFFFFFF
movl $0xffffffff, %ecx       # imm = 0xFFFFFFFF
movl $0xffffffff, %edi       # imm = 0xFFFFFFFF
cmpl $-0x1, %esi
movq 0x48(%rsp), %r14
movq %r12, %rbp
je 0x5a0e7
cmpl $-0x1, %edx
je 0x5a0e7
cmpl $-0x1, %edi
je 0x5a0e7
cmpl $-0x1, %ecx
jne 0x5a5eb
incq %r15
addq $0x1c, %rbx
cmpq %r15, %r13
jne 0x59fec
movq 0x20(%rsp), %rsi
incq %rsi
cmpq 0x40(%rsp), %rsi
jne 0x59fbe
leaq 0xf9e46(%rip), %rdi     # 0x153f57
callq 0x4660
movl 0x4b0(%rsp), %ebp
jmp 0x5aeac
movq (%rbp), %rax
cmpq %rax, 0x8(%rbp)
je 0x5aed1
movslq (%rax), %r15
movq (%rdi), %rsi
movq 0x8(%rdi), %rdx
subq %rsi, %rdx
sarq $0x3, %rdx
movabsq $-0x30c30c30c30c30c3, %rbx # imm = 0xCF3CF3CF3CF3CF3D
imulq %rbx, %rdx
cmpq %r15, %rdx
jbe 0x5aec0
movslq 0x8(%rax), %r14
imulq $0xa8, %r15, %r13
addq %r13, %rsi
leaq 0x1e8(%rsp), %r12
movq %r12, %rdi
callq 0x67616
movq 0x78(%r12), %rax
movq 0x80(%r12), %rdx
subq %rax, %rdx
sarq $0x2, %rdx
cmpq %r14, %rdx
jbe 0x5aede
movslq (%rax,%r14,4), %rsi
movq 0x230(%rsp), %rax
movq 0x238(%rsp), %rdx
subq %rax, %rdx
sarq $0x2, %rdx
cmpq %rsi, %rdx
jbe 0x5aeef
movslq (%rax,%rsi,4), %rsi
movq 0x1e8(%rsp), %rax
movq 0x1f0(%rsp), %rcx
subq %rax, %rcx
sarq $0x3, %rcx
movabsq $-0x5555555555555555, %rdx # imm = 0xAAAAAAAAAAAAAAAB
imulq %rcx, %rdx
cmpq %rsi, %rdx
jbe 0x5aefd
leaq (%rsi,%rsi,2), %rcx
movq 0x10(%rax,%rcx,8), %rdx
leaq 0x290(%rsp), %rsi
movq %rdx, 0x10(%rsi)
movups (%rax,%rcx,8), %xmm0
movaps %xmm0, (%rsi)
leaq 0x1b0(%rsp), %rdi
movsd 0xf714b(%rip), %xmm0    # 0x151360
callq 0x84416
leaq 0x398(%rsp), %rdi
leaq 0x1e8(%rsp), %rsi
callq 0x67616
movq 0x1c0(%rsp), %rax
movq %rax, 0x10(%rsp)
movups 0x1b0(%rsp), %xmm0
movups %xmm0, (%rsp)
leaq 0x50(%rsp), %rdi
leaq 0x398(%rsp), %rsi
callq 0x9daf8
movq 0x28(%rsp), %rcx
movq (%rcx), %rax
movq 0x8(%rcx), %rdx
subq %rax, %rdx
sarq $0x3, %rdx
imulq %rbx, %rdx
cmpq %r15, %rdx
jbe 0x5af0b
leaq (%rax,%r13), %rbx
movq (%rax,%r13), %rdi
movq 0x10(%rax,%r13), %rsi
movaps 0x50(%rsp), %xmm0
movups %xmm0, (%rax,%r13)
movq 0x60(%rsp), %rcx
movq %rcx, 0x10(%rax,%r13)
xorps %xmm0, %xmm0
movaps %xmm0, 0x50(%rsp)
movq $0x0, 0x60(%rsp)
testq %rdi, %rdi
je 0x5a2b9
subq %rdi, %rsi
callq 0x4470
movq 0x28(%rbx), %rax
movups 0x68(%rsp), %xmm0
movups 0x18(%rbx), %xmm1
movups %xmm0, 0x18(%rbx)
movq 0x78(%rsp), %rcx
movq %rcx, 0x28(%rbx)
leaq 0x100(%rsp), %r14
movaps %xmm1, (%r14)
movq %rax, 0x10(%r14)
xorps %xmm0, %xmm0
movups %xmm0, 0x68(%rsp)
xorl %r12d, %r12d
movq %r12, 0x78(%rsp)
movq %r14, %rdi
callq 0x2f4c2
movq 0x40(%rbx), %rax
movaps 0x80(%rsp), %xmm0
movups 0x30(%rbx), %xmm1
movups %xmm0, 0x30(%rbx)
movq 0x90(%rsp), %rcx
movq %rcx, 0x40(%rbx)
movaps %xmm1, (%r14)
movq %rax, 0x10(%r14)
xorps %xmm0, %xmm0
movaps %xmm0, 0x80(%rsp)
movq %r12, 0x90(%rsp)
leaq 0x100(%rsp), %rdi
callq 0x2f4c2
movq 0x48(%rbx), %rdi
movq 0x58(%rbx), %rsi
movups 0x98(%rsp), %xmm0
movups %xmm0, 0x48(%rbx)
movq 0xa8(%rsp), %rax
movq %rax, 0x58(%rbx)
movq %r12, 0xa8(%rsp)
xorps %xmm0, %xmm0
movups %xmm0, 0x98(%rsp)
testq %rdi, %rdi
je 0x5a383
subq %rdi, %rsi
callq 0x4470
movq 0x60(%rbx), %rdi
movq 0x70(%rbx), %rsi
movaps 0xb0(%rsp), %xmm0
movups %xmm0, 0x60(%rbx)
movq 0xc0(%rsp), %rax
movq %rax, 0x70(%rbx)
xorps %xmm1, %xmm1
movaps %xmm1, 0xb0(%rsp)
movq $0x0, 0xc0(%rsp)
testq %rdi, %rdi
je 0x5a3ca
subq %rdi, %rsi
callq 0x4470
xorps %xmm1, %xmm1
movq 0x78(%rbx), %rdi
movq 0x88(%rbx), %rsi
movups 0xc8(%rsp), %xmm0
movups %xmm0, 0x78(%rbx)
movq 0xd8(%rsp), %rax
movq %rax, 0x88(%rbx)
movups %xmm1, 0xc8(%rsp)
movq $0x0, 0xd8(%rsp)
testq %rdi, %rdi
je 0x5a411
subq %rdi, %rsi
callq 0x4470
movq 0xf0(%rsp), %rax
movq %rax, 0xa0(%rbx)
movaps 0xe0(%rsp), %xmm0
movups %xmm0, 0x90(%rbx)
movq 0xc8(%rsp), %rdi
testq %rdi, %rdi
je 0x5a44c
movq 0xd8(%rsp), %rsi
subq %rdi, %rsi
callq 0x4470
movq 0xb0(%rsp), %rdi
testq %rdi, %rdi
je 0x5a469
movq 0xc0(%rsp), %rsi
subq %rdi, %rsi
callq 0x4470
leaq 0x68(%rsp), %r14
leaq 0x80(%rsp), %r12
movq 0x18(%r12), %rdi
testq %rdi, %rdi
je 0x5a490
movq 0xa8(%rsp), %rsi
subq %rdi, %rsi
callq 0x4470
movq %r12, %rdi
callq 0x2f4c2
movq %r14, %rdi
callq 0x2f4c2
movq 0x50(%rsp), %rdi
testq %rdi, %rdi
je 0x5a4b7
movq 0x60(%rsp), %rsi
subq %rdi, %rsi
callq 0x4470
movq 0x410(%rsp), %rdi
testq %rdi, %rdi
je 0x5a4d4
movq 0x420(%rsp), %rsi
subq %rdi, %rsi
callq 0x4470
movq 0x3f8(%rsp), %rdi
testq %rdi, %rdi
je 0x5a4f1
movq 0x408(%rsp), %rsi
subq %rdi, %rsi
callq 0x4470
movq 0x3e0(%rsp), %rdi
testq %rdi, %rdi
je 0x5a50e
movq 0x3f0(%rsp), %rsi
subq %rdi, %rsi
callq 0x4470
leaq 0x3c8(%rsp), %rdi
callq 0x2f4c2
leaq 0x3b0(%rsp), %r14
movq %r14, %rdi
callq 0x2f4c2
movq -0x18(%r14), %rdi
testq %rdi, %rdi
je 0x5a544
movq 0x3a8(%rsp), %rsi
subq %rdi, %rsi
callq 0x4470
movq 0x18(%rsp), %rdi
movq %r15, %rsi
callq 0xee36
orq %rdx, (%rax)
movq 0x260(%rsp), %rdi
testq %rdi, %rdi
je 0x5a571
movq 0x270(%rsp), %rsi
subq %rdi, %rsi
callq 0x4470
movq 0x248(%rsp), %rdi
testq %rdi, %rdi
je 0x5a58e
movq 0x258(%rsp), %rsi
subq %rdi, %rsi
callq 0x4470
movq 0x230(%rsp), %rdi
testq %rdi, %rdi
je 0x5a5ab
movq 0x240(%rsp), %rsi
subq %rdi, %rsi
callq 0x4470
leaq 0x218(%rsp), %rdi
callq 0x2f4c2
leaq 0x200(%rsp), %rbx
movq %rbx, %rdi
callq 0x2f4c2
movq -0x18(%rbx), %rdi
testq %rdi, %rdi
je 0x5a5e1
movq 0x1f8(%rsp), %rsi
subq %rdi, %rsi
callq 0x4470
movl $0x1, %ebp
jmp 0x5aeac
movl %edx, %ebp
movl %esi, %r14d
movslq %ecx, %r12
movq 0x1d8(%rsp), %rax
movq (%rax), %rsi
movq 0x8(%rax), %rdx
subq %rsi, %rdx
sarq $0x3, %rdx
movabsq $-0x30c30c30c30c30c3, %rax # imm = 0xCF3CF3CF3CF3CF3D
imulq %rax, %rdx
cmpq %r12, %rdx
jbe 0x5af1c
movl %edi, %r13d
imulq $0xa8, %r12, %rcx
movq %rcx, 0x20(%rsp)
addq %rcx, %rsi
leaq 0x1e8(%rsp), %rbx
movq %rbx, %rdi
callq 0x67616
movslq %ebp, %rsi
movq 0x78(%rbx), %rax
movq 0x80(%rbx), %rdx
subq %rax, %rdx
sarq $0x2, %rdx
cmpq %rsi, %rdx
jbe 0x5af28
movslq (%rax,%rsi,4), %rsi
movq 0x230(%rsp), %rcx
movq 0x238(%rsp), %rdx
subq %rcx, %rdx
sarq $0x2, %rdx
cmpq %rsi, %rdx
jbe 0x5af36
movslq %r13d, %rbx
movq 0x28(%rsp), %rdx
movq (%rdx), %rax
movq 0x8(%rdx), %rdx
subq %rax, %rdx
sarq $0x3, %rdx
movabsq $-0x30c30c30c30c30c3, %rdi # imm = 0xCF3CF3CF3CF3CF3D
imulq %rdi, %rdx
cmpq %rbx, %rdx
jbe 0x5af44
movslq (%rcx,%rsi,4), %rbp
imulq $0xa8, %rbx, %rcx
addq %rcx, %rax
leaq 0x50(%rsp), %rdi
movq %rax, %rsi
callq 0x67616
movslq %r14d, %rsi
movq 0xc8(%rsp), %r13
movq 0xd0(%rsp), %rdx
subq %r13, %rdx
sarq $0x2, %rdx
cmpq %rsi, %rdx
jbe 0x5af55
movslq (%r13,%rsi,4), %r14
movq 0x98(%rsp), %rcx
movq 0xa0(%rsp), %rdx
subq %rcx, %rdx
sarq $0x2, %rdx
cmpq %r14, %rdx
jbe 0x5af66
movq 0x200(%rsp), %rax
movq 0x208(%rsp), %rdx
subq %rax, %rdx
sarq $0x5, %rdx
cmpq %rbp, %rdx
jbe 0x5af63
movq %rsi, 0x38(%rsp)
movslq (%rcx,%r14,4), %r14
movq 0x68(%rsp), %rcx
movq 0x70(%rsp), %rdx
subq %rcx, %rdx
sarq $0x5, %rdx
cmpq %r14, %rdx
jbe 0x5af66
movq %rbp, %rdx
shlq $0x5, %rdx
addq %rdx, %rax
movq %r14, %rsi
shlq $0x5, %rsi
movq 0x8(%rax), %rdx
cmpq 0x8(%rcx,%rsi), %rdx
jne 0x5a78a
testq %rdx, %rdx
je 0x5a796
addq %rsi, %rcx
movq (%rcx), %rsi
movq (%rax), %rdi
callq 0x4480
testl %eax, %eax
je 0x5a796
movl 0x4b0(%rsp), %ebp
jmp 0x5ada4
movq 0x1e8(%rsp), %rax
movq 0x1f0(%rsp), %rdx
subq %rax, %rdx
sarq $0x3, %rdx
movabsq $-0x5555555555555555, %rsi # imm = 0xAAAAAAAAAAAAAAAB
imulq %rsi, %rdx
cmpq %rbp, %rdx
jbe 0x5af77
leaq (,%rbp,2), %rcx
addq %rbp, %rcx
movq 0x10(%rax,%rcx,8), %rdx
movq %rdx, 0x1c0(%rsp)
movupd (%rax,%rcx,8), %xmm0
movapd %xmm0, 0x1b0(%rsp)
movq 0x50(%rsp), %rax
movq 0x58(%rsp), %rdx
subq %rax, %rdx
sarq $0x3, %rdx
imulq %rsi, %rdx
cmpq %r14, %rdx
jbe 0x5af88
leaq (%r14,%r14,2), %rcx
movq 0x10(%rax,%rcx,8), %rdx
leaq 0x440(%rsp), %rsi
movq %rdx, 0x10(%rsi)
movupd (%rax,%rcx,8), %xmm0
movapd %xmm0, (%rsi)
leaq 0x2d8(%rsp), %rdi
leaq 0x1b0(%rsp), %rdx
callq 0x8461e
leaq 0x2f0(%rsp), %rdi
leaq 0x1e8(%rsp), %rsi
callq 0x67616
movq 0x2e8(%rsp), %rax
movq %rax, 0x10(%rsp)
movupd 0x2d8(%rsp), %xmm0
movupd %xmm0, (%rsp)
leaq 0x100(%rsp), %rdi
leaq 0x2f0(%rsp), %rsi
callq 0x9daf8
movq %rbx, 0x30(%rsp)
movq 0x28(%rsp), %rcx
movq (%rcx), %rax
movq 0x8(%rcx), %rdx
subq %rax, %rdx
sarq $0x3, %rdx
movabsq $-0x30c30c30c30c30c3, %rcx # imm = 0xCF3CF3CF3CF3CF3D
imulq %rcx, %rdx
cmpq %r12, %rdx
jbe 0x5af99
movq %r12, %rbp
movq 0x20(%rsp), %rdx
leaq (%rax,%rdx), %rbx
movq (%rax,%rdx), %rdi
movq 0x10(%rax,%rdx), %rsi
movaps 0x100(%rsp), %xmm0
movups %xmm0, (%rax,%rdx)
movq 0x110(%rsp), %rcx
movq %rcx, 0x10(%rax,%rdx)
xorps %xmm0, %xmm0
movaps %xmm0, 0x100(%rsp)
movq $0x0, 0x110(%rsp)
testq %rdi, %rdi
je 0x5a901
subq %rdi, %rsi
callq 0x4470
movq 0x28(%rbx), %rax
movups 0x118(%rsp), %xmm0
movups 0x18(%rbx), %xmm1
movups %xmm0, 0x18(%rbx)
movq 0x128(%rsp), %rcx
movq %rcx, 0x28(%rbx)
leaq 0x290(%rsp), %r14
movaps %xmm1, (%r14)
movq %rax, 0x10(%r14)
xorps %xmm0, %xmm0
movups %xmm0, 0x118(%rsp)
xorl %r12d, %r12d
movq %r12, 0x128(%rsp)
movq %r14, %rdi
callq 0x2f4c2
movq 0x40(%rbx), %rax
movaps 0x130(%rsp), %xmm0
movupd 0x30(%rbx), %xmm1
movups %xmm0, 0x30(%rbx)
movq 0x140(%rsp), %rcx
movq %rcx, 0x40(%rbx)
movapd %xmm1, (%r14)
movq %rax, 0x10(%r14)
xorps %xmm0, %xmm0
movaps %xmm0, 0x130(%rsp)
movq %r12, 0x140(%rsp)
leaq 0x290(%rsp), %rdi
callq 0x2f4c2
movq 0x48(%rbx), %rdi
movq 0x58(%rbx), %rsi
movups 0x148(%rsp), %xmm0
movups %xmm0, 0x48(%rbx)
movq 0x158(%rsp), %rax
movq %rax, 0x58(%rbx)
movq %r12, 0x158(%rsp)
xorps %xmm0, %xmm0
movups %xmm0, 0x148(%rsp)
testq %rdi, %rdi
je 0x5a9d9
subq %rdi, %rsi
callq 0x4470
movq 0x60(%rbx), %rdi
movq 0x70(%rbx), %rsi
movaps 0x160(%rsp), %xmm0
movups %xmm0, 0x60(%rbx)
movq 0x170(%rsp), %rax
movq %rax, 0x70(%rbx)
xorpd %xmm1, %xmm1
movapd %xmm1, 0x160(%rsp)
movq $0x0, 0x170(%rsp)
testq %rdi, %rdi
movq 0x48(%rsp), %r12
je 0x5aa28
subq %rdi, %rsi
callq 0x4470
xorpd %xmm1, %xmm1
movq 0x78(%rbx), %rdi
movq 0x88(%rbx), %rsi
movups 0x178(%rsp), %xmm0
movups %xmm0, 0x78(%rbx)
movq 0x188(%rsp), %rax
movq %rax, 0x88(%rbx)
movupd %xmm1, 0x178(%rsp)
movq $0x0, 0x188(%rsp)
testq %rdi, %rdi
je 0x5aa70
subq %rdi, %rsi
callq 0x4470
movq 0x1a0(%rsp), %rax
movq %rax, 0xa0(%rbx)
movapd 0x190(%rsp), %xmm0
movupd %xmm0, 0x90(%rbx)
movq 0x178(%rsp), %rdi
testq %rdi, %rdi
je 0x5aaad
movq 0x188(%rsp), %rsi
subq %rdi, %rsi
callq 0x4470
movq 0x160(%rsp), %rdi
testq %rdi, %rdi
je 0x5aaca
movq 0x170(%rsp), %rsi
subq %rdi, %rsi
callq 0x4470
leaq 0x118(%rsp), %r14
leaq 0x130(%rsp), %r13
movq 0x18(%r13), %rdi
testq %rdi, %rdi
je 0x5aaf3
movq 0x158(%rsp), %rsi
subq %rdi, %rsi
callq 0x4470
movq %r13, %rdi
callq 0x2f4c2
movq %r14, %rdi
callq 0x2f4c2
movq 0x100(%rsp), %rdi
testq %rdi, %rdi
je 0x5ab20
movq 0x110(%rsp), %rsi
subq %rdi, %rsi
callq 0x4470
movq 0x368(%rsp), %rdi
testq %rdi, %rdi
je 0x5ab3d
movq 0x378(%rsp), %rsi
subq %rdi, %rsi
callq 0x4470
movq 0x350(%rsp), %rdi
testq %rdi, %rdi
je 0x5ab5a
movq 0x360(%rsp), %rsi
subq %rdi, %rsi
callq 0x4470
movq 0x338(%rsp), %rdi
testq %rdi, %rdi
je 0x5ab77
movq 0x348(%rsp), %rsi
subq %rdi, %rsi
callq 0x4470
leaq 0x320(%rsp), %rdi
callq 0x2f4c2
leaq 0x308(%rsp), %r14
movq %r14, %rdi
callq 0x2f4c2
movq -0x18(%r14), %rdi
testq %rdi, %rdi
je 0x5abad
movq 0x300(%rsp), %rsi
subq %rdi, %rsi
callq 0x4470
movq 0x18(%rsp), %rdi
movq %rbp, %rsi
callq 0xee36
orq %rdx, (%rax)
movq %r12, %rdi
movq %r15, %rsi
callq 0xee36
orq %rdx, (%rax)
movq 0x28(%rsp), %rcx
movq (%rcx), %rax
movq 0x8(%rcx), %rdx
subq %rax, %rdx
sarq $0x3, %rdx
movabsq $-0x30c30c30c30c30c3, %rcx # imm = 0xCF3CF3CF3CF3CF3D
imulq %rcx, %rdx
movq %rbp, %r14
cmpq %rbp, %rdx
movl 0x4b0(%rsp), %ebp
jbe 0x5afaa
leaq 0xe0(%rsp), %rbx
movq 0x20(%rsp), %rcx
leaq (%rax,%rcx), %rdx
addq $0x90, %rdx
leaq 0x100(%rsp), %rdi
movq %rbx, %rsi
callq 0x8461e
leaq 0x100(%rsp), %rdi
callq 0x8398c
movq 0x1d0(%rsp), %rcx
movq 0x3c0(%rcx), %rax
movq 0x3c8(%rcx), %rdx
subq %rax, %rdx
sarq $0x4, %rdx
movabsq $0x6db6db6db6db6db7, %rcx # imm = 0x6DB6DB6DB6DB6DB7
imulq %rcx, %rdx
movq 0x30(%rsp), %rsi
cmpq %rsi, %rdx
jbe 0x5afbb
movsd %xmm0, 0x18(%rsp)
imulq $0x70, %rsi, %rdx
movq 0x10(%rax,%rdx), %rcx
movq %rcx, 0x110(%rsp)
movupd (%rax,%rdx), %xmm0
movapd %xmm0, 0x100(%rsp)
movq 0x20(%rax,%rdx), %rcx
movq 0x28(%rax,%rdx), %rdx
subq %rcx, %rdx
sarq $0x3, %rdx
movabsq $-0x5555555555555555, %rax # imm = 0xAAAAAAAAAAAAAAAB
imulq %rax, %rdx
movq 0x38(%rsp), %rsi
cmpq %rsi, %rdx
jbe 0x5afc9
leaq (%rsi,%rsi,2), %rax
movq 0x10(%rcx,%rax,8), %rdx
leaq 0x290(%rsp), %rsi
movq %rdx, 0x10(%rsi)
movupd (%rcx,%rax,8), %xmm0
movapd %xmm0, (%rsi)
leaq 0x2c0(%rsp), %rdi
leaq 0x100(%rsp), %rdx
callq 0x8461e
movq 0x28(%rsp), %rcx
movq (%rcx), %rax
movq 0x8(%rcx), %rdx
subq %rax, %rdx
sarq $0x3, %rdx
movabsq $-0x30c30c30c30c30c3, %rcx # imm = 0xCF3CF3CF3CF3CF3D
imulq %rcx, %rdx
cmpq %r14, %rdx
jbe 0x5afd7
movq 0x20(%rsp), %rcx
leaq (%rax,%rcx), %rsi
addq $0x90, %rsi
leaq 0x2a8(%rsp), %rdi
movq %rbx, %rdx
callq 0x8461e
movsd 0x2a8(%rsp), %xmm0
movsd 0x2b0(%rsp), %xmm1
divsd 0x2c0(%rsp), %xmm0
divsd 0x2c8(%rsp), %xmm1
movsd 0x2b8(%rsp), %xmm2
divsd 0x2d0(%rsp), %xmm2
leaq 0x460(%rsp), %rdi
callq 0x84364
movq 0x4b8(%rsp), %rax
movsd 0x18(%rsp), %xmm0
addsd (%rax), %xmm0
movsd %xmm0, (%rax)
incl %ebp
movq 0xc8(%rsp), %r13
testq %r13, %r13
je 0x5adb7
movq 0xd8(%rsp), %rsi
subq %r13, %rsi
movq %r13, %rdi
callq 0x4470
movq 0xb0(%rsp), %rdi
testq %rdi, %rdi
je 0x5add4
movq 0xc0(%rsp), %rsi
subq %rdi, %rsi
callq 0x4470
leaq 0x68(%rsp), %rbx
movq 0x30(%rbx), %rdi
testq %rdi, %rdi
je 0x5adf2
movq 0xa8(%rsp), %rsi
subq %rdi, %rsi
callq 0x4470
leaq 0x80(%rsp), %r14
movq %r14, %rdi
callq 0x2f4c2
movq %rbx, %rdi
callq 0x2f4c2
movq -0x30(%r14), %rdi
testq %rdi, %rdi
je 0x5ae20
movq 0x60(%rsp), %rsi
subq %rdi, %rsi
callq 0x4470
movq 0x260(%rsp), %rdi
testq %rdi, %rdi
je 0x5ae3d
movq 0x270(%rsp), %rsi
subq %rdi, %rsi
callq 0x4470
movq 0x248(%rsp), %rdi
testq %rdi, %rdi
je 0x5ae5a
movq 0x258(%rsp), %rsi
subq %rdi, %rsi
callq 0x4470
leaq 0x200(%rsp), %rbx
movq 0x30(%rbx), %rdi
testq %rdi, %rdi
je 0x5ae7b
movq 0x240(%rsp), %rsi
subq %rdi, %rsi
callq 0x4470
leaq 0x218(%rsp), %r14
movq %r14, %rdi
callq 0x2f4c2
movq %rbx, %rdi
callq 0x2f4c2
movq -0x30(%r14), %rdi
testq %rdi, %rdi
je 0x5aeac
movq 0x1f8(%rsp), %rsi
subq %rdi, %rsi
callq 0x4470
movl %ebp, %eax
addq $0x478, %rsp            # imm = 0x478
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0xf282e(%rip), %rdi     # 0x14d6f5
movq %r15, %rsi
xorl %eax, %eax
callq 0x4630
leaq 0xf281d(%rip), %rdi     # 0x14d6f5
xorl %esi, %esi
xorl %edx, %edx
jmp 0x5aeca
leaq 0xf2810(%rip), %rdi     # 0x14d6f5
movq %r14, %rsi
xorl %eax, %eax
callq 0x4630
leaq 0xf27ff(%rip), %rdi     # 0x14d6f5
xorl %eax, %eax
callq 0x4630
leaq 0xf27f1(%rip), %rdi     # 0x14d6f5
xorl %eax, %eax
callq 0x4630
leaq 0xf27e3(%rip), %rdi     # 0x14d6f5
movq %r15, %rsi
xorl %eax, %eax
callq 0x4630
leaq 0xf27d2(%rip), %rdi     # 0x14d6f5
movq %r12, %rsi
jmp 0x5aeca
leaq 0xf27c6(%rip), %rdi     # 0x14d6f5
xorl %eax, %eax
callq 0x4630
leaq 0xf27b8(%rip), %rdi     # 0x14d6f5
xorl %eax, %eax
callq 0x4630
leaq 0xf27aa(%rip), %rdi     # 0x14d6f5
movq %rbx, %rsi
xorl %eax, %eax
callq 0x4630
leaq 0xf2799(%rip), %rdi     # 0x14d6f5
xorl %eax, %eax
callq 0x4630
movq %rbp, %r14
leaq 0xf2788(%rip), %rdi     # 0x14d6f5
movq %r14, %rsi
xorl %eax, %eax
callq 0x4630
leaq 0xf2777(%rip), %rdi     # 0x14d6f5
movq %rbp, %rsi
xorl %eax, %eax
callq 0x4630
leaq 0xf2766(%rip), %rdi     # 0x14d6f5
movq %r14, %rsi
xorl %eax, %eax
callq 0x4630
leaq 0xf2755(%rip), %rdi     # 0x14d6f5
movq %r12, %rsi
xorl %eax, %eax
callq 0x4630
leaq 0xf2744(%rip), %rdi     # 0x14d6f5
movq %r14, %rsi
xorl %eax, %eax
callq 0x4630
leaq 0xf2733(%rip), %rdi     # 0x14d6f5
xorl %eax, %eax
callq 0x4630
leaq 0xf2725(%rip), %rdi     # 0x14d6f5
xorl %eax, %eax
callq 0x4630
leaq 0xf2717(%rip), %rdi     # 0x14d6f5
movq %r14, %rsi
xorl %eax, %eax
callq 0x4630
jmp 0x5b057
jmp 0x5b057
jmp 0x5b057
jmp 0x5b057
jmp 0x5b057
jmp 0x5b057
movq %rax, %rbx
leaq 0x100(%rsp), %rdi
callq 0x6771a
jmp 0x5b009
movq %rax, %rbx
leaq 0x2f0(%rsp), %rdi
callq 0x6771a
jmp 0x5b05a
jmp 0x5b057
jmp 0x5b057
jmp 0x5b057
jmp 0x5b057
jmp 0x5b057
jmp 0x5b057
jmp 0x5b057
jmp 0x5b052
jmp 0x5b052
jmp 0x5b052
movq %rax, %rbx
leaq 0x50(%rsp), %rdi
callq 0x6771a
jmp 0x5b03e
movq %rax, %rbx
leaq 0x398(%rsp), %rdi
jmp 0x5b05f
jmp 0x5b052
jmp 0x5b052
jmp 0x5b052
jmp 0x5b052
jmp 0x5b052
movq %rax, %rbx
jmp 0x5b064
movq %rax, %rbx
leaq 0x50(%rsp), %rdi
callq 0x6771a
leaq 0x1e8(%rsp), %rdi
callq 0x6771a
movq %rbx, %rdi
callq 0x4780