// File: /workspace/github_cpp_makefile_star2_O3/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, %r14
movq %rdi, (%rsp)
xorpd %xmm0, %xmm0
movapd %xmm0, 0x10(%rsp)
movq $0x0, 0x20(%rsp)
movq 0x90(%rsi), %rax
movq 0x98(%rsi), %rcx
cmpq %rax, %rcx
je 0x716d1
leaq 0xc0(%r14), %rdx
movq %rdx, 0x8(%rsp)
leaq 0xd8(%r14), %rdx
movq %rdx, 0x40(%rsp)
leaq 0xf0(%r14), %rdx
movq %rdx, 0x38(%rsp)
movq 0xa8(%r14), %rdx
xorl %r8d, %r8d
leaq 0xf8(%rsp), %rbp
leaq (%r8,%r8,2), %rbx
movq (%rdx,%rbx,8), %rsi
cmpq %rsi, 0x8(%rdx,%rbx,8)
je 0x716ab
movq %r8, 0x30(%rsp)
movl $0x1, %r15d
xorl %eax, %eax
movl (%rsi,%rax,4), %r12d
movq 0x90(%r14), %rax
xorps %xmm0, %xmm0
cvtsi2sdl (%rax,%rbx,4), %xmm0
xorps %xmm1, %xmm1
cvtsi2sdl 0x4(%rax,%rbx,4), %xmm1
cvtsi2sdl 0x8(%rax,%rbx,4), %xmm2
leaq 0x68(%rsp), %rdi
callq 0x84364
movslq %r12d, %rax
movq 0x60(%r14), %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 0x84364
movsd 0x68(%rsp), %xmm0
movq %rbp, %r13
movq %rbp, %rdi
movq 0x8(%rsp), %rsi
callq 0x84416
leaq 0xc8(%rsp), %rdi
leaq 0x90(%rsp), %rsi
movq %r13, %rdx
callq 0x84642
movsd 0x70(%rsp), %xmm0
leaq 0xe0(%rsp), %r13
movq %r13, %rdi
movq 0x40(%rsp), %rsi
callq 0x84416
leaq 0xb0(%rsp), %rdi
leaq 0xc8(%rsp), %rsi
movq %r13, %rdx
callq 0x84642
movsd 0x78(%rsp), %xmm0
leaq 0x110(%rsp), %r13
movq %r13, %rdi
movq 0x38(%rsp), %rsi
callq 0x84416
leaq 0x48(%rsp), %rdi
leaq 0xb0(%rsp), %rsi
movq %r13, %rdx
callq 0x84642
movq 0x58(%rsp), %rax
movq %rax, 0xa0(%rsp)
movupd 0x48(%rsp), %xmm0
movapd %xmm0, 0x90(%rsp)
movl %r12d, 0x48(%rsp)
leaq 0x50(%rsp), %rcx
movq %rax, 0x10(%rcx)
movupd %xmm0, (%rcx)
movq 0x18(%rsp), %rsi
cmpq 0x20(%rsp), %rsi
je 0x71663
movupd 0x48(%rsp), %xmm0
movupd 0x58(%rsp), %xmm1
movupd %xmm1, 0x10(%rsi)
movupd %xmm0, (%rsi)
addq $0x20, %rsi
movq %rsi, 0x18(%rsp)
jmp 0x71672
leaq 0x10(%rsp), %rdi
leaq 0x48(%rsp), %rdx
callq 0x768aa
movl %r15d, %eax
movq 0xa8(%r14), %rdx
movq (%rdx,%rbx,8), %rsi
movq 0x8(%rdx,%rbx,8), %rcx
subq %rsi, %rcx
sarq $0x2, %rcx
incl %r15d
cmpq %rax, %rcx
ja 0x71522
movq 0x90(%r14), %rax
movq 0x98(%r14), %rcx
movq 0x30(%rsp), %r8
incl %r8d
movq %rcx, %rsi
subq %rax, %rsi
sarq $0x2, %rsi
movabsq $-0x5555555555555555, %rdi # imm = 0xAAAAAAAAAAAAAAAB
imulq %rdi, %rsi
cmpq %r8, %rsi
ja 0x71502
jmp 0x716d4
movq %rcx, %rax
movq (%rsp), %rdx
xorpd %xmm0, %xmm0
movupd %xmm0, (%rdx)
movq $0x0, 0x10(%rdx)
cmpl $0x0, 0x108(%r14)
jle 0x71718
movq 0x1238c7(%rip), %rdi    # 0x194fc0
leaq 0xe31d2(%rip), %rsi     # 0x1548d2
movl $0x76, %edx
callq 0x44e0
movq 0x90(%r14), %rax
movq 0x98(%r14), %rcx
cmpq %rax, %rcx
je 0x71931
leaq 0xc0(%r14), %rax
movq %rax, 0x38(%rsp)
leaq 0xd8(%r14), %rax
movq %rax, 0x30(%rsp)
leaq 0xf0(%r14), %rax
movq %rax, 0x88(%rsp)
movq $0x0, 0x28(%rsp)
leaq 0xc8(%rsp), %r13
leaq 0xf8(%rsp), %r12
leaq 0x90(%rsp), %r15
movq %r14, 0x80(%rsp)
movq (%rsp), %rdi
leaq 0x10(%rsp), %rsi
callq 0x75bec
movq 0x10(%rsp), %rdi
cmpq %rdi, 0x18(%rsp)
je 0x718fa
movl $0x1, %r8d
movq 0x28(%rsp), %rax
leaq (%rax,%rax,2), %rbx
xorl %ecx, %ecx
movq %rcx, 0x8(%rsp)
movl %r8d, 0x40(%rsp)
movq 0x90(%r14), %rax
xorps %xmm0, %xmm0
cvtsi2sdl (%rax,%rbx,4), %xmm0
xorps %xmm1, %xmm1
cvtsi2sdl 0x4(%rax,%rbx,4), %xmm1
cvtsi2sdl 0x8(%rax,%rbx,4), %xmm2
leaq 0x48(%rsp), %rdi
callq 0x84364
movq %r15, %rbp
movq %r12, %r15
movq (%rsp), %rax
movq (%rax), %rax
movq (%rax,%rbx,8), %r12
movq 0x8(%rax,%rbx,8), %rdx
subq %r12, %rdx
sarq $0x5, %rdx
movq 0x8(%rsp), %rsi
cmpq %rsi, %rdx
jbe 0x7196c
movsd 0x48(%rsp), %xmm0
movq %r13, %rdi
movq 0x38(%rsp), %rsi
callq 0x84416
movq %r13, %r14
movq 0x8(%rsp), %r13
shlq $0x5, %r13
leaq (%r12,%r13), %rsi
addq $0x8, %rsi
leaq 0xb0(%rsp), %rdi
movq %r14, %rdx
callq 0x8461e
movsd 0x50(%rsp), %xmm0
movq %r15, %r12
movq %r15, %rdi
movq 0x30(%rsp), %rsi
callq 0x84416
movq %rbp, %r15
movq %rbp, %rdi
leaq 0xb0(%rsp), %rsi
movq %r12, %rdx
callq 0x8461e
movsd 0x58(%rsp), %xmm0
leaq 0xe0(%rsp), %rbp
movq %rbp, %rdi
movq 0x88(%rsp), %rsi
callq 0x84416
leaq 0x68(%rsp), %rdi
movq %r15, %rsi
movq %rbp, %rdx
callq 0x8461e
movq (%rsp), %rax
movq (%rax), %rcx
movq (%rcx,%rbx,8), %rax
movq 0x8(%rcx,%rbx,8), %rdx
subq %rax, %rdx
sarq $0x5, %rdx
movq 0x8(%rsp), %rsi
cmpq %rsi, %rdx
movl 0x40(%rsp), %r8d
jbe 0x7195e
movq 0x78(%rsp), %rcx
movq %rcx, 0x18(%rax,%r13)
movupd 0x68(%rsp), %xmm0
movupd %xmm0, 0x8(%rax,%r13)
movl %r8d, %ecx
movq 0x10(%rsp), %rdi
movq 0x18(%rsp), %rax
subq %rdi, %rax
sarq $0x5, %rax
incl %r8d
cmpq %rcx, %rax
movq %r14, %r13
movq 0x80(%rsp), %r14
ja 0x717a0
movq 0x98(%r14), %rax
subq 0x90(%r14), %rax
movq 0x28(%rsp), %rdx
incl %edx
sarq $0x2, %rax
movabsq $-0x5555555555555555, %rcx # imm = 0xAAAAAAAAAAAAAAAB
imulq %rcx, %rax
movq %rdx, 0x28(%rsp)
cmpq %rdx, %rax
ja 0x71771
jmp 0x71936
movq 0x10(%rsp), %rdi
testq %rdi, %rdi
je 0x71948
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 0xdbd90(%rip), %rdi     # 0x14d6f5
xorl %eax, %eax
callq 0x4630
leaq 0xdbd82(%rip), %rdi     # 0x14d6f5
xorl %eax, %eax
callq 0x4630
jmp 0x7198e
jmp 0x7198e
jmp 0x719a0
jmp 0x7198e
jmp 0x7198e
jmp 0x7198e
jmp 0x719a0
jmp 0x719a0
jmp 0x7198e
jmp 0x7198e
movq %rax, %rbx
movq (%rsp), %rdi
callq 0xee9c
jmp 0x719a3
jmp 0x719a0
jmp 0x719a0
movq %rax, %rbx
movq 0x10(%rsp), %rdi
testq %rdi, %rdi
je 0x719ba
movq 0x20(%rsp), %rsi
subq %rdi, %rsi
callq 0x4470
movq %rbx, %rdi
callq 0x4780