// File: /workspace/github_c_makefile_star2_O0/Matthias-Wandel[P]imgcomp/src/compare_util.c
// Function: BloomImgMap
void BloomImgMap(ImgMap_t * src, ImgMap_t * dst)
{
	int w = src->w;
	int h = src->h;

	// Bloom vertically while copying to dst array
	for (int r=0;r<h;r++){
		int * row = src->values+src->w*r;
		int * prevrow, *nextrow;
		prevrow = src->values+src->w*(r-1);
		if (r ==0) prevrow = src->values;
		
		nextrow = src->values+src->w*(r+1);
		if (r >= h-1) nextrow = row;

		int * dstrow = dst->values+src->w*r;
		
		for (int c=0;c<w;c++){
			int nv = row[c];
			if (nv < prevrow[c]) nv = prevrow[c];
			if (nv < nextrow[c]) nv = nextrow[c];
			dstrow[c] = nv;
		}
	}

	// Bloom horizontally in place
	for (int r=0;r<h;r++){
		int * row = dst->values+src->w*r;
		
		int pv = 0;
		int c;
		for (c=0;c<w-1;c++){
			int nv = row[c];
			if (nv < pv) nv = pv;
			if (row[c+1]>nv) nv = row[c+1];
			pv = row[c];
			row[c] = nv;
		}
		if (row[c] < pv) row[c] = pv;
	}

}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq -0x8(%rbp), %rax
movl (%rax), %eax
movl %eax, -0x14(%rbp)
movq -0x8(%rbp), %rax
movl 0x4(%rax), %eax
movl %eax, -0x18(%rbp)
movl $0x0, -0x1c(%rbp)
movl -0x1c(%rbp), %eax
cmpl -0x18(%rbp), %eax
jge 0x83c5
movq -0x8(%rbp), %rax
addq $0x8, %rax
movq -0x8(%rbp), %rcx
movl (%rcx), %ecx
imull -0x1c(%rbp), %ecx
movslq %ecx, %rcx
shlq $0x2, %rcx
addq %rcx, %rax
movq %rax, -0x28(%rbp)
movq -0x8(%rbp), %rax
addq $0x8, %rax
movq -0x8(%rbp), %rcx
movl (%rcx), %ecx
movl -0x1c(%rbp), %edx
subl $0x1, %edx
imull %edx, %ecx
movslq %ecx, %rcx
shlq $0x2, %rcx
addq %rcx, %rax
movq %rax, -0x30(%rbp)
cmpl $0x0, -0x1c(%rbp)
jne 0x82e9
movq -0x8(%rbp), %rax
addq $0x8, %rax
movq %rax, -0x30(%rbp)
movq -0x8(%rbp), %rax
addq $0x8, %rax
movq -0x8(%rbp), %rcx
movl (%rcx), %ecx
movl -0x1c(%rbp), %edx
addl $0x1, %edx
imull %edx, %ecx
movslq %ecx, %rcx
shlq $0x2, %rcx
addq %rcx, %rax
movq %rax, -0x38(%rbp)
movl -0x1c(%rbp), %eax
movl -0x18(%rbp), %ecx
subl $0x1, %ecx
cmpl %ecx, %eax
jl 0x8323
movq -0x28(%rbp), %rax
movq %rax, -0x38(%rbp)
movq -0x10(%rbp), %rax
addq $0x8, %rax
movq -0x8(%rbp), %rcx
movl (%rcx), %ecx
imull -0x1c(%rbp), %ecx
movslq %ecx, %rcx
shlq $0x2, %rcx
addq %rcx, %rax
movq %rax, -0x40(%rbp)
movl $0x0, -0x44(%rbp)
movl -0x44(%rbp), %eax
cmpl -0x14(%rbp), %eax
jge 0x83b5
movq -0x28(%rbp), %rax
movslq -0x44(%rbp), %rcx
movl (%rax,%rcx,4), %eax
movl %eax, -0x48(%rbp)
movl -0x48(%rbp), %eax
movq -0x30(%rbp), %rcx
movslq -0x44(%rbp), %rdx
cmpl (%rcx,%rdx,4), %eax
jge 0x837e
movq -0x30(%rbp), %rax
movslq -0x44(%rbp), %rcx
movl (%rax,%rcx,4), %eax
movl %eax, -0x48(%rbp)
movl -0x48(%rbp), %eax
movq -0x38(%rbp), %rcx
movslq -0x44(%rbp), %rdx
cmpl (%rcx,%rdx,4), %eax
jge 0x839c
movq -0x38(%rbp), %rax
movslq -0x44(%rbp), %rcx
movl (%rax,%rcx,4), %eax
movl %eax, -0x48(%rbp)
movl -0x48(%rbp), %edx
movq -0x40(%rbp), %rax
movslq -0x44(%rbp), %rcx
movl %edx, (%rax,%rcx,4)
movl -0x44(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x44(%rbp)
jmp 0x834a
jmp 0x83b7
movl -0x1c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x1c(%rbp)
jmp 0x8286
movl $0x0, -0x4c(%rbp)
movl -0x4c(%rbp), %eax
cmpl -0x18(%rbp), %eax
jge 0x84ac
movq -0x10(%rbp), %rax
addq $0x8, %rax
movq -0x8(%rbp), %rcx
movl (%rcx), %ecx
imull -0x4c(%rbp), %ecx
movslq %ecx, %rcx
shlq $0x2, %rcx
addq %rcx, %rax
movq %rax, -0x58(%rbp)
movl $0x0, -0x5c(%rbp)
movl $0x0, -0x60(%rbp)
movl -0x60(%rbp), %eax
movl -0x14(%rbp), %ecx
subl $0x1, %ecx
cmpl %ecx, %eax
jge 0x847e
movq -0x58(%rbp), %rax
movslq -0x60(%rbp), %rcx
movl (%rax,%rcx,4), %eax
movl %eax, -0x64(%rbp)
movl -0x64(%rbp), %eax
cmpl -0x5c(%rbp), %eax
jge 0x842f
movl -0x5c(%rbp), %eax
movl %eax, -0x64(%rbp)
movq -0x58(%rbp), %rax
movl -0x60(%rbp), %ecx
addl $0x1, %ecx
movslq %ecx, %rcx
movl (%rax,%rcx,4), %eax
cmpl -0x64(%rbp), %eax
jle 0x8457
movq -0x58(%rbp), %rax
movl -0x60(%rbp), %ecx
addl $0x1, %ecx
movslq %ecx, %rcx
movl (%rax,%rcx,4), %eax
movl %eax, -0x64(%rbp)
movq -0x58(%rbp), %rax
movslq -0x60(%rbp), %rcx
movl (%rax,%rcx,4), %eax
movl %eax, -0x5c(%rbp)
movl -0x64(%rbp), %edx
movq -0x58(%rbp), %rax
movslq -0x60(%rbp), %rcx
movl %edx, (%rax,%rcx,4)
movl -0x60(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x60(%rbp)
jmp 0x8406
movq -0x58(%rbp), %rax
movslq -0x60(%rbp), %rcx
movl (%rax,%rcx,4), %eax
cmpl -0x5c(%rbp), %eax
jge 0x849c
movl -0x5c(%rbp), %edx
movq -0x58(%rbp), %rax
movslq -0x60(%rbp), %rcx
movl %edx, (%rax,%rcx,4)
jmp 0x849e
movl -0x4c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x4c(%rbp)
jmp 0x83cc
popq %rbp
retq
nop