// File: /workspace/github_cpp_makefile_star2_O2/Luthaf[P]zeopp/networkstorage.cc
// Function: check_for_collision(ATOM_NETWORK*, std::vector<MOLECULE, std::allocator<MOLECULE>>*, std::vector<CONNECTION, std::allocator<CONNECTION>>*)
bool check_for_collision(ATOM_NETWORK *framework, vector<MOLECULE> *assembled_molecules, vector<CONNECTION> *two_way_connections) {
  bool verbose = false;
if(verbose) printf("DEBUG: checking for collisions...\n");
  XYZ centre_abc(0.5,0.5,0.5);
  XYZ centre_xyz = framework->abc_to_xyz_returning_XYZ(centre_abc);
  bool collision = false;
  int num_assembled_molecules = assembled_molecules->size();
  int num_c = two_way_connections->size();
  //is it possible to have more than one periodic bond between atoms? depends on unit cell - we need to check all x,y,z in the range -1 to 1, except for redundant combinations, handled below
  bool multiple_periodic_connections_possible = false;
  for(int z=-1; z<2 && !multiple_periodic_connections_possible; z++) {
    for(int y=-1; y<2 && !multiple_periodic_connections_possible; y++) {
      for(int x=0; x<2 && !multiple_periodic_connections_possible; x++) { //x cannot be -1
        if((x==0 && y==0 && z==1) || (x==0 && y==1) || (x==1)) {
          XYZ image_abc(x,y,z);
          double self_distance = framework->abc_to_xyz_returning_XYZ(image_abc).magnitude();
          if(self_distance<=GENERAL_BOND_DISTANCE*2.0) multiple_periodic_connections_possible = true;
        }
      }
    }
  }

  //new and much faster system - build a set of vectors storing the info we need and just query it according to the basic collision rules - and don't include sites or H atoms
  vector <int> atom_molecule_id_vector;
  vector <int> atom_position_id_vector;
  vector <XYZ> atom_abc_vector;
  vector <bool> atom_is_close_to_site_vector;
/*
int debug1=198, debug2=730;
*/
  for(int i=0; i<num_assembled_molecules; i++) { //for each molecule
    int num_at_i = assembled_molecules->at(i).atoms_xyz.size();
    int num_sites_i = assembled_molecules->at(i).sites.size();
    int num_dummy_sites_i = assembled_molecules->at(i).dummy_sites.size();
    vector <XYZ> local_atom_abc_vector;
    vector <XYZ> local_site_abc_vector;
    for(int j=0; j<num_at_i; j++) { //for each atom
      if(assembled_molecules->at(i).atoms_type.at(j)!="H") { //if not H
        XYZ xyz_j = assembled_molecules->at(i).atoms_xyz.at(j);
        XYZ abc_j = framework->xyz_to_abc_returning_XYZ(xyz_j);
        bool is_site_j = false;
        bool is_dummy_site_j = false;
        for(int s=0; s<num_sites_i && !is_site_j; s++) { //find if site
          is_site_j = (j == assembled_molecules->at(i).sites.at(s));
        }
        for(int s=0; s<num_dummy_sites_i && !is_dummy_site_j && !is_site_j; s++) { //find if dummy site
          is_dummy_site_j = (j == assembled_molecules->at(i).dummy_sites.at(s));
        }
        if(is_site_j) {
          local_site_abc_vector.push_back(abc_j);
        } else if(is_dummy_site_j) { //do nothing - don't want to write this one out, and don't want to bypass collision detection near to dummy sites
        } else {
          local_atom_abc_vector.push_back(abc_j);
          atom_abc_vector.push_back(abc_j);
          atom_molecule_id_vector.push_back(i);
          atom_position_id_vector.push_back(j);
        }
      }
    }
    int num_actual_at_i = local_atom_abc_vector.size();
    for(int j=0; j<num_actual_at_i; j++) {
      bool is_close_to_site = false;
      for(int k=0; k<num_sites_i && !is_close_to_site; k++) {
        is_close_to_site = is_part_of_site_abc(local_atom_abc_vector.at(j), local_site_abc_vector.at(k), framework);
/*
if(atom_is_close_to_site_vector.size()==debug1 || atom_is_close_to_site_vector.size()==debug2) {
  if(is_close_to_site) printf("DEBYG: overall atom index %d (fractional %.3f/%.3f/%.3f) is close to site index %d (fractional %.3f/%.3f/%.3f) in molecule index %d\n", (int)(atom_is_close_to_site_vector.size()), local_atom_abc_vector.at(j).x, local_atom_abc_vector.at(j).y, local_atom_abc_vector.at(j).z, k, local_site_abc_vector.at(k).x, local_site_abc_vector.at(k).y, local_site_abc_vector.at(k).z, i);
  else printf("DEBYG: overall atom index %d (fractional %.3f/%.3f/%.3f) is NOT close to site index %d (fractional %.3f/%.3f/%.3f) in molecule index %d (distance = %.3f)\n", (int)(atom_is_close_to_site_vector.size()), local_atom_abc_vector.at(j).x, local_atom_abc_vector.at(j).y, local_atom_abc_vector.at(j).z, k, local_site_abc_vector.at(k).x, local_site_abc_vector.at(k).y, local_site_abc_vector.at(k).z, i, framework->getDistCalc().minimum_periodic_distance(local_atom_abc_vector.at(j).x, local_atom_abc_vector.at(j).y, local_atom_abc_vector.at(j).z, local_site_abc_vector.at(k).x, local_site_abc_vector.at(k).y, local_site_abc_vector.at(k).z));
}
*/
      }
      atom_is_close_to_site_vector.push_back(is_close_to_site);
    }
  }
  int num_total_atoms = atom_abc_vector.size();
  for(int i=0; i<num_total_atoms && !collision; i++) {
    for(int j=i+1; j<num_total_atoms && !collision; j++) {
      if(atom_molecule_id_vector.at(i)==atom_molecule_id_vector.at(j)) { //atoms are in the same molecule
        if(!bonded_xyz(assembled_molecules->at(atom_molecule_id_vector.at(i)).atoms_xyz.at(atom_position_id_vector.at(i)), assembled_molecules->at(atom_molecule_id_vector.at(j)).atoms_xyz.at(atom_position_id_vector.at(j)))) { //if they are not supposed to be bonded
          if(bonded_abc(atom_abc_vector.at(i), atom_abc_vector.at(j), framework)) {
            if(verbose) printf("NOTICE: non-bonded atoms in building block %d are bonded periodically, constituting a collision\n", atom_molecule_id_vector.at(i));
            collision = true; //collision if they are bonded
          }
        } else if(multiple_periodic_connections_possible) { //else they are supposed to be bonded - so we need to make sure that they are not bonded more than once periodically, if that is a possibility given the unit cell parameters
          XYZ shift_i_to_centre = centre_abc - trans_to_origuc(atom_abc_vector.at(i));
          XYZ uc_j = trans_to_origuc(atom_abc_vector.at(j)+shift_i_to_centre);
          int num_periodic_bonds = 0;
          for(int da=-1; da<2 && num_periodic_bonds<2; da++) {
            for(int db=-1; db<2 && num_periodic_bonds<2; db++) {
              for(int dc=-1; dc<2 && num_periodic_bonds<2; dc++) {
                XYZ image(da,db,dc);
                XYZ image_j_xyz = framework->abc_to_xyz_returning_XYZ(uc_j+image);
                if(bonded_xyz(image_j_xyz, centre_xyz)) num_periodic_bonds++;
              }
            }
          }
          if(num_periodic_bonds>1) {
            if(verbose) printf("NOTICE: more than one (%d) bonds were detected between atoms in building block %d, constituting a collision\n", num_periodic_bonds, atom_molecule_id_vector.at(i));
            collision = true;
          }
        }
      } else if(bonded_abc(atom_abc_vector.at(i), atom_abc_vector.at(j), framework)) { //atoms are in different molecules, and they are bonded
        if(!atom_is_close_to_site_vector.at(i) || !atom_is_close_to_site_vector.at(j)) {
          if(verbose) printf("NOTICE: a bond was detected between atoms that are not both part of a site: %s (fractional %.3f/%.3f/%.3f) and %s (fractional %.3f/%.3f/%.3f) in building blocks %d and %d respectively (overall indices %d and %d), constituting a collision (distance = %.3f)\n", assembled_molecules->at(atom_molecule_id_vector.at(i)).atoms_type.at(atom_position_id_vector.at(i)).c_str(), atom_abc_vector.at(i).x, atom_abc_vector.at(i).y, atom_abc_vector.at(i).z, assembled_molecules->at(atom_molecule_id_vector.at(j)).atoms_type.at(atom_position_id_vector.at(j)).c_str(), atom_abc_vector.at(j).x, atom_abc_vector.at(j).y, atom_abc_vector.at(j).z, atom_molecule_id_vector.at(i), atom_molecule_id_vector.at(j), i, j, framework->getDistCalc().minimum_periodic_distance(atom_abc_vector.at(i).x, atom_abc_vector.at(i).y, atom_abc_vector.at(i).z, atom_abc_vector.at(j).x, atom_abc_vector.at(j).y, atom_abc_vector.at(j).z));

          collision = true; //if either atom is not part of a site, this is a collision
        } else { //else they are both part of sites - so we need to check whether these molecules are supposed to be connected
          bool mols_connected = false;
          for(int k=0; k<num_c && !mols_connected; k++) {
            CONNECTION c = two_way_connections->at(k);
            int v1 = c.v1;
            int v2 = c.v2;
            if((v1==atom_molecule_id_vector.at(i) && v2==atom_molecule_id_vector.at(j)) || (v2==atom_molecule_id_vector.at(i) && v1==atom_molecule_id_vector.at(j))) {
              mols_connected = true;
            }
          }
          if(!mols_connected) {
            if(verbose) printf("NOTICE: a bond was detected between disconnected building blocks %d and %d, constituting a collision\n", atom_molecule_id_vector.at(i), atom_molecule_id_vector.at(j));
            collision = true;
          }
        }
      }
    }
  }
  return collision;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x278, %rsp            # imm = 0x278
movq %rdx, %r14
movq %rsi, %r12
movq %rdi, %r15
leaq 0x260(%rsp), %rbx
movsd 0xb5a21(%rip), %xmm0    # 0xfc038
movq %rbx, %rdi
movapd %xmm0, %xmm1
movapd %xmm0, %xmm2
callq 0x6402e
leaq 0x248(%rsp), %rdi
movq %r15, %rsi
movq %rbx, %rdx
movq %r12, %rbx
callq 0x3f1b2
movq 0x8(%r12), %rax
subq (%r12), %rax
movl $0xa8, %ecx
cqto
idivq %rcx
movq %rax, 0x90(%rsp)
movq 0x8(%r14), %rax
movq %r14, 0x160(%rsp)
subq (%r14), %rax
pushq $0x1c
popq %rcx
cqto
idivq %rcx
movq %rax, 0x88(%rsp)
pushq $-0x1
popq %r14
movl $0x0, 0x3c(%rsp)
movq %r12, 0x60(%rsp)
cmpl $0x1, %r14d
jg 0x46794
testb $0x1, 0x3c(%rsp)
jne 0x46794
cvtsi2sd %r14d, %xmm0
movsd %xmm0, 0x98(%rsp)
movl %r14d, 0x40(%rsp)
xorl $0x1, %r14d
pushq $-0x1
popq %rbp
cmpl $0x1, %ebp
jg 0x46782
testb $0x1, 0x3c(%rsp)
jne 0x46782
cvtsi2sd %ebp, %xmm0
movsd %xmm0, 0x50(%rsp)
xorl %r13d, %r13d
movl %ebp, %eax
xorl $0x1, %eax
movl %eax, 0x68(%rsp)
cmpl $0x1, %r13d
ja 0x4677b
testb $0x1, 0x3c(%rsp)
jne 0x4677b
movl %r13d, %eax
orl %ebp, %eax
orl %r14d, %eax
jne 0x46752
cvtsi2sd %r13d, %xmm0
leaq 0x168(%rsp), %r12
movq %r12, %rdi
movsd 0x50(%rsp), %xmm1
movsd 0x98(%rsp), %xmm2
callq 0x6402e
leaq 0x70(%rsp), %rbx
movq %rbx, %rdi
movq %r15, %rsi
movq %r12, %rdx
callq 0x3f1b2
movq %rbx, %rdi
callq 0x63758
movsd 0xbafb9(%rip), %xmm1    # 0x101700
ucomisd %xmm0, %xmm1
jb 0x46768
pushq $0x1
popq %rax
jmp 0x4676f
movl 0x68(%rsp), %eax
orl %r13d, %eax
sete %al
cmpl $0x1, %r13d
je 0x46700
testb %al, %al
je 0x46773
jmp 0x46700
movl 0x3c(%rsp), %eax
movzbl %al, %eax
movl %eax, 0x3c(%rsp)
incl %r13d
jmp 0x466e1
incl %ebp
jmp 0x466b7
movl 0x40(%rsp), %r14d
incl %r14d
movq 0x60(%rsp), %rbx
jmp 0x46688
leaq 0x70(%rsp), %rax
andq $0x0, 0x10(%rax)
leaq 0x130(%rsp), %rcx
andq $0x0, 0x10(%rcx)
leaq 0xa0(%rsp), %rdx
andq $0x0, 0x10(%rdx)
leaq 0x168(%rsp), %rsi
andq $0x0, (%rsi)
andl $0x0, 0x8(%rsi)
andq $0x0, 0x10(%rsi)
xorpd %xmm0, %xmm0
andl $0x0, 0x18(%rsi)
movapd %xmm0, (%rax)
andq $0x0, 0x20(%rsi)
movapd %xmm0, (%rcx)
movapd %xmm0, (%rdx)
xorl %eax, %eax
movl %eax, 0xf8(%rsp)
cmpl 0x90(%rsp), %eax
jge 0x46b32
movslq %eax, %rsi
movq %rbx, %rdi
callq 0x4b9e8
movq 0x8(%rax), %rcx
subq (%rax), %rcx
movq %rcx, %rax
cqto
pushq $0x18
popq %rcx
idivq %rcx
movq %rax, %rbp
movslq 0xf8(%rsp), %rsi
movq %rbx, %rdi
callq 0x4b9e8
movq %rbx, %rdi
movq 0x48(%rax), %rbx
movq 0x50(%rax), %r14
movslq 0xf8(%rsp), %rsi
callq 0x4b9e8
subq %rbx, %r14
movq 0x68(%rax), %rcx
subq 0x60(%rax), %rcx
xorpd %xmm0, %xmm0
movapd %xmm0, 0xe0(%rsp)
andq $0x0, 0xf0(%rsp)
movapd %xmm0, 0xc0(%rsp)
andq $0x0, 0xd0(%rsp)
shrq $0x2, %r14
movslq %r14d, %r12
shrq $0x2, %rcx
movslq %ecx, %r13
xorl %eax, %eax
movq 0x60(%rsp), %rbx
leaq 0xc0(%rsp), %r14
movq %rbp, 0x50(%rsp)
movl %eax, 0x4c(%rsp)
cmpl %ebp, %eax
jge 0x46a42
movslq 0xf8(%rsp), %rsi
movq %rbx, %rdi
callq 0x4b9e8
addq $0x18, %rax
movslq 0x4c(%rsp), %rsi
movq %rax, %rdi
callq 0x4bb9a
movq %rax, %rdi
leaq 0xbf854(%rip), %rsi     # 0x106124
callq 0x38683
testb %al, %al
je 0x46a37
movslq 0xf8(%rsp), %rsi
movq %rbx, %rdi
callq 0x4b9e8
movslq 0x4c(%rsp), %rsi
movq %rax, %rdi
callq 0x4b6d6
movq 0x10(%rax), %rcx
movq %rcx, 0x220(%rsp)
movupd (%rax), %xmm0
movapd %xmm0, 0x210(%rsp)
leaq 0x118(%rsp), %rdi
movq %r15, %rsi
leaq 0x210(%rsp), %rdx
callq 0x3e082
xorl %ebp, %ebp
xorl %r14d, %r14d
cmpq %r12, %rbp
jge 0x4696b
testb $0x1, %r14b
jne 0x4696b
movl 0x4c(%rsp), %r14d
movslq 0xf8(%rsp), %rsi
movq %rbx, %rdi
callq 0x4b9e8
addq $0x48, %rax
movq %rax, %rdi
movq %rbp, %rsi
callq 0xac00
cmpl (%rax), %r14d
sete %r14b
incq %rbp
jmp 0x46930
xorl %ebp, %ebp
xorl %eax, %eax
cmpq %r13, %rbp
setge %cl
movl %eax, %edx
orb %r14b, %dl
orb %cl, %dl
testb $0x1, %dl
jne 0x469b3
movq %rbx, %rdi
movl 0x4c(%rsp), %ebx
movslq 0xf8(%rsp), %rsi
callq 0x4b9e8
addq $0x60, %rax
movq %rax, %rdi
movq %rbp, %rsi
callq 0xac00
cmpl (%rax), %ebx
sete %al
incq %rbp
movq 0x60(%rsp), %rbx
jmp 0x4696f
testb $0x1, %r14b
je 0x469d8
leaq 0xc0(%rsp), %r14
movq %r14, %rdi
leaq 0x118(%rsp), %rsi
callq 0x4beaa
movq 0x50(%rsp), %rbp
jmp 0x46a37
testb $0x1, %al
leaq 0xc0(%rsp), %r14
movq 0x50(%rsp), %rbp
jne 0x46a37
leaq 0xe0(%rsp), %rdi
leaq 0x118(%rsp), %rsi
callq 0x4beaa
leaq 0xa0(%rsp), %rdi
leaq 0x118(%rsp), %rsi
callq 0x4beaa
leaq 0x70(%rsp), %rdi
leaq 0xf8(%rsp), %rsi
callq 0x9434
leaq 0x130(%rsp), %rdi
leaq 0x4c(%rsp), %rsi
callq 0x9434
movl 0x4c(%rsp), %eax
incl %eax
jmp 0x46899
movq 0xe8(%rsp), %rax
subq 0xe0(%rsp), %rax
cqto
pushq $0x18
popq %rcx
idivq %rcx
movq %rax, %rcx
testl %ecx, %ecx
movl $0x0, %eax
cmovlel %eax, %ecx
movq %rcx, 0x50(%rsp)
xorl %ebp, %ebp
cmpq 0x50(%rsp), %rbp
je 0x46b0f
xorl %r13d, %r13d
xorl %eax, %eax
testb $0x1, %al
jne 0x46af4
cmpq %r12, %r13
jge 0x46af4
leaq 0xe0(%rsp), %rdi
movq %rbp, %rsi
callq 0x4b6d6
movq 0x10(%rax), %rcx
movq %rcx, 0x200(%rsp)
movupd (%rax), %xmm0
movapd %xmm0, 0x1f0(%rsp)
movq %r14, %rdi
movq %r13, %rsi
callq 0x4b6d6
movq 0x10(%rax), %rcx
movq %rcx, 0x28(%rsp)
movups (%rax), %xmm0
movups %xmm0, 0x18(%rsp)
movq 0x200(%rsp), %rax
movq %rax, 0x10(%rsp)
movapd 0x1f0(%rsp), %xmm0
movupd %xmm0, (%rsp)
movq %r15, %rdi
callq 0x43776
incq %r13
jmp 0x46a7e
movzbl %al, %esi
andl $0x1, %esi
leaq 0x168(%rsp), %rdi
callq 0xa8f6
incq %rbp
jmp 0x46a6e
movq %r14, %rdi
callq 0xb132
leaq 0xe0(%rsp), %rdi
callq 0xb132
movl 0xf8(%rsp), %eax
incl %eax
jmp 0x467e8
leaq 0xa0(%rsp), %rcx
movq 0x8(%rcx), %rax
subq (%rcx), %rax
cqto
pushq $0x18
popq %rcx
idivq %rcx
movq %rax, %rcx
movslq 0x88(%rsp), %rax
movq %rax, 0x88(%rsp)
movq %rcx, 0x158(%rsp)
movslq %ecx, %rax
movq %rax, 0x148(%rsp)
pushq $0x1
popq %rax
movq %rax, 0x110(%rsp)
xorl %r12d, %r12d
leaq 0x210(%rsp), %rbx
leaq 0xf8(%rsp), %rbp
xorl %r13d, %r13d
cmpq 0x148(%rsp), %r12
jge 0x47098
testb $0x1, %r13b
jne 0x47098
leaq 0x1(%r12), %rax
movq %rax, 0x150(%rsp)
movq 0x110(%rsp), %r14
movq %r12, 0x68(%rsp)
cmpl 0x158(%rsp), %r14d
jge 0x47083
testb $0x1, %r13b
jne 0x47083
movq %r14, 0x40(%rsp)
leaq 0x70(%rsp), %rdi
movq %r12, %rsi
callq 0xac00
movl (%rax), %r14d
leaq 0x70(%rsp), %rdi
movq 0x40(%rsp), %rsi
callq 0xac00
movzbl %r13b, %ecx
movl %ecx, 0x5c(%rsp)
cmpl (%rax), %r14d
jne 0x46e8e
leaq 0x70(%rsp), %rdi
movq %r12, %rsi
callq 0xac00
movslq (%rax), %rsi
movq 0x60(%rsp), %rdi
callq 0x4b9e8
movq %rax, %r14
leaq 0x130(%rsp), %rdi
movq %r12, %rsi
callq 0xac00
movslq (%rax), %rsi
movq %r14, %rdi
callq 0x4b6d6
movq 0x10(%rax), %rcx
movq %rcx, 0x1e0(%rsp)
movupd (%rax), %xmm0
movapd %xmm0, 0x1d0(%rsp)
leaq 0x70(%rsp), %rdi
movq 0x40(%rsp), %rsi
callq 0xac00
movslq (%rax), %rsi
movq 0x60(%rsp), %rdi
callq 0x4b9e8
movq %rax, %r14
leaq 0x130(%rsp), %rdi
movq 0x40(%rsp), %rsi
callq 0xac00
movslq (%rax), %rsi
movq %r14, %rdi
callq 0x4b6d6
movq 0x10(%rax), %rcx
movq %rcx, 0x28(%rsp)
movups (%rax), %xmm0
movups %xmm0, 0x18(%rsp)
movq 0x1e0(%rsp), %rax
movq %rax, 0x10(%rsp)
movapd 0x1d0(%rsp), %xmm0
movupd %xmm0, (%rsp)
callq 0x76066
testb %al, %al
je 0x46fd7
testb $0x1, 0x3c(%rsp)
movq 0x40(%rsp), %r14
je 0x4707b
leaq 0xa0(%rsp), %rdi
movq %r12, %rsi
callq 0x4b6d6
movq 0x10(%rax), %rcx
movq %rcx, 0x10(%rsp)
movupd (%rax), %xmm0
movupd %xmm0, (%rsp)
leaq 0xc0(%rsp), %rdi
callq 0x637df
leaq 0xe0(%rsp), %rdi
leaq 0x260(%rsp), %rsi
leaq 0xc0(%rsp), %rdx
callq 0x642ae
leaq 0xa0(%rsp), %rdi
movq %r14, %rsi
callq 0x4b6d6
leaq 0x230(%rsp), %rdi
movq %rax, %rsi
leaq 0xe0(%rsp), %rdx
callq 0x642d2
movq 0x240(%rsp), %rax
movq %rax, 0x10(%rsp)
movupd 0x230(%rsp), %xmm0
movupd %xmm0, (%rsp)
leaq 0xc0(%rsp), %rdi
callq 0x637df
xorl %r14d, %r14d
pushq $-0x1
popq %rax
cmpl $0x1, %eax
jg 0x47054
cmpl $0x1, %r14d
jg 0x47054
movl %eax, 0x90(%rsp)
cvtsi2sd %eax, %xmm0
movsd %xmm0, 0x98(%rsp)
pushq $-0x1
popq %r13
cmpl $0x1, %r13d
jg 0x46e80
cmpl $0x1, %r14d
jg 0x46e80
cvtsi2sd %r13d, %xmm0
movsd %xmm0, 0x50(%rsp)
pushq $-0x1
popq %r12
cmpl $0x1, %r12d
jg 0x46e73
cmpl $0x2, %r14d
jge 0x46e73
cvtsi2sd %r12d, %xmm2
movq %rbx, %rdi
movsd 0x98(%rsp), %xmm0
movsd 0x50(%rsp), %xmm1
callq 0x6402e
movq %rbp, %rdi
leaq 0xc0(%rsp), %rsi
movq %rbx, %rdx
callq 0x642d2
leaq 0x118(%rsp), %rdi
movq %r15, %rsi
movq %rbp, %rdx
callq 0x3f1b2
movq 0x258(%rsp), %rax
movq %rax, 0x28(%rsp)
movups 0x248(%rsp), %xmm0
movups %xmm0, 0x18(%rsp)
movq 0x128(%rsp), %rax
movq %rax, 0x10(%rsp)
movupd 0x118(%rsp), %xmm0
movupd %xmm0, (%rsp)
callq 0x76066
movzbl %al, %eax
addl %eax, %r14d
incl %r12d
jmp 0x46dd5
incl %r13d
movq 0x68(%rsp), %r12
jmp 0x46db2
movl 0x90(%rsp), %eax
incl %eax
jmp 0x46d87
leaq 0xa0(%rsp), %rdi
movq %r12, %rsi
callq 0x4b6d6
movq 0x10(%rax), %rcx
movq %rcx, 0x1a0(%rsp)
movupd (%rax), %xmm0
movapd %xmm0, 0x190(%rsp)
leaq 0xa0(%rsp), %rdi
movq 0x40(%rsp), %rsi
callq 0x4b6d6
movq 0x10(%rax), %rcx
movq %rcx, 0x28(%rsp)
movups (%rax), %xmm0
movups %xmm0, 0x18(%rsp)
movq 0x1a0(%rsp), %rax
movq %rax, 0x10(%rsp)
movapd 0x190(%rsp), %xmm0
movupd %xmm0, (%rsp)
movq %r15, %rdi
callq 0x43650
testb %al, %al
movq 0x40(%rsp), %r14
je 0x4707b
leaq 0x168(%rsp), %rdi
movq %r12, %rsi
callq 0xaba4
movb $0x1, %r13b
testq %rdx, (%rax)
je 0x4707b
leaq 0x168(%rsp), %rdi
movq %r14, %rsi
callq 0xaba4
testq %rdx, (%rax)
je 0x4707b
xorl %r13d, %r13d
xorl %eax, %eax
cmpq 0x88(%rsp), %r13
jge 0x4706c
testb $0x1, %al
jne 0x4706c
movq 0x160(%rsp), %rdi
movq %r13, %rsi
callq 0x4b9ca
movl (%rax), %r14d
movq %r12, %rsi
movl 0x4(%rax), %r12d
leaq 0x70(%rsp), %rdi
callq 0xac00
cmpl (%rax), %r14d
jne 0x46f97
leaq 0x70(%rsp), %rdi
movq 0x40(%rsp), %rsi
callq 0xac00
cmpl (%rax), %r12d
je 0x46fbf
leaq 0x70(%rsp), %rdi
movq 0x68(%rsp), %rsi
callq 0xac00
cmpl (%rax), %r12d
jne 0x46fc3
leaq 0x70(%rsp), %rdi
movq 0x40(%rsp), %rsi
callq 0xac00
cmpl (%rax), %r14d
jne 0x46fc3
movb $0x1, %al
jmp 0x46fc5
xorl %eax, %eax
incq %r13
movq 0x68(%rsp), %r12
movq 0x40(%rsp), %r14
jmp 0x46f44
leaq 0xa0(%rsp), %rdi
movq %r12, %rsi
callq 0x4b6d6
movq 0x10(%rax), %rcx
movq %rcx, 0x1c0(%rsp)
movupd (%rax), %xmm0
movapd %xmm0, 0x1b0(%rsp)
leaq 0xa0(%rsp), %rdi
movq 0x40(%rsp), %rsi
callq 0x4b6d6
movq 0x10(%rax), %rcx
movq %rcx, 0x28(%rsp)
movups (%rax), %xmm0
movups %xmm0, 0x18(%rsp)
movq 0x1c0(%rsp), %rax
movq %rax, 0x10(%rsp)
movapd 0x1b0(%rsp), %xmm0
movupd %xmm0, (%rsp)
movq %r15, %rdi
callq 0x43650
testb %al, %al
pushq $0x1
popq %rax
movl 0x5c(%rsp), %ecx
cmovnel %eax, %ecx
jmp 0x47062
cmpl $0x2, %r14d
pushq $0x1
popq %rax
movl 0x5c(%rsp), %ecx
cmovgel %eax, %ecx
movl %ecx, %r13d
movq 0x40(%rsp), %r14
jmp 0x4707b
testb $0x1, %al
pushq $0x1
popq %rax
movl 0x5c(%rsp), %ecx
cmovel %eax, %ecx
movl %ecx, %r13d
incq %r14
jmp 0x46bc2
incq 0x110(%rsp)
movq 0x150(%rsp), %r12
jmp 0x46b90
leaq 0x168(%rsp), %rdi
callq 0xa976
leaq 0xa0(%rsp), %rdi
callq 0xb132
leaq 0x130(%rsp), %rdi
callq 0xb290
leaq 0x70(%rsp), %rdi
callq 0xb290
andb $0x1, %r13b
movl %r13d, %eax
addq $0x278, %rsp            # imm = 0x278
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x47127
jmp 0x47127
jmp 0x47127
jmp 0x47127
jmp 0x47127
jmp 0x47127
jmp 0x47127
jmp 0x47127
jmp 0x47104
jmp 0x47127
jmp 0x47127
jmp 0x47104
jmp 0x47104
jmp 0x47104
jmp 0x47104
jmp 0x47104
jmp 0x47104
movq %rax, %rbx
leaq 0xc0(%rsp), %rdi
callq 0xb132
leaq 0xe0(%rsp), %rdi
callq 0xb132
jmp 0x4712a
jmp 0x47127
jmp 0x47127
movq %rax, %rbx
leaq 0x168(%rsp), %rdi
callq 0xa976
leaq 0xa0(%rsp), %rdi
callq 0xb132
leaq 0x130(%rsp), %rdi
callq 0xb290
leaq 0x70(%rsp), %rdi
callq 0xb290
movq %rbx, %rdi
callq 0x4780