// File: /workspace/github_cpp_makefile_star2_O1/Luthaf[P]zeopp/network.cc
// Function: getOMSInformation(char*, char*, ATOM_NETWORK*, bool)
void getOMSInformation(char *filename, char *filenameExtendedOutput, ATOM_NETWORK *atmnet, bool extendedOutput){

 // General consts
 const double Threshold = PI/16.;

 // Output variables
 int nOMS=0;
 vector< vector<int> > OMS_atomIDs;

 // to speed up calculations, identify atoms on the "surface" of the unit cell 

 vector <int> surfaceIDs;
 vector <bool> surfaceFlag;

 double surface_slab_d = 3.5; // cutoff distance from the surface 

 double a_step = surface_slab_d/atmnet->a;
 double b_step = surface_slab_d/atmnet->b;
 double c_step = surface_slab_d/atmnet->c;

 surfaceFlag.resize(atmnet->atoms.size(), false);

 if(a_step>=1.0 || b_step>=1.0 || c_step>=1.0)
   {//no speed up
   for(unsigned int i = 0; i < atmnet->atoms.size(); i++) 
      {
      surfaceIDs.push_back(i);
      surfaceFlag.at(i) = true;
      };
   cout << "Small unit cell. All(" << atmnet->atoms.size() << ") atoms considered to be on the unit cell surface." << endl;
   }else
   {
   for(unsigned int i = 0; i < atmnet->atoms.size(); i++)
      {
      double a = atmnet->atoms.at(i).a_coord; double b = atmnet->atoms.at(i).b_coord; double c = atmnet->atoms.at(i).c_coord;

      if(a < a_step || a > (1-a_step) || b < b_step || b > (1-b_step) || c < c_step || c > (1-c_step) )
        {
        surfaceIDs.push_back(i); surfaceFlag.at(i) = true;
        };
      };
   cout << "Big unit cell. " << surfaceIDs.size() << " out of " << atmnet->atoms.size() << " atoms considered to be on the unit cell surface. Surface definition = " << surface_slab_d << endl;
   };


 for(unsigned int i = 0; i < atmnet->atoms.size(); i++)
    {
//    DijkstraAtomNetwork.nodes.push_back(DIJKSTRA_NODE(i, atmnet->atoms.at(i).x, atmnet->atoms.at(i).y, atmnet->atoms.at(i).z,
//                                                           lookupCovRadius(atmnet->atoms.at(i).type), true));

    if(isMetal(atmnet->atoms.at(i).type) == true)
     {

     vector< vector <double> > cluster;
     vector <int> cluster_atomIDs;

     XYZ atom1(atmnet->atoms.at(i).x, atmnet->atoms.at(i).y, atmnet->atoms.at(i).z);
     vector <double> origin;
     origin.push_back(atom1.x); origin.push_back(atom1.y); origin.push_back(atom1.z);
     cluster.push_back(origin);
     cluster_atomIDs.push_back(i);

     for(int x=-1; x<2; x++) // loop over all unit cells
     for(int y=-1; y<2; y++)
     for(int z=-1; z<2; z++)
       {
       if(x==0 && y==0 && z==0)
         { // connectivity inside cell
         for(unsigned int j = 0; j < atmnet->atoms.size(); j++)
            {
            if(i!=j)
              {
              XYZ atom2(atmnet->atoms.at(j).x, atmnet->atoms.at(j).y, atmnet->atoms.at(j).z);
              XYZ va = atmnet->v_a; XYZ vb = atmnet->v_b; XYZ vc = atmnet->v_c;
              atom2 = atom2 + va.scale(x) + vb.scale(y) + vc.scale(z);
              double dist = calcEuclideanDistance(atom1.x, atom1.y, atom1.z, atom2.x, atom2.y, atom2.z);
              if(dist < lookupCovRadius(atmnet->atoms.at(i).type) + lookupCovRadius(atmnet->atoms.at(j).type)  + 0.4)
               { // connected;
               vector <double> clusteratom;
               clusteratom.push_back(atom2.x); clusteratom.push_back(atom2.y); clusteratom.push_back(atom2.z);
               cluster.push_back(clusteratom);
               cluster_atomIDs.push_back(j);
               };
              };
            };
         }else
         { // connectivity outside cell
         if(surfaceFlag.at(i) == true) // only investigate if surface atom (other will not have a chance to be connected)
           {
           for(unsigned int k = 0; k < surfaceIDs.size(); k++)
              {
              unsigned int j = surfaceIDs.at(k);

              XYZ atom2(atmnet->atoms.at(j).x, atmnet->atoms.at(j).y, atmnet->atoms.at(j).z);
              XYZ va = atmnet->v_a; XYZ vb = atmnet->v_b; XYZ vc = atmnet->v_c;
              atom2 = atom2 + va.scale(x) + vb.scale(y) + vc.scale(z);

              double dist = calcEuclideanDistance(atom1.x, atom1.y, atom1.z, atom2.x, atom2.y, atom2.z);
              if(dist < lookupCovRadius(atmnet->atoms.at(i).type) + lookupCovRadius(atmnet->atoms.at(j).type)  + 0.4)
               { // connected;
               vector <double> clusteratom;
               clusteratom.push_back(atom2.x); clusteratom.push_back(atom2.y); clusteratom.push_back(atom2.z);
               cluster.push_back(clusteratom);
               cluster_atomIDs.push_back(j);
               };



              }; // ends loop over k
            }; // ends surfaceFlag.at(i) if

        }; // end loop over cells outside the central cell
       }; //ends loop over supercell (x,y,z)

   if(IsExposedMoleculeThreshold(cluster, Threshold)) 
      {
      nOMS++;
      OMS_atomIDs.push_back(cluster_atomIDs);
      };

   }; // ends if isMetal
  }; // finishes loop over all atoms

 // Save output
 fstream output;
 output.open(filename, fstream::out);
 output << filename << " #OMS=  "<< nOMS << "\n";
 output.close();

 // Save extended output: coordinates with framework and molecule ID




/* Save additional atom statistics */

 if(extendedOutput == true)
   {
   fstream output2;
   output2.open(filenameExtendedOutput, fstream::out);

   for(unsigned int i=0; i < OMS_atomIDs.size(); i++)
      {
      output2 << atmnet->atoms.at(OMS_atomIDs[i].at(0)).type << "     ";
      output2 << OMS_atomIDs[i].size()-1 << "  ";
      for(unsigned int j=1; j < OMS_atomIDs[i].size(); j++)
         output2 << atmnet->atoms.at(OMS_atomIDs[i].at(j)).type << " ";
      output2 << "\n";
      };

   output2.close();

   }; // ends extended output


}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x708, %rsp            # imm = 0x708
movl %ecx, 0xf0(%rsp)
movq %rdx, %rbx
xorps %xmm0, %xmm0
movaps %xmm0, 0xd0(%rsp)
xorl %ecx, %ecx
movq %rcx, 0xe0(%rsp)
movq %rcx, 0x70(%rsp)
movaps %xmm0, 0x60(%rsp)
leaq 0x100(%rsp), %rax
movq %rcx, (%rax)
movl %ecx, 0x8(%rax)
movq %rcx, 0x10(%rax)
movl %ecx, 0x18(%rax)
movq %rcx, 0x20(%rax)
movsd 0x143c34(%rip), %xmm0   # 0x14f078
movapd %xmm0, %xmm1
divsd 0x8(%rdx), %xmm1
movsd %xmm1, 0x20(%rsp)
movapd %xmm0, %xmm1
divsd 0x10(%rdx), %xmm1
movsd %xmm1, 0x48(%rsp)
divsd 0x18(%rdx), %xmm0
movsd %xmm0, 0x58(%rsp)
movq %rsi, 0x240(%rsp)
movq 0x2f8(%rdx), %rsi
subq 0x2f0(%rdx), %rsi
movq %rdi, 0x248(%rsp)
sarq $0x3, %rsi
movabsq $-0x79435e50d79435e5, %rcx # imm = 0x86BCA1AF286BCA1B
imulq %rcx, %rsi
movq %rax, %rdi
xorl %edx, %edx
callq 0xed48
movsd 0x20(%rsp), %xmm0
ucomisd 0x143ba3(%rip), %xmm0   # 0x14f058
movq 0x2f0(%rbx), %rax
movq 0x2f8(%rbx), %rcx
jae 0xb6cd
movsd 0x48(%rsp), %xmm0
ucomisd 0x143b81(%rip), %xmm0   # 0x14f058
jae 0xb6cd
movsd 0x58(%rsp), %xmm0
ucomisd 0x143b6d(%rip), %xmm0   # 0x14f058
jae 0xb6cd
cmpq %rax, %rcx
je 0xb619
movsd 0x143b56(%rip), %xmm0   # 0x14f058
movapd %xmm0, %xmm1
subsd 0x20(%rsp), %xmm1
movsd %xmm1, 0x28(%rsp)
movapd %xmm0, %xmm1
subsd 0x48(%rsp), %xmm1
movsd %xmm1, 0xb0(%rsp)
subsd 0x58(%rsp), %xmm0
movsd %xmm0, 0xa8(%rsp)
movl $0x1, %ebp
xorl %r13d, %r13d
leaq 0x60(%rsp), %r14
leaq 0x4f0(%rsp), %r15
leaq 0x100(%rsp), %r12
imulq $0x98, %r13, %rcx
movsd 0x18(%rax,%rcx), %xmm0
movsd 0x20(%rsp), %xmm1
ucomisd %xmm0, %xmm1
ja 0xb5ac
ucomisd 0x28(%rsp), %xmm0
ja 0xb5ac
movsd 0x20(%rax,%rcx), %xmm0
movsd 0x48(%rsp), %xmm1
ucomisd %xmm0, %xmm1
ja 0xb5ac
ucomisd 0xb0(%rsp), %xmm0
ja 0xb5ac
movsd 0x28(%rax,%rcx), %xmm0
movsd 0x58(%rsp), %xmm1
ucomisd %xmm0, %xmm1
ja 0xb5ac
ucomisd 0xa8(%rsp), %xmm0
jbe 0xb5e8
leal -0x1(%rbp), %eax
movl %eax, 0x4f0(%rsp)
movq 0x68(%rsp), %rsi
cmpq 0x70(%rsp), %rsi
je 0xb5cf
movl %eax, (%rsi)
addq $0x4, %rsi
movq %rsi, 0x68(%rsp)
jmp 0xb5da
movq %r14, %rdi
movq %r15, %rdx
callq 0x1422c
movq %r12, %rdi
movq %r13, %rsi
callq 0xedb6
orq %rdx, (%rax)
movl %ebp, %r13d
movq 0x2f0(%rbx), %rax
movq 0x2f8(%rbx), %rcx
subq %rax, %rcx
sarq $0x3, %rcx
movabsq $-0x79435e50d79435e5, %rdx # imm = 0x86BCA1AF286BCA1B
imulq %rdx, %rcx
incl %ebp
cmpq %r13, %rcx
ja 0xb551
movq 0x18b9a0(%rip), %rdi    # 0x196fc0
leaq 0x143d2d(%rip), %rsi    # 0x14f354
movl $0xf, %edx
callq 0x44e0
movq 0x68(%rsp), %rsi
subq 0x60(%rsp), %rsi
sarq $0x2, %rsi
movq 0x18b97a(%rip), %rdi    # 0x196fc0
callq 0x42b0
movq %rax, %r14
leaq 0x1484ff(%rip), %rsi    # 0x153b54
movl $0x8, %edx
movq %rax, %rdi
callq 0x44e0
movq 0x2f8(%rbx), %rsi
subq 0x2f0(%rbx), %rsi
sarq $0x3, %rsi
movabsq $-0x79435e50d79435e5, %rax # imm = 0x86BCA1AF286BCA1B
imulq %rax, %rsi
movq %r14, %rdi
callq 0x42b0
movq %rax, %r14
leaq 0x143cd0(%rip), %rsi    # 0x14f364
movl $0x47, %edx
movq %rax, %rdi
callq 0x44e0
movsd 0x1439cf(%rip), %xmm0   # 0x14f078
movq %r14, %rdi
callq 0x46b0
movq %rax, %r14
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %r14, %rdi
movl $0xa, %esi
callq 0x4420
jmp 0xb7bc
cmpq %rax, %rcx
je 0xb74d
xorl %r14d, %r14d
leaq 0x60(%rsp), %r15
leaq 0x4f0(%rsp), %r12
leaq 0x100(%rsp), %r13
movl %r14d, 0x4f0(%rsp)
movq 0x68(%rsp), %rsi
cmpq 0x70(%rsp), %rsi
je 0xb70c
movl %r14d, (%rsi)
addq $0x4, %rsi
movq %rsi, 0x68(%rsp)
jmp 0xb717
movq %r15, %rdi
movq %r12, %rdx
callq 0x1422c
movq %r13, %rdi
movq %r14, %rsi
callq 0xedb6
orq %rdx, (%rax)
movq 0x2f8(%rbx), %rax
subq 0x2f0(%rbx), %rax
incl %r14d
sarq $0x3, %rax
movabsq $-0x79435e50d79435e5, %rcx # imm = 0x86BCA1AF286BCA1B
imulq %rcx, %rax
cmpq %r14, %rax
ja 0xb6ea
movq 0x18b86c(%rip), %rdi    # 0x196fc0
leaq 0x143bb0(%rip), %rsi    # 0x14f30b
movl $0x15, %edx
callq 0x44e0
movq 0x2f8(%rbx), %rsi
subq 0x2f0(%rbx), %rsi
sarq $0x3, %rsi
movabsq $-0x79435e50d79435e5, %rax # imm = 0x86BCA1AF286BCA1B
imulq %rax, %rsi
movq 0x18b834(%rip), %rdi    # 0x196fc0
callq 0x42b0
movq %rax, %r14
leaq 0x143b86(%rip), %rsi    # 0x14f321
movl $0x32, %edx
movq %rax, %rdi
callq 0x44e0
movq (%r14), %rax
movq -0x18(%rax), %rdi
addq %r14, %rdi
movl $0xa, %esi
callq 0x4420
movsbl %al, %esi
movq %r14, %rdi
callq 0x4040
movq %rax, %rdi
callq 0x42c0
movq 0x2f0(%rbx), %rax
cmpq %rax, 0x2f8(%rbx)
je 0xc3fd
leaq 0x138(%rsp), %rcx
leaq 0x38(%rbx), %rdx
movq %rdx, 0x58(%rsp)
leaq 0x50(%rbx), %rdx
movq %rdx, 0xb0(%rsp)
leaq 0x68(%rbx), %rdx
movq %rdx, 0xa8(%rsp)
leaq 0x128(%rsp), %r12
xorl %edx, %edx
movl $0x0, 0x54(%rsp)
xorl %r14d, %r14d
movq %r14, 0xa0(%rsp)
movq %rdx, 0x28(%rsp)
imulq $0x98, %rdx, %r15
movq %rcx, 0x128(%rsp)
movq 0x40(%rax,%r15), %rsi
movq 0x48(%rax,%r15), %rdx
addq %rsi, %rdx
movq %r12, %rdi
callq 0xf32a
movq %r12, %rdi
callq 0x223bd
movl %eax, %r13d
movq 0x128(%rsp), %rdi
leaq 0x138(%rsp), %rax
cmpq %rax, %rdi
je 0xb882
movq 0x138(%rsp), %rsi
incq %rsi
callq 0x4470
testb %r13b, %r13b
je 0xb943
xorpd %xmm0, %xmm0
movapd %xmm0, 0x4f0(%rsp)
xorl %eax, %eax
movq %rax, 0x500(%rsp)
movq %rax, 0x2f0(%rsp)
movapd %xmm0, 0x2e0(%rsp)
movq 0x2f0(%rbx), %rax
movq 0x2f8(%rbx), %rdx
subq %rax, %rdx
sarq $0x3, %rdx
movabsq $-0x79435e50d79435e5, %rcx # imm = 0x86BCA1AF286BCA1B
imulq %rcx, %rdx
cmpq 0x28(%rsp), %rdx
jbe 0xc7bb
movsd (%rax,%r15), %xmm0
movsd 0x8(%rax,%r15), %xmm1
movsd 0x10(%rax,%r15), %xmm2
leaq 0xb8(%rsp), %rdi
callq 0x85982
xorpd %xmm0, %xmm0
movapd %xmm0, 0x80(%rsp)
movq $0x0, 0x90(%rsp)
movq 0x88(%rsp), %rsi
testq %rsi, %rsi
je 0xb992
movsd 0xb8(%rsp), %xmm0
movsd %xmm0, (%rsi)
addq $0x8, %rsi
movq %rsi, 0x88(%rsp)
jmp 0xb9a7
leaq 0x128(%rsp), %r12
movq 0xa0(%rsp), %r14
incl %r14d
movq 0x2f0(%rbx), %rax
movq 0x2f8(%rbx), %rcx
subq %rax, %rcx
sarq $0x3, %rcx
movabsq $-0x79435e50d79435e5, %rdx # imm = 0x86BCA1AF286BCA1B
imulq %rdx, %rcx
movq %r14, %rdx
cmpq %r14, %rcx
leaq 0x138(%rsp), %rcx
ja 0xb821
jmp 0xc405
leaq 0x80(%rsp), %rdi
leaq 0xb8(%rsp), %rdx
callq 0x148c4
movq 0x88(%rsp), %rsi
cmpq 0x90(%rsp), %rsi
je 0xb9d4
movsd 0xc0(%rsp), %xmm0
movsd %xmm0, (%rsi)
addq $0x8, %rsi
movq %rsi, 0x88(%rsp)
jmp 0xb9e9
leaq 0x80(%rsp), %rdi
leaq 0xc0(%rsp), %rdx
callq 0x148c4
movq 0x88(%rsp), %rsi
cmpq 0x90(%rsp), %rsi
je 0xba16
movsd 0xc8(%rsp), %xmm0
movsd %xmm0, (%rsi)
addq $0x8, %rsi
movq %rsi, 0x88(%rsp)
jmp 0xba2b
leaq 0x80(%rsp), %rdi
leaq 0xc8(%rsp), %rdx
callq 0x148c4
leaq 0x4f0(%rsp), %rdi
leaq 0x80(%rsp), %rsi
callq 0xee9a
movq 0xa0(%rsp), %rax
movl %eax, 0x30(%rsp)
movq 0x2e8(%rsp), %rsi
cmpq 0x2f0(%rsp), %rsi
je 0xba6e
movl %eax, (%rsi)
addq $0x4, %rsi
movq %rsi, 0x2e8(%rsp)
jmp 0xba80
leaq 0x2e0(%rsp), %rdi
leaq 0x30(%rsp), %rdx
callq 0x1422c
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
xorps %xmm0, %xmm0
cvtsi2sd %eax, %xmm0
movsd %xmm0, 0x250(%rsp)
movl $0xffffffff, %ecx       # imm = 0xFFFFFFFF
movl %eax, 0xf4(%rsp)
movl %ecx, 0xf8(%rsp)
movl %ecx, %edx
orl %eax, %edx
movl %edx, 0xfc(%rsp)
xorps %xmm0, %xmm0
cvtsi2sd %ecx, %xmm0
movsd %xmm0, 0x258(%rsp)
movl $0xffffffff, %ebp       # imm = 0xFFFFFFFF
movl 0xfc(%rsp), %eax
orl %ebp, %eax
movl %ebp, 0x9c(%rsp)
je 0xbf27
leaq 0x100(%rsp), %rdi
movq 0x28(%rsp), %rsi
callq 0xedb6
testq %rdx, (%rax)
je 0xc31a
movq 0x60(%rsp), %rax
cmpq %rax, 0x68(%rsp)
je 0xc31a
xorps %xmm0, %xmm0
cvtsi2sdl 0x9c(%rsp), %xmm0
movsd %xmm0, 0x260(%rsp)
movl $0x1, %ebp
xorl %ecx, %ecx
movl (%rax,%rcx,4), %r13d
movq 0x2f0(%rbx), %rax
movq 0x2f8(%rbx), %rdx
subq %rax, %rdx
sarq $0x3, %rdx
movabsq $-0x79435e50d79435e5, %rcx # imm = 0x86BCA1AF286BCA1B
imulq %rcx, %rdx
cmpq %r13, %rdx
jbe 0xc742
imulq $0x98, %r13, %r12
movsd (%rax,%r12), %xmm0
movsd 0x8(%rax,%r12), %xmm1
movsd 0x10(%rax,%r12), %xmm2
leaq 0x30(%rsp), %rdi
callq 0x85982
movq 0x58(%rsp), %rcx
movq 0x10(%rcx), %rax
movq %rax, 0x230(%rsp)
movups (%rcx), %xmm0
movaps %xmm0, 0x220(%rsp)
movq 0xb0(%rsp), %rcx
movq 0x10(%rcx), %rax
movq %rax, 0x210(%rsp)
movups (%rcx), %xmm0
movaps %xmm0, 0x200(%rsp)
movq 0xa8(%rsp), %rcx
movq 0x10(%rcx), %rax
movq %rax, 0x1f0(%rsp)
movups (%rcx), %xmm0
movaps %xmm0, 0x1e0(%rsp)
leaq 0x2c8(%rsp), %r14
movq %r14, %rdi
leaq 0x220(%rsp), %rsi
movsd 0x250(%rsp), %xmm0
callq 0x85a34
leaq 0x268(%rsp), %rdi
leaq 0x30(%rsp), %rsi
movq %r14, %rdx
callq 0x85dd4
leaq 0x2b0(%rsp), %r14
movq %r14, %rdi
leaq 0x200(%rsp), %rsi
movsd 0x258(%rsp), %xmm0
callq 0x85a34
leaq 0x148(%rsp), %rdi
leaq 0x268(%rsp), %rsi
movq %r14, %rdx
callq 0x85dd4
leaq 0x298(%rsp), %r14
movq %r14, %rdi
leaq 0x1e0(%rsp), %rsi
movsd 0x260(%rsp), %xmm0
callq 0x85a34
movq %rsp, %rdi
leaq 0x148(%rsp), %rsi
movq %r14, %rdx
callq 0x85dd4
movq 0x10(%rsp), %rax
movq %rax, 0x40(%rsp)
movups (%rsp), %xmm0
movaps %xmm0, 0x30(%rsp)
movsd 0xb8(%rsp), %xmm0
movsd 0xc0(%rsp), %xmm1
movsd 0xc8(%rsp), %xmm2
movsd 0x30(%rsp), %xmm3
movsd 0x38(%rsp), %xmm4
movsd 0x40(%rsp), %xmm5
callq 0x868fa
movsd %xmm0, 0x48(%rsp)
movq 0x2f0(%rbx), %rax
movq 0x2f8(%rbx), %rdx
subq %rax, %rdx
sarq $0x3, %rdx
movabsq $-0x79435e50d79435e5, %rcx # imm = 0x86BCA1AF286BCA1B
imulq %rcx, %rdx
cmpq 0x28(%rsp), %rdx
jbe 0xc764
leaq 0x190(%rsp), %rcx
movq %rcx, 0x180(%rsp)
movq 0x40(%rax,%r15), %rsi
movq 0x48(%rax,%r15), %rdx
addq %rsi, %rdx
leaq 0x180(%rsp), %rdi
callq 0xf32a
leaq 0x180(%rsp), %rdi
callq 0x2214b
movsd %xmm0, 0x20(%rsp)
movq 0x2f0(%rbx), %rax
movq 0x2f8(%rbx), %rdx
subq %rax, %rdx
sarq $0x3, %rdx
movabsq $-0x79435e50d79435e5, %rcx # imm = 0x86BCA1AF286BCA1B
imulq %rcx, %rdx
cmpq %r13, %rdx
jbe 0xc753
leaq 0x170(%rsp), %rcx
movq %rcx, 0x160(%rsp)
movq 0x40(%rax,%r12), %rsi
movq 0x48(%rax,%r12), %rdx
addq %rsi, %rdx
leaq 0x160(%rsp), %rdi
callq 0xf32a
leaq 0x160(%rsp), %rdi
callq 0x2214b
movsd 0x20(%rsp), %xmm1
addsd %xmm0, %xmm1
addsd 0x1432be(%rip), %xmm1   # 0x14f060
movsd %xmm1, 0x20(%rsp)
movq 0x160(%rsp), %rdi
leaq 0x170(%rsp), %rax
cmpq %rax, %rdi
je 0xbdcd
movq 0x170(%rsp), %rsi
incq %rsi
callq 0x4470
movq 0x180(%rsp), %rdi
leaq 0x190(%rsp), %rax
cmpq %rax, %rdi
je 0xbdf2
movq 0x190(%rsp), %rsi
incq %rsi
callq 0x4470
movsd 0x20(%rsp), %xmm0
ucomisd 0x48(%rsp), %xmm0
jbe 0xbf04
xorpd %xmm0, %xmm0
movapd %xmm0, (%rsp)
movq $0x0, 0x10(%rsp)
movq 0x8(%rsp), %rsi
testq %rsi, %rsi
je 0xbe35
movsd 0x30(%rsp), %xmm0
movsd %xmm0, (%rsi)
addq $0x8, %rsi
movq %rsi, 0x8(%rsp)
jmp 0xbe42
movq %rsp, %rdi
leaq 0x30(%rsp), %rdx
callq 0x148c4
movq 0x8(%rsp), %rsi
cmpq 0x10(%rsp), %rsi
je 0xbe63
movsd 0x38(%rsp), %xmm0
movsd %xmm0, (%rsi)
addq $0x8, %rsi
movq %rsi, 0x8(%rsp)
jmp 0xbe70
movq %rsp, %rdi
leaq 0x38(%rsp), %rdx
callq 0x148c4
movq 0x8(%rsp), %rsi
cmpq 0x10(%rsp), %rsi
je 0xbe91
movsd 0x40(%rsp), %xmm0
movsd %xmm0, (%rsi)
addq $0x8, %rsi
movq %rsi, 0x8(%rsp)
jmp 0xbe9e
movq %rsp, %rdi
leaq 0x40(%rsp), %rdx
callq 0x148c4
leaq 0x4f0(%rsp), %rdi
movq %rsp, %rsi
callq 0xee9a
movl %r13d, 0x148(%rsp)
movq 0x2e8(%rsp), %rsi
cmpq 0x2f0(%rsp), %rsi
je 0xbed9
movl %r13d, (%rsi)
addq $0x4, %rsi
movq %rsi, 0x2e8(%rsp)
jmp 0xbeee
leaq 0x2e0(%rsp), %rdi
leaq 0x148(%rsp), %rdx
callq 0x1422c
movq (%rsp), %rdi
testq %rdi, %rdi
je 0xbf04
movq 0x10(%rsp), %rsi
subq %rdi, %rsi
callq 0x4470
movl %ebp, %ecx
movq 0x60(%rsp), %rax
movq 0x68(%rsp), %rdx
subq %rax, %rdx
sarq $0x2, %rdx
incl %ebp
cmpq %rcx, %rdx
ja 0xbb25
jmp 0xc31a
movq 0x2f0(%rbx), %rax
cmpq %rax, 0x2f8(%rbx)
je 0xc31a
xorl %r13d, %r13d
cmpl %r13d, 0xa0(%rsp)
je 0xc2eb
imulq $0x98, %r13, %rbp
movsd (%rax,%rbp), %xmm0
movsd 0x8(%rax,%rbp), %xmm1
movsd 0x10(%rax,%rbp), %xmm2
leaq 0x30(%rsp), %rdi
callq 0x85982
movq 0x58(%rsp), %rcx
movq 0x10(%rcx), %rax
movq %rax, 0x230(%rsp)
movups (%rcx), %xmm0
movaps %xmm0, 0x220(%rsp)
movq 0xb0(%rsp), %rcx
movq 0x10(%rcx), %rax
movq %rax, 0x210(%rsp)
movups (%rcx), %xmm0
movaps %xmm0, 0x200(%rsp)
movq 0xa8(%rsp), %rcx
movq 0x10(%rcx), %rax
movq %rax, 0x1f0(%rsp)
movupd (%rcx), %xmm0
movapd %xmm0, 0x1e0(%rsp)
xorpd %xmm0, %xmm0
leaq 0x2c8(%rsp), %r14
movq %r14, %rdi
leaq 0x220(%rsp), %rsi
callq 0x85a34
leaq 0x268(%rsp), %rdi
leaq 0x30(%rsp), %rsi
movq %r14, %rdx
callq 0x85dd4
xorpd %xmm0, %xmm0
leaq 0x2b0(%rsp), %r14
movq %r14, %rdi
leaq 0x200(%rsp), %rsi
callq 0x85a34
leaq 0x148(%rsp), %rdi
leaq 0x268(%rsp), %rsi
movq %r14, %rdx
callq 0x85dd4
xorpd %xmm0, %xmm0
leaq 0x298(%rsp), %r14
movq %r14, %rdi
leaq 0x1e0(%rsp), %rsi
callq 0x85a34
movq %rsp, %rdi
leaq 0x148(%rsp), %rsi
movq %r14, %rdx
callq 0x85dd4
movq 0x10(%rsp), %rax
movq %rax, 0x40(%rsp)
movups (%rsp), %xmm0
movaps %xmm0, 0x30(%rsp)
movsd 0xb8(%rsp), %xmm0
movsd 0xc0(%rsp), %xmm1
movsd 0xc8(%rsp), %xmm2
movsd 0x30(%rsp), %xmm3
movsd 0x38(%rsp), %xmm4
movsd 0x40(%rsp), %xmm5
callq 0x868fa
movsd %xmm0, 0x48(%rsp)
movq 0x2f0(%rbx), %rax
movq 0x2f8(%rbx), %rdx
subq %rax, %rdx
sarq $0x3, %rdx
movabsq $-0x79435e50d79435e5, %rcx # imm = 0x86BCA1AF286BCA1B
imulq %rcx, %rdx
cmpq 0x28(%rsp), %rdx
jbe 0xc788
leaq 0x1d0(%rsp), %rcx
movq %rcx, 0x1c0(%rsp)
movq 0x40(%rax,%r15), %rsi
movq 0x48(%rax,%r15), %rdx
addq %rsi, %rdx
leaq 0x1c0(%rsp), %rdi
callq 0xf32a
leaq 0x1c0(%rsp), %rdi
callq 0x2214b
movsd %xmm0, 0x20(%rsp)
movq 0x2f0(%rbx), %rax
movq 0x2f8(%rbx), %rdx
subq %rax, %rdx
sarq $0x3, %rdx
movabsq $-0x79435e50d79435e5, %rcx # imm = 0x86BCA1AF286BCA1B
imulq %rcx, %rdx
cmpq %r13, %rdx
jbe 0xc777
leaq 0x1b0(%rsp), %rcx
movq %rcx, 0x1a0(%rsp)
movq 0x40(%rax,%rbp), %rsi
movq 0x48(%rax,%rbp), %rdx
addq %rsi, %rdx
leaq 0x1a0(%rsp), %rdi
callq 0xf32a
leaq 0x1a0(%rsp), %rdi
callq 0x2214b
movsd 0x20(%rsp), %xmm1
addsd %xmm0, %xmm1
addsd 0x142ed7(%rip), %xmm1   # 0x14f060
movsd %xmm1, 0x20(%rsp)
movq 0x1a0(%rsp), %rdi
leaq 0x1b0(%rsp), %rax
cmpq %rax, %rdi
je 0xc1b4
movq 0x1b0(%rsp), %rsi
incq %rsi
callq 0x4470
movq 0x1c0(%rsp), %rdi
leaq 0x1d0(%rsp), %rax
cmpq %rax, %rdi
je 0xc1d9
movq 0x1d0(%rsp), %rsi
incq %rsi
callq 0x4470
movsd 0x20(%rsp), %xmm0
ucomisd 0x48(%rsp), %xmm0
jbe 0xc2eb
xorpd %xmm0, %xmm0
movapd %xmm0, (%rsp)
movq $0x0, 0x10(%rsp)
movq 0x8(%rsp), %rsi
testq %rsi, %rsi
je 0xc21c
movsd 0x30(%rsp), %xmm0
movsd %xmm0, (%rsi)
addq $0x8, %rsi
movq %rsi, 0x8(%rsp)
jmp 0xc229
movq %rsp, %rdi
leaq 0x30(%rsp), %rdx
callq 0x148c4
movq 0x8(%rsp), %rsi
cmpq 0x10(%rsp), %rsi
je 0xc24a
movsd 0x38(%rsp), %xmm0
movsd %xmm0, (%rsi)
addq $0x8, %rsi
movq %rsi, 0x8(%rsp)
jmp 0xc257
movq %rsp, %rdi
leaq 0x38(%rsp), %rdx
callq 0x148c4
movq 0x8(%rsp), %rsi
cmpq 0x10(%rsp), %rsi
je 0xc278
movsd 0x40(%rsp), %xmm0
movsd %xmm0, (%rsi)
addq $0x8, %rsi
movq %rsi, 0x8(%rsp)
jmp 0xc285
movq %rsp, %rdi
leaq 0x40(%rsp), %rdx
callq 0x148c4
leaq 0x4f0(%rsp), %rdi
movq %rsp, %rsi
callq 0xee9a
movl %r13d, 0x148(%rsp)
movq 0x2e8(%rsp), %rsi
cmpq 0x2f0(%rsp), %rsi
je 0xc2c0
movl %r13d, (%rsi)
addq $0x4, %rsi
movq %rsi, 0x2e8(%rsp)
jmp 0xc2d5
leaq 0x2e0(%rsp), %rdi
leaq 0x148(%rsp), %rdx
callq 0x1422c
movq (%rsp), %rdi
testq %rdi, %rdi
je 0xc2eb
movq 0x10(%rsp), %rsi
subq %rdi, %rsi
callq 0x4470
incl %r13d
movq 0x2f0(%rbx), %rax
movq 0x2f8(%rbx), %rcx
subq %rax, %rcx
sarq $0x3, %rcx
movabsq $-0x79435e50d79435e5, %rdx # imm = 0x86BCA1AF286BCA1B
imulq %rdx, %rcx
cmpq %r13, %rcx
ja 0xbf3e
movl 0x9c(%rsp), %ebp
incl %ebp
cmpl $0x2, %ebp
leaq 0x280(%rsp), %r14
movl 0xf8(%rsp), %ecx
jne 0xbac8
incl %ecx
cmpl $0x2, %ecx
movl 0xf4(%rsp), %eax
jne 0xbaa1
incl %eax
cmpl $0x2, %eax
jne 0xba85
movq %r14, %rdi
leaq 0x4f0(%rsp), %rsi
callq 0xeec6
movq %r14, %rdi
movsd 0x142d0d(%rip), %xmm0   # 0x14f080
callq 0x10cfb1
movl %eax, %r15d
movq %r14, %rdi
callq 0xef60
testb %r15b, %r15b
je 0xc3a1
leaq 0xd0(%rsp), %rdi
leaq 0x2e0(%rsp), %rsi
callq 0xefae
incl 0x54(%rsp)
movq 0x80(%rsp), %rdi
testq %rdi, %rdi
movq 0xa0(%rsp), %r14
je 0xc3c6
movq 0x90(%rsp), %rsi
subq %rdi, %rsi
callq 0x4470
movq 0x2e0(%rsp), %rdi
testq %rdi, %rdi
je 0xc3e3
movq 0x2f0(%rsp), %rsi
subq %rdi, %rsi
callq 0x4470
leaq 0x4f0(%rsp), %rdi
callq 0xef60
leaq 0x128(%rsp), %r12
jmp 0xb953
movl $0x0, 0x54(%rsp)
leaq 0x4f0(%rsp), %rdi
callq 0x4520
leaq 0x4f0(%rsp), %rdi
movq 0x248(%rsp), %r15
movq %r15, %rsi
movl $0x10, %edx
callq 0x43d0
leaq 0x500(%rsp), %r14
testq %r15, %r15
je 0xc454
movq %r15, %rdi
callq 0x41e0
movq %r14, %rdi
movq %r15, %rsi
movq %rax, %rdx
callq 0x44e0
jmp 0xc473
movq 0x500(%rsp), %rax
movq -0x18(%rax), %rax
leaq (%r14,%rax), %rdi
movl 0x520(%rsp,%rax), %esi
orl $0x1, %esi
callq 0x4710
leaq 0x143009(%rip), %rsi    # 0x14f483
movl $0x8, %edx
movq %r14, %rdi
callq 0x44e0
movq %r14, %rdi
movl 0x54(%rsp), %esi
callq 0x4750
leaq 0x149094(%rip), %rsi    # 0x15552e
movl $0x1, %edx
movq %rax, %rdi
callq 0x44e0
leaq 0x4f0(%rsp), %rdi
callq 0x4090
cmpb $0x0, 0xf0(%rsp)
je 0xc6ba
leaq 0x2e0(%rsp), %rdi
callq 0x4520
leaq 0x2e0(%rsp), %rdi
movq 0x240(%rsp), %rsi
movl $0x10, %edx
callq 0x43d0
movq 0xd0(%rsp), %rax
cmpq %rax, 0xd8(%rsp)
je 0xc6a0
leaq 0x2f0(%rsp), %r14
leaq 0x14af78(%rip), %r13    # 0x157486
xorl %ecx, %ecx
xorl %r12d, %r12d
leaq (%rcx,%rcx,2), %r15
movq (%rax,%r15,8), %rcx
cmpq %rcx, 0x8(%rax,%r15,8)
je 0xc7a9
movslq (%rcx), %rsi
movq 0x2f0(%rbx), %rax
movq 0x2f8(%rbx), %rdx
subq %rax, %rdx
sarq $0x3, %rdx
movabsq $-0x79435e50d79435e5, %rcx # imm = 0x86BCA1AF286BCA1B
imulq %rcx, %rdx
cmpq %rsi, %rdx
jbe 0xc7ad
imulq $0x98, %rsi, %rcx
movq 0x40(%rax,%rcx), %rsi
movq 0x48(%rax,%rcx), %rdx
movq %r14, %rdi
callq 0x44e0
movl $0x5, %edx
movq %rax, %rdi
leaq 0x142f0f(%rip), %rsi    # 0x14f48c
callq 0x44e0
movq 0xd0(%rsp), %rax
movq 0x8(%rax,%r15,8), %rsi
subq (%rax,%r15,8), %rsi
sarq $0x2, %rsi
decq %rsi
movq %r14, %rdi
callq 0x42b0
movl $0x2, %edx
movq %rax, %rdi
leaq 0x142ede(%rip), %rsi    # 0x14f48f
callq 0x44e0
movq 0xd0(%rsp), %rcx
movq (%rcx,%r15,8), %rax
movq 0x8(%rcx,%r15,8), %rcx
subq %rax, %rcx
cmpq $0x5, %rcx
jb 0xc658
movl $0x1, %ecx
movl $0x2, %ebp
movslq (%rax,%rcx,4), %rsi
movq 0x2f0(%rbx), %rax
movq 0x2f8(%rbx), %rdx
subq %rax, %rdx
sarq $0x3, %rdx
movabsq $-0x79435e50d79435e5, %rcx # imm = 0x86BCA1AF286BCA1B
imulq %rcx, %rdx
cmpq %rsi, %rdx
jbe 0xc79b
imulq $0x98, %rsi, %rcx
movq 0x40(%rax,%rcx), %rsi
movq 0x48(%rax,%rcx), %rdx
movq %r14, %rdi
callq 0x44e0
movl $0x1, %edx
movq %rax, %rdi
movq %r13, %rsi
callq 0x44e0
movl %ebp, %ecx
movq 0xd0(%rsp), %rdx
movq (%rdx,%r15,8), %rax
movq 0x8(%rdx,%r15,8), %rdx
subq %rax, %rdx
sarq $0x2, %rdx
incl %ebp
cmpq %rcx, %rdx
ja 0xc5de
movl $0x1, %edx
movq %r14, %rdi
leaq 0x148ec7(%rip), %rsi    # 0x15552e
callq 0x44e0
incl %r12d
movq 0xd0(%rsp), %rax
movq 0xd8(%rsp), %rdx
subq %rax, %rdx
sarq $0x3, %rdx
movabsq $-0x5555555555555555, %rcx # imm = 0xAAAAAAAAAAAAAAAB
imulq %rcx, %rdx
movq %r12, %rcx
cmpq %r12, %rdx
ja 0xc513
leaq 0x2e0(%rsp), %rdi
callq 0x4090
leaq 0x2e0(%rsp), %rdi
callq 0x4110
leaq 0x4f0(%rsp), %rdi
callq 0x4110
movq 0x100(%rsp), %rdi
testq %rdi, %rdi
je 0xc70c
movq 0x120(%rsp), %rsi
subq %rdi, %rsi
callq 0x4470
xorl %eax, %eax
movq %rax, 0x100(%rsp)
movl %eax, 0x108(%rsp)
movq %rax, 0x110(%rsp)
movl %eax, 0x118(%rsp)
movq %rax, 0x120(%rsp)
movq 0x60(%rsp), %rdi
testq %rdi, %rdi
je 0xc723
movq 0x70(%rsp), %rsi
subq %rdi, %rsi
callq 0x4470
leaq 0xd0(%rsp), %rdi
callq 0xefda
addq $0x708, %rsp            # imm = 0x708
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x142f5c(%rip), %rdi    # 0x14f6a5
movq %r13, %rsi
xorl %eax, %eax
callq 0x4630
leaq 0x142f4b(%rip), %rdi    # 0x14f6a5
movq %r13, %rsi
xorl %eax, %eax
callq 0x4630
leaq 0x142f3a(%rip), %rdi    # 0x14f6a5
movq 0x28(%rsp), %rsi
xorl %eax, %eax
callq 0x4630
leaq 0x142f27(%rip), %rdi    # 0x14f6a5
movq %r13, %rsi
xorl %eax, %eax
callq 0x4630
leaq 0x142f16(%rip), %rdi    # 0x14f6a5
movq 0x28(%rsp), %rsi
xorl %eax, %eax
callq 0x4630
leaq 0x142f03(%rip), %rdi    # 0x14f6a5
xorl %eax, %eax
callq 0x4630
xorl %esi, %esi
xorl %edx, %edx
leaq 0x142ef1(%rip), %rdi    # 0x14f6a5
xorl %eax, %eax
callq 0x4630
leaq 0x142ee3(%rip), %rdi    # 0x14f6a5
movq 0x28(%rsp), %rsi
xorl %eax, %eax
callq 0x4630
movq %rax, %rbx
leaq 0x280(%rsp), %rdi
callq 0xef60
jmp 0xc966
jmp 0xc832
jmp 0xc963
jmp 0xc84b
jmp 0xc83f
jmp 0xc7f0
movq %rax, %rbx
jmp 0xc983
movq %rax, %rbx
movq 0x128(%rsp), %rdi
leaq 0x138(%rsp), %rax
cmpq %rax, %rdi
je 0xc9ad
movq 0x138(%rsp), %rsi
incq %rsi
callq 0x4470
jmp 0xc9ad
jmp 0xc83f
jmp 0xc963
jmp 0xc83f
movq %rax, %rbx
jmp 0xc85b
jmp 0xc83f
jmp 0xc83f
jmp 0xc84b
jmp 0xc83f
movq %rax, %rbx
jmp 0xc9ad
jmp 0xc84b
jmp 0xc84b
movq %rax, %rbx
leaq 0x2e0(%rsp), %rdi
callq 0x4110
leaq 0x4f0(%rsp), %rdi
callq 0x4110
jmp 0xc9ad
jmp 0xc963
jmp 0xc91d
jmp 0xc91d
jmp 0xc963
movq %rax, %rbx
movq 0x1a0(%rsp), %rdi
leaq 0x1b0(%rsp), %rax
cmpq %rax, %rdi
je 0xc8c6
movq 0x1b0(%rsp), %rsi
incq %rsi
callq 0x4470
jmp 0xc8c6
jmp 0xc963
jmp 0xc8c3
jmp 0xc91d
jmp 0xc963
jmp 0xc963
jmp 0xc963
movq %rax, %rbx
movq 0x1c0(%rsp), %rdi
leaq 0x1d0(%rsp), %rax
cmpq %rax, %rdi
je 0xc966
movq 0x1d0(%rsp), %rsi
jmp 0xc955
jmp 0xc963
jmp 0xc963
jmp 0xc963
movq %rax, %rbx
movq 0x160(%rsp), %rdi
leaq 0x170(%rsp), %rax
cmpq %rax, %rdi
je 0xc938
movq 0x170(%rsp), %rsi
incq %rsi
callq 0x4470
jmp 0xc938
jmp 0xc935
jmp 0xc963
movq %rax, %rbx
movq (%rsp), %rdi
testq %rdi, %rdi
je 0xc966
movq 0x10(%rsp), %rsi
subq %rdi, %rsi
jmp 0xc958
jmp 0xc963
movq %rax, %rbx
movq 0x180(%rsp), %rdi
leaq 0x190(%rsp), %rax
cmpq %rax, %rdi
je 0xc966
movq 0x190(%rsp), %rsi
incq %rsi
callq 0x4470
jmp 0xc966
jmp 0xc963
jmp 0xc963
movq %rax, %rbx
movq 0x80(%rsp), %rdi
testq %rdi, %rdi
je 0xc983
movq 0x90(%rsp), %rsi
subq %rdi, %rsi
callq 0x4470
movq 0x2e0(%rsp), %rdi
testq %rdi, %rdi
je 0xc9a0
movq 0x2f0(%rsp), %rsi
subq %rdi, %rsi
callq 0x4470
leaq 0x4f0(%rsp), %rdi
callq 0xef60
movq 0x100(%rsp), %rdi
testq %rdi, %rdi
je 0xc9f2
movq 0x120(%rsp), %rsi
subq %rdi, %rsi
callq 0x4470
xorl %eax, %eax
movq %rax, 0x100(%rsp)
movl %eax, 0x108(%rsp)
movq %rax, 0x110(%rsp)
movl %eax, 0x118(%rsp)
movq %rax, 0x120(%rsp)
movq 0x60(%rsp), %rdi
testq %rdi, %rdi
je 0xca09
movq 0x70(%rsp), %rsi
subq %rdi, %rsi
callq 0x4470
leaq 0xd0(%rsp), %rdi
callq 0xefda
movq %rbx, %rdi
callq 0x4780