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

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

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

 double surface_slab_d = 2.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;
   };



 // Define connectivity of atoms in terms of Dijkstra graph
 DIJKSTRA_NETWORK DijkstraAtomNetwork;
 DijkstraAtomNetwork.v_a = atmnet->v_a;  DijkstraAtomNetwork.v_b = atmnet->v_b; DijkstraAtomNetwork.v_c = atmnet->v_c;

 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));
    };
 // now need to update CONN connections for each node

 for(unsigned int i = 0; i < DijkstraAtomNetwork.nodes.size(); i++)
    {
    XYZ atom1(DijkstraAtomNetwork.nodes.at(i).x, DijkstraAtomNetwork.nodes.at(i).y, DijkstraAtomNetwork.nodes.at(i).z);
// CONN(int myFrom, int myTo, double len, double maxR, DELTA_POS deltaP);
// DELTA_POS(int myX = 0, int myY = 0, int myZ = 0);

    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 = i+1; j < DijkstraAtomNetwork.nodes.size(); j++)
            {
            XYZ atom2(DijkstraAtomNetwork.nodes.at(j).x, DijkstraAtomNetwork.nodes.at(j).y, DijkstraAtomNetwork.nodes.at(j).z);
            XYZ va = DijkstraAtomNetwork.v_a; XYZ vb = DijkstraAtomNetwork.v_b; XYZ vc = DijkstraAtomNetwork.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 < DijkstraAtomNetwork.nodes.at(i).max_radius + DijkstraAtomNetwork.nodes.at(j).max_radius + 0.4)
               { // connected;
               DijkstraAtomNetwork.nodes.at(i).connections.push_back(CONN(i, j, dist, 0.10, DELTA_POS (x,y,z)));
               DijkstraAtomNetwork.nodes.at(j).connections.push_back(CONN(j, i, dist, 0.10, DELTA_POS (x,y,z)));
               };
            };
         }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(DijkstraAtomNetwork.nodes.at(j).x, DijkstraAtomNetwork.nodes.at(j).y, DijkstraAtomNetwork.nodes.at(j).z);
              XYZ va = DijkstraAtomNetwork.v_a; XYZ vb = DijkstraAtomNetwork.v_b; XYZ vc = DijkstraAtomNetwork.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 < DijkstraAtomNetwork.nodes.at(i).max_radius + DijkstraAtomNetwork.nodes.at(j).max_radius + 0.4)
                 { // connected
                 DijkstraAtomNetwork.nodes.at(i).connections.push_back(CONN(i, j, dist, 0.10, DELTA_POS (x,y,z)));
                 };
              }; // ends loop over k
            }; // ends surfaceFlag.at(i) if

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


 // Find frameworks
 vector<bool> accessInfo;
 vector<PORE> structureSegments;
 PORE::findChannelsAndPockets(&DijkstraAtomNetwork, &accessInfo, &structureSegments);

 // Save output
 fstream output;
 output.open(filename, fstream::out);
 int nPockets=0, nChan1D=0, nChan2D=0, nChan3D=0;
 for(unsigned int i = 0; i < structureSegments.size(); i++){
    if(structureSegments[i].dimensionality == 0) nPockets++;
    if(structureSegments[i].dimensionality == 1) nChan1D++;
    if(structureSegments[i].dimensionality == 2) nChan2D++;
    if(structureSegments[i].dimensionality == 3) nChan3D++;
    };
 output << filename << "   "<< atmnet->returnChemicalFormula() << "   " << structureSegments.size() << " segments: " << (structureSegments.size() - nPockets) << " framework(s) (1D/2D/3D " 
        << nChan1D << " " << nChan2D << " " << nChan3D
        << " ) and  "  << nPockets << "  molecule(s). Identified dimensionality of framework(s): ";
 for(unsigned int i = 0; i < structureSegments.size(); i++){
    if(structureSegments[i].dimensionality > 0 ) output << structureSegments[i].dimensionality << " ";
    };
 output << "\n";
 output.close();

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


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

   for(unsigned int i = 0; i < structureSegments.size(); i++)
      {
      for(unsigned int j = 0; j< structureSegments[i].reverseIDMappings.size(); j++)
         {
         int atomID = structureSegments[i].reverseIDMappings.find(j)->second;
         output2 << atmnet->atoms.at(atomID).type << "    ";
//         output2 << atmnet->atoms.at(atomID).x << "   " << atmnet->atoms.at(atomID).y << "   "
//                 << atmnet->atoms.at(atomID).z << "   " ;
         output2 << structureSegments[i].nodes.at(j).x << "   " << structureSegments[i].nodes.at(j).y << "  "
                 << structureSegments[i].nodes.at(j).z << "   ";
         output2 << atmnet->atoms.at(atomID).a_coord << "   "
                 << atmnet->atoms.at(atomID).b_coord << "   " << atmnet->atoms.at(atomID).c_coord << "   "
                 << structureSegments[i].dimensionality << "   " << i << "   ";
         output2 << structureSegments[i].unitCells.size();
         output2 << "\n";
         };
      };

   output2 << "#Center of mass information(XYZ coords, no atoms, ABC coordinates, and radii)\n";
   for(unsigned int i = 0; i < structureSegments.size(); i++)
      {
      pair <XYZ,double> COM = structureSegments[i].getCenterOfMass();
      Point p(COM.first.x, COM.first.y, COM.first.z);
      Point pabc = atmnet->xyz_to_abc(atmnet->shiftXYZInUC(p));
      output2 << "X    " << COM.first.x << "  " << COM.first.y << "  " << COM.first.z << "      ";
      output2 << structureSegments[i].nodes.size() << "    ";
      output2 << pabc[0] << "  " << pabc[1] << "  " << pabc[2] << "     ";
      output2 << i << "  " << 2.0*(COM.second-1.5) << "\n";   // 1.5 stands for average radii of atoms
                                                              // 2.0 multiplyer to convert to diameters
      };

   output2.close();
   };
*/


/* Analysis of cages ONLY 
 * for Ismael  */
/*
 if(extendedOutput == true)
   {
   fstream output2;
   output2.open(filenameExtendedOutput, fstream::out);

   for(unsigned int i = 0; i < structureSegments.size(); i++)
      {
      if(structureSegments[i].dimensionality == 0)
        {
        vector < pair <int,XYZ> > cageReconstructedCoords = structureSegments[i].getReconstructedPore();
        
        for(unsigned int j = 0; j< structureSegments[i].reverseIDMappings.size(); j++)
           {
           int atomID = structureSegments[i].reverseIDMappings.find((cageReconstructedCoords.at(j).first))->second;
           output2 << atmnet->atoms.at(atomID).type << "    ";
           output2 << atmnet->atoms.at(atomID).x << "   " << atmnet->atoms.at(atomID).y << "   "
                   << atmnet->atoms.at(atomID).z << "   " ;
           output2 << atmnet->atoms.at(atomID).radius << "   ";
           output2 << structureSegments[i].nodes.at(j).x << "   " << structureSegments[i].nodes.at(j).y << "  "
                   << structureSegments[i].nodes.at(j).z << "   ";
*/
/* DEBUG
           output2 << atmnet->atoms.at(atomID).a_coord << "   "
                   << atmnet->atoms.at(atomID).b_coord << "   " << atmnet->atoms.at(atomID).c_coord << "   "
                   << structureSegments[i].dimensionality << "   " << i << "   ";
         output2 << structureSegments[i].unitCells.size();
*/
/*
           output2 << cageReconstructedCoords.at(j).second.x << "  " << cageReconstructedCoords.at(j).second.y << "  "
                   << cageReconstructedCoords.at(j).second.z << "  ";
          output2 << "  " << i << "  ";
          output2 << "\n";
            };
         };
      };


   output2.close();
   };
*/

 /* Alternative version of the above, which saves multiple copies of molecules that cross boundry */
