// File: /workspace/github_cpp_makefile_star2_O1/kylegranger[P]ImageScaling/filter16.cpp
// Function: Upfilter(color_t*, color_t*, color_t*, color_t*, color_t*)
void Upfilter(color_t *src1, color_t *src2, color_t *src3, color_t *dst1, color_t *dst2)
{
	dst1[0].r = ((src1[0].r + 3 * (src1[1].r + src2[0].r) + src2[1].r * 9 + 8) >> 4);
	dst1[1].r = ((src1[2].r + 3 * (src1[1].r + src2[2].r) + src2[1].r * 9 + 8) >> 4);
	dst2[0].r = ((src3[0].r + 3 * (src3[1].r + src2[0].r) + src2[1].r * 9 + 8) >> 4);
	dst2[1].r = ((src3[2].r + 3 * (src3[1].r + src2[2].r) + src2[1].r * 9 + 8) >> 4);

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

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

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

// Assembly:
movzwl 0x4(%rdi), %eax
movzwl 0xc(%rdi), %r9d
movzwl 0x4(%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, 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 0x4(%rdx), %eax
movzwl 0xc(%rdx), %r9d
movzwl 0x4(%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, 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 0x2(%rdi), %eax
movzwl 0xa(%rdi), %r9d
movzwl 0x2(%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, 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 0x2(%rdx), %eax
movzwl 0xa(%rdx), %r9d
movzwl 0x2(%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, 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 (%rdi), %eax
movzwl 0x8(%rdi), %r9d
movzwl (%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, (%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 (%rdx), %eax
movzwl 0x8(%rdx), %r9d
movzwl (%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, (%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 0x6(%rdi), %eax
movzwl 0xe(%rdi), %r9d
movzwl 0x6(%rsi), %r10d
addl %r9d, %r10d
leal (%r10,%r10,2), %r9d
addl %eax, %r9d
movzwl 0xe(%rsi), %eax
leal (%rax,%rax,8), %eax
addl %r9d, %eax
addl $0x8, %eax
shrl $0x4, %eax
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 0x6(%rdx), %eax
movzwl 0xe(%rdx), %ecx
movzwl 0x6(%rsi), %edi
addl %ecx, %edi
leal (%rdi,%rdi,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, 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