// File: /workspace/github_cpp_makefile_star2_O1/Luthaf[P]zeopp/area_and_volume.cc
// Function: determineAccessibility(ATOM_NETWORK*, double, double, bool, std::vector<bool, std::allocator<bool>>*, VORONOI_NETWORK*)
void determineAccessibility(ATOM_NETWORK *atmnet, double r_probe_chan, double r_probe, bool excludePockets, vector<bool> *isAccessible, VORONOI_NETWORK *pointSet) {
  // Create a temporary copy of the atomic network in which each atom's radius has been increased by the probe radius
  ATOM_NETWORK newAtomNet;
  atmnet->copy(&newAtomNet);
  for(int i = 0; i < newAtomNet.numAtoms; i++){ newAtomNet.atoms[i].radius += r_probe; }  

  // Calculate and store the Voronoi network for this new atomic network
  VORONOI_NETWORK vornet;
  vector<BASIC_VCELL> vorcells;
  vector<VOR_CELL> advCells;

  container_periodic_poly *new_rad_con = (container_periodic_poly *)performVoronoiDecomp(true, &newAtomNet, &vornet, advCells, false, vorcells);

  vector<CHANNEL> channels = vector<CHANNEL>();
  vector<bool> accessInfo = vector<bool> ();
  CHANNEL::findChannels(&vornet, max(0.0, r_probe_chan - r_probe), &accessInfo, &channels);
  srand(randSeed);

  vector<Point> axsPoints = vector<Point> ();
  vector<Point> inaxsPoints = vector<Point> ();
  vector< pair<int, Point> > resampledInfo = vector< pair<int, Point> > ();  // List of resampled points and the id of the Voronoi cell to which they belong
  int resampleCount = 0;

  int num_accessible = 0;

  for(unsigned int i = 0; i < pointSet->nodes.size(); i++){
    bool overlaps = false;

    Point samplingPoint;
    if(resampleCount>0) {
      double change = 0.000001;
      samplingPoint = Point(pointSet->nodes.at(i).x+change, pointSet->nodes.at(i).y+change, pointSet->nodes.at(i).z+change);
    } else samplingPoint = Point(pointSet->nodes.at(i).x, pointSet->nodes.at(i).y, pointSet->nodes.at(i).z);

    double newAtomX, newAtomY, newAtomZ;
    int minAtomID;
    bool foundCell = new_rad_con->find_voronoi_cell(samplingPoint[0], samplingPoint[1], samplingPoint[2], newAtomX, newAtomY, newAtomZ, minAtomID);
    if(!foundCell){
	    cerr << "Error: Unable to find Voronoi cell for sampled point in AV calculation." << "\n"
	    << "Occurred for structure " << newAtomNet.name << "\n"
	    << "Exiting..." << "\n";
    	exit(1);
    }

    ATOM curAtom = atmnet->atoms[minAtomID];

    // Adjust sampling point so that it lies within the Voronoi cell of interest constructed previously
    samplingPoint = (samplingPoint.add(Point(curAtom.x, curAtom.y, curAtom.z).subtract(Point(newAtomX, newAtomY, newAtomZ))));

    double minDist = calcEuclideanDistance(samplingPoint[0], samplingPoint[1], samplingPoint[2], curAtom.x, curAtom.y, curAtom.z);
    if(minDist < r_probe + curAtom.radius - 0.00000001) overlaps = true;
    
    // If necessary, check Voronoi nodes of cell to determine accessibility of point
    if(!overlaps && excludePockets){
      BASIC_VCELL vcell = vorcells[minAtomID];
      Point circCenter = Point(curAtom.x, curAtom.y, curAtom.z);
      double samplingRadius = minDist;
      Point sampleRay = Point(samplingPoint[0]-curAtom.x, samplingPoint[1]-curAtom.y, samplingPoint[2]-curAtom.z);
      
      // Scan the nodes in the Voronoi cell to find if line can be drawn from the node to the sampling point
      bool foundNode = false;
      if(vcell.getNumNodes() == 0){
	      cerr << "Error: Voronoi cell of sampled point does not have any nodes" << "\n"
	      << "Point: " << samplingPoint[0] << " " << samplingPoint[1] << " " << samplingPoint[2] << "\n"
	      << "Voronoi cell is #" << minAtomID << " in structure " << newAtomNet.name << "\n"
	      << "Please contact the source code provider." << "\n"
	      << "Exiting..." << "\n";
	      exit(1);
      }
      for(int k = 0; k < vcell.getNumNodes(); k++){
	      Point nodePoint = vcell.getNodeCoord(k);  
	      bool nodeInsideSphere = (calcEuclideanDistance(nodePoint[0], nodePoint[1], nodePoint[2], circCenter[0], circCenter[1], circCenter[2]) < samplingRadius);
	      if(!nodeInsideSphere){
	        Point otherRay = samplingPoint.subtract(nodePoint);
	        double dotProduct = sampleRay.dot_product(otherRay);
          double dotProductMax = 1e-5;
	        if(dotProduct > dotProductMax) {
	          // Angle is less than 90 degrees and so the line segment intersects twice,
      	    // making the path not viable
	        }
	        else {
	          // Angle is at least 90 degrees and so the line segment interesects only once, 
	          // thereby representing a viable path
	          foundNode = true;
	          overlaps = !accessInfo.at(vcell.getNodeID(k));
	          break;
	        }
	      }
      }

      // Sampling failed due to lying on Voronoi cell face and numerical inaccurarcy. 
      // Record failure, resample and notify user later
      if(!foundNode){
	      resampleCount++;
	      resampledInfo.push_back(pair<int, Point> (minAtomID, samplingPoint));
	      i--;
      } else resampleCount = 0;
    }

    if(resampleCount==0) {
      if(!overlaps) num_accessible++;
      if(!overlaps) isAccessible->push_back(true); else isAccessible->push_back(false);
    }
  }

  // Warn user if points were resampled
  if(resampleCount != 0){
    cerr << "\n" << "\n"
    << "Warning: Resampled " << resampleCount << " points (preset coords, not random samples) out of " << pointSet->nodes.size()  
    << " when analyzing " << atmnet->name << "\n"
    << "\n" << "\n"; 
  }

  //FREE MEMORY
  delete new_rad_con;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x7a8, %rsp            # imm = 0x7A8
movq %rcx, 0x58(%rsp)
movq %rdx, 0x170(%rsp)
movl %esi, 0x3c(%rsp)
movsd %xmm1, 0x68(%rsp)
movsd %xmm0, 0x20(%rsp)
movq %rdi, %r14
leaq 0x348(%rsp), %rbx
movq %rbx, %rdi
callq 0x514f4
movq %r14, 0xc8(%rsp)
movq %r14, %rdi
movq %rbx, %rsi
callq 0x528f4
movslq 0x458(%rsp), %rcx
testq %rcx, %rcx
movsd 0x68(%rsp), %xmm1
jle 0x420bf
movq 0x638(%rsp), %rax
imulq $0x98, %rcx, %rcx
xorl %edx, %edx
movsd 0x30(%rax,%rdx), %xmm0
addsd %xmm1, %xmm0
movsd %xmm0, 0x30(%rax,%rdx)
addq $0x98, %rdx
cmpq %rdx, %rcx
jne 0x420a3
leaq 0x2b8(%rsp), %rdi
callq 0x555c0
xorpd %xmm0, %xmm0
leaq 0x200(%rsp), %r9
movapd %xmm0, (%r9)
xorl %eax, %eax
movq %rax, 0x10(%r9)
leaq 0x240(%rsp), %rcx
movq %rax, 0x10(%rcx)
movapd %xmm0, (%rcx)
leaq 0x348(%rsp), %rsi
leaq 0x2b8(%rsp), %rdx
movl $0x1, %edi
xorl %r8d, %r8d
callq 0x717c
movq %rax, %r14
leaq 0x220(%rsp), %rdx
xorpd %xmm2, %xmm2
movapd %xmm2, (%rdx)
xorl %r15d, %r15d
movq %r15, 0x10(%rdx)
movsd 0x20(%rsp), %xmm0
subsd 0x68(%rsp), %xmm0
xorpd %xmm1, %xmm1
maxsd %xmm1, %xmm0
leaq 0xa0(%rsp), %rsi
movq %r15, 0x20(%rsi)
movapd %xmm2, 0x10(%rsi)
movapd %xmm2, (%rsi)
leaq 0x2b8(%rsp), %rdi
callq 0x7481a
movl $0x3b4ca6f5, %edi       # imm = 0x3B4CA6F5
callq 0x4410
xorpd %xmm0, %xmm0
movapd %xmm0, 0x80(%rsp)
movq $0x0, 0x90(%rsp)
movq 0x58(%rsp), %rcx
movq 0x50(%rcx), %rax
cmpq 0x48(%rcx), %rax
je 0x42930
movl 0x3c(%rsp), %eax
xorb $0x1, %al
movl %eax, 0x3c(%rsp)
xorl %r13d, %r13d
leaq 0x1e0(%rsp), %rbx
leaq 0x1b0(%rsp), %rbp
leaq 0x330(%rsp), %r12
xorl %r15d, %r15d
movq $0x0, 0x60(%rsp)
movq %r14, 0x178(%rsp)
xorpd %xmm0, %xmm0
xorpd %xmm1, %xmm1
xorpd %xmm2, %xmm2
leaq 0x40(%rsp), %rdi
callq 0x85436
testl %r15d, %r15d
jle 0x42242
movq 0x58(%rsp), %rcx
movq 0x48(%rcx), %rax
movq 0x50(%rcx), %rdx
subq %rax, %rdx
sarq $0x6, %rdx
cmpq %r13, %rdx
jbe 0x42bd7
shlq $0x6, %r13
movsd (%rax,%r13), %xmm0
movsd 0x11134f(%rip), %xmm3   # 0x153568
addsd %xmm3, %xmm0
movsd 0x8(%rax,%r13), %xmm1
addsd %xmm3, %xmm1
movsd 0x10(%rax,%r13), %xmm2
addsd %xmm3, %xmm2
leaq 0xd0(%rsp), %rdi
callq 0x85436
jmp 0x42284
movq 0x58(%rsp), %rcx
movq 0x48(%rcx), %rax
movq 0x50(%rcx), %rdx
subq %rax, %rdx
sarq $0x6, %rdx
cmpq %r13, %rdx
jbe 0x42d7d
shlq $0x6, %r13
movsd (%rax,%r13), %xmm0
movsd 0x8(%rax,%r13), %xmm1
movsd 0x10(%rax,%r13), %xmm2
leaq 0xd0(%rsp), %rdi
callq 0x85436
movq 0xe0(%rsp), %rax
movq %rax, 0x50(%rsp)
movupd 0xd0(%rsp), %xmm0
movapd %xmm0, 0x40(%rsp)
leaq 0x40(%rsp), %rdi
xorl %esi, %esi
callq 0x85478
movsd (%rax), %xmm0
movsd %xmm0, 0x20(%rsp)
leaq 0x40(%rsp), %rdi
movl $0x1, %esi
callq 0x85478
movsd (%rax), %xmm0
movsd %xmm0, 0x30(%rsp)
leaq 0x40(%rsp), %rdi
movl $0x2, %esi
callq 0x85478
movsd (%rax), %xmm2
movq %r14, %rdi
movsd 0x20(%rsp), %xmm0
movsd 0x30(%rsp), %xmm1
leaq 0x1a8(%rsp), %rsi
leaq 0x1a0(%rsp), %rdx
leaq 0x198(%rsp), %rcx
leaq 0x2c(%rsp), %r8
callq 0x14ae5a
movq %r15, 0x70(%rsp)
testb %al, %al
je 0x42b2f
movslq 0x2c(%rsp), %rax
movq 0xc8(%rsp), %rcx
movq 0x2f0(%rcx), %r14
imulq $0x98, %rax, %r15
movups (%r14,%r15), %xmm0
movups 0x10(%r14,%r15), %xmm1
movups 0x20(%r14,%r15), %xmm2
movupd 0x30(%r14,%r15), %xmm3
movaps %xmm0, 0xd0(%rsp)
movaps %xmm1, 0xe0(%rsp)
movaps %xmm2, 0xf0(%rsp)
movapd %xmm3, 0x100(%rsp)
leaq 0x120(%rsp), %rax
movq %rax, 0x110(%rsp)
movq 0x40(%r14,%r15), %rsi
movq 0x48(%r14,%r15), %rdx
addq %rsi, %rdx
leaq 0x110(%rsp), %rdi
callq 0xf32a
addq %r15, %r14
leaq 0x140(%rsp), %rax
movq %rax, 0x130(%rsp)
movq 0x60(%r14), %rsi
movq 0x68(%r14), %rdx
addq %rsi, %rdx
leaq 0x130(%rsp), %rdi
callq 0xf32a
movb 0x90(%r14), %al
leaq 0x110(%rsp), %rcx
movb %al, 0x50(%rcx)
movups 0x80(%r14), %xmm0
movups %xmm0, 0x40(%rcx)
movsd 0xd0(%rsp), %xmm0
movsd 0xd8(%rsp), %xmm1
movsd 0xe0(%rsp), %xmm2
movq %rbx, %rdi
callq 0x85436
movq 0x70(%rsp), %r15
movsd 0x1a8(%rsp), %xmm0
movsd 0x1a0(%rsp), %xmm1
movsd 0x198(%rsp), %xmm2
leaq 0x270(%rsp), %rdi
callq 0x85436
movq 0x280(%rsp), %rax
movq %rax, 0x10(%rsp)
movupd 0x270(%rsp), %xmm0
movupd %xmm0, (%rsp)
leaq 0x288(%rsp), %rdi
movq %rbx, %rsi
callq 0x85528
movq 0x298(%rsp), %rax
movq %rax, 0x10(%rsp)
movupd 0x288(%rsp), %xmm0
movupd %xmm0, (%rsp)
movq %rbp, %rdi
leaq 0x40(%rsp), %rsi
callq 0x85446
movq 0x1c0(%rsp), %rax
movq %rax, 0x50(%rsp)
movupd 0x1b0(%rsp), %xmm0
movapd %xmm0, 0x40(%rsp)
leaq 0x40(%rsp), %rdi
xorl %esi, %esi
callq 0x85478
movsd (%rax), %xmm0
movsd %xmm0, 0x20(%rsp)
leaq 0x40(%rsp), %rdi
movl $0x1, %esi
callq 0x85478
movsd (%rax), %xmm0
movsd %xmm0, 0x30(%rsp)
leaq 0x40(%rsp), %rdi
movl $0x2, %esi
callq 0x85478
movsd (%rax), %xmm2
movsd 0xd0(%rsp), %xmm3
movsd 0xd8(%rsp), %xmm4
movsd 0xe0(%rsp), %xmm5
movsd 0x20(%rsp), %xmm0
movsd 0x30(%rsp), %xmm1
callq 0x868fa
movsd 0x100(%rsp), %xmm1
addsd 0x68(%rsp), %xmm1
addsd 0x111045(%rip), %xmm1   # 0x153570
movsd %xmm0, 0x180(%rsp)
ucomisd %xmm0, %xmm1
seta %r14b
movl %r14d, %eax
orb 0x3c(%rsp), %al
jne 0x42899
movslq 0x2c(%rsp), %rax
leaq (%rax,%rax,2), %r13
shlq $0x4, %r13
addq 0x200(%rsp), %r13
movq %rbp, %rdi
movq %r13, %rsi
callq 0xe7f6
addq $0x18, %r13
leaq 0x1c8(%rsp), %rdi
movq %r13, %rsi
callq 0xe886
movsd 0xd0(%rsp), %xmm0
movsd 0xd8(%rsp), %xmm1
movsd 0xe0(%rsp), %xmm2
movq %r12, %rdi
callq 0x85436
leaq 0x40(%rsp), %rdi
xorl %esi, %esi
callq 0x85478
movsd (%rax), %xmm0
subsd 0xd0(%rsp), %xmm0
movsd %xmm0, 0x20(%rsp)
leaq 0x40(%rsp), %rdi
movl $0x1, %esi
callq 0x85478
movsd (%rax), %xmm0
movsd %xmm0, 0x30(%rsp)
movsd 0xd8(%rsp), %xmm0
movsd %xmm0, 0x78(%rsp)
leaq 0x40(%rsp), %rdi
movl $0x2, %esi
callq 0x85478
movsd 0x30(%rsp), %xmm1
subsd 0x78(%rsp), %xmm1
movsd (%rax), %xmm2
subsd 0xe0(%rsp), %xmm2
leaq 0x2a0(%rsp), %rdi
movsd 0x20(%rsp), %xmm0
callq 0x85436
movq %rbp, %rdi
callq 0x6c80a
testl %eax, %eax
je 0x42be8
xorl %r15d, %r15d
xorl %r13d, %r13d
movq %rbp, %rdi
callq 0x6c80a
cmpl %eax, %r13d
jge 0x427c7
movq %rbx, %rdi
movq %rbp, %rsi
movl %r13d, %edx
callq 0x6c81c
movq %rbx, %rdi
xorl %esi, %esi
callq 0x85478
movsd (%rax), %xmm0
movsd %xmm0, 0x20(%rsp)
movq %rbx, %rdi
movl $0x1, %esi
callq 0x85478
movsd (%rax), %xmm0
movsd %xmm0, 0x30(%rsp)
movq %rbx, %rdi
movl $0x2, %esi
callq 0x85478
movsd (%rax), %xmm0
movsd %xmm0, 0x78(%rsp)
movq %r12, %rdi
xorl %esi, %esi
callq 0x85478
movsd (%rax), %xmm0
movsd %xmm0, 0x190(%rsp)
movq %r12, %rdi
movl $0x1, %esi
callq 0x85478
movsd (%rax), %xmm0
movsd %xmm0, 0x188(%rsp)
movq %r12, %rdi
movl $0x2, %esi
callq 0x85478
movsd (%rax), %xmm5
movsd 0x20(%rsp), %xmm0
movsd 0x30(%rsp), %xmm1
movsd 0x78(%rsp), %xmm2
movsd 0x190(%rsp), %xmm3
movsd 0x188(%rsp), %xmm4
callq 0x868fa
xorl %eax, %eax
movsd 0x180(%rsp), %xmm1
ucomisd %xmm0, %xmm1
ja 0x427bc
movq 0x1f0(%rsp), %rax
movq %rax, 0x10(%rsp)
movupd 0x1e0(%rsp), %xmm0
movupd %xmm0, (%rsp)
leaq 0x258(%rsp), %rdi
leaq 0x40(%rsp), %rsi
callq 0x85528
movq 0x268(%rsp), %rax
movq %rax, 0x10(%rsp)
movupd 0x258(%rsp), %xmm0
movupd %xmm0, (%rsp)
leaq 0x2a0(%rsp), %rdi
callq 0x855b8
xorl %eax, %eax
movsd %xmm0, 0x20(%rsp)
ucomisd 0x110dfa(%rip), %xmm0   # 0x153578
ja 0x427aa
movq %rbp, %rdi
movl %r13d, %esi
callq 0x6c83a
movslq %eax, %rsi
leaq 0xa0(%rsp), %rdi
callq 0xedb6
testq %rdx, (%rax)
sete %r14b
movb $0x1, %r15b
movl $0x8, %eax
movsd 0x20(%rsp), %xmm0
ucomisd 0x110dc0(%rip), %xmm0   # 0x153578
jbe 0x427bc
xorl %eax, %eax
incl %r13d
testl %eax, %eax
je 0x42638
testb $0x1, %r15b
je 0x427d5
xorl %r15d, %r15d
jmp 0x4285f
movl 0x2c(%rsp), %eax
movl %eax, 0x1e0(%rsp)
movq 0x50(%rsp), %rax
leaq 0x1e8(%rsp), %rcx
movq %rax, 0x10(%rcx)
movapd 0x40(%rsp), %xmm0
movupd %xmm0, (%rcx)
movq 0x88(%rsp), %rsi
cmpq 0x90(%rsp), %rsi
je 0x4283b
movupd 0x1e0(%rsp), %xmm0
movupd 0x1f0(%rsp), %xmm1
movupd %xmm1, 0x10(%rsi)
movupd %xmm0, (%rsi)
addq $0x20, %rsi
movq %rsi, 0x88(%rsp)
movq 0x70(%rsp), %r15
jmp 0x42850
leaq 0x80(%rsp), %rdi
movq %rbx, %rdx
callq 0x49804
movq 0x70(%rsp), %r15
incl %r15d
movq 0x60(%rsp), %rax
decl %eax
movq %rax, 0x60(%rsp)
movq 0x1c8(%rsp), %rdi
testq %rdi, %rdi
je 0x4287c
movq 0x1d8(%rsp), %rsi
subq %rdi, %rsi
callq 0x4470
movq 0x1b0(%rsp), %rdi
testq %rdi, %rdi
je 0x42899
movq 0x1c0(%rsp), %rsi
subq %rdi, %rsi
callq 0x4470
testl %r15d, %r15d
jne 0x428b5
notb %r14b
movzbl %r14b, %esi
andl $0x1, %esi
movq 0x170(%rsp), %rdi
callq 0xe9e6
movq 0x130(%rsp), %rdi
leaq 0x140(%rsp), %rax
cmpq %rax, %rdi
je 0x428da
movq 0x140(%rsp), %rsi
incq %rsi
callq 0x4470
movq 0x110(%rsp), %rdi
leaq 0x120(%rsp), %rax
cmpq %rax, %rdi
movq 0x178(%rsp), %r14
je 0x42907
movq 0x120(%rsp), %rsi
incq %rsi
callq 0x4470
movq 0x58(%rsp), %rcx
movq 0x50(%rcx), %rax
subq 0x48(%rcx), %rax
movq 0x60(%rsp), %rcx
incl %ecx
sarq $0x6, %rax
movq %rcx, %r13
movq %rcx, 0x60(%rsp)
cmpq %rcx, %rax
ja 0x421cf
testl %r15d, %r15d
je 0x42a34
movq 0x1546b0(%rip), %rdi    # 0x196ff0
leaq 0x112be7(%rip), %rsi    # 0x15552e
movl $0x1, %edx
callq 0x44e0
movq 0x154698(%rip), %rdi    # 0x196ff0
leaq 0x112bcf(%rip), %rsi    # 0x15552e
movl $0x1, %edx
callq 0x44e0
movq 0x154680(%rip), %rdi    # 0x196ff0
leaq 0x110da7(%rip), %rsi    # 0x15371e
movl $0x13, %edx
callq 0x44e0
movq 0x154668(%rip), %rdi    # 0x196ff0
movl %r15d, %esi
callq 0x4750
movq %rax, %rbx
leaq 0x11118f(%rip), %rsi    # 0x153b29
movl $0x33, %edx
movq %rax, %rdi
callq 0x44e0
movq 0x58(%rsp), %rax
movq 0x50(%rax), %rsi
subq 0x48(%rax), %rsi
sarq $0x6, %rsi
movq %rbx, %rdi
callq 0x42b0
movq %rax, %rbx
leaq 0x11cb1f(%rip), %rsi    # 0x15f4e9
movl $0x10, %edx
movq %rax, %rdi
callq 0x44e0
movq 0xc8(%rsp), %rax
movq 0x320(%rax), %rsi
movq 0x328(%rax), %rdx
movq %rbx, %rdi
callq 0x44e0
movq %rax, %rbx
leaq 0x112b2f(%rip), %rsi    # 0x15552e
movl $0x1, %edx
movq %rax, %rdi
callq 0x44e0
leaq 0x112b1b(%rip), %rsi    # 0x15552e
movl $0x1, %edx
movq %rbx, %rdi
callq 0x44e0
leaq 0x112b07(%rip), %rsi    # 0x15552e
movl $0x1, %edx
movq %rbx, %rdi
callq 0x44e0
testq %r14, %r14
je 0x42a5d
movq %r14, %rdi
addq $0x1f8, %rdi            # imm = 0x1F8
callq 0xf028
movq %r14, %rdi
callq 0x149ea2
movl $0x298, %esi            # imm = 0x298
movq %r14, %rdi
callq 0x4470
movq 0x80(%rsp), %rdi
testq %rdi, %rdi
je 0x42a7a
movq 0x90(%rsp), %rsi
subq %rdi, %rsi
callq 0x4470
movq 0xa0(%rsp), %rdi
testq %rdi, %rdi
je 0x42abf
movq 0xc0(%rsp), %rsi
subq %rdi, %rsi
callq 0x4470
xorl %eax, %eax
movq %rax, 0xa0(%rsp)
movl %eax, 0xa8(%rsp)
movq %rax, 0xb0(%rsp)
movl %eax, 0xb8(%rsp)
movq %rax, 0xc0(%rsp)
leaq 0x220(%rsp), %rdi
callq 0x494b0
leaq 0x240(%rsp), %rdi
callq 0xebb4
leaq 0x200(%rsp), %rdi
callq 0xebe4
movq 0x318(%rsp), %rdi
testq %rdi, %rdi
je 0x42b03
movq 0x328(%rsp), %rsi
subq %rdi, %rsi
callq 0x4470
leaq 0x300(%rsp), %rdi
callq 0xf1b8
leaq 0x348(%rsp), %rdi
callq 0xec14
addq $0x7a8, %rsp            # imm = 0x7A8
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq 0x1544ba(%rip), %rdi    # 0x196ff0
leaq 0x110efd(%rip), %rsi    # 0x153a3a
movl $0x47, %edx
callq 0x44e0
movq 0x1544a2(%rip), %rdi    # 0x196ff0
leaq 0x1129d9(%rip), %rsi    # 0x15552e
movl $0x1, %edx
callq 0x44e0
movq 0x15448a(%rip), %rdi    # 0x196ff0
leaq 0x110f15(%rip), %rsi    # 0x153a82
movl $0x17, %edx
callq 0x44e0
movq 0x668(%rsp), %rsi
movq 0x670(%rsp), %rdx
movq 0x154462(%rip), %rdi    # 0x196ff0
callq 0x44e0
movq %rax, %rbx
leaq 0x112991(%rip), %rsi    # 0x15552e
movl $0x1, %edx
movq %rax, %rdi
callq 0x44e0
leaq 0x113a01(%rip), %rsi    # 0x1565b2
movl $0xa, %edx
movq %rbx, %rdi
callq 0x44e0
leaq 0x112969(%rip), %rsi    # 0x15552e
movq %rbx, %rdi
callq 0x4440
movl $0x1, %edi
callq 0x710c
leaq 0x10cac7(%rip), %rdi    # 0x14f6a5
movq %r13, %rsi
xorl %eax, %eax
callq 0x4630
movq 0x154401(%rip), %rdi    # 0x196ff0
leaq 0x110ea4(%rip), %rsi    # 0x153a9a
movl $0x3c, %edx
callq 0x44e0
movq 0x1543e9(%rip), %rdi    # 0x196ff0
leaq 0x112920(%rip), %rsi    # 0x15552e
movl $0x1, %edx
callq 0x44e0
movq 0x1543d1(%rip), %rdi    # 0x196ff0
leaq 0x110eb1(%rip), %rsi    # 0x153ad7
movl $0x7, %edx
callq 0x44e0
leaq 0x40(%rsp), %rdi
xorl %esi, %esi
callq 0x85478
movsd (%rax), %xmm0
movq 0x1543a9(%rip), %rdi    # 0x196ff0
callq 0x46b0
movq %rax, %rbx
leaq 0x114830(%rip), %rsi    # 0x157486
movl $0x1, %edx
movq %rax, %rdi
callq 0x44e0
leaq 0x40(%rsp), %rdi
movl $0x1, %esi
callq 0x85478
movsd (%rax), %xmm0
movq %rbx, %rdi
callq 0x46b0
movq %rax, %rbx
leaq 0x1147fe(%rip), %rsi    # 0x157486
movl $0x1, %edx
movq %rax, %rdi
callq 0x44e0
leaq 0x40(%rsp), %rdi
movl $0x2, %esi
callq 0x85478
movsd (%rax), %xmm0
movq %rbx, %rdi
callq 0x46b0
movq %rax, %rbx
leaq 0x112874(%rip), %rsi    # 0x15552e
movl $0x1, %edx
movq %rax, %rdi
callq 0x44e0
leaq 0x110e11(%rip), %rsi    # 0x153adf
movl $0x11, %edx
movq %rbx, %rdi
callq 0x44e0
movl 0x2c(%rsp), %esi
movq %rbx, %rdi
callq 0x4750
movq %rax, %rbx
leaq 0x110e00(%rip), %rsi    # 0x153af1
movl $0xe, %edx
movq %rax, %rdi
callq 0x44e0
movq 0x668(%rsp), %rsi
movq 0x670(%rsp), %rdx
movq %rbx, %rdi
callq 0x44e0
movq %rax, %rbx
leaq 0x11280e(%rip), %rsi    # 0x15552e
movl $0x1, %edx
movq %rax, %rdi
callq 0x44e0
leaq 0x110dcc(%rip), %rsi    # 0x153b00
movl $0x28, %edx
movq %rbx, %rdi
callq 0x44e0
leaq 0x1127e6(%rip), %rsi    # 0x15552e
movl $0x1, %edx
movq %rbx, %rdi
callq 0x44e0
leaq 0x113856(%rip), %rsi    # 0x1565b2
movl $0xa, %edx
movq %rbx, %rdi
callq 0x44e0
leaq 0x1127be(%rip), %rsi    # 0x15552e
movq %rbx, %rdi
callq 0x4440
jmp 0x42bcd
leaq 0x10c921(%rip), %rdi    # 0x14f6a5
movq %r13, %rsi
xorl %eax, %eax
callq 0x4630
movq %rax, %rbx
jmp 0x42e60
movq %rax, %rbx
jmp 0x42eb2
jmp 0x42da0
movq %rax, %rbx
jmp 0x42ed9
jmp 0x42e26
jmp 0x42e16
jmp 0x42e16
jmp 0x42e16
jmp 0x42e26
movq %rax, %rbx
movq 0x1b0(%rsp), %rdi
testq %rdi, %rdi
je 0x42e36
movq 0x1c0(%rsp), %rsi
subq %rdi, %rsi
callq 0x4470
jmp 0x42e36
jmp 0x42e26
jmp 0x42e1d
jmp 0x42e26
jmp 0x42e16
jmp 0x42e16
jmp 0x42e16
jmp 0x42e16
movq %rax, %rbx
movq 0x110(%rsp), %rdi
leaq 0x120(%rsp), %rax
cmpq %rax, %rdi
je 0x42e43
movq 0x120(%rsp), %rsi
incq %rsi
callq 0x4470
jmp 0x42e43
jmp 0x42e16
jmp 0x42e26
jmp 0x42e26
jmp 0x42e26
jmp 0x42e26
movq %rax, %rbx
jmp 0x42e43
jmp 0x42e1d
movq %rax, %rbx
jmp 0x42e36
jmp 0x42e26
jmp 0x42e26
movq %rax, %rbx
leaq 0x1b0(%rsp), %rdi
callq 0xf420
leaq 0xd0(%rsp), %rdi
callq 0x2f814
movq 0x80(%rsp), %rdi
testq %rdi, %rdi
je 0x42e60
movq 0x90(%rsp), %rsi
subq %rdi, %rsi
callq 0x4470
movq 0xa0(%rsp), %rdi
testq %rdi, %rdi
je 0x42ea5
movq 0xc0(%rsp), %rsi
subq %rdi, %rsi
callq 0x4470
xorl %eax, %eax
movq %rax, 0xa0(%rsp)
movl %eax, 0xa8(%rsp)
movq %rax, 0xb0(%rsp)
movl %eax, 0xb8(%rsp)
movq %rax, 0xc0(%rsp)
leaq 0x220(%rsp), %rdi
callq 0x494b0
leaq 0x240(%rsp), %rdi
callq 0xebb4
leaq 0x200(%rsp), %rdi
callq 0xebe4
leaq 0x2b8(%rsp), %rdi
callq 0xeab8
leaq 0x348(%rsp), %rdi
callq 0xec14
movq %rbx, %rdi
callq 0x4780