// File: 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
movq %rsp, %rbp
subq $0x290, %rsp            # imm = 0x290
movq %rdi, -0x200(%rbp)
movq %rdi, %rax
movq %rax, -0x1f8(%rbp)
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq -0x10(%rbp), %rax
movq %rax, -0x1f0(%rbp)
leaq -0x28(%rbp), %rdi
callq 0xcd5c0
movl $0x0, -0x2c(%rbp)
movq -0x1f0(%rbp), %rdi
movl -0x2c(%rbp), %eax
movq %rax, -0x208(%rbp)
addq $0x90, %rdi
callq 0x706e0
movq %rax, %rcx
movq -0x208(%rbp), %rax
cmpq %rcx, %rax
jae 0xc73af
movl $0x0, -0x30(%rbp)
movq -0x1f0(%rbp), %rdi
movl -0x30(%rbp), %eax
movq %rax, -0x210(%rbp)
addq $0xa8, %rdi
movl -0x2c(%rbp), %eax
movl %eax, %esi
callq 0x10890
movq %rax, %rdi
callq 0x10090
movq %rax, %rcx
movq -0x210(%rbp), %rax
cmpq %rcx, %rax
jae 0xc739f
movq -0x1f0(%rbp), %rdi
addq $0xa8, %rdi
movl -0x2c(%rbp), %eax
movl %eax, %esi
callq 0x10890
movq %rax, %rdi
movl -0x30(%rbp), %eax
movl %eax, %esi
callq 0x101d0
movq %rax, -0x218(%rbp)
jmp 0xc7191
movq -0x1f0(%rbp), %rdi
movq -0x218(%rbp), %rax
movl (%rax), %eax
movl %eax, -0x34(%rbp)
addq $0x90, %rdi
movq %rdi, -0x230(%rbp)
movl -0x2c(%rbp), %eax
movl %eax, %esi
callq 0x658f0
movq -0x230(%rbp), %rdi
cvtsi2sdl (%rax), %xmm0
movsd %xmm0, -0x228(%rbp)
movl -0x2c(%rbp), %eax
movl %eax, %esi
callq 0x658f0
movq -0x230(%rbp), %rdi
cvtsi2sdl 0x4(%rax), %xmm0
movsd %xmm0, -0x220(%rbp)
movl -0x2c(%rbp), %eax
movl %eax, %esi
callq 0x658f0
movsd -0x228(%rbp), %xmm0
movsd -0x220(%rbp), %xmm1
cvtsi2sdl 0x8(%rax), %xmm2
leaq -0x60(%rbp), %rdi
callq 0xea8e0
jmp 0xc7217
movq -0x1f0(%rbp), %rdi
addq $0x60, %rdi
movq %rdi, -0x248(%rbp)
movslq -0x34(%rbp), %rsi
callq 0x2a4c0
movq -0x248(%rbp), %rdi
movsd 0x8(%rax), %xmm0
movsd %xmm0, -0x240(%rbp)
movslq -0x34(%rbp), %rsi
callq 0x2a4c0
movq -0x248(%rbp), %rdi
movsd 0x10(%rax), %xmm0
movsd %xmm0, -0x238(%rbp)
movslq -0x34(%rbp), %rsi
callq 0x2a4c0
movsd -0x240(%rbp), %xmm0
movsd -0x238(%rbp), %xmm1
movsd 0x18(%rax), %xmm2
leaq -0x80(%rbp), %rdi
callq 0xea8e0
jmp 0xc728c
movq -0x1f0(%rbp), %rsi
addq $0xc0, %rsi
movsd -0x60(%rbp), %xmm0
leaq -0xe0(%rbp), %rdi
callq 0xea9f0
jmp 0xc72ad
leaq -0xc8(%rbp), %rdi
leaq -0x80(%rbp), %rsi
leaq -0xe0(%rbp), %rdx
callq 0xeae50
jmp 0xc72c6
movq -0x1f0(%rbp), %rsi
addq $0xd8, %rsi
movsd -0x58(%rbp), %xmm0
leaq -0xf8(%rbp), %rdi
callq 0xea9f0
jmp 0xc72e7
leaq -0xb0(%rbp), %rdi
leaq -0xc8(%rbp), %rsi
leaq -0xf8(%rbp), %rdx
callq 0xeae50
jmp 0xc7303
movq -0x1f0(%rbp), %rsi
addq $0xf0, %rsi
movsd -0x50(%rbp), %xmm0
leaq -0x110(%rbp), %rdi
callq 0xea9f0
jmp 0xc7324
leaq -0x98(%rbp), %rdi
leaq -0xb0(%rbp), %rsi
leaq -0x110(%rbp), %rdx
callq 0xeae50
jmp 0xc7340
movq -0x88(%rbp), %rax
movq %rax, -0x70(%rbp)
movups -0x98(%rbp), %xmm0
movaps %xmm0, -0x80(%rbp)
leaq -0x130(%rbp), %rdi
leaq -0x34(%rbp), %rsi
leaq -0x80(%rbp), %rdx
callq 0xcd5e0
jmp 0xc736c
leaq -0x28(%rbp), %rdi
leaq -0x130(%rbp), %rsi
callq 0xcd620
jmp 0xc737e
jmp 0xc7380
movl -0x30(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x30(%rbp)
jmp 0xc7126
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
jmp 0xc76c1
jmp 0xc73a1
movl -0x2c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x2c(%rbp)
jmp 0xc70ef
movq -0x200(%rbp), %rdi
movb $0x0, -0x131(%rbp)
callq 0xcd690
movq -0x1f0(%rbp), %rax
cmpl $0x0, 0x108(%rax)
jle 0xc7406
movq 0x1abbe7(%rip), %rdi    # 0x272fc0
leaq 0x134142(%rip), %rsi    # 0x1fb522
callq 0x5540
jmp 0xc73e7
jmp 0xc7406
movq -0x200(%rbp), %rdi
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
callq 0x104c0
jmp 0xc76c1
movl $0x0, -0x138(%rbp)
movq -0x1f0(%rbp), %rdi
movl -0x138(%rbp), %eax
movq %rax, -0x250(%rbp)
addq $0x90, %rdi
callq 0x706e0
movq %rax, %rcx
movq -0x250(%rbp), %rax
cmpq %rcx, %rax
jae 0xc768c
movq -0x200(%rbp), %rdi
leaq -0x28(%rbp), %rsi
callq 0xcd6b0
jmp 0xc7455
movl $0x0, -0x13c(%rbp)
movl -0x13c(%rbp), %eax
movq %rax, -0x258(%rbp)
leaq -0x28(%rbp), %rdi
callq 0x102c0
movq %rax, %rcx
movq -0x258(%rbp), %rax
cmpq %rcx, %rax
jae 0xc7676
movq -0x1f0(%rbp), %rdi
addq $0x90, %rdi
movq %rdi, -0x270(%rbp)
movl -0x138(%rbp), %eax
movl %eax, %esi
callq 0x658f0
movq -0x270(%rbp), %rdi
cvtsi2sdl (%rax), %xmm0
movsd %xmm0, -0x268(%rbp)
movl -0x138(%rbp), %eax
movl %eax, %esi
callq 0x658f0
movq -0x270(%rbp), %rdi
cvtsi2sdl 0x4(%rax), %xmm0
movsd %xmm0, -0x260(%rbp)
movl -0x138(%rbp), %eax
movl %eax, %esi
callq 0x658f0
movsd -0x268(%rbp), %xmm0
movsd -0x260(%rbp), %xmm1
cvtsi2sdl 0x8(%rax), %xmm2
leaq -0x158(%rbp), %rdi
callq 0xea8e0
jmp 0xc750e
movq -0x200(%rbp), %rdi
movl -0x138(%rbp), %eax
movl %eax, %esi
callq 0x102a0
movq %rax, %rdi
movl -0x13c(%rbp), %eax
movl %eax, %esi
callq 0x10310
movq %rax, -0x278(%rbp)
jmp 0xc753b
movq -0x1f0(%rbp), %rsi
movq -0x278(%rbp), %rax
addq $0x8, %rax
movq %rax, -0x280(%rbp)
addq $0xc0, %rsi
movsd -0x158(%rbp), %xmm0
leaq -0x1b8(%rbp), %rdi
callq 0xea9f0
jmp 0xc7571
movq -0x280(%rbp), %rsi
leaq -0x1a0(%rbp), %rdi
leaq -0x1b8(%rbp), %rdx
callq 0xeadf0
jmp 0xc758d
movq -0x1f0(%rbp), %rsi
addq $0xd8, %rsi
movsd -0x150(%rbp), %xmm0
leaq -0x1d0(%rbp), %rdi
callq 0xea9f0
jmp 0xc75b1
leaq -0x188(%rbp), %rdi
leaq -0x1a0(%rbp), %rsi
leaq -0x1d0(%rbp), %rdx
callq 0xeadf0
jmp 0xc75cd
movq -0x1f0(%rbp), %rsi
addq $0xf0, %rsi
movsd -0x148(%rbp), %xmm0
leaq -0x1e8(%rbp), %rdi
callq 0xea9f0
jmp 0xc75f1
leaq -0x170(%rbp), %rdi
leaq -0x188(%rbp), %rsi
leaq -0x1e8(%rbp), %rdx
callq 0xeadf0
jmp 0xc760d
movq -0x200(%rbp), %rdi
movl -0x138(%rbp), %eax
movl %eax, %esi
callq 0x102a0
movq %rax, %rdi
movl -0x13c(%rbp), %eax
movl %eax, %esi
callq 0x10310
movq %rax, -0x288(%rbp)
jmp 0xc763a
movq -0x288(%rbp), %rax
movq -0x170(%rbp), %rcx
movq %rcx, 0x8(%rax)
movq -0x168(%rbp), %rcx
movq %rcx, 0x10(%rax)
movq -0x160(%rbp), %rcx
movq %rcx, 0x18(%rax)
movl -0x13c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x13c(%rbp)
jmp 0xc745f
jmp 0xc7678
movl -0x138(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x138(%rbp)
jmp 0xc7410
movb $0x1, -0x131(%rbp)
testb $0x1, -0x131(%rbp)
jne 0xc76a8
movq -0x200(%rbp), %rdi
callq 0x104c0
leaq -0x28(%rbp), %rdi
callq 0x2aee0
movq -0x1f8(%rbp), %rax
addq $0x290, %rsp            # imm = 0x290
popq %rbp
retq
leaq -0x28(%rbp), %rdi
callq 0x2aee0
movq -0x40(%rbp), %rdi
callq 0x58f0
nopw %cs:(%rax,%rax)