// File: Luthaf[P]zeopp/channel.cc
// Function: CHANNEL::findFreeIncludedSphereDiameterforNode(int, std::pair<double, std::pair<double, double>>)
pair <double, pair<double,double> > CHANNEL::findFreeIncludedSphereDiameterforNode(int nodeid, pair<double, pair<double,double> > maxdidfdif){
    //Define three access types
    const int ACCESSED   =  1;
    const int UNKNOWN      = -1;
    
    // 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 maxdi,di,df;
    
    
    // In case of early termination, be ready to return the current node Di
    maxdidfdif.first = 2.0 * lnodes.at(nodeid).max_radius; // .first is use to store the current Di for the current (nodeid) node
    
    // Test if it is worth to run the funtion (e.g. starting node's radius is smaller than the current Df)
    if(lnodes.at(nodeid).max_radius < maxdidfdif.second.first/2.0)
    {
        return maxdidfdif; // if not, just return the current best numbers (maxdidfdif)
    };
    
    // Start analysis for node of id = nodeid
    
    nodeIndex = nodeid;
    
    // accept the initial node
    maxdi = lnodes.at(nodeIndex).max_radius; // (it is not really the max but will be analyzed to get max)
    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;
            
            // termine early if the current Df is smaller than the current record
            
            if(df * 2.0 < maxdidfdif.second.first)
            {
                return maxdidfdif; // if not, just return the current best numbers (maxdidfdif) 
            };
            
            
            // 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, the resulting df can be calculated
                if(df>nodes[best.first].connections.at(best.second).max_radius) df=nodes[best.first].connections.at(best.second).max_radius;
                flag=false;
                break;
            };
            // otherwise do nothing
            // need to make sure heap is correct
        }
        
        else{
            //
            // need this section ?
            //
        };
        
    };
    
    // change radii to diameter
    df=df*2.0;
    di=di*2.0;
    maxdi=maxdi*2.0;
    
    pair <double, pair<double,double> > resultdidfdif;
    resultdidfdif.first=maxdi;
    resultdidfdif.second.first=df;
    resultdidfdif.second.second=di;
    
    return resultdidfdif;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x2f0, %rsp            # imm = 0x2F0
