// File: Luthaf[P]zeopp/feature.cc
// Function: FEATURE::calculateSurfaceArea_OLD(ATOM_NETWORK*, std::vector<DIJKSTRA_NODE, std::allocator<DIJKSTRA_NODE>>*, std::vector<int, std::allocator<int>>*, int, char*, int)
double FEATURE::calculateSurfaceArea_OLD(ATOM_NETWORK *uc,vector<DIJKSTRA_NODE> *ChanNodeList,vector <int> *featnodemap,int curr_f,char *name,int fid){
 
  long int i,j,k,counter=0;  
  double volume;
  int step;
  double r_tr; // threshold for r
  XYZ max,min;
  XYZ box;
  XYZ pt;

  vector <double> SA_holo;  // stores hologram for each feature
  vector <double> SA_holo_otherf; // as above but excluding surface that is covered by other segments

  srand(randSeed2);
  SPHERE sph,sph2;
  vector <SPHERE> object; // a vector of spheres that define object (segemnt/feature/channel)

  vector <SPHERE> other_object; // vectors of spheres corresponding to other segments

    // Draw the components located in each unit cell
    for(unsigned int i = 0; i < unitCells.size(); i++){
      vector<int> nodeIDs = ucNodes.at(i);
      DELTA_POS disp = unitCells.at(i);
      
      // Iterate over all nodes in the unit cell
      for(unsigned int j = 0; j < nodeIDs.size(); j++){
	DIJKSTRA_NODE curNode = nodes.at(nodeIDs.at(j));
	
	// Find node coordinates

        if(dimensionality<1) 
           { // if feature is not a channel, use reconstrcted feature
	   sph.x = curNode.x + v_a.x*disp.x + v_b.x*disp.y + v_c.x*disp.z;
	   sph.y = curNode.y + v_a.y*disp.x + v_b.y*disp.y + v_c.y*disp.z;
	   sph.z = curNode.z + v_a.z*disp.x + v_b.z*disp.y + v_c.z*disp.z;
           } else {
           sph.x = nodes.at(nodeIDs.at(j)).x;sph.y = nodes.at(nodeIDs.at(j)).y;sph.z = nodes.at(nodeIDs.at(j)).z;
//           cout << "draw sphere { " << sph.x << "  " << sph.y << "  " << sph.z << " } radius 0.1 " << "\n"; 
           };

	sph.r = SPHERE_SCALE*curNode.max_radius;

        object.push_back(sph);

        if(object.size()==1)
          { // first sphere added
          min.x=sph.x-sph.r;max.x=sph.x+sph.r;
          min.y=sph.y-sph.r;max.y=sph.y+sph.r;
          min.z=sph.z-sph.r;max.z=sph.z+sph.r;
          }else
          {
          if(min.x>(sph.x-sph.r)) min.x=sph.x-sph.r;
          if(max.x<(sph.x+sph.r)) max.x=sph.x+sph.r;
          if(min.y>(sph.y-sph.r)) min.y=sph.y-sph.r;
          if(max.y<(sph.y+sph.r)) max.y=sph.y+sph.r;
          if(min.z>(sph.z-sph.r)) min.z=sph.z-sph.r;
          if(max.z<(sph.z+sph.r)) max.z=sph.z+sph.r;
          };
		
      }
    } // end of analysis of object



// Create a list of spheres that overlap with the current feature
/*
 for(j=0;j<(int)ChanNodeList->size();j++)
    {
    int count=0;
    int count2=0;
    Point node;
    node.x=ChanNodeList->at(j).x; node.y=ChanNodeList->at(j).y; node.z=ChanNodeList->at(j).z;
    node=uc->shiftXYZInUC(node);

    for(int i = 0; i < (int)object.size(); i++){
       Point p;
       p.x=object[i].x;p.y=object[i].y;p.z=object[i].z;
       Point p_shifted=uc->shiftXYZInUC(p);

       double dist = uc->calcDistanceXYZ(p.x,p.y,p.z,node.x,node.y,node.z);
       if(dist<0.01&&fabs(ChanNodeList->at(j).max_radius*SPHERE_SCALE-object[i].r)<0.01) 
          {
          count++; break;
          };

       if(dist<ChanNodeList->at(j).max_radius*SPHERE_SCALE+object[i].r)
         {
         count2++;
         };

       };

    if(count==0) // if node is not a part of the current feature
      {
      if(count2>0) {
        //origDNet->nodes[j] is an sphere overlapping with the current feature
        sph2.r=ChanNodeList->at(j).max_radius*SPHERE_SCALE;
        sph2.x=node.x; sph2.y=node.y; sph2.z=node.z;
        other_object.push_back(sph2);
        };
      };

    };
*/

// New version of code to find overlapping nodes

vector <int> conn_feat;

 for(j=0;j<(int)ChanNodeList->size();j++)
    {
    if(featnodemap->at(j)==curr_f)
      {
      for(i=0;i<(int)(ChanNodeList->at(j).connections.size());i++)      
         {
         if(featnodemap->at(ChanNodeList->at(j).connections.at(i).to)!=curr_f)
            {
            int flag=0;
            for(k=0;k<(int)conn_feat.size();k++)
               {
               if(conn_feat[k]==featnodemap->at(ChanNodeList->at(j).connections.at(i).to)) flag=1;
               };
            if(flag==0) conn_feat.push_back(featnodemap->at(ChanNodeList->at(j).connections.at(i).to));
            };
         };
      };
    }

for(i=0;i<(int)conn_feat.size();i++)
 for(j=0;j<(int)ChanNodeList->size();j++)
    {
    if(featnodemap->at(j)==i)
       {
       Point node;
       node[0]=ChanNodeList->at(j).x; node[1]=ChanNodeList->at(j).y; node[2]=ChanNodeList->at(j).z;
       node=uc->shiftXYZInUC(node);

       sph2.r=ChanNodeList->at(j).max_radius*SPHERE_SCALE;
       sph2.x=node[0]; sph2.y=node[1]; sph2.z=node[2];
       other_object.push_back(sph2);

       };
    };



cout << "Outside spheres list contain " << other_object.size() << " spheres (of " << ChanNodeList->size() << " nodes)." << "\n";


//

  box.x=max.x-min.x;
  box.y=max.y-min.y;
  box.z=max.z-min.z;
 
  volume=box.x*box.y*box.z;

//  cout << "Segment Box volume= " << volume << "\n"; 

// Now MC integration of surface

//int pos_origDNet;

SA_holo.resize(NBINS_SA_HOLO,0);
SA_holo_otherf.resize(NBINS_SA_HOLO,0);

for(step=0;step<NBINS_SA_HOLO;step++) // loop over all bins for surface area holograms
   {
   r_tr=(double)step*SA_HOLO_STEP;

   counter=0;

   for(j=0;j<(int)object.size();j++)
      {
      if(object[j].r>r_tr) { counter++;break;}; // at least one sphere larger than r_tr, sampling makes sense
      };


   if(counter>0)
     { // sampling makes sense

//     double totalSA = 0;
//     int sampleCount = 0;

     // Sample around each of the object's spheres
     for(int i = 0; i < (int)object.size(); i++){


        // now go to sampling

//        cout << "Object " << i << "\n"; cout.flush();

        int count = 0;
        int count_otherf=0;

        if(object[i].r-r_tr>0)
        for(int j = 0; j < N_MC_SA_SAMPLE; j++){

        bool overlap=false;
        bool overlap_otherf=false; // overlap with other features

        // Randomly sample point on a sphere of radius 1
        double theta = (rand()*1.0/RAND_MAX)*2*PI;
        double cosphi = 1.0 - (rand()*1.0/RAND_MAX)*2.0;
        double phi = acos(cosphi);

        // Convert spherical coordinates to xyz coordinates
        double xpoint = sin(phi)*cos(theta); //Don't need abs(sin(phi)) becase phi is from 0 to pi
        double ypoint = sin(phi)*sin(theta);
        double zpoint = cosphi;	
      
        // Scale the point to lie on a radius of r_probe + r_atom#i
        xpoint *= (object[i].r-r_tr);
        ypoint *= (object[i].r-r_tr);
        zpoint *= (object[i].r-r_tr);

        // move the point to the segment

        pt.x=object[i].x+xpoint;
        pt.y=object[i].y+ypoint;
        pt.z=object[i].z+zpoint;


        if(dimensionality<1)
          { // if the feature is not a channel, just check overlap with other spheres

          for(k=0;k<(int)object.size();k++)
             {
             if(k!=i)
                {
                if(calcEuclideanDistance(pt.x,pt.y,pt.z,object[k].x,object[k].y,object[k].z)<(object[k].r-r_tr)- 0.00001)
                   {
                   overlap=true; break;
                   };
                };
             };

          if(overlap==false) count++;


          //otherlap with other segments

         if(overlap==false)
         for(int jj=0;jj<(int)other_object.size();jj++)
            {
            Point p;
            p[0]=pt.x;p[1]=pt.y;p[2]=pt.z;
            Point p_shifted=uc->shiftXYZInUC(p);

            double dist = uc->calcDistanceXYZ(p[0],p[1],p[2],other_object[jj].x,other_object[jj].y,other_object[jj].z);

            if(dist<other_object[jj].r) {
                 overlap_otherf=true; break;
                 };

           };

 
          if(overlap_otherf==false) count_otherf++;

          }else{
          // sample points in case of channels, have to use pbc here

          // Convert (x,y,z) coordinates to ones relative to the unit cell vectors
          Point abc_coords = uc->xyz_to_abc(pt.x, pt.y, pt.z);

          abc_coords=uc->shiftABCInUC(abc_coords);
/*
          if(abc_coords.x<0||abc_coords.x>=1||abc_coords.y<0||abc_coords.y>=1||abc_coords.z<0||abc_coords.z>=1)
             {
             overlap=true;           
             };
*/
          if(overlap!=true)
            {
            for(k=0;k<(int)object.size();k++)
               {
               if(k!=i)
                  {
                  Point new_abc=uc->xyz_to_abc(object[k].x, object[k].y, object[k].z);
                  double centerDist = uc->calcDistanceABC(new_abc[0],new_abc[1],new_abc[2],abc_coords[0],abc_coords[1],abc_coords[2]);
                  if(centerDist < (object[k].r-r_tr) - 0.00001){
                     overlap=true; break;
                     };
                  };
               };

            };
          if(overlap==false) count++;

         // check otherlap with other segments
  
         if(overlap==false)
         for(int jk=0;jk<(int)other_object.size();jk++)
            {
            Point p;
            p[0]=pt.x;p[1]=pt.y;p[2]=pt.z;
            Point p_shifted=uc->shiftXYZInUC(p);

            double dist = uc->calcDistanceXYZ(p[0],p[1],p[2],other_object[jk].x,other_object[jk].y,other_object[jk].z);

            if(dist<other_object[jk].r) {
                 overlap_otherf=true; break;
                 };

           };
          

          if(overlap_otherf == false) 
	    count_otherf++;

          }; // end if, for channels (dim>0)

     
       }; // ends for(int j = 0; j < N_MC_SA_SAMPLE; j++){

//     cout << " count= " << count << "    cont_otherf= " << count_otherf << "\n";

     SA_holo[step]+= ((double)count/(double)N_MC_SA_SAMPLE)* 4.0 * PI * pow(object[i].r-r_tr,2);
     SA_holo_otherf[step]+= ((double)count_otherf/(double)N_MC_SA_SAMPLE)* 4.0 * PI * pow(object[i].r-r_tr,2);
     }; // ends for(int i = 0; i < (int)object.size() 

     }else   // from if(counter>0)
     {
     // surface area is 0
     SA_holo[step]=0;
     }; // ends  if(counter>0)

   }; // ends for(step=0;step<NBINS_SA_HOLO;step++)


cout << "##SA_holo:  " << name << "  Feature=  " << fid << "   ";
for(i=0;i<NBINS_SA_HOLO;i++)
   {
   cout << SA_holo[i] << "   ";
   };

cout << " Other:  ";
for(i=0;i<NBINS_SA_HOLO;i++)
   {
   cout << SA_holo_otherf[i] << "   ";
   };

cout << "\n";

//volume=volume*((double)(N_MC_SAMPLE-counter))/(double)N_MC_SAMPLE;

return SA_holo[0];


}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x830, %rsp            # imm = 0x830
movl 0x10(%rbp), %eax
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq %rcx, -0x20(%rbp)
movl %r8d, -0x24(%rbp)
movq %r9, -0x30(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x3e0(%rbp)
movq $0x0, -0x50(%rbp)
leaq -0x80(%rbp), %rdi
xorps %xmm2, %xmm2
movaps %xmm2, %xmm0
movaps %xmm2, %xmm1
callq 0xea8e0
leaq -0x98(%rbp), %rdi
xorps %xmm2, %xmm2
movaps %xmm2, %xmm0
movaps %xmm2, %xmm1
callq 0xea8e0
leaq -0xb0(%rbp), %rdi
xorps %xmm2, %xmm2
movaps %xmm2, %xmm0
movaps %xmm2, %xmm1
callq 0xea8e0
leaq -0xc8(%rbp), %rdi
xorps %xmm2, %xmm2
movaps %xmm2, %xmm0
movaps %xmm2, %xmm1
callq 0xea8e0
leaq -0xe0(%rbp), %rdi
callq 0xf650
leaq -0xf8(%rbp), %rdi
callq 0xf650
movl $0x3b4ca6f5, %edi       # imm = 0x3B4CA6F5
callq 0x5510
leaq -0x150(%rbp), %rdi
callq 0x852e0
leaq -0x168(%rbp), %rdi
callq 0x852e0
movl $0x0, -0x16c(%rbp)
movq -0x3e0(%rbp), %rdi
movl -0x16c(%rbp), %eax
movq %rax, -0x3e8(%rbp)
addq $0x90, %rdi
callq 0x706e0
movq %rax, %rcx
movq -0x3e8(%rbp), %rax
cmpq %rcx, %rax
jae 0xdec0a
movq -0x3e0(%rbp), %rdi
addq $0xa8, %rdi
movl -0x16c(%rbp), %eax
movl %eax, %esi
callq 0xaf5b0
movq %rax, -0x3f0(%rbp)
jmp 0xde625
movq -0x3f0(%rbp), %rsi
leaq -0x188(%rbp), %rdi
callq 0xeec0
jmp 0xde63a
movq -0x3e0(%rbp), %rdi
addq $0x90, %rdi
movl -0x16c(%rbp), %eax
movl %eax, %esi
callq 0xcd720
movq %rax, -0x3f8(%rbp)
jmp 0xde65e
movq -0x3f8(%rbp), %rax
movq (%rax), %rcx
movq %rcx, -0x1a0(%rbp)
movl 0x8(%rax), %eax
movl %eax, -0x198(%rbp)
movl $0x0, -0x1a4(%rbp)
movl -0x1a4(%rbp), %eax
movq %rax, -0x400(%rbp)
leaq -0x188(%rbp), %rdi
callq 0x10090
movq %rax, %rcx
movq -0x400(%rbp), %rax
cmpq %rcx, %rax
jae 0xdebd9
movq -0x3e0(%rbp), %rax
addq $0x60, %rax
movq %rax, -0x410(%rbp)
movl -0x1a4(%rbp), %eax
movl %eax, %esi
leaq -0x188(%rbp), %rdi
callq 0x101d0
movq %rax, -0x408(%rbp)
jmp 0xde6dd
movq -0x410(%rbp), %rdi
movq -0x408(%rbp), %rax
movslq (%rax), %rsi
callq 0x10130
movq %rax, -0x418(%rbp)
jmp 0xde6fc
movq -0x418(%rbp), %rsi
leaq -0x1f0(%rbp), %rdi
callq 0x64400
jmp 0xde711
movq -0x3e0(%rbp), %rax
cmpl $0x1, 0x108(%rax)
jge 0xde867
movq -0x3e0(%rbp), %rax
movsd -0x1e8(%rbp), %xmm1
movsd 0xc0(%rax), %xmm0
cvtsi2sdl -0x1a0(%rbp), %xmm2
mulsd %xmm2, %xmm0
addsd %xmm1, %xmm0
movsd 0xd8(%rax), %xmm1
cvtsi2sdl -0x19c(%rbp), %xmm2
mulsd %xmm2, %xmm1
addsd %xmm0, %xmm1
movsd 0xf0(%rax), %xmm0
cvtsi2sdl -0x198(%rbp), %xmm2
mulsd %xmm2, %xmm0
addsd %xmm1, %xmm0
movsd %xmm0, -0x118(%rbp)
movsd -0x1e0(%rbp), %xmm1
movsd 0xc8(%rax), %xmm0
cvtsi2sdl -0x1a0(%rbp), %xmm2
mulsd %xmm2, %xmm0
addsd %xmm1, %xmm0
movsd 0xe0(%rax), %xmm1
cvtsi2sdl -0x19c(%rbp), %xmm2
mulsd %xmm2, %xmm1
addsd %xmm0, %xmm1
movsd 0xf8(%rax), %xmm0
cvtsi2sdl -0x198(%rbp), %xmm2
mulsd %xmm2, %xmm0
addsd %xmm1, %xmm0
movsd %xmm0, -0x110(%rbp)
movsd -0x1d8(%rbp), %xmm1
movsd 0xd0(%rax), %xmm0
cvtsi2sdl -0x1a0(%rbp), %xmm2
mulsd %xmm2, %xmm0
addsd %xmm1, %xmm0
movsd 0xe8(%rax), %xmm1
cvtsi2sdl -0x19c(%rbp), %xmm2
mulsd %xmm2, %xmm1
addsd %xmm0, %xmm1
movsd 0x100(%rax), %xmm0
cvtsi2sdl -0x198(%rbp), %xmm2
mulsd %xmm2, %xmm0
addsd %xmm1, %xmm0
movsd %xmm0, -0x108(%rbp)
jmp 0xde9b2
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x190(%rbp)
movl %eax, -0x194(%rbp)
jmp 0xe04fe
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x190(%rbp)
movl %eax, -0x194(%rbp)
jmp 0xdebf9
movq -0x3e0(%rbp), %rax
addq $0x60, %rax
movq %rax, -0x428(%rbp)
movl -0x1a4(%rbp), %eax
movl %eax, %esi
leaq -0x188(%rbp), %rdi
callq 0x101d0
movq %rax, -0x420(%rbp)
jmp 0xde896
movq -0x428(%rbp), %rdi
movq -0x420(%rbp), %rax
movslq (%rax), %rsi
callq 0x10130
movq %rax, -0x430(%rbp)
jmp 0xde8b5
movq -0x3e0(%rbp), %rax
movq -0x430(%rbp), %rcx
movsd 0x8(%rcx), %xmm0
movsd %xmm0, -0x118(%rbp)
addq $0x60, %rax
movq %rax, -0x440(%rbp)
movl -0x1a4(%rbp), %eax
movl %eax, %esi
leaq -0x188(%rbp), %rdi
callq 0x101d0
movq %rax, -0x438(%rbp)
jmp 0xde8f8
movq -0x440(%rbp), %rdi
movq -0x438(%rbp), %rax
movslq (%rax), %rsi
callq 0x10130
movq %rax, -0x448(%rbp)
jmp 0xde917
movq -0x3e0(%rbp), %rax
movq -0x448(%rbp), %rcx
movsd 0x10(%rcx), %xmm0
movsd %xmm0, -0x110(%rbp)
addq $0x60, %rax
movq %rax, -0x458(%rbp)
movl -0x1a4(%rbp), %eax
movl %eax, %esi
leaq -0x188(%rbp), %rdi
callq 0x101d0
movq %rax, -0x450(%rbp)
jmp 0xde95a
movq -0x458(%rbp), %rdi
movq -0x450(%rbp), %rax
movslq (%rax), %rsi
callq 0x10130
movq %rax, -0x460(%rbp)
jmp 0xde979
movq -0x460(%rbp), %rax
movsd 0x18(%rax), %xmm0
movsd %xmm0, -0x108(%rbp)
jmp 0xde9b2
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x190(%rbp)
movl %eax, -0x194(%rbp)
leaq -0x1f0(%rbp), %rdi
callq 0x100e0
jmp 0xdebf9
movsd -0x1b8(%rbp), %xmm0
movsd 0x11892e(%rip), %xmm1   # 0x1f72f0
mulsd %xmm1, %xmm0
movsd %xmm0, -0x100(%rbp)
leaq -0x150(%rbp), %rdi
leaq -0x118(%rbp), %rsi
callq 0x85360
jmp 0xde9e3
leaq -0x150(%rbp), %rdi
callq 0x85300
cmpq $0x1, %rax
jne 0xdea85
movsd -0x118(%rbp), %xmm0
subsd -0x100(%rbp), %xmm0
movsd %xmm0, -0x98(%rbp)
movsd -0x118(%rbp), %xmm0
addsd -0x100(%rbp), %xmm0
movsd %xmm0, -0x80(%rbp)
movsd -0x110(%rbp), %xmm0
subsd -0x100(%rbp), %xmm0
movsd %xmm0, -0x90(%rbp)
movsd -0x110(%rbp), %xmm0
addsd -0x100(%rbp), %xmm0
movsd %xmm0, -0x78(%rbp)
movsd -0x108(%rbp), %xmm0
subsd -0x100(%rbp), %xmm0
movsd %xmm0, -0x88(%rbp)
movsd -0x108(%rbp), %xmm0
addsd -0x100(%rbp), %xmm0
movsd %xmm0, -0x70(%rbp)
jmp 0xdebb9
movsd -0x98(%rbp), %xmm0
movsd -0x118(%rbp), %xmm1
subsd -0x100(%rbp), %xmm1
ucomisd %xmm1, %xmm0
jbe 0xdeabb
movsd -0x118(%rbp), %xmm0
subsd -0x100(%rbp), %xmm0
movsd %xmm0, -0x98(%rbp)
movsd -0x80(%rbp), %xmm1
movsd -0x118(%rbp), %xmm0
addsd -0x100(%rbp), %xmm0
ucomisd %xmm1, %xmm0
jbe 0xdeaeb
movsd -0x118(%rbp), %xmm0
addsd -0x100(%rbp), %xmm0
movsd %xmm0, -0x80(%rbp)
movsd -0x90(%rbp), %xmm0
movsd -0x110(%rbp), %xmm1
subsd -0x100(%rbp), %xmm1
ucomisd %xmm1, %xmm0
jbe 0xdeb21
movsd -0x110(%rbp), %xmm0
subsd -0x100(%rbp), %xmm0
movsd %xmm0, -0x90(%rbp)
movsd -0x78(%rbp), %xmm1
movsd -0x110(%rbp), %xmm0
addsd -0x100(%rbp), %xmm0
ucomisd %xmm1, %xmm0
jbe 0xdeb51
movsd -0x110(%rbp), %xmm0
addsd -0x100(%rbp), %xmm0
movsd %xmm0, -0x78(%rbp)
movsd -0x88(%rbp), %xmm0
movsd -0x108(%rbp), %xmm1
subsd -0x100(%rbp), %xmm1
ucomisd %xmm1, %xmm0
jbe 0xdeb87
movsd -0x108(%rbp), %xmm0
subsd -0x100(%rbp), %xmm0
movsd %xmm0, -0x88(%rbp)
movsd -0x70(%rbp), %xmm1
movsd -0x108(%rbp), %xmm0
addsd -0x100(%rbp), %xmm0
ucomisd %xmm1, %xmm0
jbe 0xdebb7
movsd -0x108(%rbp), %xmm0
addsd -0x100(%rbp), %xmm0
movsd %xmm0, -0x70(%rbp)
jmp 0xdebb9
leaq -0x1f0(%rbp), %rdi
callq 0x100e0
movl -0x1a4(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x1a4(%rbp)
jmp 0xde682
leaq -0x188(%rbp), %rdi
callq 0xec80
movl -0x16c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x16c(%rbp)
jmp 0xde5ce
leaq -0x188(%rbp), %rdi
callq 0xec80
jmp 0xe04fe
leaq -0x208(%rbp), %rdi
callq 0xd0d0
movq $0x0, -0x40(%rbp)
movq -0x40(%rbp), %rax
movq %rax, -0x468(%rbp)
movq -0x18(%rbp), %rdi
callq 0x10100
movq %rax, %rcx
movq -0x468(%rbp), %rax
movslq %ecx, %rcx
cmpq %rcx, %rax
jge 0xdeedf
movq -0x20(%rbp), %rdi
movq -0x40(%rbp), %rsi
callq 0x101d0
movq %rax, -0x470(%rbp)
jmp 0xdec5e
movq -0x470(%rbp), %rax
movl (%rax), %eax
cmpl -0x24(%rbp), %eax
jne 0xdeecc
movq $0x0, -0x38(%rbp)
movq -0x38(%rbp), %rax
movq %rax, -0x480(%rbp)
movq -0x18(%rbp), %rdi
movq -0x40(%rbp), %rsi
callq 0x10130
movq %rax, -0x478(%rbp)
jmp 0xdec99
movq -0x478(%rbp), %rdi
addq $0x20, %rdi
callq 0x2a9e0
movq %rax, %rcx
movq -0x480(%rbp), %rax
movslq %ecx, %rcx
cmpq %rcx, %rax
jge 0xdeeca
movq -0x20(%rbp), %rax
movq %rax, -0x490(%rbp)
movq -0x18(%rbp), %rdi
movq -0x40(%rbp), %rsi
callq 0x10130
movq %rax, -0x488(%rbp)
jmp 0xdece0
movq -0x488(%rbp), %rdi
addq $0x20, %rdi
movq -0x38(%rbp), %rsi
callq 0x64470
movq %rax, -0x498(%rbp)
jmp 0xdecfd
movq -0x490(%rbp), %rdi
movq -0x498(%rbp), %rax
movslq 0x4(%rax), %rsi
callq 0x101d0
movq %rax, -0x4a0(%rbp)
jmp 0xded1d
movq -0x4a0(%rbp), %rax
movl (%rax), %eax
cmpl -0x24(%rbp), %eax
je 0xdeeb7
movl $0x0, -0x20c(%rbp)
movq $0x0, -0x48(%rbp)
movq -0x48(%rbp), %rax
movq %rax, -0x4a8(%rbp)
leaq -0x208(%rbp), %rdi
callq 0x10090
movq %rax, %rcx
movq -0x4a8(%rbp), %rax
movslq %ecx, %rcx
cmpq %rcx, %rax
jge 0xdee37
movq -0x48(%rbp), %rsi
leaq -0x208(%rbp), %rdi
callq 0xed60
movl (%rax), %eax
movl %eax, -0x4bc(%rbp)
movq -0x20(%rbp), %rax
movq %rax, -0x4b8(%rbp)
movq -0x18(%rbp), %rdi
movq -0x40(%rbp), %rsi
callq 0x10130
movq %rax, -0x4b0(%rbp)
jmp 0xdeda7
movq -0x4b0(%rbp), %rdi
addq $0x20, %rdi
movq -0x38(%rbp), %rsi
callq 0x64470
movq %rax, -0x4c8(%rbp)
jmp 0xdedc4
movq -0x4b8(%rbp), %rdi
movq -0x4c8(%rbp), %rax
movslq 0x4(%rax), %rsi
callq 0x101d0
movq %rax, -0x4d0(%rbp)
jmp 0xdede4
movl -0x4bc(%rbp), %eax
movq -0x4d0(%rbp), %rcx
cmpl (%rcx), %eax
jne 0xdee24
movl $0x1, -0x20c(%rbp)
jmp 0xdee24
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x190(%rbp)
movl %eax, -0x194(%rbp)
leaq -0x208(%rbp), %rdi
callq 0xec80
jmp 0xe04fe
jmp 0xdee26
movq -0x48(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x48(%rbp)
jmp 0xded41
cmpl $0x0, -0x20c(%rbp)
jne 0xdeeb5
movq -0x20(%rbp), %rax
movq %rax, -0x4e0(%rbp)
movq -0x18(%rbp), %rdi
movq -0x40(%rbp), %rsi
callq 0x10130
movq %rax, -0x4d8(%rbp)
jmp 0xdee61
movq -0x4d8(%rbp), %rdi
addq $0x20, %rdi
movq -0x38(%rbp), %rsi
callq 0x64470
movq %rax, -0x4e8(%rbp)
jmp 0xdee7e
movq -0x4e0(%rbp), %rdi
movq -0x4e8(%rbp), %rax
movslq 0x4(%rax), %rsi
callq 0x101d0
movq %rax, -0x4f0(%rbp)
jmp 0xdee9e
movq -0x4f0(%rbp), %rsi
leaq -0x208(%rbp), %rdi
callq 0xd1b0
jmp 0xdeeb3
jmp 0xdeeb5
jmp 0xdeeb7
jmp 0xdeeb9
movq -0x38(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x38(%rbp)
jmp 0xdec78
jmp 0xdeecc
jmp 0xdeece
movq -0x40(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x40(%rbp)
jmp 0xdec1e
movq $0x0, -0x38(%rbp)
movq -0x38(%rbp), %rax
movq %rax, -0x4f8(%rbp)
leaq -0x208(%rbp), %rdi
callq 0x10090
movq %rax, %rcx
movq -0x4f8(%rbp), %rax
movslq %ecx, %rcx
cmpq %rcx, %rax
jge 0xdf1e2
movq $0x0, -0x40(%rbp)
movq -0x40(%rbp), %rax
movq %rax, -0x500(%rbp)
movq -0x18(%rbp), %rdi
callq 0x10100
movq %rax, %rcx
movq -0x500(%rbp), %rax
movslq %ecx, %rcx
cmpq %rcx, %rax
jge 0xdf1cf
movq -0x20(%rbp), %rdi
movq -0x40(%rbp), %rsi
callq 0x101d0
movq %rax, -0x508(%rbp)
jmp 0xdef5c
movq -0x508(%rbp), %rax
movslq (%rax), %rax
cmpq -0x38(%rbp), %rax
jne 0xdf1bc
leaq -0x230(%rbp), %rdi
xorps %xmm2, %xmm2
movaps %xmm2, %xmm0
movaps %xmm2, %xmm1
callq 0xe9c70
jmp 0xdef87
movq -0x18(%rbp), %rdi
movq -0x40(%rbp), %rsi
callq 0x10130
movq %rax, -0x510(%rbp)
jmp 0xdef9d
movq -0x510(%rbp), %rax
movsd 0x8(%rax), %xmm0
movsd %xmm0, -0x520(%rbp)
leaq -0x230(%rbp), %rdi
xorl %esi, %esi
callq 0xe9d70
movq %rax, -0x518(%rbp)
jmp 0xdefc8
movq -0x518(%rbp), %rax
movsd -0x520(%rbp), %xmm0
movsd %xmm0, (%rax)
movq -0x18(%rbp), %rdi
movq -0x40(%rbp), %rsi
callq 0x10130
movq %rax, -0x528(%rbp)
jmp 0xdeff1
movq -0x528(%rbp), %rax
movsd 0x10(%rax), %xmm0
movsd %xmm0, -0x538(%rbp)
leaq -0x230(%rbp), %rdi
movl $0x1, %esi
callq 0xe9d70
movq %rax, -0x530(%rbp)
jmp 0xdf01f
movq -0x530(%rbp), %rax
movsd -0x538(%rbp), %xmm0
movsd %xmm0, (%rax)
movq -0x18(%rbp), %rdi
movq -0x40(%rbp), %rsi
callq 0x10130
movq %rax, -0x540(%rbp)
jmp 0xdf048
movq -0x540(%rbp), %rax
movsd 0x18(%rax), %xmm0
movsd %xmm0, -0x550(%rbp)
leaq -0x230(%rbp), %rdi
movl $0x2, %esi
callq 0xe9d70
movq %rax, -0x548(%rbp)
jmp 0xdf076
movq -0x548(%rbp), %rax
movsd -0x550(%rbp), %xmm0
movsd %xmm0, (%rax)
movq -0x10(%rbp), %rsi
movq -0x220(%rbp), %rax
movq %rax, -0x250(%rbp)
movups -0x230(%rbp), %xmm0
movaps %xmm0, -0x260(%rbp)
movq -0x250(%rbp), %rcx
movq %rsp, %rax
movq %rcx, 0x10(%rax)
movaps -0x260(%rbp), %xmm0
movups %xmm0, (%rax)
leaq -0x248(%rbp), %rdi
callq 0x97f20
jmp 0xdf0cf
movq -0x238(%rbp), %rax
movq %rax, -0x220(%rbp)
movups -0x248(%rbp), %xmm0
movaps %xmm0, -0x230(%rbp)
movq -0x18(%rbp), %rdi
movq -0x40(%rbp), %rsi
callq 0x10130
movq %rax, -0x558(%rbp)
jmp 0xdf101
movq -0x558(%rbp), %rax
movsd 0x38(%rax), %xmm0
movsd 0x1181db(%rip), %xmm1   # 0x1f72f0
mulsd %xmm1, %xmm0
movsd %xmm0, -0x120(%rbp)
leaq -0x230(%rbp), %rdi
xorl %esi, %esi
callq 0xe9d70
movq %rax, -0x560(%rbp)
jmp 0xdf138
movq -0x560(%rbp), %rax
movsd (%rax), %xmm0
movsd %xmm0, -0x138(%rbp)
leaq -0x230(%rbp), %rdi
movl $0x1, %esi
callq 0xe9d70
movq %rax, -0x568(%rbp)
jmp 0xdf165
movq -0x568(%rbp), %rax
movsd (%rax), %xmm0
movsd %xmm0, -0x130(%rbp)
leaq -0x230(%rbp), %rdi
movl $0x2, %esi
callq 0xe9d70
movq %rax, -0x570(%rbp)
jmp 0xdf192
movq -0x570(%rbp), %rax
movsd (%rax), %xmm0
movsd %xmm0, -0x128(%rbp)
leaq -0x168(%rbp), %rdi
leaq -0x138(%rbp), %rsi
callq 0x85360
jmp 0xdf1ba
jmp 0xdf1bc
jmp 0xdf1be
movq -0x40(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x40(%rbp)
jmp 0xdef1c
jmp 0xdf1d1
movq -0x38(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x38(%rbp)
jmp 0xdeee7
movq 0x193dd7(%rip), %rdi    # 0x272fc0
leaq 0x11c99f(%rip), %rsi    # 0x1fbb8f
callq 0x5540
movq %rax, -0x578(%rbp)
jmp 0xdf1fe
leaq -0x168(%rbp), %rdi
callq 0x85300
movq -0x578(%rbp), %rdi
movq %rax, %rsi
callq 0x5160
movq %rax, -0x580(%rbp)
jmp 0xdf222
movq -0x580(%rbp), %rdi
leaq 0x11c97d(%rip), %rsi    # 0x1fbbad
callq 0x5540
movq %rax, -0x588(%rbp)
jmp 0xdf23e
movq -0x18(%rbp), %rdi
callq 0x10100
movq -0x588(%rbp), %rdi
movq %rax, %rsi
callq 0x5160
movq %rax, -0x590(%rbp)
jmp 0xdf25f
movq -0x590(%rbp), %rdi
leaq 0x11c94e(%rip), %rsi    # 0x1fbbbb
callq 0x5540
movq %rax, -0x598(%rbp)
jmp 0xdf27b
movq -0x598(%rbp), %rdi
leaq 0x11a39c(%rip), %rsi    # 0x1f9625
callq 0x5540
jmp 0xdf290
movsd -0x80(%rbp), %xmm0
movsd -0x98(%rbp), %xmm1
subsd %xmm1, %xmm0
movsd %xmm0, -0xb0(%rbp)
movsd -0x78(%rbp), %xmm0
movsd -0x90(%rbp), %xmm1
subsd %xmm1, %xmm0
movsd %xmm0, -0xa8(%rbp)
movsd -0x70(%rbp), %xmm0
movsd -0x88(%rbp), %xmm1
subsd %xmm1, %xmm0
movsd %xmm0, -0xa0(%rbp)
movsd -0xb0(%rbp), %xmm0
movsd -0xa8(%rbp), %xmm1
mulsd %xmm1, %xmm0
movsd -0xa0(%rbp), %xmm1
mulsd %xmm1, %xmm0
movsd %xmm0, -0x58(%rbp)
movq $0x0, -0x268(%rbp)
leaq -0xe0(%rbp), %rdi
movl $0x1, %esi
leaq -0x268(%rbp), %rdx
callq 0x85210
jmp 0xdf325
movq $0x0, -0x270(%rbp)
leaq -0xf8(%rbp), %rdi
movl $0x1, %esi
leaq -0x270(%rbp), %rdx
callq 0x85210
jmp 0xdf34a
movl $0x0, -0x5c(%rbp)
cmpl $0x1, -0x5c(%rbp)
jge 0xe0333
cvtsi2sdl -0x5c(%rbp), %xmm0
movsd 0x11c568(%rip), %xmm1   # 0x1fb8d0
mulsd %xmm1, %xmm0
movsd %xmm0, -0x68(%rbp)
movq $0x0, -0x50(%rbp)
movq $0x0, -0x40(%rbp)
movq -0x40(%rbp), %rax
movq %rax, -0x5a0(%rbp)
leaq -0x150(%rbp), %rdi
callq 0x85300
movq %rax, %rcx
movq -0x5a0(%rbp), %rax
movslq %ecx, %rcx
cmpq %rcx, %rax
jge 0xdf3e4
movq -0x40(%rbp), %rsi
leaq -0x150(%rbp), %rdi
callq 0x88920
movsd 0x18(%rax), %xmm0
ucomisd -0x68(%rbp), %xmm0
jbe 0xdf3d4
movq -0x50(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x50(%rbp)
jmp 0xdf3e4
jmp 0xdf3d6
movq -0x40(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x40(%rbp)
jmp 0xdf381
cmpq $0x0, -0x50(%rbp)
jle 0xe030c
movl $0x0, -0x274(%rbp)
movl -0x274(%rbp), %eax
movl %eax, -0x5a4(%rbp)
leaq -0x150(%rbp), %rdi
callq 0x85300
movq %rax, %rcx
movl -0x5a4(%rbp), %eax
cmpl %ecx, %eax
jge 0xe030a
movl $0x0, -0x278(%rbp)
movl $0x0, -0x27c(%rbp)
movslq -0x274(%rbp), %rsi
leaq -0x150(%rbp), %rdi
callq 0x88920
movsd 0x18(%rax), %xmm0
subsd -0x68(%rbp), %xmm0
xorps %xmm1, %xmm1
ucomisd %xmm1, %xmm0
jbe 0xe01c4
movl $0x0, -0x280(%rbp)
cmpl $0x1f4, -0x280(%rbp)    # imm = 0x1F4
jge 0xe01c2
movb $0x0, -0x281(%rbp)
movb $0x0, -0x282(%rbp)
callq 0x5190
cvtsi2sd %eax, %xmm0
movsd 0x112bb7(%rip), %xmm1   # 0x1f2050
mulsd %xmm1, %xmm0
movsd 0x117163(%rip), %xmm1   # 0x1f6608
divsd %xmm1, %xmm0
movsd 0x112b97(%rip), %xmm1   # 0x1f2048
mulsd %xmm1, %xmm0
movsd 0x117173(%rip), %xmm1   # 0x1f6630
mulsd %xmm1, %xmm0
movsd %xmm0, -0x290(%rbp)
callq 0x5190
cvtsi2sd %eax, %xmm0
movsd 0x112b76(%rip), %xmm1   # 0x1f2050
mulsd %xmm1, %xmm0
movsd 0x117122(%rip), %xmm1   # 0x1f6608
divsd %xmm1, %xmm0
movq %xmm0, %rax
movabsq $-0x8000000000000000, %rcx # imm = 0x8000000000000000
xorq %rcx, %rax
movq %rax, %xmm0
addsd %xmm0, %xmm0
movsd 0x112b43(%rip), %xmm1   # 0x1f2050
addsd %xmm1, %xmm0
movsd %xmm0, -0x298(%rbp)
movsd -0x298(%rbp), %xmm0
callq 0x54f0
movsd %xmm0, -0x2a0(%rbp)
movsd -0x2a0(%rbp), %xmm0
callq 0x5140
movsd %xmm0, -0x5b8(%rbp)
movsd -0x290(%rbp), %xmm0
callq 0x5970
movaps %xmm0, %xmm1
movsd -0x5b8(%rbp), %xmm0
mulsd %xmm1, %xmm0
movsd %xmm0, -0x2a8(%rbp)
movsd -0x2a0(%rbp), %xmm0
callq 0x5140
movsd %xmm0, -0x5b0(%rbp)
movsd -0x290(%rbp), %xmm0
callq 0x5140
movaps %xmm0, %xmm1
movsd -0x5b0(%rbp), %xmm0
mulsd %xmm1, %xmm0
movsd %xmm0, -0x2b0(%rbp)
movsd -0x298(%rbp), %xmm0
movsd %xmm0, -0x2b8(%rbp)
movslq -0x274(%rbp), %rsi
leaq -0x150(%rbp), %rdi
callq 0x88920
movsd 0x18(%rax), %xmm0
subsd -0x68(%rbp), %xmm0
mulsd -0x2a8(%rbp), %xmm0
movsd %xmm0, -0x2a8(%rbp)
movslq -0x274(%rbp), %rsi
leaq -0x150(%rbp), %rdi
callq 0x88920
movsd 0x18(%rax), %xmm0
subsd -0x68(%rbp), %xmm0
mulsd -0x2b0(%rbp), %xmm0
movsd %xmm0, -0x2b0(%rbp)
movslq -0x274(%rbp), %rsi
leaq -0x150(%rbp), %rdi
callq 0x88920
movsd 0x18(%rax), %xmm0
subsd -0x68(%rbp), %xmm0
mulsd -0x2b8(%rbp), %xmm0
movsd %xmm0, -0x2b8(%rbp)
movslq -0x274(%rbp), %rsi
leaq -0x150(%rbp), %rdi
callq 0x88920
movsd (%rax), %xmm0
addsd -0x2a8(%rbp), %xmm0
movsd %xmm0, -0xc8(%rbp)
movslq -0x274(%rbp), %rsi
leaq -0x150(%rbp), %rdi
callq 0x88920
movsd 0x8(%rax), %xmm0
addsd -0x2b0(%rbp), %xmm0
movsd %xmm0, -0xc0(%rbp)
movslq -0x274(%rbp), %rsi
leaq -0x150(%rbp), %rdi
callq 0x88920
movq %rax, %rcx
movq -0x3e0(%rbp), %rax
movsd 0x10(%rcx), %xmm0
addsd -0x2b8(%rbp), %xmm0
movsd %xmm0, -0xb8(%rbp)
cmpl $0x1, 0x108(%rax)
jge 0xdfb49
movq $0x0, -0x48(%rbp)
movq -0x48(%rbp), %rax
movq %rax, -0x5c0(%rbp)
leaq -0x150(%rbp), %rdi
callq 0x85300
movq %rax, %rcx
movq -0x5c0(%rbp), %rax
movslq %ecx, %rcx
cmpq %rcx, %rax
jge 0xdf81c
movq -0x48(%rbp), %rax
movslq -0x274(%rbp), %rcx
cmpq %rcx, %rax
je 0xdf809
movsd -0xc8(%rbp), %xmm0
movsd %xmm0, -0x5f0(%rbp)
movsd -0xc0(%rbp), %xmm0
movsd %xmm0, -0x5e8(%rbp)
movsd -0xb8(%rbp), %xmm0
movsd %xmm0, -0x5e0(%rbp)
movq -0x48(%rbp), %rsi
leaq -0x150(%rbp), %rdi
movq %rdi, -0x5f8(%rbp)
callq 0x88920
movq -0x5f8(%rbp), %rdi
movsd (%rax), %xmm0
movsd %xmm0, -0x5d8(%rbp)
movq -0x48(%rbp), %rsi
callq 0x88920
movq -0x5f8(%rbp), %rdi
movsd 0x8(%rax), %xmm0
movsd %xmm0, -0x5d0(%rbp)
movq -0x48(%rbp), %rsi
callq 0x88920
movsd -0x5f0(%rbp), %xmm0
movsd -0x5e8(%rbp), %xmm1
movsd -0x5e0(%rbp), %xmm2
movsd -0x5d8(%rbp), %xmm3
movsd -0x5d0(%rbp), %xmm4
movsd 0x10(%rax), %xmm5
callq 0xebaf0
movsd %xmm0, -0x5c8(%rbp)
jmp 0xdf7ca
movq -0x48(%rbp), %rsi
leaq -0x150(%rbp), %rdi
callq 0x88920
movsd -0x5c8(%rbp), %xmm1
movsd 0x18(%rax), %xmm0
subsd -0x68(%rbp), %xmm0
movsd 0x116e24(%rip), %xmm2   # 0x1f6618
subsd %xmm2, %xmm0
ucomisd %xmm1, %xmm0
jbe 0xdf807
movb $0x1, -0x281(%rbp)
jmp 0xdf81c
jmp 0xdf809
jmp 0xdf80b
movq -0x48(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x48(%rbp)
jmp 0xdf6cd
movb -0x281(%rbp), %al
andb $0x1, %al
movzbl %al, %eax
cmpl $0x0, %eax
jne 0xdf83b
movl -0x278(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x278(%rbp)
movb -0x281(%rbp), %al
andb $0x1, %al
movzbl %al, %eax
cmpl $0x0, %eax
jne 0xdfb25
movl $0x0, -0x2bc(%rbp)
movl -0x2bc(%rbp), %eax
movl %eax, -0x5fc(%rbp)
leaq -0x168(%rbp), %rdi
callq 0x85300
movq %rax, %rcx
movl -0x5fc(%rbp), %eax
cmpl %ecx, %eax
jge 0xdfb23
leaq -0x2d8(%rbp), %rdi
xorps %xmm2, %xmm2
movaps %xmm2, %xmm0
movaps %xmm2, %xmm1
callq 0xe9c70
jmp 0xdf899
movsd -0xc8(%rbp), %xmm0
movsd %xmm0, -0x610(%rbp)
leaq -0x2d8(%rbp), %rdi
xorl %esi, %esi
callq 0xe9d70
movq %rax, -0x608(%rbp)
jmp 0xdf8c0
movq -0x608(%rbp), %rax
movsd -0x610(%rbp), %xmm0
movsd %xmm0, (%rax)
movsd -0xc0(%rbp), %xmm0
movsd %xmm0, -0x620(%rbp)
leaq -0x2d8(%rbp), %rdi
movl $0x1, %esi
callq 0xe9d70
movq %rax, -0x618(%rbp)
jmp 0xdf8fd
movq -0x618(%rbp), %rax
movsd -0x620(%rbp), %xmm0
movsd %xmm0, (%rax)
movsd -0xb8(%rbp), %xmm0
movsd %xmm0, -0x630(%rbp)
leaq -0x2d8(%rbp), %rdi
movl $0x2, %esi
callq 0xe9d70
movq %rax, -0x628(%rbp)
jmp 0xdf93a
movq -0x628(%rbp), %rax
movsd -0x630(%rbp), %xmm0
movsd %xmm0, (%rax)
movq -0x10(%rbp), %rsi
movq -0x2c8(%rbp), %rax
movq %rax, -0x300(%rbp)
movups -0x2d8(%rbp), %xmm0
movaps %xmm0, -0x310(%rbp)
movq -0x300(%rbp), %rcx
movq %rsp, %rax
movq %rcx, 0x10(%rax)
movaps -0x310(%rbp), %xmm0
movups %xmm0, (%rax)
leaq -0x2f0(%rbp), %rdi
callq 0x97f20
jmp 0xdf993
movq -0x10(%rbp), %rax
movq %rax, -0x640(%rbp)
leaq -0x2d8(%rbp), %rdi
xorl %esi, %esi
callq 0xe9d70
movq %rax, -0x638(%rbp)
jmp 0xdf9b5
movq -0x638(%rbp), %rax
movsd (%rax), %xmm0
movsd %xmm0, -0x650(%rbp)
leaq -0x2d8(%rbp), %rdi
movl $0x1, %esi
callq 0xe9d70
movq %rax, -0x648(%rbp)
jmp 0xdf9e2
movq -0x648(%rbp), %rax
movsd (%rax), %xmm0
movsd %xmm0, -0x660(%rbp)
leaq -0x2d8(%rbp), %rdi
movl $0x2, %esi
callq 0xe9d70
movq %rax, -0x658(%rbp)
jmp 0xdfa0f
movq -0x658(%rbp), %rax
movsd (%rax), %xmm0
movsd %xmm0, -0x680(%rbp)
movslq -0x2bc(%rbp), %rsi
leaq -0x168(%rbp), %rdi
movq %rdi, -0x688(%rbp)
callq 0x88920
movq -0x688(%rbp), %rdi
movsd (%rax), %xmm0
movsd %xmm0, -0x678(%rbp)
movslq -0x2bc(%rbp), %rsi
callq 0x88920
movq -0x688(%rbp), %rdi
movsd 0x8(%rax), %xmm0
movsd %xmm0, -0x670(%rbp)
movslq -0x2bc(%rbp), %rsi
callq 0x88920
movq -0x640(%rbp), %rdi
movsd -0x650(%rbp), %xmm0
movsd -0x660(%rbp), %xmm1
movsd -0x680(%rbp), %xmm2
movsd -0x678(%rbp), %xmm3
movsd -0x670(%rbp), %xmm4
movsd 0x10(%rax), %xmm5
callq 0x97a10
movsd %xmm0, -0x668(%rbp)
jmp 0xdfabe
movsd -0x668(%rbp), %xmm0
movsd %xmm0, -0x318(%rbp)
movsd -0x318(%rbp), %xmm0
movsd %xmm0, -0x690(%rbp)
movslq -0x2bc(%rbp), %rsi
leaq -0x168(%rbp), %rdi
callq 0x88920
movsd -0x690(%rbp), %xmm1
movsd 0x18(%rax), %xmm0
ucomisd %xmm1, %xmm0
jbe 0xdfb0d
movb $0x1, -0x282(%rbp)
jmp 0xdfb23
jmp 0xdfb0f
movl -0x2bc(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x2bc(%rbp)
jmp 0xdf859
jmp 0xdfb25
movb -0x282(%rbp), %al
andb $0x1, %al
movzbl %al, %eax
cmpl $0x0, %eax
jne 0xdfb44
movl -0x27c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x27c(%rbp)
jmp 0xe01ac
movq -0x10(%rbp), %rsi
movsd -0xc8(%rbp), %xmm0
movsd -0xc0(%rbp), %xmm1
movsd -0xb8(%rbp), %xmm2
leaq -0x330(%rbp), %rdi
callq 0x97360
jmp 0xdfb73
movq -0x10(%rbp), %rsi
movq -0x320(%rbp), %rax
movq %rax, -0x350(%rbp)
movups -0x330(%rbp), %xmm0
movaps %xmm0, -0x360(%rbp)
movq -0x350(%rbp), %rcx
movq %rsp, %rax
movq %rcx, 0x10(%rax)
movaps -0x360(%rbp), %xmm0
movups %xmm0, (%rax)
leaq -0x348(%rbp), %rdi
callq 0x97e90
jmp 0xdfbb9
movq -0x348(%rbp), %rax
movq %rax, -0x330(%rbp)
movq -0x340(%rbp), %rax
movq %rax, -0x328(%rbp)
movq -0x338(%rbp), %rax
movq %rax, -0x320(%rbp)
movb -0x281(%rbp), %al
andb $0x1, %al
movzbl %al, %eax
cmpl $0x1, %eax
je 0xdfe82
movq $0x0, -0x48(%rbp)
movq -0x48(%rbp), %rax
movq %rax, -0x698(%rbp)
leaq -0x150(%rbp), %rdi
callq 0x85300
movq %rax, %rcx
movq -0x698(%rbp), %rax
movslq %ecx, %rcx
cmpq %rcx, %rax
jge 0xdfe80
movq -0x48(%rbp), %rax
movslq -0x274(%rbp), %rcx
cmpq %rcx, %rax
je 0xdfe6d
movq -0x10(%rbp), %rax
movq %rax, -0x6b0(%rbp)
movq -0x48(%rbp), %rsi
leaq -0x150(%rbp), %rdi
movq %rdi, -0x6b8(%rbp)
callq 0x88920
movq -0x6b8(%rbp), %rdi
movsd (%rax), %xmm0
movsd %xmm0, -0x6a8(%rbp)
movq -0x48(%rbp), %rsi
callq 0x88920
movq -0x6b8(%rbp), %rdi
movsd 0x8(%rax), %xmm0
movsd %xmm0, -0x6a0(%rbp)
movq -0x48(%rbp), %rsi
callq 0x88920
movq -0x6b0(%rbp), %rsi
movsd -0x6a8(%rbp), %xmm0
movsd -0x6a0(%rbp), %xmm1
movsd 0x10(%rax), %xmm2
leaq -0x378(%rbp), %rdi
callq 0x97360
jmp 0xdfcc5
movq -0x10(%rbp), %rax
movq %rax, -0x6c8(%rbp)
leaq -0x378(%rbp), %rdi
xorl %esi, %esi
callq 0xe9d70
movq %rax, -0x6c0(%rbp)
jmp 0xdfce7
movq -0x6c0(%rbp), %rax
movsd (%rax), %xmm0
movsd %xmm0, -0x6d8(%rbp)
leaq -0x378(%rbp), %rdi
movl $0x1, %esi
callq 0xe9d70
movq %rax, -0x6d0(%rbp)
jmp 0xdfd14
movq -0x6d0(%rbp), %rax
movsd (%rax), %xmm0
movsd %xmm0, -0x6e8(%rbp)
leaq -0x378(%rbp), %rdi
movl $0x2, %esi
callq 0xe9d70
movq %rax, -0x6e0(%rbp)
jmp 0xdfd41
movq -0x6e0(%rbp), %rax
movsd (%rax), %xmm0
movsd %xmm0, -0x6f8(%rbp)
leaq -0x330(%rbp), %rdi
xorl %esi, %esi
callq 0xe9d70
movq %rax, -0x6f0(%rbp)
jmp 0xdfd6b
movq -0x6f0(%rbp), %rax
movsd (%rax), %xmm0
movsd %xmm0, -0x708(%rbp)
leaq -0x330(%rbp), %rdi
movl $0x1, %esi
callq 0xe9d70
movq %rax, -0x700(%rbp)
jmp 0xdfd98
movq -0x700(%rbp), %rax
movsd (%rax), %xmm0
movsd %xmm0, -0x718(%rbp)
leaq -0x330(%rbp), %rdi
movl $0x2, %esi
callq 0xe9d70
movq %rax, -0x710(%rbp)
jmp 0xdfdc5
movsd -0x718(%rbp), %xmm4
movsd -0x708(%rbp), %xmm3
movsd -0x6f8(%rbp), %xmm2
movsd -0x6e8(%rbp), %xmm1
movsd -0x6d8(%rbp), %xmm0
movq -0x6c8(%rbp), %rdi
movq -0x710(%rbp), %rax
movsd (%rax), %xmm5
callq 0x97720
movsd %xmm0, -0x720(%rbp)
jmp 0xdfe0e
movsd -0x720(%rbp), %xmm0
movsd %xmm0, -0x380(%rbp)
movsd -0x380(%rbp), %xmm0
movsd %xmm0, -0x728(%rbp)
movq -0x48(%rbp), %rsi
leaq -0x150(%rbp), %rdi
callq 0x88920
movsd -0x728(%rbp), %xmm1
movsd 0x18(%rax), %xmm0
subsd -0x68(%rbp), %xmm0
movsd 0x1167c0(%rip), %xmm2   # 0x1f6618
subsd %xmm2, %xmm0
ucomisd %xmm1, %xmm0
jbe 0xdfe6b
movb $0x1, -0x281(%rbp)
jmp 0xdfe80
jmp 0xdfe6d
jmp 0xdfe6f
movq -0x48(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x48(%rbp)
jmp 0xdfbff
jmp 0xdfe82
movb -0x281(%rbp), %al
andb $0x1, %al
movzbl %al, %eax
cmpl $0x0, %eax
jne 0xdfea1
movl -0x278(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x278(%rbp)
movb -0x281(%rbp), %al
andb $0x1, %al
movzbl %al, %eax
cmpl $0x0, %eax
jne 0xe018b
movl $0x0, -0x384(%rbp)
movl -0x384(%rbp), %eax
movl %eax, -0x72c(%rbp)
leaq -0x168(%rbp), %rdi
callq 0x85300
movq %rax, %rcx
movl -0x72c(%rbp), %eax
cmpl %ecx, %eax
jge 0xe0189
leaq -0x3a0(%rbp), %rdi
xorps %xmm2, %xmm2
movaps %xmm2, %xmm0
movaps %xmm2, %xmm1
callq 0xe9c70
jmp 0xdfeff
movsd -0xc8(%rbp), %xmm0
movsd %xmm0, -0x740(%rbp)
leaq -0x3a0(%rbp), %rdi
xorl %esi, %esi
callq 0xe9d70
movq %rax, -0x738(%rbp)
jmp 0xdff26
movq -0x738(%rbp), %rax
movsd -0x740(%rbp), %xmm0
movsd %xmm0, (%rax)
movsd -0xc0(%rbp), %xmm0
movsd %xmm0, -0x750(%rbp)
leaq -0x3a0(%rbp), %rdi
movl $0x1, %esi
callq 0xe9d70
movq %rax, -0x748(%rbp)
jmp 0xdff63
movq -0x748(%rbp), %rax
movsd -0x750(%rbp), %xmm0
movsd %xmm0, (%rax)
movsd -0xb8(%rbp), %xmm0
movsd %xmm0, -0x760(%rbp)
leaq -0x3a0(%rbp), %rdi
movl $0x2, %esi
callq 0xe9d70
movq %rax, -0x758(%rbp)
jmp 0xdffa0
movq -0x758(%rbp), %rax
movsd -0x760(%rbp), %xmm0
movsd %xmm0, (%rax)
movq -0x10(%rbp), %rsi
movq -0x390(%rbp), %rax
movq %rax, -0x3c0(%rbp)
movups -0x3a0(%rbp), %xmm0
movaps %xmm0, -0x3d0(%rbp)
movq -0x3c0(%rbp), %rcx
movq %rsp, %rax
movq %rcx, 0x10(%rax)
movaps -0x3d0(%rbp), %xmm0
movups %xmm0, (%rax)
leaq -0x3b8(%rbp), %rdi
callq 0x97f20
jmp 0xdfff9
movq -0x10(%rbp), %rax
movq %rax, -0x770(%rbp)
leaq -0x3a0(%rbp), %rdi
xorl %esi, %esi
callq 0xe9d70
movq %rax, -0x768(%rbp)
jmp 0xe001b
movq -0x768(%rbp), %rax
movsd (%rax), %xmm0
movsd %xmm0, -0x780(%rbp)
leaq -0x3a0(%rbp), %rdi
movl $0x1, %esi
callq 0xe9d70
movq %rax, -0x778(%rbp)
jmp 0xe0048
movq -0x778(%rbp), %rax
movsd (%rax), %xmm0
movsd %xmm0, -0x790(%rbp)
leaq -0x3a0(%rbp), %rdi
movl $0x2, %esi
callq 0xe9d70
movq %rax, -0x788(%rbp)
jmp 0xe0075
movq -0x788(%rbp), %rax
movsd (%rax), %xmm0
movsd %xmm0, -0x7b0(%rbp)
movslq -0x384(%rbp), %rsi
leaq -0x168(%rbp), %rdi
movq %rdi, -0x7b8(%rbp)
callq 0x88920
movq -0x7b8(%rbp), %rdi
movsd (%rax), %xmm0
movsd %xmm0, -0x7a8(%rbp)
movslq -0x384(%rbp), %rsi
callq 0x88920
movq -0x7b8(%rbp), %rdi
movsd 0x8(%rax), %xmm0
movsd %xmm0, -0x7a0(%rbp)
movslq -0x384(%rbp), %rsi
callq 0x88920
movq -0x770(%rbp), %rdi
movsd -0x780(%rbp), %xmm0
movsd -0x790(%rbp), %xmm1
movsd -0x7b0(%rbp), %xmm2
movsd -0x7a8(%rbp), %xmm3
movsd -0x7a0(%rbp), %xmm4
movsd 0x10(%rax), %xmm5
callq 0x97a10
movsd %xmm0, -0x798(%rbp)
jmp 0xe0124
movsd -0x798(%rbp), %xmm0
movsd %xmm0, -0x3d8(%rbp)
movsd -0x3d8(%rbp), %xmm0
movsd %xmm0, -0x7c0(%rbp)
movslq -0x384(%rbp), %rsi
leaq -0x168(%rbp), %rdi
callq 0x88920
movsd -0x7c0(%rbp), %xmm1
movsd 0x18(%rax), %xmm0
ucomisd %xmm1, %xmm0
jbe 0xe0173
movb $0x1, -0x282(%rbp)
jmp 0xe0189
jmp 0xe0175
movl -0x384(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x384(%rbp)
jmp 0xdfebf
jmp 0xe018b
movb -0x282(%rbp), %al
andb $0x1, %al
movzbl %al, %eax
cmpl $0x0, %eax
jne 0xe01aa
movl -0x27c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x27c(%rbp)
jmp 0xe01ac
jmp 0xe01ae
movl -0x280(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x280(%rbp)
jmp 0xdf46a
jmp 0xe01c4
cvtsi2sdl -0x278(%rbp), %xmm0
movsd 0x11b704(%rip), %xmm1   # 0x1fb8d8
divsd %xmm1, %xmm0
movsd 0x116448(%rip), %xmm1   # 0x1f6628
mulsd %xmm1, %xmm0
movsd 0x116444(%rip), %xmm1   # 0x1f6630
mulsd %xmm1, %xmm0
movsd %xmm0, -0x7d0(%rbp)
movslq -0x274(%rbp), %rsi
leaq -0x150(%rbp), %rdi
callq 0x88920
movsd 0x18(%rax), %xmm0
movsd -0x68(%rbp), %xmm1
subsd %xmm1, %xmm0
movl $0x2, %edi
callq 0x850c0
movsd %xmm0, -0x7c8(%rbp)
jmp 0xe022d
movslq -0x5c(%rbp), %rsi
leaq -0xe0(%rbp), %rdi
callq 0xedb0
movsd -0x7d0(%rbp), %xmm0
movsd -0x7c8(%rbp), %xmm2
movsd (%rax), %xmm1
mulsd %xmm2, %xmm0
addsd %xmm1, %xmm0
movsd %xmm0, (%rax)
cvtsi2sdl -0x27c(%rbp), %xmm0
movsd 0x11b66b(%rip), %xmm1   # 0x1fb8d8
divsd %xmm1, %xmm0
movsd 0x1163af(%rip), %xmm1   # 0x1f6628
mulsd %xmm1, %xmm0
movsd 0x1163ab(%rip), %xmm1   # 0x1f6630
mulsd %xmm1, %xmm0
movsd %xmm0, -0x7e0(%rbp)
movslq -0x274(%rbp), %rsi
leaq -0x150(%rbp), %rdi
callq 0x88920
movsd 0x18(%rax), %xmm0
movsd -0x68(%rbp), %xmm1
subsd %xmm1, %xmm0
movl $0x2, %edi
callq 0x850c0
movsd %xmm0, -0x7d8(%rbp)
jmp 0xe02c6
movslq -0x5c(%rbp), %rsi
leaq -0xf8(%rbp), %rdi
callq 0xedb0
movsd -0x7e0(%rbp), %xmm0
movsd -0x7d8(%rbp), %xmm2
movsd (%rax), %xmm1
mulsd %xmm2, %xmm0
addsd %xmm1, %xmm0
movsd %xmm0, (%rax)
movl -0x274(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x274(%rbp)
jmp 0xdf3f9
jmp 0xe0323
movslq -0x5c(%rbp), %rsi
leaq -0xe0(%rbp), %rdi
callq 0xedb0
xorps %xmm0, %xmm0
movsd %xmm0, (%rax)
jmp 0xe0325
movl -0x5c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x5c(%rbp)
jmp 0xdf351
movq 0x192c86(%rip), %rdi    # 0x272fc0
leaq 0x11b883(%rip), %rsi    # 0x1fbbc4
callq 0x5540
movq %rax, -0x7e8(%rbp)
jmp 0xe034f
movq -0x7e8(%rbp), %rdi
movq -0x30(%rbp), %rsi
callq 0x5540
movq %rax, -0x7f0(%rbp)
jmp 0xe0368
movq -0x7f0(%rbp), %rdi
leaq 0x11b85b(%rip), %rsi    # 0x1fbbd1
callq 0x5540
movq %rax, -0x7f8(%rbp)
jmp 0xe0384
movq -0x7f8(%rbp), %rdi
movl 0x10(%rbp), %esi
callq 0x58d0
movq %rax, -0x800(%rbp)
jmp 0xe039c
movq -0x800(%rbp), %rdi
leaq 0x1120dd(%rip), %rsi    # 0x1f2487
callq 0x5540
jmp 0xe03b1
movq $0x0, -0x38(%rbp)
cmpq $0x1, -0x38(%rbp)
jge 0xe040e
movq -0x38(%rbp), %rsi
leaq -0xe0(%rbp), %rdi
callq 0xedb0
movsd (%rax), %xmm0
movq 0x192be5(%rip), %rdi    # 0x272fc0
callq 0x5980
movq %rax, -0x808(%rbp)
jmp 0xe03e9
movq -0x808(%rbp), %rdi
leaq 0x112090(%rip), %rsi    # 0x1f2487
callq 0x5540
jmp 0xe03fe
jmp 0xe0400
movq -0x38(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x38(%rbp)
jmp 0xe03b9
movq 0x192bab(%rip), %rdi    # 0x272fc0
leaq 0x11b7c2(%rip), %rsi    # 0x1fbbde
callq 0x5540
jmp 0xe0423
movq $0x0, -0x38(%rbp)
cmpq $0x1, -0x38(%rbp)
jge 0xe0480
movq -0x38(%rbp), %rsi
leaq -0xf8(%rbp), %rdi
callq 0xedb0
movsd (%rax), %xmm0
movq 0x192b73(%rip), %rdi    # 0x272fc0
callq 0x5980
movq %rax, -0x810(%rbp)
jmp 0xe045b
movq -0x810(%rbp), %rdi
leaq 0x11201e(%rip), %rsi    # 0x1f2487
callq 0x5540
jmp 0xe0470
jmp 0xe0472
movq -0x38(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x38(%rbp)
jmp 0xe042b
movq 0x192b39(%rip), %rdi    # 0x272fc0
leaq 0x119197(%rip), %rsi    # 0x1f9625
callq 0x5540
jmp 0xe0495
leaq -0xe0(%rbp), %rdi
xorl %eax, %eax
movl %eax, %esi
callq 0xedb0
movsd (%rax), %xmm0
movsd %xmm0, -0x818(%rbp)
leaq -0x208(%rbp), %rdi
callq 0xec80
leaq -0x168(%rbp), %rdi
callq 0x85400
leaq -0x150(%rbp), %rdi
callq 0x85400
leaq -0xf8(%rbp), %rdi
callq 0xf9d0
leaq -0xe0(%rbp), %rdi
callq 0xf9d0
movsd -0x818(%rbp), %xmm0
addq $0x830, %rsp            # imm = 0x830
popq %rbp
retq
leaq -0x168(%rbp), %rdi
callq 0x85400
leaq -0x150(%rbp), %rdi
callq 0x85400
leaq -0xf8(%rbp), %rdi
callq 0xf9d0
leaq -0xe0(%rbp), %rdi
callq 0xf9d0
movq -0x190(%rbp), %rdi
callq 0x58f0
nopw (%rax,%rax)