// File: Luthaf[P]zeopp/networkaccessibility.cc
// Function: AccessibilityClass::isPointInsideAtomAndNotAccessible(Point, double&, int)
pair <bool,bool> AccessibilityClass::isPointInsideAtomAndNotAccessible(Point samplingPoint, double& mindist_domod, 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 - 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 - 0.00000001) 
     overlaps = true;
   };

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

 inside = overlaps;

 mindist_domod = minDist-curAtom.radius; // DO mod distance for probe-occupiable space

 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 < 0.0 );
           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 $0x540, %rsp            # imm = 0x540
leaq 0x10(%rbp), %rax
movq %rax, -0x310(%rbp)
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movl %edx, -0x1c(%rbp)
movq -0x10(%rbp), %rax
movq %rax, -0x318(%rbp)
movb $0x0, -0x1d(%rbp)
movb $0x0, -0x1e(%rbp)
movb $0x0, 0xa3c(%rax)
leaq -0x40(%rbp), %rdi
xorps %xmm2, %xmm2
movaps %xmm2, %xmm0
movaps %xmm2, %xmm1
callq 0xe9c70
movq -0x318(%rbp), %rax
movq -0x310(%rbp), %rdi
movq 0x9f0(%rax), %rax
movq %rax, -0x308(%rbp)
xorl %esi, %esi
callq 0xe9d70
movq -0x310(%rbp), %rdi
movsd (%rax), %xmm0
movsd %xmm0, -0x300(%rbp)
movl $0x1, %esi
callq 0xe9d70
movq -0x310(%rbp), %rdi
movsd (%rax), %xmm0
movsd %xmm0, -0x2f8(%rbp)
movl $0x2, %esi
callq 0xe9d70
movq -0x308(%rbp), %rdi
movsd -0x300(%rbp), %xmm0
movsd -0x2f8(%rbp), %xmm1
movsd (%rax), %xmm2
leaq -0x48(%rbp), %rsi
leaq -0x50(%rbp), %rdx
leaq -0x58(%rbp), %rcx
leaq -0x5c(%rbp), %r8
callq 0x1ed560
andb $0x1, %al
movb %al, -0x5d(%rbp)
testb $0x1, -0x5d(%rbp)
jne 0xfda2f
movq 0x175604(%rip), %rdi    # 0x272ff0
leaq 0xff195(%rip), %rsi     # 0x1fcb88
callq 0x5540
movq %rax, %rdi
leaq 0xfbc23(%rip), %rsi     # 0x1f9625
callq 0x5540
movq %rax, %rdi
leaq 0xfd909(%rip), %rsi     # 0x1fb31a
callq 0x5540
movq %rax, %rdi
leaq 0xfbc05(%rip), %rsi     # 0x1f9625
callq 0x5540
movl $0x1, %edi
callq 0x67c0
movq -0x318(%rbp), %rax
movq -0x310(%rbp), %rcx
movl -0x5c(%rbp), %edx
movl %edx, 0xa18(%rax)
movq (%rcx), %rdx
movq %rdx, 0xa00(%rax)
movq 0x8(%rcx), %rdx
movq %rdx, 0xa08(%rax)
movq 0x10(%rcx), %rcx
movq %rcx, 0xa10(%rax)
cmpl $0x0, -0x1c(%rbp)
jl 0xfdabe
movq -0x318(%rbp), %rax
movb 0x8c0(%rax), %al
andb $0x1, %al
movzbl %al, %eax
cmpl $0x0, %eax
jne 0xfda91
movl -0x5c(%rbp), %eax
cmpl -0x1c(%rbp), %eax
je 0xfda8f
movb $0x1, -0x1e(%rbp)
jmp 0xfdabc
movq -0x318(%rbp), %rdi
addq $0x460, %rdi            # imm = 0x460
addq $0x308, %rdi            # imm = 0x308
movslq -0x5c(%rbp), %rsi
callq 0xed60
movl (%rax), %eax
cmpl -0x1c(%rbp), %eax
je 0xfdaba
movb $0x1, -0x1e(%rbp)
jmp 0xfdabc
jmp 0xfdabe
movq -0x318(%rbp), %rdi
addq $0x750, %rdi            # imm = 0x750
movslq -0x5c(%rbp), %rsi
callq 0xfcc0
movq %rax, %rsi
leaq -0xf8(%rbp), %rdi
callq 0xf0d0
movsd -0xf8(%rbp), %xmm0
movsd -0xf0(%rbp), %xmm1
movsd -0xe8(%rbp), %xmm2
leaq -0x140(%rbp), %rdi
callq 0xe9c70
jmp 0xfdb0a
movsd -0x48(%rbp), %xmm0
movsd -0x50(%rbp), %xmm1
movsd -0x58(%rbp), %xmm2
leaq -0x168(%rbp), %rdi
callq 0xe9c70
jmp 0xfdb27
movq -0x158(%rbp), %rcx
movq %rsp, %rax
movq %rcx, 0x10(%rax)
movups -0x168(%rbp), %xmm0
movups %xmm0, (%rax)
leaq -0x128(%rbp), %rdi
leaq -0x140(%rbp), %rsi
callq 0xe9ef0
jmp 0xfdb54
movq -0x310(%rbp), %rsi
movq -0x118(%rbp), %rcx
movq %rsp, %rax
movq %rcx, 0x10(%rax)
movups -0x128(%rbp), %xmm0
movups %xmm0, (%rax)
leaq -0x110(%rbp), %rdi
callq 0xe9cb0
jmp 0xfdb81
movq -0x100(%rbp), %rax
movq %rax, -0x30(%rbp)
movups -0x110(%rbp), %xmm0
movaps %xmm0, -0x40(%rbp)
leaq -0x40(%rbp), %rdi
xorl %esi, %esi
callq 0xe9d70
movq %rax, -0x320(%rbp)
jmp 0xfdbab
movq -0x320(%rbp), %rax
movsd (%rax), %xmm0
movsd %xmm0, -0x330(%rbp)
leaq -0x40(%rbp), %rdi
movl $0x1, %esi
callq 0xe9d70
movq %rax, -0x328(%rbp)
jmp 0xfdbd5
movq -0x328(%rbp), %rax
movsd (%rax), %xmm0
movsd %xmm0, -0x340(%rbp)
leaq -0x40(%rbp), %rdi
movl $0x2, %esi
callq 0xe9d70
movq %rax, -0x338(%rbp)
jmp 0xfdbff
movsd -0x340(%rbp), %xmm1
movsd -0x330(%rbp), %xmm0
movq -0x338(%rbp), %rax
movsd (%rax), %xmm2
movsd -0xf8(%rbp), %xmm3
movsd -0xf0(%rbp), %xmm4
movsd -0xe8(%rbp), %xmm5
callq 0xebaf0
movsd %xmm0, -0x348(%rbp)
jmp 0xfdc41
movsd -0x348(%rbp), %xmm0
movsd %xmm0, -0x170(%rbp)
movsd -0x170(%rbp), %xmm1
movsd -0xc8(%rbp), %xmm0
movsd 0xf89a7(%rip), %xmm2    # 0x1f6610
subsd %xmm2, %xmm0
ucomisd %xmm1, %xmm0
jbe 0xfdc90
movb $0x1, -0x1e(%rbp)
jmp 0xfdc90
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x148(%rbp)
movl %eax, -0x14c(%rbp)
jmp 0xfe7b1
movq -0x318(%rbp), %rax
testb $0x1, 0x8c0(%rax)
je 0xfddd1
movq -0x318(%rbp), %rdi
movq %rdi, %rax
addq $0x2f0, %rax            # imm = 0x2F0
movq %rax, -0x350(%rbp)
addq $0x768, %rdi            # imm = 0x768
movslq -0x5c(%rbp), %rsi
callq 0xed60
movq -0x350(%rbp), %rdi
movslq (%rax), %rsi
callq 0xfcc0
movq %rax, %rsi
leaq -0xf8(%rbp), %rdi
callq 0x595e0
jmp 0xfdceb
movq -0x318(%rbp), %rax
movq %rax, -0x360(%rbp)
leaq -0x40(%rbp), %rdi
xorl %esi, %esi
callq 0xe9d70
movq %rax, -0x358(%rbp)
jmp 0xfdd0d
movq -0x358(%rbp), %rax
movsd (%rax), %xmm0
movsd %xmm0, -0x370(%rbp)
leaq -0x40(%rbp), %rdi
movl $0x1, %esi
callq 0xe9d70
movq %rax, -0x368(%rbp)
jmp 0xfdd37
movq -0x368(%rbp), %rax
movsd (%rax), %xmm0
movsd %xmm0, -0x380(%rbp)
leaq -0x40(%rbp), %rdi
movl $0x2, %esi
callq 0xe9d70
movq %rax, -0x378(%rbp)
jmp 0xfdd61
movsd -0x380(%rbp), %xmm1
movsd -0x370(%rbp), %xmm0
movq -0x360(%rbp), %rdi
movq -0x378(%rbp), %rax
movsd (%rax), %xmm2
leaq -0xf8(%rbp), %rsi
callq 0x97950
movsd %xmm0, -0x388(%rbp)
jmp 0xfdd99
movsd -0x388(%rbp), %xmm0
movsd %xmm0, -0x170(%rbp)
movsd -0x170(%rbp), %xmm1
movsd -0xc8(%rbp), %xmm0
movsd 0xf884f(%rip), %xmm2    # 0x1f6610
subsd %xmm2, %xmm0
ucomisd %xmm1, %xmm0
jbe 0xfddcf
movb $0x1, -0x1e(%rbp)
jmp 0xfddd1
movq -0x318(%rbp), %rax
movsd -0x170(%rbp), %xmm0
movsd %xmm0, 0x9f8(%rax)
movb -0x1e(%rbp), %al
andb $0x1, %al
movb %al, -0x1d(%rbp)
movsd -0x170(%rbp), %xmm0
subsd -0xc8(%rbp), %xmm0
movq -0x18(%rbp), %rax
movsd %xmm0, (%rax)
movb -0x1d(%rbp), %al
andb $0x1, %al
movzbl %al, %eax
cmpl $0x1, %eax
jne 0xfde37
leaq -0x2(%rbp), %rdi
leaq -0x1d(%rbp), %rsi
leaq -0x1e(%rbp), %rdx
callq 0x102060
jmp 0xfde28
movl $0x1, -0x174(%rbp)
jmp 0xfe798
movq -0x318(%rbp), %rdi
addq $0x750, %rdi            # imm = 0x750
movslq -0x5c(%rbp), %rsi
callq 0xfcc0
movq %rax, %rsi
leaq -0xf8(%rbp), %rdi
callq 0x595e0
jmp 0xfde5f
movsd -0xf8(%rbp), %xmm0
movsd -0xf0(%rbp), %xmm1
movsd -0xe8(%rbp), %xmm2
leaq -0x1c0(%rbp), %rdi
callq 0xe9c70
jmp 0xfde85
movsd -0x48(%rbp), %xmm0
movsd -0x50(%rbp), %xmm1
movsd -0x58(%rbp), %xmm2
leaq -0x1d8(%rbp), %rdi
callq 0xe9c70
jmp 0xfdea2
movq -0x1c8(%rbp), %rcx
movq %rsp, %rax
movq %rcx, 0x10(%rax)
movups -0x1d8(%rbp), %xmm0
movups %xmm0, (%rax)
leaq -0x1a8(%rbp), %rdi
leaq -0x1c0(%rbp), %rsi
callq 0xe9ef0
jmp 0xfdecf
movq -0x310(%rbp), %rsi
movq -0x198(%rbp), %rcx
movq %rsp, %rax
movq %rcx, 0x10(%rax)
movups -0x1a8(%rbp), %xmm0
movups %xmm0, (%rax)
leaq -0x190(%rbp), %rdi
callq 0xe9cb0
jmp 0xfdefc
movq -0x310(%rbp), %rdi
movq -0x180(%rbp), %rax
movq %rax, 0x10(%rdi)
movups -0x190(%rbp), %xmm0
movups %xmm0, (%rdi)
xorl %esi, %esi
callq 0xe9d70
movq %rax, -0x390(%rbp)
jmp 0xfdf28
movq -0x310(%rbp), %rdi
movq -0x390(%rbp), %rax
movsd (%rax), %xmm0
movsd %xmm0, -0x3a0(%rbp)
movl $0x1, %esi
callq 0xe9d70
movq %rax, -0x398(%rbp)
jmp 0xfdf55
movq -0x310(%rbp), %rdi
movq -0x398(%rbp), %rax
movsd (%rax), %xmm0
movsd %xmm0, -0x3b0(%rbp)
movl $0x2, %esi
callq 0xe9d70
movq %rax, -0x3a8(%rbp)
jmp 0xfdf82
movsd -0x3b0(%rbp), %xmm1
movsd -0x3a0(%rbp), %xmm0
movq -0x3a8(%rbp), %rax
movsd (%rax), %xmm2
movsd -0xf8(%rbp), %xmm3
movsd -0xf0(%rbp), %xmm4
movsd -0xe8(%rbp), %xmm5
callq 0xebaf0
movsd %xmm0, -0x3b8(%rbp)
jmp 0xfdfc4
movsd -0x3b8(%rbp), %xmm0
movsd %xmm0, -0x170(%rbp)
testb $0x1, -0x1e(%rbp)
jne 0xfe77b
movq -0x318(%rbp), %rdi
addq $0x940, %rdi            # imm = 0x940
movslq -0x5c(%rbp), %rsi
callq 0x162f0
movq %rax, %rsi
leaq -0x208(%rbp), %rdi
callq 0x17040
jmp 0xfe006
movsd -0xf8(%rbp), %xmm0
movsd -0xf0(%rbp), %xmm1
movsd -0xe8(%rbp), %xmm2
leaq -0x220(%rbp), %rdi
callq 0xe9c70
jmp 0xfe02c
movq -0x310(%rbp), %rdi
movsd -0x170(%rbp), %xmm0
movsd %xmm0, -0x228(%rbp)
xorl %esi, %esi
callq 0xe9d70
movq %rax, -0x3c0(%rbp)
jmp 0xfe053
movq -0x310(%rbp), %rdi
movq -0x3c0(%rbp), %rax
movsd (%rax), %xmm0
movsd -0xf8(%rbp), %xmm1
subsd %xmm1, %xmm0
movsd %xmm0, -0x3d0(%rbp)
movl $0x1, %esi
callq 0xe9d70
movq %rax, -0x3c8(%rbp)
jmp 0xfe08c
movq -0x310(%rbp), %rdi
movq -0x3c8(%rbp), %rax
movsd (%rax), %xmm0
movsd -0xf0(%rbp), %xmm1
subsd %xmm1, %xmm0
movsd %xmm0, -0x3e0(%rbp)
movl $0x2, %esi
callq 0xe9d70
movq %rax, -0x3d8(%rbp)
jmp 0xfe0c5
movsd -0x3e0(%rbp), %xmm1
movsd -0x3d0(%rbp), %xmm0
movq -0x3d8(%rbp), %rax
movsd (%rax), %xmm2
movsd -0xe8(%rbp), %xmm3
subsd %xmm3, %xmm2
leaq -0x240(%rbp), %rdi
callq 0xe9c70
jmp 0xfe0fa
movq -0x318(%rbp), %rax
movb $0x0, -0x241(%rbp)
movb $0x0, 0xa3c(%rax)
leaq -0x208(%rbp), %rdi
callq 0xbd460
movl %eax, -0x3e4(%rbp)
jmp 0xfe123
movl -0x3e4(%rbp), %eax
cmpl $0x0, %eax
jne 0xfe36b
movq 0x174eb7(%rip), %rdi    # 0x272ff0
leaq 0xf89da(%rip), %rsi     # 0x1f6b1a
callq 0x5540
movq %rax, -0x3f0(%rbp)
jmp 0xfe14e
movq -0x3f0(%rbp), %rdi
leaq 0xfb4c9(%rip), %rsi     # 0x1f9625
callq 0x5540
movq %rax, -0x3f8(%rbp)
jmp 0xfe16a
movq -0x3f8(%rbp), %rdi
leaq 0xf89df(%rip), %rsi     # 0x1f6b57
callq 0x5540
movq %rax, -0x400(%rbp)
jmp 0xfe186
movq -0x310(%rbp), %rdi
xorl %esi, %esi
callq 0xe9d70
movq %rax, -0x408(%rbp)
jmp 0xfe19d
movq -0x400(%rbp), %rdi
movq -0x408(%rbp), %rax
movsd (%rax), %xmm0
callq 0x5980
movq %rax, -0x410(%rbp)
jmp 0xfe1bd
movq -0x410(%rbp), %rdi
leaq 0xfe0e3(%rip), %rsi     # 0x1fc2ae
callq 0x5540
movq %rax, -0x418(%rbp)
jmp 0xfe1d9
movq -0x310(%rbp), %rdi
movl $0x1, %esi
callq 0xe9d70
movq %rax, -0x420(%rbp)
jmp 0xfe1f3
movq -0x418(%rbp), %rdi
movq -0x420(%rbp), %rax
movsd (%rax), %xmm0
callq 0x5980
movq %rax, -0x428(%rbp)
jmp 0xfe213
movq -0x428(%rbp), %rdi
leaq 0xfe08d(%rip), %rsi     # 0x1fc2ae
callq 0x5540
movq %rax, -0x430(%rbp)
jmp 0xfe22f
movq -0x310(%rbp), %rdi
movl $0x2, %esi
callq 0xe9d70
movq %rax, -0x438(%rbp)
jmp 0xfe249
movq -0x430(%rbp), %rdi
movq -0x438(%rbp), %rax
movsd (%rax), %xmm0
callq 0x5980
movq %rax, -0x440(%rbp)
jmp 0xfe269
movq -0x440(%rbp), %rdi
leaq 0xfb3ae(%rip), %rsi     # 0x1f9625
callq 0x5540
movq %rax, -0x448(%rbp)
jmp 0xfe285
movq -0x448(%rbp), %rdi
leaq 0xf88cc(%rip), %rsi     # 0x1f6b5f
callq 0x5540
movq %rax, -0x450(%rbp)
jmp 0xfe2a1
movq -0x450(%rbp), %rdi
movl -0x5c(%rbp), %esi
callq 0x58d0
movq %rax, -0x458(%rbp)
jmp 0xfe2b9
movq -0x458(%rbp), %rdi
leaq 0xfb35e(%rip), %rsi     # 0x1f9625
callq 0x5540
movq %rax, -0x460(%rbp)
jmp 0xfe2d5
movq -0x460(%rbp), %rdi
leaq 0xf889d(%rip), %rsi     # 0x1f6b80
callq 0x5540
movq %rax, -0x468(%rbp)
jmp 0xfe2f1
movq -0x468(%rbp), %rdi
leaq 0xfb326(%rip), %rsi     # 0x1f9625
callq 0x5540
movq %rax, -0x470(%rbp)
jmp 0xfe30d
movq -0x470(%rbp), %rdi
leaq 0xfcfff(%rip), %rsi     # 0x1fb31a
callq 0x5540
movq %rax, -0x478(%rbp)
jmp 0xfe329
movq -0x478(%rbp), %rdi
leaq 0xfb2ee(%rip), %rsi     # 0x1f9625
callq 0x5540
jmp 0xfe33e
movl $0x1, %edi
callq 0x67c0
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x148(%rbp)
movl %eax, -0x14c(%rbp)
leaq -0x208(%rbp), %rdi
callq 0x138c0
jmp 0xfe7b1
movl $0x0, -0x248(%rbp)
movl -0x248(%rbp), %eax
movl %eax, -0x480(%rbp)
leaq -0x208(%rbp), %rdi
callq 0xbd460
movl %eax, -0x47c(%rbp)
jmp 0xfe395
movl -0x480(%rbp), %eax
movl -0x47c(%rbp), %ecx
cmpl %ecx, %eax
jge 0xfe708
movl -0x248(%rbp), %edx
leaq -0x260(%rbp), %rdi
leaq -0x208(%rbp), %rsi
callq 0xbd480
jmp 0xfe3c4
leaq -0x260(%rbp), %rdi
xorl %esi, %esi
callq 0xe9d70
movq %rax, -0x488(%rbp)
jmp 0xfe3db
movq -0x488(%rbp), %rax
movsd (%rax), %xmm0
movsd %xmm0, -0x498(%rbp)
leaq -0x260(%rbp), %rdi
movl $0x1, %esi
callq 0xe9d70
movq %rax, -0x490(%rbp)
jmp 0xfe408
movq -0x490(%rbp), %rax
movsd (%rax), %xmm0
movsd %xmm0, -0x4a8(%rbp)
leaq -0x260(%rbp), %rdi
movl $0x2, %esi
callq 0xe9d70
movq %rax, -0x4a0(%rbp)
jmp 0xfe435
movq -0x4a0(%rbp), %rax
movsd (%rax), %xmm0
movsd %xmm0, -0x4b8(%rbp)
leaq -0x220(%rbp), %rdi
xorl %esi, %esi
callq 0xe9d70
movq %rax, -0x4b0(%rbp)
jmp 0xfe45f
movq -0x4b0(%rbp), %rax
movsd (%rax), %xmm0
movsd %xmm0, -0x4c8(%rbp)
leaq -0x220(%rbp), %rdi
movl $0x1, %esi
callq 0xe9d70
movq %rax, -0x4c0(%rbp)
jmp 0xfe48c
movq -0x4c0(%rbp), %rax
movsd (%rax), %xmm0
movsd %xmm0, -0x4d8(%rbp)
leaq -0x220(%rbp), %rdi
movl $0x2, %esi
callq 0xe9d70
movq %rax, -0x4d0(%rbp)
jmp 0xfe4b9
movsd -0x4d8(%rbp), %xmm4
movsd -0x4c8(%rbp), %xmm3
movsd -0x4b8(%rbp), %xmm2
movsd -0x4a8(%rbp), %xmm1
movsd -0x498(%rbp), %xmm0
movq -0x4d0(%rbp), %rax
movsd (%rax), %xmm5
callq 0xebaf0
movsd %xmm0, -0x4e0(%rbp)
jmp 0xfe4fb
movq -0x318(%rbp), %rax
movsd -0x4e0(%rbp), %xmm1
movsd -0x228(%rbp), %xmm0
ucomisd %xmm1, %xmm0
seta -0x261(%rbp)
addq $0x910, %rax            # imm = 0x910
movq %rax, -0x4f0(%rbp)
movl -0x248(%rbp), %esi
leaq -0x208(%rbp), %rdi
callq 0xbd4d0
movl %eax, -0x4e4(%rbp)
jmp 0xfe544
movq -0x4f0(%rbp), %rdi
movl -0x4e4(%rbp), %eax
movslq %eax, %rsi
callq 0x24e20
xorps %xmm0, %xmm0
ucomisd 0x18(%rax), %xmm0
seta %al
andb $0x1, %al
movb %al, -0x262(%rbp)
testb $0x1, -0x261(%rbp)
jne 0xfe6f2
testb $0x1, -0x262(%rbp)
jne 0xfe6f2
movq -0x310(%rbp), %rsi
movq -0x250(%rbp), %rax
movq %rax, -0x290(%rbp)
movups -0x260(%rbp), %xmm0
movaps %xmm0, -0x2a0(%rbp)
movq -0x290(%rbp), %rcx
movq %rsp, %rax
movq %rcx, 0x10(%rax)
movaps -0x2a0(%rbp), %xmm0
movups %xmm0, (%rax)
leaq -0x280(%rbp), %rdi
callq 0xe9ef0
jmp 0xfe5cf
movq -0x270(%rbp), %rax
movq %rax, -0x2b0(%rbp)
movups -0x280(%rbp), %xmm0
movaps %xmm0, -0x2c0(%rbp)
movq -0x2b0(%rbp), %rcx
movq %rsp, %rax
movq %rcx, 0x10(%rax)
movaps -0x2c0(%rbp), %xmm0
movups %xmm0, (%rax)
leaq -0x240(%rbp), %rdi
callq 0xea050
movsd %xmm0, -0x4f8(%rbp)
jmp 0xfe619
movsd -0x4f8(%rbp), %xmm0
movsd %xmm0, -0x2a8(%rbp)
movsd -0x2a8(%rbp), %xmm0
xorps %xmm1, %xmm1
ucomisd %xmm1, %xmm0
jbe 0xfe63f
jmp 0xfe6f0
movb $0x1, -0x241(%rbp)
movl -0x248(%rbp), %esi
leaq -0x208(%rbp), %rdi
callq 0xbd4d0
movl %eax, -0x4fc(%rbp)
jmp 0xfe660
movq -0x318(%rbp), %rax
movl -0x4fc(%rbp), %ecx
movl %ecx, 0xa1c(%rax)
addq $0x990, %rax            # imm = 0x990
movq %rax, -0x508(%rbp)
movl -0x248(%rbp), %esi
leaq -0x208(%rbp), %rdi
callq 0xbd4d0
movl %eax, -0x500(%rbp)
jmp 0xfe69a
movq -0x508(%rbp), %rdi
movl -0x500(%rbp), %eax
movslq %eax, %rsi
callq 0xfff0
movq %rdx, -0x518(%rbp)
movq %rax, -0x510(%rbp)
jmp 0xfe6bf
movq -0x518(%rbp), %rax
movq -0x510(%rbp), %rcx
movq %rcx, -0x2d0(%rbp)
movq %rax, -0x2c8(%rbp)
leaq -0x2d0(%rbp), %rdi
callq 0x101a0
xorb $-0x1, %al
andb $0x1, %al
movb %al, -0x1e(%rbp)
jmp 0xfe708
jmp 0xfe6f2
jmp 0xfe6f4
movl -0x248(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x248(%rbp)
jmp 0xfe375
testb $0x1, -0x241(%rbp)
jne 0xfe76f
movq -0x310(%rbp), %rdx
movq -0x318(%rbp), %rax
movl 0xa38(%rax), %ecx
incl %ecx
movl %ecx, 0xa38(%rax)
addq $0xa20, %rax            # imm = 0xA20
movq %rax, -0x520(%rbp)
leaq -0x2f0(%rbp), %rdi
leaq -0x5c(%rbp), %rsi
callq 0x84e40
jmp 0xfe74c
movq -0x520(%rbp), %rdi
leaq -0x2f0(%rbp), %rsi
callq 0x84e10
jmp 0xfe761
movq -0x318(%rbp), %rax
movb $0x1, 0xa3c(%rax)
leaq -0x208(%rbp), %rdi
callq 0x138c0
leaq -0x2(%rbp), %rdi
leaq -0x1d(%rbp), %rsi
leaq -0x1e(%rbp), %rdx
callq 0x102060
jmp 0xfe78e
movl $0x1, -0x174(%rbp)
leaq -0xf8(%rbp), %rdi
callq 0xf200
movw -0x2(%rbp), %ax
addq $0x540, %rsp            # imm = 0x540
popq %rbp
retq
leaq -0xf8(%rbp), %rdi
callq 0xf200
movq -0x148(%rbp), %rdi
callq 0x58f0
nopl (%rax)