// File: /workspace/github_cpp_makefile_star2_O2/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), %rsi
movq 0x20(%rdi), %rdx
movq 0x28(%rdi), %rdi
movl %edi, %ecx
leaq 0x60(%rsp), %rax
andl $0x0, (%rax)
andq $0x0, 0x8(%rax)
movq %rax, 0x10(%rax)
movq %rax, 0x18(%rax)
andq $0x0, 0x20(%rax)
movq %rcx, 0x10(%rsp)
cvtsi2sd %rcx, %xmm1
mulsd 0x8074(%rip), %xmm1     # 0x11010
cvttsd2si %xmm1, %rax
subl %eax, %edi
movq %rdi, 0x30(%rsp)
movl %edx, %ecx
movq %rcx, 0x40(%rsp)
movl %esi, %r15d
movl %eax, %eax
movq %rax, 0x28(%rsp)
movq %rsi, 0x18(%rsp)
shrl %esi
movq %rdx, 0x20(%rsp)
cvtsi2sd %r15, %xmm1
shrl %edx
movq %rdx, 0x38(%rsp)
mulsd 0x8067(%rip), %xmm1     # 0x11040
movsd 0x8067(%rip), %xmm2     # 0x11048
subsd %xmm0, %xmm2
mulsd %xmm1, %xmm2
movsd %xmm2, 0x48(%rsp)
negq %rsi
movq %rsi, 0x50(%rsp)
xorl %r14d, %r14d
cmpq 0x10(%rsp), %r14
je 0x90d2
cmpq 0x28(%rsp), %r14
setb %al
cmpq 0x30(%rsp), %r14
seta %cl
orb %al, %cl
movb %cl, 0x8(%rsp)
xorl %r13d, %r13d
cmpq 0x40(%rsp), %r13
je 0x90ca
movq %r13, %r12
subq 0x38(%rsp), %r12
imulq %r12, %r12
xorl %ebp, %ebp
cmpq %rbp, %r15
je 0x90c2
movq %rbx, %rdi
movq %rbp, %rsi
movq %r13, %rdx
movq %r14, %rcx
callq 0x9746
movl %eax, 0x4(%rsp)
testl %eax, %eax
je 0x90ba
cmpb $0x0, 0x8(%rsp)
je 0x906f
leaq 0x58(%rsp), %rdi
leaq 0x4(%rsp), %rsi
callq 0xfca6
movq 0x50(%rsp), %rax
addq %rbp, %rax
imulq %rax, %rax
addq %r12, %rax
movq %rax, %xmm0
punpckldq 0x8035(%rip), %xmm0 # xmm0 = xmm0[0],mem[0],xmm0[1],mem[1]
subpd 0x803d(%rip), %xmm0     # 0x110d0
movapd %xmm0, %xmm1
unpckhpd %xmm0, %xmm1            # xmm1 = xmm1[1],xmm0[1]
addsd %xmm0, %xmm1
sqrtsd %xmm1, %xmm0
ucomisd 0x48(%rsp), %xmm0
jbe 0x90ba
leaq 0x58(%rsp), %rdi
leaq 0x4(%rsp), %rsi
callq 0xfca6
incq %rbp
jmp 0x9037
incq %r13
jmp 0x901e
incq %r14
jmp 0x8ffa
movq 0xeeef(%rip), %rdi      # 0x17fc8
leaq 0x8c2e(%rip), %rsi      # 0x11d0e
callq 0x3260
movq 0x80(%rsp), %rsi
movq %rax, %rdi
callq 0x31a0
leaq 0x8c25(%rip), %rsi      # 0x11d21
movq %rax, %rdi
callq 0x3260
movq %rax, %rdi
callq 0x3110
movl 0x18(%rsp), %r15d
movl 0x20(%rsp), %eax
movq %rax, 0x8(%rsp)
xorl %r14d, %r14d
leaq 0x4(%rsp), %r12
cmpq 0x10(%rsp), %r14
je 0x9185
xorl %r13d, %r13d
cmpq 0x8(%rsp), %r13
je 0x9180
xorl %ebp, %ebp
cmpq %rbp, %r15
je 0x917b
movq %rbx, %rdi
movq %rbp, %rsi
movq %r13, %rdx
movq %r14, %rcx
callq 0x9746
movl %eax, 0x4(%rsp)
leaq 0x58(%rsp), %rdi
movq %r12, %rsi
callq 0xfc8c
cmpq $0x1, %rax
jne 0x9176
movq %rbx, %rdi
movq %rbp, %rsi
movq %r13, %rdx
movq %r14, %rcx
xorl %r8d, %r8d
callq 0xa85a
incq %rbp
jmp 0x9135
incq %r13
jmp 0x912c
incq %r14
jmp 0x9122
leaq 0x58(%rsp), %rdi
callq 0xfe4a
addq $0x88, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x91a7
jmp 0x91a7
jmp 0x91a7
movq %rax, %rbx
leaq 0x58(%rsp), %rdi
callq 0xfe4a
movq %rbx, %rdi
callq 0x3420