// File: /workspace/github_cpp_makefile_star2_O1/kylegranger[P]ImageScaling/filter16.cpp
// Function: UpfilterLeft(color_t*, color_t*, color_t*, color_t*, color_t*)
void UpfilterLeft(color_t *src1, color_t *src2, color_t *src3, color_t *dst1, color_t *dst2)
{
	// we mix 9 source pixels to four destination pixels
	dst1[0].r = (3 * src1[1].r + src2[1].r * 9 + 6) / 12;
	dst1[1].r = ((src1[2].r + 3 * (src1[1].r + src2[2].r) + src2[1].r * 9 + 8) >> 4);
	dst2[0].r = (3 * src3[1].r + src2[1].r * 9 + 6) / 12;
	dst2[1].r = ((src3[2].r + 3 * (src3[1].r + src2[2].r) + src2[1].r * 9 + 8) >> 4);

	dst1[0].g = (3 * src1[1].g + src2[1].g * 9 + 6) / 12;
	dst1[1].g = ((src1[2].g + 3 * (src1[1].g + src2[2].g) + src2[1].g * 9 + 8) >> 4);
	dst2[0].g = (3 * src3[1].g + src2[1].g * 9 + 6) / 12;
	dst2[1].g = ((src3[2].g + 3 * (src3[1].g + src2[2].g) + src2[1].g * 9 + 8) >> 4);

	dst1[0].b = (3 * src1[1].b + src2[1].b * 9 + 6) / 12;
	dst1[1].b = ((src1[2].b + 3 * (src1[1].b + src2[2].b) + src2[1].b * 9 + 8) >> 4);
	dst2[0].b = (3 * src3[1].b + src2[1].b * 9 + 6) / 12;
	dst2[1].b = ((src3[2].b + 3 * (src3[1].b + src2[2].b) + src2[1].b * 9 + 8) >> 4);

	dst1[0].a = (3 * src1[1].a + src2[1].a * 9 + 6) / 12;
	dst1[1].a = ((src1[2].a + 3 * (src1[1].a + src2[2].a) + src2[1].a * 9 + 8) >> 4);
	dst2[0].a = (3 * src3[1].a + src2[1].a * 9 + 6) / 12;
	dst2[1].a = ((src3[2].a + 3 * (src3[1].a + src2[2].a) + src2[1].a * 9 + 8) >> 4);
}

