// File: /workspace/github_cpp_makefile_star2_O2/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 %rdi, 0x8(%rsp)
leaq 0x30(%rsp), %rax
andq $0x0, 0x10(%rax)
xorpd %xmm0, %xmm0
movapd %xmm0, (%rax)
leaq 0xc0(%rsi), %rax
movq %rax, 0x28(%rsp)
leaq 0xd8(%rsi), %rax
movq %rax, 0x20(%rsp)
movq %rsi, (%rsp)
leaq 0xf0(%rsi), %rax
movq %rax, 0x18(%rsp)
xorl %esi, %esi
leaq 0x68(%rsp), %r14
movl %esi, %esi
movq (%rsp), %rcx
movq 0x98(%rcx), %rax
subq 0x90(%rcx), %rax
cqto
pushq $0xc
popq %rcx
idivq %rcx
cmpq %rsi, %rax
jbe 0x53f4b
xorl %ebp, %ebp
imulq $0x18, %rsi, %r15
movq %rsi, 0x10(%rsp)
imulq $0xc, %rsi, %r12
movl %ebp, %ebp
movq (%rsp), %rax
movq 0xa8(%rax), %rdi
movq 0x8(%rdi,%r15), %rax
subq (%rdi,%r15), %rax
sarq $0x2, %rax
cmpq %rbp, %rax
jbe 0x53f3f
addq %r15, %rdi
movq %rbp, %rsi
callq 0xac00
movl (%rax), %ebx
movq (%rsp), %r13
movq 0x90(%r13), %rax
cvtsi2sdl (%rax,%r12), %xmm0
cvtsi2sdl 0x4(%rax,%r12), %xmm1
cvtsi2sdl 0x8(%rax,%r12), %xmm2
leaq 0x50(%rsp), %rdi
callq 0x6402e
movslq %ebx, %rax
movq 0x60(%r13), %rcx
imulq $0x48, %rax, %rax
movsd 0x8(%rcx,%rax), %xmm0
movsd 0x10(%rcx,%rax), %xmm1
movsd 0x18(%rcx,%rax), %xmm2
leaq 0x90(%rsp), %rdi
callq 0x6402e
movsd 0x50(%rsp), %xmm0
leaq 0xf8(%rsp), %r13
movq %r13, %rdi
movq 0x28(%rsp), %rsi
callq 0x640ba
leaq 0xe0(%rsp), %rdi
leaq 0x90(%rsp), %rsi
movq %r13, %rdx
callq 0x642d2
movsd 0x58(%rsp), %xmm0
leaq 0xc8(%rsp), %r13
movq %r13, %rdi
movq 0x20(%rsp), %rsi
callq 0x640ba
leaq 0xb0(%rsp), %rdi
leaq 0xe0(%rsp), %rsi
movq %r13, %rdx
callq 0x642d2
movsd 0x60(%rsp), %xmm0
leaq 0x110(%rsp), %r13
movq %r13, %rdi
movq 0x18(%rsp), %rsi
callq 0x640ba
movq %r14, %rdi
leaq 0xb0(%rsp), %rsi
movq %r13, %rdx
callq 0x642d2
movq 0x78(%rsp), %rax
movq %rax, 0xa0(%rsp)
movupd 0x68(%rsp), %xmm0
movapd %xmm0, 0x90(%rsp)
movl %ebx, 0x68(%rsp)
leaq 0x70(%rsp), %rcx
movq %rax, 0x10(%rcx)
movupd %xmm0, (%rcx)
leaq 0x30(%rsp), %rdi
movq %r14, %rsi
callq 0x57664
incl %ebp
jmp 0x53de7
movq 0x10(%rsp), %rsi
incl %esi
jmp 0x53db3
movq 0x8(%rsp), %r13
andq $0x0, 0x10(%r13)
xorpd %xmm0, %xmm0
movupd %xmm0, (%r13)
movq (%rsp), %rax
cmpl $0x0, 0x108(%rax)
jle 0x53f7f
movq 0xfc04d(%rip), %rdi     # 0x14ffc0
leaq 0xaf8b0(%rip), %rsi     # 0x10382a
callq 0x4480
xorl %ebx, %ebx
leaq 0xf8(%rsp), %r14
leaq 0x90(%rsp), %r15
movl %ebx, %ebx
movq (%rsp), %rcx
movq 0x98(%rcx), %rax
subq 0x90(%rcx), %rax
cqto
pushq $0xc
popq %rcx
idivq %rcx
cmpq %rbx, %rax
jbe 0x54102
movq %r13, %rdi
leaq 0x30(%rsp), %rsi
callq 0x5768a
xorl %r12d, %r12d
imulq $0xc, %rbx, %rax
movq %rax, 0x10(%rsp)
movq %rbx, 0x88(%rsp)
imulq $0x18, %rbx, %rbp
movl %r12d, %r12d
movq 0x38(%rsp), %rax
subq 0x30(%rsp), %rax
sarq $0x5, %rax
cmpq %r12, %rax
jbe 0x540f3
movq (%rsp), %rax
movq 0x90(%rax), %rax
movq 0x10(%rsp), %rcx
cvtsi2sdl (%rax,%rcx), %xmm0
cvtsi2sdl 0x4(%rax,%rcx), %xmm1
cvtsi2sdl 0x8(%rax,%rcx), %xmm2
leaq 0x68(%rsp), %rdi
callq 0x6402e
movq (%r13), %rdi
addq %rbp, %rdi
movq %r12, %rsi
callq 0xac22
movq %rax, %r13
movq %r15, %rbx
movq %r14, %r15
movsd 0x68(%rsp), %xmm0
leaq 0xe0(%rsp), %r14
movq %r14, %rdi
movq 0x28(%rsp), %rsi
callq 0x640ba
addq $0x8, %r13
leaq 0xb0(%rsp), %rdi
movq %r13, %rsi
movq %r14, %rdx
callq 0x642ae
movsd 0x70(%rsp), %xmm0
movq %r15, %r14
movq %r15, %rdi
movq 0x20(%rsp), %rsi
callq 0x640ba
movq %rbx, %r15
movq %rbx, %rdi
leaq 0xb0(%rsp), %rsi
movq %r14, %rdx
callq 0x642ae
movsd 0x78(%rsp), %xmm0
leaq 0xc8(%rsp), %rdi
movq 0x18(%rsp), %rsi
movq 0x8(%rsp), %r13
callq 0x640ba
leaq 0x50(%rsp), %rdi
movq %r15, %rsi
leaq 0xc8(%rsp), %rdx
callq 0x642ae
movq (%r13), %rdi
addq %rbp, %rdi
movq %r12, %rsi
callq 0xac22
movq 0x60(%rsp), %rcx
movq %rcx, 0x18(%rax)
movupd 0x50(%rsp), %xmm0
movupd %xmm0, 0x8(%rax)
incl %r12d
jmp 0x53fdb
movq 0x88(%rsp), %rbx
incl %ebx
jmp 0x53f91
leaq 0x30(%rsp), %rdi
callq 0x108f8
movq %r13, %rax
addq $0x128, %rsp            # imm = 0x128
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x54146
jmp 0x54146
jmp 0x54133
jmp 0x54146
jmp 0x54141
jmp 0x54141
jmp 0x54141
jmp 0x54141
jmp 0x54133
movq %rax, %rbx
movq 0x8(%rsp), %r13
jmp 0x54149
jmp 0x54141
jmp 0x54141
movq %rax, %rbx
jmp 0x54151
movq %rax, %rbx
movq %r13, %rdi
callq 0xac44
leaq 0x30(%rsp), %rdi
callq 0x108f8
movq %rbx, %rdi
callq 0x4780
nop