// File: kylegranger[P]ImageScaling/linear16.cpp
// Function: CLinear16::UpsampleY(CLinear16*)
void CLinear16::UpsampleY(CLinear16 *bmp)
{
	color_t *src1 = mData - mWidth;
	color_t *src2 = mData;
	color_t *src3 = mData + mWidth;
	color_t *dst1 = bmp->mData;
	color_t *dst2 = bmp->mData + bmp->mWidth;
	for (int y = 0; y < mHeight; y++)
	{
		if (y == 0)
		{
			for (int x = 0; x < mWidth; x++)
			{
				UpfilterY(src2, src2, src3, dst1++, dst2++);
				src1++; src2++; src3++;
			}
		}
		else if (y == mHeight - 1)
		{
			for (int x = 0; x < mWidth; x++)
			{
				UpfilterY(src1, src2, src2, dst1++, dst2++);
				src1++; src2++; src3++;
			}
		}
		else
		{
			for (int x = 0; x < mWidth; x++)
			{
				Upfilter(src1++, src2++, src3++, dst1++, dst2++);
			}
		}
		dst1 += bmp->mWidth;
		dst2 += bmp->mWidth;
	}
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x50, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq -0x8(%rbp), %rcx
movq %rcx, -0x50(%rbp)
movq 0x18(%rcx), %rax
movslq (%rcx), %rsi
xorl %edx, %edx
subq %rsi, %rdx
shlq $0x3, %rdx
addq %rdx, %rax
movq %rax, -0x18(%rbp)
movq 0x18(%rcx), %rax
movq %rax, -0x20(%rbp)
movq 0x18(%rcx), %rax
movslq (%rcx), %rcx
shlq $0x3, %rcx
addq %rcx, %rax
movq %rax, -0x28(%rbp)
movq -0x10(%rbp), %rax
movq 0x18(%rax), %rax
movq %rax, -0x30(%rbp)
movq -0x10(%rbp), %rax
movq 0x18(%rax), %rax
movq -0x10(%rbp), %rcx
movslq (%rcx), %rcx
shlq $0x3, %rcx
addq %rcx, %rax
movq %rax, -0x38(%rbp)
movl $0x0, -0x3c(%rbp)
movq -0x50(%rbp), %rcx
movl -0x3c(%rbp), %eax
cmpl 0x4(%rcx), %eax
jge 0x96c3
cmpl $0x0, -0x3c(%rbp)
jne 0x9591
movl $0x0, -0x40(%rbp)
movq -0x50(%rbp), %rcx
movl -0x40(%rbp), %eax
cmpl (%rcx), %eax
jge 0x958c
movq -0x20(%rbp), %rdi
movq -0x20(%rbp), %rsi
movq -0x28(%rbp), %rdx
movq -0x30(%rbp), %rcx
movq %rcx, %rax
addq $0x8, %rax
movq %rax, -0x30(%rbp)
movq -0x38(%rbp), %r8
movq %r8, %rax
addq $0x8, %rax
movq %rax, -0x38(%rbp)
callq 0x75d0
movq -0x18(%rbp), %rax
addq $0x8, %rax
movq %rax, -0x18(%rbp)
movq -0x20(%rbp), %rax
addq $0x8, %rax
movq %rax, -0x20(%rbp)
movq -0x28(%rbp), %rax
addq $0x8, %rax
movq %rax, -0x28(%rbp)
movl -0x40(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x40(%rbp)
jmp 0x9523
jmp 0x9685
movq -0x50(%rbp), %rcx
movl -0x3c(%rbp), %eax
movl 0x4(%rcx), %ecx
subl $0x1, %ecx
cmpl %ecx, %eax
jne 0x9614
movl $0x0, -0x44(%rbp)
movq -0x50(%rbp), %rcx
movl -0x44(%rbp), %eax
cmpl (%rcx), %eax
jge 0x9612
movq -0x18(%rbp), %rdi
movq -0x20(%rbp), %rsi
movq -0x20(%rbp), %rdx
movq -0x30(%rbp), %rcx
movq %rcx, %rax
addq $0x8, %rax
movq %rax, -0x30(%rbp)
movq -0x38(%rbp), %r8
movq %r8, %rax
addq $0x8, %rax
movq %rax, -0x38(%rbp)
callq 0x75d0
movq -0x18(%rbp), %rax
addq $0x8, %rax
movq %rax, -0x18(%rbp)
movq -0x20(%rbp), %rax
addq $0x8, %rax
movq %rax, -0x20(%rbp)
movq -0x28(%rbp), %rax
addq $0x8, %rax
movq %rax, -0x28(%rbp)
movl -0x44(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x44(%rbp)
jmp 0x95a9
jmp 0x9683
movl $0x0, -0x48(%rbp)
movq -0x50(%rbp), %rcx
movl -0x48(%rbp), %eax
cmpl (%rcx), %eax
jge 0x9681
movq -0x18(%rbp), %rdi
movq %rdi, %rax
addq $0x8, %rax
movq %rax, -0x18(%rbp)
movq -0x20(%rbp), %rsi
movq %rsi, %rax
addq $0x8, %rax
movq %rax, -0x20(%rbp)
movq -0x28(%rbp), %rdx
movq %rdx, %rax
addq $0x8, %rax
movq %rax, -0x28(%rbp)
movq -0x30(%rbp), %rcx
movq %rcx, %rax
addq $0x8, %rax
movq %rax, -0x30(%rbp)
movq -0x38(%rbp), %r8
movq %r8, %rax
addq $0x8, %rax
movq %rax, -0x38(%rbp)
callq 0x7720
movl -0x48(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x48(%rbp)
jmp 0x961b
jmp 0x9683
jmp 0x9685
movq -0x10(%rbp), %rax
movl (%rax), %ecx
movq -0x30(%rbp), %rax
movslq %ecx, %rcx
shlq $0x3, %rcx
addq %rcx, %rax
movq %rax, -0x30(%rbp)
movq -0x10(%rbp), %rax
movl (%rax), %ecx
movq -0x38(%rbp), %rax
movslq %ecx, %rcx
shlq $0x3, %rcx
addq %rcx, %rax
movq %rax, -0x38(%rbp)
movl -0x3c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x3c(%rbp)
jmp 0x9506
addq $0x50, %rsp
popq %rbp
retq
nopl (%rax)