// File: /workspace/github_cpp_makefile_star2_O3/spatialfruitsalad[P]volume2position/./tomogram.hpp
// Function: tomogram3d<int>::cleanBorder(double)
void cleanBorder(double outside = 0.005)
    {
        unsigned nx = get_sx();
        unsigned ny = get_sy();
        unsigned nz = get_sz();
        
        std::set<VALUE> markList; // all particle labels contained in here will be set to 0
        double zExcludeFraction = 0.05;
        unsigned zTop = zExcludeFraction * nz;
        unsigned zBot = nz - zTop;
    
        for (unsigned long k = 0; k != nz; ++k)
        for (unsigned long j = 0; j != ny; ++j)
        for (unsigned long i = 0; i != nx; ++i)
        {
            // exclude all particles that touch the boundary
            
            auto v = get(i,j,k);
            
            if( v != 0)
            {
                // TOP && bottom
                if(k < zTop || k > zBot)
                {
                    markList.insert(v);
                }
                double r = sqrt( (i-nx/2)*(i-nx/2) + (j- ny/2)*(j-ny/2));
                // radial
                if (r > 0.5*nx*(1.0 - outside))
                {
                    markList.insert(v);
                }
            }
        }
        std::cout << "CleanUp: removing " << markList.size() << " clusters" << std::endl;
// remove all clusters that touch the boundary
        for (unsigned int k = 0; k != nz; ++k)
        for (unsigned int j = 0; j != ny; ++j)
        for (unsigned int i = 0; i != nx; ++i)
        {
            auto v = get(i,j,k);
            if( markList.count(v) == 1)
            {
                set(i,j,k,0);
            }
        }
    }

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x88, %rsp
movq %rdi, %rbx
movq 0x18(%rdi), %rax
movq %rax, 0x10(%rsp)
movq 0x20(%rdi), %rax
movq %rax, 0x8(%rsp)
movq 0x28(%rdi), %rsi
xorl %eax, %eax
movl $0xffffffff, %ecx       # imm = 0xFFFFFFFF
leaq 0x60(%rsp), %rdx
movl $0x0, (%rdx)
movq %rax, 0x8(%rdx)
movq %rdx, 0x10(%rdx)
movq %rdx, 0x18(%rdx)
movq %rax, 0x20(%rdx)
movq %rsi, 0x18(%rsp)
andq %rsi, %rcx
movq %rcx, 0x20(%rsp)
je 0xc0fb
movq 0x18(%rsp), %rcx
movl %ecx, %eax
cvtsi2sd %rax, %xmm1
mulsd 0xb05b(%rip), %xmm1     # 0x17010
cvttsd2si %xmm1, %rax
subl %eax, %ecx
movq %rcx, 0x38(%rsp)
movq 0x8(%rsp), %rdx
movl %edx, %ecx
movq %rcx, 0x28(%rsp)
movq 0x10(%rsp), %rcx
movl %ecx, %r15d
movl %eax, %eax
movq %rax, 0x30(%rsp)
movl %ecx, %esi
shrl %esi
movl %ecx, %eax
xorps %xmm1, %xmm1
cvtsi2sd %rax, %xmm1
shrl %edx
movq %rdx, 0x40(%rsp)
mulsd 0xb04f(%rip), %xmm1     # 0x17048
movsd 0xb04f(%rip), %xmm2     # 0x17050
subsd %xmm0, %xmm2
mulsd %xmm1, %xmm2
movsd %xmm2, 0x48(%rsp)
negq %rsi
movq %rsi, 0x50(%rsp)
xorl %r14d, %r14d
cmpq $0x0, 0x28(%rsp)
je 0xc0ed
cmpq 0x30(%rsp), %r14
setb %al
cmpq 0x38(%rsp), %r14
seta %cl
orb %al, %cl
movb %cl, 0x3(%rsp)
xorl %r13d, %r13d
testq %r15, %r15
je 0xc0df
movq %r13, %r12
subq 0x40(%rsp), %r12
imulq %r12, %r12
xorl %ebp, %ebp
movq %rbx, %rdi
movq %rbp, %rsi
movq %r13, %rdx
movq %r14, %rcx
callq 0xcef2
movl %eax, 0x4(%rsp)
testl %eax, %eax
je 0xc0d3
cmpb $0x0, 0x3(%rsp)
je 0xc085
leaq 0x58(%rsp), %rdi
leaq 0x4(%rsp), %rsi
callq 0x1532e
movq 0x50(%rsp), %rax
addq %rbp, %rax
imulq %rax, %rax
addq %r12, %rax
movq %rax, %xmm0
punpckldq 0xb03f(%rip), %xmm0 # xmm0 = xmm0[0],mem[0],xmm0[1],mem[1]
subpd 0xb047(%rip), %xmm0     # 0x170f0
movapd %xmm0, %xmm1
unpckhpd %xmm0, %xmm1            # xmm1 = xmm1[1],xmm0[1]
addsd %xmm0, %xmm1
xorps %xmm0, %xmm0
sqrtsd %xmm1, %xmm0
ucomisd 0x48(%rsp), %xmm0
jbe 0xc0d3
leaq 0x58(%rsp), %rdi
leaq 0x4(%rsp), %rsi
callq 0x1532e
incq %rbp
cmpq %rbp, %r15
jne 0xc056
incq %r13
cmpq 0x28(%rsp), %r13
jne 0xc03f
incq %r14
cmpq 0x20(%rsp), %r14
jne 0xc01a
movq 0x10ec6(%rip), %rdi     # 0x1cfc8
leaq 0xbc6a(%rip), %rsi      # 0x17d73
movl $0x12, %edx
callq 0x32f0
movq 0x80(%rsp), %rsi
movq 0x10ea6(%rip), %rdi     # 0x1cfc8
callq 0x31d0
movq %rax, %r14
leaq 0xbc55(%rip), %rsi      # 0x17d86
movl $0x9, %edx
movq %rax, %rdi
callq 0x32f0
movq (%r14), %rax
movq -0x18(%rax), %rdi
addq %r14, %rdi
movl $0xa, %esi
callq 0x32a0
movsbl %al, %esi
movq %r14, %rdi
callq 0x3040
movq %rax, %rdi
callq 0x31e0
cmpl $0x0, 0x18(%rsp)
je 0xc221
movl 0x10(%rsp), %r13d
movl 0x8(%rsp), %ebp
xorl %r14d, %r14d
cmpl $0x0, 0x8(%rsp)
je 0xc213
xorl %r15d, %r15d
cmpl $0x0, 0x10(%rsp)
je 0xc207
xorl %r12d, %r12d
movq %rbx, %rdi
movq %r12, %rsi
movq %r15, %rdx
movq %r14, %rcx
callq 0xcef2
movq 0x68(%rsp), %rdi
testq %rdi, %rdi
je 0xc1ff
leaq 0x60(%rsp), %r8
movq %r8, %rcx
movq %rdi, %rdx
movl 0x20(%rdi), %esi
xorl %edi, %edi
cmpl %eax, %esi
setl %dil
movq %rdx, %r8
cmovlq %rcx, %r8
movq 0x10(%rdx,%rdi,8), %rdi
testq %rdi, %rdi
jne 0xc1b4
leaq 0x60(%rsp), %rdi
cmpq %rdi, %r8
je 0xc1ff
cmpl %eax, %esi
cmovlq %rcx, %rdx
cmpl 0x20(%rdx), %eax
jl 0xc1ff
movq %rbx, %rdi
movq %r12, %rsi
movq %r15, %rdx
movq %r14, %rcx
xorl %r8d, %r8d
callq 0xe3de
incq %r12
cmpq %r13, %r12
jne 0xc194
incq %r15
cmpq %rbp, %r15
jne 0xc18a
incq %r14
cmpq 0x20(%rsp), %r14
jne 0xc17c
leaq 0x58(%rsp), %rdi
callq 0x1543c
addq $0x88, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0xc243
jmp 0xc243
jmp 0xc243
movq %rax, %rbx
leaq 0x58(%rsp), %rdi
callq 0x1543c
movq %rbx, %rdi
callq 0x3430