// File: Luthaf[P]zeopp/networkaccessibility.cc
// Function: AccessibilityClassNINF::isPointInsideAtomAndNotAccessible(Point, int)
pair <bool,bool> AccessibilityClassNINF::isPointInsideAtomAndNotAccessible(Point samplingPoint, int atomID){

 bool inside = false, overlaps = false; // flags to state if a point is inside atom, inaccessible

 needToResampleFlag = false; // since new point is tested, we clear this variable

 Point smplPoint; // temporary sampling point

 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." << "\n"
          << "Exiting..." << "\n";
     exit(1);
    };

 tempMinDistAtomID = minAtomID; // store this information so it is not needed to be recomputed
 tempPoint = samplingPoint;

 // The routine first checks if the provided point is inside atoms


 // if in SA routine, check if the sampled point is within other atom
 if(atomID >= 0){
  if(highAccuracyFlag == false)
    {
    // old check from Thomas code (pre-high accuracy)
 
    // If point in Voronoi cell of different atom, probe-atom overlap occurs because of d^2-r^2 criterion.
    if(minAtomID != atomID)
      overlaps = true;

    }else{
    // new check if high accuracy is requested
    if(analyzedAtomNet->IDmapping[minAtomID] != atomID)
      overlaps = true;
    };
  }; // finishing check for SA


 ATOM curAtom = analyzedAtomNet->atoms[minAtomID];

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


 double minDist = calcEuclideanDistance(smplPoint[0], smplPoint[1], smplPoint[2], curAtom.x, curAtom.y, curAtom.z);
 if(minDist < curAtom.radius + r_probe - 0.00000001) 
   overlaps = true;


 if(highAccuracyFlag)  // additional check for high accuracy calculations to check if a point is within the original atom
   {
   curAtom = orgAtomNet->atoms[analyzedAtomNet->IDmapping[minAtomID]];
   minDist = orgAtomNet->calcDistance(smplPoint[0], smplPoint[1], smplPoint[2], &curAtom);
   if(minDist < curAtom.radius + r_probe - 0.00000001) 
     overlaps = true;
   };

 tempMinDist = minDist; // store temporary (to be used in AV within range function

 inside = overlaps;

 if(inside == true) return pair<bool,bool> (inside,overlaps); // if the point is inside an atom
                                                              // terminate and return the answer



 // If the point is outside of atoms
 // The routine then checks if the point is in accessible or inaccessible volume/surface 

 curAtom = analyzedAtomNet->atoms[minAtomID];  // making sure we look at the correct atom net (hiAcc or regular)

 // 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))));

 minDist = calcEuclideanDistance(samplingPoint[0], samplingPoint[1], samplingPoint[2], curAtom.x, curAtom.y, curAtom.z);

 // If necessary, check Voronoi nodes of cell to determine accessibility of point
 if(!overlaps){
   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;
   needToResampleFlag = 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 << "\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);
           bool nodeInsideOtherAtom = (vornet.nodes[vcell.getNodeID(k)].rad_stat_sphere < r_probe );
           if(!nodeInsideSphere&&!nodeInsideOtherAtom){
             Point otherRay = samplingPoint.subtract(nodePoint);
             double dotProduct = sampleRay.dot_product(otherRay);
             if(dotProduct > 0) {
               // 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;
               tempNodeID = vcell.getNodeID(k);
               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));
       needToResampleFlag = true;
       };

 };

