// File: /workspace/github_cpp_makefile_star2_O3/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 $0xe8, %rsp
movl %esi, %r14d
movq %rdi, %rbx
movq 0xbba2(%rip), %r15      # 0x1cfc8
leaq 0x6640(%rip), %rsi      # 0x17a6d
movl $0x11, %edx
movq %r15, %rdi
callq 0x32f0
movq %r15, %rdi
movl %r14d, %esi
callq 0x3420
movq %rax, %r12
leaq 0x64b7(%rip), %rsi      # 0x17906
movl $0x6, %edx
movq %rax, %rdi
callq 0x32f0
movq %r12, %rdi
callq 0x31e0
xorps %xmm0, %xmm0
movaps %xmm0, 0x50(%rsp)
movq $0x0, 0x60(%rsp)
movq 0x18(%rbx), %rax
movq %rax, 0x18(%rsp)
movq 0x20(%rbx), %rax
movq %rax, 0x10(%rsp)
movq %rbx, 0x28(%rsp)
movq 0x28(%rbx), %rax
movq %rax, (%rsp)
leaq 0x65e4(%rip), %rsi      # 0x17a7f
movl $0x16, %edx
movq %r15, %rdi
callq 0x32f0
movq 0xbb19(%rip), %rdi      # 0x1cfc8
leaq 0x6450(%rip), %rsi      # 0x17906
movl $0x6, %edx
callq 0x32f0
movq 0xbb01(%rip), %rdi      # 0x1cfc8
callq 0x31e0
movl 0x18(%rsp), %r15d
movl 0x10(%rsp), %eax
movl (%rsp), %ecx
movslq %r15d, %rsi
movq %rax, 0x88(%rsp)
movslq %eax, %rdx
movq %rcx, 0x80(%rsp)
movslq %ecx, %rcx
leaq 0x50(%rsp), %rdi
movl $0x1, %r8d
callq 0x8e82
movq 0xbac0(%rip), %rdi      # 0x1cfc8
leaq 0x6587(%rip), %rsi      # 0x17a96
movl $0xa, %edx
callq 0x32f0
movq 0xbaa8(%rip), %rdi      # 0x1cfc8
callq 0x31e0
cmpl $0x0, (%rsp)
je 0x11789
movl %r14d, %eax
decl %eax
shrl $0x1f, %eax
addl %r14d, %eax
decl %eax
sarl %eax
movq %rax, 0x20(%rsp)
movl %eax, %ecx
negl %ecx
movq 0x18(%rsp), %rax
decl %eax
movl %eax, 0x3c(%rsp)
movq 0x10(%rsp), %rax
decl %eax
movl %eax, 0x34(%rsp)
movq (%rsp), %rax
decl %eax
movq %rax, (%rsp)
xorl %r14d, %r14d
movl %ecx, 0xc(%rsp)
movq %r15, 0x90(%rsp)
testl %ecx, %ecx
movl $0x0, %eax
movl %ecx, 0x30(%rsp)
cmovgl %ecx, %eax
movq %rax, 0xc0(%rsp)
cmpl $0x0, 0x10(%rsp)
je 0x11772
movl %r14d, %edx
movq 0x20(%rsp), %rax
subl %eax, %edx
testl %edx, %edx
movl $0x0, %ecx
cmovlel %ecx, %edx
movl %edx, 0x4c(%rsp)
leal (%rax,%r14), %ecx
movq (%rsp), %rax
cmpl %ecx, %eax
cmovll %eax, %ecx
movl %ecx, 0x48(%rsp)
movslq %ecx, %rax
movq %rax, 0xc8(%rsp)
xorl %r12d, %r12d
movl 0xc(%rsp), %eax
movq %r14, 0x98(%rsp)
testl %eax, %eax
movl $0x0, %ecx
movl %eax, 0x38(%rsp)
cmovgl %eax, %ecx
movq %rcx, 0xb0(%rsp)
cmpl $0x0, 0x18(%rsp)
je 0x1175b
movl %r12d, %edx
movq 0x20(%rsp), %rax
subl %eax, %edx
testl %edx, %edx
movl $0x0, %ecx
cmovlel %ecx, %edx
movl %edx, 0x44(%rsp)
leal (%rax,%r12), %ecx
movl 0x34(%rsp), %eax
cmpl %ecx, %eax
cmovll %eax, %ecx
movl %ecx, 0x40(%rsp)
movslq %ecx, %rax
movq %rax, 0xb8(%rsp)
xorl %r13d, %r13d
movl 0xc(%rsp), %ebx
movq %r12, 0xa0(%rsp)
testl %ebx, %ebx
movl $0x0, %ebp
cmovgl %ebx, %ebp
movq 0x28(%rsp), %rdi
movq %r13, %rsi
movq %r12, %rdx
movq %r14, %rcx
callq 0xe968
cmpb $0x1, %al
je 0x1174d
movq 0x20(%rsp), %rdx
leal (%rdx,%r13), %eax
movl %r13d, %ecx
subl %edx, %ecx
xorl %r12d, %r12d
testl %ecx, %ecx
cmovlel %r12d, %ecx
movl 0x3c(%rsp), %edx
cmpl %eax, %edx
cmovll %edx, %eax
cmpl %eax, %ecx
jg 0x1171e
movl %eax, %eax
movq %rax, 0xa8(%rsp)
xorl %r12d, %r12d
movq 0xb0(%rsp), %r14
movl 0x40(%rsp), %eax
cmpl %eax, 0x44(%rsp)
jle 0x116bd
leaq 0x1(%rbp), %rax
cmpq 0xa8(%rsp), %rbp
movq %rax, %rbp
jb 0x11698
jmp 0x1171e
movq 0xc0(%rsp), %r15
movl 0x48(%rsp), %eax
cmpl %eax, 0x4c(%rsp)
jg 0x11708
movq 0x28(%rsp), %rdi
movq %rbp, %rsi
movq %r14, %rdx
movq %r15, %rcx
callq 0xe968
movzbl %r12b, %ecx
movzbl %al, %r12d
cmpb %r12b, %cl
cmoval %ecx, %r12d
cmpb $0x1, %r12b
je 0x1171b
leaq 0x1(%r15), %rax
cmpq 0xc8(%rsp), %r15
movq %rax, %r15
jl 0x116cf
leaq 0x1(%r14), %rax
cmpq 0xb8(%rsp), %r14
movq %rax, %r14
jl 0x116bd
jmp 0x116aa
movb $0x1, %r12b
movzbl %r12b, %r8d
leaq 0x50(%rsp), %rdi
movq %r13, %rsi
movq 0xa0(%rsp), %r12
movq %r12, %rdx
movq 0x98(%rsp), %r14
movq %r14, %rcx
callq 0x9356
movq 0x90(%rsp), %r15
incq %r13
incl %ebx
cmpq %r15, %r13
jne 0x1163e
incq %r12
movl 0x38(%rsp), %eax
incl %eax
cmpq 0x88(%rsp), %r12
jne 0x115da
incq %r14
movl 0x30(%rsp), %ecx
incl %ecx
cmpq 0x80(%rsp), %r14
jne 0x11576
movq 0x28(%rsp), %rsi
leaq 0x18(%rsi), %rax
movq 0x10(%rsi), %rcx
movq 0x10(%rax), %rdx
movq %rdx, 0xe0(%rsp)
movups (%rax), %xmm0
movaps %xmm0, 0xd0(%rsp)
movaps 0x50(%rsp), %xmm0
movq 0x60(%rsp), %rdx
movq %rdx, 0x10(%rsi)
movq 0x78(%rsp), %rdx
movq %rdx, 0x10(%rax)
movups 0x68(%rsp), %xmm1
movups %xmm1, (%rax)
movups (%rsi), %xmm1
movups %xmm0, (%rsi)
movaps %xmm1, 0x50(%rsp)
movq %rcx, 0x60(%rsp)
movaps 0xd0(%rsp), %xmm0
movups %xmm0, 0x68(%rsp)
movq 0xe0(%rsp), %rax
movq %rax, 0x78(%rsp)
movq 0xb7cb(%rip), %rbx      # 0x1cfc8
leaq 0x60b9(%rip), %rsi      # 0x178bd
movl $0x5, %edx
movq %rbx, %rdi
callq 0x32f0
movq (%rbx), %rax
addq -0x18(%rax), %rbx
movq %rbx, %rdi
movl $0xa, %esi
callq 0x32a0
movsbl %al, %esi
movq 0xb799(%rip), %rdi      # 0x1cfc8
callq 0x3040
movq %rax, %rdi
callq 0x31e0
movq 0x50(%rsp), %rdi
testq %rdi, %rdi
je 0x1184b
callq 0x3280
addq $0xe8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x11865
jmp 0x11865
jmp 0x11865
jmp 0x11865
movq %rax, %rbx
movq 0x50(%rsp), %rdi
testq %rdi, %rdi
je 0x11877
callq 0x3280
movq %rbx, %rdi
callq 0x3430
nop