// File: /workspace/github_cpp_makefile_star2_O3/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 $0x728, %rsp            # imm = 0x728
movl %ecx, 0xd0(%rsp)
movq %rdx, %rbx
movq %rsi, 0x260(%rsp)
xorps %xmm0, %xmm0
movaps %xmm0, 0xb0(%rsp)
xorl %ecx, %ecx
movq %rcx, 0xc0(%rsp)
movq %rcx, 0x50(%rsp)
movaps %xmm0, 0x40(%rsp)
leaq 0x1d8(%rsp), %rax
movq %rcx, (%rax)
movl %ecx, 0x8(%rax)
movq %rcx, 0x10(%rax)
movl %ecx, 0x18(%rax)
movq %rcx, 0x20(%rax)
movsd 0x141b70(%rip), %xmm0   # 0x14d078
divsd 0x8(%rdx), %xmm0
movsd %xmm0, 0x18(%rsp)
movq %rdi, %rbp
movq 0x2f8(%rdx), %rsi
subq 0x2f0(%rdx), %rsi
movupd 0x10(%rdx), %xmm0
movapd %xmm0, 0xa0(%rsp)
sarq $0x3, %rsi
movabsq $-0x79435e50d79435e5, %rcx # imm = 0x86BCA1AF286BCA1B
imulq %rcx, %rsi
movq %rax, %rdi
xorl %edx, %edx
callq 0xedc8
movsd 0x18(%rsp), %xmm0
ucomisd 0x141afc(%rip), %xmm0   # 0x14d058
movq 0x2f0(%rbx), %rax
movq 0x2f8(%rbx), %rcx
movq %rbp, 0x268(%rsp)
jae 0xb77b
movapd 0x141b70(%rip), %xmm1   # 0x14d0f0
divpd 0xa0(%rsp), %xmm1
ucomisd 0x141ac7(%rip), %xmm1   # 0x14d058
jae 0xb77b
movapd %xmm1, %xmm0
unpckhpd %xmm1, %xmm0            # xmm0 = xmm0[1],xmm1[1]
ucomisd 0x141ab1(%rip), %xmm0   # 0x14d058
jae 0xb77b
movapd %xmm1, 0x70(%rsp)
cmpq %rax, %rcx
je 0xb6c7
movsd 0x141a94(%rip), %xmm0   # 0x14d058
subsd 0x18(%rsp), %xmm0
movsd %xmm0, 0xa0(%rsp)
movapd 0x141af5(%rip), %xmm0   # 0x14d0d0
subpd 0x70(%rsp), %xmm0
movapd %xmm0, 0x140(%rsp)
movl $0x1, %ebp
xorl %r13d, %r13d
leaq 0x40(%rsp), %r14
leaq 0x510(%rsp), %r15
leaq 0x1d8(%rsp), %r12
imulq $0x98, %r13, %rdx
movsd 0x18(%rax,%rdx), %xmm0
movsd 0x18(%rsp), %xmm1
ucomisd %xmm0, %xmm1
ja 0xb657
ucomisd 0xa0(%rsp), %xmm0
ja 0xb657
movupd 0x20(%rax,%rdx), %xmm0
movapd 0x140(%rsp), %xmm1
cmpltpd %xmm0, %xmm1
cmpltpd 0x70(%rsp), %xmm0
orpd %xmm1, %xmm0
movmskpd %xmm0, %edx
testb $0x1, %dl
jne 0xb657
shrb %dl
je 0xb6a1
leal -0x1(%rbp), %eax
movl %eax, 0x510(%rsp)
movq 0x48(%rsp), %rsi
cmpq 0x50(%rsp), %rsi
je 0xb67a
movl %eax, (%rsi)
addq $0x4, %rsi
movq %rsi, 0x48(%rsp)
jmp 0xb685
movq %r14, %rdi
movq %r15, %rdx
callq 0x14198
movq %r12, %rdi
movq %r13, %rsi
callq 0xee36
orq %rdx, (%rax)
movq 0x2f0(%rbx), %rax
movq 0x2f8(%rbx), %rcx
movl %ebp, %r13d
movq %rcx, %rdx
subq %rax, %rdx
sarq $0x3, %rdx
movabsq $-0x79435e50d79435e5, %rsi # imm = 0x86BCA1AF286BCA1B
imulq %rsi, %rdx
incl %ebp
cmpq %r13, %rdx
ja 0xb607
movq 0x1898f2(%rip), %rdi    # 0x194fc0
leaq 0x141ccf(%rip), %rsi    # 0x14d3a4
movl $0xf, %edx
callq 0x44e0
movq 0x48(%rsp), %rsi
subq 0x40(%rsp), %rsi
sarq $0x2, %rsi
movq 0x1898cc(%rip), %rdi    # 0x194fc0
callq 0x42b0
movq %rax, %r14
leaq 0x146501(%rip), %rsi    # 0x151c04
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 0x141c72(%rip), %rsi    # 0x14d3b4
movl $0x47, %edx
movq %rax, %rdi
callq 0x44e0
movsd 0x141921(%rip), %xmm0   # 0x14d078
movq %r14, %rdi
callq 0x46b0
movq %rax, %r14
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %r14, %rdi
movl $0xa, %esi
callq 0x4420
jmp 0xb86a
cmpq %rax, %rcx
je 0xb7fb
xorl %r14d, %r14d
leaq 0x40(%rsp), %r15
leaq 0x510(%rsp), %r12
leaq 0x1d8(%rsp), %r13
movl %r14d, 0x510(%rsp)
movq 0x48(%rsp), %rsi
cmpq 0x50(%rsp), %rsi
je 0xb7ba
movl %r14d, (%rsi)
addq $0x4, %rsi
movq %rsi, 0x48(%rsp)
jmp 0xb7c5
movq %r15, %rdi
movq %r12, %rdx
callq 0x14198
movq %r13, %rdi
movq %r14, %rsi
callq 0xee36
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 0xb798
movq 0x1897be(%rip), %rdi    # 0x194fc0
leaq 0x141b52(%rip), %rsi    # 0x14d35b
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 0x189786(%rip), %rdi    # 0x194fc0
callq 0x42b0
movq %rax, %r14
leaq 0x141b28(%rip), %rsi    # 0x14d371
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 0xc464
leaq 0x118(%rsp), %rcx
leaq 0x38(%rbx), %rdx
movq %rdx, 0x140(%rsp)
leaq 0x50(%rbx), %rdx
movq %rdx, 0x100(%rsp)
leaq 0x68(%rbx), %rdx
movq %rdx, 0xf8(%rsp)
leaq 0x108(%rsp), %r14
xorl %edx, %edx
movl $0x0, 0x3c(%rsp)
xorl %r15d, %r15d
movq %r15, 0x60(%rsp)
movq %rdx, 0x70(%rsp)
imulq $0x98, %rdx, %r12
movq %rcx, 0x108(%rsp)
movq 0x40(%rax,%r12), %rsi
movq 0x48(%rax,%r12), %rdx
addq %rsi, %rdx
movq %r14, %rdi
callq 0xf3ce
movq %r14, %rdi
callq 0x222b8
movl %eax, %r13d
movq 0x108(%rsp), %rdi
leaq 0x118(%rsp), %rax
cmpq %rax, %rdi
je 0xb930
movq 0x118(%rsp), %rsi
incq %rsi
callq 0x4470
testb %r13b, %r13b
je 0xba0e
xorpd %xmm0, %xmm0
movapd %xmm0, 0x510(%rsp)
xorl %eax, %eax
movq %rax, 0x520(%rsp)
movq %rax, 0x310(%rsp)
movapd %xmm0, 0x300(%rsp)
movq 0x2f0(%rbx), %rax
movq 0x2f8(%rbx), %rdx
subq %rax, %rdx
sarq $0x3, %rdx
movabsq $-0x79435e50d79435e5, %rcx # imm = 0x86BCA1AF286BCA1B
imulq %rcx, %rdx
cmpq 0x70(%rsp), %rdx
jbe 0xc7fa
movsd (%rax,%r12), %xmm0
movsd 0x8(%rax,%r12), %xmm1
movsd 0x10(%rax,%r12), %xmm2
leaq 0xe0(%rsp), %r14
movq %r14, %rdi
callq 0x84364
xorpd %xmm0, %xmm0
movapd %xmm0, 0x80(%rsp)
movq $0x0, 0x90(%rsp)
leaq 0x80(%rsp), %rdi
xorl %esi, %esi
movq %r14, %rdx
callq 0x1481e
movq 0x88(%rsp), %rsi
movq 0x90(%rsp), %rax
cmpq %rax, %rsi
je 0xba5a
movsd 0xe8(%rsp), %xmm0
movsd %xmm0, (%rsi)
addq $0x8, %rsi
movq %rsi, 0x88(%rsp)
jmp 0xba7f
leaq 0x108(%rsp), %r14
movq 0x60(%rsp), %r15
incl %r15d
movq 0x2f0(%rbx), %rax
movq 0x2f8(%rbx), %rcx
subq %rax, %rcx
sarq $0x3, %rcx
movabsq $-0x79435e50d79435e5, %rdx # imm = 0x86BCA1AF286BCA1B
imulq %rdx, %rcx
movq %r15, %rdx
cmpq %r15, %rcx
leaq 0x118(%rsp), %rcx
ja 0xb8d2
jmp 0xc46c
leaq 0x80(%rsp), %rdi
leaq 0xe8(%rsp), %rdx
callq 0x1481e
movq 0x88(%rsp), %rsi
movq 0x90(%rsp), %rax
cmpq %rax, %rsi
je 0xba9f
movsd 0xf0(%rsp), %xmm0
movsd %xmm0, (%rsi)
addq $0x8, %rsi
movq %rsi, 0x88(%rsp)
jmp 0xbab4
leaq 0x80(%rsp), %rdi
leaq 0xf0(%rsp), %rdx
callq 0x1481e
leaq 0x510(%rsp), %rdi
leaq 0x80(%rsp), %rsi
callq 0xef20
movq 0x60(%rsp), %rax
movl %eax, 0x20(%rsp)
movq 0x308(%rsp), %rsi
cmpq 0x310(%rsp), %rsi
je 0xbaf4
movl %eax, (%rsi)
addq $0x4, %rsi
movq %rsi, 0x308(%rsp)
jmp 0xbb06
leaq 0x300(%rsp), %rdi
leaq 0x20(%rsp), %rdx
callq 0x14198
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
xorps %xmm0, %xmm0
cvtsi2sd %eax, %xmm0
movsd %xmm0, 0x270(%rsp)
movl $0xffffffff, %ecx       # imm = 0xFFFFFFFF
movl %eax, 0xd4(%rsp)
movl %ecx, 0xd8(%rsp)
movl %ecx, %edx
orl %eax, %edx
movl %edx, 0xdc(%rsp)
xorps %xmm0, %xmm0
cvtsi2sd %ecx, %xmm0
movsd %xmm0, 0x278(%rsp)
movl $0xffffffff, %ebp       # imm = 0xFFFFFFFF
movl 0xdc(%rsp), %eax
orl %ebp, %eax
movl %ebp, 0x6c(%rsp)
je 0xbf9c
leaq 0x1d8(%rsp), %rdi
movq 0x70(%rsp), %rsi
callq 0xee36
testq %rdx, (%rax)
je 0xc387
movq 0x40(%rsp), %rax
cmpq %rax, 0x48(%rsp)
je 0xc387
xorps %xmm0, %xmm0
cvtsi2sdl 0x6c(%rsp), %xmm0
movsd %xmm0, 0x280(%rsp)
movl $0x1, %r14d
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 0xc781
imulq $0x98, %r13, %r15
movsd (%rax,%r15), %xmm0
movsd 0x8(%rax,%r15), %xmm1
movsd 0x10(%rax,%r15), %xmm2
leaq 0x20(%rsp), %rdi
callq 0x84364
movq 0x140(%rsp), %rcx
movq 0x10(%rcx), %rax
movq %rax, 0x250(%rsp)
movups (%rcx), %xmm0
movaps %xmm0, 0x240(%rsp)
movq 0x100(%rsp), %rcx
movq 0x10(%rcx), %rax
movq %rax, 0x230(%rsp)
movups (%rcx), %xmm0
movaps %xmm0, 0x220(%rsp)
movq 0xf8(%rsp), %rcx
movq 0x10(%rcx), %rax
movq %rax, 0x210(%rsp)
movups (%rcx), %xmm0
movaps %xmm0, 0x200(%rsp)
leaq 0x2e8(%rsp), %rbp
movq %rbp, %rdi
leaq 0x240(%rsp), %rsi
movsd 0x270(%rsp), %xmm0
callq 0x84416
leaq 0x288(%rsp), %rdi
leaq 0x20(%rsp), %rsi
movq %rbp, %rdx
callq 0x84642
leaq 0x2d0(%rsp), %rbp
movq %rbp, %rdi
leaq 0x220(%rsp), %rsi
movsd 0x278(%rsp), %xmm0
callq 0x84416
leaq 0x128(%rsp), %rdi
leaq 0x288(%rsp), %rsi
movq %rbp, %rdx
callq 0x84642
leaq 0x2b8(%rsp), %rbp
movq %rbp, %rdi
leaq 0x200(%rsp), %rsi
movsd 0x280(%rsp), %xmm0
callq 0x84416
movq %rsp, %rdi
leaq 0x128(%rsp), %rsi
movq %rbp, %rdx
callq 0x84642
movq 0x10(%rsp), %rax
movq %rax, 0x30(%rsp)
movups (%rsp), %xmm0
movaps %xmm0, 0x20(%rsp)
movsd 0xe0(%rsp), %xmm0
movsd 0xe8(%rsp), %xmm1
movsd 0xf0(%rsp), %xmm2
movsd 0x20(%rsp), %xmm3
movsd 0x28(%rsp), %xmm4
movsd 0x30(%rsp), %xmm5
callq 0x84cbb
movsd %xmm0, 0xa0(%rsp)
movq 0x2f0(%rbx), %rax
movq 0x2f8(%rbx), %rdx
subq %rax, %rdx
sarq $0x3, %rdx
movabsq $-0x79435e50d79435e5, %rcx # imm = 0x86BCA1AF286BCA1B
imulq %rcx, %rdx
cmpq 0x70(%rsp), %rdx
jbe 0xc7a3
leaq 0x188(%rsp), %rcx
movq %rcx, 0x178(%rsp)
movq 0x40(%rax,%r12), %rsi
movq 0x48(%rax,%r12), %rdx
addq %rsi, %rdx
leaq 0x178(%rsp), %rdi
callq 0xf3ce
leaq 0x178(%rsp), %rdi
callq 0x22046
movsd %xmm0, 0x18(%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 0xc792
leaq 0x168(%rsp), %rcx
movq %rcx, 0x158(%rsp)
movq 0x40(%rax,%r15), %rsi
movq 0x48(%rax,%r15), %rdx
addq %rsi, %rdx
leaq 0x158(%rsp), %rdi
callq 0xf3ce
leaq 0x158(%rsp), %rdi
callq 0x22046
movsd 0x18(%rsp), %xmm1
addsd %xmm0, %xmm1
addsd 0x141237(%rip), %xmm1   # 0x14d060
movsd %xmm1, 0x18(%rsp)
movq 0x158(%rsp), %rdi
leaq 0x168(%rsp), %rax
cmpq %rax, %rdi
je 0xbe54
movq 0x168(%rsp), %rsi
incq %rsi
callq 0x4470
movq 0x178(%rsp), %rdi
leaq 0x188(%rsp), %rax
cmpq %rax, %rdi
je 0xbe79
movq 0x188(%rsp), %rsi
incq %rsi
callq 0x4470
movsd 0x18(%rsp), %xmm0
ucomisd 0xa0(%rsp), %xmm0
jbe 0xbf77
xorpd %xmm0, %xmm0
movapd %xmm0, (%rsp)
movq $0x0, 0x10(%rsp)
movq %rsp, %rdi
xorl %esi, %esi
leaq 0x20(%rsp), %rdx
callq 0x1481e
movq 0x8(%rsp), %rsi
movq 0x10(%rsp), %rax
cmpq %rax, %rsi
je 0xbed3
movsd 0x28(%rsp), %xmm0
movsd %xmm0, (%rsi)
addq $0x8, %rsi
movq %rsi, 0x8(%rsp)
jmp 0xbeea
movq %rsp, %rdi
leaq 0x28(%rsp), %rdx
callq 0x1481e
movq 0x8(%rsp), %rsi
movq 0x10(%rsp), %rax
cmpq %rax, %rsi
je 0xbf04
movsd 0x30(%rsp), %xmm0
movsd %xmm0, (%rsi)
addq $0x8, %rsi
movq %rsi, 0x8(%rsp)
jmp 0xbf11
movq %rsp, %rdi
leaq 0x30(%rsp), %rdx
callq 0x1481e
leaq 0x510(%rsp), %rdi
movq %rsp, %rsi
callq 0xef20
movl %r13d, 0x128(%rsp)
movq 0x308(%rsp), %rsi
cmpq 0x310(%rsp), %rsi
je 0xbf4c
movl %r13d, (%rsi)
addq $0x4, %rsi
movq %rsi, 0x308(%rsp)
jmp 0xbf61
leaq 0x300(%rsp), %rdi
leaq 0x128(%rsp), %rdx
callq 0x14198
movq (%rsp), %rdi
testq %rdi, %rdi
je 0xbf77
movq 0x10(%rsp), %rsi
subq %rdi, %rsi
callq 0x4470
movl %r14d, %ecx
movq 0x40(%rsp), %rax
movq 0x48(%rsp), %rdx
subq %rax, %rdx
sarq $0x2, %rdx
incl %r14d
cmpq %rcx, %rdx
ja 0xbba6
jmp 0xc387
movq 0x2f0(%rbx), %rax
movq 0x2f8(%rbx), %rcx
cmpq %rax, %rcx
je 0xc387
xorl %r13d, %r13d
cmpl %r13d, 0x60(%rsp)
je 0xc363
imulq $0x98, %r13, %r14
movsd (%rax,%r14), %xmm0
movsd 0x8(%rax,%r14), %xmm1
movsd 0x10(%rax,%r14), %xmm2
leaq 0x20(%rsp), %rdi
callq 0x84364
movq 0x140(%rsp), %rcx
movq 0x10(%rcx), %rax
movq %rax, 0x250(%rsp)
movups (%rcx), %xmm0
movaps %xmm0, 0x240(%rsp)
movq 0x100(%rsp), %rcx
movq 0x10(%rcx), %rax
movq %rax, 0x230(%rsp)
movups (%rcx), %xmm0
movaps %xmm0, 0x220(%rsp)
movq 0xf8(%rsp), %rcx
movq 0x10(%rcx), %rax
movq %rax, 0x210(%rsp)
movupd (%rcx), %xmm0
movapd %xmm0, 0x200(%rsp)
xorpd %xmm0, %xmm0
leaq 0x2e8(%rsp), %r15
movq %r15, %rdi
leaq 0x240(%rsp), %rsi
callq 0x84416
leaq 0x288(%rsp), %rdi
leaq 0x20(%rsp), %rsi
movq %r15, %rdx
callq 0x84642
xorpd %xmm0, %xmm0
leaq 0x2d0(%rsp), %r15
movq %r15, %rdi
leaq 0x220(%rsp), %rsi
callq 0x84416
leaq 0x128(%rsp), %rdi
leaq 0x288(%rsp), %rsi
movq %r15, %rdx
callq 0x84642
xorpd %xmm0, %xmm0
leaq 0x2b8(%rsp), %r15
movq %r15, %rdi
leaq 0x200(%rsp), %rsi
callq 0x84416
movq %rsp, %rdi
leaq 0x128(%rsp), %rsi
movq %r15, %rdx
callq 0x84642
movq 0x10(%rsp), %rax
movq %rax, 0x30(%rsp)
movups (%rsp), %xmm0
movaps %xmm0, 0x20(%rsp)
movsd 0xe0(%rsp), %xmm0
movsd 0xe8(%rsp), %xmm1
movsd 0xf0(%rsp), %xmm2
movsd 0x20(%rsp), %xmm3
movsd 0x28(%rsp), %xmm4
movsd 0x30(%rsp), %xmm5
callq 0x84cbb
movsd %xmm0, 0xa0(%rsp)
movq 0x2f0(%rbx), %rax
movq 0x2f8(%rbx), %rdx
subq %rax, %rdx
sarq $0x3, %rdx
movabsq $-0x79435e50d79435e5, %rcx # imm = 0x86BCA1AF286BCA1B
imulq %rcx, %rdx
cmpq 0x70(%rsp), %rdx
jbe 0xc7b6
leaq 0x1c8(%rsp), %rcx
movq %rcx, 0x1b8(%rsp)
movq 0x40(%rax,%r12), %rsi
movq 0x48(%rax,%r12), %rdx
addq %rsi, %rdx
leaq 0x1b8(%rsp), %rdi
callq 0xf3ce
leaq 0x1b8(%rsp), %rdi
callq 0x22046
movsd %xmm0, 0x18(%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 0xc7c9
leaq 0x1a8(%rsp), %rcx
movq %rcx, 0x198(%rsp)
movq 0x40(%rax,%r14), %rsi
movq 0x48(%rax,%r14), %rdx
addq %rsi, %rdx
leaq 0x198(%rsp), %rdi
callq 0xf3ce
leaq 0x198(%rsp), %rdi
callq 0x22046
movsd 0x18(%rsp), %xmm1
addsd %xmm0, %xmm1
addsd 0x140e59(%rip), %xmm1   # 0x14d060
movsd %xmm1, 0x18(%rsp)
movq 0x198(%rsp), %rdi
leaq 0x1a8(%rsp), %rax
cmpq %rax, %rdi
je 0xc232
movq 0x1a8(%rsp), %rsi
incq %rsi
callq 0x4470
movq 0x1b8(%rsp), %rdi
leaq 0x1c8(%rsp), %rax
cmpq %rax, %rdi
je 0xc257
movq 0x1c8(%rsp), %rsi
incq %rsi
callq 0x4470
movsd 0x18(%rsp), %xmm0
ucomisd 0xa0(%rsp), %xmm0
jbe 0xc355
xorpd %xmm0, %xmm0
movapd %xmm0, (%rsp)
movq $0x0, 0x10(%rsp)
movq %rsp, %rdi
xorl %esi, %esi
leaq 0x20(%rsp), %rdx
callq 0x1481e
movq 0x8(%rsp), %rsi
movq 0x10(%rsp), %rax
cmpq %rax, %rsi
je 0xc2b1
movsd 0x28(%rsp), %xmm0
movsd %xmm0, (%rsi)
addq $0x8, %rsi
movq %rsi, 0x8(%rsp)
jmp 0xc2c8
movq %rsp, %rdi
leaq 0x28(%rsp), %rdx
callq 0x1481e
movq 0x8(%rsp), %rsi
movq 0x10(%rsp), %rax
cmpq %rax, %rsi
je 0xc2e2
movsd 0x30(%rsp), %xmm0
movsd %xmm0, (%rsi)
addq $0x8, %rsi
movq %rsi, 0x8(%rsp)
jmp 0xc2ef
movq %rsp, %rdi
leaq 0x30(%rsp), %rdx
callq 0x1481e
leaq 0x510(%rsp), %rdi
movq %rsp, %rsi
callq 0xef20
movl %r13d, 0x128(%rsp)
movq 0x308(%rsp), %rsi
cmpq 0x310(%rsp), %rsi
je 0xc32a
movl %r13d, (%rsi)
addq $0x4, %rsi
movq %rsi, 0x308(%rsp)
jmp 0xc33f
leaq 0x300(%rsp), %rdi
leaq 0x128(%rsp), %rdx
callq 0x14198
movq (%rsp), %rdi
testq %rdi, %rdi
je 0xc355
movq 0x10(%rsp), %rsi
subq %rdi, %rsi
callq 0x4470
movq 0x2f0(%rbx), %rax
movq 0x2f8(%rbx), %rcx
incl %r13d
movq %rcx, %rdx
subq %rax, %rdx
sarq $0x3, %rdx
movabsq $-0x79435e50d79435e5, %rsi # imm = 0x86BCA1AF286BCA1B
imulq %rsi, %rdx
cmpq %r13, %rdx
ja 0xbfb6
movl 0x6c(%rsp), %ebp
incl %ebp
cmpl $0x2, %ebp
leaq 0x2a0(%rsp), %r14
movl 0xd8(%rsp), %ecx
jne 0xbb4e
incl %ecx
cmpl $0x2, %ecx
movl 0xd4(%rsp), %eax
jne 0xbb27
incl %eax
cmpl $0x2, %eax
jne 0xbb0b
movq %r14, %rdi
leaq 0x510(%rsp), %rsi
callq 0xef4c
movq %r14, %rdi
movsd 0x140ca3(%rip), %xmm0   # 0x14d080
callq 0x10bc2f
movl %eax, %r13d
movq %r14, %rdi
callq 0xefe6
testb %r13b, %r13b
je 0xc40b
leaq 0xb0(%rsp), %rdi
leaq 0x300(%rsp), %rsi
callq 0xf03a
incl 0x3c(%rsp)
movq 0x60(%rsp), %r15
movq 0x80(%rsp), %rdi
testq %rdi, %rdi
je 0xc42d
movq 0x90(%rsp), %rsi
subq %rdi, %rsi
callq 0x4470
movq 0x300(%rsp), %rdi
testq %rdi, %rdi
je 0xc44a
movq 0x310(%rsp), %rsi
subq %rdi, %rsi
callq 0x4470
leaq 0x510(%rsp), %rdi
callq 0xefe6
leaq 0x108(%rsp), %r14
jmp 0xba1b
movl $0x0, 0x3c(%rsp)
leaq 0x510(%rsp), %rdi
callq 0x4520
leaq 0x510(%rsp), %rdi
movq 0x268(%rsp), %r15
movq %r15, %rsi
movl $0x10, %edx
callq 0x43d0
leaq 0x520(%rsp), %r14
testq %r15, %r15
je 0xc4bb
movq %r15, %rdi
callq 0x41e0
movq %r14, %rdi
movq %r15, %rsi
movq %rax, %rdx
callq 0x44e0
jmp 0xc4da
movq 0x520(%rsp), %rax
movq -0x18(%rax), %rax
leaq (%r14,%rax), %rdi
movl 0x540(%rsp,%rax), %esi
orl $0x1, %esi
callq 0x4710
leaq 0x140ff2(%rip), %rsi    # 0x14d4d3
movl $0x8, %edx
movq %r14, %rdi
callq 0x44e0
movq %r14, %rdi
movl 0x3c(%rsp), %esi
callq 0x4750
leaq 0x14711d(%rip), %rsi    # 0x15361e
movl $0x1, %edx
movq %rax, %rdi
callq 0x44e0
leaq 0x510(%rsp), %rdi
callq 0x4090
cmpb $0x0, 0xd0(%rsp)
je 0xc721
leaq 0x300(%rsp), %rdi
callq 0x4520
leaq 0x300(%rsp), %rdi
movq 0x260(%rsp), %rsi
movl $0x10, %edx
callq 0x43d0
movq 0xb0(%rsp), %rax
cmpq %rax, 0xb8(%rsp)
je 0xc707
leaq 0x310(%rsp), %r14
leaq 0x149061(%rip), %r13    # 0x1555d6
xorl %ecx, %ecx
xorl %r12d, %r12d
leaq (%rcx,%rcx,2), %r15
movq (%rax,%r15,8), %rcx
cmpq %rcx, 0x8(%rax,%r15,8)
je 0xc7e8
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 0xc7ec
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 0x140ef8(%rip), %rsi    # 0x14d4dc
callq 0x44e0
movq 0xb0(%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 0x140ec7(%rip), %rsi    # 0x14d4df
callq 0x44e0
movq 0xb0(%rsp), %rcx
movq (%rcx,%r15,8), %rax
movq 0x8(%rcx,%r15,8), %rcx
subq %rax, %rcx
cmpq $0x5, %rcx
jb 0xc6bf
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 0xc7da
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 0xb0(%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 0xc645
movl $0x1, %edx
movq %r14, %rdi
leaq 0x146f50(%rip), %rsi    # 0x15361e
callq 0x44e0
incl %r12d
movq 0xb0(%rsp), %rax
movq 0xb8(%rsp), %rdx
subq %rax, %rdx
sarq $0x3, %rdx
movabsq $-0x5555555555555555, %rcx # imm = 0xAAAAAAAAAAAAAAAB
imulq %rcx, %rdx
movq %r12, %rcx
cmpq %r12, %rdx
ja 0xc57a
leaq 0x300(%rsp), %rdi
callq 0x4090
leaq 0x300(%rsp), %rdi
callq 0x4110
leaq 0x510(%rsp), %rdi
callq 0x4110
movq 0x1d8(%rsp), %rdi
testq %rdi, %rdi
je 0xc74b
movq 0x1f8(%rsp), %rsi
subq %rdi, %rsi
callq 0x4470
movq 0x40(%rsp), %rdi
testq %rdi, %rdi
je 0xc762
movq 0x50(%rsp), %rsi
subq %rdi, %rsi
callq 0x4470
leaq 0xb0(%rsp), %rdi
callq 0xf066
addq $0x728, %rsp            # imm = 0x728
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x140f6d(%rip), %rdi    # 0x14d6f5
movq %r13, %rsi
xorl %eax, %eax
callq 0x4630
leaq 0x140f5c(%rip), %rdi    # 0x14d6f5
movq %r13, %rsi
xorl %eax, %eax
callq 0x4630
leaq 0x140f4b(%rip), %rdi    # 0x14d6f5
movq 0x70(%rsp), %rsi
xorl %eax, %eax
callq 0x4630
leaq 0x140f38(%rip), %rdi    # 0x14d6f5
movq 0x70(%rsp), %rsi
xorl %eax, %eax
callq 0x4630
leaq 0x140f25(%rip), %rdi    # 0x14d6f5
movq %r13, %rsi
xorl %eax, %eax
callq 0x4630
leaq 0x140f14(%rip), %rdi    # 0x14d6f5
xorl %eax, %eax
callq 0x4630
xorl %esi, %esi
xorl %edx, %edx
leaq 0x140f02(%rip), %rdi    # 0x14d6f5
xorl %eax, %eax
callq 0x4630
leaq 0x140ef4(%rip), %rdi    # 0x14d6f5
movq 0x70(%rsp), %rsi
xorl %eax, %eax
callq 0x4630
movq %rax, %rbx
leaq 0x2a0(%rsp), %rdi
callq 0xefe6
jmp 0xc9a2
jmp 0xc871
jmp 0xc99f
jmp 0xc88a
jmp 0xc87e
jmp 0xc82f
movq %rax, %rbx
jmp 0xc9bf
movq %rax, %rbx
movq 0x108(%rsp), %rdi
leaq 0x118(%rsp), %rax
cmpq %rax, %rdi
je 0xc9e9
movq 0x118(%rsp), %rsi
incq %rsi
callq 0x4470
jmp 0xc9e9
jmp 0xc87e
jmp 0xc87e
jmp 0xc99f
movq %rax, %rbx
jmp 0xc89a
jmp 0xc87e
jmp 0xc87e
jmp 0xc88a
jmp 0xc87e
movq %rax, %rbx
jmp 0xc9e9
jmp 0xc88a
jmp 0xc88a
movq %rax, %rbx
leaq 0x300(%rsp), %rdi
callq 0x4110
leaq 0x510(%rsp), %rdi
callq 0x4110
jmp 0xc9e9
jmp 0xc99f
jmp 0xc959
jmp 0xc959
jmp 0xc99f
jmp 0xc8fd
movq %rax, %rbx
movq 0x198(%rsp), %rdi
leaq 0x1a8(%rsp), %rax
cmpq %rax, %rdi
je 0xc900
movq 0x1a8(%rsp), %rsi
incq %rsi
callq 0x4470
jmp 0xc900
jmp 0xc99f
jmp 0xc959
jmp 0xc99f
jmp 0xc99f
movq %rax, %rbx
movq 0x1b8(%rsp), %rdi
leaq 0x1c8(%rsp), %rax
cmpq %rax, %rdi
je 0xc9a2
movq 0x1c8(%rsp), %rsi
jmp 0xc98f
jmp 0xc99f
jmp 0xc99f
jmp 0xc99f
jmp 0xc99f
movq %rax, %rbx
movq 0x158(%rsp), %rdi
leaq 0x168(%rsp), %rax
cmpq %rax, %rdi
je 0xc972
movq 0x168(%rsp), %rsi
incq %rsi
callq 0x4470
jmp 0xc972
jmp 0xc96f
jmp 0xc99f
movq %rax, %rbx
movq (%rsp), %rdi
testq %rdi, %rdi
je 0xc9a2
movq 0x10(%rsp), %rsi
subq %rdi, %rsi
jmp 0xc992
movq %rax, %rbx
movq 0x178(%rsp), %rdi
leaq 0x188(%rsp), %rax
cmpq %rax, %rdi
je 0xc9a2
movq 0x188(%rsp), %rsi
incq %rsi
callq 0x4470
jmp 0xc9a2
jmp 0xc99f
jmp 0xc99f
jmp 0xc99f
movq %rax, %rbx
movq 0x80(%rsp), %rdi
testq %rdi, %rdi
je 0xc9bf
movq 0x90(%rsp), %rsi
subq %rdi, %rsi
callq 0x4470
movq 0x300(%rsp), %rdi
testq %rdi, %rdi
je 0xc9dc
movq 0x310(%rsp), %rsi
subq %rdi, %rsi
callq 0x4470
leaq 0x510(%rsp), %rdi
callq 0xefe6
movq 0x1d8(%rsp), %rdi
testq %rdi, %rdi
je 0xca23
movq 0x1f8(%rsp), %rsi
subq %rdi, %rsi
callq 0x4470
xorl %eax, %eax
movq %rax, 0x1d8(%rsp)
movl $0x0, 0x1e0(%rsp)
movq %rax, 0x1e8(%rsp)
movq 0x40(%rsp), %rdi
testq %rdi, %rdi
je 0xca3a
movq 0x50(%rsp), %rsi
subq %rdi, %rsi
callq 0x4470
leaq 0xb0(%rsp), %rdi
callq 0xf066
movq %rbx, %rdi
callq 0x4780