// File: /workspace/github_cpp_makefile_star2_O2/spatialfruitsalad[P]volume2position/./dilate.hpp
// Function: Dilate::Process(tomogram3d<unsigned char>&, int)
static void Process(tomogram3d<uint8_t>& matrix_in, int masksize)
    {
        std::cout << "dilate: masksize " << masksize << "  ... " << std::flush;

        tomogram3d<uint8_t> dilate_map;

        int sx = matrix_in.get_sx();
        int sy = matrix_in.get_sy();
        int sz = matrix_in.get_sz();

        std::cout << "initialize dilate_map " << "  ... " << std::flush;
        dilate_map.initialise (sx, sy, sz, 1);
        std::cout << " done ... " << std::flush;

        int tol = (masksize-1)/2;

        for (int k = 0; k != sz; ++k)
        {
            for (int j = 0; j != sy; ++j)
            {
                for (int i = 0; i != sx; ++i)
                {
                    if (matrix_in.get(i,j,k) != 1)
                    {
                        int imin = std::max (i-tol, 0);
                        int imax = std::min (i+tol, int (sx-1));
                        int jmin = std::max (j-tol, 0);
                        int jmax = std::min (j+tol, int (sy-1));
                        int kmin = std::max (k-tol, 0);
                        int kmax = std::min (k+tol, int (sz-1));

                        uint8_t test_max = 0;
                        for (int ii = imin; ii <= imax; ++ii)
                            for (int jj = jmin; jj <= jmax; ++jj)
                                for (int kk = kmin; kk <= kmax; ++kk)
                                {
                                    test_max = std::max(test_max, matrix_in.get(ii,jj,kk));
                                    if (test_max == 1) goto end_voxel;
                                }
end_voxel:
                        dilate_map.set(i,j,k,test_max);
                    }
                }
            }
        }
        std::swap(matrix_in, dilate_map);
        std::cout << " done" << std::endl;
    }

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0xc8, %rsp
movl %esi, %ebp
movq %rdi, %rbx
movq 0xb425(%rip), %r14      # 0x17fc8
leaq 0x4e88(%rip), %rsi      # 0x11a32
movq %r14, %rdi
callq 0x3260
movq %rax, %rdi
movl %ebp, %esi
callq 0x3410
leaq 0x4d08(%rip), %rsi      # 0x118cb
movq %rax, %rdi
callq 0x3260
movq %rax, %rdi
callq 0x31b0
xorps %xmm0, %xmm0
andq $0x0, 0xa0(%rsp)
movaps %xmm0, 0x90(%rsp)
movq 0x18(%rbx), %rax
movq %rax, 0x20(%rsp)
movq 0x20(%rbx), %rax
movq %rax, 0x18(%rsp)
movq 0x28(%rbx), %rax
movq %rax, 0x10(%rsp)
leaq 0x4e3b(%rip), %rsi      # 0x11a44
movq %r14, %rdi
callq 0x3260
leaq 0x4cb3(%rip), %rsi      # 0x118cb
movq %rax, %rdi
callq 0x3260
movq %rax, %rdi
callq 0x31b0
movl 0x20(%rsp), %r14d
movl 0x18(%rsp), %eax
movl 0x10(%rsp), %ecx
movslq %r14d, %rsi
movq %rax, 0x50(%rsp)
movslq %eax, %rdx
movq %rcx, 0x48(%rsp)
movslq %ecx, %rcx
leaq 0x90(%rsp), %rdi
pushq $0x1
popq %r8
callq 0x6fda
movq 0xb368(%rip), %rdi      # 0x17fc8
leaq 0x4df4(%rip), %rsi      # 0x11a5b
callq 0x3260
movq %rax, %rdi
callq 0x31b0
decl %ebp
pushq $0x2
popq %rcx
movl %ebp, %eax
cltd
idivl %ecx
movl %eax, %ecx
movq 0x20(%rsp), %rax
decl %eax
movq %rax, 0x20(%rsp)
movq 0x18(%rsp), %rax
decl %eax
movq %rax, 0x18(%rsp)
movq 0x10(%rsp), %rax
decl %eax
movq %rax, 0x10(%rsp)
movq %rcx, 0x28(%rsp)
movl %ecx, %eax
negl %eax
xorl %r15d, %r15d
movl %eax, 0xc(%rsp)
movq %r14, 0x58(%rsp)
testl %eax, %eax
movl $0x0, %ecx
cmovgl %eax, %ecx
movq %rcx, 0x80(%rsp)
cmpq 0x48(%rsp), %r15
je 0xce47
movl %eax, 0x3c(%rsp)
movq 0x28(%rsp), %rax
addl %r15d, %eax
movq 0x10(%rsp), %rcx
cmpl %eax, %ecx
cmovll %ecx, %eax
movslq %eax, %r13
xorl %ebp, %ebp
movl 0xc(%rsp), %eax
movq %r15, 0x60(%rsp)
testl %eax, %eax
movl $0x0, %ecx
movl %eax, 0x40(%rsp)
cmovgl %eax, %ecx
movq %rcx, 0x78(%rsp)
cmpq 0x50(%rsp), %rbp
je 0xce39
movq 0x28(%rsp), %rax
addl %ebp, %eax
movq 0x18(%rsp), %rcx
cmpl %eax, %ecx
cmovll %ecx, %eax
cltq
movq %rax, 0x88(%rsp)
xorl %esi, %esi
movl 0xc(%rsp), %eax
movq %rbp, 0x70(%rsp)
testl %eax, %eax
movl $0x0, %r12d
movl %eax, 0x44(%rsp)
cmovgl %eax, %r12d
cmpq %r14, %rsi
je 0xce2b
movq %rbx, %rdi
movq %rsi, 0x30(%rsp)
movq %rbp, %rdx
movq %r15, %rcx
callq 0xad44
cmpb $0x1, %al
je 0xce18
movq 0x28(%rsp), %rax
movq 0x30(%rsp), %rcx
addl %ecx, %eax
movq 0x20(%rsp), %rcx
cmpl %eax, %ecx
cmovll %ecx, %eax
cltq
xorl %ebp, %ebp
movq %rax, 0x68(%rsp)
movq 0x78(%rsp), %r14
cmpq %rax, %r12
jg 0xcded
cmpq 0x88(%rsp), %r14
jg 0xcde0
movq 0x80(%rsp), %r15
cmpq %r13, %r15
jg 0xcddb
movq %rbx, %rdi
movq %r12, %rsi
movq %r14, %rdx
movq %r15, %rcx
callq 0xad44
movzbl %bpl, %ecx
movzbl %al, %ebp
cmpb %bpl, %cl
cmoval %ecx, %ebp
incq %r15
cmpb $0x1, %bpl
jne 0xcdad
jmp 0xcdea
incq %r14
jmp 0xcd9b
incq %r12
movq 0x68(%rsp), %rax
jmp 0xcd91
movb $0x1, %bpl
movzbl %bpl, %r8d
leaq 0x90(%rsp), %rdi
movq 0x30(%rsp), %rsi
movq 0x70(%rsp), %rbp
movq %rbp, %rdx
movq 0x60(%rsp), %r15
movq %r15, %rcx
callq 0x72fc
movq 0x58(%rsp), %r14
movq 0x30(%rsp), %rsi
incq %rsi
movl 0x44(%rsp), %eax
incl %eax
jmp 0xcd3e
incq %rbp
movl 0x40(%rsp), %eax
incl %eax
jmp 0xccfa
incq %r15
movl 0x3c(%rsp), %eax
incl %eax
jmp 0xccb9
leaq 0x90(%rsp), %rsi
movq %rbx, %rdi
callq 0xab0f
movq 0xb16a(%rip), %rdi      # 0x17fc8
leaq 0x4a1d(%rip), %rsi      # 0x11882
callq 0x3260
movq %rax, %rdi
callq 0x3110
leaq 0x90(%rsp), %rdi
callq 0xb29a
addq $0xc8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0xce99
jmp 0xce99
jmp 0xce99
jmp 0xce99
movq %rax, %rbx
leaq 0x90(%rsp), %rdi
callq 0xb29a
movq %rbx, %rdi
callq 0x3420
nop