// File: /workspace/github_c_makefile_star2_O0/yui0[P]img2vec/./imgp.h
// Function: imgp_filter
void imgp_filter(uint8_t *im, int w, int h, uint8_t *o, double *K, int Ks, double divisor, double offset)
{
	unsigned int ix, iy, x, y;
	int kx, ky;
	double r, g, b, p;

	for (ix=0; ix<w; ix++) {
		for (iy=0; iy<h; iy++) {
			r = g = b = 0.0;
			for (kx=-Ks; kx<=Ks; kx++) {
				for (ky=-Ks; ky<=Ks; ky++) {
					x = ix+kx;
					y = iy+ky;
					p = ((x<0) || (x>=w) || (y<0) || (y>=h)) ? 0 : im[(ix+kx + (iy+ky)*w)*3];
					r += (K[(kx+Ks) + (ky+Ks)*(2*Ks+1)]/divisor) * p + offset;
					p = ((x<0) || (x>=w) || (y<0) || (y>=h)) ? 0 : im[(ix+kx + (iy+ky)*w)*3 +1];
					g += (K[(kx+Ks) + (ky+Ks)*(2*Ks+1)]/divisor) * p + offset;
					p = ((x<0) || (x>=w) || (y<0) || (y>=h)) ? 0 : im[(ix+kx + (iy+ky)*w)*3 +2];
					b += (K[(kx+Ks) + (ky+Ks)*(2*Ks+1)]/divisor) * p + offset;
				}
			}
			r = (r>255.0) ? 255.0 : ((r<0.0) ? 0.0 : r);
			g = (g>255.0) ? 255.0 : ((g<0.0) ? 0.0 : g);
			b = (b>255.0) ? 255.0 : ((b<0.0) ? 0.0 : b);
			o[(ix + iy*w)*3] = r;
			o[(ix + iy*w)*3 +1] = g;
			o[(ix + iy*w)*3 +2] = b;
		}
	}
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x8(%rbp)
movl %esi, -0xc(%rbp)
movl %edx, -0x10(%rbp)
movq %rcx, -0x18(%rbp)
movq %r8, -0x20(%rbp)
movl %r9d, -0x24(%rbp)
movsd %xmm0, -0x30(%rbp)
movsd %xmm1, -0x38(%rbp)
movl $0x0, -0x3c(%rbp)
movl -0x3c(%rbp), %eax
cmpl -0xc(%rbp), %eax
jae 0x7bee
movl $0x0, -0x40(%rbp)
movl -0x40(%rbp), %eax
cmpl -0x10(%rbp), %eax
jae 0x7bde
xorps %xmm0, %xmm0
movsd %xmm0, -0x68(%rbp)
xorps %xmm0, %xmm0
movsd %xmm0, -0x60(%rbp)
xorps %xmm0, %xmm0
movsd %xmm0, -0x58(%rbp)
xorl %eax, %eax
subl -0x24(%rbp), %eax
movl %eax, -0x4c(%rbp)
movl -0x4c(%rbp), %eax
cmpl -0x24(%rbp), %eax
jg 0x7a39
xorl %eax, %eax
subl -0x24(%rbp), %eax
movl %eax, -0x50(%rbp)
movl -0x50(%rbp), %eax
cmpl -0x24(%rbp), %eax
jg 0x7a29
movl -0x3c(%rbp), %eax
addl -0x4c(%rbp), %eax
movl %eax, -0x44(%rbp)
movl -0x40(%rbp), %eax
addl -0x50(%rbp), %eax
movl %eax, -0x48(%rbp)
cmpl $0x0, -0x44(%rbp)
jb 0x786c
movl -0x44(%rbp), %eax
cmpl -0xc(%rbp), %eax
jae 0x786c
cmpl $0x0, -0x48(%rbp)
jb 0x786c
movl -0x48(%rbp), %eax
cmpl -0x10(%rbp), %eax
jb 0x7873
xorl %eax, %eax
movl %eax, -0x74(%rbp)
jmp 0x7895
movq -0x8(%rbp), %rax
movl -0x3c(%rbp), %ecx
addl -0x4c(%rbp), %ecx
movl -0x40(%rbp), %edx
addl -0x50(%rbp), %edx
imull -0xc(%rbp), %edx
addl %edx, %ecx
imull $0x3, %ecx, %ecx
movl %ecx, %ecx
movzbl (%rax,%rcx), %eax
movl %eax, -0x74(%rbp)
movl -0x74(%rbp), %eax
cvtsi2sd %eax, %xmm0
movsd %xmm0, -0x70(%rbp)
movq -0x20(%rbp), %rax
movl -0x4c(%rbp), %ecx
addl -0x24(%rbp), %ecx
movl -0x50(%rbp), %edx
addl -0x24(%rbp), %edx
movl -0x24(%rbp), %esi
shll %esi
addl $0x1, %esi
imull %esi, %edx
addl %edx, %ecx
movslq %ecx, %rcx
movsd (%rax,%rcx,8), %xmm0
divsd -0x30(%rbp), %xmm0
movsd -0x70(%rbp), %xmm2
movsd -0x38(%rbp), %xmm1
mulsd %xmm2, %xmm0
addsd %xmm1, %xmm0
addsd -0x58(%rbp), %xmm0
movsd %xmm0, -0x58(%rbp)
cmpl $0x0, -0x44(%rbp)
jb 0x7903
movl -0x44(%rbp), %eax
cmpl -0xc(%rbp), %eax
jae 0x7903
cmpl $0x0, -0x48(%rbp)
jb 0x7903
movl -0x48(%rbp), %eax
cmpl -0x10(%rbp), %eax
jb 0x790a
xorl %eax, %eax
movl %eax, -0x78(%rbp)
jmp 0x792f
movq -0x8(%rbp), %rax
movl -0x3c(%rbp), %ecx
addl -0x4c(%rbp), %ecx
movl -0x40(%rbp), %edx
addl -0x50(%rbp), %edx
imull -0xc(%rbp), %edx
addl %edx, %ecx
imull $0x3, %ecx, %ecx
addl $0x1, %ecx
movl %ecx, %ecx
movzbl (%rax,%rcx), %eax
movl %eax, -0x78(%rbp)
movl -0x78(%rbp), %eax
cvtsi2sd %eax, %xmm0
movsd %xmm0, -0x70(%rbp)
movq -0x20(%rbp), %rax
movl -0x4c(%rbp), %ecx
addl -0x24(%rbp), %ecx
movl -0x50(%rbp), %edx
addl -0x24(%rbp), %edx
movl -0x24(%rbp), %esi
shll %esi
addl $0x1, %esi
imull %esi, %edx
addl %edx, %ecx
movslq %ecx, %rcx
movsd (%rax,%rcx,8), %xmm0
divsd -0x30(%rbp), %xmm0
movsd -0x70(%rbp), %xmm2
movsd -0x38(%rbp), %xmm1
mulsd %xmm2, %xmm0
addsd %xmm1, %xmm0
addsd -0x60(%rbp), %xmm0
movsd %xmm0, -0x60(%rbp)
cmpl $0x0, -0x44(%rbp)
jb 0x799d
movl -0x44(%rbp), %eax
cmpl -0xc(%rbp), %eax
jae 0x799d
cmpl $0x0, -0x48(%rbp)
jb 0x799d
movl -0x48(%rbp), %eax
cmpl -0x10(%rbp), %eax
jb 0x79a4
xorl %eax, %eax
movl %eax, -0x7c(%rbp)
jmp 0x79c9
movq -0x8(%rbp), %rax
movl -0x3c(%rbp), %ecx
addl -0x4c(%rbp), %ecx
movl -0x40(%rbp), %edx
addl -0x50(%rbp), %edx
imull -0xc(%rbp), %edx
addl %edx, %ecx
imull $0x3, %ecx, %ecx
addl $0x2, %ecx
movl %ecx, %ecx
movzbl (%rax,%rcx), %eax
movl %eax, -0x7c(%rbp)
movl -0x7c(%rbp), %eax
cvtsi2sd %eax, %xmm0
movsd %xmm0, -0x70(%rbp)
movq -0x20(%rbp), %rax
movl -0x4c(%rbp), %ecx
addl -0x24(%rbp), %ecx
movl -0x50(%rbp), %edx
addl -0x24(%rbp), %edx
movl -0x24(%rbp), %esi
shll %esi
addl $0x1, %esi
imull %esi, %edx
addl %edx, %ecx
movslq %ecx, %rcx
movsd (%rax,%rcx,8), %xmm0
divsd -0x30(%rbp), %xmm0
movsd -0x70(%rbp), %xmm2
movsd -0x38(%rbp), %xmm1
mulsd %xmm2, %xmm0
addsd %xmm1, %xmm0
addsd -0x68(%rbp), %xmm0
movsd %xmm0, -0x68(%rbp)
movl -0x50(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x50(%rbp)
jmp 0x7832
jmp 0x7a2b
movl -0x4c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x4c(%rbp)
jmp 0x781e
movsd -0x58(%rbp), %xmm0
movsd 0x2a5ca(%rip), %xmm1    # 0x32010
ucomisd %xmm1, %xmm0
jbe 0x7a5e
movsd 0x2a5bc(%rip), %xmm0    # 0x32010
movsd %xmm0, -0x88(%rbp)
jmp 0x7a92
xorps %xmm0, %xmm0
ucomisd -0x58(%rbp), %xmm0
jbe 0x7a75
xorps %xmm0, %xmm0
movsd %xmm0, -0x90(%rbp)
jmp 0x7a82
movsd -0x58(%rbp), %xmm0
movsd %xmm0, -0x90(%rbp)
movsd -0x90(%rbp), %xmm0
movsd %xmm0, -0x88(%rbp)
movsd -0x88(%rbp), %xmm0
movsd %xmm0, -0x58(%rbp)
movsd -0x60(%rbp), %xmm0
movsd 0x2a564(%rip), %xmm1    # 0x32010
ucomisd %xmm1, %xmm0
jbe 0x7ac4
movsd 0x2a556(%rip), %xmm0    # 0x32010
movsd %xmm0, -0x98(%rbp)
jmp 0x7af8
xorps %xmm0, %xmm0
ucomisd -0x60(%rbp), %xmm0
jbe 0x7adb
xorps %xmm0, %xmm0
movsd %xmm0, -0xa0(%rbp)
jmp 0x7ae8
movsd -0x60(%rbp), %xmm0
movsd %xmm0, -0xa0(%rbp)
movsd -0xa0(%rbp), %xmm0
movsd %xmm0, -0x98(%rbp)
movsd -0x98(%rbp), %xmm0
movsd %xmm0, -0x60(%rbp)
movsd -0x68(%rbp), %xmm0
movsd 0x2a4fe(%rip), %xmm1    # 0x32010
ucomisd %xmm1, %xmm0
jbe 0x7b2a
movsd 0x2a4f0(%rip), %xmm0    # 0x32010
movsd %xmm0, -0xa8(%rbp)
jmp 0x7b5e
xorps %xmm0, %xmm0
ucomisd -0x68(%rbp), %xmm0
jbe 0x7b41
xorps %xmm0, %xmm0
movsd %xmm0, -0xb0(%rbp)
jmp 0x7b4e
movsd -0x68(%rbp), %xmm0
movsd %xmm0, -0xb0(%rbp)
movsd -0xb0(%rbp), %xmm0
movsd %xmm0, -0xa8(%rbp)
movsd -0xa8(%rbp), %xmm0
movsd %xmm0, -0x68(%rbp)
cvttsd2si -0x58(%rbp), %eax
movb %al, %dl
movq -0x18(%rbp), %rax
movl -0x3c(%rbp), %esi
movl -0x40(%rbp), %ecx
movl -0xc(%rbp), %edi
imull %edi, %ecx
addl %ecx, %esi
movl %esi, %ecx
leal (%rcx,%rcx,2), %ecx
movb %dl, (%rax,%rcx)
cvttsd2si -0x60(%rbp), %eax
movb %al, %dl
movq -0x18(%rbp), %rax
movl -0x3c(%rbp), %esi
movl -0x40(%rbp), %ecx
movl -0xc(%rbp), %edi
imull %edi, %ecx
addl %ecx, %esi
movl %esi, %ecx
leal 0x1(%rcx,%rcx,2), %ecx
movb %dl, (%rax,%rcx)
cvttsd2si -0x68(%rbp), %eax
movb %al, %dl
movq -0x18(%rbp), %rax
movl -0x3c(%rbp), %ecx
movl -0x40(%rbp), %esi
imull -0xc(%rbp), %esi
addl %esi, %ecx
imull $0x3, %ecx, %ecx
addl $0x2, %ecx
movl %ecx, %ecx
movb %dl, (%rax,%rcx)
movl -0x40(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x40(%rbp)
jmp 0x77f2
jmp 0x7be0
movl -0x3c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x3c(%rbp)
jmp 0x77df
addq $0x30, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)