// File: /workspace/github_cpp_makefile_star2_O1/spatialfruitsalad[P]volume2position/./gauss_filter.hpp
// Function: void gaussFilter::gauss_filter_mask_5<float>(tomogram3d<float>&, int, float)
static void gauss_filter_mask_5 (tomogram3d<VALUE>& matrix_in, int masksize, float sigma){

    std::cout << "gauss_filter_neu: masksize " << masksize << "  ... " << std::flush;

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

    int tol = (masksize-1)/2;

    std::vector <float> mask1D (masksize);
    float sum = 0;
    
    for (int i = 0; i != masksize; ++i){
        float distance_square = pow(float(i-tol),2);
        float val = exp(-1*distance_square/(2*sigma*sigma));
        mask1D.at(i) = val;
        sum += val;
    }

    for (int i = 0; i != masksize; ++i){
        mask1D.at(i) = mask1D.at(i)/sum;
    }

    std::vector<VALUE> row_x (sx);
    for (int k = 0; k != sz; ++k)
    for (int j = 0; j != sy; ++j){
        for (int i = 0; i != sx; ++i){
            row_x.at(i) = matrix_in.get(i,j,k);
        }
        for (int i = 0; i != sx; ++i){
            int imin = std::max (i-tol, 0);
            int imax = std::min (i+tol, int (sx-1));
            float new_val = 0;
            for (int ii = imin; ii <= imax; ++ii){
                new_val += row_x.at(ii)*mask1D.at(ii-i+tol);
            }
            matrix_in.set(i,j,k,new_val);
        }
    }

    std::vector<VALUE> row_y (sy);
    for (int k = 0; k != sz; ++k)
    for (int i = 0; i != sx; ++i){
        for (int j = 0; j != sy; ++j){
            row_y.at(j) = matrix_in.get(i,j,k);
        }
        for (int j = 2; j != sy - 2; ++j){
            int jmin = std::max (j-tol, 0);
            int jmax = std::min (j+tol, int (sy-1));
            float new_val = 0;
            for (int jj = jmin; jj <= jmax; ++jj){
                new_val += row_y.at(jj)*mask1D.at(jj-j+tol);
            }
            matrix_in.set(i,j,k,new_val);
        }
    }

    std::vector<VALUE> row_z (sz);
    for (int i = 0; i != sx; ++i)
    for (int j = 0; j != sy; ++j){
        for (int k = 0; k != sz; ++k){
            row_z.at(k) = matrix_in.get(i,j,k);
        }
        for (int k = 2; k != sz - 2; ++k){
            int kmin = std::max (k-tol, 0);
            int kmax = std::min (k+tol, int (sz-1));
            float new_val = 0;
            for (int kk = kmin; kk <= kmax; ++kk){
                new_val += row_z.at(kk)*mask1D.at(kk-k+tol);
            }
            matrix_in.set(i,j,k,new_val);
        }
    }
    std::cout << " done" << std::endl;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0xc8, %rsp
movss %xmm0, (%rsp)
movl %esi, %r14d
movq %rdi, %r13
movq 0xd387(%rip), %r15      # 0x1cfc8
leaq 0x7cd5(%rip), %rsi      # 0x1791d
movl $0x1b, %edx
movq %r15, %rdi
callq 0x3300
movq %r15, %rdi
movl %r14d, %esi
callq 0x3430
movq %rax, %r15
leaq 0x7cac(%rip), %rsi      # 0x17916
movl $0x6, %edx
movq %rax, %rdi
callq 0x3300
movq %r15, %rdi
callq 0x31e0
movq 0x18(%r13), %rax
movq %rax, 0x8(%rsp)
movq 0x20(%r13), %rax
movq %rax, 0x30(%rsp)
movq 0x28(%r13), %rax
movq %rax, 0x38(%rsp)
leal -0x1(%r14), %eax
movl %eax, %ecx
shrl $0x1f, %ecx
addl %ecx, %eax
sarl %eax
movq %rax, 0x10(%rsp)
movslq %r14d, %r15
leaq 0x48(%rsp), %rdi
leaq 0xa8(%rsp), %rdx
movq %r15, %rsi
callq 0x121c6
xorps %xmm1, %xmm1
movl %r14d, %ebx
cmpl $0x1, %r15d
jb 0xfd5d
movss (%rsp), %xmm0
movaps %xmm0, %xmm1
addss %xmm0, %xmm1
mulss %xmm0, %xmm1
movss %xmm1, 0x20(%rsp)
movq 0x10(%rsp), %r12
negl %r12d
xorps %xmm1, %xmm1
xorl %r15d, %r15d
movss %xmm1, (%rsp)
leal (%r12,%r15), %eax
xorps %xmm0, %xmm0
cvtsi2ss %eax, %xmm0
movaps %xmm0, %xmm1
xorps 0x73fe(%rip), %xmm1     # 0x17110
mulss %xmm0, %xmm1
divss 0x20(%rsp), %xmm1
xorps %xmm0, %xmm0
cvtss2sd %xmm1, %xmm0
callq 0x3450
movq 0x48(%rsp), %rax
movq 0x50(%rsp), %rdx
subq %rax, %rdx
sarq $0x2, %rdx
cmpq %r15, %rdx
jbe 0x103a3
cvtsd2ss %xmm0, %xmm0
movss %xmm0, (%rax,%r15,4)
movss (%rsp), %xmm1
addss %xmm0, %xmm1
incq %r15
cmpq %r15, %rbx
jne 0xfcf8
testl %r14d, %r14d
je 0xfd94
movq 0x48(%rsp), %rax
movq 0x50(%rsp), %rdx
subq %rax, %rdx
sarq $0x2, %rdx
xorl %esi, %esi
cmpq %rsi, %rdx
je 0x10395
movss (%rax,%rsi,4), %xmm0
divss %xmm1, %xmm0
movss %xmm0, (%rax,%rsi,4)
incq %rsi
cmpq %rsi, %rbx
jne 0xfd75
movq %r13, (%rsp)
movl 0x8(%rsp), %eax
movq %rax, 0x20(%rsp)
movslq %eax, %rsi
leaq 0xa8(%rsp), %rdi
leaq 0x90(%rsp), %rdx
callq 0x121c6
movl 0x30(%rsp), %ebp
movq 0x38(%rsp), %rax
movl %eax, %ecx
movq %rcx, 0x40(%rsp)
testl %eax, %eax
movq %rbp, 0x70(%rsp)
je 0xff45
movq 0x8(%rsp), %rax
leal -0x1(%rax), %r13d
movq 0x10(%rsp), %rax
movl %eax, %ecx
negl %ecx
movl %ecx, 0x18(%rsp)
movl %eax, %eax
movq %rax, 0x68(%rsp)
xorl %r14d, %r14d
cmpl $0x0, 0x30(%rsp)
je 0xff37
xorl %r15d, %r15d
cmpl $0x0, 0x8(%rsp)
je 0xff26
xorl %r12d, %r12d
movq (%rsp), %rbx
movq 0x20(%rsp), %rbp
movq %rbx, %rdi
movq %r12, %rsi
movq %r15, %rdx
movq %r14, %rcx
callq 0xf418
movq 0xa8(%rsp), %rax
movq 0xb0(%rsp), %rdx
subq %rax, %rdx
sarq $0x2, %rdx
cmpq %r12, %rdx
jbe 0x10362
movss %xmm0, (%rax,%r12,4)
incq %r12
cmpq %r12, %rbp
jne 0xfe1b
cmpl $0x0, 0x8(%rsp)
je 0xff26
movq 0x68(%rsp), %rbp
xorl %r12d, %r12d
movl 0x18(%rsp), %ebx
movq 0x10(%rsp), %rcx
leal (%rcx,%r12), %r8d
movl %r12d, %eax
subl %ecx, %eax
testl %eax, %eax
movl $0x0, %ecx
cmovlel %ecx, %eax
cmpl %r8d, %r13d
cmovll %r13d, %r8d
xorps %xmm0, %xmm0
cmpl %r8d, %eax
jg 0xff01
testl %ebx, %ebx
movl $0x0, %esi
cmovgl %ebx, %esi
movq 0xa8(%rsp), %rax
movq 0xb0(%rsp), %rdx
subq %rax, %rdx
sarq $0x2, %rdx
movq 0x48(%rsp), %rdi
movq 0x50(%rsp), %rcx
subq %rdi, %rcx
sarq $0x2, %rcx
movslq %r8d, %r8
cmpq %rsi, %rdx
jbe 0x10340
leal (%rsi,%rbp), %r9d
movslq %r9d, %r9
cmpq %r9, %rcx
jbe 0x1033a
movss (%rax,%rsi,4), %xmm1
mulss (%rdi,%r9,4), %xmm1
addss %xmm1, %xmm0
leaq 0x1(%rsi), %r9
cmpq %r8, %rsi
movq %r9, %rsi
jl 0xfecd
movq (%rsp), %rdi
movq %r12, %rsi
movq %r15, %rdx
movq %r14, %rcx
callq 0xf774
incq %r12
incl %ebx
decq %rbp
cmpq 0x20(%rsp), %r12
jne 0xfe71
incq %r15
movq 0x70(%rsp), %rbp
cmpq %rbp, %r15
jne 0xfe04
incq %r14
cmpq 0x40(%rsp), %r14
jne 0xfdf6
movslq %ebp, %rsi
leaq 0x90(%rsp), %rdi
leaq 0x78(%rsp), %rdx
callq 0x121c6
movslq 0x10(%rsp), %rax
movq %rax, 0x60(%rsp)
cmpl $0x0, 0x38(%rsp)
movq (%rsp), %rbx
movq 0x20(%rsp), %r12
je 0x100fb
movq 0x30(%rsp), %rax
leal -0x2(%rax), %ecx
movq %rcx, 0x18(%rsp)
leal -0x1(%rax), %r13d
movl $0x2, %eax
subl 0x10(%rsp), %eax
movl %eax, 0x68(%rsp)
movq 0x60(%rsp), %rax
addq $-0x2, %rax
movq %rax, 0xc0(%rsp)
xorl %r14d, %r14d
cmpl $0x0, 0x8(%rsp)
je 0x100ed
xorl %r15d, %r15d
cmpl $0x0, 0x30(%rsp)
je 0x10001
xorl %r12d, %r12d
movq %rbx, %rdi
movq %r15, %rsi
movq %r12, %rdx
movq %r14, %rcx
callq 0xf418
movq 0x90(%rsp), %rax
movq 0x98(%rsp), %rdx
subq %rax, %rdx
sarq $0x2, %rdx
cmpq %r12, %rdx
jbe 0x10373
movss %xmm0, (%rax,%r12,4)
incq %r12
cmpq %r12, %rbp
jne 0xffc2
cmpl $0x2, 0x18(%rsp)
je 0x100d3
movl $0x2, %r12d
movq 0xc0(%rsp), %rbp
movl 0x68(%rsp), %ebx
movq 0x10(%rsp), %rcx
leal (%rcx,%r12), %r8d
movl %r12d, %eax
subl %ecx, %eax
testl %eax, %eax
movl $0x0, %ecx
cmovlel %ecx, %eax
cmpl %r8d, %r13d
cmovll %r13d, %r8d
xorps %xmm0, %xmm0
cmpl %r8d, %eax
jg 0x100ae
testl %ebx, %ebx
movl $0x0, %esi
cmovgl %ebx, %esi
movq 0x90(%rsp), %rax
movq 0x98(%rsp), %rdx
subq %rax, %rdx
sarq $0x2, %rdx
movq 0x48(%rsp), %rdi
movq 0x50(%rsp), %rcx
subq %rdi, %rcx
sarq $0x2, %rcx
movslq %r8d, %r8
cmpq %rsi, %rdx
jbe 0x1032c
leal (%rsi,%rbp), %r9d
movslq %r9d, %r9
cmpq %r9, %rcx
jbe 0x10326
movss (%rax,%rsi,4), %xmm1
mulss (%rdi,%r9,4), %xmm1
addss %xmm1, %xmm0
leaq 0x1(%rsi), %r9
cmpq %r8, %rsi
movq %r9, %rsi
jl 0x1007a
movq (%rsp), %rdi
movq %r15, %rsi
movq %r12, %rdx
movq %r14, %rcx
callq 0xf774
incq %r12
incl %ebx
decq %rbp
cmpq 0x18(%rsp), %r12
jne 0x1001e
incq %r15
movq 0x20(%rsp), %r12
cmpq %r12, %r15
movq (%rsp), %rbx
movq 0x70(%rsp), %rbp
jne 0xffb8
incq %r14
cmpq 0x40(%rsp), %r14
jne 0xffaa
movq 0x40(%rsp), %rbp
movslq %ebp, %rsi
leaq 0x78(%rsp), %rdi
leaq 0x2f(%rsp), %rdx
callq 0x121c6
cmpl $0x0, 0x8(%rsp)
je 0x1028c
movq 0x38(%rsp), %rax
leal -0x2(%rax), %ecx
movq %rcx, 0x18(%rsp)
leal -0x1(%rax), %r13d
movl $0x2, %eax
subl 0x10(%rsp), %eax
movl %eax, 0x8(%rsp)
addq $-0x2, 0x60(%rsp)
xorl %r14d, %r14d
cmpl $0x0, 0x30(%rsp)
je 0x10280
xorl %r15d, %r15d
cmpl $0x0, 0x38(%rsp)
je 0x10198
xorl %r12d, %r12d
movq %rbx, %rdi
movq %r14, %rsi
movq %r15, %rdx
movq %r12, %rcx
callq 0xf418
movq 0x78(%rsp), %rax
movq 0x80(%rsp), %rdx
subq %rax, %rdx
sarq $0x2, %rdx
cmpq %r12, %rdx
jbe 0x10384
movss %xmm0, (%rax,%r12,4)
incq %r12
cmpq %r12, %rbp
jne 0x1015c
cmpl $0x2, 0x18(%rsp)
je 0x10264
movl $0x2, %r12d
movq 0x60(%rsp), %rbp
movl 0x8(%rsp), %ebx
movq 0x10(%rsp), %rcx
leal (%rcx,%r12), %r8d
movl %r12d, %eax
subl %ecx, %eax
testl %eax, %eax
movl $0x0, %ecx
cmovlel %ecx, %eax
cmpl %r8d, %r13d
cmovll %r13d, %r8d
xorps %xmm0, %xmm0
cmpl %r8d, %eax
jg 0x1023f
testl %ebx, %ebx
movl $0x0, %esi
cmovgl %ebx, %esi
movq 0x78(%rsp), %rax
movq 0x80(%rsp), %rdx
subq %rax, %rdx
sarq $0x2, %rdx
movq 0x48(%rsp), %rdi
movq 0x50(%rsp), %rcx
subq %rdi, %rcx
sarq $0x2, %rcx
movslq %r8d, %r8
cmpq %rsi, %rdx
jbe 0x10354
leal (%rsi,%rbp), %r9d
movslq %r9d, %r9
cmpq %r9, %rcx
jbe 0x1034e
movss (%rax,%rsi,4), %xmm1
mulss (%rdi,%r9,4), %xmm1
addss %xmm1, %xmm0
leaq 0x1(%rsi), %r9
cmpq %r8, %rsi
movq %r9, %rsi
jl 0x1020b
movq (%rsp), %rdi
movq %r14, %rsi
movq %r15, %rdx
movq %r12, %rcx
callq 0xf774
incq %r12
incl %ebx
decq %rbp
cmpq 0x18(%rsp), %r12
jne 0x101b2
incq %r15
cmpq 0x70(%rsp), %r15
movq (%rsp), %rbx
movq 0x20(%rsp), %r12
movq 0x40(%rsp), %rbp
jne 0x10152
incq %r14
cmpq %r12, %r14
jne 0x10144
movq 0xcd35(%rip), %rbx      # 0x1cfc8
leaq 0x7633(%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 0xcd03(%rip), %rdi      # 0x1cfc8
callq 0x3040
movq %rax, %rdi
callq 0x31e0
movq 0x78(%rsp), %rdi
testq %rdi, %rdi
je 0x102e1
callq 0x3290
movq 0x90(%rsp), %rdi
testq %rdi, %rdi
je 0x102f3
callq 0x3290
movq 0xa8(%rsp), %rdi
testq %rdi, %rdi
je 0x10305
callq 0x3290
movq 0x48(%rsp), %rdi
testq %rdi, %rdi
je 0x10314
callq 0x3290
addq $0xc8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %r9, %rsi
movq %rcx, %rdx
leaq 0x7436(%rip), %rdi      # 0x17769
xorl %eax, %eax
callq 0x33a0
movq %r9, %rsi
movq %rcx, %rdx
leaq 0x7422(%rip), %rdi      # 0x17769
xorl %eax, %eax
callq 0x33a0
movq %r9, %rsi
movq %rcx, %rdx
leaq 0x740e(%rip), %rdi      # 0x17769
xorl %eax, %eax
callq 0x33a0
leaq 0x7400(%rip), %rdi      # 0x17769
movq %r12, %rsi
xorl %eax, %eax
callq 0x33a0
leaq 0x73ef(%rip), %rdi      # 0x17769
movq %r12, %rsi
xorl %eax, %eax
callq 0x33a0
leaq 0x73de(%rip), %rdi      # 0x17769
movq %r12, %rsi
xorl %eax, %eax
callq 0x33a0
leaq 0x73cd(%rip), %rdi      # 0x17769
xorl %eax, %eax
callq 0x33a0
leaq 0x73bf(%rip), %rdi      # 0x17769
movq %r15, %rsi
xorl %eax, %eax
callq 0x33a0
jmp 0x103ee
jmp 0x103e9
jmp 0x103be
jmp 0x103d5
jmp 0x103be
movq %rax, %rbx
jmp 0x10415
jmp 0x103d5
jmp 0x103e9
jmp 0x103ee
jmp 0x103d5
jmp 0x103d5
jmp 0x103ee
jmp 0x103ee
jmp 0x103e9
jmp 0x103e9
movq %rax, %rbx
movq 0x78(%rsp), %rdi
testq %rdi, %rdi
je 0x103f1
callq 0x3290
jmp 0x103f1
movq %rax, %rbx
jmp 0x10403
movq %rax, %rbx
movq 0x90(%rsp), %rdi
testq %rdi, %rdi
je 0x10403
callq 0x3290
movq 0xa8(%rsp), %rdi
testq %rdi, %rdi
je 0x10415
callq 0x3290
movq 0x48(%rsp), %rdi
testq %rdi, %rdi
je 0x10424
callq 0x3290
movq %rbx, %rdi
callq 0x3440