// File: /workspace/github_cpp_makefile_star2_O1/Luthaf[P]zeopp/channel.cc
// Function: PORE::PORE(std::vector<int, std::allocator<int>>, DIJKSTRA_NETWORK*, int, int (*) [3])
PORE::PORE(vector<int> nodeIDs, DIJKSTRA_NETWORK *dnet, int dim, int basisVecs[3][3]){
    idMappings = map<int,int> ();
    reverseIDMappings = map<int,int> ();
    nodes = vector<DIJKSTRA_NODE> ();
    connections = vector<CONN> ();
    
    // Reindex the nodes to facilitate storage
    for(unsigned int i = 0; i < nodeIDs.size(); i++){
        idMappings.insert(pair<int,int>(nodeIDs.at(i),i));
        reverseIDMappings.insert(pair<int,int>(i,nodeIDs.at(i)));
    }
    
    // Iterate over all nodes in list
    for(unsigned int i = 0; i < nodeIDs.size(); i++){
        DIJKSTRA_NODE oldNode = dnet->nodes.at(nodeIDs.at(i));
        DIJKSTRA_NODE newNode = DIJKSTRA_NODE(i, oldNode.x, oldNode.y, oldNode.z, oldNode.max_radius);
        
        // Include connection only if end node is in pore
        // Reindex connection start and end ids
        for(unsigned int j = 0; j < oldNode.connections.size(); j++){
            CONN oldConn = oldNode.connections.at(j);
            map<int,int>::iterator id1Iter = idMappings.find(oldConn.from);
            map<int,int>::iterator id2Iter = idMappings.find(oldConn.to);
            if(id2Iter != idMappings.end()){
                CONN newConn = CONN(id1Iter->second,id2Iter->second,oldConn.length,oldConn.max_radius,oldConn.deltaPos);
                newNode.connections.push_back(newConn);
                connections.push_back(newConn);
            }
        }
        nodes.push_back(newNode);
    }
    
    basis[0][0] = basisVecs[0][0];  basis[0][1] = basisVecs[0][1];  basis[0][2] = basisVecs[0][2];
    basis[1][0] = basisVecs[1][0];  basis[1][1] = basisVecs[1][1];  basis[1][2] = basisVecs[1][2];
    basis[2][0] = basisVecs[2][0];  basis[2][1] = basisVecs[2][1];  basis[2][2] = basisVecs[2][2];
    dimensionality = dim;
    
    // Store unit cell vectors
    v_a = dnet->v_a;
    v_b = dnet->v_b;
    v_c = dnet->v_c;
    reconstruct();    // Reconstruct pore
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x118, %rsp            # imm = 0x118
movq %r8, 0x98(%rsp)
movl %ecx, 0x64(%rsp)
movq %rdx, 0x70(%rsp)
movq %rsi, %rbp
movq %rdi, %rbx
leaq 0x8(%rdi), %r12
xorl %eax, %eax
movl %eax, 0x8(%rdi)
movq %rax, 0x10(%rdi)
movq %r12, 0x18(%rdi)
movq %r12, 0x20(%rdi)
movq %rax, 0x28(%rdi)
leaq 0x30(%rdi), %rcx
movq %rcx, 0x50(%rsp)
leaq 0x38(%rdi), %r15
movl %eax, 0x38(%rdi)
movq %rax, 0x40(%rdi)
movq %r15, 0x48(%rdi)
movq %r15, 0x50(%rdi)
leaq 0x60(%rdi), %rcx
movq %rcx, 0x68(%rsp)
leaq 0x78(%rdi), %rcx
movq %rcx, 0x58(%rsp)
leaq 0xc0(%rdi), %rdi
xorps %xmm0, %xmm0
movups %xmm0, 0x58(%rbx)
movups %xmm0, 0x68(%rbx)
movups %xmm0, 0x78(%rbx)
movups %xmm0, 0x88(%rbx)
movups %xmm0, 0x98(%rbx)
movups %xmm0, 0xa8(%rbx)
movq %rax, 0xb8(%rbx)
xorps %xmm0, %xmm0
xorps %xmm1, %xmm1
xorps %xmm2, %xmm2
movq %rdi, 0x90(%rsp)
callq 0x85982
leaq 0xd8(%rbx), %rdi
xorps %xmm0, %xmm0
xorps %xmm1, %xmm1
xorps %xmm2, %xmm2
movq %rdi, 0x88(%rsp)
callq 0x85982
leaq 0xf0(%rbx), %rdi
xorps %xmm0, %xmm0
xorps %xmm1, %xmm1
xorps %xmm2, %xmm2
movq %rdi, 0x80(%rsp)
callq 0x85982
leaq 0x8(%rsp), %r13
xorps %xmm0, %xmm0
movaps %xmm0, 0x8(%r13)
movaps %xmm0, 0x18(%r13)
movaps %xmm0, -0x8(%r13)
movq %r13, 0x10(%r13)
movq %r13, 0x18(%r13)
movq $0x0, 0x20(%r13)
movq %rbx, %rdi
callq 0x116a8
movq 0x8(%r13), %rax
testq %rax, %rax
je 0x6fb9d
movl 0x8(%rsp), %ecx
movl %ecx, 0x8(%rbx)
movq %rax, 0x10(%rbx)
movq 0x18(%rsp), %rcx
movq %rcx, 0x18(%rbx)
movq 0x20(%rsp), %rcx
movq %rcx, 0x20(%rbx)
movq %r12, 0x8(%rax)
movq 0x28(%rsp), %rax
movq %rax, 0x28(%rbx)
xorl %eax, %eax
movq %rax, 0x10(%rsp)
movq %r13, 0x18(%rsp)
movq %r13, 0x20(%rsp)
movq %rax, 0x28(%rsp)
movq %rsp, %r14
movq %r14, %rdi
callq 0xf118
xorps %xmm0, %xmm0
movaps %xmm0, 0x10(%r14)
movaps %xmm0, 0x20(%r14)
movaps %xmm0, (%r14)
movq %r13, 0x18(%r14)
movq %r13, 0x20(%r14)
movq $0x0, 0x28(%r14)
movq 0x50(%rsp), %rdi
callq 0x116a8
movq 0x10(%r14), %rax
testq %rax, %rax
je 0x6fc1c
movl 0x8(%rsp), %ecx
movl %ecx, 0x38(%rbx)
movq %rax, 0x40(%rbx)
movq 0x18(%rsp), %rcx
movq %rcx, 0x48(%rbx)
movq 0x20(%rsp), %rcx
movq %rcx, 0x50(%rbx)
movq %r15, 0x8(%rax)
movq 0x28(%rsp), %rax
movq %rax, 0x58(%rbx)
xorl %eax, %eax
movq %rax, 0x10(%rsp)
movq %r13, 0x18(%rsp)
movq %r13, 0x20(%rsp)
movq %rax, 0x28(%rsp)
movq %rsp, %r14
movq %r14, %rdi
callq 0xf118
xorl %r13d, %r13d
leaq 0xd0(%rsp), %r15
movq %r13, 0x10(%r15)
xorps %xmm0, %xmm0
movaps %xmm0, (%r15)
movq %r13, 0x10(%r14)
movaps %xmm0, (%r14)
movq 0x60(%rbx), %rax
movups 0x68(%rbx), %xmm0
movq (%r15), %rcx
movq %rcx, 0x60(%rbx)
movq 0x8(%r15), %rcx
movq %rcx, 0x68(%rbx)
movq 0x10(%r15), %rcx
movq %rcx, 0x70(%rbx)
movq (%r14), %rcx
movq 0x8(%r14), %rdx
movq 0x10(%r14), %rsi
movq %rax, (%r14)
movups %xmm0, 0x8(%r14)
movq %rcx, (%r15)
movq %rdx, 0x8(%r15)
movq %rsi, 0x10(%r15)
movq %rsp, %r14
movq %r14, %rdi
callq 0xf07c
movq %r15, %rdi
callq 0xf07c
movq %r13, 0x10(%r14)
xorps %xmm0, %xmm0
movaps %xmm0, (%r14)
movq %rsp, %r14
movq 0x58(%rsp), %rdi
movq %r14, %rsi
callq 0x3a704
movq (%r14), %rdi
testq %rdi, %rdi
je 0x6fcc5
movq 0x10(%rsp), %rsi
subq %rdi, %rsi
callq 0x4470
movq (%rbp), %rax
cmpq %rax, 0x8(%rbp)
je 0x6fd34
xorl %r14d, %r14d
movq %rsp, %r15
movl (%rax,%r14,4), %eax
movl %eax, (%rsp)
movl %r14d, 0x4(%rsp)
movq %rbx, %rdi
movq %r15, %rsi
callq 0x13690
movq (%rbp), %rax
movq 0x8(%rbp), %rdx
subq %rax, %rdx
sarq $0x2, %rdx
cmpq %r14, %rdx
jbe 0x700c2
movl %r14d, (%rsp)
movl (%rax,%r14,4), %eax
movl %eax, 0x4(%rsp)
movq 0x50(%rsp), %rdi
movq %r15, %rsi
callq 0x13690
incl %r14d
movq (%rbp), %rax
movq 0x8(%rbp), %rcx
subq %rax, %rcx
sarq $0x2, %rcx
cmpq %r14, %rcx
ja 0x6fcd5
movq (%rbp), %rax
cmpq %rax, 0x8(%rbp)
je 0x6fffc
leaq 0x20(%rsp), %r13
xorl %edx, %edx
leaq 0xa8(%rsp), %r15
movq %rbp, 0xa0(%rsp)
movq %rdx, 0x78(%rsp)
movslq (%rax,%rdx,4), %rsi
movq 0x70(%rsp), %rax
movq (%rax), %rbp
movq 0x8(%rax), %rdx
subq %rbp, %rdx
sarq $0x3, %rdx
movabsq $-0x71c71c71c71c71c7, %rax # imm = 0x8E38E38E38E38E39
imulq %rax, %rdx
cmpq %rsi, %rdx
jbe 0x700d3
leaq (%rsi,%rsi,8), %r14
leaq 0x20(,%r14,8), %rsi
addq %rbp, %rsi
movups -0x20(%rsi), %xmm0
movups -0x10(%rsi), %xmm1
movaps %xmm1, 0x10(%rsp)
movaps %xmm0, (%rsp)
movq %r13, %rdi
callq 0x38318
leaq (,%r14,8), %rax
addq %rbp, %rax
movb 0x40(%rax), %cl
movb %cl, 0x20(%r13)
movq 0x38(%rax), %rax
movq %r13, %r14
movq %rax, 0x18(%r13)
movsd 0x8(%rsp), %xmm0
movsd 0x10(%rsp), %xmm1
movsd 0x18(%rsp), %xmm2
movsd 0x38(%rsp), %xmm3
leaq 0xd0(%rsp), %rdi
movq 0x78(%rsp), %rsi
movl $0x1, %edx
callq 0x50c7c
movq 0x20(%rsp), %rax
cmpq %rax, 0x28(%rsp)
leaq 0xf0(%rsp), %r13
je 0x6ff8c
xorl %ebp, %ebp
leaq (,%rbp,4), %rdx
addq %rbp, %rdx
movl (%rax,%rdx,8), %edi
movq 0x10(%rbx), %rcx
movq %r12, %r8
testq %rcx, %rcx
je 0x6fe52
movq %rcx, %rsi
movq %r12, %r8
xorl %r9d, %r9d
cmpl %edi, 0x20(%rsi)
setl %r9b
cmovgeq %rsi, %r8
movq 0x10(%rsi,%r9,8), %rsi
testq %rsi, %rsi
jne 0x6fe3a
movq %r12, %rsi
cmpq %r12, %r8
je 0x6fe65
cmpl 0x20(%r8), %edi
cmovlq %r12, %r8
movq %r8, %rsi
movl 0x4(%rax,%rdx,8), %edi
movq %r12, %r8
testq %rcx, %rcx
je 0x6fe8c
movq %r12, %r8
xorl %r9d, %r9d
cmpl %edi, 0x20(%rcx)
setl %r9b
cmovgeq %rcx, %r8
movq 0x10(%rcx,%r9,8), %rcx
testq %rcx, %rcx
jne 0x6fe74
movq %r12, %r9
cmpq %r12, %r8
je 0x6fe9f
cmpl 0x20(%r8), %edi
cmovlq %r12, %r8
movq %r8, %r9
cmpq %r12, %r9
je 0x6ff62
movsd 0x8(%rax,%rdx,8), %xmm0
movsd 0x10(%rax,%rdx,8), %xmm1
movq 0x18(%rax,%rdx,8), %rcx
movl 0x20(%rax,%rdx,8), %r8d
movl 0x24(%rsi), %esi
movl 0x24(%r9), %edx
movq %r15, %rdi
callq 0x50b50
movq 0xf8(%rsp), %rsi
cmpq 0x100(%rsp), %rsi
je 0x6ff0d
movq 0xc8(%rsp), %rax
movq %rax, 0x20(%rsi)
movups 0xa8(%rsp), %xmm0
movups 0xb8(%rsp), %xmm1
movups %xmm1, 0x10(%rsi)
movups %xmm0, (%rsi)
addq $0x28, 0xf8(%rsp)
jmp 0x6ff18
movq %r13, %rdi
movq %r15, %rdx
callq 0x396ae
movq 0x80(%rbx), %rsi
cmpq 0x88(%rbx), %rsi
je 0x6ff55
movq 0xc8(%rsp), %rax
movq %rax, 0x20(%rsi)
movups 0xa8(%rsp), %xmm0
movups 0xb8(%rsp), %xmm1
movups %xmm1, 0x10(%rsi)
movups %xmm0, (%rsi)
addq $0x28, 0x80(%rbx)
jmp 0x6ff62
movq 0x58(%rsp), %rdi
movq %r15, %rdx
callq 0x396ae
incl %ebp
movq 0x20(%rsp), %rax
movq 0x28(%rsp), %rcx
subq %rax, %rcx
sarq $0x3, %rcx
movabsq $-0x3333333333333333, %rdx # imm = 0xCCCCCCCCCCCCCCCD
imulq %rdx, %rcx
cmpq %rbp, %rcx
ja 0x6fe1a
movq 0x68(%rsp), %rdi
leaq 0xd0(%rsp), %rsi
callq 0x51244
movq 0xf0(%rsp), %rdi
testq %rdi, %rdi
movq 0xa0(%rsp), %rbp
je 0x6ffc3
movq 0x100(%rsp), %rsi
subq %rdi, %rsi
callq 0x4470
movq 0x20(%rsp), %rdi
testq %rdi, %rdi
je 0x6ffda
movq 0x30(%rsp), %rsi
subq %rdi, %rsi
callq 0x4470
movq 0x78(%rsp), %rdx
incl %edx
movq (%rbp), %rax
movq 0x8(%rbp), %rcx
subq %rax, %rcx
sarq $0x2, %rcx
cmpq %rdx, %rcx
movq %r14, %r13
ja 0x6fd59
movq 0x98(%rsp), %rcx
movl (%rcx), %eax
movl %eax, 0x10c(%rbx)
movl 0x4(%rcx), %eax
movl %eax, 0x110(%rbx)
movl 0x8(%rcx), %eax
movl %eax, 0x114(%rbx)
movl 0xc(%rcx), %eax
movl %eax, 0x118(%rbx)
movl 0x10(%rcx), %eax
movl %eax, 0x11c(%rbx)
movl 0x14(%rcx), %eax
movl %eax, 0x120(%rbx)
movl 0x18(%rcx), %eax
movl %eax, 0x124(%rbx)
movl 0x1c(%rcx), %eax
movl %eax, 0x128(%rbx)
movl 0x20(%rcx), %eax
movl %eax, 0x12c(%rbx)
movl 0x64(%rsp), %eax
movl %eax, 0x108(%rbx)
movq 0x70(%rsp), %rcx
movq 0x28(%rcx), %rax
movq 0x90(%rsp), %rdx
movq %rax, 0x10(%rdx)
movups 0x18(%rcx), %xmm0
movups %xmm0, (%rdx)
movq 0x40(%rcx), %rax
movq 0x88(%rsp), %rdx
movq %rax, 0x10(%rdx)
movups 0x30(%rcx), %xmm0
movups %xmm0, (%rdx)
movq 0x58(%rcx), %rax
movq 0x80(%rsp), %rdx
movq %rax, 0x10(%rdx)
movups 0x48(%rcx), %xmm0
movups %xmm0, (%rdx)
movq %rbx, %rdi
callq 0x70196
addq $0x118, %rsp            # imm = 0x118
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0xdf5dc(%rip), %rdi     # 0x14f6a5
movq %r14, %rsi
xorl %eax, %eax
callq 0x4630
leaq 0xdf5cb(%rip), %rdi     # 0x14f6a5
xorl %eax, %eax
callq 0x4630
jmp 0x700f2
jmp 0x700f7
jmp 0x700f2
jmp 0x700f2
movq %rax, %r14
jmp 0x70117
jmp 0x700f2
jmp 0x700f2
movq %rax, %r14
jmp 0x7012e
movq %rax, %r14
movq 0xf0(%rsp), %rdi
testq %rdi, %rdi
je 0x70117
movq 0x100(%rsp), %rsi
subq %rdi, %rsi
callq 0x4470
movq 0x20(%rsp), %rdi
testq %rdi, %rdi
je 0x7012e
movq 0x30(%rsp), %rsi
subq %rdi, %rsi
callq 0x4470
leaq 0xa8(%rbx), %rdi
callq 0xefda
movq 0x90(%rbx), %rdi
testq %rdi, %rdi
je 0x70155
movq 0xa0(%rbx), %rsi
subq %rdi, %rsi
callq 0x4470
movq 0x58(%rsp), %rax
movq (%rax), %rdi
testq %rdi, %rdi
je 0x70171
movq 0x88(%rbx), %rsi
subq %rdi, %rsi
callq 0x4470
movq 0x68(%rsp), %rdi
callq 0xf07c
movq 0x50(%rsp), %rdi
callq 0xf118
movq %rbx, %rdi
callq 0xf118
movq %r14, %rdi
callq 0x4780
nop