return pair<bool,bool> (inside,overlaps);

}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x530, %rsp            # imm = 0x530
leaq 0x10(%rbp), %rax
movq %rax, -0x300(%rbp)
movq %rdi, -0x10(%rbp)
movl %esi, -0x14(%rbp)
movq -0x10(%rbp), %rax
movq %rax, -0x308(%rbp)
movb $0x0, -0x15(%rbp)
movb $0x0, -0x16(%rbp)
movb $0x0, 0x18c(%rax)
leaq -0x30(%rbp), %rdi
xorps %xmm2, %xmm2
movaps %xmm2, %xmm0
movaps %xmm2, %xmm1
callq 0xe9c70
movq -0x308(%rbp), %rax
movq -0x300(%rbp), %rdi
movq 0x140(%rax), %rax
movq %rax, -0x2f8(%rbp)
xorl %esi, %esi
callq 0xe9d70
movq -0x300(%rbp), %rdi
movsd (%rax), %xmm0
movsd %xmm0, -0x2f0(%rbp)
movl $0x1, %esi
callq 0xe9d70
movq -0x300(%rbp), %rdi
movsd (%rax), %xmm0
movsd %xmm0, -0x2e8(%rbp)
movl $0x2, %esi
callq 0xe9d70
movq -0x2f8(%rbp), %rdi
movsd -0x2f0(%rbp), %xmm0
movsd -0x2e8(%rbp), %xmm1
movsd (%rax), %xmm2
leaq -0x38(%rbp), %rsi
leaq -0x40(%rbp), %rdx
leaq -0x48(%rbp), %rcx
leaq -0x4c(%rbp), %r8
callq 0x1ed560
andb $0x1, %al
movb %al, -0x4d(%rbp)
testb $0x1, -0x4d(%rbp)
jne 0xfefbb
movq 0x174078(%rip), %rdi    # 0x272ff0
leaq 0xfdc09(%rip), %rsi     # 0x1fcb88
callq 0x5540
movq %rax, %rdi
leaq 0xfa697(%rip), %rsi     # 0x1f9625
callq 0x5540
movq %rax, %rdi
leaq 0xfc37d(%rip), %rsi     # 0x1fb31a
callq 0x5540
movq %rax, %rdi
leaq 0xfa679(%rip), %rsi     # 0x1f9625
callq 0x5540
movl $0x1, %edi
callq 0x67c0
movq -0x308(%rbp), %rax
movq -0x300(%rbp), %rcx
movl -0x4c(%rbp), %edx
movl %edx, 0x168(%rax)
movq (%rcx), %rdx
movq %rdx, 0x150(%rax)
movq 0x8(%rcx), %rdx
movq %rdx, 0x158(%rax)
movq 0x10(%rcx), %rcx
movq %rcx, 0x160(%rax)
cmpl $0x0, -0x14(%rbp)
jl 0xff044
movq -0x308(%rbp), %rax
movb 0x10(%rax), %al
andb $0x1, %al
movzbl %al, %eax
cmpl $0x0, %eax
jne 0xff01a
movl -0x4c(%rbp), %eax
cmpl -0x14(%rbp), %eax
je 0xff018
movb $0x1, -0x16(%rbp)
jmp 0xff042
movq -0x308(%rbp), %rax
movq 0x8(%rax), %rdi
addq $0x308, %rdi            # imm = 0x308
movslq -0x4c(%rbp), %rsi
callq 0xed60
movl (%rax), %eax
cmpl -0x14(%rbp), %eax
je 0xff040
movb $0x1, -0x16(%rbp)
jmp 0xff042
jmp 0xff044
movq -0x308(%rbp), %rax
movq 0x8(%rax), %rdi
addq $0x2f0, %rdi            # imm = 0x2F0
movslq -0x4c(%rbp), %rsi
callq 0xfcc0
movq %rax, %rsi
leaq -0xe8(%rbp), %rdi
callq 0xf0d0
movsd -0xe8(%rbp), %xmm0
movsd -0xe0(%rbp), %xmm1
movsd -0xd8(%rbp), %xmm2
leaq -0x130(%rbp), %rdi
callq 0xe9c70
jmp 0xff094
movsd -0x38(%rbp), %xmm0
movsd -0x40(%rbp), %xmm1
movsd -0x48(%rbp), %xmm2
leaq -0x158(%rbp), %rdi
callq 0xe9c70
jmp 0xff0b1
movq -0x148(%rbp), %rcx
movq %rsp, %rax
movq %rcx, 0x10(%rax)
movups -0x158(%rbp), %xmm0
movups %xmm0, (%rax)
leaq -0x118(%rbp), %rdi
leaq -0x130(%rbp), %rsi
callq 0xe9ef0
jmp 0xff0de
movq -0x300(%rbp), %rsi
movq -0x108(%rbp), %rcx
movq %rsp, %rax
movq %rcx, 0x10(%rax)
movups -0x118(%rbp), %xmm0
movups %xmm0, (%rax)
leaq -0x100(%rbp), %rdi
callq 0xe9cb0
jmp 0xff10b
movq -0xf0(%rbp), %rax
movq %rax, -0x20(%rbp)
movups -0x100(%rbp), %xmm0
movaps %xmm0, -0x30(%rbp)
leaq -0x30(%rbp), %rdi
xorl %esi, %esi
callq 0xe9d70
movq %rax, -0x310(%rbp)
jmp 0xff135
movq -0x310(%rbp), %rax
movsd (%rax), %xmm0
movsd %xmm0, -0x320(%rbp)
leaq -0x30(%rbp), %rdi
movl $0x1, %esi
callq 0xe9d70
movq %rax, -0x318(%rbp)
jmp 0xff15f
movq -0x318(%rbp), %rax
movsd (%rax), %xmm0
movsd %xmm0, -0x330(%rbp)
leaq -0x30(%rbp), %rdi
movl $0x2, %esi
callq 0xe9d70
movq %rax, -0x328(%rbp)
jmp 0xff189
movsd -0x330(%rbp), %xmm1
movsd -0x320(%rbp), %xmm0
movq -0x328(%rbp), %rax
movsd (%rax), %xmm2
movsd -0xe8(%rbp), %xmm3
movsd -0xe0(%rbp), %xmm4
movsd -0xd8(%rbp), %xmm5
callq 0xebaf0
movsd %xmm0, -0x338(%rbp)
jmp 0xff1cb
movq -0x308(%rbp), %rax
movsd -0x338(%rbp), %xmm0
movsd %xmm0, -0x160(%rbp)
movsd -0x160(%rbp), %xmm1
movsd -0xb8(%rbp), %xmm0
addsd 0x138(%rax), %xmm0
movsd 0xf740e(%rip), %xmm2    # 0x1f6610
subsd %xmm2, %xmm0
ucomisd %xmm1, %xmm0
jbe 0xff229
movb $0x1, -0x16(%rbp)
jmp 0xff229
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x138(%rbp)
movl %eax, -0x13c(%rbp)
jmp 0xffd5a
movq -0x308(%rbp), %rax
testb $0x1, 0x10(%rax)
je 0xff37d
movq -0x308(%rbp), %rcx
movq (%rcx), %rax
movq 0x8(%rcx), %rdi
addq $0x2f0, %rax            # imm = 0x2F0
movq %rax, -0x340(%rbp)
addq $0x308, %rdi            # imm = 0x308
movslq -0x4c(%rbp), %rsi
callq 0xed60
movq -0x340(%rbp), %rdi
movslq (%rax), %rsi
callq 0xfcc0
movq %rax, %rsi
leaq -0xe8(%rbp), %rdi
callq 0x595e0
jmp 0xff285
movq -0x308(%rbp), %rax
movq (%rax), %rax
movq %rax, -0x350(%rbp)
leaq -0x30(%rbp), %rdi
xorl %esi, %esi
callq 0xe9d70
movq %rax, -0x348(%rbp)
jmp 0xff2aa
movq -0x348(%rbp), %rax
movsd (%rax), %xmm0
movsd %xmm0, -0x360(%rbp)
leaq -0x30(%rbp), %rdi
movl $0x1, %esi
callq 0xe9d70
movq %rax, -0x358(%rbp)
jmp 0xff2d4
movq -0x358(%rbp), %rax
movsd (%rax), %xmm0
movsd %xmm0, -0x370(%rbp)
leaq -0x30(%rbp), %rdi
movl $0x2, %esi
callq 0xe9d70
movq %rax, -0x368(%rbp)
jmp 0xff2fe
movsd -0x370(%rbp), %xmm1
movsd -0x360(%rbp), %xmm0
movq -0x350(%rbp), %rdi
movq -0x368(%rbp), %rax
movsd (%rax), %xmm2
leaq -0xe8(%rbp), %rsi
callq 0x97950
movsd %xmm0, -0x378(%rbp)
jmp 0xff336
movq -0x308(%rbp), %rax
movsd -0x378(%rbp), %xmm0
movsd %xmm0, -0x160(%rbp)
movsd -0x160(%rbp), %xmm1
movsd -0xb8(%rbp), %xmm0
addsd 0x138(%rax), %xmm0
movsd 0xf72a3(%rip), %xmm2    # 0x1f6610
subsd %xmm2, %xmm0
ucomisd %xmm1, %xmm0
jbe 0xff37b
movb $0x1, -0x16(%rbp)
jmp 0xff37d
movq -0x308(%rbp), %rax
movsd -0x160(%rbp), %xmm0
movsd %xmm0, 0x148(%rax)
movb -0x16(%rbp), %al
andb $0x1, %al
movb %al, -0x15(%rbp)
movb -0x15(%rbp), %al
andb $0x1, %al
movzbl %al, %eax
cmpl $0x1, %eax
jne 0xff3cb
leaq -0x2(%rbp), %rdi
leaq -0x15(%rbp), %rsi
leaq -0x16(%rbp), %rdx
callq 0x102060
jmp 0xff3bc
movl $0x1, -0x164(%rbp)
jmp 0xffd41
movq -0x308(%rbp), %rax
movq 0x8(%rax), %rdi
addq $0x2f0, %rdi            # imm = 0x2F0
movslq -0x4c(%rbp), %rsi
callq 0xfcc0
movq %rax, %rsi
leaq -0xe8(%rbp), %rdi
callq 0x595e0
jmp 0xff3f7
movsd -0xe8(%rbp), %xmm0
movsd -0xe0(%rbp), %xmm1
movsd -0xd8(%rbp), %xmm2
leaq -0x1b0(%rbp), %rdi
callq 0xe9c70
jmp 0xff41d
movsd -0x38(%rbp), %xmm0
movsd -0x40(%rbp), %xmm1
movsd -0x48(%rbp), %xmm2
leaq -0x1c8(%rbp), %rdi
callq 0xe9c70
jmp 0xff43a
movq -0x1b8(%rbp), %rcx
movq %rsp, %rax
movq %rcx, 0x10(%rax)
movups -0x1c8(%rbp), %xmm0
movups %xmm0, (%rax)
leaq -0x198(%rbp), %rdi
leaq -0x1b0(%rbp), %rsi
callq 0xe9ef0
jmp 0xff467
movq -0x300(%rbp), %rsi
movq -0x188(%rbp), %rcx
movq %rsp, %rax
movq %rcx, 0x10(%rax)
movups -0x198(%rbp), %xmm0
movups %xmm0, (%rax)
leaq -0x180(%rbp), %rdi
callq 0xe9cb0
jmp 0xff494
movq -0x300(%rbp), %rdi
movq -0x170(%rbp), %rax
movq %rax, 0x10(%rdi)
movups -0x180(%rbp), %xmm0
movups %xmm0, (%rdi)
xorl %esi, %esi
callq 0xe9d70
movq %rax, -0x380(%rbp)
jmp 0xff4c0
movq -0x300(%rbp), %rdi
movq -0x380(%rbp), %rax
movsd (%rax), %xmm0
movsd %xmm0, -0x390(%rbp)
movl $0x1, %esi
callq 0xe9d70
movq %rax, -0x388(%rbp)
jmp 0xff4ed
movq -0x300(%rbp), %rdi
movq -0x388(%rbp), %rax
movsd (%rax), %xmm0
movsd %xmm0, -0x3a0(%rbp)
movl $0x2, %esi
callq 0xe9d70
movq %rax, -0x398(%rbp)
jmp 0xff51a
movsd -0x3a0(%rbp), %xmm1
movsd -0x390(%rbp), %xmm0
movq -0x398(%rbp), %rax
movsd (%rax), %xmm2
movsd -0xe8(%rbp), %xmm3
movsd -0xe0(%rbp), %xmm4
movsd -0xd8(%rbp), %xmm5
callq 0xebaf0
movsd %xmm0, -0x3a8(%rbp)
jmp 0xff55c
movsd -0x3a8(%rbp), %xmm0
movsd %xmm0, -0x160(%rbp)
testb $0x1, -0x16(%rbp)
jne 0xffd24
movq -0x308(%rbp), %rdi
addq $0x90, %rdi
movslq -0x4c(%rbp), %rsi
callq 0x162f0
movq %rax, %rsi
leaq -0x1f8(%rbp), %rdi
callq 0x17040
jmp 0xff59e
movsd -0xe8(%rbp), %xmm0
movsd -0xe0(%rbp), %xmm1
movsd -0xd8(%rbp), %xmm2
leaq -0x210(%rbp), %rdi
callq 0xe9c70
jmp 0xff5c4
movq -0x300(%rbp), %rdi
movsd -0x160(%rbp), %xmm0
movsd %xmm0, -0x218(%rbp)
xorl %esi, %esi
callq 0xe9d70
movq %rax, -0x3b0(%rbp)
jmp 0xff5eb
movq -0x300(%rbp), %rdi
movq -0x3b0(%rbp), %rax
movsd (%rax), %xmm0
movsd -0xe8(%rbp), %xmm1
subsd %xmm1, %xmm0
movsd %xmm0, -0x3c0(%rbp)
movl $0x1, %esi
callq 0xe9d70
movq %rax, -0x3b8(%rbp)
jmp 0xff624
movq -0x300(%rbp), %rdi
movq -0x3b8(%rbp), %rax
movsd (%rax), %xmm0
movsd -0xe0(%rbp), %xmm1
subsd %xmm1, %xmm0
movsd %xmm0, -0x3d0(%rbp)
movl $0x2, %esi
callq 0xe9d70
movq %rax, -0x3c8(%rbp)
jmp 0xff65d
movsd -0x3d0(%rbp), %xmm1
movsd -0x3c0(%rbp), %xmm0
movq -0x3c8(%rbp), %rax
movsd (%rax), %xmm2
movsd -0xd8(%rbp), %xmm3
subsd %xmm3, %xmm2
leaq -0x230(%rbp), %rdi
callq 0xe9c70
jmp 0xff692
movq -0x308(%rbp), %rax
movb $0x0, -0x231(%rbp)
movb $0x0, 0x18c(%rax)
leaq -0x1f8(%rbp), %rdi
callq 0xbd460
movl %eax, -0x3d4(%rbp)
jmp 0xff6bb
movl -0x3d4(%rbp), %eax
cmpl $0x0, %eax
jne 0xff903
movq 0x17391f(%rip), %rdi    # 0x272ff0
leaq 0xf7442(%rip), %rsi     # 0x1f6b1a
callq 0x5540
movq %rax, -0x3e0(%rbp)
jmp 0xff6e6
movq -0x3e0(%rbp), %rdi
leaq 0xf9f31(%rip), %rsi     # 0x1f9625
callq 0x5540
movq %rax, -0x3e8(%rbp)
jmp 0xff702
movq -0x3e8(%rbp), %rdi
leaq 0xf7447(%rip), %rsi     # 0x1f6b57
callq 0x5540
movq %rax, -0x3f0(%rbp)
jmp 0xff71e
movq -0x300(%rbp), %rdi
xorl %esi, %esi
callq 0xe9d70
movq %rax, -0x3f8(%rbp)
jmp 0xff735
movq -0x3f0(%rbp), %rdi
movq -0x3f8(%rbp), %rax
movsd (%rax), %xmm0
callq 0x5980
movq %rax, -0x400(%rbp)
jmp 0xff755
movq -0x400(%rbp), %rdi
leaq 0xfcb4b(%rip), %rsi     # 0x1fc2ae
callq 0x5540
movq %rax, -0x408(%rbp)
jmp 0xff771
movq -0x300(%rbp), %rdi
movl $0x1, %esi
callq 0xe9d70
movq %rax, -0x410(%rbp)
jmp 0xff78b
movq -0x408(%rbp), %rdi
movq -0x410(%rbp), %rax
movsd (%rax), %xmm0
callq 0x5980
movq %rax, -0x418(%rbp)
jmp 0xff7ab
movq -0x418(%rbp), %rdi
leaq 0xfcaf5(%rip), %rsi     # 0x1fc2ae
callq 0x5540
movq %rax, -0x420(%rbp)
jmp 0xff7c7
movq -0x300(%rbp), %rdi
movl $0x2, %esi
callq 0xe9d70
movq %rax, -0x428(%rbp)
jmp 0xff7e1
movq -0x420(%rbp), %rdi
movq -0x428(%rbp), %rax
movsd (%rax), %xmm0
callq 0x5980
movq %rax, -0x430(%rbp)
jmp 0xff801
movq -0x430(%rbp), %rdi
leaq 0xf9e16(%rip), %rsi     # 0x1f9625
callq 0x5540
movq %rax, -0x438(%rbp)
jmp 0xff81d
movq -0x438(%rbp), %rdi
leaq 0xf7334(%rip), %rsi     # 0x1f6b5f
callq 0x5540
movq %rax, -0x440(%rbp)
jmp 0xff839
movq -0x440(%rbp), %rdi
movl -0x4c(%rbp), %esi
callq 0x58d0
movq %rax, -0x448(%rbp)
jmp 0xff851
movq -0x448(%rbp), %rdi
leaq 0xf9dc6(%rip), %rsi     # 0x1f9625
callq 0x5540
movq %rax, -0x450(%rbp)
jmp 0xff86d
movq -0x450(%rbp), %rdi
leaq 0xf7305(%rip), %rsi     # 0x1f6b80
callq 0x5540
movq %rax, -0x458(%rbp)
jmp 0xff889
movq -0x458(%rbp), %rdi
leaq 0xf9d8e(%rip), %rsi     # 0x1f9625
callq 0x5540
movq %rax, -0x460(%rbp)
jmp 0xff8a5
movq -0x460(%rbp), %rdi
leaq 0xfba67(%rip), %rsi     # 0x1fb31a
callq 0x5540
movq %rax, -0x468(%rbp)
jmp 0xff8c1
movq -0x468(%rbp), %rdi
leaq 0xf9d56(%rip), %rsi     # 0x1f9625
callq 0x5540
jmp 0xff8d6
movl $0x1, %edi
callq 0x67c0
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x138(%rbp)
movl %eax, -0x13c(%rbp)
leaq -0x1f8(%rbp), %rdi
callq 0x138c0
jmp 0xffd5a
movl $0x0, -0x238(%rbp)
movl -0x238(%rbp), %eax
movl %eax, -0x470(%rbp)
leaq -0x1f8(%rbp), %rdi
callq 0xbd460
movl %eax, -0x46c(%rbp)
jmp 0xff92d
movl -0x470(%rbp), %eax
movl -0x46c(%rbp), %ecx
cmpl %ecx, %eax
jge 0xffcb1
movl -0x238(%rbp), %edx
leaq -0x250(%rbp), %rdi
leaq -0x1f8(%rbp), %rsi
callq 0xbd480
jmp 0xff95c
leaq -0x250(%rbp), %rdi
xorl %esi, %esi
callq 0xe9d70
movq %rax, -0x478(%rbp)
jmp 0xff973
movq -0x478(%rbp), %rax
movsd (%rax), %xmm0
movsd %xmm0, -0x488(%rbp)
leaq -0x250(%rbp), %rdi
movl $0x1, %esi
callq 0xe9d70
movq %rax, -0x480(%rbp)
jmp 0xff9a0
movq -0x480(%rbp), %rax
movsd (%rax), %xmm0
movsd %xmm0, -0x498(%rbp)
leaq -0x250(%rbp), %rdi
movl $0x2, %esi
callq 0xe9d70
movq %rax, -0x490(%rbp)
jmp 0xff9cd
movq -0x490(%rbp), %rax
movsd (%rax), %xmm0
movsd %xmm0, -0x4a8(%rbp)
leaq -0x210(%rbp), %rdi
xorl %esi, %esi
callq 0xe9d70
movq %rax, -0x4a0(%rbp)
jmp 0xff9f7
movq -0x4a0(%rbp), %rax
movsd (%rax), %xmm0
movsd %xmm0, -0x4b8(%rbp)
leaq -0x210(%rbp), %rdi
movl $0x1, %esi
callq 0xe9d70
movq %rax, -0x4b0(%rbp)
jmp 0xffa24
movq -0x4b0(%rbp), %rax
movsd (%rax), %xmm0
movsd %xmm0, -0x4c8(%rbp)
leaq -0x210(%rbp), %rdi
movl $0x2, %esi
callq 0xe9d70
movq %rax, -0x4c0(%rbp)
jmp 0xffa51
movsd -0x4c8(%rbp), %xmm4
movsd -0x4b8(%rbp), %xmm3
movsd -0x4a8(%rbp), %xmm2
movsd -0x498(%rbp), %xmm1
movsd -0x488(%rbp), %xmm0
movq -0x4c0(%rbp), %rax
movsd (%rax), %xmm5
callq 0xebaf0
movsd %xmm0, -0x4d0(%rbp)
jmp 0xffa93
movq -0x308(%rbp), %rax
movsd -0x4d0(%rbp), %xmm1
movsd -0x218(%rbp), %xmm0
ucomisd %xmm1, %xmm0
seta -0x251(%rbp)
addq $0x60, %rax
movq %rax, -0x4e0(%rbp)
movl -0x238(%rbp), %esi
leaq -0x1f8(%rbp), %rdi
callq 0xbd4d0
movl %eax, -0x4d4(%rbp)
jmp 0xffada
movq -0x4e0(%rbp), %rdi
movl -0x4d4(%rbp), %eax
movslq %eax, %rsi
callq 0x24e20
movq %rax, %rcx
movq -0x308(%rbp), %rax
movsd 0x18(%rcx), %xmm1
movsd 0x138(%rax), %xmm0
ucomisd %xmm1, %xmm0
seta %al
andb $0x1, %al
movb %al, -0x252(%rbp)
testb $0x1, -0x251(%rbp)
jne 0xffc9b
testb $0x1, -0x252(%rbp)
jne 0xffc9b
movq -0x300(%rbp), %rsi
movq -0x240(%rbp), %rax
movq %rax, -0x280(%rbp)
movups -0x250(%rbp), %xmm0
movaps %xmm0, -0x290(%rbp)
movq -0x280(%rbp), %rcx
movq %rsp, %rax
movq %rcx, 0x10(%rax)
movaps -0x290(%rbp), %xmm0
movups %xmm0, (%rax)
leaq -0x270(%rbp), %rdi
callq 0xe9ef0
jmp 0xffb78
movq -0x260(%rbp), %rax
movq %rax, -0x2a0(%rbp)
movups -0x270(%rbp), %xmm0
movaps %xmm0, -0x2b0(%rbp)
movq -0x2a0(%rbp), %rcx
movq %rsp, %rax
movq %rcx, 0x10(%rax)
movaps -0x2b0(%rbp), %xmm0
movups %xmm0, (%rax)
leaq -0x230(%rbp), %rdi
callq 0xea050
movsd %xmm0, -0x4e8(%rbp)
jmp 0xffbc2
movsd -0x4e8(%rbp), %xmm0
movsd %xmm0, -0x298(%rbp)
movsd -0x298(%rbp), %xmm0
xorps %xmm1, %xmm1
ucomisd %xmm1, %xmm0
jbe 0xffbe8
jmp 0xffc99
movb $0x1, -0x231(%rbp)
movl -0x238(%rbp), %esi
leaq -0x1f8(%rbp), %rdi
callq 0xbd4d0
movl %eax, -0x4ec(%rbp)
jmp 0xffc09
movq -0x308(%rbp), %rax
movl -0x4ec(%rbp), %ecx
movl %ecx, 0x16c(%rax)
addq $0xe0, %rax
movq %rax, -0x4f8(%rbp)
movl -0x238(%rbp), %esi
leaq -0x1f8(%rbp), %rdi
callq 0xbd4d0
movl %eax, -0x4f0(%rbp)
jmp 0xffc43
movq -0x4f8(%rbp), %rdi
movl -0x4f0(%rbp), %eax
movslq %eax, %rsi
callq 0xfff0
movq %rdx, -0x508(%rbp)
movq %rax, -0x500(%rbp)
jmp 0xffc68
movq -0x508(%rbp), %rax
movq -0x500(%rbp), %rcx
movq %rcx, -0x2c0(%rbp)
movq %rax, -0x2b8(%rbp)
leaq -0x2c0(%rbp), %rdi
callq 0x101a0
xorb $-0x1, %al
andb $0x1, %al
movb %al, -0x16(%rbp)
jmp 0xffcb1
jmp 0xffc9b
jmp 0xffc9d
movl -0x238(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x238(%rbp)
jmp 0xff90d
testb $0x1, -0x231(%rbp)
jne 0xffd18
movq -0x300(%rbp), %rdx
movq -0x308(%rbp), %rax
movl 0x188(%rax), %ecx
incl %ecx
movl %ecx, 0x188(%rax)
addq $0x170, %rax            # imm = 0x170
movq %rax, -0x510(%rbp)
leaq -0x2e0(%rbp), %rdi
leaq -0x4c(%rbp), %rsi
callq 0x84e40
jmp 0xffcf5
movq -0x510(%rbp), %rdi
leaq -0x2e0(%rbp), %rsi
callq 0x84e10
jmp 0xffd0a
movq -0x308(%rbp), %rax
movb $0x1, 0x18c(%rax)
leaq -0x1f8(%rbp), %rdi
callq 0x138c0
leaq -0x2(%rbp), %rdi
leaq -0x15(%rbp), %rsi
leaq -0x16(%rbp), %rdx
callq 0x102060
jmp 0xffd37
movl $0x1, -0x164(%rbp)
leaq -0xe8(%rbp), %rdi
callq 0xf200
movw -0x2(%rbp), %ax
addq $0x530, %rsp            # imm = 0x530
popq %rbp
retq
leaq -0xe8(%rbp), %rdi
callq 0xf200
movq -0x138(%rbp), %rdi
callq 0x58f0
nopw %cs:(%rax,%rax)