// File: /workspace/github_cpp_makefile_star2_O3/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 $0xd88, %rsp            # imm = 0xD88
movq %r9, 0xf8(%rsp)
movl %r8d, 0x17c(%rsp)
movl %ecx, 0x44(%rsp)
movsd %xmm2, 0x160(%rsp)
movsd %xmm1, 0x168(%rsp)
movsd %xmm0, 0x20(%rsp)
movl %edx, %ebx
movq %rsi, %r14
movq %rdi, %r15
testl %edx, %edx
cmoveq %rdi, %r14
leaq 0x348(%rsp), %r12
movq %r12, %rdi
callq 0x4866a
movq %r12, %rdi
movq %r15, %rsi
movq %r14, %rdx
movl %ebx, %ecx
movsd 0x20(%rsp), %xmm0
movsd 0x168(%rsp), %xmm1
callq 0x93b2c
leaq 0x348(%rsp), %rdi
callq 0x93f00
movl $0x3b4ca6f5, %edi       # imm = 0x3B4CA6F5
callq 0x4410
xorl %eax, %eax
movq %rax, 0xc0(%rsp)
xorpd %xmm0, %xmm0
movapd %xmm0, 0xb0(%rsp)
movq %rax, 0x1b0(%rsp)
movapd %xmm0, 0x1a0(%rsp)
movq %rax, 0xa0(%rsp)
movapd %xmm0, 0x90(%rsp)
movq %rax, 0x190(%rsp)
movapd %xmm0, 0x180(%rsp)
movslq 0xcd0(%rsp), %rsi
leaq 0x118(%rsp), %rdx
movq %rax, (%rdx)
leaq 0x148(%rsp), %rdi
leaq 0x100(%rsp), %rcx
callq 0x38220
movslq 0xcd4(%rsp), %rsi
leaq 0x100(%rsp), %rdx
movq $0x0, (%rdx)
leaq 0x118(%rsp), %rdi
leaq 0x70(%rsp), %rcx
callq 0x38220
movq 0xf8(%rsp), %r12
xorps %xmm1, %xmm1
xorpd %xmm0, %xmm0
movapd %xmm0, 0xd0(%rsp)
movaps %xmm1, 0x100(%rsp)
movq $0x0, 0x110(%rsp)
cmpl $0x0, 0x110(%r14)
movq %r14, 0x38(%rsp)
jle 0x4622d
xorps %xmm0, %xmm0
cvtsi2sdl 0x44(%rsp), %xmm0
movapd %xmm0, 0x300(%rsp)
unpcklpd %xmm0, %xmm0            # xmm0 = xmm0[0,0]
movapd %xmm0, 0x2f0(%rsp)
xorpd %xmm0, %xmm0
movapd %xmm0, 0xd0(%rsp)
xorl %ebp, %ebp
leaq 0x50(%rsp), %rbx
leaq 0x130(%rsp), %rcx
movslq 0xcd0(%rsp), %rsi
movl $0x0, 0x50(%rsp)
leaq 0x70(%rsp), %rdi
movq %rbx, %rdx
movq %rcx, %r15
callq 0x3864a
movslq 0xcd4(%rsp), %rsi
movl $0x0, 0x130(%rsp)
movq %rbx, %rdi
movq %r15, %rdx
leaq 0x2d8(%rsp), %rcx
callq 0x3864a
cmpl $0x0, 0x44(%rsp)
jle 0x4603a
xorpd %xmm0, %xmm0
movapd %xmm0, 0x1c0(%rsp)
xorl %r12d, %r12d
imulq $0x98, %rbp, %rax
movq %rax, 0x1d0(%rsp)
callq 0x4150
xorps %xmm0, %xmm0
cvtsi2sd %eax, %xmm0
divsd 0x10ba45(%rip), %xmm0   # 0x1515f0
addsd %xmm0, %xmm0
mulsd 0x10ba59(%rip), %xmm0   # 0x151610
movsd %xmm0, 0x20(%rsp)
callq 0x4150
xorps %xmm0, %xmm0
cvtsi2sd %eax, %xmm0
divsd 0x10ba47(%rip), %xmm0   # 0x151618
addsd %xmm0, %xmm0
addsd 0x10747b(%rip), %xmm0   # 0x14d058
movsd %xmm0, 0xe0(%rsp)
callq 0x4400
movsd %xmm0, 0x170(%rsp)
callq 0x4100
movsd %xmm0, 0x48(%rsp)
movsd 0x20(%rsp), %xmm0
callq 0x4800
mulsd 0x48(%rsp), %xmm0
movsd %xmm0, 0x48(%rsp)
movsd 0x170(%rsp), %xmm0
callq 0x4100
movsd %xmm0, 0x170(%rsp)
movsd 0x20(%rsp), %xmm0
callq 0x4100
movsd 0x170(%rsp), %xmm1
mulsd %xmm0, %xmm1
movq 0x2f0(%r14), %rax
movq 0x1d0(%rsp), %rcx
movsd 0x30(%rax,%rcx), %xmm2
addsd 0x168(%rsp), %xmm2
movsd 0x48(%rsp), %xmm0
mulsd %xmm2, %xmm0
mulsd %xmm2, %xmm1
mulsd 0xe0(%rsp), %xmm2
leaq 0x130(%rsp), %r15
movq %r15, %rdi
movq %r14, %rsi
callq 0x52eec
movq %r15, %rdi
xorl %esi, %esi
callq 0x83f9a
movsd (%rax), %xmm0
movq 0x2f0(%r14), %rax
movq 0x1d0(%rsp), %rbx
addsd 0x18(%rax,%rbx), %xmm0
movsd %xmm0, 0x20(%rsp)
movq %r15, %rdi
movl $0x1, %esi
callq 0x83f9a
movsd (%rax), %xmm0
movq 0x2f0(%r14), %rax
addsd 0x20(%rax,%rbx), %xmm0
movsd %xmm0, 0xe0(%rsp)
movq %r15, %rdi
movl $0x2, %esi
callq 0x83f9a
movsd (%rax), %xmm2
movq 0x2f0(%r14), %rax
addsd 0x28(%rax,%rbx), %xmm2
leaq 0x2d8(%rsp), %rdi
movq %r14, %rsi
movsd 0x20(%rsp), %xmm0
movsd 0xe0(%rsp), %xmm1
movsd %xmm2, 0x48(%rsp)
callq 0x52d94
movq 0x2e8(%rsp), %rax
movq %rax, 0x10(%rsp)
movups 0x2d8(%rsp), %xmm0
movups %xmm0, (%rsp)
leaq 0x348(%rsp), %rbx
movq %rbx, %rdi
movq %rbp, %r14
movl %ebp, %esi
callq 0x94c08
movl %eax, %ebp
movq %rbx, %rdi
callq 0x487fa
movl %eax, %r15d
movl %ebp, %eax
shrl $0x8, %eax
andl $0x1, %eax
movl 0x17c(%rsp), %ecx
andb %al, %cl
testb $0x1, %bpl
movzbl %cl, %r13d
cmovnel %eax, %r13d
movq %rbx, %rdi
callq 0x487fa
orb %bpl, %al
testb $0x1, %al
je 0x45d94
movq %r14, %rbp
movq 0x38(%rsp), %r14
jmp 0x4600b
leaq 0x330(%rsp), %rdi
movsd 0x20(%rsp), %xmm0
movsd 0xe0(%rsp), %xmm1
movsd 0x48(%rsp), %xmm2
callq 0x83f68
movq %r14, %rbp
movq 0x340(%rsp), %rax
movq %rax, 0x10(%rsp)
movups 0x330(%rsp), %xmm0
movups %xmm0, (%rsp)
leaq 0x318(%rsp), %rdi
movq 0x38(%rsp), %rsi
callq 0x53a92
movq 0x328(%rsp), %rax
movq %rax, 0x10(%rsp)
movups 0x318(%rsp), %xmm0
movups %xmm0, (%rsp)
leaq 0x1e0(%rsp), %rdi
movq 0x38(%rsp), %rsi
callq 0x51d04
testb %r13b, %r13b
je 0x45e48
movq 0x98(%rsp), %rsi
cmpq 0xa0(%rsp), %rsi
je 0x45e83
movq 0x1f0(%rsp), %rax
movq %rax, 0x10(%rsi)
movups 0x1e0(%rsp), %xmm0
movups %xmm0, (%rsi)
addq $0x18, 0x98(%rsp)
jmp 0x45e98
movq 0xb8(%rsp), %rsi
cmpq 0xc0(%rsp), %rsi
je 0x45f0d
movq 0x1f0(%rsp), %rax
movq %rax, 0x10(%rsi)
movups 0x1e0(%rsp), %xmm0
movups %xmm0, (%rsi)
addq $0x18, 0xb8(%rsp)
jmp 0x45f22
leaq 0x90(%rsp), %rdi
leaq 0x1e0(%rsp), %rdx
callq 0x2fec4
leaq 0x348(%rsp), %rdi
callq 0x48872
movq 0x38(%rsp), %r14
movq %rax, 0x88(%rsp)
cmpl $-0x1, %eax
jne 0x45ec5
sarq $0x20, %rax
movq 0x50(%rsp), %rcx
incl (%rcx,%rax,4)
jmp 0x45edd
movl $0x3d, %edx
movq 0x14f0ef(%rip), %rdi    # 0x194fc0
leaq 0x10b878(%rip), %rsi    # 0x151750
callq 0x44e0
movq 0x188(%rsp), %rsi
cmpq 0x190(%rsp), %rsi
je 0x45f98
movl 0x8c(%rsp), %eax
movl %eax, (%rsi)
addq $0x4, %rsi
movq %rsi, 0x188(%rsp)
jmp 0x45fad
leaq 0xb0(%rsp), %rdi
leaq 0x1e0(%rsp), %rdx
callq 0x2fec4
leaq 0x348(%rsp), %rdi
callq 0x48872
movq 0x38(%rsp), %r14
movq %rax, 0x88(%rsp)
movabsq $-0x100000001, %rcx     # imm = 0xFFFFFFFEFFFFFFFF
cmpq %rcx, %rax
jbe 0x45f57
movq 0x70(%rsp), %rcx
cltq
incl (%rcx,%rax,4)
jmp 0x45f6f
movl $0x3f, %edx
movq 0x14f05d(%rip), %rdi    # 0x194fc0
leaq 0x10b824(%rip), %rsi    # 0x15178e
callq 0x44e0
movq 0x1a8(%rsp), %rsi
cmpq 0x1b0(%rsp), %rsi
je 0x45fd7
movl 0x88(%rsp), %eax
movl %eax, (%rsi)
addq $0x4, %rsi
movq %rsi, 0x1a8(%rsp)
jmp 0x45fec
leaq 0x180(%rsp), %rdi
leaq 0x8c(%rsp), %rdx
callq 0xf864
movdqa 0x1c0(%rsp), %xmm1
pshufd $0x55, %xmm1, %xmm0     # xmm0 = xmm1[1,1,1,1]
movd %xmm0, %eax
incl %eax
movd %eax, %xmm0
punpcklqdq %xmm1, %xmm0    # xmm0 = xmm0[0],xmm1[0]
shufps $0xe2, %xmm1, %xmm0     # xmm0 = xmm0[2,0],xmm1[2,3]
movaps %xmm0, 0x1c0(%rsp)
jmp 0x4600b
leaq 0x1a0(%rsp), %rdi
leaq 0x88(%rsp), %rdx
callq 0xf864
movdqa 0x1c0(%rsp), %xmm1
movd %xmm1, %eax
incl %eax
movd %eax, %xmm0
movss %xmm0, %xmm1            # xmm1 = xmm0[0],xmm1[1,2,3]
movaps %xmm1, 0x1c0(%rsp)
movzbl %r15b, %eax
negl %eax
addl %eax, %r12d
incl %r12d
cmpl 0x44(%rsp), %r12d
jl 0x45b97
cvtdq2pd 0x1c0(%rsp), %xmm0
movq 0xf8(%rsp), %r12
leaq 0x50(%rsp), %rbx
jmp 0x4603e
xorpd %xmm0, %xmm0
movq 0x2f0(%r14), %rax
movq 0x2f8(%r14), %rdx
subq %rax, %rdx
sarq $0x3, %rdx
movabsq $-0x79435e50d79435e5, %rcx # imm = 0x86BCA1AF286BCA1B
imulq %rcx, %rdx
cmpq %rbp, %rdx
movsd 0x168(%rsp), %xmm3
jbe 0x46db2
imulq $0x98, %rbp, %rsi
movq 0x148(%rsp), %rcx
movq 0x150(%rsp), %rdx
movapd %xmm0, %xmm7
divpd 0x2f0(%rsp), %xmm7
leaq 0x30(%rax,%rsi), %rax
movsd (%rax), %xmm0
addsd %xmm3, %xmm0
mulpd 0x10b5a4(%rip), %xmm7   # 0x151650
mulpd 0x10b5ac(%rip), %xmm7   # 0x151660
subq %rcx, %rdx
movapd 0x300(%rsp), %xmm4
movsd 0x10b548(%rip), %xmm5   # 0x151610
movsd 0x10b550(%rip), %xmm6   # 0x151620
je 0x46116
sarq $0x3, %rdx
movq 0x70(%rsp), %rsi
xorl %edi, %edi
xorps %xmm1, %xmm1
cvtsi2sdl (%rsi,%rdi,4), %xmm1
divsd %xmm4, %xmm1
mulsd %xmm6, %xmm1
mulsd %xmm5, %xmm1
movsd (%rax), %xmm2
addsd %xmm3, %xmm2
mulsd %xmm2, %xmm2
mulsd %xmm1, %xmm2
addsd (%rcx,%rdi,8), %xmm2
movsd %xmm2, (%rcx,%rdi,8)
incq %rdi
movl %edi, %r8d
cmpq %r8, %rdx
ja 0x460dd
movq 0x118(%rsp), %rcx
movq 0x120(%rsp), %rdx
subq %rcx, %rdx
je 0x4616f
sarq $0x3, %rdx
movq 0x50(%rsp), %rsi
xorl %edi, %edi
xorps %xmm1, %xmm1
cvtsi2sdl (%rsi,%rdi,4), %xmm1
divsd %xmm4, %xmm1
mulsd %xmm6, %xmm1
mulsd %xmm5, %xmm1
movsd (%rax), %xmm2
addsd %xmm3, %xmm2
mulsd %xmm2, %xmm2
mulsd %xmm1, %xmm2
addsd (%rcx,%rdi,8), %xmm2
movsd %xmm2, (%rcx,%rdi,8)
incq %rdi
movl %edi, %r8d
cmpq %r8, %rdx
ja 0x46136
mulsd %xmm0, %xmm0
unpcklpd %xmm0, %xmm0            # xmm0 = xmm0[0,0]
mulpd %xmm0, %xmm7
movapd %xmm7, 0x20(%rsp)
movapd %xmm7, 0x130(%rsp)
movq 0x108(%rsp), %rsi
cmpq 0x110(%rsp), %rsi
je 0x461b4
movapd 0x130(%rsp), %xmm0
movupd %xmm0, (%rsi)
addq $0x10, 0x108(%rsp)
jmp 0x461c9
leaq 0x100(%rsp), %rdi
leaq 0x130(%rsp), %rdx
callq 0x49446
movq 0x50(%rsp), %rdi
testq %rdi, %rdi
je 0x461e0
movq 0x60(%rsp), %rsi
subq %rdi, %rsi
callq 0x4470
movq 0x70(%rsp), %rdi
testq %rdi, %rdi
je 0x461fa
movq 0x80(%rsp), %rsi
subq %rdi, %rsi
callq 0x4470
movapd 0xd0(%rsp), %xmm0
addpd 0x20(%rsp), %xmm0
movapd %xmm0, 0xd0(%rsp)
incq %rbp
movslq 0x110(%r14), %rax
cmpq %rax, %rbp
leaq 0x130(%rsp), %rcx
jl 0x45b27
movb 0xdc8(%rsp), %bpl
testb %bpl, %bpl
je 0x46609
cmpb $0x0, 0xdd0(%rsp)
je 0x46513
cmpb $0x0, 0xdd8(%rsp)
je 0x4658d
xorpd %xmm0, %xmm0
movapd %xmm0, 0x70(%rsp)
xorl %eax, %eax
movq %rax, 0x80(%rsp)
movq %rax, 0x60(%rsp)
movapd %xmm0, 0x50(%rsp)
movq 0xb0(%rsp), %rax
movabsq $-0x5555555555555555, %r12 # imm = 0xAAAAAAAAAAAAAAAB
cmpq %rax, 0xb8(%rsp)
je 0x46338
movl $0x1, %r13d
xorl %ecx, %ecx
leaq 0x130(%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 0x38(%rsp), %rsi
callq 0x51c42
movq 0x78(%rsp), %rsi
cmpq 0x80(%rsp), %rsi
je 0x46303
movq 0x140(%rsp), %rax
movq %rax, 0x10(%rsi)
movupd 0x130(%rsp), %xmm0
movupd %xmm0, (%rsi)
addq $0x18, 0x78(%rsp)
jmp 0x4630e
movq %r15, %rdi
movq %rbx, %rdx
callq 0x2fec4
movl %r13d, %ecx
movq 0xb0(%rsp), %rax
movq 0xb8(%rsp), %rdx
subq %rax, %rdx
sarq $0x3, %rdx
imulq %r12, %rdx
incl %r13d
cmpq %rcx, %rdx
ja 0x462ae
movq 0x90(%rsp), %rax
cmpq %rax, 0x98(%rsp)
je 0x463ea
movl $0x1, %r13d
xorl %ecx, %ecx
leaq 0x130(%rsp), %rbx
leaq 0x50(%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 0x38(%rsp), %rsi
callq 0x51c42
movq 0x58(%rsp), %rsi
cmpq 0x60(%rsp), %rsi
je 0x463b5
movq 0x140(%rsp), %rax
movq %rax, 0x10(%rsi)
movupd 0x130(%rsp), %xmm0
movupd %xmm0, (%rsi)
addq $0x18, 0x58(%rsp)
jmp 0x463c0
movq %r15, %rdi
movq %rbx, %rdx
callq 0x2fec4
movl %r13d, %ecx
movq 0x90(%rsp), %rax
movq 0x98(%rsp), %rdx
subq %rax, %rdx
sarq $0x3, %rdx
imulq %r12, %rdx
incl %r13d
cmpq %rcx, %rdx
ja 0x46363
leaq 0x240(%rsp), %rdi
leaq 0x70(%rsp), %rsi
callq 0xe868
leaq 0x228(%rsp), %rdi
leaq 0x1a0(%rsp), %rsi
callq 0xe8f8
movq 0xf8(%rsp), %r12
movq 0x38(%rsp), %r14
leaq 0x210(%rsp), %rdi
leaq 0x50(%rsp), %rsi
callq 0xe868
leaq 0x1f8(%rsp), %rdi
leaq 0x180(%rsp), %rsi
callq 0xe8f8
leaq 0x240(%rsp), %rsi
leaq 0x228(%rsp), %rdx
leaq 0x210(%rsp), %rcx
leaq 0x1f8(%rsp), %r8
movq %r12, %rdi
callq 0x3d8a7
movq 0x1f8(%rsp), %rdi
testq %rdi, %rdi
je 0x4648a
movq 0x208(%rsp), %rsi
subq %rdi, %rsi
callq 0x4470
movq 0x210(%rsp), %rdi
testq %rdi, %rdi
je 0x464a7
movq 0x220(%rsp), %rsi
subq %rdi, %rsi
callq 0x4470
movq 0x228(%rsp), %rdi
testq %rdi, %rdi
je 0x464c4
movq 0x238(%rsp), %rsi
subq %rdi, %rsi
callq 0x4470
movq 0x240(%rsp), %rdi
testq %rdi, %rdi
je 0x464e1
movq 0x250(%rsp), %rsi
subq %rdi, %rsi
callq 0x4470
movq 0x50(%rsp), %rdi
testq %rdi, %rdi
je 0x464f8
movq 0x60(%rsp), %rsi
subq %rdi, %rsi
callq 0x4470
movq 0x70(%rsp), %rdi
testq %rdi, %rdi
je 0x46609
movq 0x80(%rsp), %rsi
jmp 0x46601
leaq 0x2a0(%rsp), %rdi
leaq 0xb0(%rsp), %rsi
callq 0xe868
leaq 0x288(%rsp), %rdi
leaq 0x90(%rsp), %rsi
callq 0xe868
leaq 0x2a0(%rsp), %rsi
leaq 0x288(%rsp), %rdx
movq %r12, %rdi
callq 0x3d1fa
movq 0x288(%rsp), %rdi
testq %rdi, %rdi
je 0x46572
movq 0x298(%rsp), %rsi
subq %rdi, %rsi
callq 0x4470
movq 0x2a0(%rsp), %rdi
testq %rdi, %rdi
je 0x46609
movq 0x2b0(%rsp), %rsi
jmp 0x46601
leaq 0x270(%rsp), %rdi
leaq 0xb0(%rsp), %rsi
callq 0xe868
leaq 0x258(%rsp), %rdi
leaq 0x90(%rsp), %rsi
callq 0xe868
leaq 0x270(%rsp), %rsi
leaq 0x258(%rsp), %rdx
movq %r12, %rdi
callq 0x3d685
movq 0x258(%rsp), %rdi
testq %rdi, %rdi
je 0x465ec
movq 0x268(%rsp), %rsi
subq %rdi, %rsi
callq 0x4470
movq 0x270(%rsp), %rdi
testq %rdi, %rdi
je 0x46609
movq 0x280(%rsp), %rsi
subq %rdi, %rsi
callq 0x4470
leaq 0x80(%r14), %rdi
callq 0x83b30
movsd %xmm0, 0x20(%rsp)
testb %bpl, %bpl
jne 0x46bf8
leaq 0x10e6ba(%rip), %rsi    # 0x154ce5
movl $0x2, %edx
movq %r12, %rdi
callq 0x44e0
movq 0xdc0(%rsp), %rbx
testq %rbx, %rbx
je 0x4665d
movq %rbx, %rdi
callq 0x41e0
movq %r12, %rdi
movq %rbx, %rsi
movq %rax, %rdx
callq 0x44e0
jmp 0x46676
movq (%r12), %rax
movq -0x18(%rax), %rax
leaq (%r12,%rax), %rdi
movl 0x20(%r12,%rax), %esi
orl $0x1, %esi
callq 0x4710
leaq 0x10ef59(%rip), %rsi    # 0x1555d6
movl $0x1, %edx
movq %r12, %rdi
callq 0x44e0
leaq 0x10b221(%rip), %rsi    # 0x1518b2
movl $0x11, %edx
movq %r12, %rdi
callq 0x44e0
movq %r12, %rdi
movsd 0x20(%rsp), %xmm0
callq 0x46b0
movq %rax, %r15
leaq 0x10b20e(%rip), %rsi    # 0x1518c4
movl $0xc, %edx
movq %rax, %rdi
callq 0x44e0
movq %r15, %rdi
movsd 0x160(%rsp), %xmm0
callq 0x46b0
leaq 0x106e03(%rip), %rsi    # 0x14d4de
movl $0x3, %edx
movq %rax, %rdi
callq 0x44e0
leaq 0x10b8ff(%rip), %rsi    # 0x151fee
movl $0x9, %edx
movq %r12, %rdi
callq 0x44e0
movq %r12, %rdi
movapd 0xd0(%rsp), %xmm0
callq 0x46b0
movq %rax, %r15
leaq 0x10eebf(%rip), %rsi    # 0x1555d6
movl $0x1, %edx
movq %rax, %rdi
callq 0x44e0
leaq 0x10b8ce(%rip), %rsi    # 0x151ff9
movl $0xe, %edx
movq %r15, %rdi
callq 0x44e0
movapd 0xd0(%rsp), %xmm0
divsd 0x20(%rsp), %xmm0
mulsd 0x10aed9(%rip), %xmm0   # 0x151628
movq %r15, %rdi
movapd %xmm0, 0xe0(%rsp)
callq 0x46b0
movq %rax, %r15
leaq 0x10ee6c(%rip), %rsi    # 0x1555d6
movl $0x1, %edx
movq %rax, %rdi
callq 0x44e0
leaq 0x10b88b(%rip), %rsi    # 0x152009
movl $0xb, %edx
movq %r15, %rdi
callq 0x44e0
movapd 0xe0(%rsp), %xmm0
divsd 0x160(%rsp), %xmm0
movq %r15, %rdi
callq 0x46b0
movq %rax, %r15
leaq 0x10ee27(%rip), %rsi    # 0x1555d6
movl $0x1, %edx
movq %rax, %rdi
callq 0x44e0
leaq 0x10b82a(%rip), %rsi    # 0x151fed
movl $0xa, %edx
movq %r15, %rdi
callq 0x44e0
movapd 0xd0(%rsp), %xmm0
unpckhpd %xmm0, %xmm0            # xmm0 = xmm0[1,1]
movq %r15, %rdi
movapd %xmm0, 0xe0(%rsp)
callq 0x46b0
movq %rax, %r15
leaq 0x10edde(%rip), %rsi    # 0x1555d6
movl $0x1, %edx
movq %rax, %rdi
callq 0x44e0
leaq 0x10b7ec(%rip), %rsi    # 0x151ff8
movl $0xf, %edx
movq %r15, %rdi
callq 0x44e0
movapd 0xe0(%rsp), %xmm0
divsd 0x20(%rsp), %xmm0
mulsd 0x10adf8(%rip), %xmm0   # 0x151628
movq %r15, %rdi
movapd %xmm0, 0x20(%rsp)
callq 0x46b0
movq %rax, %r15
leaq 0x10ed8e(%rip), %rsi    # 0x1555d6
movl $0x1, %edx
movq %rax, %rdi
callq 0x44e0
leaq 0x10b7ac(%rip), %rsi    # 0x152008
movl $0xc, %edx
movq %r15, %rdi
callq 0x44e0
movapd 0x20(%rsp), %xmm0
divsd 0x160(%rsp), %xmm0
movq %r15, %rdi
callq 0x46b0
leaq 0x10cd97(%rip), %rsi    # 0x15361e
movl $0x1, %edx
movq %rax, %rdi
callq 0x44e0
cmpb $0x0, 0xde0(%rsp)
je 0x46aa2
cmpl $0x0, 0x110(%r14)
xorpd %xmm0, %xmm0
movapd %xmm0, 0x20(%rsp)
jle 0x46983
movapd %xmm0, 0x20(%rsp)
movl $0x48, %ebx
xorl %r13d, %r13d
leaq 0x2b8(%rsp), %r12
xorl %r15d, %r15d
movq 0x2f0(%r14), %rax
leaq 0x2c8(%rsp), %r14
movq %r14, 0x2b8(%rsp)
movq -0x8(%rax,%rbx), %rsi
movq (%rax,%rbx), %rdx
addq %rsi, %rdx
movq %r12, %rdi
callq 0xf3ce
movq %r12, %rdi
callq 0x222b8
movl %eax, %ebp
movq 0x2b8(%rsp), %rdi
cmpq %r14, %rdi
je 0x46925
movq 0x2c8(%rsp), %rsi
incq %rsi
callq 0x4470
testb %bpl, %bpl
je 0x46960
movq 0x100(%rsp), %rax
movq 0x108(%rsp), %rdx
subq %rax, %rdx
sarq $0x4, %rdx
cmpq %r15, %rdx
jbe 0x46dc3
movupd (%rax,%r13), %xmm0
movapd 0x20(%rsp), %xmm1
addpd %xmm0, %xmm1
movapd %xmm1, 0x20(%rsp)
incq %r15
movq 0x38(%rsp), %r14
movslq 0x110(%r14), %rax
addq $0x10, %r13
addq $0x98, %rbx
cmpq %rax, %r15
jl 0x468d3
movapd 0xd0(%rsp), %xmm0
cmpeqpd 0x10671b(%rip), %xmm0   # 0x14d0b0
movmskpd %xmm0, %eax
xorpd %xmm0, %xmm0
movsd %xmm0, 0x48(%rsp)
movapd %xmm0, 0x1d0(%rsp)
testb $0x1, %al
jne 0x469c8
movapd 0x20(%rsp), %xmm0
divsd 0xd0(%rsp), %xmm0
movapd %xmm0, 0x1d0(%rsp)
testb $0x2, %al
movq 0xf8(%rsp), %r12
movq 0x38(%rsp), %r14
movq 0xdc0(%rsp), %rbx
jne 0x469fa
movapd 0x20(%rsp), %xmm0
unpckhpd %xmm0, %xmm0            # xmm0 = xmm0[1,1]
divsd 0xe0(%rsp), %xmm0
movsd %xmm0, 0x48(%rsp)
leaq 0x10b614(%rip), %rsi    # 0x152015
movl $0x2, %edx
movq %r12, %rdi
callq 0x44e0
testq %rbx, %rbx
je 0x46a2b
movq %rbx, %rdi
callq 0x41e0
movq %r12, %rdi
movq %rbx, %rsi
movq %rax, %rdx
callq 0x44e0
jmp 0x46a44
movq (%r12), %rax
movq -0x18(%rax), %rax
leaq (%r12,%rax), %rdi
movl 0x20(%r12,%rax), %esi
orl $0x1, %esi
callq 0x4710
leaq 0x10b5cd(%rip), %rsi    # 0x152018
movl $0x21, %edx
movq %r12, %rdi
callq 0x44e0
movq %r12, %rdi
movapd 0x1d0(%rsp), %xmm0
callq 0x46b0
movq %rax, %rbx
leaq 0x106a6b(%rip), %rsi    # 0x14d4de
movl $0x3, %edx
movq %rax, %rdi
callq 0x44e0
movq %rbx, %rdi
movsd 0x48(%rsp), %xmm0
callq 0x46b0
leaq 0x10cb89(%rip), %rsi    # 0x15361e
movl $0x1, %edx
movq %rax, %rdi
callq 0x44e0
leaq 0x10ae5c(%rip), %rsi    # 0x151905
movl $0x14, %edx
movq %r12, %rdi
callq 0x44e0
movq 0x150(%rsp), %rsi
subq 0x148(%rsp), %rsi
sarq $0x3, %rsi
movq %r12, %rdi
callq 0x42b0
leaq 0x10b561(%rip), %rsi    # 0x15203a
movl $0x1b, %edx
movq %rax, %rdi
callq 0x44e0
movq 0x148(%rsp), %rax
cmpq %rax, 0x150(%rsp)
je 0x46b43
movl $0x1, %ebp
xorl %ecx, %ecx
leaq 0x1069d9(%rip), %rbx    # 0x14d4df
movsd (%rax,%rcx,8), %xmm0
movq %r12, %rdi
callq 0x46b0
movl $0x2, %edx
movq %rax, %rdi
movq %rbx, %rsi
callq 0x44e0
movl %ebp, %ecx
movq 0x148(%rsp), %rax
movq 0x150(%rsp), %rdx
subq %rax, %rdx
sarq $0x3, %rdx
incl %ebp
cmpq %rcx, %rdx
ja 0x46b06
leaq 0x10ade6(%rip), %rsi    # 0x151930
movl $0x14, %edx
movq %r12, %rdi
callq 0x44e0
movq 0x120(%rsp), %rsi
subq 0x118(%rsp), %rsi
sarq $0x3, %rsi
movq %r12, %rdi
callq 0x42b0
leaq 0x10b4dc(%rip), %rsi    # 0x152056
movl $0x1a, %edx
movq %rax, %rdi
callq 0x44e0
movq 0x118(%rsp), %rax
cmpq %rax, 0x120(%rsp)
je 0x46be4
movl $0x1, %ebp
xorl %ecx, %ecx
leaq 0x106938(%rip), %rbx    # 0x14d4df
movsd (%rax,%rcx,8), %xmm0
movq %r12, %rdi
callq 0x46b0
movl $0x2, %edx
movq %rax, %rdi
movq %rbx, %rsi
callq 0x44e0
movl %ebp, %ecx
movq 0x118(%rsp), %rax
movq 0x120(%rsp), %rdx
subq %rax, %rdx
sarq $0x3, %rdx
incl %ebp
cmpq %rcx, %rdx
ja 0x46ba7
leaq 0x10ca33(%rip), %rsi    # 0x15361e
movl $0x1, %edx
movq %r12, %rdi
callq 0x44e0
movl 0xd80(%rsp), %ebx
testl %ebx, %ebx
je 0x46cb3
movq 0x14e3e2(%rip), %rdi    # 0x194ff0
leaq 0x10ca09(%rip), %rsi    # 0x15361e
movl $0x1, %edx
callq 0x44e0
movq 0x14e3ca(%rip), %rdi    # 0x194ff0
leaq 0x10c9f1(%rip), %rsi    # 0x15361e
movl $0x1, %edx
callq 0x44e0
movq 0x14e3b2(%rip), %rdi    # 0x194ff0
leaq 0x10ab89(%rip), %rsi    # 0x1517ce
movl $0x13, %edx
callq 0x44e0
movq 0x14e39a(%rip), %rdi    # 0x194ff0
movl %ebx, %esi
callq 0x4750
movq %rax, %rbx
leaq 0x10ab7b(%rip), %rsi    # 0x1517e2
movl $0xf, %edx
movq %rax, %rdi
callq 0x44e0
movl 0x44(%rsp), %esi
imull 0x110(%r14), %esi
movq %rbx, %rdi
callq 0x4750
movq %rax, %rbx
leaq 0x10c98c(%rip), %rsi    # 0x15361e
movl $0x1, %edx
movq %rax, %rdi
callq 0x44e0
leaq 0x10c978(%rip), %rsi    # 0x15361e
movl $0x1, %edx
movq %rbx, %rdi
callq 0x44e0
leaq 0x348(%rsp), %rdi
callq 0x48944
movq 0x100(%rsp), %rdi
testq %rdi, %rdi
je 0x46cdd
movq 0x110(%rsp), %rsi
subq %rdi, %rsi
callq 0x4470
movq 0x118(%rsp), %rdi
testq %rdi, %rdi
je 0x46cfa
movq 0x128(%rsp), %rsi
subq %rdi, %rsi
callq 0x4470
movq 0x148(%rsp), %rdi
testq %rdi, %rdi
je 0x46d17
movq 0x158(%rsp), %rsi
subq %rdi, %rsi
callq 0x4470
movq 0x180(%rsp), %rdi
testq %rdi, %rdi
je 0x46d34
movq 0x190(%rsp), %rsi
subq %rdi, %rsi
callq 0x4470
movq 0x90(%rsp), %rdi
testq %rdi, %rdi
je 0x46d51
movq 0xa0(%rsp), %rsi
subq %rdi, %rsi
callq 0x4470
movq 0x1a0(%rsp), %rdi
testq %rdi, %rdi
je 0x46d6e
movq 0x1b0(%rsp), %rsi
subq %rdi, %rsi
callq 0x4470
movq 0xb0(%rsp), %rdi
testq %rdi, %rdi
je 0x46d8b
movq 0xc0(%rsp), %rsi
subq %rdi, %rsi
callq 0x4470
leaq 0x348(%rsp), %rdi
callq 0x48974
movaps 0xd0(%rsp), %xmm0
addq $0xd88, %rsp            # imm = 0xD88
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x10693c(%rip), %rdi    # 0x14d6f5
movq %rbp, %rsi
xorl %eax, %eax
callq 0x4630
leaq 0x10692b(%rip), %rdi    # 0x14d6f5
movq %r15, %rsi
xorl %eax, %eax
callq 0x4630
movq %rax, %rbx
movq 0x1f8(%rsp), %rdi
testq %rdi, %rdi
je 0x46df9
movq 0x208(%rsp), %rsi
subq %rdi, %rsi
callq 0x4470
jmp 0x46df9
movq %rax, %rbx
movq 0x210(%rsp), %rdi
testq %rdi, %rdi
je 0x46e1b
movq 0x220(%rsp), %rsi
subq %rdi, %rsi
callq 0x4470
jmp 0x46e1b
movq %rax, %rbx
movq 0x228(%rsp), %rdi
testq %rdi, %rdi
je 0x46e3d
movq 0x238(%rsp), %rsi
subq %rdi, %rsi
callq 0x4470
jmp 0x46e3d
movq %rax, %rbx
movq 0x240(%rsp), %rdi
testq %rdi, %rdi
je 0x46f5c
movq 0x250(%rsp), %rsi
subq %rdi, %rsi
callq 0x4470
jmp 0x46f5c
jmp 0x46f59
movq %rax, %rbx
movq 0x258(%rsp), %rdi
testq %rdi, %rdi
je 0x46e8d
movq 0x268(%rsp), %rsi
subq %rdi, %rsi
callq 0x4470
jmp 0x46e8d
movq %rax, %rbx
movq 0x270(%rsp), %rdi
testq %rdi, %rdi
je 0x46f8d
movq 0x280(%rsp), %rsi
jmp 0x46f85
movq %rax, %rbx
movq 0x288(%rsp), %rdi
testq %rdi, %rdi
je 0x46ed0
movq 0x298(%rsp), %rsi
subq %rdi, %rsi
callq 0x4470
jmp 0x46ed0
movq %rax, %rbx
movq 0x2a0(%rsp), %rdi
testq %rdi, %rdi
je 0x46f8d
movq 0x2b0(%rsp), %rsi
jmp 0x46f85
jmp 0x46f42
jmp 0x46f42
movq %rax, %rbx
jmp 0x46fc7
movq %rax, %rbx
jmp 0x46fe4
jmp 0x46f42
movq %rax, %rbx
jmp 0x47058
jmp 0x46f42
jmp 0x46f59
jmp 0x46f59
jmp 0x46f42
movq %rax, %rbx
movq 0x2b8(%rsp), %rdi
cmpq %r14, %rdi
je 0x46f8d
movq 0x2c8(%rsp), %rsi
incq %rsi
jmp 0x46f88
jmp 0x46f42
jmp 0x46f59
jmp 0x46f42
jmp 0x46f59
jmp 0x46f42
movq %rax, %rbx
jmp 0x46f73
jmp 0x46f42
movq %rax, %rbx
jmp 0x46f8d
jmp 0x46f59
jmp 0x46f59
jmp 0x46f59
jmp 0x46f59
jmp 0x46f59
jmp 0x46f59
jmp 0x46f59
jmp 0x46f59
jmp 0x46f59
movq %rax, %rbx
movq 0x50(%rsp), %rdi
testq %rdi, %rdi
je 0x46f73
movq 0x60(%rsp), %rsi
subq %rdi, %rsi
callq 0x4470
movq 0x70(%rsp), %rdi
testq %rdi, %rdi
je 0x46f8d
movq 0x80(%rsp), %rsi
subq %rdi, %rsi
callq 0x4470
movq 0x100(%rsp), %rdi
testq %rdi, %rdi
je 0x46faa
movq 0x110(%rsp), %rsi
subq %rdi, %rsi
callq 0x4470
movq 0x118(%rsp), %rdi
testq %rdi, %rdi
je 0x46fc7
movq 0x128(%rsp), %rsi
subq %rdi, %rsi
callq 0x4470
movq 0x148(%rsp), %rdi
testq %rdi, %rdi
je 0x46fe4
movq 0x158(%rsp), %rsi
subq %rdi, %rsi
callq 0x4470
movq 0x180(%rsp), %rdi
testq %rdi, %rdi
je 0x47001
movq 0x190(%rsp), %rsi
subq %rdi, %rsi
callq 0x4470
movq 0x90(%rsp), %rdi
testq %rdi, %rdi
je 0x4701e
movq 0xa0(%rsp), %rsi
subq %rdi, %rsi
callq 0x4470
movq 0x1a0(%rsp), %rdi
testq %rdi, %rdi
je 0x4703b
movq 0x1b0(%rsp), %rsi
subq %rdi, %rsi
callq 0x4470
movq 0xb0(%rsp), %rdi
testq %rdi, %rdi
je 0x47058
movq 0xc0(%rsp), %rsi
subq %rdi, %rsi
callq 0x4470
leaq 0x348(%rsp), %rdi
callq 0x48974
movq %rbx, %rdi
callq 0x4780