// File: 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:
subq $0x108, %rsp            # imm = 0x108
movq %rdi, 0x100(%rsp)
movl %esi, 0xfc(%rsp)
movq 0x1bb33(%rip), %rdi     # 0x33fc0
movq %rdi, 0x30(%rsp)
leaq 0x10561(%rip), %rsi     # 0x289fa
callq 0x3290
movq %rax, %rdi
movl 0xfc(%rsp), %esi
callq 0x3470
movq %rax, %rdi
leaq 0x103dc(%rip), %rsi     # 0x28893
callq 0x3290
movq %rax, %rdi
movq 0x1bb02(%rip), %rsi     # 0x33fc8
callq 0x32c0
leaq 0xc8(%rsp), %rdi
callq 0xa200
movq 0x100(%rsp), %rdi
callq 0x125e0
movl %eax, 0xc4(%rsp)
movq 0x100(%rsp), %rdi
callq 0x125f0
movl %eax, 0xc0(%rsp)
movq 0x100(%rsp), %rdi
callq 0x12600
movq 0x30(%rsp), %rdi
movl %eax, 0xbc(%rsp)
leaq 0x104ec(%rip), %rsi     # 0x28a0c
callq 0x3290
movq %rax, 0x38(%rsp)
jmp 0x1852c
movq 0x38(%rsp), %rdi
leaq 0x1035b(%rip), %rsi     # 0x28893
callq 0x3290
movq %rax, 0x28(%rsp)
jmp 0x18544
movq 0x28(%rsp), %rdi
movq 0x1ba78(%rip), %rsi     # 0x33fc8
callq 0x32c0
jmp 0x18557
movslq 0xc4(%rsp), %rsi
movslq 0xc0(%rsp), %rdx
movslq 0xbc(%rsp), %rcx
leaq 0xc8(%rsp), %rdi
movl $0x1, %r8d
callq 0xa210
jmp 0x18584
movq 0x1ba35(%rip), %rdi     # 0x33fc0
leaq 0x10491(%rip), %rsi     # 0x28a23
callq 0x3290
movq %rax, 0x20(%rsp)
jmp 0x1859e
movq 0x20(%rsp), %rdi
movq 0x1ba1e(%rip), %rsi     # 0x33fc8
callq 0x32c0
jmp 0x185b1
movl 0xfc(%rsp), %eax
subl $0x1, %eax
movl $0x2, %ecx
cltd
idivl %ecx
movl %eax, 0xa8(%rsp)
movl $0x0, 0xa4(%rsp)
movl 0xa4(%rsp), %eax
cmpl 0xbc(%rsp), %eax
je 0x1892b
movl $0x0, 0xa0(%rsp)
movl 0xa0(%rsp), %eax
cmpl 0xc0(%rsp), %eax
je 0x18913
movl $0x0, 0x9c(%rsp)
movl 0x9c(%rsp), %eax
cmpl 0xc4(%rsp), %eax
je 0x188fb
movq 0x100(%rsp), %rdi
movslq 0x9c(%rsp), %rsi
movslq 0xa0(%rsp), %rdx
movslq 0xa4(%rsp), %rcx
callq 0x13b70
movb %al, 0x1f(%rsp)
jmp 0x18652
movb 0x1f(%rsp), %al
movzbl %al, %eax
cmpl $0x1, %eax
je 0x188e3
movl 0x9c(%rsp), %eax
subl 0xa8(%rsp), %eax
movl %eax, 0x94(%rsp)
movl $0x0, 0x90(%rsp)
leaq 0x94(%rsp), %rdi
leaq 0x90(%rsp), %rsi
callq 0x127b0
movl (%rax), %eax
movl %eax, 0x98(%rsp)
movl 0x9c(%rsp), %eax
addl 0xa8(%rsp), %eax
movl %eax, 0x88(%rsp)
movl 0xc4(%rsp), %eax
subl $0x1, %eax
movl %eax, 0x84(%rsp)
leaq 0x88(%rsp), %rdi
leaq 0x84(%rsp), %rsi
callq 0x127f0
movl (%rax), %eax
movl %eax, 0x8c(%rsp)
movl 0xa0(%rsp), %eax
subl 0xa8(%rsp), %eax
movl %eax, 0x7c(%rsp)
movl $0x0, 0x78(%rsp)
leaq 0x7c(%rsp), %rdi
leaq 0x78(%rsp), %rsi
callq 0x127b0
movl (%rax), %eax
movl %eax, 0x80(%rsp)
movl 0xa0(%rsp), %eax
addl 0xa8(%rsp), %eax
movl %eax, 0x70(%rsp)
movl 0xc0(%rsp), %eax
subl $0x1, %eax
movl %eax, 0x6c(%rsp)
leaq 0x70(%rsp), %rdi
leaq 0x6c(%rsp), %rsi
callq 0x127f0
movl (%rax), %eax
movl %eax, 0x74(%rsp)
movl 0xa4(%rsp), %eax
subl 0xa8(%rsp), %eax
movl %eax, 0x64(%rsp)
movl $0x0, 0x60(%rsp)
leaq 0x64(%rsp), %rdi
leaq 0x60(%rsp), %rsi
callq 0x127b0
movl (%rax), %eax
movl %eax, 0x68(%rsp)
movl 0xa4(%rsp), %eax
addl 0xa8(%rsp), %eax
movl %eax, 0x58(%rsp)
movl 0xbc(%rsp), %eax
subl $0x1, %eax
movl %eax, 0x54(%rsp)
leaq 0x58(%rsp), %rdi
leaq 0x54(%rsp), %rsi
callq 0x127f0
movl (%rax), %eax
movl %eax, 0x5c(%rsp)
movb $0x0, 0x53(%rsp)
movl 0x98(%rsp), %eax
movl %eax, 0x4c(%rsp)
movl 0x4c(%rsp), %eax
cmpl 0x8c(%rsp), %eax
jg 0x188b2
movl 0x80(%rsp), %eax
movl %eax, 0x48(%rsp)
movl 0x48(%rsp), %eax
cmpl 0x74(%rsp), %eax
jg 0x188a0
movl 0x68(%rsp), %eax
movl %eax, 0x44(%rsp)
movl 0x44(%rsp), %eax
cmpl 0x5c(%rsp), %eax
jg 0x1888e
movq 0x100(%rsp), %rdi
movslq 0x4c(%rsp), %rsi
movslq 0x48(%rsp), %rdx
movslq 0x44(%rsp), %rcx
callq 0x13b70
movb %al, 0x1e(%rsp)
jmp 0x18821
movb 0x1e(%rsp), %al
movb %al, 0x43(%rsp)
leaq 0x53(%rsp), %rdi
leaq 0x43(%rsp), %rsi
callq 0x1ce60
movq %rax, 0x10(%rsp)
jmp 0x1883f
movq 0x10(%rsp), %rax
movb (%rax), %al
movb %al, 0x53(%rsp)
movzbl 0x53(%rsp), %eax
cmpl $0x1, %eax
jne 0x1887c
jmp 0x188b4
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0xb0(%rsp)
movl %eax, 0xac(%rsp)
leaq 0xc8(%rsp), %rdi
callq 0xfda0
jmp 0x18982
jmp 0x1887e
movl 0x44(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x44(%rsp)
jmp 0x187f1
jmp 0x18890
movl 0x48(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x48(%rsp)
jmp 0x187db
jmp 0x188a2
movl 0x4c(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x4c(%rsp)
jmp 0x187bf
jmp 0x188b4
movslq 0x9c(%rsp), %rsi
movslq 0xa0(%rsp), %rdx
movslq 0xa4(%rsp), %rcx
movzbl 0x53(%rsp), %r8d
leaq 0xc8(%rsp), %rdi
callq 0xa6f0
jmp 0x188e1
jmp 0x188e3
jmp 0x188e5
movl 0x9c(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x9c(%rsp)
jmp 0x18613
jmp 0x188fd
movl 0xa0(%rsp), %eax
addl $0x1, %eax
movl %eax, 0xa0(%rsp)
jmp 0x185f4
jmp 0x18915
movl 0xa4(%rsp), %eax
addl $0x1, %eax
movl %eax, 0xa4(%rsp)
jmp 0x185d5
movq 0x100(%rsp), %rdi
leaq 0xc8(%rsp), %rsi
callq 0x12f60
movq 0x1b679(%rip), %rdi     # 0x33fc0
leaq 0xfefc(%rip), %rsi      # 0x2884a
callq 0x3290
movq %rax, 0x8(%rsp)
jmp 0x1895a
movq 0x8(%rsp), %rdi
movq 0x1b63a(%rip), %rsi     # 0x33fa0
callq 0x32c0
jmp 0x1896d
leaq 0xc8(%rsp), %rdi
callq 0xfda0
addq $0x108, %rsp            # imm = 0x108
retq
movq 0xb0(%rsp), %rdi
callq 0x34a0
nop