// File: /workspace/github_cpp_makefile_star2_O3/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 0xd441(%rip), %r15      # 0x1cfc8
leaq 0x7d7f(%rip), %rsi      # 0x1790d
movl $0x1b, %edx
movq %r15, %rdi
callq 0x32f0
movq %r15, %rdi
movl %r14d, %esi
callq 0x3420
movq %rax, %r15
leaq 0x7d56(%rip), %rsi      # 0x17906
movl $0x6, %edx
movq %rax, %rdi
callq 0x32f0
movq %r15, %rdi
callq 0x31e0
movq 0x18(%r13), %rax
movq %rax, 0x10(%rsp)
movq 0x20(%r13), %rax
movq %rax, 0x28(%rsp)
movq 0x28(%r13), %rax
movq %rax, 0x30(%rsp)
leal -0x1(%r14), %eax
movl %eax, %ecx
shrl $0x1f, %ecx
addl %ecx, %eax
sarl %eax
movq %rax, 0x18(%rsp)
movslq %r14d, %r15
leaq 0x40(%rsp), %rdi
leaq 0xa8(%rsp), %rdx
movq %r15, %rsi
callq 0x12052
cmpl $0x1, %r15d
jb 0xfcd7
movss (%rsp), %xmm0
movaps %xmm0, %xmm1
addss %xmm0, %xmm1
mulss %xmm0, %xmm1
movss %xmm1, 0x8(%rsp)
movl %r14d, %ebx
movq 0x18(%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 0x74ab(%rip), %xmm1     # 0x17100
mulss %xmm0, %xmm1
divss 0x8(%rsp), %xmm1
xorps %xmm0, %xmm0
cvtss2sd %xmm1, %xmm0
callq 0x3440
movq 0x40(%rsp), %rax
movq 0x48(%rsp), %rdx
subq %rax, %rdx
sarq $0x2, %rdx
cmpq %r15, %rdx
jbe 0x102ca
cvtsd2ss %xmm0, %xmm0
movss %xmm0, (%rax,%r15,4)
movss (%rsp), %xmm1
addss %xmm0, %xmm1
incq %r15
cmpq %r15, %rbx
jne 0xfc3b
testl %r14d, %r14d
je 0xfcd7
movq 0x40(%rsp), %rax
movq 0x48(%rsp), %rdx
subq %rax, %rdx
sarq $0x2, %rdx
xorl %ecx, %ecx
cmpq %rcx, %rdx
je 0x102db
movss (%rax,%rcx,4), %xmm0
divss %xmm1, %xmm0
movss %xmm0, (%rax,%rcx,4)
incq %rcx
cmpq %rcx, %rbx
jne 0xfcb8
movq %r13, (%rsp)
movl 0x10(%rsp), %eax
movq %rax, 0x38(%rsp)
movslq %eax, %rsi
leaq 0xa8(%rsp), %rdi
leaq 0x90(%rsp), %rdx
callq 0x12052
movl 0x28(%rsp), %ecx
movq 0x30(%rsp), %rax
movl %eax, %ebx
testl %eax, %eax
movq %rcx, 0x70(%rsp)
movq %rbx, 0x60(%rsp)
je 0xfe8b
movq 0x10(%rsp), %rax
leal -0x1(%rax), %r13d
movq 0x18(%rsp), %rax
movl %eax, %edx
negl %edx
movl %edx, 0x8(%rsp)
movl %eax, %eax
movq %rax, 0x68(%rsp)
xorl %r14d, %r14d
cmpl $0x0, 0x28(%rsp)
je 0xfe7a
xorl %r15d, %r15d
cmpl $0x0, 0x10(%rsp)
je 0xfe69
xorl %r12d, %r12d
movq (%rsp), %rbx
movq 0x38(%rsp), %rbp
movq %rbx, %rdi
movq %r12, %rsi
movq %r15, %rdx
movq %r14, %rcx
callq 0xf342
movq 0xa8(%rsp), %rax
movq 0xb0(%rsp), %rdx
subq %rax, %rdx
sarq $0x2, %rdx
cmpq %r12, %rdx
jbe 0x10297
movss %xmm0, (%rax,%r12,4)
incq %r12
cmpq %r12, %rbp
jne 0xfd5e
cmpl $0x0, 0x10(%rsp)
je 0xfe69
movq 0x68(%rsp), %rbp
xorl %r12d, %r12d
movl 0x8(%rsp), %ebx
movq 0x18(%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 0xfe44
testl %ebx, %ebx
movl $0x0, %esi
cmovgl %ebx, %esi
movq 0xa8(%rsp), %rax
movq 0xb0(%rsp), %rdx
subq %rax, %rdx
sarq $0x2, %rdx
movq 0x40(%rsp), %rdi
movq 0x48(%rsp), %rcx
subq %rdi, %rcx
sarq $0x2, %rcx
movl %r8d, %r8d
cmpq %rsi, %rdx
jbe 0x10289
leal (%rsi,%rbp), %r9d
movslq %r9d, %r9
cmpq %r9, %rcx
jbe 0x10283
movss (%rax,%rsi,4), %xmm1
mulss (%rdi,%r9,4), %xmm1
addss %xmm1, %xmm0
leaq 0x1(%rsi), %r9
cmpq %r8, %rsi
movq %r9, %rsi
jb 0xfe10
movq (%rsp), %rdi
movq %r12, %rsi
movq %r15, %rdx
movq %r14, %rcx
callq 0xf6ac
incq %r12
incl %ebx
decq %rbp
cmpq 0x38(%rsp), %r12
jne 0xfdb4
incq %r15
movq 0x70(%rsp), %rcx
cmpq %rcx, %r15
jne 0xfd47
incq %r14
movq 0x60(%rsp), %rbx
cmpq %rbx, %r14
jne 0xfd39
movslq %ecx, %rsi
leaq 0x90(%rsp), %rdi
leaq 0x78(%rsp), %rdx
callq 0x12052
movslq 0x18(%rsp), %rax
movq %rax, 0x58(%rsp)
cmpl $0x0, 0x30(%rsp)
je 0x10038
movq 0x28(%rsp), %rax
leal -0x2(%rax), %ecx
movq %rcx, 0x8(%rsp)
leal -0x1(%rax), %r13d
movl $0x2, %eax
subl 0x18(%rsp), %eax
movl %eax, 0x68(%rsp)
movq 0x58(%rsp), %rax
addq $-0x2, %rax
movq %rax, 0xc0(%rsp)
xorl %r14d, %r14d
cmpl $0x0, 0x10(%rsp)
je 0x10027
xorl %r15d, %r15d
cmpl $0x0, 0x28(%rsp)
je 0xff52
xorl %r12d, %r12d
movq (%rsp), %rbx
movq 0x70(%rsp), %rbp
movq %rbx, %rdi
movq %r15, %rsi
movq %r12, %rdx
movq %r14, %rcx
callq 0xf342
movq 0x90(%rsp), %rax
movq 0x98(%rsp), %rdx
subq %rax, %rdx
sarq $0x2, %rdx
cmpq %r12, %rdx
jbe 0x102a8
movss %xmm0, (%rax,%r12,4)
incq %r12
cmpq %r12, %rbp
jne 0xff08
cmpl $0x2, 0x8(%rsp)
je 0x10019
movl $0x2, %r12d
movq 0xc0(%rsp), %rbp
movl 0x68(%rsp), %ebx
movq 0x18(%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 0xfff4
testl %ebx, %ebx
movl $0x0, %esi
cmovgl %ebx, %esi
movq 0x90(%rsp), %rax
movq 0x98(%rsp), %rdx
subq %rax, %rdx
sarq $0x2, %rdx
movq 0x40(%rsp), %rdi
movq 0x48(%rsp), %rcx
subq %rdi, %rcx
sarq $0x2, %rcx
movl %r8d, %r8d
cmpq %rsi, %rdx
jbe 0x10261
leal (%rsi,%rbp), %r9d
movslq %r9d, %r9
cmpq %r9, %rcx
jbe 0x1025b
movss (%rax,%rsi,4), %xmm1
mulss (%rdi,%r9,4), %xmm1
addss %xmm1, %xmm0
leaq 0x1(%rsi), %r9
cmpq %r8, %rsi
movq %r9, %rsi
jb 0xffc0
movq (%rsp), %rdi
movq %r15, %rsi
movq %r12, %rdx
movq %r14, %rcx
callq 0xf6ac
incq %r12
incl %ebx
decq %rbp
cmpq 0x8(%rsp), %r12
jne 0xff64
incq %r15
cmpq 0x38(%rsp), %r15
jne 0xfef5
incq %r14
movq 0x60(%rsp), %rbx
cmpq %rbx, %r14
jne 0xfee7
movslq %ebx, %rsi
leaq 0x78(%rsp), %rdi
leaq 0x27(%rsp), %rdx
callq 0x12052
cmpl $0x0, 0x10(%rsp)
je 0x101c1
movq 0x30(%rsp), %rax
leal -0x2(%rax), %ecx
movq %rcx, 0x8(%rsp)
leal -0x1(%rax), %r13d
movl $0x2, %eax
subl 0x18(%rsp), %eax
movl %eax, 0x10(%rsp)
addq $-0x2, 0x58(%rsp)
xorl %r14d, %r14d
cmpl $0x0, 0x28(%rsp)
je 0x101b3
xorl %r15d, %r15d
cmpl $0x0, 0x30(%rsp)
je 0x100e4
xorl %r12d, %r12d
movq (%rsp), %rbx
movq 0x60(%rsp), %rbp
movq %rbx, %rdi
movq %r14, %rsi
movq %r15, %rdx
movq %r12, %rcx
callq 0xf342
movq 0x78(%rsp), %rax
movq 0x80(%rsp), %rdx
subq %rax, %rdx
sarq $0x2, %rdx
cmpq %r12, %rdx
jbe 0x102b9
movss %xmm0, (%rax,%r12,4)
incq %r12
cmpq %r12, %rbp
jne 0x1009d
cmpl $0x2, 0x8(%rsp)
je 0x101a5
movl $0x2, %r12d
movq 0x58(%rsp), %rbp
movl 0x10(%rsp), %ebx
movq 0x18(%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 0x10180
testl %ebx, %ebx
movl $0x0, %esi
cmovgl %ebx, %esi
movq 0x78(%rsp), %rax
movq 0x80(%rsp), %rdx
subq %rax, %rdx
sarq $0x2, %rdx
movq 0x40(%rsp), %rdi
movq 0x48(%rsp), %rcx
subq %rdi, %rcx
sarq $0x2, %rcx
movl %r8d, %r8d
cmpq %rsi, %rdx
jbe 0x10275
leal (%rsi,%rbp), %r9d
movslq %r9d, %r9
cmpq %r9, %rcx
jbe 0x1026f
movss (%rax,%rsi,4), %xmm1
mulss (%rdi,%r9,4), %xmm1
addss %xmm1, %xmm0
leaq 0x1(%rsi), %r9
cmpq %r8, %rsi
movq %r9, %rsi
jb 0x1014c
movq (%rsp), %rdi
movq %r14, %rsi
movq %r15, %rdx
movq %r12, %rcx
callq 0xf6ac
incq %r12
incl %ebx
decq %rbp
cmpq 0x8(%rsp), %r12
jne 0x100f3
incq %r15
cmpq 0x70(%rsp), %r15
jne 0x1008a
incq %r14
cmpq 0x38(%rsp), %r14
jne 0x1007c
movq 0xce00(%rip), %rbx      # 0x1cfc8
leaq 0x76ee(%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 0xcdce(%rip), %rdi      # 0x1cfc8
callq 0x3040
movq %rax, %rdi
callq 0x31e0
movq 0x78(%rsp), %rdi
testq %rdi, %rdi
je 0x10216
callq 0x3280
movq 0x90(%rsp), %rdi
testq %rdi, %rdi
je 0x10228
callq 0x3280
movq 0xa8(%rsp), %rdi
testq %rdi, %rdi
je 0x1023a
callq 0x3280
movq 0x40(%rsp), %rdi
testq %rdi, %rdi
je 0x10249
callq 0x3280
addq $0xc8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %r9, %rsi
movq %rcx, %rdx
leaq 0x74f1(%rip), %rdi      # 0x17759
xorl %eax, %eax
callq 0x3390
movq %r9, %rsi
movq %rcx, %rdx
leaq 0x74dd(%rip), %rdi      # 0x17759
xorl %eax, %eax
callq 0x3390
movq %r9, %rsi
movq %rcx, %rdx
leaq 0x74c9(%rip), %rdi      # 0x17759
xorl %eax, %eax
callq 0x3390
leaq 0x74bb(%rip), %rdi      # 0x17759
movq %r12, %rsi
xorl %eax, %eax
callq 0x3390
leaq 0x74aa(%rip), %rdi      # 0x17759
movq %r12, %rsi
xorl %eax, %eax
callq 0x3390
leaq 0x7499(%rip), %rdi      # 0x17759
movq %r12, %rsi
xorl %eax, %eax
callq 0x3390
leaq 0x7488(%rip), %rdi      # 0x17759
movq %r15, %rsi
xorl %eax, %eax
callq 0x3390
leaq 0x7477(%rip), %rdi      # 0x17759
movq %rdx, %rsi
xorl %eax, %eax
callq 0x3390
jmp 0x10326
jmp 0x1030d
jmp 0x102f6
jmp 0x10312
jmp 0x102f6
movq %rax, %rbx
jmp 0x1034d
jmp 0x10312
jmp 0x10312
jmp 0x1030d
jmp 0x10312
jmp 0x10326
jmp 0x10326
jmp 0x10326
jmp 0x1030d
jmp 0x1030d
movq %rax, %rbx
jmp 0x1033b
movq %rax, %rbx
movq 0x78(%rsp), %rdi
testq %rdi, %rdi
je 0x10329
callq 0x3280
jmp 0x10329
movq %rax, %rbx
movq 0x90(%rsp), %rdi
testq %rdi, %rdi
je 0x1033b
callq 0x3280
movq 0xa8(%rsp), %rdi
testq %rdi, %rdi
je 0x1034d
callq 0x3280
movq 0x40(%rsp), %rdi
testq %rdi, %rdi
je 0x1035c
callq 0x3280
movq %rbx, %rdi
callq 0x3430