// File: /workspace/github_cpp_makefile_star2_O1/Luthaf[P]zeopp/channel.cc
// Function: PORE::getReconstructredPoresWithCrossBoundryCopies()
vector<  vector< pair <int,XYZ> > >  PORE::getReconstructredPoresWithCrossBoundryCopies(){

/*
 *  Pore variables
 *      std::vector<DELTA_POS> unitCells;    // List of displacements of unitcells in single PORE unit
 *          std::vector< std::vector<int> > ucNodes;  // List of nodes contained in each unit cell
 *              XYZ v_a, v_b, v_c;              // Unit cell vectors
 *
 *              */

 vector< pair <int,XYZ> > reconstructedNodeCoords; /* holds the reconstructure pore/molecule */

 for(int unsigned i=0; i<unitCells.size(); i++)
    {
    for(int unsigned j=0; j<ucNodes[i].size(); j++)
       {
       int nd = ucNodes[i].at(j); // current node

       XYZ deltapos(double(unitCells[i].x), double(unitCells[i].y), double(unitCells[i].z));

       XYZ node(nodes[nd].x, nodes[nd].y, nodes[nd].z);

       node = node + v_a.scale(deltapos.x) + v_b.scale(deltapos.y) + v_c.scale(deltapos.z) ;

       pair <int,XYZ> p (nd,node);

       reconstructedNodeCoords.push_back(p);
       };
    };

 vector<  vector< pair <int,XYZ> > > reconstructedCopies; // This will store copies of all reconstructure pores/molecules


 if(dimensionality>0) cout << "Calling PORE::getReconstructredPoresWithCrossBoundryCopies() for a pore with dim>0, it was not intended. DO NOT TRUST\n";

 for(int unsigned i=0; i<unitCells.size(); i++)
    {
    reconstructedCopies.push_back(reconstructedNodeCoords);

    for(int unsigned j=0; j<reconstructedNodeCoords.size(); j++)
       {

       XYZ deltapos(double(unitCells[i].x), double(unitCells[i].y), double(unitCells[i].z));

       reconstructedCopies[i].at(j).second = reconstructedCopies[i].at(j).second - v_a.scale(deltapos.x) - v_b.scale(deltapos.y) - v_c.scale(deltapos.z) ; 

       };
    };

 return reconstructedCopies;

}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x128, %rsp            # imm = 0x128
movq %rsi, %r13
movq %rdi, (%rsp)
xorpd %xmm0, %xmm0
movapd %xmm0, 0x10(%rsp)
movq $0x0, 0x20(%rsp)
movq 0x98(%rsi), %rax
cmpq 0x90(%rsi), %rax
movq %rsi, 0x8(%rsp)
je 0x723d1
leaq 0xc0(%r13), %rax
movq %rax, 0x50(%rsp)
leaq 0xd8(%r13), %rax
movq %rax, 0x48(%rsp)
leaq 0xf0(%r13), %rax
movq %rax, 0x40(%rsp)
xorl %edx, %edx
leaq 0xf8(%rsp), %rbp
leaq 0xe0(%rsp), %r14
leaq 0x110(%rsp), %rbx
movq 0xa8(%r13), %rcx
movq %rdx, 0x38(%rsp)
leaq (%rdx,%rdx,2), %rdx
movq (%rcx,%rdx,8), %rax
cmpq %rax, 0x8(%rcx,%rdx,8)
je 0x723a1
movl $0x1, %r15d
xorl %ecx, %ecx
movq %rdx, 0x28(%rsp)
movl (%rax,%rcx,4), %r12d
movq 0x90(%r13), %rax
xorps %xmm0, %xmm0
cvtsi2sdl (%rax,%rdx,4), %xmm0
xorps %xmm1, %xmm1
cvtsi2sdl 0x4(%rax,%rdx,4), %xmm1
cvtsi2sdl 0x8(%rax,%rdx,4), %xmm2
leaq 0x78(%rsp), %rdi
callq 0x85982
movslq %r12d, %rax
movq 0x60(%r13), %rcx
leaq (%rax,%rax,8), %rax
movsd 0x8(%rcx,%rax,8), %xmm0
movsd 0x10(%rcx,%rax,8), %xmm1
movsd 0x18(%rcx,%rax,8), %xmm2
leaq 0x90(%rsp), %rdi
callq 0x85982
movsd 0x78(%rsp), %xmm0
movq %rbp, %r13
movq %rbp, %rdi
movq 0x50(%rsp), %rsi
callq 0x85a34
leaq 0xc8(%rsp), %rdi
leaq 0x90(%rsp), %rsi
movq %r13, %rdx
callq 0x85dd4
movsd 0x80(%rsp), %xmm0
movq %r14, %r13
movq %r14, %rdi
movq 0x48(%rsp), %rsi
callq 0x85a34
leaq 0xb0(%rsp), %rdi
leaq 0xc8(%rsp), %rsi
movq %r13, %rdx
callq 0x85dd4
movsd 0x88(%rsp), %xmm0
movq %rbx, %r13
movq %rbx, %rdi
movq 0x40(%rsp), %rsi
callq 0x85a34
leaq 0x58(%rsp), %rdi
leaq 0xb0(%rsp), %rsi
movq %r13, %rdx
callq 0x85dd4
movq 0x68(%rsp), %rax
movq %rax, 0xa0(%rsp)
movupd 0x58(%rsp), %xmm0
movapd %xmm0, 0x90(%rsp)
movl %r12d, 0x58(%rsp)
leaq 0x60(%rsp), %rcx
movq %rax, 0x10(%rcx)
movupd %xmm0, (%rcx)
movq 0x18(%rsp), %rsi
cmpq 0x20(%rsp), %rsi
je 0x7235f
movupd 0x58(%rsp), %xmm0
movupd 0x68(%rsp), %xmm1
movupd %xmm1, 0x10(%rsi)
movupd %xmm0, (%rsi)
addq $0x20, %rsi
movq %rsi, 0x18(%rsp)
jmp 0x7236e
leaq 0x10(%rsp), %rdi
leaq 0x58(%rsp), %rdx
callq 0x7760c
movl %r15d, %ecx
movq 0x8(%rsp), %r13
movq 0xa8(%r13), %rdx
movq 0x28(%rsp), %rsi
movq (%rdx,%rsi,8), %rax
movq 0x8(%rdx,%rsi,8), %rdx
subq %rax, %rdx
sarq $0x2, %rdx
incl %r15d
cmpq %rcx, %rdx
movq %rsi, %rdx
ja 0x72222
movq 0x98(%r13), %rax
subq 0x90(%r13), %rax
movq 0x38(%rsp), %rdx
incl %edx
sarq $0x2, %rax
movabsq $-0x5555555555555555, %rcx # imm = 0xAAAAAAAAAAAAAAAB
imulq %rcx, %rax
cmpq %rdx, %rax
ja 0x721f6
movq (%rsp), %rax
xorpd %xmm0, %xmm0
movupd %xmm0, (%rax)
movq $0x0, 0x10(%rax)
cmpl $0x0, 0x108(%r13)
jle 0x72407
movq 0x124bca(%rip), %rdi    # 0x196fc0
leaq 0xe43bd(%rip), %rsi     # 0x1567ba
movl $0x76, %edx
callq 0x44e0
movq 0x8(%rsp), %rcx
movq 0x98(%rcx), %rax
cmpq 0x90(%rcx), %rax
je 0x72620
movq 0x8(%rsp), %rcx
leaq 0xc0(%rcx), %rax
movq %rax, 0x48(%rsp)
leaq 0xd8(%rcx), %rax
movq %rax, 0x40(%rsp)
leaq 0xf0(%rcx), %rax
movq %rax, 0x38(%rsp)
movq $0x0, 0x30(%rsp)
leaq 0xc8(%rsp), %r13
leaq 0xf8(%rsp), %r12
leaq 0x90(%rsp), %rbp
movq (%rsp), %rdi
leaq 0x10(%rsp), %rsi
callq 0x7688c
movq 0x18(%rsp), %rax
cmpq 0x10(%rsp), %rax
je 0x725e6
movl $0x1, %edi
movq 0x30(%rsp), %rax
leaq (%rax,%rax,2), %r14
xorl %ebx, %ebx
movq %r14, 0x28(%rsp)
movl %edi, 0x50(%rsp)
movq 0x8(%rsp), %rax
movq 0x90(%rax), %rax
xorps %xmm0, %xmm0
cvtsi2sdl (%rax,%r14,4), %xmm0
cvtsi2sdl 0x4(%rax,%r14,4), %xmm1
cvtsi2sdl 0x8(%rax,%r14,4), %xmm2
leaq 0x58(%rsp), %rdi
callq 0x85982
movq %rbp, %r15
movq %r12, %rbp
movq (%rsp), %rax
movq (%rax), %rax
movq (%rax,%r14,8), %r12
movq 0x8(%rax,%r14,8), %rdx
subq %r12, %rdx
sarq $0x5, %rdx
cmpq %rbx, %rdx
jbe 0x7265e
movsd 0x58(%rsp), %xmm0
movq %r13, %rdi
movq 0x48(%rsp), %rsi
callq 0x85a34
movq %r13, %r14
movq %rbx, %r13
shlq $0x5, %r13
leaq (%r12,%r13), %rsi
addq $0x8, %rsi
leaq 0xb0(%rsp), %rdi
movq %r14, %rdx
callq 0x85da6
movsd 0x60(%rsp), %xmm0
movq %rbp, %r12
movq %rbp, %rdi
movq 0x40(%rsp), %rsi
callq 0x85a34
movq %r15, %rbp
movq %r15, %rdi
leaq 0xb0(%rsp), %rsi
movq %r12, %rdx
callq 0x85da6
movsd 0x68(%rsp), %xmm0
leaq 0xe0(%rsp), %r15
movq %r15, %rdi
movq 0x38(%rsp), %rsi
callq 0x85a34
leaq 0x78(%rsp), %rdi
movq %rbp, %rsi
movq %r15, %rdx
callq 0x85da6
movq (%rsp), %rax
movq (%rax), %rcx
movq 0x28(%rsp), %rdx
movq (%rcx,%rdx,8), %rax
movq 0x8(%rcx,%rdx,8), %rdx
subq %rax, %rdx
sarq $0x5, %rdx
cmpq %rbx, %rdx
movl 0x50(%rsp), %edi
jbe 0x7264d
movq 0x88(%rsp), %rcx
movq %rcx, 0x18(%rax,%r13)
movupd 0x78(%rsp), %xmm0
movupd %xmm0, 0x8(%rax,%r13)
movq 0x18(%rsp), %rax
subq 0x10(%rsp), %rax
movl %edi, %ebx
sarq $0x5, %rax
incl %edi
cmpq %rbx, %rax
movq %r14, %r13
movq 0x28(%rsp), %r14
ja 0x7249d
movq 0x8(%rsp), %rcx
movq 0x98(%rcx), %rax
subq 0x90(%rcx), %rax
movq 0x30(%rsp), %rdx
incl %edx
sarq $0x2, %rax
movabsq $-0x5555555555555555, %rcx # imm = 0xAAAAAAAAAAAAAAAB
imulq %rcx, %rax
movq %rdx, 0x30(%rsp)
cmpq %rdx, %rax
ja 0x7246a
movq 0x10(%rsp), %rdi
testq %rdi, %rdi
je 0x72637
movq 0x20(%rsp), %rsi
subq %rdi, %rsi
callq 0x4470
movq (%rsp), %rax
addq $0x128, %rsp            # imm = 0x128
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0xdd051(%rip), %rdi     # 0x14f6a5
movq %rbx, %rsi
xorl %eax, %eax
callq 0x4630
movq %rbx, %rsi
leaq 0xdd03d(%rip), %rdi     # 0x14f6a5
xorl %eax, %eax
callq 0x4630
jmp 0x72683
jmp 0x72683
jmp 0x72695
jmp 0x72683
jmp 0x72683
jmp 0x72683
jmp 0x72695
jmp 0x72695
jmp 0x72683
jmp 0x72683
movq %rax, %rbx
movq (%rsp), %rdi
callq 0xee1c
jmp 0x72698
jmp 0x72695
jmp 0x72695
movq %rax, %rbx
movq 0x10(%rsp), %rdi
testq %rdi, %rdi
je 0x726af
movq 0x20(%rsp), %rsi
subq %rdi, %rsi
callq 0x4470
movq %rbx, %rdi
callq 0x4780
nop