movq %rdi, -0x170(%rbp)
movq %rdi, -0x168(%rbp)
leaq 0x10(%rbp), %rax
movq %rax, -0x160(%rbp)
movq %rsi, -0x8(%rbp)
movl %edx, -0xc(%rbp)
movq -0x8(%rbp), %rsi
movq %rsi, -0x158(%rbp)
movl $0x1, -0x10(%rbp)
movl $0xffffffff, -0x14(%rbp) # imm = 0xFFFFFFFF
addq $0x60, %rsi
leaq -0x30(%rbp), %rdi
movq %rdi, -0x150(%rbp)
callq 0x67230
movq -0x150(%rbp), %rdi
callq 0x10100
movq %rax, -0x148(%rbp)
leaq -0x54(%rbp), %rdi
xorl %ecx, %ecx
movl %ecx, %esi
movl %ecx, %edx
callq 0x94010
jmp 0xca24c
leaq -0x65(%rbp), %rdi
movq %rdi, -0x178(%rbp)
callq 0x65af0
movq -0x148(%rbp), %rsi
movq -0x178(%rbp), %rcx
leaq -0x48(%rbp), %rdi
leaq -0x54(%rbp), %rdx
callq 0xce390
jmp 0xca279
leaq -0x65(%rbp), %rdi
callq 0x14e70
leaq -0x30(%rbp), %rdi
callq 0x10100
movq %rax, -0x188(%rbp)
leaq -0x81(%rbp), %rdi
movq %rdi, -0x180(%rbp)
callq 0x10960
movq -0x188(%rbp), %rsi
movq -0x180(%rbp), %rcx
leaq -0x80(%rbp), %rdi
leaq -0x14(%rbp), %rdx
callq 0x65a70
jmp 0xca2c2
leaq -0x81(%rbp), %rdi
callq 0x13030
movl $0x0, -0x88(%rbp)
movslq -0xc(%rbp), %rsi
leaq -0x30(%rbp), %rdi
callq 0x10130
movq %rax, -0x190(%rbp)
jmp 0xca2ee
movq -0x160(%rbp), %rax
movq -0x190(%rbp), %rcx
movsd 0x38(%rcx), %xmm0
addsd %xmm0, %xmm0
movsd %xmm0, (%rax)
movslq -0xc(%rbp), %rsi
leaq -0x30(%rbp), %rdi
callq 0x10130
movq %rax, -0x198(%rbp)
jmp 0xca31f
movq -0x160(%rbp), %rax
movq -0x198(%rbp), %rcx
movsd 0x38(%rcx), %xmm1
movsd 0x8(%rax), %xmm0
movsd 0x127d09(%rip), %xmm2   # 0x1f2048
divsd %xmm2, %xmm0
ucomisd %xmm1, %xmm0
jbe 0xca3d9
movq -0x170(%rbp), %rax
movq -0x160(%rbp), %rcx
movq (%rcx), %rdx
movq %rdx, (%rax)
movq 0x8(%rcx), %rdx
movq %rdx, 0x8(%rax)
movq 0x10(%rcx), %rcx
movq %rcx, 0x10(%rax)
movl $0x1, -0xa4(%rbp)
jmp 0xcae5b
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x60(%rbp)
movl %eax, -0x64(%rbp)
jmp 0xcae98
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x60(%rbp)
movl %eax, -0x64(%rbp)
leaq -0x65(%rbp), %rdi
callq 0x14e70
jmp 0xcae98
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x60(%rbp)
movl %eax, -0x64(%rbp)
leaq -0x81(%rbp), %rdi
callq 0x13030
jmp 0xcae8f
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x60(%rbp)
movl %eax, -0x64(%rbp)
jmp 0xcae86
movl -0xc(%rbp), %eax
movl %eax, -0x88(%rbp)
movl -0x88(%rbp), %eax
movl %eax, %esi
leaq -0x30(%rbp), %rdi
callq 0x10130
movq %rax, -0x1a0(%rbp)
jmp 0xca3fc
movq -0x1a0(%rbp), %rax
movsd 0x38(%rax), %xmm0
movsd %xmm0, -0x90(%rbp)
movl -0x88(%rbp), %eax
movl %eax, %esi
leaq -0x30(%rbp), %rdi
callq 0x10130
movq %rax, -0x1a8(%rbp)
jmp 0xca42a
movq -0x1a8(%rbp), %rax
movsd 0x38(%rax), %xmm0
movsd %xmm0, -0x98(%rbp)
movl -0x88(%rbp), %eax
movl %eax, %esi
leaq -0x30(%rbp), %rdi
callq 0x10130
movq %rax, -0x1b0(%rbp)
jmp 0xca458
movq -0x1b0(%rbp), %rax
movsd 0x38(%rax), %xmm0
movsd %xmm0, -0xa0(%rbp)
movl -0x88(%rbp), %eax
movl %eax, %esi
leaq -0x80(%rbp), %rdi
callq 0xed60
movl $0x1, (%rax)
leaq -0xb0(%rbp), %rdi
xorl %ecx, %ecx
movl %ecx, %esi
movl %ecx, %edx
callq 0x94010
jmp 0xca497
movl -0x88(%rbp), %eax
movl %eax, %esi
leaq -0x48(%rbp), %rdi
callq 0x658f0
movl -0xa8(%rbp), %ecx
movl %ecx, 0x8(%rax)
movq -0xb0(%rbp), %rcx
movq %rcx, (%rax)
leaq -0x30(%rbp), %rax
movq %rax, 0x1a937a(%rip)    # 0x273840
leaq 0x9e3(%rip), %rsi       # 0xcaeb0
leaq -0xd0(%rbp), %rdi
callq 0xce410
jmp 0xca4db
movl $0x0, -0xd4(%rbp)
movl -0xd4(%rbp), %eax
movq %rax, -0x1b8(%rbp)
movl -0x88(%rbp), %eax
movl %eax, %esi
leaq -0x30(%rbp), %rdi
callq 0x2a4c0
movq %rax, %rdi
addq $0x20, %rdi
callq 0x2a9e0
movq %rax, %rcx
movq -0x1b8(%rbp), %rax
cmpq %rcx, %rax
jae 0xca6d0
movl -0x88(%rbp), %eax
movl %eax, %esi
leaq -0x30(%rbp), %rdi
callq 0x2a4c0
movq %rax, %rdi
addq $0x20, %rdi
movl -0xd4(%rbp), %eax
movl %eax, %esi
callq 0x64470
movq %rax, -0x1c0(%rbp)
jmp 0xca550
movq -0x1c0(%rbp), %rax
movsd 0x10(%rax), %xmm0
movsd %xmm0, -0x1d0(%rbp)
movl -0x88(%rbp), %eax
movl %eax, %esi
leaq -0x30(%rbp), %rdi
callq 0x2a4c0
movq %rax, %rdi
addq $0x20, %rdi
movl -0xd4(%rbp), %eax
movl %eax, %esi
callq 0x64470
movq %rax, -0x1c8(%rbp)
jmp 0xca592
movq -0x1c8(%rbp), %rax
movslq 0x4(%rax), %rsi
leaq -0x30(%rbp), %rdi
callq 0x10130
movq %rax, -0x1d8(%rbp)
jmp 0xca5af
movsd -0x1d0(%rbp), %xmm0
movq -0x1d8(%rbp), %rax
ucomisd 0x38(%rax), %xmm0
jbe 0xca689
movl -0x88(%rbp), %eax
movl %eax, %esi
leaq -0x30(%rbp), %rdi
callq 0x2a4c0
movq %rax, %rdi
addq $0x20, %rdi
movl -0xd4(%rbp), %eax
movl %eax, %esi
callq 0x64470
movq %rax, -0x1e0(%rbp)
jmp 0xca5f7
movq -0x1e0(%rbp), %rax
movslq 0x4(%rax), %rsi
leaq -0x30(%rbp), %rdi
callq 0x10130
movq %rax, -0x1e8(%rbp)
jmp 0xca614
movq -0x1e8(%rbp), %rax
movsd 0x38(%rax), %xmm0
movsd %xmm0, -0x1f8(%rbp)
movl -0x88(%rbp), %eax
movl %eax, %esi
leaq -0x30(%rbp), %rdi
callq 0x2a4c0
movq %rax, %rdi
addq $0x20, %rdi
movl -0xd4(%rbp), %eax
movl %eax, %esi
callq 0x64470
movq %rax, -0x1f0(%rbp)
jmp 0xca656
movq -0x1f0(%rbp), %rax
movsd -0x1f8(%rbp), %xmm0
movsd %xmm0, 0x10(%rax)
jmp 0xca689
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x60(%rbp)
movl %eax, -0x64(%rbp)
leaq -0xd0(%rbp), %rdi
callq 0xce5b0
jmp 0xcae86
leaq -0xdc(%rbp), %rdi
leaq -0x88(%rbp), %rsi
leaq -0xd4(%rbp), %rdx
callq 0x103a0
jmp 0xca6a5
movq -0xdc(%rbp), %rsi
leaq -0xd0(%rbp), %rdi
callq 0xce470
jmp 0xca6ba
jmp 0xca6bc
movl -0xd4(%rbp), %eax
addl $0x1, %eax
movl %eax, -0xd4(%rbp)
jmp 0xca4e5
leaq -0xd0(%rbp), %rdi
callq 0xce4d0
jmp 0xca6de
movb $0x1, -0xdd(%rbp)
leaq -0xd0(%rbp), %rdi
callq 0xce520
movl %eax, -0x1fc(%rbp)
jmp 0xca6f9
movl -0x1fc(%rbp), %ecx
xorl %eax, %eax
cmpl $0x0, %ecx
movb %al, -0x1fd(%rbp)
je 0xca718
movb -0xdd(%rbp), %al
movb %al, -0x1fd(%rbp)
movb -0x1fd(%rbp), %al
testb $0x1, %al
jne 0xca727
jmp 0xcadce
leaq -0xd0(%rbp), %rdi
callq 0xce540
movq %rax, -0x208(%rbp)
jmp 0xca73c
movq -0x208(%rbp), %rax
movq %rax, -0xe8(%rbp)
movslq -0xe8(%rbp), %rsi
leaq -0x30(%rbp), %rdi
callq 0x2a4c0
movq %rax, %rdi
addq $0x20, %rdi
movslq -0xe4(%rbp), %rsi
callq 0x69220
movl 0x4(%rax), %eax
movl %eax, -0xec(%rbp)
movslq -0xec(%rbp), %rsi
leaq -0x80(%rbp), %rdi
callq 0xed60
cmpl $-0x1, (%rax)
jne 0xcabf8
movslq -0xe8(%rbp), %rsi
leaq -0x30(%rbp), %rdi
callq 0x2a4c0
movq %rax, %rdi
addq $0x20, %rdi
movslq -0xe4(%rbp), %rsi
callq 0x64470
movq %rax, -0x210(%rbp)
jmp 0xca7bb
movq -0x210(%rbp), %rax
movsd 0x10(%rax), %xmm1
movsd -0xa0(%rbp), %xmm0
ucomisd %xmm1, %xmm0
jbe 0xca815
movslq -0xe8(%rbp), %rsi
leaq -0x30(%rbp), %rdi
callq 0x2a4c0
movq %rax, %rdi
addq $0x20, %rdi
movslq -0xe4(%rbp), %rsi
callq 0x64470
movq %rax, -0x218(%rbp)
jmp 0xca801
movq -0x218(%rbp), %rax
movsd 0x10(%rax), %xmm0
movsd %xmm0, -0xa0(%rbp)
movslq -0xec(%rbp), %rsi
leaq -0x30(%rbp), %rdi
callq 0x10130
movq %rax, -0x220(%rbp)
jmp 0xca82e
movq -0x220(%rbp), %rax
movsd 0x38(%rax), %xmm0
ucomisd -0x98(%rbp), %xmm0
jbe 0xca871
movslq -0xec(%rbp), %rsi
leaq -0x30(%rbp), %rdi
callq 0x10130
movq %rax, -0x228(%rbp)
jmp 0xca85d
movq -0x228(%rbp), %rax
movsd 0x38(%rax), %xmm0
movsd %xmm0, -0x98(%rbp)
movq -0x160(%rbp), %rax
movsd 0x1277c8(%rip), %xmm1   # 0x1f2048
mulsd -0xa0(%rbp), %xmm1
movsd 0x8(%rax), %xmm0
ucomisd %xmm1, %xmm0
jbe 0xca8c6
movq -0x170(%rbp), %rax
movq -0x160(%rbp), %rcx
movq (%rcx), %rdx
movq %rdx, (%rax)
movq 0x8(%rcx), %rdx
movq %rdx, 0x8(%rax)
movq 0x10(%rcx), %rcx
movq %rcx, 0x10(%rax)
movl $0x1, -0xa4(%rbp)
jmp 0xcae4f
movslq -0xec(%rbp), %rsi
leaq -0x80(%rbp), %rdi
callq 0xed60
movl $0x1, (%rax)
movslq -0xe8(%rbp), %rsi
leaq -0x48(%rbp), %rdi
movq %rdi, -0x240(%rbp)
callq 0x658f0
movq -0x240(%rbp), %rdi
movq %rax, -0x248(%rbp)
movslq -0xec(%rbp), %rsi
callq 0x658f0
movq -0x248(%rbp), %rcx
movq -0x240(%rbp), %rdi
movl 0x8(%rcx), %edx
movl %edx, 0x8(%rax)
movq (%rcx), %rcx
movq %rcx, (%rax)
movslq -0xec(%rbp), %rsi
callq 0x658f0
movq %rax, -0x238(%rbp)
movslq -0xe8(%rbp), %rsi
leaq -0x30(%rbp), %rdi
callq 0x2a4c0
movq %rax, %rdi
addq $0x20, %rdi
movslq -0xe4(%rbp), %rsi
callq 0x64470
movq %rax, -0x230(%rbp)
jmp 0xca966
movq -0x238(%rbp), %rdi
movq -0x230(%rbp), %rsi
addq $0x18, %rsi
callq 0x94150
movl %edx, -0x254(%rbp)
movq %rax, -0x250(%rbp)
jmp 0xca98c
movl -0x254(%rbp), %eax
movq -0x250(%rbp), %rcx
movq %rcx, -0x108(%rbp)
movl %eax, -0x100(%rbp)
movq -0x108(%rbp), %rax
movq %rax, -0xf8(%rbp)
movl -0x100(%rbp), %eax
movl %eax, -0xf0(%rbp)
movslq -0xec(%rbp), %rsi
leaq -0x48(%rbp), %rdi
callq 0x658f0
movq -0xf8(%rbp), %rcx
movq %rcx, (%rax)
movl -0xf0(%rbp), %ecx
movl %ecx, 0x8(%rax)
movl $0x0, -0x10c(%rbp)
movl -0x10c(%rbp), %eax
movq %rax, -0x260(%rbp)
movslq -0xec(%rbp), %rsi
leaq -0x30(%rbp), %rdi
callq 0x2a4c0
movq %rax, %rdi
addq $0x20, %rdi
callq 0x2a9e0
movq %rax, %rcx
movq -0x260(%rbp), %rax
cmpq %rcx, %rax
jae 0xcabe5
movslq -0xec(%rbp), %rsi
leaq -0x30(%rbp), %rdi
callq 0x2a4c0
movq %rax, %rdi
addq $0x20, %rdi
movl -0x10c(%rbp), %eax
movl %eax, %esi
callq 0x64470
movq %rax, -0x268(%rbp)
jmp 0xcaa56
movq -0x268(%rbp), %rax
movsd 0x10(%rax), %xmm0
movsd %xmm0, -0x278(%rbp)
movslq -0xec(%rbp), %rsi
leaq -0x30(%rbp), %rdi
callq 0x2a4c0
movq %rax, %rdi
addq $0x20, %rdi
movl -0x10c(%rbp), %eax
movl %eax, %esi
callq 0x64470
movq %rax, -0x270(%rbp)
jmp 0xcaa97
movq -0x270(%rbp), %rax
movslq 0x4(%rax), %rsi
leaq -0x30(%rbp), %rdi
callq 0x10130
movq %rax, -0x280(%rbp)
jmp 0xcaab4
movsd -0x278(%rbp), %xmm0
movq -0x280(%rbp), %rax
ucomisd 0x38(%rax), %xmm0
jbe 0xcab6d
movslq -0xec(%rbp), %rsi
leaq -0x30(%rbp), %rdi
callq 0x2a4c0
movq %rax, %rdi
addq $0x20, %rdi
movl -0x10c(%rbp), %eax
movl %eax, %esi
callq 0x64470
movq %rax, -0x288(%rbp)
jmp 0xcaafb
movq -0x288(%rbp), %rax
movslq 0x4(%rax), %rsi
leaq -0x30(%rbp), %rdi
callq 0x10130
movq %rax, -0x290(%rbp)
jmp 0xcab18
movq -0x290(%rbp), %rax
movsd 0x38(%rax), %xmm0
movsd %xmm0, -0x2a0(%rbp)
movslq -0xec(%rbp), %rsi
leaq -0x30(%rbp), %rdi
callq 0x2a4c0
movq %rax, %rdi
addq $0x20, %rdi
movl -0x10c(%rbp), %eax
movl %eax, %esi
callq 0x64470
movq %rax, -0x298(%rbp)
jmp 0xcab59
movq -0x298(%rbp), %rax
movsd -0x2a0(%rbp), %xmm0
movsd %xmm0, 0x10(%rax)
movslq -0xec(%rbp), %rsi
leaq -0x30(%rbp), %rdi
callq 0x2a4c0
movq %rax, %rdi
addq $0x20, %rdi
movl -0x10c(%rbp), %eax
movl %eax, %esi
callq 0x69220
movl 0x4(%rax), %eax
cmpl -0xe8(%rbp), %eax
je 0xcabcf
leaq -0x114(%rbp), %rdi
leaq -0xec(%rbp), %rsi
leaq -0x10c(%rbp), %rdx
callq 0xcd170
jmp 0xcabb8
movq -0x114(%rbp), %rsi
leaq -0xd0(%rbp), %rdi
callq 0xce470
jmp 0xcabcd
jmp 0xcabcf
jmp 0xcabd1
movl -0x10c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x10c(%rbp)
jmp 0xca9ed
leaq -0xd0(%rbp), %rdi
callq 0xce4d0
jmp 0xcabf3
jmp 0xcadc9
movslq -0xec(%rbp), %rsi
leaq -0x80(%rbp), %rdi
callq 0xed60
cmpl $0x1, (%rax)
jne 0xcadc5
movslq -0xec(%rbp), %rsi
leaq -0x48(%rbp), %rdi
movq %rdi, -0x2c0(%rbp)
callq 0x658f0
movq -0x2c0(%rbp), %rdi
movq %rax, -0x2b8(%rbp)
movslq -0xe8(%rbp), %rsi
callq 0x658f0
movq %rax, -0x2b0(%rbp)
movslq -0xe8(%rbp), %rsi
leaq -0x30(%rbp), %rdi
callq 0x2a4c0
movq %rax, %rdi
addq $0x20, %rdi
movslq -0xe4(%rbp), %rsi
callq 0x64470
movq %rax, -0x2a8(%rbp)
jmp 0xcac75
movq -0x2b0(%rbp), %rdi
movq -0x2a8(%rbp), %rsi
addq $0x18, %rsi
callq 0x94150
movl %edx, -0x2cc(%rbp)
movq %rax, -0x2c8(%rbp)
jmp 0xcac9b
movq -0x2b8(%rbp), %rdi
movl -0x2cc(%rbp), %eax
movq -0x2c8(%rbp), %rcx
movq %rcx, -0x130(%rbp)
movl %eax, -0x128(%rbp)
movl -0x128(%rbp), %eax
movl %eax, -0x118(%rbp)
movq -0x130(%rbp), %rax
movq %rax, -0x120(%rbp)
movl -0x118(%rbp), %eax
movl %eax, -0x138(%rbp)
movq -0x120(%rbp), %rax
movq %rax, -0x140(%rbp)
movq -0x140(%rbp), %rsi
movl -0x138(%rbp), %edx
callq 0x94040
movb %al, -0x2cd(%rbp)
jmp 0xcad0a
movb -0x2cd(%rbp), %al
testb $0x1, %al
jne 0xcadc3
jmp 0xcad1a
movq -0x158(%rbp), %rdi
movsd -0xa0(%rbp), %xmm0
movsd %xmm0, -0x2e0(%rbp)
addq $0x60, %rdi
movslq -0xe8(%rbp), %rsi
callq 0x2a4c0
movq %rax, %rdi
addq $0x20, %rdi
movslq -0xe4(%rbp), %rsi
callq 0x64470
movq %rax, -0x2d8(%rbp)
jmp 0xcad5d
movsd -0x2e0(%rbp), %xmm0
movq -0x2d8(%rbp), %rax
ucomisd 0x10(%rax), %xmm0
jbe 0xcadba
movq -0x158(%rbp), %rdi
addq $0x60, %rdi
movslq -0xe8(%rbp), %rsi
callq 0x2a4c0
movq %rax, %rdi
addq $0x20, %rdi
movslq -0xe4(%rbp), %rsi
callq 0x64470
movq %rax, -0x2e8(%rbp)
jmp 0xcada6
movq -0x2e8(%rbp), %rax
movsd 0x10(%rax), %xmm0
movsd %xmm0, -0xa0(%rbp)
movb $0x0, -0xdd(%rbp)
jmp 0xcadce
jmp 0xcadc7
jmp 0xcadc7
jmp 0xcadc9
jmp 0xca6e5
movq -0x170(%rbp), %rdi
movsd -0xa0(%rbp), %xmm0
addsd %xmm0, %xmm0
movsd %xmm0, -0xa0(%rbp)
movsd -0x98(%rbp), %xmm0
addsd %xmm0, %xmm0
movsd %xmm0, -0x98(%rbp)
movsd -0x90(%rbp), %xmm0
addsd %xmm0, %xmm0
movsd %xmm0, -0x90(%rbp)
callq 0xce2f0
jmp 0xcae18
movq -0x170(%rbp), %rax
movsd -0x90(%rbp), %xmm0
movsd %xmm0, (%rax)
movsd -0xa0(%rbp), %xmm0
movsd %xmm0, 0x8(%rax)
movsd -0x98(%rbp), %xmm0
movsd %xmm0, 0x10(%rax)
movl $0x1, -0xa4(%rbp)
leaq -0xd0(%rbp), %rdi
callq 0xce5b0
leaq -0x80(%rbp), %rdi
callq 0xec80
leaq -0x48(%rbp), %rdi
callq 0x14c80
leaq -0x30(%rbp), %rdi
callq 0x10e40
movq -0x168(%rbp), %rax
addq $0x2f0, %rsp            # imm = 0x2F0
popq %rbp
retq
leaq -0x80(%rbp), %rdi
callq 0xec80
leaq -0x48(%rbp), %rdi
callq 0x14c80
leaq -0x30(%rbp), %rdi
callq 0x10e40
movq -0x60(%rbp), %rdi
callq 0x58f0
nopw (%rax,%rax)