//getReconstructredPoresWithCrossBoundryCopies

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

   for(unsigned int i = 0; i < structureSegments.size(); i++)
      {
      if(structureSegments[i].dimensionality == 0)
        {
        vector< vector < pair <int,XYZ> > > cagesMultipleCopiesReconstructedCoords = structureSegments[i].getReconstructredPoresWithCrossBoundryCopies();

        vector < pair <int,int> > cageBonds;

        for(unsigned int m = 0; m < cagesMultipleCopiesReconstructedCoords[0].size(); m++)
           for(unsigned int n = m + 1; n < cagesMultipleCopiesReconstructedCoords[0].size(); n++)
              {
              int atomID1 = structureSegments[i].reverseIDMappings.find((cagesMultipleCopiesReconstructedCoords[0].at(m).first))->second;
              int atomID2 = structureSegments[i].reverseIDMappings.find((cagesMultipleCopiesReconstructedCoords[0].at(n).first))->second;

              if(cagesMultipleCopiesReconstructedCoords[0].at(m).second.euclid_dist(cagesMultipleCopiesReconstructedCoords[0].at(n).second)
                     < ( lookupCovRadius(atmnet->atoms.at(atomID1).type) + lookupCovRadius(atmnet->atoms.at(atomID2).type) + 0.45 ))
                     {
                     cageBonds.push_back(pair <int,int> (m,n));
                     //if(i==28) cout << m << "   " << n << endl;
                     };
              };
//        cout << "Molecule: " << i << " Atoms: " << cagesMultipleCopiesReconstructedCoords[0].size() << " Bonds: " << cageBonds.size() << endl;

        for(unsigned int k = 0; k< cagesMultipleCopiesReconstructedCoords.size(); k++)
           {
           /* beging loop over all atoms/to be saved in frmaid format */
/*
           for(unsigned int j = 0; j< structureSegments[i].reverseIDMappings.size(); j++)
              {
              int atomID = structureSegments[i].reverseIDMappings.find((cagesMultipleCopiesReconstructedCoords[k].at(j).first))->second;
              output2 << atmnet->atoms.at(atomID).type << "    ";
              output2 << atmnet->atoms.at(atomID).x << "   " << atmnet->atoms.at(atomID).y << "   "
                      << atmnet->atoms.at(atomID).z << "   " ;
              output2 << atmnet->atoms.at(atomID).radius << "   ";
              output2 << structureSegments[i].nodes.at(j).x << "   " << structureSegments[i].nodes.at(j).y << "  "
                      << structureSegments[i].nodes.at(j).z << "   ";
              output2 << cagesMultipleCopiesReconstructedCoords[k].at(j).second.x << "  " << cagesMultipleCopiesReconstructedCoords[k].at(j).second.y << "  "
                   << cagesMultipleCopiesReconstructedCoords[k].at(j).second.z << "  ";
              output2 << "  " << i << "  " << k << " ";
              output2 << "\n";
              };
 */
           /* ends saving file in frameid format */

           /* beging loop over all atoms in SDF format */

           /* SDF header */
           output2 << i << endl;
           output2 << "Zeomolecule" << endl << endl;
           output2 << "  " << structureSegments[i].reverseIDMappings.size() << " " << cageBonds.size() << " 0     0  0  0  0  0  0999 V2000\n"; 
           for(unsigned int j = 0; j< structureSegments[i].reverseIDMappings.size(); j++)
              {
              int atomID = structureSegments[i].reverseIDMappings.find((cagesMultipleCopiesReconstructedCoords[k].at(j).first))->second;
              output2 << "    ";
              output2 << cagesMultipleCopiesReconstructedCoords[k].at(j).second.x << "  " << cagesMultipleCopiesReconstructedCoords[k].at(j).second.y << "  "
                   << cagesMultipleCopiesReconstructedCoords[k].at(j).second.z << "  ";
              output2 << atmnet->atoms.at(atomID).type << "   0  0  0  0  0  0  0  0  0  0  0  0\n";
              };
           for(unsigned int k = 0; k < cageBonds.size(); k++)
              {
              output2 << cageBonds[k].first << "  " << cageBonds[k].second << " 1 0 0 0 0\n" ;
              };
           output2 << "M  END\n$$$$\n";  
           /* ends saving file in SDF format */

           }; // ends for loop over copies of the segment i (each molecule)
         }; // ends if(structureSegments[i].dimensionality == 0)
      };


   output2.close();
   };




/* Save additional atom statistics */
/*
 if(extendedOutput == true)
   {
   fstream output2;
   output2.open(filenameExtendedOutput, fstream::out);


   int nMetals=0, nCs=0, nHs=0;
   std::map<std::string,int> metalmap;

//  mymap['a']="an element";
   for(unsigned int i=0; i < atmnet->atoms.size(); i++)
      {
      if(atmnet->atoms.at(i).type == "C") nCs++;
      if(atmnet->atoms.at(i).type == "H") nHs++;
      if(isMetal(atmnet->atoms.at(i).type) == true) 
        {
        nMetals++;
        if(metalmap[atmnet->atoms.at(i).type] == 0) metalmap[atmnet->atoms.at(i).type] =1;
         else metalmap[atmnet->atoms.at(i).type] = metalmap[atmnet->atoms.at(i).type] +1;
        };
      };

   output2 << filename << "    nCs: " << nCs << "  nHs: " << nHs << "  nMetals: " << nMetals << " nMetalTypes: " << metalmap.size() << "  ";

   std::map<std::string,int>::iterator it;
   for(it=metalmap.begin(); it!=metalmap.end(); ++it)
      {
      output2 << "  " << (*it).first << " " << (*it).second; 
      };


//   for(auto& x: metalmap) {
//      output2 << "  "  << x.first << " " << x.second;
//      };


   output2 << "\n";
   output2.close();
   };
*/

