// File: Luthaf[P]zeopp/channel.cc
// Function: PORE::getFreeIncludedSphereDiameterforNodePair(int, int)
pair <double, double> PORE::getFreeIncludedSphereDiameterforNodePair(int node1, int node2){
    //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(node1 == node2 || node1 < 0 || node2 < 0){
      cerr << "Requesting Df/Dif conculation for nodes of incorrect IDs.\n" << "\n";
      abort();
      };

    // node1 and node2 are provided

    node1 = idMappings.find(node1)->second;
    node2 = idMappings.find(node2)->second;
    
    // 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);
    
    compareConnections_ptr = &lnodes;
    HEAP< pair<int,int> > stack(compareConnections);
    
    // loop over all connections and add them to stack
    for(unsigned int i=0; i<lnodes[nodeIndex].connections.size(); i++)
    {
        if(lnodes[nodeIndex].connections.at(i).max_radius > lnodes.at(lnodes[nodeIndex].connections.at(i).to).max_radius)
            lnodes[nodeIndex].connections.at(i).max_radius = lnodes.at(lnodes[nodeIndex].connections.at(i).to).max_radius;
        
        stack.insert(pair<int,int>(nodeIndex,i));
    };
    
    stack.reHeapify();
    
    bool flag=true;
    
    while(stack.size() != 0&&flag){
        //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)
        {
            // going to accept the best_node and update di and df
            // update df and di
            if(lnodes[best.first].connections.at(best.second).max_radius<df) df=lnodes[best.first].connections.at(best.second).max_radius;
            
            if(lnodes.at(best_node).max_radius > di) di = lnodes.at(best_node).max_radius;

            // in the desired node is reached, and the loop 
            
            if(best_node == node2)
              {
              node2FoundFlag = true; 
              flag = true; // stop flag set
              break;
              };
            
            // otherwise continue

            // 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);
            
            // 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(); 
        }
        
        else if(accessStatuses[best_node]==ACCESSED){
            //selected connection leads to a node that is on stact
            //need to check in which unit cell it is
            
            
            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;
            };
            // otherwise do nothing
            // need to make sure heap is correct (which should be true as nothing was added)
        }
        
        else{
            //
            // need this section ?
            //
        };
        
    };
    
    // change radii to diameter
    df=df*2.0;
    di=di*2.0;
    
    if(node2FoundFlag == false)
      {
      df = -1;
      di = -1;
      };

    pair<double,double>  resultdfdif;
    resultdfdif.first=df;
    resultdfdif.second=di;
    
    return resultdfdif;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x2f0, %rsp            # imm = 0x2F0
