// File: /workspace/github_cpp_makefile_star2_O1/Luthaf[P]zeopp/area_and_volume.cc
// Function: calcASA(ATOM_NETWORK*, ATOM_NETWORK*, bool, double, double, double, int, bool, std::ostream&, char*, bool, bool, bool, bool)
double calcASA(ATOM_NETWORK *hiaccatmnet, ATOM_NETWORK *orgatmnet, bool highAccuracy, double r_probe_chan, double r_probe, double rho_crystal, int numSamples, bool excludePockets, ostream &output, char *filename, bool visualize, bool VisITflag, bool LiverpoolFlag, bool ExtendedOutputFlag){

  ATOM_NETWORK *atmnet; // pointed to the analyzed (original atomsnet)

  if(highAccuracy) atmnet=orgatmnet; else atmnet = hiaccatmnet; // this ensures that the loops below loop over original atoms
                                                                // and not "high-acuracy" clusters, which are used only for
                                                                // voronoi decomposition

  // Create an object that handles analysis of accessibility of sampled points
  AccessibilityClass accessAnalysis;
  if(highAccuracy) accessAnalysis.setupAndFindChannels(hiaccatmnet, orgatmnet, highAccuracy, r_probe_chan, r_probe);
    else accessAnalysis.setupAndFindChannels(hiaccatmnet, hiaccatmnet, highAccuracy, r_probe_chan, r_probe);

  accessAnalysis.removeOverlappedNodes();

  srand(randSeed);

  vector<Point> axsPoints   = vector<Point> (); // List of accessible points to be visualized in ZeoVis
  vector<int> axsPointsChannelIDs;  // corresponding channel IDs
  vector<Point> inaxsPoints = vector<Point> (); // List of inaccessible points to be visualized in ZeoVis
  vector<int> inaxsPointsPocketIDs; // corresponding pocket IDs
  double totalSA = 0;
  double totalSA_inaxs = 0;

  vector<double> totalSA_inChannel(accessAnalysis.n_channels,0);
  vector<double> totalSA_inPocket(accessAnalysis.n_pockets,0);

  //vectors that store SA contributions per atom (a pair of accessible and inaccessible)
  vector< pair <double,double> > histogramSAperAtom;

  // Sample around each of the network's atoms
  for(int i = 0; i < atmnet->numAtoms; i++){
    int count = 0;
    int count_inaxs = 0;
    // MC statistics can be collected w.r.t to identified channels and inaccessible pockets
    vector<int> count_inChannel(accessAnalysis.n_channels,0);
    vector<int> count_inPocket(accessAnalysis.n_pockets,0);

    for(int j = 0; j < numSamples; j++){
      bool overlaps = false;
      bool inside = false;

      // 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 *= (atmnet->atoms[i].radius + r_probe);
      ypoint *= (atmnet->atoms[i].radius + r_probe);
      zpoint *= (atmnet->atoms[i].radius + r_probe);

      // Convert (x,y,z) coordinates to ones relative to the unit cell vectors
      Point abc_coords = atmnet->xyz_to_abc(xpoint, ypoint, zpoint);

      // Transform coords relative to the atom center into ones relative to the unit cell vectors
      double newAPoint = abc_coords[0] + atmnet->atoms[i].a_coord;
      double newBPoint = abc_coords[1] + atmnet->atoms[i].b_coord;
      double newCPoint = abc_coords[2] + atmnet->atoms[i].c_coord;

      Point samplingPoint = atmnet->abc_to_xyz(newAPoint, newBPoint, newCPoint);


      // Calling accessibility object to determine accessibility of the point (this replaced a big chunk of code by Thomas)
      pair<bool,bool> answer = (accessAnalysis.isSPointInsideAtomAndNotAccessible(samplingPoint, i));
      inside = answer.first; overlaps = answer.second;
      if(accessAnalysis.needToResample() == true) j--; // the sampled point could not be analyzed in isSPointInsideAtomAndNotAccessible() function, resampling needed

      if(inside == false && excludePockets == false) overlaps = false; // if ignore inacceible pockets, treat the point as accessible (unless inside atom)


      // Store sampled points that did not overlap within atom for later visualization
      if(accessAnalysis.needToResample() == false && !inside) {
	Point abcCoords = Point(newAPoint, newBPoint, newCPoint);
	Point coords = atmnet->abc_to_xyz(atmnet->shiftABCInUC(abcCoords));
	if(overlaps)
          {
          count_inaxs++;
	  inaxsPoints.push_back(coords);
          pair <int,int> CoP = accessAnalysis.lastChannelOrPocket();
          if(CoP.first!=-1)
            {
            cout << "Error: CoP.first!=-1 in pocket, consult source code provider\n";
            } else {
            count_inPocket[CoP.second]++;
            };
          inaxsPointsPocketIDs.push_back(CoP.second);
          }
	else
          {
	  axsPoints.push_back(coords);
          count++;
          pair <int,int> CoP = accessAnalysis.lastChannelOrPocket();
          if(CoP.second!=-1)
            {
            cout << "Error: CoP.second!=-1 in channel, consult source code provider\n";
            } else {
            count_inChannel[CoP.first]++;
            };
          axsPointsChannelIDs.push_back(CoP.first);
          };
      }

//      if(accessAnalysis.needToResample() == false && !overlaps)
//        count++;
    }
   
    // SA per atom (in accessible space and in inaccessible pockets)
    double SAperAtom = (1.0*count)/numSamples * 4.0 * PI * pow((atmnet->atoms.at(i).radius + r_probe),2);
    double SAperAtom_inaxs = (1.0*count_inaxs)/numSamples * 4.0 * PI * pow((atmnet->atoms.at(i).radius + r_probe),2);

    //Increment total surface area by fraction of atom that is accessible
    totalSA += SAperAtom;
    //and inaccessible
    totalSA_inaxs += SAperAtom_inaxs;

    // SA per channel and pocket
    for(unsigned int m = 0; m < totalSA_inChannel.size(); m++)
      {
      totalSA_inChannel[m] += (1.0*count_inChannel[m])/numSamples * 4.0 * PI * pow((atmnet->atoms.at(i).radius + r_probe),2);
      };
    for(unsigned int m = 0; m < totalSA_inPocket.size(); m++)
      {
      totalSA_inPocket[m] += (1.0*count_inPocket[m])/numSamples * 4.0 * PI * pow((atmnet->atoms.at(i).radius + r_probe),2);
      };

    histogramSAperAtom.push_back(pair <double,double> (SAperAtom,SAperAtom_inaxs));

  }

  // Write the necessary commands to the output stream
  // necessary to visualize the sampling
  if(visualize){
    if(VisITflag == false)
      {
      reportPoints(output, axsPoints, inaxsPoints);
      }
    else{
      if(LiverpoolFlag == false)
        {
        //report points in std. VisIt format
        reportPointsVisIT(output, axsPoints, inaxsPoints);
        }
      else{
      //report points in Liverpool format
      vector<Point> LiverpoolAxsPoints = vector<Point> ();
      vector<Point> LiverpoolInaxsPoints = vector<Point> ();
      for(unsigned i = 0; i < axsPoints.size(); i++)
         {
         LiverpoolAxsPoints.push_back(atmnet->xyz_to_abc(axsPoints[i]));
         };
      for(unsigned j = 0; j < inaxsPoints.size(); j++)
         {
         LiverpoolInaxsPoints.push_back(atmnet->xyz_to_abc(inaxsPoints[j]));
         };
//      reportPointsVisIT(output, LiverpoolAxsPoints, LiverpoolInaxsPoints);
      reportPointsVisIT(output, LiverpoolAxsPoints, axsPointsChannelIDs, LiverpoolInaxsPoints, inaxsPointsPocketIDs);
      };
      };
    //reportResampledPoints(output, resampledInfo);
  }


  double ucVolume    = calcDeterminant(atmnet->ucVectors);   
  double saPerVolume = (totalSA/ucVolume)*pow(10.0,4.0); // Units of m^2/cm^3
  double saPerMass   = saPerVolume/rho_crystal;          // Units of m^2/g

  double saPerVolume_inaxs = (totalSA_inaxs/ucVolume)*pow(10.0,4.0); // Units of m^2/cm^3
  double saPerMass_inaxs   = saPerVolume_inaxs/rho_crystal;          // Units of m^2/g

  if(!visualize){
//    output << newAtomNet.name << " ";
    output << "@ " << filename << " ";
    output << "Unitcell_volume: " << ucVolume << "   Density: " << rho_crystal << "   ";
    output << "ASA_A^2: " << totalSA << " "
	   << "ASA_m^2/cm^3: " << saPerVolume << " "
	   << "ASA_m^2/g: " << saPerMass << " "
           << "NASA_A^2: " << totalSA_inaxs << " "
           << "NASA_m^2/cm^3: " << saPerVolume_inaxs << " "
           << "NASA_m^2/g: " << saPerMass_inaxs << "\n";
  }

  // Surface composition histogram
  if(!visualize&&ExtendedOutputFlag){
    double metalFrac = 0, metalFrac_inaxs = 0;

    for(int i = 0; i < atmnet->numAtoms; i++)
       {
       if(isMetal(atmnet->atoms[i].type) == true) 
         {
         metalFrac+= histogramSAperAtom.at(i).first;
         metalFrac_inaxs += histogramSAperAtom.at(i).second;
         };
       };

    metalFrac = metalFrac / totalSA;
    if(totalSA == 0) metalFrac=0;
    metalFrac_inaxs = metalFrac_inaxs / totalSA_inaxs;
    if(totalSA_inaxs == 0) metalFrac_inaxs =0;

    output << "# " << filename << " Metal fraction in ASA and NASA: " << metalFrac << "   " << metalFrac_inaxs << "\n";
  };

  // extended output
  if(!visualize){
    output << "Number_of_channels: " << totalSA_inChannel.size()  << " Channel_surface_area_A^2: ";
    for(unsigned int i = 0; i < totalSA_inChannel.size(); i++)
      {
      output << totalSA_inChannel[i] << "  ";
      };
    output << "\nNumber_of_pockets: " << totalSA_inPocket.size()  << " Pocket_surface_area_A^2: ";
    for(unsigned int i = 0; i < totalSA_inPocket.size(); i++)
      {
      output << totalSA_inPocket[i] << "  ";
      };
    output << "\n";
    };

    
    // Warn user if points were resampled
  int resampleCount =  accessAnalysis.getResampleCount();
  if(resampleCount != 0){
    cerr << "\n" << "\n"
  	 << "Warning: Resampled " << resampleCount << " points out of " << atmnet->numAtoms*numSamples 
	 << "\n" << "\n"; 
  }
  accessAnalysis.deconstruct();
  return totalSA;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0xd48, %rsp            # imm = 0xD48
movq %r9, 0x18(%rsp)
movl %r8d, 0x17c(%rsp)
movl %ecx, 0x2c(%rsp)
movsd %xmm2, 0x160(%rsp)
movsd %xmm1, 0xa8(%rsp)
movsd %xmm0, 0x20(%rsp)
movl %edx, %ebx
movq %rsi, %r14
movq %rdi, %r15
testl %edx, %edx
cmoveq %rdi, %r14
leaq 0x308(%rsp), %r12
movq %r12, %rdi
callq 0x48f44
movq %r12, %rdi
movq %r15, %rsi
movq %r14, %rdx
movl %ebx, %ecx
movsd 0x20(%rsp), %xmm0
movsd 0xa8(%rsp), %xmm1
callq 0x95b90
leaq 0x308(%rsp), %rdi
callq 0x95f64
movl $0x3b4ca6f5, %edi       # imm = 0x3B4CA6F5
callq 0x4410
xorl %eax, %eax
movq %rax, 0xf0(%rsp)
xorpd %xmm0, %xmm0
movapd %xmm0, 0xe0(%rsp)
movq %rax, 0x1b0(%rsp)
movapd %xmm0, 0x1a0(%rsp)
movq %rax, 0xd0(%rsp)
movapd %xmm0, 0xc0(%rsp)
movq %rax, 0x190(%rsp)
movapd %xmm0, 0x180(%rsp)
movslq 0xc90(%rsp), %rsi
leaq 0xf8(%rsp), %rdx
movq %rax, (%rdx)
leaq 0x130(%rsp), %rdi
leaq 0x110(%rsp), %rcx
callq 0x3871a
movslq 0xc94(%rsp), %rsi
leaq 0x110(%rsp), %rdx
movq $0x0, (%rdx)
leaq 0xf8(%rsp), %rdi
leaq 0x90(%rsp), %rcx
callq 0x3871a
xorpd %xmm0, %xmm0
movapd %xmm0, 0x110(%rsp)
movq $0x0, 0x120(%rsp)
cmpl $0x0, 0x110(%r14)
movq %r14, 0x20(%rsp)
jle 0x4695f
xorps %xmm0, %xmm0
cvtsi2sdl 0x2c(%rsp), %xmm0
movsd %xmm0, 0x168(%rsp)
xorpd %xmm0, %xmm0
movsd %xmm0, 0x48(%rsp)
xorl %ebp, %ebp
leaq 0x70(%rsp), %rbx
leaq 0x148(%rsp), %r15
movsd %xmm0, 0x68(%rsp)
movslq 0xc90(%rsp), %rsi
movl $0x0, 0x70(%rsp)
leaq 0x90(%rsp), %rdi
movq %rbx, %rdx
movq %r15, %rcx
callq 0x38af6
movslq 0xc94(%rsp), %rsi
movl $0x0, 0x148(%rsp)
movq %rbx, %rdi
movq %r15, %rdx
leaq 0x2c0(%rsp), %rcx
callq 0x38af6
cmpl $0x0, 0x2c(%rsp)
jle 0x46648
movl $0x0, 0xbc(%rsp)
imulq $0x98, %rbp, %rax
movq %rax, 0x1c0(%rsp)
movl $0x0, 0xb8(%rsp)
xorl %ebx, %ebx
callq 0x4150
xorps %xmm0, %xmm0
cvtsi2sd %eax, %xmm0
divsd 0x10d35f(%rip), %xmm0   # 0x153560
addsd %xmm0, %xmm0
mulsd 0x10d373(%rip), %xmm0   # 0x153580
movsd %xmm0, 0x30(%rsp)
callq 0x4150
xorps %xmm0, %xmm0
cvtsi2sd %eax, %xmm0
divsd 0x10d361(%rip), %xmm0   # 0x153588
addsd %xmm0, %xmm0
addsd 0x108e25(%rip), %xmm0   # 0x14f058
movsd %xmm0, 0x50(%rsp)
callq 0x4400
movsd %xmm0, 0x170(%rsp)
callq 0x4100
movsd %xmm0, 0xb0(%rsp)
movsd 0x30(%rsp), %xmm0
callq 0x4800
mulsd 0xb0(%rsp), %xmm0
movsd %xmm0, 0xb0(%rsp)
movsd 0x170(%rsp), %xmm0
callq 0x4100
movsd %xmm0, 0x170(%rsp)
movsd 0x30(%rsp), %xmm0
callq 0x4100
movsd 0x170(%rsp), %xmm1
mulsd %xmm0, %xmm1
movq 0x20(%rsp), %rsi
movq 0x2f0(%rsi), %rax
movq 0x1c0(%rsp), %rcx
movsd 0x30(%rax,%rcx), %xmm2
addsd 0xa8(%rsp), %xmm2
movsd 0xb0(%rsp), %xmm0
mulsd %xmm2, %xmm0
mulsd %xmm2, %xmm1
mulsd 0x50(%rsp), %xmm2
leaq 0x148(%rsp), %r15
movq %r15, %rdi
callq 0x531ea
movq %r15, %rdi
xorl %esi, %esi
callq 0x85478
movsd (%rax), %xmm0
movq 0x20(%rsp), %r14
movq 0x2f0(%r14), %rax
movq 0x1c0(%rsp), %r12
addsd 0x18(%rax,%r12), %xmm0
movsd %xmm0, 0x30(%rsp)
movq %r15, %rdi
movl $0x1, %esi
callq 0x85478
movsd (%rax), %xmm0
movq 0x2f0(%r14), %rax
addsd 0x20(%rax,%r12), %xmm0
movsd %xmm0, 0x50(%rsp)
movq %r15, %rdi
movl $0x2, %esi
callq 0x85478
movsd (%rax), %xmm2
movq 0x2f0(%r14), %rax
addsd 0x28(%rax,%r12), %xmm2
leaq 0x2c0(%rsp), %rdi
movq %r14, %rsi
movsd 0x30(%rsp), %xmm0
movsd 0x50(%rsp), %xmm1
movsd %xmm2, 0xb0(%rsp)
callq 0x53092
movq 0x2d0(%rsp), %rax
movq %rax, 0x10(%rsp)
movupd 0x2c0(%rsp), %xmm0
movupd %xmm0, (%rsp)
leaq 0x308(%rsp), %r12
movq %r12, %rdi
movq %rbp, %r14
movl %ebp, %esi
callq 0x96c82
movl %eax, %ebp
movq %r12, %rdi
callq 0x490d4
movl %eax, %r15d
movzwl %bp, %eax
shrl $0x8, %eax
cmpb $0x0, 0x17c(%rsp)
movl $0x0, %r13d
cmovnel %eax, %r13d
testb $0x1, %bpl
cmovnel %eax, %r13d
movq %r12, %rdi
callq 0x490d4
orb %bpl, %al
testb $0x1, %al
je 0x463f7
movq %r14, %rbp
jmp 0x46613
leaq 0x2f0(%rsp), %rdi
movsd 0x30(%rsp), %xmm0
movsd 0x50(%rsp), %xmm1
movsd 0xb0(%rsp), %xmm2
callq 0x85436
movq %r14, %rbp
movq 0x300(%rsp), %rax
movq %rax, 0x10(%rsp)
movupd 0x2f0(%rsp), %xmm0
movupd %xmm0, (%rsp)
leaq 0x2d8(%rsp), %rdi
movq 0x20(%rsp), %rsi
callq 0x53d90
movq 0x2e8(%rsp), %rax
movq %rax, 0x10(%rsp)
movupd 0x2d8(%rsp), %xmm0
movupd %xmm0, (%rsp)
leaq 0x1c8(%rsp), %rdi
movq 0x20(%rsp), %rsi
callq 0x52144
testb $0x1, %r13b
je 0x464b2
movq 0xc8(%rsp), %rsi
cmpq 0xd0(%rsp), %rsi
je 0x464e8
movq 0x1d8(%rsp), %rax
movq %rax, 0x10(%rsi)
movupd 0x1c8(%rsp), %xmm0
movupd %xmm0, (%rsi)
addq $0x18, 0xc8(%rsp)
jmp 0x464fd
movq 0xe8(%rsp), %rsi
cmpq 0xf0(%rsp), %rsi
je 0x4652e
movq 0x1d8(%rsp), %rax
movq %rax, 0x10(%rsi)
movupd 0x1c8(%rsp), %xmm0
movupd %xmm0, (%rsi)
addq $0x18, 0xe8(%rsp)
jmp 0x46543
leaq 0xc0(%rsp), %rdi
leaq 0x1c8(%rsp), %rdx
callq 0x3012c
leaq 0x308(%rsp), %rdi
callq 0x49146
movq %rax, 0x40(%rsp)
cmpl $-0x1, %eax
je 0x46576
movl $0x3d, %edx
movq 0x150aa0(%rip), %rdi    # 0x196fc0
leaq 0x10d179(%rip), %rsi    # 0x1536a0
callq 0x44e0
jmp 0x46583
leaq 0xe0(%rsp), %rdi
leaq 0x1c8(%rsp), %rdx
callq 0x3012c
leaq 0x308(%rsp), %rdi
callq 0x49146
movq %rax, 0x40(%rsp)
cmpl $-0x1, 0x44(%rsp)
je 0x465a9
movl $0x3f, %edx
movq 0x150a58(%rip), %rdi    # 0x196fc0
leaq 0x10d16f(%rip), %rsi    # 0x1536de
callq 0x44e0
jmp 0x465b9
movslq 0x44(%rsp), %rax
movq 0x70(%rsp), %rcx
incl (%rcx,%rax,4)
movq 0x188(%rsp), %rsi
cmpq 0x190(%rsp), %rsi
je 0x465df
movl 0x44(%rsp), %eax
movl %eax, (%rsi)
addq $0x4, %rsi
movq %rsi, 0x188(%rsp)
jmp 0x465f1
movslq 0x40(%rsp), %rax
movq 0x90(%rsp), %rcx
incl (%rcx,%rax,4)
movq 0x1a8(%rsp), %rsi
cmpq 0x1b0(%rsp), %rsi
je 0x465fa
movl 0x40(%rsp), %eax
movl %eax, (%rsi)
addq $0x4, %rsi
movq %rsi, 0x1a8(%rsp)
jmp 0x4660c
leaq 0x180(%rsp), %rdi
leaq 0x44(%rsp), %rdx
callq 0xf7b4
incl 0xb8(%rsp)
jmp 0x46613
leaq 0x1a0(%rsp), %rdi
leaq 0x40(%rsp), %rdx
callq 0xf7b4
incl 0xbc(%rsp)
movzbl %r15b, %eax
negl %eax
addl %eax, %ebx
incl %ebx
cmpl 0x2c(%rsp), %ebx
jl 0x461ed
cvtsi2sdl 0xbc(%rsp), %xmm3
cvtsi2sdl 0xb8(%rsp), %xmm5
leaq 0x70(%rsp), %rbx
leaq 0x148(%rsp), %r15
jmp 0x46650
xorpd %xmm5, %xmm5
xorpd %xmm3, %xmm3
movq 0x20(%rsp), %r14
movq 0x2f0(%r14), %rcx
movq 0x2f8(%r14), %rdx
subq %rcx, %rdx
sarq $0x3, %rdx
movabsq $-0x79435e50d79435e5, %rax # imm = 0x86BCA1AF286BCA1B
imulq %rax, %rdx
cmpq %rbp, %rdx
movsd 0xa8(%rsp), %xmm2
movsd 0x10cef4(%rip), %xmm0   # 0x153580
jbe 0x4750e
movsd 0x168(%rsp), %xmm1
divsd %xmm1, %xmm3
movsd 0x10cee9(%rip), %xmm4   # 0x153590
mulsd %xmm4, %xmm3
mulsd %xmm0, %xmm3
movq 0x2f0(%r14), %rsi
movq 0x2f8(%r14), %rdx
subq %rsi, %rdx
sarq $0x3, %rdx
imulq %rax, %rdx
cmpq %rbp, %rdx
jbe 0x474fd
movapd %xmm3, %xmm9
movapd %xmm0, %xmm3
imulq $0x98, %rbp, %rax
movsd 0x30(%rcx,%rax), %xmm0
addsd %xmm2, %xmm0
movq 0x138(%rsp), %rcx
movq 0x130(%rsp), %rdx
divsd %xmm1, %xmm5
mulsd %xmm4, %xmm5
mulsd %xmm3, %xmm5
movapd %xmm5, %xmm8
movsd 0x30(%rsi,%rax), %xmm1
addsd %xmm2, %xmm1
subq %rdx, %rcx
je 0x467c7
movq 0x2f0(%r14), %rsi
movq 0x2f8(%r14), %rdx
subq %rsi, %rdx
sarq $0x3, %rdx
movabsq $-0x79435e50d79435e5, %rdi # imm = 0x86BCA1AF286BCA1B
imulq %rdi, %rdx
cmpq %rbp, %rdx
jbe 0x4751f
sarq $0x3, %rcx
movq 0x90(%rsp), %rdx
addq %rax, %rsi
addq $0x30, %rsi
movq 0x130(%rsp), %rdi
xorl %r8d, %r8d
movsd 0xa8(%rsp), %xmm4
movsd 0x168(%rsp), %xmm5
movsd 0x10cdfd(%rip), %xmm6   # 0x153580
movsd 0x10ce05(%rip), %xmm7   # 0x153590
xorps %xmm2, %xmm2
cvtsi2sdl (%rdx,%r8,4), %xmm2
divsd %xmm5, %xmm2
mulsd %xmm7, %xmm2
mulsd %xmm6, %xmm2
movsd (%rsi), %xmm3
addsd %xmm4, %xmm3
mulsd %xmm3, %xmm3
mulsd %xmm2, %xmm3
addsd (%rdi,%r8,8), %xmm3
movsd %xmm3, (%rdi,%r8,8)
incq %r8
movl %r8d, %r9d
cmpq %r9, %rcx
ja 0x4678b
movq 0x100(%rsp), %rcx
movq 0xf8(%rsp), %rdx
subq %rdx, %rcx
je 0x46881
movq 0x2f0(%r14), %rsi
movq 0x2f8(%r14), %rdx
subq %rsi, %rdx
sarq $0x3, %rdx
movabsq $-0x79435e50d79435e5, %rdi # imm = 0x86BCA1AF286BCA1B
imulq %rdi, %rdx
cmpq %rbp, %rdx
jbe 0x47530
sarq $0x3, %rcx
movq 0x70(%rsp), %rdx
addq %rsi, %rax
addq $0x30, %rax
movq 0xf8(%rsp), %rsi
xorl %edi, %edi
movsd 0xa8(%rsp), %xmm4
movsd 0x168(%rsp), %xmm5
movsd 0x10cd40(%rip), %xmm6   # 0x153580
movsd 0x10cd48(%rip), %xmm7   # 0x153590
xorps %xmm2, %xmm2
cvtsi2sdl (%rdx,%rdi,4), %xmm2
divsd %xmm5, %xmm2
mulsd %xmm7, %xmm2
mulsd %xmm6, %xmm2
movsd (%rax), %xmm3
addsd %xmm4, %xmm3
mulsd %xmm3, %xmm3
mulsd %xmm2, %xmm3
addsd (%rsi,%rdi,8), %xmm3
movsd %xmm3, (%rsi,%rdi,8)
incq %rdi
movl %edi, %r8d
cmpq %r8, %rcx
ja 0x46848
mulsd %xmm0, %xmm0
mulsd %xmm0, %xmm9
mulsd %xmm1, %xmm1
mulsd %xmm1, %xmm8
movsd %xmm9, 0x50(%rsp)
movsd %xmm9, 0x148(%rsp)
movsd %xmm8, 0x30(%rsp)
movsd %xmm8, 0x150(%rsp)
movq 0x118(%rsp), %rsi
cmpq 0x120(%rsp), %rsi
je 0x468df
movupd 0x148(%rsp), %xmm0
movupd %xmm0, (%rsi)
addq $0x10, 0x118(%rsp)
jmp 0x468ef
leaq 0x110(%rsp), %rdi
movq %r15, %rdx
callq 0x49962
movq 0x70(%rsp), %rdi
testq %rdi, %rdi
je 0x46909
movq 0x80(%rsp), %rsi
subq %rdi, %rsi
callq 0x4470
movq 0x90(%rsp), %rdi
testq %rdi, %rdi
je 0x46926
movq 0xa0(%rsp), %rsi
subq %rdi, %rsi
callq 0x4470
movsd 0x48(%rsp), %xmm0
addsd 0x50(%rsp), %xmm0
movsd %xmm0, 0x48(%rsp)
movsd 0x68(%rsp), %xmm0
addsd 0x30(%rsp), %xmm0
movsd %xmm0, 0x68(%rsp)
incq %rbp
movslq 0x110(%r14), %rax
cmpq %rax, %rbp
jl 0x46172
jmp 0x4696f
xorpd %xmm0, %xmm0
movsd %xmm0, 0x68(%rsp)
movsd %xmm0, 0x48(%rsp)
movb 0xd88(%rsp), %r13b
testb %r13b, %r13b
je 0x46d5e
cmpb $0x0, 0xd90(%rsp)
je 0x46c64
cmpb $0x0, 0xd98(%rsp)
je 0x46ce0
xorpd %xmm0, %xmm0
movapd %xmm0, 0x90(%rsp)
xorl %eax, %eax
movq %rax, 0xa0(%rsp)
movq %rax, 0x80(%rsp)
movapd %xmm0, 0x70(%rsp)
movq 0xe0(%rsp), %rax
movabsq $-0x5555555555555555, %r12 # imm = 0xAAAAAAAAAAAAAAAB
cmpq %rax, 0xe8(%rsp)
je 0x46a86
movl $0x1, %ebp
xorl %ecx, %ecx
leaq 0x148(%rsp), %rbx
leaq 0x90(%rsp), %r15
leaq (%rcx,%rcx,2), %rcx
movq 0x10(%rax,%rcx,8), %rdx
movq %rdx, 0x10(%rsp)
movupd (%rax,%rcx,8), %xmm0
movupd %xmm0, (%rsp)
movq %rbx, %rdi
movq 0x20(%rsp), %rsi
callq 0x52082
movq 0x98(%rsp), %rsi
cmpq 0xa0(%rsp), %rsi
je 0x46a53
movq 0x158(%rsp), %rax
movq %rax, 0x10(%rsi)
movupd 0x148(%rsp), %xmm0
movupd %xmm0, (%rsi)
addq $0x18, 0x98(%rsp)
jmp 0x46a5e
movq %r15, %rdi
movq %rbx, %rdx
callq 0x3012c
movl %ebp, %ecx
movq 0xe0(%rsp), %rax
movq 0xe8(%rsp), %rdx
subq %rax, %rdx
sarq $0x3, %rdx
imulq %r12, %rdx
incl %ebp
cmpq %rcx, %rdx
ja 0x469f8
movq 0xc0(%rsp), %rax
cmpq %rax, 0xc8(%rsp)
je 0x46b38
movl $0x1, %ebp
xorl %ecx, %ecx
leaq 0x148(%rsp), %rbx
leaq 0x70(%rsp), %r15
leaq (%rcx,%rcx,2), %rcx
movq 0x10(%rax,%rcx,8), %rdx
movq %rdx, 0x10(%rsp)
movupd (%rax,%rcx,8), %xmm0
movupd %xmm0, (%rsp)
movq %rbx, %rdi
movq 0x20(%rsp), %rsi
callq 0x52082
movq 0x78(%rsp), %rsi
cmpq 0x80(%rsp), %rsi
je 0x46b05
movq 0x158(%rsp), %rax
movq %rax, 0x10(%rsi)
movupd 0x148(%rsp), %xmm0
movupd %xmm0, (%rsi)
addq $0x18, 0x78(%rsp)
jmp 0x46b10
movq %r15, %rdi
movq %rbx, %rdx
callq 0x3012c
movl %ebp, %ecx
movq 0xc0(%rsp), %rax
movq 0xc8(%rsp), %rdx
subq %rax, %rdx
sarq $0x3, %rdx
imulq %r12, %rdx
incl %ebp
cmpq %rcx, %rdx
ja 0x46ab0
leaq 0x228(%rsp), %rdi
leaq 0x90(%rsp), %rsi
callq 0xe7f6
leaq 0x210(%rsp), %rdi
leaq 0x1a0(%rsp), %rsi
callq 0xe886
movq 0x20(%rsp), %r14
leaq 0x1f8(%rsp), %rdi
leaq 0x70(%rsp), %rsi
callq 0xe7f6
leaq 0x1e0(%rsp), %rdi
leaq 0x180(%rsp), %rsi
callq 0xe886
leaq 0x228(%rsp), %rsi
leaq 0x210(%rsp), %rdx
leaq 0x1f8(%rsp), %rcx
leaq 0x1e0(%rsp), %r8
movq 0x18(%rsp), %rdi
callq 0x3dcc7
movq 0x1e0(%rsp), %rdi
testq %rdi, %rdi
je 0x46bd5
movq 0x1f0(%rsp), %rsi
subq %rdi, %rsi
callq 0x4470
movq 0x1f8(%rsp), %rdi
testq %rdi, %rdi
je 0x46bf2
movq 0x208(%rsp), %rsi
subq %rdi, %rsi
callq 0x4470
movq 0x210(%rsp), %rdi
testq %rdi, %rdi
je 0x46c0f
movq 0x220(%rsp), %rsi
subq %rdi, %rsi
callq 0x4470
movq 0x228(%rsp), %rdi
testq %rdi, %rdi
je 0x46c2c
movq 0x238(%rsp), %rsi
subq %rdi, %rsi
callq 0x4470
movq 0x70(%rsp), %rdi
testq %rdi, %rdi
je 0x46c46
movq 0x80(%rsp), %rsi
subq %rdi, %rsi
callq 0x4470
movq 0x90(%rsp), %rdi
testq %rdi, %rdi
je 0x46d5e
movq 0xa0(%rsp), %rsi
jmp 0x46d56
leaq 0x288(%rsp), %rdi
leaq 0xe0(%rsp), %rsi
callq 0xe7f6
leaq 0x270(%rsp), %rdi
leaq 0xc0(%rsp), %rsi
callq 0xe7f6
leaq 0x288(%rsp), %rsi
leaq 0x270(%rsp), %rdx
movq 0x18(%rsp), %rdi
callq 0x3d61a
movq 0x270(%rsp), %rdi
testq %rdi, %rdi
je 0x46cc5
movq 0x280(%rsp), %rsi
subq %rdi, %rsi
callq 0x4470
movq 0x288(%rsp), %rdi
testq %rdi, %rdi
je 0x46d5e
movq 0x298(%rsp), %rsi
jmp 0x46d56
leaq 0x258(%rsp), %rdi
leaq 0xe0(%rsp), %rsi
callq 0xe7f6
leaq 0x240(%rsp), %rdi
leaq 0xc0(%rsp), %rsi
callq 0xe7f6
leaq 0x258(%rsp), %rsi
leaq 0x240(%rsp), %rdx
movq 0x18(%rsp), %rdi
callq 0x3daa5
movq 0x240(%rsp), %rdi
testq %rdi, %rdi
je 0x46d41
movq 0x250(%rsp), %rsi
subq %rdi, %rsi
callq 0x4470
movq 0x258(%rsp), %rdi
testq %rdi, %rdi
je 0x46d5e
movq 0x268(%rsp), %rsi
subq %rdi, %rsi
callq 0x4470
leaq 0x80(%r14), %rdi
callq 0x84ffd
movsd %xmm0, 0x30(%rsp)
testb %r13b, %r13b
jne 0x47345
leaq 0x10fe4d(%rip), %rsi    # 0x156bcd
movl $0x2, %edx
movq 0x18(%rsp), %rdi
callq 0x44e0
movq 0xd80(%rsp), %rbx
testq %rbx, %rbx
je 0x46db6
movq %rbx, %rdi
callq 0x41e0
movq 0x18(%rsp), %rdi
movq %rbx, %rsi
movq %rax, %rdx
callq 0x44e0
jmp 0x46dd2
movq 0x18(%rsp), %rcx
movq (%rcx), %rax
movq -0x18(%rax), %rax
leaq (%rcx,%rax), %rdi
movl 0x20(%rcx,%rax), %esi
orl $0x1, %esi
callq 0x4710
leaq 0x1106ad(%rip), %rsi    # 0x157486
movl $0x1, %edx
movq 0x18(%rsp), %rdi
callq 0x44e0
leaq 0x10ca13(%rip), %rsi    # 0x153802
movl $0x11, %edx
movq 0x18(%rsp), %rdi
callq 0x44e0
movq 0x18(%rsp), %rdi
movsd 0x30(%rsp), %xmm0
callq 0x46b0
movq %rax, %r15
leaq 0x10c9fc(%rip), %rsi    # 0x153814
movl $0xc, %edx
movq %rax, %rdi
callq 0x44e0
movq %r15, %rdi
movsd 0x160(%rsp), %xmm0
callq 0x46b0
leaq 0x108651(%rip), %rsi    # 0x14f48e
movl $0x3, %edx
movq %rax, %rdi
callq 0x44e0
leaq 0x10d0ed(%rip), %rsi    # 0x153f3e
movl $0x9, %edx
movq 0x18(%rsp), %rdi
callq 0x44e0
movq 0x18(%rsp), %rdi
movsd 0x48(%rsp), %xmm0
callq 0x46b0
movq %rax, %r15
leaq 0x11060c(%rip), %rsi    # 0x157486
movl $0x1, %edx
movq %rax, %rdi
callq 0x44e0
leaq 0x10d0bb(%rip), %rsi    # 0x153f49
movl $0xe, %edx
movq %r15, %rdi
callq 0x44e0
movsd 0x48(%rsp), %xmm0
divsd 0x30(%rsp), %xmm0
mulsd 0x10c6e9(%rip), %xmm0   # 0x153598
movq %r15, %rdi
movsd %xmm0, 0x50(%rsp)
callq 0x46b0
movq %rax, %r15
leaq 0x1105bf(%rip), %rsi    # 0x157486
movl $0x1, %edx
movq %rax, %rdi
callq 0x44e0
leaq 0x10d07e(%rip), %rsi    # 0x153f59
movl $0xb, %edx
movq %r15, %rdi
callq 0x44e0
movsd 0x50(%rsp), %xmm0
divsd 0x160(%rsp), %xmm0
movq %r15, %rdi
callq 0x46b0
movq %rax, %r15
leaq 0x11057d(%rip), %rsi    # 0x157486
movl $0x1, %edx
movq %rax, %rdi
callq 0x44e0
leaq 0x10d020(%rip), %rsi    # 0x153f3d
movl $0xa, %edx
movq %r15, %rdi
callq 0x44e0
movq %r15, %rdi
movsd 0x68(%rsp), %xmm0
callq 0x46b0
movq %rax, %r15
leaq 0x110544(%rip), %rsi    # 0x157486
movl $0x1, %edx
movq %rax, %rdi
callq 0x44e0
leaq 0x10cff2(%rip), %rsi    # 0x153f48
movl $0xf, %edx
movq %r15, %rdi
callq 0x44e0
movsd 0x68(%rsp), %xmm0
divsd 0x30(%rsp), %xmm0
mulsd 0x10c621(%rip), %xmm0   # 0x153598
movq %r15, %rdi
movsd %xmm0, 0x30(%rsp)
callq 0x46b0
movq %rax, %r15
leaq 0x1104f7(%rip), %rsi    # 0x157486
movl $0x1, %edx
movq %rax, %rdi
callq 0x44e0
leaq 0x10cfb5(%rip), %rsi    # 0x153f58
movl $0xc, %edx
movq %r15, %rdi
callq 0x44e0
movsd 0x30(%rsp), %xmm0
divsd 0x160(%rsp), %xmm0
movq %r15, %rdi
callq 0x46b0
leaq 0x10e560(%rip), %rsi    # 0x15552e
movl $0x1, %edx
movq %rax, %rdi
callq 0x44e0
movb 0xda0(%rsp), %al
xorb $0x1, %al
orb %r13b, %al
jne 0x471d8
cmpl $0x0, 0x110(%r14)
xorpd %xmm0, %xmm0
movapd %xmm0, 0x30(%rsp)
movapd %xmm0, 0x50(%rsp)
jle 0x470ea
movapd %xmm0, 0x50(%rsp)
movl $0x8, %ebx
movl $0x48, %r13d
xorl %r15d, %r15d
leaq 0x2a0(%rsp), %r12
movapd %xmm0, 0x30(%rsp)
movq 0x2f0(%r14), %rax
leaq 0x2b0(%rsp), %r14
movq %r14, 0x2a0(%rsp)
movq -0x8(%rax,%r13), %rsi
movq (%rax,%r13), %rdx
addq %rsi, %rdx
movq %r12, %rdi
callq 0xf32a
movq %r12, %rdi
callq 0x223bd
movl %eax, %ebp
movq 0x2a0(%rsp), %rdi
cmpq %r14, %rdi
je 0x4707f
movq 0x2b0(%rsp), %rsi
incq %rsi
callq 0x4470
testb %bpl, %bpl
je 0x470c7
movq 0x110(%rsp), %rax
movq 0x118(%rsp), %rdx
subq %rax, %rdx
sarq $0x4, %rdx
cmpq %r15, %rdx
jbe 0x47541
movapd 0x30(%rsp), %xmm0
addsd -0x8(%rax,%rbx), %xmm0
movapd %xmm0, 0x30(%rsp)
movapd 0x50(%rsp), %xmm0
addsd (%rax,%rbx), %xmm0
movapd %xmm0, 0x50(%rsp)
incq %r15
movq 0x20(%rsp), %r14
movslq 0x110(%r14), %rax
addq $0x10, %rbx
addq $0x98, %r13
cmpq %rax, %r15
jl 0x4702d
leaq 0x10ce74(%rip), %rsi    # 0x153f65
movl $0x2, %edx
movq 0x18(%rsp), %rdi
callq 0x44e0
movb 0xd88(%rsp), %r13b
movq 0xd80(%rsp), %rbx
testq %rbx, %rbx
je 0x4712f
movq %rbx, %rdi
callq 0x41e0
movq 0x18(%rsp), %rdi
movq %rbx, %rsi
movq %rax, %rdx
callq 0x44e0
jmp 0x4714b
movq 0x18(%rsp), %rcx
movq (%rcx), %rax
movq -0x18(%rax), %rax
leaq (%rcx,%rax), %rdi
movl 0x20(%rcx,%rax), %esi
orl $0x1, %esi
callq 0x4710
leaq 0x10ce16(%rip), %rsi    # 0x153f68
movl $0x21, %edx
movq 0x18(%rsp), %rdi
callq 0x44e0
movsd 0x48(%rsp), %xmm0
movapd 0x30(%rsp), %xmm1
divsd %xmm0, %xmm1
cmpeqsd 0x10c146(%rip), %xmm0   # 0x1532c0
andnpd %xmm1, %xmm0
movq 0x18(%rsp), %rdi
callq 0x46b0
movq %rax, %rbx
leaq 0x1082fc(%rip), %rsi    # 0x14f48e
movl $0x3, %edx
movq %rax, %rdi
callq 0x44e0
movsd 0x68(%rsp), %xmm1
movapd 0x50(%rsp), %xmm2
divsd %xmm1, %xmm2
xorpd %xmm0, %xmm0
cmpeqsd %xmm1, %xmm0
andnpd %xmm2, %xmm0
movq %rbx, %rdi
callq 0x46b0
leaq 0x10e363(%rip), %rsi    # 0x15552e
movl $0x1, %edx
movq %rax, %rdi
callq 0x44e0
testb %r13b, %r13b
jne 0x47345
leaq 0x10c66d(%rip), %rsi    # 0x153855
movl $0x14, %edx
movq 0x18(%rsp), %rdi
callq 0x44e0
movq 0x138(%rsp), %rsi
subq 0x130(%rsp), %rsi
sarq $0x3, %rsi
movq 0x18(%rsp), %rdi
callq 0x42b0
leaq 0x10cd6e(%rip), %rsi    # 0x153f8a
movl $0x1b, %edx
movq %rax, %rdi
callq 0x44e0
movq 0x130(%rsp), %rax
cmpq %rax, 0x138(%rsp)
je 0x47288
movl $0x1, %ebp
xorl %ecx, %ecx
leaq 0x108246(%rip), %rbx    # 0x14f48f
movsd (%rax,%rcx,8), %xmm0
movq 0x18(%rsp), %rdi
callq 0x46b0
movl $0x2, %edx
movq %rax, %rdi
movq %rbx, %rsi
callq 0x44e0
movl %ebp, %ecx
movq 0x130(%rsp), %rax
movq 0x138(%rsp), %rdx
subq %rax, %rdx
sarq $0x3, %rdx
incl %ebp
cmpq %rcx, %rdx
ja 0x47249
leaq 0x10c5f1(%rip), %rsi    # 0x153880
movl $0x14, %edx
movq 0x18(%rsp), %rdi
callq 0x44e0
movq 0x100(%rsp), %rsi
subq 0xf8(%rsp), %rsi
sarq $0x3, %rsi
movq 0x18(%rsp), %rdi
callq 0x42b0
leaq 0x10cce3(%rip), %rsi    # 0x153fa6
movl $0x1a, %edx
movq %rax, %rdi
callq 0x44e0
movq 0xf8(%rsp), %rax
cmpq %rax, 0x100(%rsp)
je 0x4732f
movl $0x1, %ebp
xorl %ecx, %ecx
leaq 0x10819f(%rip), %rbx    # 0x14f48f
movsd (%rax,%rcx,8), %xmm0
movq 0x18(%rsp), %rdi
callq 0x46b0
movl $0x2, %edx
movq %rax, %rdi
movq %rbx, %rsi
callq 0x44e0
movl %ebp, %ecx
movq 0xf8(%rsp), %rax
movq 0x100(%rsp), %rdx
subq %rax, %rdx
sarq $0x3, %rdx
incl %ebp
cmpq %rcx, %rdx
ja 0x472f0
leaq 0x10e1f8(%rip), %rsi    # 0x15552e
movl $0x1, %edx
movq 0x18(%rsp), %rdi
callq 0x44e0
movl 0xd40(%rsp), %ebx
testl %ebx, %ebx
je 0x47400
movq 0x14fc95(%rip), %rdi    # 0x196ff0
leaq 0x10e1cc(%rip), %rsi    # 0x15552e
movl $0x1, %edx
callq 0x44e0
movq 0x14fc7d(%rip), %rdi    # 0x196ff0
leaq 0x10e1b4(%rip), %rsi    # 0x15552e
movl $0x1, %edx
callq 0x44e0
movq 0x14fc65(%rip), %rdi    # 0x196ff0
leaq 0x10c38c(%rip), %rsi    # 0x15371e
movl $0x13, %edx
callq 0x44e0
movq 0x14fc4d(%rip), %rdi    # 0x196ff0
movl %ebx, %esi
callq 0x4750
movq %rax, %rbx
leaq 0x10c37e(%rip), %rsi    # 0x153732
movl $0xf, %edx
movq %rax, %rdi
callq 0x44e0
movl 0x2c(%rsp), %esi
imull 0x110(%r14), %esi
movq %rbx, %rdi
callq 0x4750
movq %rax, %rbx
leaq 0x10e14f(%rip), %rsi    # 0x15552e
movl $0x1, %edx
movq %rax, %rdi
callq 0x44e0
leaq 0x10e13b(%rip), %rsi    # 0x15552e
movl $0x1, %edx
movq %rbx, %rdi
callq 0x44e0
leaq 0x308(%rsp), %rdi
callq 0x4922a
movq 0x110(%rsp), %rdi
testq %rdi, %rdi
je 0x4742a
movq 0x120(%rsp), %rsi
subq %rdi, %rsi
callq 0x4470
movq 0xf8(%rsp), %rdi
testq %rdi, %rdi
je 0x47447
movq 0x108(%rsp), %rsi
subq %rdi, %rsi
callq 0x4470
movq 0x130(%rsp), %rdi
testq %rdi, %rdi
je 0x47464
movq 0x140(%rsp), %rsi
subq %rdi, %rsi
callq 0x4470
movq 0x180(%rsp), %rdi
testq %rdi, %rdi
je 0x47481
movq 0x190(%rsp), %rsi
subq %rdi, %rsi
callq 0x4470
movq 0xc0(%rsp), %rdi
testq %rdi, %rdi
je 0x4749e
movq 0xd0(%rsp), %rsi
subq %rdi, %rsi
callq 0x4470
movq 0x1a0(%rsp), %rdi
testq %rdi, %rdi
je 0x474bb
movq 0x1b0(%rsp), %rsi
subq %rdi, %rsi
callq 0x4470
movq 0xe0(%rsp), %rdi
testq %rdi, %rdi
je 0x474d8
movq 0xf0(%rsp), %rsi
subq %rdi, %rsi
callq 0x4470
leaq 0x308(%rsp), %rdi
callq 0x4925c
movsd 0x48(%rsp), %xmm0
addq $0xd48, %rsp            # imm = 0xD48
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x1081a1(%rip), %rdi    # 0x14f6a5
movq %rbp, %rsi
xorl %eax, %eax
callq 0x4630
leaq 0x108190(%rip), %rdi    # 0x14f6a5
movq %rbp, %rsi
xorl %eax, %eax
callq 0x4630
leaq 0x10817f(%rip), %rdi    # 0x14f6a5
movq %rbp, %rsi
xorl %eax, %eax
callq 0x4630
leaq 0x10816e(%rip), %rdi    # 0x14f6a5
movq %rbp, %rsi
xorl %eax, %eax
callq 0x4630
leaq 0x10815d(%rip), %rdi    # 0x14f6a5
movq %r15, %rsi
xorl %eax, %eax
callq 0x4630
movq %rax, %rbx
movq 0x1e0(%rsp), %rdi
testq %rdi, %rdi
je 0x47577
movq 0x1f0(%rsp), %rsi
subq %rdi, %rsi
callq 0x4470
jmp 0x47577
movq %rax, %rbx
movq 0x1f8(%rsp), %rdi
testq %rdi, %rdi
je 0x47599
movq 0x208(%rsp), %rsi
subq %rdi, %rsi
callq 0x4470
jmp 0x47599
movq %rax, %rbx
movq 0x210(%rsp), %rdi
testq %rdi, %rdi
je 0x475bb
movq 0x220(%rsp), %rsi
subq %rdi, %rsi
callq 0x4470
jmp 0x475bb
movq %rax, %rbx
movq 0x228(%rsp), %rdi
testq %rdi, %rdi
je 0x476e0
movq 0x238(%rsp), %rsi
subq %rdi, %rsi
callq 0x4470
jmp 0x476e0
jmp 0x476dd
movq %rax, %rbx
movq 0x240(%rsp), %rdi
testq %rdi, %rdi
je 0x4760b
movq 0x250(%rsp), %rsi
subq %rdi, %rsi
callq 0x4470
jmp 0x4760b
movq %rax, %rbx
movq 0x258(%rsp), %rdi
testq %rdi, %rdi
je 0x47717
movq 0x268(%rsp), %rsi
jmp 0x4770f
movq %rax, %rbx
movq 0x270(%rsp), %rdi
testq %rdi, %rdi
je 0x4764e
movq 0x280(%rsp), %rsi
subq %rdi, %rsi
callq 0x4470
jmp 0x4764e
movq %rax, %rbx
movq 0x288(%rsp), %rdi
testq %rdi, %rdi
je 0x47717
movq 0x298(%rsp), %rsi
jmp 0x4770f
jmp 0x476c1
jmp 0x476c1
movq %rax, %rbx
jmp 0x47751
movq %rax, %rbx
jmp 0x4776e
jmp 0x476c1
movq %rax, %rbx
jmp 0x477e2
jmp 0x476c1
jmp 0x476dd
jmp 0x476dd
jmp 0x476c1
movq %rax, %rbx
movq 0x2a0(%rsp), %rdi
cmpq %r14, %rdi
je 0x47717
movq 0x2b0(%rsp), %rsi
incq %rsi
jmp 0x47712
jmp 0x476c1
jmp 0x476dd
jmp 0x476c1
jmp 0x476c1
jmp 0x476dd
jmp 0x476dd
jmp 0x476c1
jmp 0x476dd
jmp 0x476dd
movq %rax, %rbx
jmp 0x47717
movq %rax, %rbx
jmp 0x476fa
jmp 0x476dd
jmp 0x476dd
jmp 0x476dd
jmp 0x476dd
jmp 0x476dd
jmp 0x476dd
jmp 0x476dd
jmp 0x476dd
jmp 0x476dd
movq %rax, %rbx
movq 0x70(%rsp), %rdi
testq %rdi, %rdi
je 0x476fa
movq 0x80(%rsp), %rsi
subq %rdi, %rsi
callq 0x4470
movq 0x90(%rsp), %rdi
testq %rdi, %rdi
je 0x47717
movq 0xa0(%rsp), %rsi
subq %rdi, %rsi
callq 0x4470
movq 0x110(%rsp), %rdi
testq %rdi, %rdi
je 0x47734
movq 0x120(%rsp), %rsi
subq %rdi, %rsi
callq 0x4470
movq 0xf8(%rsp), %rdi
testq %rdi, %rdi
je 0x47751
movq 0x108(%rsp), %rsi
subq %rdi, %rsi
callq 0x4470
movq 0x130(%rsp), %rdi
testq %rdi, %rdi
je 0x4776e
movq 0x140(%rsp), %rsi
subq %rdi, %rsi
callq 0x4470
movq 0x180(%rsp), %rdi
testq %rdi, %rdi
je 0x4778b
movq 0x190(%rsp), %rsi
subq %rdi, %rsi
callq 0x4470
movq 0xc0(%rsp), %rdi
testq %rdi, %rdi
je 0x477a8
movq 0xd0(%rsp), %rsi
subq %rdi, %rsi
callq 0x4470
movq 0x1a0(%rsp), %rdi
testq %rdi, %rdi
je 0x477c5
movq 0x1b0(%rsp), %rsi
subq %rdi, %rsi
callq 0x4470
movq 0xe0(%rsp), %rdi
testq %rdi, %rdi
je 0x477e2
movq 0xf0(%rsp), %rsi
subq %rdi, %rsi
callq 0x4470
leaq 0x308(%rsp), %rdi
callq 0x4925c
movq %rbx, %rdi
callq 0x4780