// File: /workspace/github_cpp_makefile_star2_O3/Luthaf[P]zeopp/channel.cc
// Function: PORE::getRestrictingDiameters(int, std::vector<int, std::allocator<int>>, std::vector<std::vector<double, std::allocator<double>>, std::allocator<std::vector<double, std::allocator<double>>>>*, std::vector<std::vector<std::pair<int, int>, std::allocator<std::pair<int, int>>>, std::allocator<std::vector<std::pair<int, int>, std::allocator<std::pair<int, int>>>>>*, std::vector<double, std::allocator<double>>*, std::vector<int, std::allocator<int>>*, std::vector<double, std::allocator<double>>*, std::vector<int, std::allocator<int>>*)
void PORE::getRestrictingDiameters(int nSegments, vector<int> vorNetID, vector< vector<double> > *PLDtable, vector< vector< pair<int,int> > > *PLDEdgeTable, 
                                  vector<double> *segmentDi, vector<int> *segmentDiNodeID, vector <double> *segmentDiFinal, vector<int> *segmentDiFinalNodeID){
    //Define three access types
    const int ACCESSED   =  1;
    const int UNKNOWN      = -1;

    // flag that is used to terminate the search
    
    bool node2FoundFlag = false;

    // Make a local copy of nodes vector as it will be modified
    vector<DIJKSTRA_NODE> lnodes = nodes;
    
    // Initialize the unit cell position of each node
    vector<DELTA_POS> directions = vector<DELTA_POS> (lnodes.size(), DELTA_POS(0,0,0));
    
    // Initialize the status of each node as UNKNOWN
    vector<int> accessStatuses = vector<int> (lnodes.size(), UNKNOWN);
    unsigned int nodeIndex = 0;
    
    double di,df;

    if(nSegments < 1){
      cerr << "Number of semgents lower than 1. This function should not be called.\n" << "\n";
      abort();
      };

//debug
//for(unsigned int i=0; i<vorNetID.size();i++) cout << vorNetID[i] << "  ";


    // Need to translate IDs from the original Voronoi network to PORE ids 

    vector <int> PoreNodesSegmentIDs; // will store segment ID for each node in the current PORE

    PoreNodesSegmentIDs.resize(nodes.size(), -1);

    int nSegPresent = 0;
    for(unsigned int i=0; i<nodes.size(); i++)
       {
       int VnodeID = reverseIDMappings.find(i)->second;
       if(vorNetID[VnodeID] >= 0)
         {
         PoreNodesSegmentIDs[i] = vorNetID[VnodeID]; 
         nSegPresent++;
         };

       };

    cout << "Current PORE contains " << nSegPresent << " nodes in predefined segments. Proceeding with Restricting Diameter Calcs\n";

    // Start analysis by accepting all nodes already assigned to segments (segment seed nodes)
    // Store information about largest node pre-assigned to each segment

    for(unsigned int i=0; i<nodes.size(); i++)
       {
       if(PoreNodesSegmentIDs[i] > -1) 
          {
          accessStatuses[i] = ACCESSED;   
          directions[i] = DELTA_POS(0,0,0); // not sure about this line
          
          if(segmentDi->at(PoreNodesSegmentIDs[i]) < nodes.at(i).max_radius*2) 
             {
             segmentDi->at(PoreNodesSegmentIDs[i]) = nodes.at(i).max_radius*2;
             segmentDiNodeID->at(PoreNodesSegmentIDs[i]) = reverseIDMappings.find(i)->second;
             segmentDiFinal->at(PoreNodesSegmentIDs[i]) = segmentDi->at(PoreNodesSegmentIDs[i]);
             };
          };
       };


/* BUG BUG line (1ln) below, it probably clears segmentDiFinal too many times, moving to the above loop */
//    for(int i=0; i<nSegments; i++) segmentDiFinal->at(i) = segmentDi->at(i); // copying current segments into Final
    
/* old stuff to be removed
    // Start analysis for node of id = nodeid
    
    nodeIndex = node1; // node1 is w.r.t pore node index (use PORE reverseMapping to retrieve original node
    
    // accept the initial node
    di=lnodes.at(nodeIndex).max_radius;
    df=lnodes.at(nodeIndex).max_radius;
    
    accessStatuses[nodeIndex] = ACCESSED;
    
    directions[nodeIndex] = DELTA_POS(0,0,0);

 ends old stuff */
    
    compareConnections_ptr = &lnodes;
    HEAP< pair<int,int> > stack(compareConnections);
    
    // loop over all connections and add them to stack
    for(unsigned int n=0;  n<nodes.size(); n++)
      {
      if(accessStatuses[n] == ACCESSED)
        {
        for(unsigned int i=0; i<lnodes[n].connections.size(); i++)
          {
          if(lnodes[n].connections.at(i).max_radius > lnodes.at(lnodes[n].connections.at(i).to).max_radius)
              lnodes[n].connections.at(i).max_radius = lnodes.at(lnodes[n].connections.at(i).to).max_radius;
        
          stack.insert(pair<int,int>(n,i));
          };
        };
      };
    
    stack.reHeapify();

//
// Note: in the following blocks, we probably dont need directions[]
// to be cleaned in the future

    
    while(stack.size() != 0){
        //loop with Dijkstra-like propagation
        
        // select the path with largest opening
        pair<int,int> best = stack.pop();
        
        int best_node = lnodes[best.first].connections[best.second].to;
        
        if(accessStatuses[best_node]==UNKNOWN)
        {
            // if the node (best_node) is not assigned to segment, assign it to the current segment (determined by node best.first)
            // check new connections, add to heap or terminane
            
            accessStatuses[best_node] = ACCESSED; 
            directions[best_node] = directions[best.first];
            directions[best_node] = directions[best_node] + (lnodes[best.first].connections.at(best.second).deltaPos);
            PoreNodesSegmentIDs[best_node] = PoreNodesSegmentIDs[best.first];
           
            if(nodes.at(best_node).max_radius * 2 > segmentDiFinal->at(PoreNodesSegmentIDs[best.first])) 
               {   
               segmentDiFinal->at(PoreNodesSegmentIDs[best.first]) = nodes.at(best_node).max_radius * 2; 
               segmentDiFinalNodeID->at(PoreNodesSegmentIDs[best.first]) = reverseIDMappings.find(best_node)->second;
               };

            // going to add new connections to the heap
            for(unsigned int i=0; i<lnodes[best_node].connections.size(); i++)
            {
                if(lnodes[best_node].connections.at(i).max_radius > lnodes.at(lnodes[best_node].connections.at(i).to).max_radius)
                    lnodes[best_node].connections.at(i).max_radius = lnodes.at(lnodes[best_node].connections.at(i).to).max_radius;
                
                if(lnodes[best_node].connections[i].to!=best.first)
                    stack.insert(pair<int,int>(best_node,i));
            };	
//            stack.reHeapify(); 
//            I think reHeapify is not needed as heap.insert ensures proper sorting
        }
        
        else if(accessStatuses[best_node]==ACCESSED){
            //selected connection leads to a node that is already assigned to a segment

            // if it is of different segment, note the destricting diameter
            if(PoreNodesSegmentIDs[best_node] != PoreNodesSegmentIDs[best.first])
              {
              // record the largest resticting diameter between two segments of the same PORE
              double r = lnodes[best.first].connections.at(best.second).max_radius;

//begin debug
//cout << "PLD table size: " << PLDtable->size() << "   " << PLDtable->at(PoreNodesSegmentIDs[best_node]).size() << "\n";
//cout << "PoreNodesSegmentIDs[best_node]= " << PoreNodesSegmentIDs[best_node] << "   PoreNodesSegmentIDs[best.first]= " << PoreNodesSegmentIDs[best.first] << "\n"; 
//              if(PLDtable->size() > PoreNodesSegmentIDs[best_node] + 1 || PLDtable->at(PoreNodesSegmentIDs[best_node]).size() > PoreNodesSegmentIDs[best.first] + 1)
//    {cout << "alarm...\n";
//};
//end debug
              double stored_d = PLDtable->at(PoreNodesSegmentIDs[best_node]).at(PoreNodesSegmentIDs[best.first]);
              if(2*r> stored_d)
                {
                PLDtable->at(PoreNodesSegmentIDs[best_node]).at(PoreNodesSegmentIDs[best.first]) = 2*r;
                PLDtable->at(PoreNodesSegmentIDs[best.first]).at(PoreNodesSegmentIDs[best_node]) = 2*r;
                pair<int,int> p(reverseIDMappings.find(best_node)->second, reverseIDMappings.find(best.first)->second); 
                PLDEdgeTable->at(PoreNodesSegmentIDs[best_node]).at(PoreNodesSegmentIDs[best.first]) = p;
                PLDEdgeTable->at(PoreNodesSegmentIDs[best.first]).at(PoreNodesSegmentIDs[best_node]) = p;
                }else{
                //cerr << "Trying to store smaller diameter than already stored. This shouldnt happen. Check the code\n";
                };              
              } else
              {
              // both nodes are of the same segment, do nothing

              };
            
           /* old stuff, probably to be removed  
            if(!(directions[best_node]).equals(directions[best.first] + lnodes[best.first].connections.at(best.second).deltaPos))
            {
                // if nodes are in different unit cells (a loop is found); just update df and continue 
                if(df>nodes[best.first].connections.at(best.second).max_radius) df=nodes[best.first].connections.at(best.second).max_radius;
            };
           */
        }
        
        else{
            //
            // need this section ?
            //
        };
        
    };
   
   for(int i=0; i<nSegments; i++)
     {
     if(segmentDi->at(i)!=segmentDiFinal->at(i)) cerr << "Segment Di(" << segmentDi->at(i) << ") is different than Segment Di Final (" << segmentDiFinal->at(i) << ") for segment " << i << ".\n";
     };  

}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0xd8, %rsp
movq %r9, 0x38(%rsp)
movq %r8, 0xc0(%rsp)
movq %rcx, 0xc8(%rsp)
movq %rdx, %rbp
movl %esi, %r12d
movq %rdi, %r13
movl $0xffffffff, 0x5c(%rsp) # imm = 0xFFFFFFFF
leaq 0x60(%rdi), %rsi
leaq 0x40(%rsp), %r14
movq %r14, %rdi
callq 0x38b26
movq (%r14), %rbx
movq 0x8(%r14), %r14
leaq 0x10(%rsp), %rdi
xorl %esi, %esi
xorl %edx, %edx
xorl %ecx, %ecx
callq 0x506b0
subq %rbx, %r14
sarq $0x3, %r14
movabsq $-0x71c71c71c71c71c7, %r15 # imm = 0x8E38E38E38E38E39
imulq %r15, %r14
leaq 0xa0(%rsp), %rdi
leaq 0x10(%rsp), %rdx
leaq 0x88(%rsp), %rcx
movq %r14, %rsi
callq 0x7608a
movq 0x48(%rsp), %rsi
subq 0x40(%rsp), %rsi
sarq $0x3, %rsi
imulq %r15, %rsi
leaq 0x88(%rsp), %rdi
leaq 0x5c(%rsp), %rdx
leaq 0x10(%rsp), %rcx
callq 0x3864a
movq 0x38(%rsp), %rbx
testl %r12d, %r12d
jle 0x75b01
xorpd %xmm0, %xmm0
leaq 0x60(%rsp), %rdi
movapd %xmm0, (%rdi)
movq $0x0, 0x10(%rdi)
movq 0x68(%r13), %rsi
subq 0x60(%r13), %rsi
sarq $0x3, %rsi
imulq %r15, %rsi
leaq 0x10(%rsp), %rdx
movl $0xffffffff, (%rdx)     # imm = 0xFFFFFFFF
callq 0x48a3e
movq 0x68(%r13), %rax
movq 0x60(%r13), %rcx
subq %rcx, %rax
je 0x750cd
sarq $0x3, %rax
imulq %r15, %rax
movq 0x40(%r13), %rcx
leaq 0x38(%r13), %rdx
movq (%rbp), %rsi
xorl %edi, %edi
movq 0x60(%rsp), %r8
xorl %ebp, %ebp
movq %rdx, %r10
testq %rcx, %rcx
je 0x750b1
movq %rcx, %r10
movq %rdx, %r9
xorl %r11d, %r11d
cmpl %edi, 0x20(%r10)
setl %r11b
cmovgeq %r10, %r9
movq 0x10(%r10,%r11,8), %r10
testq %r10, %r10
jne 0x75085
movq %rdx, %r10
cmpq %rdx, %r9
je 0x750b1
cmpl 0x20(%r9), %edi
cmovlq %rdx, %r9
movq %r9, %r10
movslq 0x24(%r10), %r9
movl (%rsi,%r9,4), %r9d
testl %r9d, %r9d
js 0x750c4
movl %r9d, (%r8,%rdi,4)
incl %ebp
incl %edi
cmpq %rdi, %rax
ja 0x75077
jmp 0x750cf
xorl %ebp, %ebp
movq 0x11feea(%rip), %rdi    # 0x194fc0
leaq 0xdfad0(%rip), %rsi     # 0x154bad
movl $0x16, %edx
callq 0x44e0
movq 0x11fed2(%rip), %rdi    # 0x194fc0
movl %ebp, %esi
callq 0x4750
leaq 0xdfac8(%rip), %rsi     # 0x154bc4
movl $0x4a, %edx
movq %rax, %rdi
callq 0x44e0
movl %r12d, 0x58(%rsp)
movq 0x60(%r13), %rcx
movq 0x68(%r13), %rdi
movabsq $-0x3333333333333333, %r14 # imm = 0xCCCCCCCCCCCCCCCD
cmpq %rcx, %rdi
movq %r13, 0x8(%rsp)
je 0x753dc
leaq 0x38(%r13), %r12
xorl %r13d, %r13d
leaq 0x10(%rsp), %rbp
movq 0x60(%rsp), %rax
cmpl $0x0, (%rax,%r13,4)
js 0x75299
movq 0x88(%rsp), %rax
movl $0x1, (%rax,%r13,4)
movq %rbp, %rdi
xorl %esi, %esi
xorl %edx, %edx
xorl %ecx, %ecx
callq 0x506b0
movq 0xa0(%rsp), %rax
leaq (,%r13,2), %rcx
addq %r13, %rcx
movl 0x18(%rsp), %edx
movl %edx, 0x8(%rax,%rcx,4)
movq 0x10(%rsp), %rdx
movq %rdx, (%rax,%rcx,4)
movq 0x60(%rsp), %r10
movslq (%r10,%r13,4), %rsi
movq (%rbx), %r9
movq 0x8(%rbx), %rdx
subq %r9, %rdx
sarq $0x3, %rdx
cmpq %rsi, %rdx
jbe 0x75a6e
movq 0x8(%rsp), %rax
movq 0x60(%rax), %rcx
movq 0x68(%rax), %rdi
movq %rdi, %r8
subq %rcx, %r8
sarq $0x3, %r8
imulq %r15, %r8
cmpq %r13, %r8
jbe 0x75a68
leaq (,%r13,8), %rax
addq %r13, %rax
movsd 0x38(%rcx,%rax,8), %xmm0
addsd %xmm0, %xmm0
ucomisd (%r9,%rsi,8), %xmm0
jbe 0x752a7
movsd %xmm0, (%r9,%rsi,8)
movq 0x8(%rsp), %rax
movq 0x40(%rax), %r11
movq %r12, %rbx
testq %r11, %r11
je 0x75235
movq %r12, %rax
xorl %ebx, %ebx
cmpl %r13d, 0x20(%r11)
setl %bl
cmovgeq %r11, %rax
movq 0x10(%r11,%rbx,8), %r11
testq %r11, %r11
jne 0x7520b
movq %r12, %rbx
cmpq %r12, %rax
je 0x75235
cmpl 0x20(%rax), %r13d
cmovlq %r12, %rax
movq %rax, %rbx
movq 0x110(%rsp), %rax
movq (%rax), %r11
movq 0x8(%rax), %rax
subq %r11, %rax
sarq $0x2, %rax
cmpq %rsi, %rax
jbe 0x75aa1
movl 0x24(%rbx), %eax
movl %eax, (%r11,%rsi,4)
movslq (%r10,%r13,4), %rsi
cmpq %rsi, %rdx
jbe 0x75a6e
movq 0x118(%rsp), %rdx
movq (%rdx), %rax
movq 0x8(%rdx), %rdx
subq %rax, %rdx
sarq $0x3, %rdx
cmpq %rsi, %rdx
movq 0x38(%rsp), %rbx
jbe 0x75a6e
movsd (%r9,%rsi,8), %xmm0
movsd %xmm0, (%rax,%rsi,8)
jmp 0x752a7
movq %rdi, %r8
subq %rcx, %r8
sarq $0x3, %r8
imulq %r15, %r8
incl %r13d
cmpq %r13, %r8
ja 0x7513a
leaq 0x40(%rsp), %rax
movq %rax, 0x1204a9(%rip)    # 0x195768
leaq -0xc05(%rip), %rax      # 0x746c1
movq %rax, 0x28(%rsp)
xorpd %xmm0, %xmm0
movapd %xmm0, 0x10(%rsp)
movq $0x0, 0x20(%rsp)
xorl %r13d, %r13d
cmpq %rcx, %rdi
je 0x7540a
leaq 0x10(%rsp), %rbp
movq 0x88(%rsp), %rax
cmpl $0x1, (%rax,%r13,4)
jne 0x753ac
movq 0x40(%rsp), %r8
leaq (,%r13,8), %rbx
addq %r13, %rbx
movq 0x20(%r8,%rbx,8), %r9
cmpq %r9, 0x28(%r8,%rbx,8)
je 0x753ac
movl $0x1, %r12d
xorl %esi, %esi
leaq (%rsi,%rsi,4), %rcx
movslq 0x4(%r9,%rcx,8), %rax
movq 0x48(%rsp), %rdx
subq %r8, %rdx
sarq $0x3, %rdx
imulq %r15, %rdx
cmpq %rax, %rdx
jbe 0x75a46
leaq (%r9,%rcx,8), %rcx
movsd 0x10(%rcx), %xmm1
leaq (%rax,%rax,8), %rax
movsd 0x38(%r8,%rax,8), %xmm0
ucomisd %xmm0, %xmm1
jbe 0x7536b
movsd %xmm0, 0x10(%rcx)
shlq $0x20, %rsi
orq %r13, %rsi
movq %rbp, %rdi
callq 0x7611c
movl %r12d, %esi
movq 0x40(%rsp), %r8
movq 0x20(%r8,%rbx,8), %r9
movq 0x28(%r8,%rbx,8), %rax
subq %r9, %rax
sarq $0x3, %rax
imulq %r14, %rax
incl %r12d
cmpq %rsi, %rax
ja 0x7532a
movq 0x8(%rsp), %rax
movq 0x60(%rax), %rcx
movq 0x68(%rax), %rdi
incl %r13d
movq %rdi, %rax
subq %rcx, %rax
sarq $0x3, %rax
imulq %r15, %rax
cmpq %r13, %rax
ja 0x752ef
movq 0x10(%rsp), %rdi
movq 0x18(%rsp), %r13
movq 0x28(%rsp), %rax
movq 0x38(%rsp), %rbx
jmp 0x7540c
leaq 0x40(%rsp), %rax
movq %rax, 0x120380(%rip)    # 0x195768
leaq -0xd2e(%rip), %rax      # 0x746c1
movq %rax, 0x28(%rsp)
xorpd %xmm0, %xmm0
movapd %xmm0, 0x10(%rsp)
movq $0x0, 0x20(%rsp)
xorl %r13d, %r13d
xorl %edi, %edi
leaq 0xd0(%rsp), %rdx
movq %rax, (%rdx)
movq %r13, %rsi
callq 0x68ddd
movabsq $0x7fffffff8, %rcx      # imm = 0x7FFFFFFF8
movq 0x18(%rsp), %rax
subq 0x10(%rsp), %rax
testq %rcx, %rax
je 0x75896
movq 0x8(%rsp), %rax
leaq 0x38(%rax), %rcx
movq %rcx, 0x80(%rsp)
addq $0x58, %rax
movq %rax, 0xb8(%rsp)
leaq 0x10(%rsp), %rdi
callq 0x761b8
movl %eax, %r12d
movslq %eax, %r13
movq 0x40(%rsp), %r10
leaq (,%r13,8), %rdx
addq %r13, %rdx
sarq $0x20, %rax
movq 0x20(%r10,%rdx,8), %r9
leaq (%rax,%rax,4), %r8
movslq 0x4(%r9,%r8,8), %rbp
movq 0x88(%rsp), %rcx
movl (%rcx,%rbp,4), %esi
cmpl $0x1, %esi
je 0x7569a
cmpl $-0x1, %esi
jne 0x75874
movl $0x1, (%rcx,%rbp,4)
movq 0xa0(%rsp), %rcx
leaq (,%r13,2), %rsi
addq %r13, %rsi
leaq (%rbp,%rbp,2), %rbx
movl 0x8(%rcx,%rsi,4), %edi
movl %edi, 0x8(%rcx,%rbx,4)
movq (%rcx,%rsi,4), %rsi
movq %rsi, (%rcx,%rbx,4)
movq 0x40(%rsp), %rsi
movq 0x20(%rsi,%rdx,8), %rcx
movq 0x28(%rsi,%rdx,8), %rdx
subq %rcx, %rdx
sarq $0x3, %rdx
imulq %r14, %rdx
cmpq %rax, %rdx
jbe 0x75a7c
leaq (,%rbx,4), %rdi
addq 0xa0(%rsp), %rdi
leaq (%rcx,%r8,8), %rsi
addq $0x18, %rsi
callq 0x50708
movq 0xa0(%rsp), %rcx
movq %rax, (%rcx,%rbx,4)
movl %edx, 0x8(%rcx,%rbx,4)
movq 0x60(%rsp), %rax
movslq (%rax,%r13,4), %rsi
movl %esi, (%rax,%rbp,4)
movq 0x8(%rsp), %rcx
movq 0x60(%rcx), %rax
movq 0x68(%rcx), %rdx
subq %rax, %rdx
sarq $0x3, %rdx
imulq %r15, %rdx
cmpq %rbp, %rdx
jbe 0x75a90
movq 0x118(%rsp), %rdx
movq (%rdx), %rcx
movq 0x8(%rdx), %rdx
subq %rcx, %rdx
sarq $0x3, %rdx
cmpq %rsi, %rdx
movq 0x80(%rsp), %r8
jbe 0x75a8d
leaq (,%rbp,8), %r13
addq %rbp, %r13
movsd 0x38(%rax,%r13,8), %xmm0
addsd %xmm0, %xmm0
ucomisd (%rcx,%rsi,8), %xmm0
jbe 0x755fe
movsd %xmm0, (%rcx,%rsi,8)
movq 0x8(%rsp), %rax
movq 0x40(%rax), %rcx
movq %r8, %rdi
testq %rcx, %rcx
je 0x755d9
movq %r8, %rax
xorl %edx, %edx
cmpl %ebp, 0x20(%rcx)
setl %dl
cmovgeq %rcx, %rax
movq 0x10(%rcx,%rdx,8), %rcx
testq %rcx, %rcx
jne 0x755b1
movq %r8, %rdi
cmpq %r8, %rax
je 0x755d9
cmpl 0x20(%rax), %ebp
cmovlq %r8, %rax
movq %rax, %rdi
movq 0x120(%rsp), %rcx
movq (%rcx), %rax
movq 0x8(%rcx), %rdx
subq %rax, %rdx
sarq $0x2, %rdx
cmpq %rsi, %rdx
jbe 0x75acb
movl 0x24(%rdi), %ecx
movl %ecx, (%rax,%rsi,4)
movq 0x40(%rsp), %rcx
movq 0x20(%rcx,%r13,8), %rdi
cmpq %rdi, 0x28(%rcx,%r13,8)
je 0x75874
movl %ebp, %ebp
movl $0x1, %ebx
xorl %esi, %esi
leaq (%rsi,%rsi,4), %r8
movslq 0x4(%rdi,%r8,8), %rax
movq 0x48(%rsp), %rdx
subq %rcx, %rdx
sarq $0x3, %rdx
imulq %r15, %rdx
cmpq %rax, %rdx
jbe 0x75a35
leaq (%rdi,%r8,8), %rdx
movsd 0x10(%rdx), %xmm1
leaq (%rax,%rax,8), %rdi
movsd 0x38(%rcx,%rdi,8), %xmm0
ucomisd %xmm0, %xmm1
jbe 0x7565c
movsd %xmm0, 0x10(%rdx)
cmpl %r12d, %eax
je 0x75677
shlq $0x20, %rsi
orq %rbp, %rsi
leaq 0x10(%rsp), %rdi
callq 0x7611c
movq 0x40(%rsp), %rcx
movl %ebx, %esi
movq 0x20(%rcx,%r13,8), %rdi
movq 0x28(%rcx,%r13,8), %rax
subq %rdi, %rax
sarq $0x3, %rax
imulq %r14, %rax
incl %ebx
cmpq %rsi, %rax
ja 0x7561c
jmp 0x75874
movq 0x60(%rsp), %rdi
movslq (%rdi,%rbp,4), %rcx
movslq (%rdi,%r13,4), %rsi
cmpl %esi, %ecx
je 0x75874
leaq (%r10,%rdx,8), %rdx
addq $0x20, %rdx
movq 0x8(%rdx), %rdx
subq %r9, %rdx
sarq $0x3, %rdx
imulq %r14, %rdx
cmpq %rax, %rdx
jbe 0x75ab2
movq 0xc8(%rsp), %rax
movq (%rax), %r10
movq 0x8(%rax), %rdx
subq %r10, %rdx
sarq $0x3, %rdx
movabsq $-0x5555555555555555, %rax # imm = 0xAAAAAAAAAAAAAAAB
imulq %rax, %rdx
cmpq %rcx, %rdx
jbe 0x75adc
leaq (%rcx,%rcx,2), %rax
movq (%r10,%rax,8), %r11
movq 0x8(%r10,%rax,8), %rbx
subq %r11, %rbx
sarq $0x3, %rbx
cmpq %rsi, %rbx
jbe 0x75ac3
leaq (%r9,%r8,8), %r8
movsd 0x10(%r8), %xmm0
addsd %xmm0, %xmm0
ucomisd (%r11,%rsi,8), %xmm0
jbe 0x75874
movsd %xmm0, (%r11,%rsi,8)
cmpq %rsi, %rdx
jbe 0x75ad9
leaq (%rsi,%rsi,2), %rdx
movq (%r10,%rdx,8), %r8
movq 0x8(%r10,%rdx,8), %rdx
subq %r8, %rdx
sarq $0x3, %rdx
cmpq %rcx, %rdx
movq 0x80(%rsp), %r11
jbe 0x75adc
movsd %xmm0, (%r8,%rcx,8)
movq 0x8(%rsp), %rdx
movq 0x40(%rdx), %rdx
movq 0xb8(%rsp), %r8
movq %r11, %r9
testq %rdx, %rdx
je 0x757ea
movq %rdx, %r8
movq %r11, %r9
xorl %r10d, %r10d
cmpl %ebp, 0x20(%r8)
setl %r10b
cmovgeq %r8, %r9
movq 0x10(%r8,%r10,8), %r8
testq %r8, %r8
jne 0x7578c
movq %r11, %r8
cmpq %r11, %r9
je 0x757b8
cmpl 0x20(%r9), %ebp
cmovlq %r11, %r9
movq %r9, %r8
movq %r11, %r9
xorl %r10d, %r10d
cmpl %r12d, 0x20(%rdx)
setl %r10b
cmovgeq %rdx, %r9
movq 0x10(%rdx,%r10,8), %rdx
testq %rdx, %rdx
jne 0x757bb
addq $0x20, %r8
cmpq %r11, %r9
je 0x757e7
cmpl %r12d, 0x20(%r9)
cmovgq %r11, %r9
jmp 0x757ea
movq %r11, %r9
movq 0xc0(%rsp), %rdx
movq (%rdx), %r10
movq 0x8(%rdx), %r11
subq %r10, %r11
sarq $0x3, %r11
movabsq $-0x5555555555555555, %rdx # imm = 0xAAAAAAAAAAAAAAAB
imulq %rdx, %r11
cmpq %rcx, %r11
jbe 0x75aed
movq (%r10,%rax,8), %rbx
movq 0x8(%r10,%rax,8), %rdx
subq %rbx, %rdx
sarq $0x3, %rdx
cmpq %rsi, %rdx
jbe 0x75af3
movl 0x4(%r8), %eax
movl 0x24(%r9), %ecx
movl %eax, (%rbx,%rsi,8)
movl %ecx, 0x4(%rbx,%rsi,8)
movslq (%rdi,%r13,4), %rsi
cmpq %rsi, %r11
jbe 0x75af0
leaq (%rsi,%rsi,2), %rdx
movslq (%rdi,%rbp,4), %rsi
movq (%r10,%rdx,8), %rdi
movq 0x8(%r10,%rdx,8), %rdx
subq %rdi, %rdx
sarq $0x3, %rdx
cmpq %rsi, %rdx
jbe 0x75af3
movl %eax, (%rdi,%rsi,8)
movl %ecx, 0x4(%rdi,%rsi,8)
movq 0x18(%rsp), %rax
subq 0x10(%rsp), %rax
movabsq $0x7fffffff8, %rcx      # imm = 0x7FFFFFFF8
testq %rcx, %rax
movq 0x38(%rsp), %rbx
jne 0x75459
movl 0x58(%rsp), %r12d
xorl %r14d, %r14d
movq 0x11f74b(%rip), %r15    # 0x194ff0
leaq 0xe8096(%rip), %rbp     # 0x15d942
movq (%rbx), %rax
movq 0x8(%rbx), %rdx
subq %rax, %rdx
sarq $0x3, %rdx
cmpq %r14, %rdx
jbe 0x75a57
movq 0x118(%rsp), %rdx
movq (%rdx), %rcx
movq 0x8(%rdx), %rdx
subq %rcx, %rdx
sarq $0x3, %rdx
cmpq %r14, %rdx
jbe 0x75a57
movsd (%rax,%r14,8), %xmm0
ucomisd (%rcx,%r14,8), %xmm0
jne 0x758f6
jnp 0x759a5
movl $0xb, %edx
movq %r15, %rdi
leaq 0xdf30a(%rip), %rsi     # 0x154c0f
callq 0x44e0
movq (%rbx), %rax
movq 0x8(%rbx), %rdx
subq %rax, %rdx
sarq $0x3, %rdx
cmpq %r14, %rdx
jbe 0x75a57
movsd (%rax,%r14,8), %xmm0
movq %r15, %rdi
callq 0x46b0
movq %rax, %r13
movl $0x26, %edx
movq %rax, %rdi
leaq 0xdf2da(%rip), %rsi     # 0x154c1b
callq 0x44e0
movq 0x118(%rsp), %rcx
movq (%rcx), %rax
movq 0x8(%rcx), %rdx
subq %rax, %rdx
sarq $0x3, %rdx
cmpq %r14, %rdx
jbe 0x75a57
movsd (%rax,%r14,8), %xmm0
movq %r13, %rdi
callq 0x46b0
movq %rax, %r13
movl $0xe, %edx
movq %rax, %rdi
leaq 0xdf2bd(%rip), %rsi     # 0x154c42
callq 0x44e0
movq %r13, %rdi
movl %r14d, %esi
callq 0x4750
movl $0x2, %edx
movq %rax, %rdi
movq %rbp, %rsi
callq 0x44e0
incq %r14
cmpq %r14, %r12
jne 0x758ac
movq 0x10(%rsp), %rdi
testq %rdi, %rdi
je 0x759c8
movq 0x20(%rsp), %rsi
subq %rdi, %rsi
callq 0x4470
movq 0x60(%rsp), %rdi
testq %rdi, %rdi
je 0x759df
movq 0x70(%rsp), %rsi
subq %rdi, %rsi
callq 0x4470
movq 0x88(%rsp), %rdi
testq %rdi, %rdi
je 0x759fc
movq 0x98(%rsp), %rsi
subq %rdi, %rsi
callq 0x4470
movq 0xa0(%rsp), %rdi
testq %rdi, %rdi
je 0x75a19
movq 0xb0(%rsp), %rsi
subq %rdi, %rsi
callq 0x4470
leaq 0x40(%rsp), %rdi
callq 0xf10e
addq $0xd8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0xd7cb9(%rip), %rdi     # 0x14d6f5
movq %rax, %rsi
xorl %eax, %eax
callq 0x4630
leaq 0xd7ca8(%rip), %rdi     # 0x14d6f5
movq %rax, %rsi
xorl %eax, %eax
callq 0x4630
leaq 0xd7c97(%rip), %rdi     # 0x14d6f5
movq %r14, %rsi
xorl %eax, %eax
callq 0x4630
movq %r13, %rsi
movq %r8, %rdx
leaq 0xd7c80(%rip), %rdi     # 0x14d6f5
xorl %eax, %eax
callq 0x4630
leaq 0xd7c72(%rip), %rdi     # 0x14d6f5
movq %rax, %rsi
xorl %eax, %eax
callq 0x4630
movq %rsi, %rbp
leaq 0xd7c5e(%rip), %rdi     # 0x14d6f5
movq %rbp, %rsi
xorl %eax, %eax
callq 0x4630
leaq 0xd7c4d(%rip), %rdi     # 0x14d6f5
movq %rax, %rdx
xorl %eax, %eax
callq 0x4630
leaq 0xd7c3c(%rip), %rdi     # 0x14d6f5
movq %rax, %rsi
xorl %eax, %eax
callq 0x4630
movq %rsi, %rcx
movq %rbx, %rdx
jmp 0x75adc
leaq 0xd7c23(%rip), %rdi     # 0x14d6f5
xorl %eax, %eax
callq 0x4630
movq %rsi, %rcx
leaq 0xd7c12(%rip), %rdi     # 0x14d6f5
movq %rcx, %rsi
xorl %eax, %eax
callq 0x4630
movq %rcx, %rsi
movq %r11, %rdx
leaq 0xd7bfb(%rip), %rdi     # 0x14d6f5
xorl %eax, %eax
callq 0x4630
movq 0x11f4e8(%rip), %rdi    # 0x194ff0
leaq 0xdf058(%rip), %rsi     # 0x154b67
movl $0x45, %edx
callq 0x44e0
movq 0x11f4d0(%rip), %rdi    # 0x194ff0
leaq 0xddaf7(%rip), %rsi     # 0x15361e
callq 0x4440
callq 0x4260
movq %rax, %rbx
jmp 0x75b9f
jmp 0x75b6e
jmp 0x75b5f
movq %rax, %rbx
jmp 0x75bbc
jmp 0x75b41
movq %rax, %rbx
jmp 0x75bd9
jmp 0x75b5f
jmp 0x75b6e
jmp 0x75b6e
jmp 0x75b5f
jmp 0x75b6e
jmp 0x75b6e
jmp 0x75b6e
jmp 0x75b6e
jmp 0x75b5f
jmp 0x75b6e
jmp 0x75b6e
movq %rax, %rbx
jmp 0x75b88
jmp 0x75b6e
jmp 0x75b6e
jmp 0x75b6e
jmp 0x75b6e
jmp 0x75b6e
movq %rax, %rbx
movq 0x10(%rsp), %rdi
testq %rdi, %rdi
je 0x75b88
movq 0x20(%rsp), %rsi
subq %rdi, %rsi
callq 0x4470
movq 0x60(%rsp), %rdi
testq %rdi, %rdi
je 0x75b9f
movq 0x70(%rsp), %rsi
subq %rdi, %rsi
callq 0x4470
movq 0x88(%rsp), %rdi
testq %rdi, %rdi
je 0x75bbc
movq 0x98(%rsp), %rsi
subq %rdi, %rsi
callq 0x4470
movq 0xa0(%rsp), %rdi
testq %rdi, %rdi
je 0x75bd9
movq 0xb0(%rsp), %rsi
subq %rdi, %rsi
callq 0x4470
leaq 0x40(%rsp), %rdi
callq 0xf10e
movq %rbx, %rdi
callq 0x4780
nop