movq %rdi, -0x18(%rbp)
movl %esi, -0x1c(%rbp)
movl %edx, -0x20(%rbp)
movq -0x18(%rbp), %rsi
movq %rsi, -0x178(%rbp)
movl $0x1, -0x24(%rbp)
movl $0xffffffff, -0x28(%rbp) # imm = 0xFFFFFFFF
movb $0x0, -0x29(%rbp)
addq $0x60, %rsi
leaq -0x48(%rbp), %rdi
movq %rdi, -0x170(%rbp)
callq 0x67230
movq -0x170(%rbp), %rdi
callq 0x10100
movq %rax, -0x168(%rbp)
leaq -0x6c(%rbp), %rdi
xorl %ecx, %ecx
movl %ecx, %esi
movl %ecx, %edx
callq 0x94010
jmp 0xcb06a
leaq -0x7d(%rbp), %rdi
movq %rdi, -0x180(%rbp)
callq 0x65af0
movq -0x168(%rbp), %rsi
movq -0x180(%rbp), %rcx
leaq -0x60(%rbp), %rdi
leaq -0x6c(%rbp), %rdx
callq 0xce390
jmp 0xcb097
leaq -0x7d(%rbp), %rdi
callq 0x14e70
leaq -0x48(%rbp), %rdi
callq 0x10100
movq %rax, -0x190(%rbp)
leaq -0x99(%rbp), %rdi
movq %rdi, -0x188(%rbp)
callq 0x10960
movq -0x190(%rbp), %rsi
movq -0x188(%rbp), %rcx
leaq -0x98(%rbp), %rdi
leaq -0x28(%rbp), %rdx
callq 0x65a70
jmp 0xcb0e3
leaq -0x99(%rbp), %rdi
callq 0x13030
movl $0x0, -0xa0(%rbp)
movl -0x1c(%rbp), %eax
cmpl -0x20(%rbp), %eax
je 0xcb111
cmpl $0x0, -0x1c(%rbp)
jl 0xcb111
cmpl $0x0, -0x20(%rbp)
jge 0xcb1a0
movq 0x1a7ed8(%rip), %rdi    # 0x272ff0
leaq 0x13065d(%rip), %rsi    # 0x1fb77c
callq 0x5540
movq %rax, -0x198(%rbp)
jmp 0xcb12d
movq -0x198(%rbp), %rdi
leaq 0x12e4ea(%rip), %rsi    # 0x1f9625
callq 0x5540
jmp 0xcb142
callq 0x52b0
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x78(%rbp)
movl %eax, -0x7c(%rbp)
jmp 0xcbc78
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x78(%rbp)
movl %eax, -0x7c(%rbp)
leaq -0x7d(%rbp), %rdi
callq 0x14e70
jmp 0xcbc78
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x78(%rbp)
movl %eax, -0x7c(%rbp)
leaq -0x99(%rbp), %rdi
callq 0x13030
jmp 0xcbc6f
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x78(%rbp)
movl %eax, -0x7c(%rbp)
jmp 0xcbc63
movq -0x178(%rbp), %rdi
leaq -0x1c(%rbp), %rsi
callq 0x102e0
movq %rax, -0x1a0(%rbp)
jmp 0xcb1b9
movq -0x1a0(%rbp), %rax
movq %rax, -0xb8(%rbp)
leaq -0xb8(%rbp), %rdi
callq 0x10350
movq -0x178(%rbp), %rdi
movl 0x4(%rax), %eax
movl %eax, -0x1c(%rbp)
leaq -0x20(%rbp), %rsi
callq 0x102e0
movq %rax, -0x1a8(%rbp)
jmp 0xcb1f2
movq -0x1a8(%rbp), %rax
movq %rax, -0xc0(%rbp)
leaq -0xc0(%rbp), %rdi
callq 0x10350
movl 0x4(%rax), %eax
movl %eax, -0x20(%rbp)
movl -0x1c(%rbp), %eax
movl %eax, -0xa0(%rbp)
movl -0xa0(%rbp), %eax
movl %eax, %esi
leaq -0x48(%rbp), %rdi
callq 0x10130
movq %rax, -0x1b0(%rbp)
jmp 0xcb235
movq -0x1b0(%rbp), %rax
movsd 0x38(%rax), %xmm0
movsd %xmm0, -0xa8(%rbp)
movl -0xa0(%rbp), %eax
movl %eax, %esi
leaq -0x48(%rbp), %rdi
callq 0x10130
movq %rax, -0x1b8(%rbp)
jmp 0xcb263
movq -0x1b8(%rbp), %rax
movsd 0x38(%rax), %xmm0
movsd %xmm0, -0xb0(%rbp)
movl -0xa0(%rbp), %eax
movl %eax, %esi
leaq -0x98(%rbp), %rdi
callq 0xed60
movl $0x1, (%rax)
leaq -0xcc(%rbp), %rdi
xorl %ecx, %ecx
movl %ecx, %esi
movl %ecx, %edx
callq 0x94010
jmp 0xcb2a5
movl -0xa0(%rbp), %eax
movl %eax, %esi
leaq -0x60(%rbp), %rdi
callq 0x658f0
movl -0xc4(%rbp), %ecx
movl %ecx, 0x8(%rax)
movq -0xcc(%rbp), %rcx
movq %rcx, (%rax)
leaq -0x48(%rbp), %rax
movq %rax, 0x1a856c(%rip)    # 0x273840
leaq -0x42b(%rip), %rsi      # 0xcaeb0
leaq -0xf0(%rbp), %rdi
callq 0xce410
jmp 0xcb2e9
movl $0x0, -0xf4(%rbp)
movl -0xf4(%rbp), %eax
movq %rax, -0x1c0(%rbp)
movl -0xa0(%rbp), %eax
movl %eax, %esi
leaq -0x48(%rbp), %rdi
callq 0x2a4c0
movq %rax, %rdi
addq $0x20, %rdi
callq 0x2a9e0
movq %rax, %rcx
movq -0x1c0(%rbp), %rax
cmpq %rcx, %rax
jae 0xcb4de
movl -0xa0(%rbp), %eax
movl %eax, %esi
leaq -0x48(%rbp), %rdi
callq 0x2a4c0
movq %rax, %rdi
addq $0x20, %rdi
movl -0xf4(%rbp), %eax
movl %eax, %esi
callq 0x64470
movq %rax, -0x1c8(%rbp)
jmp 0xcb35e
movq -0x1c8(%rbp), %rax
movsd 0x10(%rax), %xmm0
movsd %xmm0, -0x1d8(%rbp)
movl -0xa0(%rbp), %eax
movl %eax, %esi
leaq -0x48(%rbp), %rdi
callq 0x2a4c0
movq %rax, %rdi
addq $0x20, %rdi
movl -0xf4(%rbp), %eax
movl %eax, %esi
callq 0x64470
movq %rax, -0x1d0(%rbp)
jmp 0xcb3a0
movq -0x1d0(%rbp), %rax
movslq 0x4(%rax), %rsi
leaq -0x48(%rbp), %rdi
callq 0x10130
movq %rax, -0x1e0(%rbp)
jmp 0xcb3bd
movsd -0x1d8(%rbp), %xmm0
movq -0x1e0(%rbp), %rax
ucomisd 0x38(%rax), %xmm0
jbe 0xcb497
movl -0xa0(%rbp), %eax
movl %eax, %esi
leaq -0x48(%rbp), %rdi
callq 0x2a4c0
movq %rax, %rdi
addq $0x20, %rdi
movl -0xf4(%rbp), %eax
movl %eax, %esi
callq 0x64470
movq %rax, -0x1e8(%rbp)
jmp 0xcb405
movq -0x1e8(%rbp), %rax
movslq 0x4(%rax), %rsi
leaq -0x48(%rbp), %rdi
callq 0x10130
movq %rax, -0x1f0(%rbp)
jmp 0xcb422
movq -0x1f0(%rbp), %rax
movsd 0x38(%rax), %xmm0
movsd %xmm0, -0x200(%rbp)
movl -0xa0(%rbp), %eax
movl %eax, %esi
leaq -0x48(%rbp), %rdi
callq 0x2a4c0
movq %rax, %rdi
addq $0x20, %rdi
movl -0xf4(%rbp), %eax
movl %eax, %esi
callq 0x64470
movq %rax, -0x1f8(%rbp)
jmp 0xcb464
movq -0x1f8(%rbp), %rax
movsd -0x200(%rbp), %xmm0
movsd %xmm0, 0x10(%rax)
jmp 0xcb497
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x78(%rbp)
movl %eax, -0x7c(%rbp)
leaq -0xf0(%rbp), %rdi
callq 0xce5b0
jmp 0xcbc63
leaq -0xfc(%rbp), %rdi
leaq -0xa0(%rbp), %rsi
leaq -0xf4(%rbp), %rdx
callq 0x103a0
jmp 0xcb4b3
movq -0xfc(%rbp), %rsi
leaq -0xf0(%rbp), %rdi
callq 0xce470
jmp 0xcb4c8
jmp 0xcb4ca
movl -0xf4(%rbp), %eax
addl $0x1, %eax
movl %eax, -0xf4(%rbp)
jmp 0xcb2f3
leaq -0xf0(%rbp), %rdi
callq 0xce4d0
jmp 0xcb4ec
movb $0x1, -0xfd(%rbp)
leaq -0xf0(%rbp), %rdi
callq 0xce520
movl %eax, -0x204(%rbp)
jmp 0xcb507
movl -0x204(%rbp), %ecx
xorl %eax, %eax
cmpl $0x0, %ecx
movb %al, -0x205(%rbp)
je 0xcb526
movb -0xfd(%rbp), %al
movb %al, -0x205(%rbp)
movb -0x205(%rbp), %al
testb $0x1, %al
jne 0xcb535
jmp 0xcbba4
leaq -0xf0(%rbp), %rdi
callq 0xce540
movq %rax, -0x210(%rbp)
jmp 0xcb54a
movq -0x210(%rbp), %rax
movq %rax, -0x108(%rbp)
movslq -0x108(%rbp), %rsi
leaq -0x48(%rbp), %rdi
callq 0x2a4c0
movq %rax, %rdi
addq $0x20, %rdi
movslq -0x104(%rbp), %rsi
callq 0x69220
movl 0x4(%rax), %eax
movl %eax, -0x10c(%rbp)
movslq -0x10c(%rbp), %rsi
leaq -0x98(%rbp), %rdi
callq 0xed60
cmpl $-0x1, (%rax)
jne 0xcb9d2
movslq -0x108(%rbp), %rsi
leaq -0x48(%rbp), %rdi
callq 0x2a4c0
movq %rax, %rdi
addq $0x20, %rdi
movslq -0x104(%rbp), %rsi
callq 0x64470
movq %rax, -0x218(%rbp)
jmp 0xcb5cc
movq -0x218(%rbp), %rax
movsd 0x10(%rax), %xmm1
movsd -0xb0(%rbp), %xmm0
ucomisd %xmm1, %xmm0
jbe 0xcb626
movslq -0x108(%rbp), %rsi
leaq -0x48(%rbp), %rdi
callq 0x2a4c0
movq %rax, %rdi
addq $0x20, %rdi
movslq -0x104(%rbp), %rsi
callq 0x64470
movq %rax, -0x220(%rbp)
jmp 0xcb612
movq -0x220(%rbp), %rax
movsd 0x10(%rax), %xmm0
movsd %xmm0, -0xb0(%rbp)
movslq -0x10c(%rbp), %rsi
leaq -0x48(%rbp), %rdi
callq 0x10130
movq %rax, -0x228(%rbp)
jmp 0xcb63f
movq -0x228(%rbp), %rax
movsd 0x38(%rax), %xmm0
ucomisd -0xa8(%rbp), %xmm0
jbe 0xcb682
movslq -0x10c(%rbp), %rsi
leaq -0x48(%rbp), %rdi
callq 0x10130
movq %rax, -0x230(%rbp)
jmp 0xcb66e
movq -0x230(%rbp), %rax
movsd 0x38(%rax), %xmm0
movsd %xmm0, -0xa8(%rbp)
movl -0x10c(%rbp), %eax
cmpl -0x20(%rbp), %eax
jne 0xcb69d
movb $0x1, -0x29(%rbp)
movb $0x1, -0xfd(%rbp)
jmp 0xcbba4
movslq -0x10c(%rbp), %rsi
leaq -0x98(%rbp), %rdi
callq 0xed60
movl $0x1, (%rax)
movslq -0x108(%rbp), %rsi
leaq -0x60(%rbp), %rdi
movq %rdi, -0x248(%rbp)
callq 0x658f0
movq -0x248(%rbp), %rdi
movq %rax, -0x250(%rbp)
movslq -0x10c(%rbp), %rsi
callq 0x658f0
movq -0x250(%rbp), %rcx
movq -0x248(%rbp), %rdi
movl 0x8(%rcx), %edx
movl %edx, 0x8(%rax)
movq (%rcx), %rcx
movq %rcx, (%rax)
movslq -0x10c(%rbp), %rsi
callq 0x658f0
movq %rax, -0x240(%rbp)
movslq -0x108(%rbp), %rsi
leaq -0x48(%rbp), %rdi
callq 0x2a4c0
movq %rax, %rdi
addq $0x20, %rdi
movslq -0x104(%rbp), %rsi
callq 0x64470
movq %rax, -0x238(%rbp)
jmp 0xcb740
movq -0x240(%rbp), %rdi
movq -0x238(%rbp), %rsi
addq $0x18, %rsi
callq 0x94150
movl %edx, -0x25c(%rbp)
movq %rax, -0x258(%rbp)
jmp 0xcb766
movl -0x25c(%rbp), %eax
movq -0x258(%rbp), %rcx
movq %rcx, -0x128(%rbp)
movl %eax, -0x120(%rbp)
movq -0x128(%rbp), %rax
movq %rax, -0x118(%rbp)
movl -0x120(%rbp), %eax
movl %eax, -0x110(%rbp)
movslq -0x10c(%rbp), %rsi
leaq -0x60(%rbp), %rdi
callq 0x658f0
movq -0x118(%rbp), %rcx
movq %rcx, (%rax)
movl -0x110(%rbp), %ecx
movl %ecx, 0x8(%rax)
movl $0x0, -0x12c(%rbp)
movl -0x12c(%rbp), %eax
movq %rax, -0x268(%rbp)
movslq -0x10c(%rbp), %rsi
leaq -0x48(%rbp), %rdi
callq 0x2a4c0
movq %rax, %rdi
addq $0x20, %rdi
callq 0x2a9e0
movq %rax, %rcx
movq -0x268(%rbp), %rax
cmpq %rcx, %rax
jae 0xcb9bf
movslq -0x10c(%rbp), %rsi
leaq -0x48(%rbp), %rdi
callq 0x2a4c0
movq %rax, %rdi
addq $0x20, %rdi
movl -0x12c(%rbp), %eax
movl %eax, %esi
callq 0x64470
movq %rax, -0x270(%rbp)
jmp 0xcb830
movq -0x270(%rbp), %rax
movsd 0x10(%rax), %xmm0
movsd %xmm0, -0x280(%rbp)
movslq -0x10c(%rbp), %rsi
leaq -0x48(%rbp), %rdi
callq 0x2a4c0
movq %rax, %rdi
addq $0x20, %rdi
movl -0x12c(%rbp), %eax
movl %eax, %esi
callq 0x64470
movq %rax, -0x278(%rbp)
jmp 0xcb871
movq -0x278(%rbp), %rax
movslq 0x4(%rax), %rsi
leaq -0x48(%rbp), %rdi
callq 0x10130
movq %rax, -0x288(%rbp)
jmp 0xcb88e
movsd -0x280(%rbp), %xmm0
movq -0x288(%rbp), %rax
ucomisd 0x38(%rax), %xmm0
jbe 0xcb947
movslq -0x10c(%rbp), %rsi
leaq -0x48(%rbp), %rdi
callq 0x2a4c0
movq %rax, %rdi
addq $0x20, %rdi
movl -0x12c(%rbp), %eax
movl %eax, %esi
callq 0x64470
movq %rax, -0x290(%rbp)
jmp 0xcb8d5
movq -0x290(%rbp), %rax
movslq 0x4(%rax), %rsi
leaq -0x48(%rbp), %rdi
callq 0x10130
movq %rax, -0x298(%rbp)
jmp 0xcb8f2
movq -0x298(%rbp), %rax
movsd 0x38(%rax), %xmm0
movsd %xmm0, -0x2a8(%rbp)
movslq -0x10c(%rbp), %rsi
leaq -0x48(%rbp), %rdi
callq 0x2a4c0
movq %rax, %rdi
addq $0x20, %rdi
movl -0x12c(%rbp), %eax
movl %eax, %esi
callq 0x64470
movq %rax, -0x2a0(%rbp)
jmp 0xcb933
movq -0x2a0(%rbp), %rax
movsd -0x2a8(%rbp), %xmm0
movsd %xmm0, 0x10(%rax)
movslq -0x10c(%rbp), %rsi
leaq -0x48(%rbp), %rdi
callq 0x2a4c0
movq %rax, %rdi
addq $0x20, %rdi
movl -0x12c(%rbp), %eax
movl %eax, %esi
callq 0x69220
movl 0x4(%rax), %eax
cmpl -0x108(%rbp), %eax
je 0xcb9a9
leaq -0x134(%rbp), %rdi
leaq -0x10c(%rbp), %rsi
leaq -0x12c(%rbp), %rdx
callq 0xcd170
jmp 0xcb992
movq -0x134(%rbp), %rsi
leaq -0xf0(%rbp), %rdi
callq 0xce470
jmp 0xcb9a7
jmp 0xcb9a9
jmp 0xcb9ab
movl -0x12c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x12c(%rbp)
jmp 0xcb7c7
leaq -0xf0(%rbp), %rdi
callq 0xce4d0
jmp 0xcb9cd
jmp 0xcbb9f
movslq -0x10c(%rbp), %rsi
leaq -0x98(%rbp), %rdi
callq 0xed60
cmpl $0x1, (%rax)
jne 0xcbb9b
movslq -0x10c(%rbp), %rsi
leaq -0x60(%rbp), %rdi
movq %rdi, -0x2c8(%rbp)
callq 0x658f0
movq -0x2c8(%rbp), %rdi
movq %rax, -0x2c0(%rbp)
movslq -0x108(%rbp), %rsi
callq 0x658f0
movq %rax, -0x2b8(%rbp)
movslq -0x108(%rbp), %rsi
leaq -0x48(%rbp), %rdi
callq 0x2a4c0
movq %rax, %rdi
addq $0x20, %rdi
movslq -0x104(%rbp), %rsi
callq 0x64470
movq %rax, -0x2b0(%rbp)
jmp 0xcba52
movq -0x2b8(%rbp), %rdi
movq -0x2b0(%rbp), %rsi
addq $0x18, %rsi
callq 0x94150
movl %edx, -0x2d4(%rbp)
movq %rax, -0x2d0(%rbp)
jmp 0xcba78
movq -0x2c0(%rbp), %rdi
movl -0x2d4(%rbp), %eax
movq -0x2d0(%rbp), %rcx
movq %rcx, -0x150(%rbp)
movl %eax, -0x148(%rbp)
movl -0x148(%rbp), %eax
movl %eax, -0x138(%rbp)
movq -0x150(%rbp), %rax
movq %rax, -0x140(%rbp)
movl -0x138(%rbp), %eax
movl %eax, -0x158(%rbp)
movq -0x140(%rbp), %rax
movq %rax, -0x160(%rbp)
movq -0x160(%rbp), %rsi
movl -0x158(%rbp), %edx
callq 0x94040
movb %al, -0x2d5(%rbp)
jmp 0xcbae7
movb -0x2d5(%rbp), %al
testb $0x1, %al
jne 0xcbb99
jmp 0xcbaf7
movq -0x178(%rbp), %rdi
movsd -0xb0(%rbp), %xmm0
movsd %xmm0, -0x2e8(%rbp)
addq $0x60, %rdi
movslq -0x108(%rbp), %rsi
callq 0x2a4c0
movq %rax, %rdi
addq $0x20, %rdi
movslq -0x104(%rbp), %rsi
callq 0x64470
movq %rax, -0x2e0(%rbp)
jmp 0xcbb3a
movsd -0x2e8(%rbp), %xmm0
movq -0x2e0(%rbp), %rax
ucomisd 0x10(%rax), %xmm0
jbe 0xcbb97
movq -0x178(%rbp), %rdi
addq $0x60, %rdi
movslq -0x108(%rbp), %rsi
callq 0x2a4c0
movq %rax, %rdi
addq $0x20, %rdi
movslq -0x104(%rbp), %rsi
callq 0x64470
movq %rax, -0x2f0(%rbp)
jmp 0xcbb83
movq -0x2f0(%rbp), %rax
movsd 0x10(%rax), %xmm0
movsd %xmm0, -0xb0(%rbp)
jmp 0xcbb99
jmp 0xcbb9d
jmp 0xcbb9d
jmp 0xcbb9f
jmp 0xcb4f3
movsd 0x12649c(%rip), %xmm0   # 0x1f2048
mulsd -0xb0(%rbp), %xmm0
movsd %xmm0, -0xb0(%rbp)
movsd 0x126484(%rip), %xmm0   # 0x1f2048
mulsd -0xa8(%rbp), %xmm0
movsd %xmm0, -0xa8(%rbp)
movb -0x29(%rbp), %al
andb $0x1, %al
movzbl %al, %eax
cmpl $0x0, %eax
jne 0xcbc01
movsd 0x126b8f(%rip), %xmm0   # 0x1f2778
movsd %xmm0, -0xb0(%rbp)
movsd 0x126b7f(%rip), %xmm0   # 0x1f2778
movsd %xmm0, -0xa8(%rbp)
leaq -0x10(%rbp), %rdi
callq 0xce5d0
jmp 0xcbc0c
movsd -0xb0(%rbp), %xmm0
movsd %xmm0, -0x10(%rbp)
movsd -0xa8(%rbp), %xmm0
movsd %xmm0, -0x8(%rbp)
leaq -0xf0(%rbp), %rdi
callq 0xce5b0
leaq -0x98(%rbp), %rdi
callq 0xec80
leaq -0x60(%rbp), %rdi
callq 0x14c80
leaq -0x48(%rbp), %rdi
callq 0x10e40
movsd -0x10(%rbp), %xmm0
movsd -0x8(%rbp), %xmm1
addq $0x2f0, %rsp            # imm = 0x2F0
popq %rbp
retq
leaq -0x98(%rbp), %rdi
callq 0xec80
leaq -0x60(%rbp), %rdi
callq 0x14c80
leaq -0x48(%rbp), %rdi
callq 0x10e40
movq -0x78(%rbp), %rdi
callq 0x58f0
nopw (%rax,%rax)