// File: /workspace/github_cpp_makefile_star2_O1/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 $0xf8, %rsp
movl %esi, %r14d
movq %rdi, %rbx
movq 0xbabc(%rip), %r15      # 0x1cfc8
leaq 0x656a(%rip), %rsi      # 0x17a7d
movl $0x11, %edx
movq %r15, %rdi
callq 0x3300
movq %r15, %rdi
movl %r14d, %esi
callq 0x3430
movq %rax, %r12
leaq 0x63e1(%rip), %rsi      # 0x17916
movl $0x6, %edx
movq %rax, %rdi
callq 0x3300
movq %r12, %rdi
callq 0x31e0
xorps %xmm0, %xmm0
movaps %xmm0, 0x60(%rsp)
movq $0x0, 0x70(%rsp)
movq 0x18(%rbx), %rax
movq %rax, 0x20(%rsp)
movq 0x20(%rbx), %rax
movq %rax, 0x18(%rsp)
movq %rbx, 0x30(%rsp)
movq 0x28(%rbx), %rax
movq %rax, 0x8(%rsp)
leaq 0x650d(%rip), %rsi      # 0x17a8f
movl $0x16, %edx
movq %r15, %rdi
callq 0x3300
movq 0xba32(%rip), %rdi      # 0x1cfc8
leaq 0x6379(%rip), %rsi      # 0x17916
movl $0x6, %edx
callq 0x3300
movq 0xba1a(%rip), %rdi      # 0x1cfc8
callq 0x31e0
movl 0x20(%rsp), %ebx
movl 0x18(%rsp), %eax
movl 0x8(%rsp), %ecx
movslq %ebx, %rsi
movq %rax, 0x98(%rsp)
movslq %eax, %rdx
movq %rcx, 0x90(%rsp)
movslq %ecx, %rcx
leaq 0x60(%rsp), %rdi
movl $0x1, %r8d
callq 0x8fd8
movq 0xb9d9(%rip), %rdi      # 0x1cfc8
leaq 0x64b0(%rip), %rsi      # 0x17aa6
movl $0xa, %edx
callq 0x3300
movq 0xb9c1(%rip), %rdi      # 0x1cfc8
callq 0x31e0
cmpl $0x0, 0x8(%rsp)
je 0x11891
movl %r14d, %eax
decl %eax
shrl $0x1f, %eax
addl %r14d, %eax
decl %eax
sarl %eax
movq %rax, 0x28(%rsp)
movl %eax, %ecx
negl %ecx
movq 0x20(%rsp), %rax
decl %eax
movl %eax, 0x48(%rsp)
movq 0x18(%rsp), %rax
decl %eax
movl %eax, 0x40(%rsp)
movq 0x8(%rsp), %rax
decl %eax
movq %rax, 0x8(%rsp)
xorl %r14d, %r14d
movl %ecx, 0x14(%rsp)
movq %rbx, 0xa0(%rsp)
testl %ecx, %ecx
movl $0x0, %eax
movl %ecx, 0x3c(%rsp)
cmovgl %ecx, %eax
movq %rax, 0xd8(%rsp)
cmpl $0x0, 0x18(%rsp)
je 0x1187a
movl %r14d, %edx
movq 0x28(%rsp), %rax
subl %eax, %edx
testl %edx, %edx
movl $0x0, %ecx
cmovlel %ecx, %edx
movl %edx, 0x5c(%rsp)
leal (%rax,%r14), %ecx
movq 0x8(%rsp), %rax
cmpl %ecx, %eax
cmovll %eax, %ecx
movl %ecx, 0x58(%rsp)
movslq %ecx, %r12
xorl %r15d, %r15d
movl 0x14(%rsp), %eax
movq %r14, 0xa8(%rsp)
testl %eax, %eax
movl $0x0, %ecx
movl %eax, 0x44(%rsp)
cmovgl %eax, %ecx
movq %rcx, 0xc0(%rsp)
cmpl $0x0, 0x20(%rsp)
je 0x11863
movq 0x28(%rsp), %rax
leal (%rax,%r15), %ecx
movl %r15d, %edx
subl %eax, %edx
testl %edx, %edx
movl $0x0, %eax
cmovlel %eax, %edx
movl 0x40(%rsp), %eax
cmpl %ecx, %eax
cmovll %eax, %ecx
movl %edx, 0x50(%rsp)
cmpl %ecx, %edx
setg 0x7(%rsp)
movl %ecx, 0x54(%rsp)
movslq %ecx, %rax
movq %rax, 0xd0(%rsp)
xorl %r13d, %r13d
movl 0x14(%rsp), %eax
movq %r15, 0xb0(%rsp)
testl %eax, %eax
movl $0x0, %ebp
movl %eax, 0x4c(%rsp)
cmovgl %eax, %ebp
movq 0x30(%rsp), %rdi
movq %r13, %rsi
movq %r15, %rdx
movq %r14, %rcx
callq 0xeaa4
cmpb $0x1, %al
je 0x11851
movq 0x28(%rsp), %rdx
leal (%rdx,%r13), %eax
movq %r13, 0xb8(%rsp)
movl %r13d, %ecx
subl %edx, %ecx
xorl %r13d, %r13d
testl %ecx, %ecx
cmovlel %r13d, %ecx
movl 0x48(%rsp), %edx
cmpl %eax, %edx
cmovll %edx, %eax
cmpl %eax, %ecx
jg 0x1181a
cltq
movq %rax, 0xc8(%rsp)
xorl %r13d, %r13d
movq 0xc0(%rsp), %r14
movb 0x7(%rsp), %bl
movl 0x50(%rsp), %eax
cmpl 0x54(%rsp), %eax
jg 0x11805
movq 0xd8(%rsp), %r15
movl 0x58(%rsp), %eax
cmpl %eax, 0x5c(%rsp)
jg 0x117ea
movq 0x30(%rsp), %rdi
movq %rbp, %rsi
movq %r14, %rdx
movq %r15, %rcx
callq 0xeaa4
movzbl %r13b, %ecx
movzbl %al, %r13d
cmpb %r13b, %cl
cmoval %ecx, %r13d
cmpb $0x1, %r13b
je 0x11800
leaq 0x1(%r15), %rax
cmpq %r12, %r15
movq %rax, %r15
jl 0x117b6
leaq 0x1(%r14), %rax
cmpq 0xd0(%rsp), %r14
setge %bl
movq %rax, %r14
jl 0x117a4
jmp 0x11805
testb $0x1, %bl
je 0x1181a
leaq 0x1(%rbp), %rax
cmpq 0xc8(%rsp), %rbp
movq %rax, %rbp
jl 0x1178e
movzbl %r13b, %r8d
leaq 0x60(%rsp), %rdi
movq 0xb8(%rsp), %r13
movq %r13, %rsi
movq 0xb0(%rsp), %r15
movq %r15, %rdx
movq 0xa8(%rsp), %r14
movq %r14, %rcx
callq 0x949e
movq 0xa0(%rsp), %rbx
incq %r13
movl 0x4c(%rsp), %eax
incl %eax
cmpq %rbx, %r13
jne 0x11728
incq %r15
movl 0x44(%rsp), %eax
incl %eax
cmpq 0x98(%rsp), %r15
jne 0x116bd
incq %r14
movl 0x3c(%rsp), %ecx
incl %ecx
cmpq 0x90(%rsp), %r14
jne 0x11660
movq 0x30(%rsp), %r9
leaq 0x18(%r9), %rax
movq 0x10(%r9), %rcx
movups (%r9), %xmm0
xorps %xmm1, %xmm1
movups %xmm1, (%r9)
xorl %edx, %edx
movq %rdx, 0x10(%r9)
movq 0x10(%rax), %rsi
movq %rsi, 0xf0(%rsp)
movups (%rax), %xmm2
movaps %xmm2, 0xe0(%rsp)
movaps 0x60(%rsp), %xmm2
movq 0x70(%rsp), %rsi
movq %rdx, 0x60(%rsp)
movq 0x8(%r9), %rdi
movq 0x10(%r9), %r8
movups %xmm2, (%r9)
movq %rsi, 0x10(%r9)
movq %rdi, 0x68(%rsp)
movq %r8, 0x70(%rsp)
movq %rdx, 0x70(%rsp)
movaps %xmm1, 0x60(%rsp)
movq 0x88(%rsp), %rdx
movq %rdx, 0x10(%rax)
movups 0x78(%rsp), %xmm1
movups %xmm1, (%rax)
movaps %xmm0, 0x60(%rsp)
movq %rcx, 0x70(%rsp)
movaps 0xe0(%rsp), %xmm0
movups %xmm0, 0x78(%rsp)
movq 0xf0(%rsp), %rax
movq %rax, 0x88(%rsp)
movq 0xb68d(%rip), %rbx      # 0x1cfc8
leaq 0x5f8b(%rip), %rsi      # 0x178cd
movl $0x5, %edx
movq %rbx, %rdi
callq 0x3300
movq (%rbx), %rax
addq -0x18(%rax), %rbx
movq %rbx, %rdi
movl $0xa, %esi
callq 0x32b0
movsbl %al, %esi
movq 0xb65b(%rip), %rdi      # 0x1cfc8
callq 0x3040
movq %rax, %rdi
callq 0x31e0
movq 0x60(%rsp), %rdi
testq %rdi, %rdi
je 0x11989
callq 0x3290
addq $0xf8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x119a3
jmp 0x119a3
jmp 0x119a3
jmp 0x119a3
movq %rax, %rbx
movq 0x60(%rsp), %rdi
testq %rdi, %rdi
je 0x119b5
callq 0x3290
movq %rbx, %rdi
callq 0x3440
nop