// Assembly:
movzwl 0xc(%rdi), %eax
leal (%rax,%rax,2), %eax
movzwl 0xc(%rsi), %r9d
leal (%r9,%r9,8), %r9d
addl %r9d, %eax
addl $0x6, %eax
imulq $0x15555556, %rax, %rax # imm = 0x15555556
shrq $0x20, %rax
movw %ax, 0x4(%rcx)
movzwl 0x14(%rdi), %eax
movzwl 0xc(%rdi), %r9d
movzwl 0x14(%rsi), %r10d
addl %r9d, %r10d
leal (%r10,%r10,2), %r9d
addl %eax, %r9d
movzwl 0xc(%rsi), %eax
leal (%rax,%rax,8), %eax
addl %r9d, %eax
addl $0x8, %eax
shrl $0x4, %eax
movw %ax, 0xc(%rcx)
movzwl 0xc(%rdx), %eax
leal (%rax,%rax,2), %eax
movzwl 0xc(%rsi), %r9d
leal (%r9,%r9,8), %r9d
addl %r9d, %eax
addl $0x6, %eax
imulq $0x15555556, %rax, %rax # imm = 0x15555556
shrq $0x20, %rax
movw %ax, 0x4(%r8)
movzwl 0x14(%rdx), %eax
movzwl 0xc(%rdx), %r9d
movzwl 0x14(%rsi), %r10d
addl %r9d, %r10d
leal (%r10,%r10,2), %r9d
addl %eax, %r9d
movzwl 0xc(%rsi), %eax
leal (%rax,%rax,8), %eax
addl %r9d, %eax
addl $0x8, %eax
shrl $0x4, %eax
movw %ax, 0xc(%r8)
movzwl 0xa(%rdi), %eax
leal (%rax,%rax,2), %eax
movzwl 0xa(%rsi), %r9d
leal (%r9,%r9,8), %r9d
addl %r9d, %eax
addl $0x6, %eax
imulq $0x15555556, %rax, %rax # imm = 0x15555556
shrq $0x20, %rax
movw %ax, 0x2(%rcx)
movzwl 0x12(%rdi), %eax
movzwl 0xa(%rdi), %r9d
movzwl 0x12(%rsi), %r10d
addl %r9d, %r10d
leal (%r10,%r10,2), %r9d
addl %eax, %r9d
movzwl 0xa(%rsi), %eax
leal (%rax,%rax,8), %eax
addl %r9d, %eax
addl $0x8, %eax
shrl $0x4, %eax
movw %ax, 0xa(%rcx)
movzwl 0xa(%rdx), %eax
leal (%rax,%rax,2), %eax
movzwl 0xa(%rsi), %r9d
leal (%r9,%r9,8), %r9d
addl %r9d, %eax
addl $0x6, %eax
imulq $0x15555556, %rax, %rax # imm = 0x15555556
shrq $0x20, %rax
movw %ax, 0x2(%r8)
movzwl 0x12(%rdx), %eax
movzwl 0xa(%rdx), %r9d
movzwl 0x12(%rsi), %r10d
addl %r9d, %r10d
leal (%r10,%r10,2), %r9d
addl %eax, %r9d
movzwl 0xa(%rsi), %eax
leal (%rax,%rax,8), %eax
addl %r9d, %eax
addl $0x8, %eax
shrl $0x4, %eax
movw %ax, 0xa(%r8)
movzwl 0x8(%rdi), %eax
leal (%rax,%rax,2), %eax
movzwl 0x8(%rsi), %r9d
leal (%r9,%r9,8), %r9d
addl %r9d, %eax
addl $0x6, %eax
imulq $0x15555556, %rax, %rax # imm = 0x15555556
shrq $0x20, %rax
movw %ax, (%rcx)
movzwl 0x10(%rdi), %eax
movzwl 0x8(%rdi), %r9d
movzwl 0x10(%rsi), %r10d
addl %r9d, %r10d
leal (%r10,%r10,2), %r9d
addl %eax, %r9d
movzwl 0x8(%rsi), %eax
leal (%rax,%rax,8), %eax
addl %r9d, %eax
addl $0x8, %eax
shrl $0x4, %eax
movw %ax, 0x8(%rcx)
movzwl 0x8(%rdx), %eax
leal (%rax,%rax,2), %eax
movzwl 0x8(%rsi), %r9d
leal (%r9,%r9,8), %r9d
addl %r9d, %eax
addl $0x6, %eax
imulq $0x15555556, %rax, %rax # imm = 0x15555556
shrq $0x20, %rax
movw %ax, (%r8)
movzwl 0x10(%rdx), %eax
movzwl 0x8(%rdx), %r9d
movzwl 0x10(%rsi), %r10d
addl %r9d, %r10d
leal (%r10,%r10,2), %r9d
addl %eax, %r9d
movzwl 0x8(%rsi), %eax
leal (%rax,%rax,8), %eax
addl %r9d, %eax
addl $0x8, %eax
shrl $0x4, %eax
movw %ax, 0x8(%r8)
movzwl 0xe(%rdi), %eax
leal (%rax,%rax,2), %eax
movzwl 0xe(%rsi), %r9d
leal (%r9,%r9,8), %r9d
addl %r9d, %eax
addl $0x6, %eax
imulq $0x15555556, %rax, %rax # imm = 0x15555556
shrq $0x20, %rax
movw %ax, 0x6(%rcx)
movzwl 0x16(%rdi), %eax
movzwl 0xe(%rdi), %edi
movzwl 0x16(%rsi), %r9d
addl %edi, %r9d
leal (%r9,%r9,2), %edi
addl %eax, %edi
movzwl 0xe(%rsi), %eax
leal (%rax,%rax,8), %eax
addl %edi, %eax
addl $0x8, %eax
shrl $0x4, %eax
movw %ax, 0xe(%rcx)
movzwl 0xe(%rdx), %eax
leal (%rax,%rax,2), %eax
movzwl 0xe(%rsi), %ecx
leal (%rcx,%rcx,8), %ecx
addl %ecx, %eax
addl $0x6, %eax
imulq $0x15555556, %rax, %rax # imm = 0x15555556
shrq $0x20, %rax
movw %ax, 0x6(%r8)
movzwl 0x16(%rdx), %eax
movzwl 0xe(%rdx), %ecx
movzwl 0x16(%rsi), %edx
addl %ecx, %edx
leal (%rdx,%rdx,2), %ecx
addl %eax, %ecx
movzwl 0xe(%rsi), %eax
leal (%rax,%rax,8), %eax
addl %ecx, %eax
addl $0x8, %eax
shrl $0x4, %eax
movw %ax, 0xe(%r8)
retq