/* quick fix for Greg */
/*
 cout << "Running experimetnal pruning for Greg, uncomment this routine after use !!!!!!!!!!\n";
 if(extendedOutput == true)
   {
   fstream output2;
   output2.open(filenameExtendedOutput, fstream::out);

   output2 << "Processing: " << filenameExtendedOutput << "\n";
   output2 << "Unit_cell: " << atmnet->a <<"  " <<  atmnet->b <<"  " <<  atmnet->c << "  "
           << atmnet->alpha << "  " << atmnet->beta << "   " << atmnet->gamma << "\n";

   for(unsigned int i = 0; i < structureSegments.size(); i++)
      {
      if(structureSegments[i].dimensionality>2) 
      {
      for(unsigned int j = 0; j< structureSegments[i].reverseIDMappings.size(); j++)
         {
         int atomID = structureSegments[i].reverseIDMappings.find(j)->second;
         output2 << atmnet->atoms.at(atomID).type << "    ";
         output2 << atmnet->atoms.at(atomID).a_coord << "   "
                 << atmnet->atoms.at(atomID).b_coord << "   " << atmnet->atoms.at(atomID).c_coord << "\n";
         };
      };

      };

   output2.close();
   };
*/
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x6d8, %rsp            # imm = 0x6D8
movl %ecx, 0x108(%rsp)
xorps %xmm0, %xmm0
movaps %xmm0, 0x90(%rsp)
xorl %ecx, %ecx
movq %rcx, 0xa0(%rsp)
leaq 0x110(%rsp), %rax
movq %rcx, (%rax)
movl %ecx, 0x8(%rax)
movq %rcx, 0x10(%rax)
movl %ecx, 0x18(%rax)
movq %rcx, 0x20(%rax)
movsd 0x1457f8(%rip), %xmm0   # 0x14f050
movapd %xmm0, %xmm1
divsd 0x8(%rdx), %xmm1
movsd %xmm1, (%rsp)
movapd %xmm0, %xmm1
divsd 0x10(%rdx), %xmm1
movsd %xmm1, 0x8(%rsp)
divsd 0x18(%rdx), %xmm0
movsd %xmm0, 0x10(%rsp)
movq %rsi, 0x1f8(%rsp)
movq 0x2f8(%rdx), %rsi
movq %rdx, 0x18(%rsp)
subq 0x2f0(%rdx), %rsi
movq %rdi, 0x138(%rsp)
sarq $0x3, %rsi
movabsq $-0x79435e50d79435e5, %rcx # imm = 0x86BCA1AF286BCA1B
imulq %rcx, %rsi
movq %rax, %rdi
xorl %edx, %edx
callq 0xed48
movsd (%rsp), %xmm0
ucomisd 0x14578c(%rip), %xmm0   # 0x14f058
movq 0x18(%rsp), %rcx
movq 0x2f0(%rcx), %rax
movq 0x2f8(%rcx), %rcx
jae 0x9b06
movsd 0x8(%rsp), %xmm0
ucomisd 0x145765(%rip), %xmm0   # 0x14f058
jae 0x9b06
movsd 0x10(%rsp), %xmm0
ucomisd 0x145751(%rip), %xmm0   # 0x14f058
jae 0x9b06
cmpq %rax, %rcx
je 0x9a47
movsd 0x14573a(%rip), %xmm0   # 0x14f058
movapd %xmm0, %xmm1
subsd (%rsp), %xmm1
movsd %xmm1, 0x40(%rsp)
movapd %xmm0, %xmm1
subsd 0x8(%rsp), %xmm1
movsd %xmm1, 0x100(%rsp)
subsd 0x10(%rsp), %xmm0
movsd %xmm0, 0xf8(%rsp)
movl $0x1, %r13d
xorl %r12d, %r12d
leaq 0x90(%rsp), %rbx
leaq 0x2b8(%rsp), %r14
leaq 0x110(%rsp), %r15
imulq $0x98, %r12, %rcx
movsd 0x18(%rax,%rcx), %xmm0
movsd (%rsp), %xmm1
ucomisd %xmm0, %xmm1
ja 0x99ca
ucomisd 0x40(%rsp), %xmm0
ja 0x99ca
movsd 0x20(%rax,%rcx), %xmm0
movsd 0x8(%rsp), %xmm1
ucomisd %xmm0, %xmm1
ja 0x99ca
ucomisd 0x100(%rsp), %xmm0
ja 0x99ca
movsd 0x28(%rax,%rcx), %xmm0
movsd 0x10(%rsp), %xmm1
ucomisd %xmm0, %xmm1
ja 0x99ca
ucomisd 0xf8(%rsp), %xmm0
jbe 0x9a10
leal -0x1(%r13), %eax
movl %eax, 0x2b8(%rsp)
movq 0x98(%rsp), %rsi
cmpq 0xa0(%rsp), %rsi
je 0x99f7
movl %eax, (%rsi)
addq $0x4, %rsi
movq %rsi, 0x98(%rsp)
jmp 0x9a02
movq %rbx, %rdi
movq %r14, %rdx
callq 0x1422c
movq %r15, %rdi
movq %r12, %rsi
callq 0xedb6
orq %rdx, (%rax)
movl %r13d, %r12d
movq 0x18(%rsp), %rcx
movq 0x2f0(%rcx), %rax
movq 0x2f8(%rcx), %rcx
subq %rax, %rcx
sarq $0x3, %rcx
movabsq $-0x79435e50d79435e5, %rdx # imm = 0x86BCA1AF286BCA1B
imulq %rdx, %rcx
incl %r13d
cmpq %r12, %rcx
ja 0x9970
movq 0x18d572(%rip), %rdi    # 0x196fc0
leaq 0x1458ff(%rip), %rsi    # 0x14f354
movl $0xf, %edx
callq 0x44e0
movq 0x98(%rsp), %rsi
subq 0x90(%rsp), %rsi
sarq $0x2, %rsi
movq 0x18d546(%rip), %rdi    # 0x196fc0
callq 0x42b0
movq %rax, %rbx
leaq 0x14a0cb(%rip), %rsi    # 0x153b54
movl $0x8, %edx
movq %rax, %rdi
callq 0x44e0
movq 0x18(%rsp), %rax
movq 0x2f8(%rax), %rsi
subq 0x2f0(%rax), %rsi
sarq $0x3, %rsi
movabsq $-0x79435e50d79435e5, %rax # imm = 0x86BCA1AF286BCA1B
imulq %rax, %rsi
movq %rbx, %rdi
callq 0x42b0
movq %rax, %rbx
leaq 0x145897(%rip), %rsi    # 0x14f364
movl $0x47, %edx
movq %rax, %rdi
callq 0x44e0
movsd 0x14556e(%rip), %xmm0   # 0x14f050
movq %rbx, %rdi
callq 0x46b0
movq %rax, %rbx
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x4420
jmp 0x9c0b
cmpq %rax, %rcx
je 0x9b97
xorl %ebx, %ebx
leaq 0x90(%rsp), %r14
leaq 0x2b8(%rsp), %r15
leaq 0x110(%rsp), %r12
movl %ebx, 0x2b8(%rsp)
movq 0x98(%rsp), %rsi
cmpq 0xa0(%rsp), %rsi
je 0x9b52
movl %ebx, (%rsi)
addq $0x4, %rsi
movq %rsi, 0x98(%rsp)
jmp 0x9b5d
movq %r14, %rdi
movq %r15, %rdx
callq 0x1422c
movq %r12, %rdi
movq %rbx, %rsi
callq 0xedb6
orq %rdx, (%rax)
movq 0x18(%rsp), %rcx
movq 0x2f8(%rcx), %rax
subq 0x2f0(%rcx), %rax
incl %ebx
sarq $0x3, %rax
movabsq $-0x79435e50d79435e5, %rcx # imm = 0x86BCA1AF286BCA1B
imulq %rcx, %rax
cmpq %rbx, %rax
ja 0x9b29
movq 0x18d422(%rip), %rdi    # 0x196fc0
leaq 0x145766(%rip), %rsi    # 0x14f30b
movl $0x15, %edx
callq 0x44e0
movq 0x18(%rsp), %rax
movq 0x2f8(%rax), %rsi
subq 0x2f0(%rax), %rsi
sarq $0x3, %rsi
movabsq $-0x79435e50d79435e5, %rax # imm = 0x86BCA1AF286BCA1B
imulq %rax, %rsi
movq 0x18d3e5(%rip), %rdi    # 0x196fc0
callq 0x42b0
movq %rax, %rbx
leaq 0x145737(%rip), %rsi    # 0x14f321
movl $0x32, %edx
movq %rax, %rdi
callq 0x44e0
movq (%rbx), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x4420
movsbl %al, %esi
movq %rbx, %rdi
callq 0x4040
movq %rax, %rdi
callq 0x42c0
leaq 0x158(%rsp), %rdi
callq 0x50e9e
movq 0x18(%rsp), %rcx
movq 0x48(%rcx), %rax
movq %rax, 0x180(%rsp)
movups 0x38(%rcx), %xmm0
movups %xmm0, 0x170(%rsp)
movq 0x60(%rcx), %rax
movq %rax, 0x198(%rsp)
movups 0x50(%rcx), %xmm0
movups %xmm0, 0x188(%rsp)
movq 0x78(%rcx), %rax
movq %rax, 0x1b0(%rsp)
movupd 0x68(%rcx), %xmm0
movupd %xmm0, 0x1a0(%rsp)
movq 0x2f0(%rcx), %rax
cmpq %rax, 0x2f8(%rcx)
je 0x9d9a
xorl %ebx, %ebx
leaq 0x248(%rsp), %r13
leaq 0x238(%rsp), %r14
leaq 0x2b8(%rsp), %r15
leaq 0x158(%rsp), %r12
imulq $0x98, %rbx, %rcx
movsd (%rax,%rcx), %xmm0
movsd %xmm0, (%rsp)
movsd 0x8(%rax,%rcx), %xmm0
movsd %xmm0, 0x8(%rsp)
movsd 0x10(%rax,%rcx), %xmm0
movsd %xmm0, 0x40(%rsp)
movq %r13, 0x238(%rsp)
movq 0x40(%rax,%rcx), %rsi
movq 0x48(%rax,%rcx), %rdx
addq %rsi, %rdx
movq %r14, %rdi
callq 0xf32a
movq %r14, %rdi
callq 0x2214b
movapd %xmm0, %xmm3
movq %r15, %rdi
movl %ebx, %esi
movsd (%rsp), %xmm0
movsd 0x8(%rsp), %xmm1
movsd 0x40(%rsp), %xmm2
movl $0x1, %edx
callq 0x50c7c
movq %r12, %rdi
movq %r15, %rsi
callq 0x14308
movq 0x2d8(%rsp), %rdi
testq %rdi, %rdi
je 0x9d4a
movq 0x2e8(%rsp), %rsi
subq %rdi, %rsi
callq 0x4470
movq 0x238(%rsp), %rdi
cmpq %r13, %rdi
je 0x9d67
movq 0x248(%rsp), %rsi
incq %rsi
callq 0x4470
incl %ebx
movq 0x18(%rsp), %rcx
movq 0x2f0(%rcx), %rax
movq 0x2f8(%rcx), %rcx
subq %rax, %rcx
sarq $0x3, %rcx
movabsq $-0x79435e50d79435e5, %rdx # imm = 0x86BCA1AF286BCA1B
imulq %rdx, %rcx
cmpq %rbx, %rcx
ja 0x9cb0
movq 0x158(%rsp), %rax
cmpq %rax, 0x160(%rsp)
je 0xa57e
leaq 0x170(%rsp), %r14
xorl %r13d, %r13d
movl $0x2, 0xb4(%rsp)
leaq 0x4c8(%rsp), %rdi
movq $0x0, 0x10(%rsp)
leaq (,%r13,8), %rcx
addq %r13, %rcx
movsd 0x8(%rax,%rcx,8), %xmm0
movsd 0x10(%rax,%rcx,8), %xmm1
movq %rcx, 0x8(%rsp)
movsd 0x18(%rax,%rcx,8), %xmm2
callq 0x85982
movq 0x10(%rsp), %rax
incl %eax
movq %rax, 0xf0(%rsp)
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
movq %r13, 0x40(%rsp)
xorps %xmm0, %xmm0
cvtsi2sd %eax, %xmm0
movsd %xmm0, 0x200(%rsp)
movl $0xffffffff, %ecx       # imm = 0xFFFFFFFF
movl %eax, 0xb8(%rsp)
movl %ecx, 0xbc(%rsp)
movl %ecx, %edx
orl %eax, %edx
movl %edx, 0x10c(%rsp)
xorps %xmm0, %xmm0
cvtsi2sd %ecx, %xmm0
movsd %xmm0, 0xf8(%rsp)
movl $0xffffffff, %ebx       # imm = 0xFFFFFFFF
movl 0x10c(%rsp), %eax
orl %ebx, %eax
movl %ebx, 0x4c(%rsp)
je 0xa175
leaq 0x110(%rsp), %rdi
movq %r13, %rsi
callq 0xedb6
testq %rdx, (%rax)
je 0xa4fc
movq 0x90(%rsp), %rax
cmpq %rax, 0x98(%rsp)
je 0xa4fc
xorps %xmm0, %xmm0
cvtsi2sdl 0x4c(%rsp), %xmm0
movsd %xmm0, 0x100(%rsp)
movl $0x1, %ebx
xorl %ecx, %ecx
movl (%rax,%rcx,4), %r12d
movq 0x158(%rsp), %rax
movq 0x160(%rsp), %rdx
subq %rax, %rdx
sarq $0x3, %rdx
movabsq $-0x71c71c71c71c71c7, %rcx # imm = 0x8E38E38E38E38E39
imulq %rcx, %rdx
cmpq %r12, %rdx
jbe 0xb12f
leaq (%r12,%r12,8), %r15
movsd 0x8(%rax,%r15,8), %xmm0
movsd 0x10(%rax,%r15,8), %xmm1
movsd 0x18(%rax,%r15,8), %xmm2
leaq 0xc0(%rsp), %rdi
callq 0x85982
movq 0x10(%r14), %rax
movq %rax, 0x30(%rsp)
movups (%r14), %xmm0
movaps %xmm0, 0x20(%rsp)
movq 0x28(%r14), %rax
movq %rax, 0x60(%rsp)
movups 0x18(%r14), %xmm0
movaps %xmm0, 0x50(%rsp)
movq 0x40(%r14), %rax
movq %rax, 0x80(%rsp)
movups 0x30(%r14), %xmm0
movaps %xmm0, 0x70(%rsp)
leaq 0x2a0(%rsp), %rbp
movq %rbp, %rdi
leaq 0x20(%rsp), %rsi
movsd 0x200(%rsp), %xmm0
callq 0x85a34
leaq 0x258(%rsp), %rdi
leaq 0xc0(%rsp), %rsi
movq %rbp, %rdx
callq 0x85dd4
leaq 0x288(%rsp), %rbp
movq %rbp, %rdi
leaq 0x50(%rsp), %rsi
movsd 0xf8(%rsp), %xmm0
callq 0x85a34
leaq 0x140(%rsp), %rdi
leaq 0x258(%rsp), %rsi
movq %rbp, %rdx
callq 0x85dd4
leaq 0x270(%rsp), %rbp
movq %rbp, %rdi
leaq 0x70(%rsp), %rsi
movsd 0x100(%rsp), %xmm0
callq 0x85a34
leaq 0x2b8(%rsp), %rdi
leaq 0x140(%rsp), %rsi
movq %rbp, %rdx
callq 0x85dd4
movq 0x2c8(%rsp), %rax
movq %rax, 0xd0(%rsp)
movups 0x2b8(%rsp), %xmm0
movaps %xmm0, 0xc0(%rsp)
movsd 0x4c8(%rsp), %xmm0
movsd 0x4d0(%rsp), %xmm1
movsd 0x4d8(%rsp), %xmm2
movsd 0xc0(%rsp), %xmm3
movsd 0xc8(%rsp), %xmm4
movsd 0xd0(%rsp), %xmm5
callq 0x868fa
movsd %xmm0, (%rsp)
movq 0x158(%rsp), %rax
movq 0x160(%rsp), %rdx
subq %rax, %rdx
sarq $0x3, %rdx
movabsq $-0x71c71c71c71c71c7, %rcx # imm = 0x8E38E38E38E38E39
imulq %rcx, %rdx
cmpq %r13, %rdx
jbe 0xb11e
cmpq %r12, %rdx
jbe 0xb11b
movq 0x8(%rsp), %rcx
leaq (%rax,%rcx,8), %r13
movsd 0x38(%r13), %xmm0
addsd 0x38(%rax,%r15,8), %xmm0
addsd 0x144fc1(%rip), %xmm0   # 0x14f060
ucomisd (%rsp), %xmm0
jbe 0xa147
leaq 0x208(%rsp), %rdi
movl 0xb8(%rsp), %esi
movl 0xbc(%rsp), %edx
movl 0x4c(%rsp), %ecx
callq 0x509d8
movq 0x208(%rsp), %rcx
movl 0x210(%rsp), %r8d
leaq 0x2b8(%rsp), %rdi
movq 0x10(%rsp), %rsi
movl %r12d, %edx
movsd (%rsp), %xmm0
movsd 0x144f72(%rip), %xmm1   # 0x14f068
callq 0x50b50
movq 0x28(%r13), %rsi
cmpq 0x30(%r13), %rsi
je 0xa133
movq 0x2d8(%rsp), %rax
movq %rax, 0x20(%rsi)
movupd 0x2b8(%rsp), %xmm0
movupd 0x2c8(%rsp), %xmm1
movupd %xmm1, 0x10(%rsi)
movupd %xmm0, (%rsi)
addq $0x28, 0x28(%r13)
jmp 0xa147
addq $0x20, %r13
movq %r13, %rdi
leaq 0x2b8(%rsp), %rdx
callq 0x145aa
movl %ebx, %ecx
movq 0x90(%rsp), %rax
movq 0x98(%rsp), %rdx
subq %rax, %rdx
sarq $0x2, %rdx
incl %ebx
cmpq %rcx, %rdx
movq 0x40(%rsp), %r13
ja 0x9eb5
jmp 0xa4fc
movq 0x158(%rsp), %rax
movq 0x160(%rsp), %rcx
subq %rax, %rcx
sarq $0x3, %rcx
movabsq $-0x71c71c71c71c71c7, %rdx # imm = 0x8E38E38E38E38E39
imulq %rdx, %rcx
cmpq 0xf0(%rsp), %rcx
jbe 0xa4fc
movl 0xb4(%rsp), %ecx
movl %ecx, %ebx
movq 0xf0(%rsp), %r12
leaq (%r12,%r12,8), %r15
movsd 0x8(%rax,%r15,8), %xmm0
movsd 0x10(%rax,%r15,8), %xmm1
movsd 0x18(%rax,%r15,8), %xmm2
leaq 0xc0(%rsp), %rdi
callq 0x85982
movq 0x10(%r14), %rax
movq %rax, 0x30(%rsp)
movups (%r14), %xmm0
movaps %xmm0, 0x20(%rsp)
movq 0x28(%r14), %rax
movq %rax, 0x60(%rsp)
movups 0x18(%r14), %xmm0
movaps %xmm0, 0x50(%rsp)
movq 0x40(%r14), %rax
movq %rax, 0x80(%rsp)
movupd 0x30(%r14), %xmm0
movapd %xmm0, 0x70(%rsp)
xorpd %xmm0, %xmm0
leaq 0x2a0(%rsp), %rbp
movq %rbp, %rdi
leaq 0x20(%rsp), %rsi
callq 0x85a34
leaq 0x258(%rsp), %rdi
leaq 0xc0(%rsp), %rsi
movq %rbp, %rdx
callq 0x85dd4
xorpd %xmm0, %xmm0
leaq 0x288(%rsp), %rbp
movq %rbp, %rdi
leaq 0x50(%rsp), %rsi
callq 0x85a34
leaq 0x140(%rsp), %rdi
leaq 0x258(%rsp), %rsi
movq %rbp, %rdx
callq 0x85dd4
xorpd %xmm0, %xmm0
leaq 0x270(%rsp), %rbp
movq %rbp, %rdi
leaq 0x70(%rsp), %rsi
callq 0x85a34
leaq 0x2b8(%rsp), %rdi
leaq 0x140(%rsp), %rsi
movq %rbp, %rdx
callq 0x85dd4
movq 0x2c8(%rsp), %rax
movq %rax, 0xd0(%rsp)
movups 0x2b8(%rsp), %xmm0
movaps %xmm0, 0xc0(%rsp)
movsd 0x4c8(%rsp), %xmm0
movsd 0x4d0(%rsp), %xmm1
movsd 0x4d8(%rsp), %xmm2
movsd 0xc0(%rsp), %xmm3
movsd 0xc8(%rsp), %xmm4
movsd 0xd0(%rsp), %xmm5
callq 0x868fa
movsd %xmm0, (%rsp)
movq 0x158(%rsp), %rax
movq 0x160(%rsp), %rdx
subq %rax, %rdx
sarq $0x3, %rdx
movabsq $-0x71c71c71c71c71c7, %rcx # imm = 0x8E38E38E38E38E39
imulq %rcx, %rdx
cmpq %r13, %rdx
jbe 0xb140
cmpq %r12, %rdx
jbe 0xb143
movq 0x8(%rsp), %rcx
leaq (%rax,%rcx,8), %r13
movsd 0x38(%r13), %xmm0
addsd 0x38(%rax,%r15,8), %xmm0
addsd 0x144cfc(%rip), %xmm0   # 0x14f060
ucomisd (%rsp), %xmm0
jbe 0xa4c4
leaq 0x228(%rsp), %rdi
xorl %esi, %esi
xorl %edx, %edx
xorl %ecx, %ecx
callq 0x509d8
leal -0x1(%rbx), %ebp
movq 0x228(%rsp), %rcx
movl 0x230(%rsp), %r8d
leaq 0x2b8(%rsp), %rdi
movq 0x10(%rsp), %rsi
movl %ebp, %edx
movsd (%rsp), %xmm0
movsd 0x144cb7(%rip), %xmm1   # 0x14f068
callq 0x50b50
movq 0x28(%r13), %rsi
cmpq 0x30(%r13), %rsi
je 0xa3ee
movq 0x2d8(%rsp), %rax
movq %rax, 0x20(%rsi)
movupd 0x2b8(%rsp), %xmm0
movupd 0x2c8(%rsp), %xmm1
movupd %xmm1, 0x10(%rsi)
movupd %xmm0, (%rsi)
addq $0x28, 0x28(%r13)
jmp 0xa402
addq $0x20, %r13
movq %r13, %rdi
leaq 0x2b8(%rsp), %rdx
callq 0x145aa
movq 0x158(%rsp), %r13
movq 0x160(%rsp), %rdx
subq %r13, %rdx
sarq $0x3, %rdx
movabsq $-0x71c71c71c71c71c7, %rax # imm = 0x8E38E38E38E38E39
imulq %rax, %rdx
cmpq %r12, %rdx
jbe 0xb143
leaq 0x218(%rsp), %rdi
xorl %esi, %esi
xorl %edx, %edx
xorl %ecx, %ecx
callq 0x509d8
movq 0x218(%rsp), %rcx
movl 0x220(%rsp), %r8d
leaq 0x2b8(%rsp), %rdi
movl %ebp, %esi
movq 0x10(%rsp), %rdx
movsd (%rsp), %xmm0
movsd 0x144bf9(%rip), %xmm1   # 0x14f068
callq 0x50b50
leaq 0x20(,%r15,8), %rdi
addq %r13, %rdi
movq 0x8(%rdi), %rsi
cmpq 0x10(%rdi), %rsi
je 0xa4b7
movq 0x2d8(%rsp), %rax
movq %rax, 0x20(%rsi)
movupd 0x2b8(%rsp), %xmm0
movupd 0x2c8(%rsp), %xmm1
movupd %xmm1, 0x10(%rsi)
movupd %xmm0, (%rsi)
addq $0x28, 0x8(%rdi)
jmp 0xa4c4
leaq 0x2b8(%rsp), %rdx
callq 0x145aa
movl %ebx, %r12d
movq 0x158(%rsp), %rax
movq 0x160(%rsp), %rcx
subq %rax, %rcx
sarq $0x3, %rcx
movabsq $-0x71c71c71c71c71c7, %rdx # imm = 0x8E38E38E38E38E39
imulq %rdx, %rcx
incl %ebx
cmpq %r12, %rcx
movq 0x40(%rsp), %r13
ja 0xa1b9
movl 0x4c(%rsp), %ebx
incl %ebx
cmpl $0x2, %ebx
movl 0xbc(%rsp), %ecx
jne 0x9e5a
incl %ecx
cmpl $0x2, %ecx
movl 0xb8(%rsp), %eax
jne 0x9e33
incl %eax
cmpl $0x2, %eax
jne 0x9e17
movq 0x158(%rsp), %rax
movq 0x160(%rsp), %rcx
subq %rax, %rcx
sarq $0x3, %rcx
movabsq $-0x71c71c71c71c71c7, %rdx # imm = 0x8E38E38E38E38E39
imulq %rdx, %rcx
incl 0xb4(%rsp)
movq 0xf0(%rsp), %rsi
movq %rsi, %r13
movl %esi, %edx
movq %rdx, 0x10(%rsp)
cmpq %rsi, %rcx
leaq 0x4c8(%rsp), %rdi
ja 0x9dd7
xorl %eax, %eax
leaq 0xc0(%rsp), %rsi
movq %rax, (%rsi)
movl %eax, 0x8(%rsi)
movq %rax, 0x10(%rsi)
movl %eax, 0x18(%rsi)
movq %rax, 0x20(%rsi)
leaq 0x20(%rsp), %rdx
movq %rax, 0x10(%rdx)
xorpd %xmm0, %xmm0
movapd %xmm0, (%rdx)
leaq 0x158(%rsp), %rdi
callq 0x70bc6
leaq 0x2b8(%rsp), %rdi
callq 0x4520
leaq 0x2b8(%rsp), %rdi
movq 0x138(%rsp), %rsi
movl $0x10, %edx
callq 0x43d0
movq 0x20(%rsp), %rax
movq 0x28(%rsp), %rcx
subq %rax, %rcx
je 0xa652
sarq $0x4, %rcx
movabsq $-0x79435e50d79435e5, %rdx # imm = 0x86BCA1AF286BCA1B
imulq %rdx, %rcx
addq $0x108, %rax            # imm = 0x108
xorl %r14d, %r14d
movl $0x1, %edx
xorl %r15d, %r15d
xorl %r12d, %r12d
xorl %ebp, %ebp
movl (%rax), %esi
cmpl $0x1, %esi
adcl $0x0, %ebp
xorl %edi, %edi
cmpl $0x1, %esi
sete %dil
addl %edi, %r12d
xorl %edi, %edi
cmpl $0x2, %esi
sete %dil
addl %edi, %r15d
xorl %edi, %edi
cmpl $0x3, %esi
sete %dil
addl %edi, %r14d
movl %edx, %esi
addq $0x130, %rax            # imm = 0x130
incl %edx
cmpq %rsi, %rcx
ja 0xa615
jmp 0xa65d
xorl %ebp, %ebp
xorl %r12d, %r12d
xorl %r15d, %r15d
xorl %r14d, %r14d
leaq 0x2c8(%rsp), %rbx
movq 0x138(%rsp), %r13
testq %r13, %r13
je 0xa68a
movq %r13, %rdi
callq 0x41e0
movq %rbx, %rdi
movq %r13, %rsi
movq %rax, %rdx
callq 0x44e0
jmp 0xa6a9
movq 0x2c8(%rsp), %rax
movq -0x18(%rax), %rax
leaq (%rbx,%rax), %rdi
movl 0x2e8(%rsp,%rax), %esi
orl $0x1, %esi
callq 0x4710
leaq 0x144dde(%rip), %rsi    # 0x14f48e
movl $0x3, %edx
movq %rbx, %rdi
callq 0x44e0
leaq 0x4c8(%rsp), %rdi
movq 0x18(%rsp), %rsi
callq 0x54fa4
movq 0x4c8(%rsp), %rsi
movq 0x4d0(%rsp), %rdx
movq %rbx, %rdi
callq 0x44e0
movq %rax, %r13
leaq 0x144d9d(%rip), %rsi    # 0x14f48e
movl $0x3, %edx
movq %rax, %rdi
callq 0x44e0
movq 0x28(%rsp), %rsi
subq 0x20(%rsp), %rsi
sarq $0x4, %rsi
movabsq $-0x79435e50d79435e5, %rax # imm = 0x86BCA1AF286BCA1B
imulq %rax, %rsi
movq %r13, %rdi
callq 0x42b0
movq %rax, %r13
leaq 0x144c80(%rip), %rsi    # 0x14f3ac
movl $0xb, %edx
movq %rax, %rdi
callq 0x44e0
movq 0x28(%rsp), %rsi
subq 0x20(%rsp), %rsi
sarq $0x4, %rsi
movabsq $-0x79435e50d79435e5, %rax # imm = 0x86BCA1AF286BCA1B
imulq %rax, %rsi
movslq %ebp, %rax
subq %rax, %rsi
movq %r13, %rdi
callq 0x42b0
movq %rax, %r13
leaq 0x144c4b(%rip), %rsi    # 0x14f3b8
movl $0x18, %edx
movq %rax, %rdi
callq 0x44e0
movq %r13, %rdi
movl %r12d, %esi
callq 0x4750
movq %rax, %r12
leaq 0x14ccf7(%rip), %rsi    # 0x157486
movl $0x1, %edx
movq %rax, %rdi
callq 0x44e0
movq %r12, %rdi
movl %r15d, %esi
callq 0x4750
movq %rax, %r15
leaq 0x14ccd5(%rip), %rsi    # 0x157486
movl $0x1, %edx
movq %rax, %rdi
callq 0x44e0
movq %r15, %rdi
movl %r14d, %esi
callq 0x4750
movq %rax, %r14
leaq 0x144bfe(%rip), %rsi    # 0x14f3d1
movl $0x8, %edx
movq %rax, %rdi
callq 0x44e0
movq %r14, %rdi
movl %ebp, %esi
callq 0x4750
leaq 0x144be9(%rip), %rsi    # 0x14f3da
movl $0x3a, %edx
movq %rax, %rdi
callq 0x44e0
leaq 0x4d8(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0xa81f
movq 0x4d8(%rsp), %rsi
incq %rsi
callq 0x4470
movq 0x20(%rsp), %rax
cmpq %rax, 0x28(%rsp)
je 0xa88b
movl $0x1, %ebp
xorl %ecx, %ecx
leaq 0x14cc4d(%rip), %r14    # 0x157486
imulq $0x130, %rcx, %rcx      # imm = 0x130
movl 0x108(%rax,%rcx), %esi
testl %esi, %esi
jle 0xa863
movq %rbx, %rdi
callq 0x4750
movl $0x1, %edx
movq %rax, %rdi
movq %r14, %rsi
callq 0x44e0
movl %ebp, %ecx
movq 0x20(%rsp), %rax
movq 0x28(%rsp), %rdx
subq %rax, %rdx
sarq $0x4, %rdx
movabsq $-0x79435e50d79435e5, %rsi # imm = 0x86BCA1AF286BCA1B
imulq %rsi, %rdx
incl %ebp
cmpq %rcx, %rdx
ja 0xa839
leaq 0x14ac9c(%rip), %rsi    # 0x15552e
movl $0x1, %edx
movq %rbx, %rdi
callq 0x44e0
leaq 0x2b8(%rsp), %rdi
callq 0x4090
cmpb $0x0, 0x108(%rsp)
je 0xb03e
leaq 0x4c8(%rsp), %rdi
callq 0x4520
leaq 0x4c8(%rsp), %rdi
movq 0x1f8(%rsp), %rsi
movl $0x10, %edx
callq 0x43d0
movq 0x20(%rsp), %rsi
cmpq %rsi, 0x28(%rsp)
je 0xb024
leaq 0x1e8(%rsp), %r12
leaq 0x1c8(%rsp), %rbp
xorl %edx, %edx
imulq $0x130, %rdx, %rax      # imm = 0x130
cmpl $0x0, 0x108(%rsi,%rax)
jne 0xaffa
movq %rdx, 0x10(%rsp)
movq %rax, 0x8(%rsp)
addq %rax, %rsi
leaq 0x50(%rsp), %rdi
callq 0x72174
xorpd %xmm0, %xmm0
movapd %xmm0, 0x70(%rsp)
movq $0x0, 0x80(%rsp)
movq 0x50(%rsp), %rax
movq 0x8(%rax), %rcx
cmpq (%rax), %rcx
je 0xabc8
xorl %ebx, %ebx
leal 0x1(%rbx), %ecx
movq 0x50(%rsp), %rax
movq (%rax), %rsi
movq 0x8(%rax), %rdx
subq %rsi, %rdx
sarq $0x5, %rdx
movl %ecx, %r15d
cmpq %rcx, %rdx
jbe 0xabad
cmpq %rbx, %rdx
jbe 0xb19b
movq 0x20(%rsp), %rax
movq %rbx, %rdi
shlq $0x5, %rdi
addq %rsi, %rdi
movq 0x8(%rsp), %rdx
addq %rdx, %rax
addq $0x38, %rax
movq 0x8(%rax), %rdx
movq %rax, %r9
testq %rdx, %rdx
je 0xa9cd
movl (%rdi), %r8d
movq %rdx, %r10
movq %rax, %r9
xorl %r11d, %r11d
cmpl %r8d, 0x20(%r10)
setl %r11b
cmovgeq %r10, %r9
movq 0x10(%r10,%r11,8), %r10
testq %r10, %r10
jne 0xa9b4
movq %rax, %r8
cmpq %rax, %r9
je 0xa9e3
movl (%rdi), %r8d
cmpl 0x20(%r9), %r8d
cmovlq %rax, %r9
movq %r9, %r8
shlq $0x5, %rcx
addq %rcx, %rsi
movq %rax, %rcx
testq %rdx, %rdx
je 0xaa11
movl (%rsi), %r9d
movq %rax, %rcx
xorl %r10d, %r10d
cmpl %r9d, 0x20(%rdx)
setl %r10b
cmovgeq %rdx, %rcx
movq 0x10(%rdx,%r10,8), %rdx
testq %rdx, %rdx
jne 0xa9f8
cmpq %rax, %rcx
je 0xaa1f
movl (%rsi), %edx
cmpl 0x20(%rcx), %edx
cmovgeq %rcx, %rax
movslq 0x24(%r8), %r13
movslq 0x24(%rax), %r14
addq $0x8, %rdi
addq $0x8, %rsi
callq 0x85e28
movsd %xmm0, 0x40(%rsp)
movq 0x18(%rsp), %rcx
movq 0x2f0(%rcx), %rax
movq 0x2f8(%rcx), %rdx
subq %rax, %rdx
sarq $0x3, %rdx
movabsq $-0x79435e50d79435e5, %rcx # imm = 0x86BCA1AF286BCA1B
imulq %rcx, %rdx
cmpq %r13, %rdx
jbe 0xb18a
imulq $0x98, %r13, %rcx
movq %r12, 0x1d8(%rsp)
movq 0x40(%rax,%rcx), %rsi
movq 0x48(%rax,%rcx), %rdx
addq %rsi, %rdx
leaq 0x1d8(%rsp), %rdi
callq 0xf32a
leaq 0x1d8(%rsp), %rdi
callq 0x2214b
movsd %xmm0, (%rsp)
movq 0x18(%rsp), %rcx
movq 0x2f0(%rcx), %rax
movq 0x2f8(%rcx), %rdx
subq %rax, %rdx
sarq $0x3, %rdx
movabsq $-0x79435e50d79435e5, %rcx # imm = 0x86BCA1AF286BCA1B
imulq %rcx, %rdx
cmpq %r14, %rdx
jbe 0xb179
imulq $0x98, %r14, %rcx
movq %rbp, 0x1b8(%rsp)
movq 0x40(%rax,%rcx), %rsi
movq 0x48(%rax,%rcx), %rdx
addq %rsi, %rdx
leaq 0x1b8(%rsp), %rdi
callq 0xf32a
leaq 0x1b8(%rsp), %rdi
callq 0x2214b
movsd (%rsp), %xmm1
addsd %xmm0, %xmm1
addsd 0x144552(%rip), %xmm1   # 0x14f070
movsd %xmm1, (%rsp)
movq 0x1b8(%rsp), %rdi
cmpq %rbp, %rdi
je 0xab40
movq 0x1c8(%rsp), %rsi
incq %rsi
callq 0x4470
movq 0x1d8(%rsp), %rdi
cmpq %r12, %rdi
je 0xab5d
movq 0x1e8(%rsp), %rsi
incq %rsi
callq 0x4470
movsd (%rsp), %xmm0
ucomisd 0x40(%rsp), %xmm0
jbe 0xab8b
movl %ebx, 0x140(%rsp)
movl %r15d, 0x144(%rsp)
leaq 0x70(%rsp), %rdi
leaq 0x140(%rsp), %rsi
callq 0x1474e
incl %r15d
movq 0x50(%rsp), %rax
movq (%rax), %rsi
movq 0x8(%rax), %rdx
subq %rsi, %rdx
sarq $0x5, %rdx
movq %r15, %rcx
cmpq %r15, %rdx
ja 0xa97b
incl %ebx
movq 0x50(%rsp), %rax
movq 0x8(%rax), %rcx
subq (%rax), %rcx
sarq $0x5, %rcx
cmpq %rbx, %rcx
ja 0xa959
movq 0x58(%rsp), %rax
cmpq 0x50(%rsp), %rax
je 0xafd1
xorl %r13d, %r13d
leaq 0x4d8(%rsp), %rdi
movq 0x10(%rsp), %rsi
callq 0x42b0
movq %rax, %rbx
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x4420
movsbl %al, %esi
movq %rbx, %rdi
callq 0x4040
movq %rax, %rdi
callq 0x42c0
movl $0xb, %edx
leaq 0x4d8(%rsp), %rdi
leaq 0x1447ea(%rip), %rsi    # 0x14f415
callq 0x44e0
movq 0x4d8(%rsp), %rax
movq -0x18(%rax), %rdi
leaq 0x4d8(%rsp), %rax
addq %rax, %rdi
movl $0xa, %esi
callq 0x4420
movsbl %al, %esi
leaq 0x4d8(%rsp), %rdi
callq 0x4040
movq %rax, %rdi
callq 0x42c0
movq %rax, %rbx
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x4420
movsbl %al, %esi
movq %rbx, %rdi
callq 0x4040
movq %rax, %rdi
callq 0x42c0
movl $0x2, %edx
leaq 0x4d8(%rsp), %rdi
leaq 0x1447e8(%rip), %rsi    # 0x14f48f
callq 0x44e0
movq 0x20(%rsp), %rax
movq 0x8(%rsp), %rcx
movq 0x58(%rax,%rcx), %rsi
leaq 0x4d8(%rsp), %rdi
callq 0x42b0
movq %rax, %rbx
movl $0x1, %edx
movq %rax, %rdi
leaq 0x14c7ac(%rip), %rsi    # 0x157486
callq 0x44e0
movq 0x78(%rsp), %rsi
subq 0x70(%rsp), %rsi
sarq $0x3, %rsi
movq %rbx, %rdi
callq 0x42b0
movl $0x21, %edx
movq %rax, %rdi
leaq 0x14471d(%rip), %rsi    # 0x14f421
callq 0x44e0
movq 0x20(%rsp), %rax
movq 0x8(%rsp), %rcx
cmpq $0x0, 0x58(%rax,%rcx)
je 0xaf03
movq 0x8(%rsp), %rcx
addq %rcx, %rax
addq $0x30, %rax
xorl %ebp, %ebp
movq 0x50(%rsp), %rdx
leaq (,%r13,2), %r15
addq %r13, %r15
movq (%rdx,%r15,8), %rcx
movq 0x8(%rdx,%r15,8), %rdx
subq %rcx, %rdx
sarq $0x5, %rdx
cmpq %rbp, %rdx
jbe 0xb168
movq %rbp, %rbx
shlq $0x5, %rbx
addq %rbx, %rcx
movq 0x10(%rax), %rsi
addq $0x8, %rax
movq %rax, %rdx
testq %rsi, %rsi
je 0xad8d
movl (%rcx), %edi
movq %rax, %rdx
xorl %r8d, %r8d
cmpl %edi, 0x20(%rsi)
setl %r8b
cmovgeq %rsi, %rdx
movq 0x10(%rsi,%r8,8), %rsi
testq %rsi, %rsi
jne 0xad75
cmpq %rax, %rdx
je 0xad9b
movl (%rcx), %ecx
cmpl 0x20(%rdx), %ecx
cmovgeq %rdx, %rax
movslq 0x24(%rax), %r12
movl $0x4, %edx
leaq 0x4d8(%rsp), %rdi
leaq 0x1446da(%rip), %rsi    # 0x14f48d
callq 0x44e0
movq 0x50(%rsp), %rcx
movq (%rcx,%r15,8), %rax
movq 0x8(%rcx,%r15,8), %rdx
subq %rax, %rdx
sarq $0x5, %rdx
cmpq %rbp, %rdx
jbe 0xb157
movsd 0x8(%rax,%rbx), %xmm0
leaq 0x4d8(%rsp), %rdi
callq 0x46b0
movq %rax, %r14
movl $0x2, %edx
movq %rax, %rdi
leaq 0x144694(%rip), %rsi    # 0x14f48f
callq 0x44e0
movq 0x50(%rsp), %rcx
movq (%rcx,%r15,8), %rax
movq 0x8(%rcx,%r15,8), %rdx
subq %rax, %rdx
sarq $0x5, %rdx
cmpq %rbp, %rdx
jbe 0xb157
movsd 0x10(%rax,%rbx), %xmm0
movq %r14, %rdi
callq 0x46b0
movq %rax, %r14
movl $0x2, %edx
movq %rax, %rdi
leaq 0x144651(%rip), %rsi    # 0x14f48f
callq 0x44e0
movq 0x50(%rsp), %rcx
movq (%rcx,%r15,8), %rax
movq 0x8(%rcx,%r15,8), %rdx
subq %rax, %rdx
sarq $0x5, %rdx
cmpq %rbp, %rdx
jbe 0xb157
movsd 0x18(%rax,%rbx), %xmm0
movq %r14, %rdi
callq 0x46b0
movl $0x2, %edx
movq %rax, %rdi
leaq 0x144611(%rip), %rsi    # 0x14f48f
callq 0x44e0
movq 0x18(%rsp), %rcx
movq 0x2f0(%rcx), %rax
movq 0x2f8(%rcx), %rdx
subq %rax, %rdx
sarq $0x3, %rdx
movabsq $-0x79435e50d79435e5, %rcx # imm = 0x86BCA1AF286BCA1B
imulq %rcx, %rdx
cmpq %r12, %rdx
jbe 0xb154
imulq $0x98, %r12, %rcx
movq 0x40(%rax,%rcx), %rsi
movq 0x48(%rax,%rcx), %rdx
leaq 0x4d8(%rsp), %rdi
callq 0x44e0
movl $0x26, %edx
movq %rax, %rdi
leaq 0x144562(%rip), %rsi    # 0x14f443
callq 0x44e0
incl %ebp
movq 0x20(%rsp), %rax
movq 0x8(%rsp), %rcx
addq %rcx, %rax
addq $0x30, %rax
cmpq %rbp, 0x28(%rax)
ja 0xad2d
movq 0x70(%rsp), %rax
cmpq %rax, 0x78(%rsp)
je 0xaf80
movl $0x1, %ebp
xorl %r14d, %r14d
movl (%rax,%r14,8), %esi
leaq 0x4d8(%rsp), %rdi
callq 0x4750
movq %rax, %rbx
movl $0x2, %edx
movq %rax, %rdi
leaq 0x144555(%rip), %rsi    # 0x14f48f
callq 0x44e0
movq 0x70(%rsp), %rax
movl 0x4(%rax,%r14,8), %esi
movq %rbx, %rdi
callq 0x4750
movl $0xb, %edx
movq %rax, %rdi
leaq 0x14450a(%rip), %rsi    # 0x14f46a
callq 0x44e0
movl %ebp, %r14d
movq 0x70(%rsp), %rax
movq 0x78(%rsp), %rcx
subq %rax, %rcx
sarq $0x3, %rcx
incl %ebp
cmpq %r14, %rcx
ja 0xaf17
movl $0xc, %edx
leaq 0x4d8(%rsp), %rdi
leaq 0x1444e2(%rip), %rsi    # 0x14f476
callq 0x44e0
leaq 0x1e8(%rsp), %r12
leaq 0x1c8(%rsp), %rbp
movq 0x58(%rsp), %rax
subq 0x50(%rsp), %rax
incl %r13d
sarq $0x3, %rax
movabsq $-0x5555555555555555, %rcx # imm = 0xAAAAAAAAAAAAAAAB
imulq %rcx, %rax
cmpq %r13, %rax
ja 0xabdb
movq 0x70(%rsp), %rdi
testq %rdi, %rdi
je 0xafeb
movq 0x80(%rsp), %rsi
subq %rdi, %rsi
callq 0x4470
leaq 0x50(%rsp), %rdi
callq 0xee1c
movq 0x10(%rsp), %rdx
incl %edx
movq 0x20(%rsp), %rsi
movq 0x28(%rsp), %rax
subq %rsi, %rax
sarq $0x4, %rax
movabsq $-0x79435e50d79435e5, %rcx # imm = 0x86BCA1AF286BCA1B
imulq %rcx, %rax
cmpq %rdx, %rax
ja 0xa903
leaq 0x4c8(%rsp), %rdi
callq 0x4090
leaq 0x4c8(%rsp), %rdi
callq 0x4110
leaq 0x2b8(%rsp), %rdi
callq 0x4110
leaq 0x20(%rsp), %rdi
callq 0xee6a
movq 0xc0(%rsp), %rdi
testq %rdi, %rdi
je 0xb09a
movq 0xe0(%rsp), %rsi
subq %rdi, %rsi
callq 0x4470
xorl %eax, %eax
movq %rax, 0xc0(%rsp)
movl %eax, 0xc8(%rsp)
movq %rax, 0xd0(%rsp)
movl %eax, 0xd8(%rsp)
movq %rax, 0xe0(%rsp)
leaq 0x158(%rsp), %rdi
callq 0xf07c
movq 0x110(%rsp), %rdi
testq %rdi, %rdi
je 0xb0ec
movq 0x130(%rsp), %rsi
subq %rdi, %rsi
callq 0x4470
xorl %eax, %eax
movq %rax, 0x110(%rsp)
movl %eax, 0x118(%rsp)
movq %rax, 0x120(%rsp)
movl %eax, 0x128(%rsp)
movq %rax, 0x130(%rsp)
movq 0x90(%rsp), %rdi
testq %rdi, %rdi
je 0xb109
movq 0xa0(%rsp), %rsi
subq %rdi, %rsi
callq 0x4470
addq $0x6d8, %rsp            # imm = 0x6D8
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %r12, %r13
leaq 0x144580(%rip), %rdi    # 0x14f6a5
movq %r13, %rsi
xorl %eax, %eax
callq 0x4630
leaq 0x14456f(%rip), %rdi    # 0x14f6a5
movq %r12, %rsi
xorl %eax, %eax
callq 0x4630
movq %r13, %r12
leaq 0x14455b(%rip), %rdi    # 0x14f6a5
movq %r12, %rsi
xorl %eax, %eax
callq 0x4630
movq %r12, %rbp
leaq 0x144547(%rip), %rdi    # 0x14f6a5
movq %rbp, %rsi
xorl %eax, %eax
callq 0x4630
leaq 0x144536(%rip), %rdi    # 0x14f6a5
movq %rbp, %rsi
xorl %eax, %eax
callq 0x4630
leaq 0x144525(%rip), %rdi    # 0x14f6a5
movq %r14, %rsi
xorl %eax, %eax
callq 0x4630
leaq 0x144514(%rip), %rdi    # 0x14f6a5
movq %r13, %rsi
xorl %eax, %eax
callq 0x4630
leaq 0x144503(%rip), %rdi    # 0x14f6a5
movq %rbx, %rsi
xorl %eax, %eax
callq 0x4630
jmp 0xb204
jmp 0xb1c5
jmp 0xb204
jmp 0xb204
jmp 0xb1b6
movq %rax, %rbx
jmp 0xb300
jmp 0xb36f
jmp 0xb20c
movq %rax, %rbx
jmp 0xb2e6
jmp 0xb204
jmp 0xb20c
jmp 0xb20c
jmp 0xb20c
movq %rax, %rbx
leaq 0x4d8(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0xb2f3
movq 0x4d8(%rsp), %rsi
incq %rsi
callq 0x4470
jmp 0xb2f3
jmp 0xb20c
movq %rax, %rbx
jmp 0xb2f3
movq %rax, %rbx
jmp 0xb37f
movq %rax, %rbx
movq 0x2d8(%rsp), %rdi
testq %rdi, %rdi
je 0xb23e
movq 0x2e8(%rsp), %rsi
subq %rdi, %rsi
callq 0x4470
jmp 0xb23e
jmp 0xb36f
movq %rax, %rbx
movq 0x238(%rsp), %rdi
cmpq %r13, %rdi
je 0xb372
movq 0x248(%rsp), %rsi
incq %rsi
callq 0x4470
jmp 0xb372
jmp 0xb2bf
jmp 0xb2bf
movq %rax, %rbx
movq 0x1b8(%rsp), %rdi
cmpq %rbp, %rdi
je 0xb295
movq 0x1c8(%rsp), %rsi
incq %rsi
callq 0x4470
jmp 0xb295
jmp 0xb2bf
jmp 0xb292
jmp 0xb2bf
jmp 0xb2bf
movq %rax, %rbx
movq 0x1d8(%rsp), %rdi
cmpq %r12, %rdi
je 0xb2c2
movq 0x1e8(%rsp), %rsi
incq %rsi
callq 0x4470
jmp 0xb2c2
jmp 0xb2bf
jmp 0xb2bf
jmp 0xb2bf
jmp 0xb36f
movq %rax, %rbx
movq 0x70(%rsp), %rdi
testq %rdi, %rdi
je 0xb2dc
movq 0x80(%rsp), %rsi
subq %rdi, %rsi
callq 0x4470
leaq 0x50(%rsp), %rdi
callq 0xee1c
leaq 0x4c8(%rsp), %rdi
callq 0x4110
leaq 0x2b8(%rsp), %rdi
callq 0x4110
leaq 0x20(%rsp), %rdi
callq 0xee6a
movq 0xc0(%rsp), %rdi
testq %rdi, %rdi
je 0xb372
movq 0xe0(%rsp), %rsi
subq %rdi, %rsi
callq 0x4470
xorl %eax, %eax
movq %rax, 0xc0(%rsp)
movl %eax, 0xc8(%rsp)
movq %rax, 0xd0(%rsp)
movl %eax, 0xd8(%rsp)
movq %rax, 0xe0(%rsp)
jmp 0xb372
jmp 0xb36f
jmp 0xb36f
jmp 0xb36f
jmp 0xb36f
jmp 0xb36f
jmp 0xb36f
jmp 0xb36f
jmp 0xb36f
jmp 0xb36f
jmp 0xb36f
jmp 0xb36f
jmp 0xb36f
jmp 0xb36f
jmp 0xb36f
jmp 0xb36f
movq %rax, %rbx
leaq 0x158(%rsp), %rdi
callq 0xf07c
movq 0x110(%rsp), %rdi
testq %rdi, %rdi
je 0xb3c4
movq 0x130(%rsp), %rsi
subq %rdi, %rsi
callq 0x4470
xorl %eax, %eax
movq %rax, 0x110(%rsp)
movl %eax, 0x118(%rsp)
movq %rax, 0x120(%rsp)
movl %eax, 0x128(%rsp)
movq %rax, 0x130(%rsp)
movq 0x90(%rsp), %rdi
testq %rdi, %rdi
je 0xb3e1
movq 0xa0(%rsp), %rsi
subq %rdi, %rsi
callq 0x4470
movq %rbx, %rdi
callq 0x4780