// File: /workspace/github_cpp_makefile_star2_O2/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 $0x718, %rsp            # imm = 0x718
movl %ecx, 0xb4(%rsp)
movq %rdx, %rbx
andq $0x0, 0x100(%rsp)
movq %rsi, 0x178(%rsp)
andq $0x0, 0xd0(%rsp)
leaq 0x1c8(%rsp), %rcx
andq $0x0, (%rcx)
movq %rdi, 0x180(%rsp)
andl $0x0, 0x8(%rcx)
xorps %xmm0, %xmm0
andq $0x0, 0x10(%rcx)
movaps %xmm0, 0xf0(%rsp)
andl $0x0, 0x18(%rcx)
movaps %xmm0, 0xc0(%rsp)
andq $0x0, 0x20(%rcx)
movups 0x8(%rdx), %xmm0
movaps %xmm0, (%rsp)
movsd 0xf3b26(%rip), %xmm0    # 0xfc078
divsd 0x18(%rdx), %xmm0
movsd %xmm0, 0x38(%rsp)
movq 0x2f8(%rdx), %rax
subq 0x2f0(%rdx), %rax
movl $0x98, %esi
cqto
idivq %rsi
movq %rcx, %rdi
movq %rax, %rsi
xorl %edx, %edx
callq 0xab36
movapd 0xf3b56(%rip), %xmm2    # 0xfc0e0
divpd (%rsp), %xmm2
movq %rbx, 0x30(%rsp)
addq $0x2f0, %rbx            # imm = 0x2F0
ucomisd 0xf3ab5(%rip), %xmm2    # 0xfc058
jae 0x8707
movapd %xmm2, %xmm0
unpckhpd %xmm2, %xmm0            # xmm0 = xmm0[1],xmm2[1]
ucomisd 0xf3a9f(%rip), %xmm0    # 0xfc058
jae 0x8707
movsd 0x38(%rsp), %xmm1
ucomisd 0xf3a8b(%rip), %xmm1    # 0xfc058
jae 0x8707
movsd 0xf3a7d(%rip), %xmm1    # 0xfc058
movapd %xmm1, %xmm3
movapd %xmm2, 0x90(%rsp)
subsd %xmm2, %xmm3
movsd %xmm3, 0x68(%rsp)
movapd %xmm1, %xmm2
subsd %xmm0, %xmm2
movsd %xmm2, 0xa8(%rsp)
subsd 0x38(%rsp), %xmm1
movsd %xmm1, 0xa0(%rsp)
xorl %ebp, %ebp
movl $0x98, %r14d
leaq 0x2f0(%rsp), %r15
leaq 0x1c8(%rsp), %r12
movl %ebp, %r13d
movq 0x30(%rsp), %rcx
movq 0x2f8(%rcx), %rax
subq 0x2f0(%rcx), %rax
cqto
idivq %r14
cmpq %r13, %rax
jbe 0x87b7
movq %rbx, %rdi
movq %r13, %rsi
callq 0xa73a
movsd 0x18(%rax), %xmm0
movaps %xmm0, (%rsp)
movq %rbx, %rdi
movq %r13, %rsi
callq 0xa73a
movsd 0x20(%rax), %xmm0
movaps %xmm0, 0x40(%rsp)
movq %rbx, %rdi
movq %r13, %rsi
callq 0xa73a
movapd (%rsp), %xmm1
movapd %xmm1, %xmm0
movapd 0x40(%rsp), %xmm2
unpcklpd %xmm2, %xmm0            # xmm0 = xmm0[0],xmm2[0]
cmpltpd 0x90(%rsp), %xmm0
movmskpd %xmm0, %ecx
testb $0x1, %cl
jne 0x86db
ucomisd 0x68(%rsp), %xmm1
ja 0x86db
shrb %cl
jne 0x86db
ucomisd 0xa8(%rsp), %xmm2
ja 0x86db
movsd 0x28(%rax), %xmm0
movsd 0x38(%rsp), %xmm1
ucomisd %xmm0, %xmm1
ja 0x86db
ucomisd 0xa0(%rsp), %xmm0
jbe 0x8700
movl %ebp, 0x2f0(%rsp)
leaq 0xc0(%rsp), %rdi
movq %r15, %rsi
callq 0x10324
movq %r12, %rdi
movq %r13, %rsi
callq 0xaba4
orq %rdx, (%rax)
incl %ebp
jmp 0x862a
xorl %ebp, %ebp
movl $0x98, %r14d
leaq 0x2f0(%rsp), %r15
leaq 0x1c8(%rsp), %r12
movl %ebp, %r13d
movq 0x30(%rsp), %rcx
movq 0x2f8(%rcx), %rax
subq 0x2f0(%rcx), %rax
cqto
idivq %r14
cmpq %r13, %rax
jbe 0x8768
movl %ebp, 0x2f0(%rsp)
leaq 0xc0(%rsp), %rdi
movq %r15, %rsi
callq 0x10324
movq %r12, %rdi
movq %r13, %rsi
callq 0xaba4
orq %rdx, (%rax)
incl %ebp
jmp 0x871f
movq 0x147851(%rip), %rdi    # 0x14ffc0
leaq 0xf3bd5(%rip), %rsi     # 0xfc34b
callq 0x4480
movq 0x30(%rsp), %r14
movq %rax, %rdi
movq 0x2f8(%r14), %rax
subq 0x2f0(%r14), %rax
movl $0x98, %ecx
cqto
idivq %rcx
movq %rax, %rsi
callq 0x42e0
leaq 0xf3bb7(%rip), %rsi     # 0xfc361
movq %rax, %rdi
callq 0x4480
jmp 0x883c
movq 0x147802(%rip), %rdi    # 0x14ffc0
leaq 0xf3bcf(%rip), %rsi     # 0xfc394
callq 0x4480
movq 0x30(%rsp), %r14
movq 0xc8(%rsp), %rsi
subq 0xc0(%rsp), %rsi
sarq $0x2, %rsi
movq %rax, %rdi
callq 0x42e0
leaq 0xf8382(%rip), %rsi     # 0x100b74
movq %rax, %rdi
callq 0x4480
movq %rax, %rdi
movq 0x2f8(%r14), %rax
subq 0x2f0(%r14), %rax
movl $0x98, %ecx
cqto
idivq %rcx
movq %rax, %rsi
callq 0x42e0
leaq 0xf3b80(%rip), %rsi     # 0xfc3a4
movq %rax, %rdi
callq 0x4480
movsd 0xf3844(%rip), %xmm0    # 0xfc078
movq %rax, %rdi
callq 0x46c0
movq %rax, %rdi
callq 0x4230
leaq 0x38(%r14), %rax
movq %rax, 0x68(%rsp)
leaq 0x50(%r14), %r12
leaq 0x68(%r14), %r13
xorl %r15d, %r15d
movl $0x98, %ecx
movl $0x0, 0x5c(%rsp)
movl %r15d, %esi
movq 0x2f8(%r14), %rax
subq 0x2f0(%r14), %rax
cqto
idivq %rcx
cmpq %rsi, %rax
jbe 0x90ce
movq %rbx, %rdi
movq %rsi, 0x90(%rsp)
callq 0xa73a
leaq 0x2d0(%rsp), %r14
addq $0x40, %rax
movq %r14, %rdi
movq %rax, %rsi
callq 0x45d0
movq %r14, %rdi
callq 0x1b62f
movq %r14, %rdi
movl %eax, %r14d
callq 0x4210
testb %r14b, %r14b
je 0x90bc
xorpd %xmm0, %xmm0
movapd %xmm0, 0x2f0(%rsp)
andq $0x0, 0x300(%rsp)
movapd %xmm0, 0x500(%rsp)
andq $0x0, 0x510(%rsp)
movq %rbx, %rdi
movq 0x90(%rsp), %rsi
callq 0xa73a
movsd (%rax), %xmm0
movsd %xmm0, (%rsp)
movq %rbx, %rdi
movq 0x90(%rsp), %rsi
callq 0xa73a
movsd 0x8(%rax), %xmm0
movsd %xmm0, 0x40(%rsp)
movq %rbx, %rdi
movq 0x90(%rsp), %rsi
callq 0xa73a
movsd 0x10(%rax), %xmm2
leaq 0xd8(%rsp), %rdi
movsd (%rsp), %xmm0
movsd 0x40(%rsp), %xmm1
callq 0x6402e
xorpd %xmm0, %xmm0
movapd %xmm0, 0x190(%rsp)
andq $0x0, 0x1a0(%rsp)
leaq 0x190(%rsp), %r14
movq %r14, %rdi
leaq 0xd8(%rsp), %rsi
callq 0xac88
movq %r14, %rdi
leaq 0xe0(%rsp), %rsi
callq 0xac88
movq %r14, %rdi
leaq 0xe8(%rsp), %rsi
callq 0xac88
leaq 0x2f0(%rsp), %rdi
movq %r14, %rsi
callq 0xacaa
movl %r15d, 0x10(%rsp)
leaq 0x500(%rsp), %rdi
leaq 0x10(%rsp), %rsi
callq 0x10324
pushq $-0x1
popq %rax
movl %r15d, 0x38(%rsp)
cmpl $0x2, %eax
je 0x903f
movl %eax, 0x60(%rsp)
cvtsi2sd %eax, %xmm0
movsd %xmm0, 0x188(%rsp)
pushq $-0x1
popq %rax
cmpl $0x2, %eax
je 0x9034
movl %eax, %ecx
orl 0x60(%rsp), %ecx
movl %ecx, 0xbc(%rsp)
movl %eax, 0xb8(%rsp)
cvtsi2sd %eax, %xmm0
movsd %xmm0, 0xa0(%rsp)
pushq $-0x1
popq %rbp
cmpl $0x2, %ebp
je 0x9026
movl 0xbc(%rsp), %eax
orl %ebp, %eax
movl %ebp, 0x64(%rsp)
je 0x8d41
leaq 0x1c8(%rsp), %rdi
movq 0x90(%rsp), %rsi
callq 0xaba4
testq %rdx, (%rax)
je 0x9016
cvtsi2sdl 0x64(%rsp), %xmm0
movsd %xmm0, 0xa8(%rsp)
xorl %r15d, %r15d
movl %r15d, %r15d
movq 0xc8(%rsp), %rax
subq 0xc0(%rsp), %rax
sarq $0x2, %rax
cmpq %r15, %rax
jbe 0x9016
leaq 0xc0(%rsp), %rdi
movq %r15, %rsi
callq 0xac00
movl (%rax), %r14d
movq %rbx, %rdi
movq %r14, %rsi
callq 0xa73a
movsd (%rax), %xmm0
movsd %xmm0, (%rsp)
movq %rbx, %rdi
movq %r14, %rsi
callq 0xa73a
movsd 0x8(%rax), %xmm0
movsd %xmm0, 0x40(%rsp)
movq %rbx, %rdi
movq %r14, %rsi
callq 0xa73a
movsd 0x10(%rax), %xmm2
leaq 0x10(%rsp), %rdi
movsd (%rsp), %xmm0
movsd 0x40(%rsp), %xmm1
callq 0x6402e
movq 0x68(%rsp), %rcx
movq 0x10(%rcx), %rax
movq %rax, 0x170(%rsp)
movups (%rcx), %xmm0
movaps %xmm0, 0x160(%rsp)
movq 0x10(%r12), %rax
movq %rax, 0x150(%rsp)
movups (%r12), %xmm0
movaps %xmm0, 0x140(%rsp)
movq 0x10(%r13), %rax
movq %rax, 0x130(%rsp)
movups (%r13), %xmm0
movaps %xmm0, 0x120(%rsp)
leaq 0x2b8(%rsp), %rbp
movq %rbp, %rdi
leaq 0x160(%rsp), %rsi
movsd 0x188(%rsp), %xmm0
callq 0x640ba
leaq 0x1b0(%rsp), %rdi
leaq 0x10(%rsp), %rsi
movq %rbp, %rdx
callq 0x642d2
leaq 0x2a0(%rsp), %rbp
movq %rbp, %rdi
leaq 0x140(%rsp), %rsi
movsd 0xa0(%rsp), %xmm0
callq 0x640ba
leaq 0x108(%rsp), %rdi
leaq 0x1b0(%rsp), %rsi
movq %rbp, %rdx
callq 0x642d2
leaq 0x288(%rsp), %rbp
movq %rbp, %rdi
leaq 0x120(%rsp), %rsi
movsd 0xa8(%rsp), %xmm0
callq 0x640ba
leaq 0x70(%rsp), %rdi
leaq 0x108(%rsp), %rsi
movq %rbp, %rdx
callq 0x642d2
movq 0x80(%rsp), %rax
movq %rax, 0x20(%rsp)
movups 0x70(%rsp), %xmm0
movaps %xmm0, 0x10(%rsp)
movsd 0xd8(%rsp), %xmm0
movsd 0xe0(%rsp), %xmm1
movsd 0xe8(%rsp), %xmm2
movsd 0x10(%rsp), %xmm3
movsd 0x18(%rsp), %xmm4
movsd 0x20(%rsp), %xmm5
callq 0x64934
movsd %xmm0, 0x40(%rsp)
movq %rbx, %rdi
movq 0x90(%rsp), %rsi
callq 0xa73a
addq $0x40, %rax
leaq 0x208(%rsp), %rdi
movq %rax, %rsi
callq 0x45d0
leaq 0x208(%rsp), %rdi
callq 0x1b3ff
movsd %xmm0, (%rsp)
movq %rbx, %rdi
movq %r14, %rsi
callq 0xa73a
addq $0x40, %rax
leaq 0x248(%rsp), %rdi
movq %rax, %rsi
callq 0x45d0
leaq 0x248(%rsp), %rbp
movq %rbp, %rdi
callq 0x1b3ff
movsd (%rsp), %xmm1
addsd %xmm0, %xmm1
addsd 0xf33ca(%rip), %xmm1    # 0xfc068
movsd %xmm1, (%rsp)
movq %rbp, %rdi
callq 0x4210
leaq 0x208(%rsp), %rdi
callq 0x4210
movsd (%rsp), %xmm0
ucomisd 0x40(%rsp), %xmm0
leaq 0x70(%rsp), %rbp
jbe 0x8d39
xorpd %xmm0, %xmm0
movapd %xmm0, 0x70(%rsp)
andq $0x0, 0x80(%rsp)
movq %rbp, %rdi
leaq 0x10(%rsp), %rsi
callq 0xac88
movq %rbp, %rdi
leaq 0x18(%rsp), %rsi
callq 0xac88
movq %rbp, %rdi
leaq 0x20(%rsp), %rsi
callq 0xac88
leaq 0x2f0(%rsp), %rdi
movq %rbp, %rsi
callq 0xacaa
movl %r14d, 0x108(%rsp)
leaq 0x500(%rsp), %rdi
leaq 0x108(%rsp), %rsi
callq 0x10324
movq %rbp, %rdi
callq 0xb25c
incl %r15d
jmp 0x8a63
xorl %r15d, %r15d
movl %r15d, %r14d
movq 0x30(%rsp), %rcx
movq 0x2f8(%rcx), %rax
subq 0x2f0(%rcx), %rax
cqto
movl $0x98, %ecx
idivq %rcx
cmpq %r14, %rax
jbe 0x9016
cmpl %r15d, 0x38(%rsp)
je 0x900e
movq %rbx, %rdi
movq %r14, %rsi
callq 0xa73a
movsd (%rax), %xmm0
movsd %xmm0, (%rsp)
movq %rbx, %rdi
movq %r14, %rsi
callq 0xa73a
movsd 0x8(%rax), %xmm0
movsd %xmm0, 0x40(%rsp)
movq %rbx, %rdi
movq %r14, %rsi
callq 0xa73a
movsd 0x10(%rax), %xmm2
leaq 0x10(%rsp), %rdi
movsd (%rsp), %xmm0
movsd 0x40(%rsp), %xmm1
callq 0x6402e
movq 0x68(%rsp), %rcx
movq 0x10(%rcx), %rax
movq %rax, 0x170(%rsp)
movups (%rcx), %xmm0
movaps %xmm0, 0x160(%rsp)
movq 0x10(%r12), %rax
movq %rax, 0x150(%rsp)
movups (%r12), %xmm0
movaps %xmm0, 0x140(%rsp)
movq 0x10(%r13), %rax
movq %rax, 0x130(%rsp)
movupd (%r13), %xmm0
movapd %xmm0, 0x120(%rsp)
xorpd %xmm0, %xmm0
leaq 0x2b8(%rsp), %rbp
movq %rbp, %rdi
leaq 0x160(%rsp), %rsi
callq 0x640ba
leaq 0x1b0(%rsp), %rdi
leaq 0x10(%rsp), %rsi
movq %rbp, %rdx
callq 0x642d2
xorpd %xmm0, %xmm0
leaq 0x2a0(%rsp), %rbp
movq %rbp, %rdi
leaq 0x140(%rsp), %rsi
callq 0x640ba
leaq 0x108(%rsp), %rdi
leaq 0x1b0(%rsp), %rsi
movq %rbp, %rdx
callq 0x642d2
xorpd %xmm0, %xmm0
leaq 0x288(%rsp), %rbp
movq %rbp, %rdi
leaq 0x120(%rsp), %rsi
callq 0x640ba
leaq 0x70(%rsp), %rdi
leaq 0x108(%rsp), %rsi
movq %rbp, %rdx
callq 0x642d2
movq 0x80(%rsp), %rax
movq %rax, 0x20(%rsp)
movups 0x70(%rsp), %xmm0
movaps %xmm0, 0x10(%rsp)
movsd 0xd8(%rsp), %xmm0
movsd 0xe0(%rsp), %xmm1
movsd 0xe8(%rsp), %xmm2
movsd 0x10(%rsp), %xmm3
movsd 0x18(%rsp), %xmm4
movsd 0x20(%rsp), %xmm5
callq 0x64934
movsd %xmm0, 0x40(%rsp)
movq %rbx, %rdi
movq 0x90(%rsp), %rsi
callq 0xa73a
addq $0x40, %rax
leaq 0x228(%rsp), %rdi
movq %rax, %rsi
callq 0x45d0
leaq 0x228(%rsp), %rdi
callq 0x1b3ff
movsd %xmm0, (%rsp)
movq %rbx, %rdi
movq %r14, %rsi
callq 0xa73a
addq $0x40, %rax
leaq 0x268(%rsp), %rdi
movq %rax, %rsi
callq 0x45d0
leaq 0x268(%rsp), %r14
movq %r14, %rdi
callq 0x1b3ff
movsd (%rsp), %xmm1
addsd %xmm0, %xmm1
addsd 0xf30f5(%rip), %xmm1    # 0xfc068
movsd %xmm1, (%rsp)
movq %r14, %rdi
callq 0x4210
leaq 0x228(%rsp), %rdi
callq 0x4210
movsd (%rsp), %xmm0
ucomisd 0x40(%rsp), %xmm0
leaq 0x70(%rsp), %r14
jbe 0x900e
xorpd %xmm0, %xmm0
movapd %xmm0, 0x70(%rsp)
andq $0x0, 0x80(%rsp)
movq %r14, %rdi
leaq 0x10(%rsp), %rsi
callq 0xac88
movq %r14, %rdi
leaq 0x18(%rsp), %rsi
callq 0xac88
movq %r14, %rdi
leaq 0x20(%rsp), %rsi
callq 0xac88
leaq 0x2f0(%rsp), %rdi
movq %r14, %rsi
callq 0xacaa
movl %r15d, 0x108(%rsp)
leaq 0x500(%rsp), %rdi
leaq 0x108(%rsp), %rsi
callq 0x10324
movq %r14, %rdi
callq 0xb25c
incl %r15d
jmp 0x8d44
movl 0x64(%rsp), %ebp
incl %ebp
movl 0x38(%rsp), %r15d
jmp 0x8a17
movl 0xb8(%rsp), %eax
incl %eax
jmp 0x89ea
movl 0x60(%rsp), %eax
incl %eax
jmp 0x89cd
leaq 0x1f0(%rsp), %rdi
leaq 0x2f0(%rsp), %rsi
callq 0xacd6
leaq 0x1f0(%rsp), %rbp
movq %rbp, %rdi
movsd 0xf3019(%rip), %xmm0    # 0xfc080
callq 0xc4428
movl %eax, %r14d
movq %rbp, %rdi
callq 0xad30
testb %r14b, %r14b
je 0x9095
leaq 0xf0(%rsp), %rdi
leaq 0x500(%rsp), %rsi
callq 0xad52
incl 0x5c(%rsp)
leaq 0x190(%rsp), %rdi
callq 0xb25c
leaq 0x500(%rsp), %rdi
callq 0xb290
leaq 0x2f0(%rsp), %rdi
callq 0xad30
incl %r15d
movq 0x30(%rsp), %r14
movl $0x98, %ecx
jmp 0x8865
leaq 0x2f0(%rsp), %rdi
callq 0x4540
leaq 0x2f0(%rsp), %rdi
pushq $0x10
popq %rdx
movq 0x180(%rsp), %r14
movq %r14, %rsi
callq 0x4410
leaq 0x300(%rsp), %rdi
movq %r14, %rsi
callq 0x4480
leaq 0xf33b6(%rip), %rsi     # 0xfc4c3
movq %rax, %rdi
callq 0x4480
movq %rax, %rdi
movl 0x5c(%rsp), %esi
callq 0x4760
leaq 0xf9456(%rip), %rsi     # 0x10257e
movq %rax, %rdi
callq 0x4480
leaq 0x2f0(%rsp), %rdi
callq 0x4080
cmpb $0x0, 0xb4(%rsp)
je 0x9298
leaq 0x500(%rsp), %rdi
callq 0x4540
leaq 0x500(%rsp), %rdi
pushq $0x10
popq %rdx
movq 0x178(%rsp), %rsi
callq 0x4410
xorl %r12d, %r12d
leaq 0x510(%rsp), %r14
leaq 0xfb390(%rip), %r13     # 0x104512
movl %r12d, %r12d
movq 0xf0(%rsp), %rdi
movq 0xf8(%rsp), %rax
subq %rdi, %rax
cqto
pushq $0x18
popq %rcx
idivq %rcx
cmpq %r12, %rax
jbe 0x927e
imulq $0x18, %r12, %rbp
addq %rbp, %rdi
xorl %esi, %esi
callq 0xac00
movslq (%rax), %rsi
movq %rbx, %rdi
callq 0xa73a
addq $0x40, %rax
movq %r14, %rdi
movq %rax, %rsi
callq 0x43f0
movq %rax, %rdi
leaq 0xf32f1(%rip), %rsi     # 0xfc4cc
callq 0x4480
movq 0xf0(%rsp), %rax
movq 0x8(%rax,%rbp), %rsi
subq (%rax,%rbp), %rsi
sarq $0x2, %rsi
decq %rsi
movq %r14, %rdi
callq 0x42e0
movq %rax, %rdi
leaq 0xf32c5(%rip), %rsi     # 0xfc4cf
callq 0x4480
pushq $0x1
popq %rax
movl %eax, %r15d
movl %r15d, %r15d
movq 0xf0(%rsp), %rdi
movq 0x8(%rdi,%rbp), %rax
subq (%rdi,%rbp), %rax
sarq $0x2, %rax
cmpq %r15, %rax
jbe 0x9267
addq %rbp, %rdi
movq %r15, %rsi
callq 0xac00
movslq (%rax), %rsi
movq %rbx, %rdi
callq 0xa73a
addq $0x40, %rax
movq %r14, %rdi
movq %rax, %rsi
callq 0x43f0
movq %rax, %rdi
movq %r13, %rsi
callq 0x4480
incl %r15d
jmp 0x9215
movq %r14, %rdi
leaq 0xf930d(%rip), %rsi     # 0x10257e
callq 0x4480
incl %r12d
jmp 0x9182
leaq 0x500(%rsp), %rdi
callq 0x4080
leaq 0x500(%rsp), %rdi
callq 0x4120
leaq 0x2f0(%rsp), %rdi
callq 0x4120
leaq 0x1c8(%rsp), %rdi
callq 0xa976
leaq 0xc0(%rsp), %rdi
callq 0xb290
leaq 0xf0(%rsp), %rdi
callq 0xad7e
addq $0x718, %rsp            # imm = 0x718
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x92f9
jmp 0x933f
jmp 0x9337
movq %rax, %rbx
leaq 0x1f0(%rsp), %rdi
callq 0xad30
jmp 0x93d2
movq %rax, %rbx
jmp 0x934f
jmp 0x93cf
movq %rax, %rbx
leaq 0x2d0(%rsp), %rdi
callq 0x4210
jmp 0x93f9
movq %rax, %rbx
jmp 0x93df
jmp 0x9337
jmp 0x93cf
jmp 0x9337
jmp 0x933f
jmp 0x9337
jmp 0x9337
jmp 0x9337
jmp 0x9337
jmp 0x9337
jmp 0x9337
movq %rax, %rbx
jmp 0x93f9
movq %rax, %rbx
leaq 0x500(%rsp), %rdi
callq 0x4120
leaq 0x2f0(%rsp), %rdi
callq 0x4120
jmp 0x93f9
jmp 0x93cf
jmp 0x93a8
movq %rax, %rbx
leaq 0x268(%rsp), %rdi
callq 0x4210
jmp 0x9398
jmp 0x93a8
jmp 0x93a8
jmp 0x93cf
jmp 0x93cf
jmp 0x93cf
movq %rax, %rbx
leaq 0x248(%rsp), %rdi
callq 0x4210
jmp 0x93be
jmp 0x93cf
movq %rax, %rbx
leaq 0x228(%rsp), %rdi
jmp 0x93c6
jmp 0x93cf
jmp 0x93cf
jmp 0x93cf
movq %rax, %rbx
leaq 0x70(%rsp), %rdi
callq 0xb25c
jmp 0x93d2
jmp 0x93cf
jmp 0x93cf
movq %rax, %rbx
leaq 0x208(%rsp), %rdi
callq 0x4210
jmp 0x93d2
jmp 0x93cf
movq %rax, %rbx
leaq 0x190(%rsp), %rdi
callq 0xb25c
leaq 0x500(%rsp), %rdi
callq 0xb290
leaq 0x2f0(%rsp), %rdi
callq 0xad30
leaq 0x1c8(%rsp), %rdi
callq 0xa976
leaq 0xc0(%rsp), %rdi
callq 0xb290
leaq 0xf0(%rsp), %rdi
callq 0xad7e
movq %rbx, %rdi
callq 0x4780