LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_cpp_makefile_star2_O1/kylegranger[P]ImageScaling/filter16.cpp
// Function: DownfilterLeft(color_t*, color_t*, color_t*, color_t*)
void DownfilterLeft(color_t *src1, color_t *src2, color_t *src3, color_t *dst)
{
	// we mix 16 source pixels into one destination pixel
	int r = (src1[3].r)     + 3 * (src1[1].r + src1[2].r);
	r    += (src2[3].r) * 3 + 9 * (src2[1].r + src2[2].r);
	r    += (src3[3].r) * 3 + 9 * (src3[1].r + src3[2].r);
	dst->r = ((r+24)/49);
	int g = (src1[3].g)     + 3 * (src1[1].g + src1[2].g);
	g    += (src2[3].g) * 3 + 9 * (src2[1].g + src2[2].g);
	g    += (src3[3].g) * 3 + 9 * (src3[1].g + src3[2].g);
	dst->g = ((g+24)/49);
	int b = (src1[3].b)     + 3 * (src1[1].b + src1[2].b);
	b    += (src2[3].b) * 3 + 9 * (src2[1].b + src2[2].b);
	b    += (src3[3].b) * 3 + 9 * (src3[1].b + src3[2].b);
	dst->b = ((b+24)/49);
	int a = (src1[3].a)     + 3 * (src1[1].a + src1[2].a);
	a    += (src2[3].a) * 3 + 9 * (src2[1].a + src2[2].a);
	a    += (src3[3].a) * 3 + 9 * (src3[1].a + src3[2].a);
	dst->a = ((a+24)/49);
}

// Assembly:
movzwl 0x1c(%rdi), %eax
movzwl 0xc(%rdi), %r8d
movzwl 0x14(%rdi), %r9d
addl %r8d, %r9d
movzwl 0x1c(%rsi), %r8d
movzwl 0xc(%rsi), %r10d
movzwl 0x14(%rsi), %r11d
addl %r10d, %r11d
movzwl 0x1c(%rdx), %r10d
addl %r8d, %r10d
addl %r9d, %r10d
movzwl 0xc(%rdx), %r8d
movzwl 0x14(%rdx), %r9d
addl %r8d, %r9d
addl %r11d, %r9d
leal (%r10,%r10,2), %r8d
addl %eax, %r8d
leal (%r9,%r9,8), %eax
addl %r8d, %eax
addl $0x18, %eax
imulq $0x5397829d, %rax, %rax # imm = 0x5397829D
shrq $0x24, %rax
movw %ax, 0x4(%rcx)
movzwl 0x1a(%rdi), %eax
movzwl 0xa(%rdi), %r8d
movzwl 0x12(%rdi), %r9d
addl %r8d, %r9d
movzwl 0x1a(%rsi), %r8d
movzwl 0xa(%rsi), %r10d
movzwl 0x12(%rsi), %r11d
addl %r10d, %r11d
movzwl 0x1a(%rdx), %r10d
addl %r8d, %r10d
addl %r9d, %r10d
movzwl 0xa(%rdx), %r8d
movzwl 0x12(%rdx), %r9d
addl %r8d, %r9d
addl %r11d, %r9d
leal (%r10,%r10,2), %r8d
addl %eax, %r8d
leal (%r9,%r9,8), %eax
addl %r8d, %eax
addl $0x18, %eax
imulq $0x5397829d, %rax, %rax # imm = 0x5397829D
shrq $0x24, %rax
movw %ax, 0x2(%rcx)
movzwl 0x18(%rdi), %eax
movzwl 0x8(%rdi), %r8d
movzwl 0x10(%rdi), %r9d
addl %r8d, %r9d
movzwl 0x18(%rsi), %r8d
movzwl 0x8(%rsi), %r10d
movzwl 0x10(%rsi), %r11d
addl %r10d, %r11d
movzwl 0x18(%rdx), %r10d
addl %r8d, %r10d
addl %r9d, %r10d
movzwl 0x8(%rdx), %r8d
movzwl 0x10(%rdx), %r9d
addl %r8d, %r9d
addl %r11d, %r9d
leal (%r10,%r10,2), %r8d
addl %eax, %r8d
leal (%r9,%r9,8), %eax
addl %r8d, %eax
addl $0x18, %eax
imulq $0x5397829d, %rax, %rax # imm = 0x5397829D
shrq $0x24, %rax
movw %ax, (%rcx)
movzwl 0x1e(%rdi), %eax
movzwl 0xe(%rdi), %r8d
movzwl 0x16(%rdi), %edi
addl %r8d, %edi
movzwl 0x1e(%rsi), %r8d
movzwl 0xe(%rsi), %r9d
movzwl 0x16(%rsi), %esi
addl %r9d, %esi
movzwl 0x1e(%rdx), %r9d
addl %r8d, %r9d
addl %edi, %r9d
movzwl 0xe(%rdx), %edi
movzwl 0x16(%rdx), %edx
addl %edi, %edx
addl %esi, %edx
leal (%r9,%r9,2), %esi
addl %eax, %esi
leal (%rdx,%rdx,8), %eax
addl %esi, %eax
addl $0x18, %eax
imulq $0x5397829d, %rax, %rax # imm = 0x5397829D
shrq $0x24, %rax
movw %ax, 0x6(%rcx)
retq
// File: /workspace/github_cpp_makefile_star2_O1/kylegranger[P]ImageScaling/filter16.cpp
// Function: DownfilterRight(color_t*, color_t*, color_t*, color_t*)
void DownfilterRight(color_t *src1, color_t *src2, color_t *src3, color_t *dst)
{
	// we mix 16 source pixels into one destination pixel
	int r = (src1[0].r)     + 3 * (src1[1].r + src1[2].r);
	r    += (src2[0].r) * 3 + 9 * (src2[1].r + src2[2].r);
	r    += (src3[0].r) * 3 + 9 * (src3[1].r + src3[2].r);
	dst->r = ((r+24)/49);
	int g = (src1[0].g)     + 3 * (src1[1].g + src1[2].g);
	g    += (src2[0].g) * 3 + 9 * (src2[1].g + src2[2].g);
	g    += (src3[0].g) * 3 + 9 * (src3[1].g + src3[2].g);
	dst->g = ((g+24)/49);
	int b = (src1[0].b)     + 3 * (src1[1].b + src1[2].b);
	b    += (src2[0].b) * 3 + 9 * (src2[1].b + src2[2].b);
	b    += (src3[0].b) * 3 + 9 * (src3[1].b + src3[2].b);
	dst->b = ((b+24)/49);
	int a = (src1[0].a)     + 3 * (src1[1].a + src1[2].a);
	a    += (src2[0].a) * 3 + 9 * (src2[1].a + src2[2].a);
	a    += (src3[0].a) * 3 + 9 * (src3[1].a + src3[2].a);
	dst->a = ((a+24)/49);
}

// Assembly:
movzwl 0x4(%rdi), %eax
movzwl 0xc(%rdi), %r8d
movzwl 0x14(%rdi), %r9d
addl %r8d, %r9d
movzwl 0x4(%rsi), %r8d
movzwl 0xc(%rsi), %r10d
movzwl 0x14(%rsi), %r11d
addl %r10d, %r11d
movzwl 0x4(%rdx), %r10d
addl %r8d, %r10d
addl %r9d, %r10d
movzwl 0xc(%rdx), %r8d
movzwl 0x14(%rdx), %r9d
addl %r8d, %r9d
addl %r11d, %r9d
leal (%r10,%r10,2), %r8d
addl %eax, %r8d
leal (%r9,%r9,8), %eax
addl %r8d, %eax
addl $0x18, %eax
imulq $0x5397829d, %rax, %rax # imm = 0x5397829D
shrq $0x24, %rax
movw %ax, 0x4(%rcx)
movzwl 0x2(%rdi), %eax
movzwl 0xa(%rdi), %r8d
movzwl 0x12(%rdi), %r9d
addl %r8d, %r9d
movzwl 0x2(%rsi), %r8d
movzwl 0xa(%rsi), %r10d
movzwl 0x12(%rsi), %r11d
addl %r10d, %r11d
movzwl 0x2(%rdx), %r10d
addl %r8d, %r10d
addl %r9d, %r10d
movzwl 0xa(%rdx), %r8d
movzwl 0x12(%rdx), %r9d
addl %r8d, %r9d
addl %r11d, %r9d
leal (%r10,%r10,2), %r8d
addl %eax, %r8d
leal (%r9,%r9,8), %eax
addl %r8d, %eax
addl $0x18, %eax
imulq $0x5397829d, %rax, %rax # imm = 0x5397829D
shrq $0x24, %rax
movw %ax, 0x2(%rcx)
movzwl (%rdi), %eax
movzwl 0x8(%rdi), %r8d
movzwl 0x10(%rdi), %r9d
addl %r8d, %r9d
movzwl (%rsi), %r8d
movzwl 0x8(%rsi), %r10d
movzwl 0x10(%rsi), %r11d
addl %r10d, %r11d
movzwl (%rdx), %r10d
addl %r8d, %r10d
addl %r9d, %r10d
movzwl 0x8(%rdx), %r8d
movzwl 0x10(%rdx), %r9d
addl %r8d, %r9d
addl %r11d, %r9d
leal (%r10,%r10,2), %r8d
addl %eax, %r8d
leal (%r9,%r9,8), %eax
addl %r8d, %eax
addl $0x18, %eax
imulq $0x5397829d, %rax, %rax # imm = 0x5397829D
shrq $0x24, %rax
movw %ax, (%rcx)
movzwl 0x6(%rdi), %eax
movzwl 0xe(%rdi), %r8d
movzwl 0x16(%rdi), %edi
addl %r8d, %edi
movzwl 0x6(%rsi), %r8d
movzwl 0xe(%rsi), %r9d
movzwl 0x16(%rsi), %esi
addl %r9d, %esi
movzwl 0x6(%rdx), %r9d
addl %r8d, %r9d
addl %edi, %r9d
movzwl 0xe(%rdx), %edi
movzwl 0x16(%rdx), %edx
addl %edi, %edx
addl %esi, %edx
leal (%r9,%r9,2), %esi
addl %eax, %esi
leal (%rdx,%rdx,8), %eax
addl %esi, %eax
addl $0x18, %eax
imulq $0x5397829d, %rax, %rax # imm = 0x5397829D
shrq $0x24, %rax
movw %ax, 0x6(%rcx)
retq
// File: /workspace/github_cpp_makefile_star2_O1/kylegranger[P]ImageScaling/filter16.cpp
// Function: UpfilterX(color_t*, color_t*)
void UpfilterX(color_t *src, color_t *dst)
{
	// we mix three source pixels (A,B.C) into two destination pixels (1,2)
	// AB -> 1;  BC -> 2
	// All on same scanline.
	dst[0].r = ((src[0].r + 3 * src[1].r + 2) >> 2);
	dst[1].r = ((src[1].r * 3 + src[2].r + 2) >> 2);
	dst[0].g = ((src[0].g + 3 * src[1].g + 2) >> 2);
	dst[1].g = ((src[1].g * 3 + src[2].g + 2) >> 2);
	dst[0].b = ((src[0].b + 3 * src[1].b + 2) >> 2);
	dst[1].b = ((src[1].b * 3 + src[2].b + 2) >> 2);
	dst[0].a = ((src[0].a + 3 * src[1].a + 2) >> 2);
	dst[1].a = ((src[1].a * 3 + src[2].a + 2) >> 2);
}

// Assembly:
movzwl 0x4(%rdi), %eax
movzwl 0xc(%rdi), %ecx
leal (%rcx,%rcx,2), %ecx
addl %ecx, %eax
addl $0x2, %eax
shrl $0x2, %eax
movw %ax, 0x4(%rsi)
movzwl 0xc(%rdi), %eax
leal (%rax,%rax,2), %eax
movzwl 0x14(%rdi), %ecx
addl %ecx, %eax
addl $0x2, %eax
shrl $0x2, %eax
movw %ax, 0xc(%rsi)
movzwl 0x2(%rdi), %eax
movzwl 0xa(%rdi), %ecx
leal (%rcx,%rcx,2), %ecx
addl %ecx, %eax
addl $0x2, %eax
shrl $0x2, %eax
movw %ax, 0x2(%rsi)
movzwl 0xa(%rdi), %eax
leal (%rax,%rax,2), %eax
movzwl 0x12(%rdi), %ecx
addl %ecx, %eax
addl $0x2, %eax
shrl $0x2, %eax
movw %ax, 0xa(%rsi)
movzwl (%rdi), %eax
movzwl 0x8(%rdi), %ecx
leal (%rcx,%rcx,2), %ecx
addl %ecx, %eax
addl $0x2, %eax
shrl $0x2, %eax
movw %ax, (%rsi)
movzwl 0x8(%rdi), %eax
leal (%rax,%rax,2), %eax
movzwl 0x10(%rdi), %ecx
addl %ecx, %eax
addl $0x2, %eax
shrl $0x2, %eax
movw %ax, 0x8(%rsi)
movzwl 0x6(%rdi), %eax
movzwl 0xe(%rdi), %ecx
leal (%rcx,%rcx,2), %ecx
addl %ecx, %eax
addl $0x2, %eax
shrl $0x2, %eax
movw %ax, 0x6(%rsi)
movzwl 0xe(%rdi), %eax
leal (%rax,%rax,2), %eax
movzwl 0x16(%rdi), %ecx
addl %ecx, %eax
addl $0x2, %eax
shrl $0x2, %eax
movw %ax, 0xe(%rsi)
retq
// File: /workspace/github_cpp_makefile_star2_O1/kylegranger[P]ImageScaling/filter16.cpp
// Function: UpfilterXLeft(color_t*, color_t*)
void UpfilterXLeft(color_t *src, color_t *dst)
{
	dst[0].r = src[1].r;
	dst[1].r = ((src[1].r * 3 + src[2].r + 2) >> 2);
	dst[0].g = src[1].g;
	dst[1].g = ((src[1].g * 3 + src[2].g + 2) >> 2);
	dst[0].b = src[1].b;
	dst[1].b = ((src[1].b * 3 + src[2].b + 2) >> 2);
}

// Assembly:
movzwl 0xc(%rdi), %eax
movw %ax, 0x4(%rsi)
movzwl 0xc(%rdi), %eax
leal (%rax,%rax,2), %eax
movzwl 0x14(%rdi), %ecx
addl %ecx, %eax
addl $0x2, %eax
shrl $0x2, %eax
movw %ax, 0xc(%rsi)
movzwl 0xa(%rdi), %eax
movw %ax, 0x2(%rsi)
movzwl 0xa(%rdi), %eax
leal (%rax,%rax,2), %eax
movzwl 0x12(%rdi), %ecx
addl %ecx, %eax
addl $0x2, %eax
shrl $0x2, %eax
movw %ax, 0xa(%rsi)
movzwl 0x8(%rdi), %eax
movw %ax, (%rsi)
movzwl 0x8(%rdi), %eax
leal (%rax,%rax,2), %eax
movzwl 0x10(%rdi), %ecx
addl %ecx, %eax
addl $0x2, %eax
shrl $0x2, %eax
movw %ax, 0x8(%rsi)
retq
// File: /workspace/github_cpp_makefile_star2_O1/kylegranger[P]ImageScaling/filter16.cpp
// Function: UpfilterXRight(color_t*, color_t*)
void UpfilterXRight(color_t *src, color_t *dst)
{
	dst[0].r = ((src[0].r + 3 * src[1].r + 2) >> 2);
	dst[1].r = src[1].r;
	dst[0].g = ((src[0].g + 3 * src[1].g + 2) >> 2);
	dst[1].g = src[1].g;
	dst[0].b = ((src[0].b + 3 * src[1].b + 2) >> 2);
	dst[1].b = src[1].b;
	dst[0].a = ((src[0].a + 3 * src[1].a + 2) >> 2);
	dst[1].a = src[1].a;
}

// Assembly:
movzwl 0x4(%rdi), %eax
movzwl 0xc(%rdi), %ecx
leal (%rcx,%rcx,2), %ecx
addl %ecx, %eax
addl $0x2, %eax
shrl $0x2, %eax
movw %ax, 0x4(%rsi)
movzwl 0xc(%rdi), %eax
movw %ax, 0xc(%rsi)
movzwl 0x2(%rdi), %eax
movzwl 0xa(%rdi), %ecx
leal (%rcx,%rcx,2), %ecx
addl %ecx, %eax
addl $0x2, %eax
shrl $0x2, %eax
movw %ax, 0x2(%rsi)
movzwl 0xa(%rdi), %eax
movw %ax, 0xa(%rsi)
movzwl (%rdi), %eax
movzwl 0x8(%rdi), %ecx
leal (%rcx,%rcx,2), %ecx
addl %ecx, %eax
addl $0x2, %eax
shrl $0x2, %eax
movw %ax, (%rsi)
movzwl 0x8(%rdi), %eax
movw %ax, 0x8(%rsi)
movzwl 0x6(%rdi), %eax
movzwl 0xe(%rdi), %ecx
leal (%rcx,%rcx,2), %ecx
addl %ecx, %eax
addl $0x2, %eax
shrl $0x2, %eax
movw %ax, 0x6(%rsi)
movzwl 0xe(%rdi), %eax
movw %ax, 0xe(%rsi)
retq
// File: /workspace/github_cpp_makefile_star2_O1/kylegranger[P]ImageScaling/filter16.cpp
// Function: UpfilterY(color_t*, color_t*, color_t*, color_t*, color_t*)
void UpfilterY(color_t *src1, color_t *src2, color_t *src3, color_t *dst1, color_t *dst2)
{
	dst1->r = ((src1->r + 3 * src2->r + 2) >> 2);
	dst2->r = ((src2->r * 3 + src3->r + 2) >> 2);
	dst1->g = ((src1->g + 3 * src2->g + 2) >> 2);
	dst2->g = ((src2->g * 3 + src3->g + 2) >> 2);
	dst1->b = ((src1->b + 3 * src2->b + 2) >> 2);
	dst2->b = ((src2->b * 3 + src3->b + 2) >> 2);
	dst1->a = ((src1->a + 3 * src2->a + 2) >> 2);
	dst2->a = ((src2->a * 3 + src3->a + 2) >> 2);
}

// Assembly:
movzwl 0x4(%rdi), %eax
movzwl 0x4(%rsi), %r9d
leal (%r9,%r9,2), %r9d
addl %r9d, %eax
addl $0x2, %eax
shrl $0x2, %eax
movw %ax, 0x4(%rcx)
movzwl 0x4(%rsi), %eax
leal (%rax,%rax,2), %eax
movzwl 0x4(%rdx), %r9d
addl %r9d, %eax
addl $0x2, %eax
shrl $0x2, %eax
movw %ax, 0x4(%r8)
movzwl 0x2(%rdi), %eax
movzwl 0x2(%rsi), %r9d
leal (%r9,%r9,2), %r9d
addl %r9d, %eax
addl $0x2, %eax
shrl $0x2, %eax
movw %ax, 0x2(%rcx)
movzwl 0x2(%rsi), %eax
leal (%rax,%rax,2), %eax
movzwl 0x2(%rdx), %r9d
addl %r9d, %eax
addl $0x2, %eax
shrl $0x2, %eax
movw %ax, 0x2(%r8)
movzwl (%rdi), %eax
movzwl (%rsi), %r9d
leal (%r9,%r9,2), %r9d
addl %r9d, %eax
addl $0x2, %eax
shrl $0x2, %eax
movw %ax, (%rcx)
movzwl (%rsi), %eax
leal (%rax,%rax,2), %eax
movzwl (%rdx), %r9d
addl %r9d, %eax
addl $0x2, %eax
shrl $0x2, %eax
movw %ax, (%r8)
movzwl 0x6(%rdi), %eax
movzwl 0x6(%rsi), %edi
leal (%rdi,%rdi,2), %edi
addl %edi, %eax
addl $0x2, %eax
shrl $0x2, %eax
movw %ax, 0x6(%rcx)
movzwl 0x6(%rsi), %eax
leal (%rax,%rax,2), %eax
movzwl 0x6(%rdx), %ecx
addl %ecx, %eax
addl $0x2, %eax
shrl $0x2, %eax
movw %ax, 0x6(%r8)
retq
// File: /workspace/github_cpp_makefile_star2_O1/kylegranger[P]ImageScaling/linear16.cpp
// Function: CLinear16::CLinear16(int, int)
CLinear16::CLinear16(int width, int height)
{
	mWidth = width;
	mHeight = height;
	mDataSize = mWidth * mHeight * (int) sizeof(color_t);
	mData = new color_t[ mWidth * mHeight ];
	memset(mData,128,mDataSize);
	assert(mData);
	mChannel = -1;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
movl %esi, (%rdi)
movl %edx, 0x4(%rdi)
imull %esi, %edx
leal (,%rdx,8), %eax
movslq %eax, %r14
movq %r14, 0x8(%rdi)
movslq %edx, %rax
leaq (,%rax,8), %rcx
testl %eax, %eax
movq $-0x1, %rdi
cmovnsq %rcx, %rdi
callq 0x9ef0
movq %rax, 0x18(%rbx)
movq %rax, %rdi
movl $0x80, %esi
movq %r14, %rdx
callq 0x4070
movl $0xffffffff, 0x10(%rbx) # imm = 0xFFFFFFFF
addq $0x8, %rsp
popq %rbx
popq %r14
retq
nop
// File: /workspace/github_cpp_makefile_star2_O1/kylegranger[P]ImageScaling/linear16.cpp
// Function: CLinear16::ChannelSwap(int)
void CLinear16::ChannelSwap(int swap)
{
	color_t *c = mData;
	int numpixels = mWidth * mHeight;
	if (swap == 132)
	{
		for (int i = 0; i < numpixels; i++)
		{
			color_t temp = *c;
			c->g = temp.b;
			c->b = temp.g;
			c++;
		}
	}
	else if (swap == 213)
	{
		for (int i = 0; i < numpixels; i++)
		{
			color_t temp = *c;
			c->r = temp.g;
			c->g = temp.r;
			c++;
		}
	}
	else if (swap == 231)
	{
		for (int i = 0; i < numpixels; i++)
		{
			color_t temp = *c;
			c->r = temp.g;
			c->g = temp.b;
			c->b = temp.r;
			c++;
		}
	}
	else if (swap == 312)
	{
		for (int i = 0; i < numpixels; i++)
		{
			color_t temp = *c;
			c->r = temp.b;
			c->g = temp.r;
			c->b = temp.g;
			c++;
		}
	}
	else if (swap == 321)
	{
		for (int i = 0; i < numpixels; i++)
		{
			color_t temp = *c;
			c->r = temp.b;
			c->b = temp.r;
			c++;
		}
	}
}

// Assembly:
movq 0x18(%rdi), %rax
movl 0x4(%rdi), %ecx
imull (%rdi), %ecx
cmpl $0xe6, %esi
jle 0x7128
cmpl $0xe7, %esi
je 0x714e
cmpl $0x138, %esi            # imm = 0x138
je 0x717d
cmpl $0x141, %esi            # imm = 0x141
jne 0x71b1
testl %ecx, %ecx
jle 0x71b1
movl %ecx, %ecx
xorl %edx, %edx
movzwl (%rax,%rdx,8), %esi
movzwl 0x4(%rax,%rdx,8), %edi
movw %si, 0x4(%rax,%rdx,8)
movw %di, (%rax,%rdx,8)
incq %rdx
cmpl %edx, %ecx
jne 0x710a
jmp 0x71b1
cmpl $0x84, %esi
je 0x719e
cmpl $0xd5, %esi
jne 0x71b1
testl %ecx, %ecx
jle 0x71b1
movl %ecx, %ecx
xorl %edx, %edx
roll $0x10, 0x2(%rax,%rdx,8)
incq %rdx
cmpl %edx, %ecx
jne 0x7140
jmp 0x71b1
testl %ecx, %ecx
jle 0x71b1
movl %ecx, %ecx
xorl %edx, %edx
movzwl (%rax,%rdx,8), %esi
movzwl 0x2(%rax,%rdx,8), %edi
movzwl 0x4(%rax,%rdx,8), %r8d
movw %di, 0x4(%rax,%rdx,8)
movw %si, 0x2(%rax,%rdx,8)
movw %r8w, (%rax,%rdx,8)
incq %rdx
cmpl %edx, %ecx
jne 0x7156
jmp 0x71b1
testl %ecx, %ecx
jle 0x71b1
movl %ecx, %ecx
xorl %edx, %edx
movzwl (%rax,%rdx,8), %esi
movl 0x2(%rax,%rdx,8), %edi
movw %si, 0x4(%rax,%rdx,8)
movl %edi, (%rax,%rdx,8)
incq %rdx
cmpl %edx, %ecx
jne 0x7185
jmp 0x71b1
testl %ecx, %ecx
jle 0x71b1
movl %ecx, %ecx
xorl %edx, %edx
roll $0x10, (%rax,%rdx,8)
incq %rdx
cmpl %edx, %ecx
jne 0x71a6
retq
// File: /workspace/github_cpp_makefile_star2_O1/kylegranger[P]ImageScaling/linear16.cpp
// Function: CLinear16::Invert()
void CLinear16::Invert()
{
	color_t *c = mData;
	int numpixels = mWidth * mHeight;
	for (int i = 0; i < numpixels; i++)
	{
		c->r = 65535 - c->r;
		c->g = 65535 - c->g;
		c->b = 65535 - c->b;
		c++;
	}
}

// Assembly:
movl 0x4(%rdi), %ecx
imull (%rdi), %ecx
testl %ecx, %ecx
jle 0x71d9
movq 0x18(%rdi), %rax
movl %ecx, %ecx
xorl %edx, %edx
notw 0x4(%rax,%rdx,8)
notw 0x2(%rax,%rdx,8)
notw (%rax,%rdx,8)
incq %rdx
cmpl %edx, %ecx
jne 0x71c4
retq
// File: /workspace/github_cpp_makefile_star2_O1/kylegranger[P]ImageScaling/linear16.cpp
// Function: CLinear16::Init(int, int)
bool CLinear16::Init(int width, int height)
{
	mWidth = width;
	mHeight = height;
	mDataSize = mWidth * mHeight * (int)sizeof(color_t);
	mData = new color_t[ mWidth * mHeight ];
	if (!mData) return false;
	return true;
}

// Assembly:
pushq %rbx
movq %rdi, %rbx
movl %esi, (%rdi)
movl %edx, 0x4(%rdi)
imull %esi, %edx
leal (,%rdx,8), %eax
cltq
movq %rax, 0x8(%rdi)
movslq %edx, %rax
leaq (,%rax,8), %rcx
testl %eax, %eax
movq $-0x1, %rdi
cmovnsq %rcx, %rdi
callq 0x9ef0
movq %rax, 0x18(%rbx)
movb $0x1, %al
popq %rbx
retq
// File: /workspace/github_cpp_makefile_star2_O1/kylegranger[P]ImageScaling/linear16.cpp
// Function: CLinear16::GetPixel(int, int, color_t&)
void CLinear16::GetPixel(int x, int y, color_t &color)
{
	if (x < 0)        x = 0;
	if (x >= mWidth)  x = mWidth - 1;
	if (y < 0)        y = 0;
	if (y >= mHeight) y = mHeight - 1;

	color_t *c = mData + y * mWidth + x;
	color = *c;
}

// Assembly:
xorl %eax, %eax
testl %esi, %esi
cmovlel %eax, %esi
movl (%rdi), %r8d
movl 0x4(%rdi), %r9d
leal -0x1(%r8), %r10d
cmpl %r8d, %esi
cmovll %esi, %r10d
testl %edx, %edx
cmovgl %edx, %eax
leal -0x1(%r9), %edx
cmpl %r9d, %eax
cmovll %eax, %edx
imull %r8d, %edx
movslq %edx, %rax
shlq $0x3, %rax
addq 0x18(%rdi), %rax
movslq %r10d, %rdx
movq (%rax,%rdx,8), %rax
movq %rax, (%rcx)
retq
// File: /workspace/github_cpp_makefile_star2_O1/kylegranger[P]ImageScaling/linear16.cpp
// Function: CLinear16::WriteBmp(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>)
bool CLinear16::WriteBmp(std::string filename)
{
	int size;
	BitmapFileHeader bfh;
	BitmapInfoHeader bmh;

	FILE *f = fopen(filename.c_str(),"wb");
	if (!f) return false;
	size = mWidth*mHeight*3;

	memcpy(&bfh.bfType,"BM",2);
	bfh.bfSize = size + 56;
	bfh.bfOffBits = 54;
	fwrite(&bfh,1,sizeof(bfh),f);

	memset(&bmh,0,sizeof(bmh));
	bmh.biSize = sizeof(bmh);
	bmh.biWidth = mWidth;
	bmh.biHeight = -mHeight;
	bmh.biPlanes = 1;
	bmh.biBitCount = 24;
	bmh.biXPelsPerMeter = 2834;
	bmh.biYPelsPerMeter = 2834;
	fwrite(&bmh,1,sizeof(bmh),f);
	color_t *cptr = mData;
	uint8_t color[4];
	int pad = 0;
	int rowbytes = mWidth * 3;
	int modu = rowbytes & 3;
	if (modu)
		pad = 4 - modu;

	for (int y = 0; y < mHeight; y++)
	{
		for (int x = 0; x < mWidth; x++)
		{
			color[0] = cptr->b * 255 / 65535;
			color[1] = cptr->g * 255 / 65535;
			color[2] = cptr->r * 255 / 65535;
			fwrite(color,1,3,f);
			cptr++;
		}
		if (pad)
			fwrite(color,1,pad,f);
	}
	fwrite(color,1,2,f);
	fclose(f);
	return true;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x48, %rsp
movq %rdi, %r14
movq (%rsi), %rdi
leaq 0x1800d(%rip), %rsi     # 0x1f282
callq 0x4150
movq %rax, %rbx
testq %rax, %rax
je 0x73e1
movl (%r14), %eax
imull 0x4(%r14), %eax
leaq 0x12(%rsp), %rdi
movw $0x4d42, (%rdi)         # imm = 0x4D42
leal (%rax,%rax,2), %eax
addl $0x38, %eax
movl %eax, 0x2(%rdi)
movl $0x36, 0xa(%rdi)
movl $0x1, %esi
movl $0xe, %edx
movq %rbx, %rcx
callq 0x42d0
xorps %xmm0, %xmm0
leaq 0x20(%rsp), %rdi
movaps %xmm0, (%rdi)
movaps %xmm0, 0x10(%rdi)
movq $0x0, 0x20(%rdi)
movl $0x28, (%rdi)
movl (%r14), %eax
movl %eax, 0x4(%rdi)
xorl %ebp, %ebp
xorl %eax, %eax
subl 0x4(%r14), %eax
movl %eax, 0x8(%rdi)
movl $0x180001, 0xc(%rdi)    # imm = 0x180001
movabsq $0xb1200000b12, %rax    # imm = 0xB1200000B12
movq %rax, 0x18(%rdi)
movl $0x1, %esi
movl $0x28, %edx
movq %rbx, %rcx
callq 0x42d0
cmpl $0x0, 0x4(%r14)
jle 0x73c4
xorl %eax, %eax
subl (%r14), %eax
movq 0x18(%r14), %r15
andl $0x3, %eax
movl $0x4, %ecx
subl %eax, %ecx
testl %eax, %eax
movl %eax, 0x4(%rsp)
cmovel %eax, %ecx
movq %rcx, 0x8(%rsp)
movq %rsp, %r12
cmpl $0x0, (%r14)
jle 0x739c
xorl %r13d, %r13d
movzwl (%r15), %eax
imull $0xff01, %eax, %eax     # imm = 0xFF01
shrl $0x18, %eax
movb %al, (%rsp)
movzwl 0x2(%r15), %eax
imull $0xff01, %eax, %eax     # imm = 0xFF01
shrl $0x18, %eax
movb %al, 0x1(%rsp)
movzwl 0x4(%r15), %eax
imull $0xff01, %eax, %eax     # imm = 0xFF01
shrl $0x18, %eax
movb %al, 0x2(%rsp)
movl $0x1, %esi
movl $0x3, %edx
movq %r12, %rdi
movq %rbx, %rcx
callq 0x42d0
addq $0x8, %r15
incl %r13d
cmpl (%r14), %r13d
jl 0x7347
cmpl $0x0, 0x4(%rsp)
je 0x73b8
movl $0x1, %esi
movq %r12, %rdi
movq 0x8(%rsp), %rdx
movq %rbx, %rcx
callq 0x42d0
incl %ebp
cmpl 0x4(%r14), %ebp
jl 0x733e
movq %rsp, %rdi
movl $0x1, %esi
movl $0x2, %edx
movq %rbx, %rcx
callq 0x42d0
movq %rbx, %rdi
callq 0x42a0
testq %rbx, %rbx
setne %al
addq $0x48, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O1/kylegranger[P]ImageScaling/linear16.cpp
// Function: CLinear16::UpsampleX(CLinear16*)
void CLinear16::UpsampleX(CLinear16 *bmp)
{
	color_t *src = mData - 1;
	color_t *dst = bmp->mData;
	for (int y = 0; y < mHeight; y++)
	{
		UpfilterXLeft(src++, dst);
		dst += 2;
		for (int x = 1; x < mWidth-1; x++)
		{
			UpfilterX(src++, dst);
			dst += 2;
		}
		UpfilterXRight(src++, dst);
		dst += 2;
	}
}

// Assembly:
cmpl $0x0, 0x4(%rdi)
jle 0x7862
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movq %rdi, %rbx
movq 0x18(%rsi), %r14
movq 0x18(%rdi), %r15
addq $-0x8, %r15
xorl %ebp, %ebp
movq %r15, %rdi
movq %r14, %rsi
callq 0x64a7
cmpl $0x3, (%rbx)
jl 0x783e
movl $0x1, %r12d
addq $0x8, %r15
addq $0x10, %r14
movq %r15, %rdi
movq %r14, %rsi
callq 0x63f0
incl %r12d
movl (%rbx), %eax
decl %eax
cmpl %eax, %r12d
jl 0x7815
leaq 0x8(%r15), %rdi
leaq 0x10(%r14), %rsi
jmp 0x7846
leaq 0x10(%r14), %rsi
leaq 0x8(%r15), %rdi
addq $0x10, %r15
callq 0x6504
addq $0x20, %r14
incl %ebp
cmpl 0x4(%rbx), %ebp
jl 0x77ff
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
nop
// File: /workspace/github_cpp_makefile_star2_O1/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
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %rsi, 0x10(%rsp)
movl 0x4(%rdi), %eax
testl %eax, %eax
jle 0x7a53
movq %rdi, %r9
movq 0x10(%rsp), %rdx
movq 0x18(%rdx), %rcx
movslq (%rdx), %rdx
leaq (%rcx,%rdx,8), %r8
movq 0x18(%rdi), %r15
movslq (%rdi), %rdx
leaq (%r15,%rdx,8), %r13
shlq $0x3, %rdx
movq %r15, %r12
subq %rdx, %r12
xorl %esi, %esi
movq %rdi, (%rsp)
testl %esi, %esi
movl %esi, 0xc(%rsp)
je 0x799f
decl %eax
movl (%r9), %edx
cmpl %eax, %esi
jne 0x79de
testl %edx, %edx
jle 0x7a24
xorl %r14d, %r14d
leaq 0x8(%rcx), %rbx
leaq 0x8(%r8), %rbp
movq %r12, %rdi
movq %r15, %rsi
movq %r15, %rdx
callq 0x657f
movq (%rsp), %r9
addq $0x8, %r12
addq $0x8, %r15
addq $0x8, %r13
incl %r14d
movq %rbp, %r8
movq %rbx, %rcx
cmpl (%r9), %r14d
jl 0x7966
jmp 0x7a2a
cmpl $0x0, (%r9)
jle 0x7a24
xorl %r14d, %r14d
leaq 0x8(%rcx), %rbx
leaq 0x8(%r8), %rbp
movq %r15, %rdi
movq %r15, %rsi
movq %r13, %rdx
callq 0x657f
movq (%rsp), %r9
addq $0x8, %r12
addq $0x8, %r15
addq $0x8, %r13
incl %r14d
movq %rbp, %r8
movq %rbx, %rcx
cmpl (%r9), %r14d
jl 0x79a8
jmp 0x7a2a
testl %edx, %edx
jle 0x7a24
xorl %r14d, %r14d
movq %r13, %rdx
movq %r15, %rsi
movq %r12, %rdi
leaq 0x8(%rdi), %r12
leaq 0x8(%rsi), %r15
leaq 0x8(%rdx), %r13
leaq 0x8(%rcx), %rbx
leaq 0x8(%r8), %rbp
callq 0x6645
movq (%rsp), %r9
incl %r14d
movq %rbp, %r8
movq %rbx, %rcx
movq %r13, %rdx
movq %r15, %rsi
movq %r12, %rdi
cmpl (%r9), %r14d
jl 0x79ee
jmp 0x7a2a
movq %rcx, %rbx
movq %r8, %rbp
movq 0x10(%rsp), %rax
movslq (%rax), %rax
leaq (%rbx,%rax,8), %rcx
leaq (,%rax,8), %r8
addq %rbp, %r8
movl 0xc(%rsp), %esi
incl %esi
movl 0x4(%r9), %eax
cmpl %eax, %esi
jl 0x7946
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O1/kylegranger[P]ImageScaling/linear16.cpp
// Function: CLinear16::DownsampleX(CLinear16*)
void CLinear16::DownsampleX(CLinear16 *bmp)
{
	assert((mWidth  & 0xfffe) == bmp->mWidth*2);
	assert(mHeight == bmp->mHeight);
	color_t *src = mData - 1;
	color_t *dst = bmp->mData;
	for (int y = 0; y < bmp->mHeight; y++)
	{
		DownfilterXLeft(src, dst++);
		src += 2;
		for (int x = 1; x < bmp->mWidth-1; x++)
		{
			DownfilterX(src, dst++);
			src += 2;
		}
		DownfilterXRight(src, dst++);
		src += 2 + (mWidth&1);
	}
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movl $0xfffe, %eax           # imm = 0xFFFE
andl (%rdi), %eax
movl (%rsi), %ecx
addl %ecx, %ecx
cmpl %ecx, %eax
jne 0x7f5c
movq %rdi, %rbx
movq %rsi, %r14
movl 0x4(%rdi), %eax
cmpl 0x4(%rsi), %eax
jne 0x7f7b
cmpl $0x0, 0x4(%r14)
jle 0x7f4d
movq 0x18(%r14), %r15
movq 0x18(%rbx), %r12
addq $-0x8, %r12
xorl %ebp, %ebp
movq %r12, %rdi
movq %r15, %rsi
callq 0x571f
addq $0x10, %r12
cmpl $0x3, (%r14)
jl 0x7f28
movl $0x1, %r13d
addq $0x8, %r15
movq %r12, %rdi
movq %r15, %rsi
callq 0x5690
incl %r13d
addq $0x10, %r12
movl (%r14), %eax
decl %eax
cmpl %eax, %r13d
jl 0x7f08
leaq 0x8(%r15), %rsi
addq $0x10, %r15
movq %r12, %rdi
callq 0x57b3
movl (%rbx), %eax
andl $0x1, %eax
leaq (%r12,%rax,8), %r12
addq $0x10, %r12
incl %ebp
cmpl 0x4(%r14), %ebp
jl 0x7eed
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x17322(%rip), %rdi     # 0x1f285
leaq 0x1729a(%rip), %rsi     # 0x1f204
leaq 0x17384(%rip), %rcx     # 0x1f2f5
movl $0x1f6, %edx            # imm = 0x1F6
callq 0x4100
leaq 0x1739c(%rip), %rdi     # 0x1f31e
leaq 0x1727b(%rip), %rsi     # 0x1f204
leaq 0x17365(%rip), %rcx     # 0x1f2f5
movl $0x1f7, %edx            # imm = 0x1F7
callq 0x4100
// File: /workspace/github_cpp_makefile_star2_O1/kylegranger[P]ImageScaling/linear16.cpp
// Function: CLinear16::WriteSimple16(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>, ESimpleFormat)
bool CLinear16::WriteSimple16(std::string filename, ESimpleFormat format)
{
	int bytesPerPixel;
	TSimpleHeader header;
	int bytesPerLine;
	;

	FILE *f = fopen(filename.c_str(), "wb");
	if (f == NULL) 
		return false;
	switch (format)
	{
	case ESimpleFormatRgba:
	case ESimpleFormatBgra:
		bytesPerPixel = 8;
		break;
	case ESimpleFormatRgb:
	case ESimpleFormatBgr:
		bytesPerPixel = 6;
		break;
	case ESimpleFormatL:
		bytesPerPixel = 2;
		break;
	case ESimpleFormatLa:
		bytesPerPixel = 4;
		break;
	default:
		assert(0);
	return false;
	}

	header.cookieA = 'PMIS';
	header.cookieB = 'ECIL';
	header.datasize = bytesPerPixel * mWidth * mHeight;
	header.width = mWidth;
	header.height = mHeight;
	header.bits = 16;
	header.format = format;
	fwrite(&header,1,sizeof(TSimpleHeader),f);
	bytesPerLine = mWidth * bytesPerPixel;
	uint16_t *dst = (uint16_t *) malloc(bytesPerLine);
	color_t *src = mData;
	for (int i = 0; i < mHeight; i++)
	{
		WriteSimpleScanline(src, dst, format);
		fwrite(dst,1,bytesPerLine,f);
		src += mWidth;
	}
	fclose(f);
	free(dst);
	return true;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
movl %edx, %r12d
movq %rdi, %r15
movq (%rsi), %rdi
leaq 0x16d3e(%rip), %rsi     # 0x1f282
callq 0x4150
movq %rax, %rbx
testq %rax, %rax
je 0x8629
leal -0xc3b(%r12), %eax
cmpl $0x6, %eax
jae 0x863e
movl %eax, %eax
leaq 0x16c7d(%rip), %rcx     # 0x1f1ec
movslq (%rcx,%rax,4), %r14
movabsq $0x4543494c504d4953, %rax # imm = 0x4543494C504D4953
leaq 0x8(%rsp), %rdi
movq %rax, (%rdi)
movl (%r15), %eax
movl 0x4(%r15), %ecx
movl %eax, %edx
imull %ecx, %edx
imull %r14d, %edx
movslq %edx, %rdx
movq %rdx, 0x8(%rdi)
movl %eax, 0x10(%rdi)
movl %ecx, 0x14(%rdi)
movl $0x10, 0x18(%rdi)
movl %r12d, 0x1c(%rdi)
movl $0x1, %esi
movl $0x20, %edx
movq %rbx, %rcx
callq 0x42d0
movq %r12, (%rsp)
movslq (%r15), %r12
imulq %r14, %r12
movq %r12, %rdi
callq 0x4140
movq %rax, %r13
cmpl $0x0, 0x4(%r15)
jle 0x8619
movq 0x18(%r15), %rbp
xorl %r14d, %r14d
movq %r15, %rdi
movq %rbp, %rsi
movq %r13, %rdx
movq (%rsp), %rcx
callq 0x8218
movl $0x1, %esi
movq %r13, %rdi
movq %r12, %rdx
movq %rbx, %rcx
callq 0x42d0
movslq (%r15), %rax
leaq (%rbp,%rax,8), %rbp
incl %r14d
cmpl 0x4(%r15), %r14d
jl 0x85e3
movq %rbx, %rdi
callq 0x42a0
movq %r13, %rdi
callq 0x41c0
testq %rbx, %rbx
setne %al
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x16d4a(%rip), %rdi     # 0x1f38f
leaq 0x16bb8(%rip), %rsi     # 0x1f204
leaq 0x16d3e(%rip), %rcx     # 0x1f391
movl $0x2d5, %edx            # imm = 0x2D5
callq 0x4100
nop
// File: /workspace/github_cpp_makefile_star2_O1/kylegranger[P]ImageScaling/linear16.cpp
// Function: CLinear16::ConvertToMonochrome()
void CLinear16::ConvertToMonochrome()
{
	color_t *c = mData;
	for (int y = 0; y < mHeight; y++)
	{
		for (int x = 0; x < mWidth; x++)
		{
			// scale by 10000
			int luma = c->r * 2126 + c->g * 7152 + c->b * 722 + 5000;
			luma /= 10000;
			c->r = luma;
			c->g = luma;
			c->b = luma;
			c++;
		}
	}

}

// Assembly:
movl 0x4(%rdi), %eax
testl %eax, %eax
jle 0x888c
movq 0x18(%rdi), %rcx
movl (%rdi), %edx
xorl %esi, %esi
movl %edx, %edi
testl %edx, %edx
jle 0x8886
movzwl 0x4(%rcx), %r8d
imull $0x84e, %r8d, %r8d      # imm = 0x84E
movzwl 0x2(%rcx), %r9d
imull $0x1bf0, %r9d, %r9d     # imm = 0x1BF0
addl %r8d, %r9d
movzwl (%rcx), %r8d
imull $0x2d2, %r8d, %r8d      # imm = 0x2D2
addl %r9d, %r8d
addl $0x1388, %r8d           # imm = 0x1388
imulq $0x68db8bad, %r8, %r8   # imm = 0x68DB8BAD
shrq $0x2c, %r8
movw %r8w, 0x4(%rcx)
movw %r8w, 0x2(%rcx)
movw %r8w, (%rcx)
addq $0x8, %rcx
decl %edi
jne 0x8835
incl %esi
cmpl %eax, %esi
jne 0x882f
retq
nop
// File: /workspace/github_cpp_makefile_star2_O1/kylegranger[P]ImageScaling/linear16.cpp
// Function: CLinear16::CompositePremultiplied(CLinear16*)
void CLinear16::CompositePremultiplied(CLinear16 *overlay)
{
	color_t *src = overlay->mData;
	color_t *dst = mData;
	for (int y = 0; y < mHeight; y++)
	{
		for (int x = 0; x < mWidth; x++)
		{
			if (src->a == 0xffff)
			{
				// destination gets 100% of source
				*dst = *src;
			}
			else if (src->a > 0)
			{
				// destination gets 100% of source
				int b = 0xffff - src->a;
				dst->b = dst->b * b / 65535 + src->b;
				dst->g = dst->g * b / 65535 + src->g;
				dst->r = dst->r * b / 65535 + src->r;
			}
			src++;
			dst++;
		}
	}
}

// Assembly:
cmpl $0x0, 0x4(%rdi)
jle 0x893e
movq 0x18(%rdi), %rax
movq 0x18(%rsi), %rcx
xorl %edx, %edx
movl $0x80008001, %esi       # imm = 0x80008001
cmpl $0x0, (%rdi)
jle 0x8933
xorl %r8d, %r8d
movzwl 0x6(%rcx), %r9d
testl %r9d, %r9d
je 0x8923
cmpl $0xffff, %r9d           # imm = 0xFFFF
jne 0x88ce
movq (%rcx), %r9
movq %r9, (%rax)
jmp 0x8923
notl %r9d
movzwl %r9w, %r9d
movzwl (%rax), %r10d
imull %r9d, %r10d
imulq %rsi, %r10
shrq $0x2f, %r10
addw (%rcx), %r10w
movw %r10w, (%rax)
movzwl 0x2(%rax), %r10d
imull %r9d, %r10d
imulq %rsi, %r10
shrq $0x2f, %r10
addw 0x2(%rcx), %r10w
movw %r10w, 0x2(%rax)
movzwl 0x4(%rax), %r10d
imull %r9d, %r10d
imulq %rsi, %r10
shrq $0x2f, %r10
addw 0x4(%rcx), %r10w
movw %r10w, 0x4(%rax)
addq $0x8, %rcx
addq $0x8, %rax
incl %r8d
cmpl (%rdi), %r8d
jl 0x88b3
incl %edx
cmpl 0x4(%rdi), %edx
jl 0x88a7
retq
nop
// File: /workspace/github_cpp_makefile_star2_O1/kylegranger[P]ImageScaling/linear16.cpp
// Function: CLinear16::CompositeStraight(CLinear16*)
void CLinear16::CompositeStraight(CLinear16 *overlay)
{
	color_t *src = overlay->mData;
	color_t *dst = mData;
	for (int y = 0; y < mHeight; y++)
	{
		for (int x = 0; x < mWidth; x++)
		{
			if (src->a == 0xffff)
			{
				// destination gets 100% of source
				*dst = *src;
			}
			else if (src->a > 0)
			{
				// destination gets 100% of source
				int b = 0xffff - src->a;
				dst->b = (dst->b * b + src->b * src->a) / 65535;
				dst->g = (dst->g * b + src->g * src->a) / 65535;
				dst->r = (dst->r * b + src->r * src->a) / 65535;
			}
			src++;
			dst++;
		}
	}
}

// Assembly:
cmpl $0x0, 0x4(%rdi)
jle 0x8a0a
pushq %rbx
movq 0x18(%rdi), %rax
movq 0x18(%rsi), %rcx
xorl %edx, %edx
movl $0x80008001, %esi       # imm = 0x80008001
cmpl $0x0, (%rdi)
jle 0x89fe
xorl %r8d, %r8d
movzwl 0x6(%rcx), %r9d
testl %r9d, %r9d
je 0x89ea
cmpl $0xffff, %r9d           # imm = 0xFFFF
jne 0x8981
movq (%rcx), %r9
movq %r9, (%rax)
jmp 0x89ea
movl %r9d, %r10d
xorl $0xffff, %r10d          # imm = 0xFFFF
movzwl (%rax), %r11d
imull %r10d, %r11d
movzwl (%rcx), %ebx
imull %r9d, %ebx
addl %r11d, %ebx
imulq %rsi, %rbx
shrq $0x2f, %rbx
movw %bx, (%rax)
movzwl 0x2(%rax), %r11d
imull %r10d, %r11d
movzwl 0x2(%rcx), %ebx
imull %r9d, %ebx
addl %r11d, %ebx
imulq %rsi, %rbx
shrq $0x2f, %rbx
movw %bx, 0x2(%rax)
movzwl 0x4(%rax), %r11d
imull %r10d, %r11d
movzwl 0x4(%rcx), %r10d
imull %r9d, %r10d
addl %r11d, %r10d
imulq %rsi, %r10
shrq $0x2f, %r10
movw %r10w, 0x4(%rax)
addq $0x8, %rcx
addq $0x8, %rax
incl %r8d
cmpl (%rdi), %r8d
jl 0x8966
incl %edx
cmpl 0x4(%rdi), %edx
jl 0x895a
popq %rbx
retq
nop
// File: /workspace/github_cpp_makefile_star2_O1/kylegranger[P]ImageScaling/linear16.cpp
// Function: CLinear16::WriteLumaToAlpha(bool)
void CLinear16::WriteLumaToAlpha(bool invertLuma)
{
	color_t *c = mData;
	for (int y = 0; y < mHeight; y++)
	{
		for (int x = 0; x < mWidth; x++)
		{
			int luma = c->r * 2126 + c->g * 7152 +c->b * 722 + 5000;
			luma /= 10000;
			c->a = invertLuma ? 65535 - luma : luma;
			c++;
		}
	}
}

// Assembly:
movl 0x4(%rdi), %eax
testl %eax, %eax
jle 0x8a7e
movq 0x18(%rdi), %rcx
movl (%rdi), %edx
xorl %edi, %edi
movl %edx, %r8d
testl %edx, %edx
jle 0x8a78
movzwl 0x4(%rcx), %r9d
imull $0x84e, %r9d, %r9d      # imm = 0x84E
movzwl 0x2(%rcx), %r10d
imull $0x1bf0, %r10d, %r10d   # imm = 0x1BF0
addl %r9d, %r10d
movzwl (%rcx), %r9d
imull $0x2d2, %r9d, %r9d      # imm = 0x2D2
addl %r10d, %r9d
addl $0x1388, %r9d           # imm = 0x1388
imulq $0x68db8bad, %r9, %r9   # imm = 0x68DB8BAD
shrq $0x2c, %r9
movl %r9d, %r10d
notl %r10d
testb %sil, %sil
cmovel %r9d, %r10d
movw %r10w, 0x6(%rcx)
addq $0x8, %rcx
decl %r8d
jne 0x8a22
incl %edi
cmpl %eax, %edi
jne 0x8a1b
retq
nop
// File: /workspace/github_cpp_makefile_star2_O1/kylegranger[P]ImageScaling/linear16.cpp
// Function: CLinear16::BlitImage(CLinear16*, int, int)
void CLinear16::BlitImage(CLinear16 *image, int dstX, int dstY)
{
	if (dstX + image->mWidth > mWidth)
	{
		assert(0);
		return;
	}
	if (dstY + image->mHeight > mHeight)
	{
		assert(0);
		return;
	}
	color_t *src = image->mData;
	color_t *dst = mData + dstY*mWidth + dstX;
	for (int y = 0; y < image->mHeight; y++)
	{
		for (int x = 0; x < image->mWidth; x++)
		{
			*dst++ = *src++;
		}
		dst += mWidth - image->mWidth;
	}
}

// Assembly:
pushq %rax
movl (%rsi), %r8d
addl %edx, %r8d
movl (%rdi), %eax
cmpl %eax, %r8d
jg 0x8af5
movl 0x4(%rsi), %r8d
addl %ecx, %r8d
cmpl 0x4(%rdi), %r8d
jg 0x8b14
cmpl $0x0, 0x4(%rsi)
jle 0x8af3
imull %ecx, %eax
cltq
shlq $0x3, %rax
addq 0x18(%rdi), %rax
movslq %edx, %rcx
leaq (%rax,%rcx,8), %rax
movq 0x18(%rsi), %rcx
xorl %edx, %edx
movl (%rsi), %r9d
testl %r9d, %r9d
jle 0x8adf
xorl %r8d, %r8d
movq (%rcx), %r9
addq $0x8, %rcx
movq %r9, (%rax)
addq $0x8, %rax
incl %r8d
movl (%rsi), %r9d
cmpl %r9d, %r8d
jl 0x8ac6
movslq (%rdi), %r8
movslq %r9d, %r9
subq %r9, %r8
leaq (%rax,%r8,8), %rax
incl %edx
cmpl 0x4(%rsi), %edx
jl 0x8abb
popq %rax
retq
leaq 0x16893(%rip), %rdi     # 0x1f38f
leaq 0x16701(%rip), %rsi     # 0x1f204
leaq 0x1693a(%rip), %rcx     # 0x1f444
movl $0x385, %edx            # imm = 0x385
callq 0x4100
leaq 0x16874(%rip), %rdi     # 0x1f38f
leaq 0x166e2(%rip), %rsi     # 0x1f204
leaq 0x1691b(%rip), %rcx     # 0x1f444
movl $0x38a, %edx            # imm = 0x38A
callq 0x4100
nop
// File: /workspace/github_cpp_makefile_star2_O1/kylegranger[P]ImageScaling/linear16.cpp
// Function: CLinear16::Flip(bool, bool)
void CLinear16::Flip(bool flipX, bool flipY)
{
	color_t *src;
	color_t *dst;
	color_t temp;

	if (flipY)
	{
		for (int y = 0; y < mHeight/2; y++)
		{
			src = mData + y * mWidth;
			dst = mData + (mHeight - 1 - y) * mWidth;
			if (flipX)
			{
				dst += mWidth - 1;
				for (int x = 0; x < mWidth; x++)
				{
					temp = *src;
					*src++ = *dst;
					*dst-- = temp;
				}
			}
			else
			{
				for (int x = 0; x < mWidth; x++)
				{
					temp = *src;
					*src++ = *dst;
					*dst++ = temp;
				}
			}
		}
	}
	else if (flipX)
	{
		for (int y = 0; y < mHeight; y++)
		{
			src = mData + y * mWidth;
			dst = src + mWidth - 1;
			for (int x = 0; x < mWidth/2; x++)
			{
				temp = *src;
				*src++ = *dst;
				*dst-- = temp;
			}
		}
	}
}

// Assembly:
testl %edx, %edx
je 0x8f62
movl 0x4(%rdi), %edx
cmpl $0x2, %edx
jl 0x8fcb
xorl %eax, %eax
movl $0xffffffff, %ecx       # imm = 0xFFFFFFFF
movq 0x18(%rdi), %r8
movl (%rdi), %r9d
testb %sil, %sil
je 0x8f0b
testl %r9d, %r9d
jle 0x8f43
movslq %r9d, %r10
addl %ecx, %edx
imull %r9d, %edx
movslq %edx, %rdx
shlq $0x3, %rdx
leaq (%rdx,%r10,8), %rdx
addq %r8, %rdx
addq $-0x8, %rdx
imull %eax, %r9d
movslq %r9d, %r9
leaq (%r8,%r9,8), %r8
xorl %r9d, %r9d
movq (%r8,%r9,8), %r10
movq (%rdx), %r11
movq %r11, (%r8,%r9,8)
movq %r10, (%rdx)
incq %r9
addq $-0x8, %rdx
cmpl (%rdi), %r9d
jl 0x8eef
jmp 0x8f43
testl %r9d, %r9d
jle 0x8f43
addl %ecx, %edx
imull %r9d, %edx
movslq %edx, %rdx
leaq (%r8,%rdx,8), %rdx
imull %eax, %r9d
movslq %r9d, %r9
leaq (%r8,%r9,8), %r8
xorl %r9d, %r9d
movq (%r8,%r9,8), %r10
movq (%rdx,%r9,8), %r11
movq %r11, (%r8,%r9,8)
movq %r10, (%rdx,%r9,8)
incq %r9
cmpl (%rdi), %r9d
jl 0x8f2b
incl %eax
movl 0x4(%rdi), %edx
movl %edx, %r8d
shrl $0x1f, %r8d
addl %edx, %r8d
sarl %r8d
decl %ecx
cmpl %r8d, %eax
jl 0x8eb5
jmp 0x8fcb
testb %sil, %sil
je 0x8fcb
cmpl $0x0, 0x4(%rdi)
jle 0x8fcb
xorl %eax, %eax
movslq (%rdi), %rcx
cmpq $0x2, %rcx
jl 0x8fc4
movq 0x18(%rdi), %rdx
movl %ecx, %esi
imull %eax, %esi
leaq (,%rsi,8), %r8
leaq (%r8,%rcx,8), %rcx
addq %rdx, %rcx
addq $-0x8, %rcx
leaq (%rdx,%rsi,8), %rdx
xorl %esi, %esi
movq (%rdx,%rsi,8), %r8
movq (%rcx), %r9
movq %r9, (%rdx,%rsi,8)
movq %r8, (%rcx)
movl (%rdi), %r8d
movl %r8d, %r9d
shrl $0x1f, %r9d
addl %r8d, %r9d
sarl %r9d
incq %rsi
addq $-0x8, %rcx
cmpl %r9d, %esi
jl 0x8f9a
incl %eax
cmpl 0x4(%rdi), %eax
jl 0x8f6f
retq
// File: /workspace/github_cpp_makefile_star2_O1/kylegranger[P]ImageScaling/linear16.cpp
// Function: CLinear16::Rotate90()
void CLinear16::Rotate90()
{
	CLinear16 *temp = new CLinear16(mWidth, mHeight);

	color_t *src = mData;

	for (int y = 0; y < mHeight; y++)
	{
		color_t *dst = temp->mData + mWidth - 1 - y;
		for (int x = 0; x < mWidth; x++)
		{
			*dst = *src++;
			dst += mWidth;
		}
	}

	BlitImage(temp, 0, 0);

	delete temp;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rdi, %r14
movl $0x20, %edi
callq 0x9eb0
movq %rax, %rbx
movl (%r14), %eax
movl 0x4(%r14), %ecx
movl %eax, (%rbx)
movl %ecx, 0x4(%rbx)
imull %eax, %ecx
leal (,%rcx,8), %eax
movslq %eax, %r15
movq %r15, 0x8(%rbx)
movslq %ecx, %rax
leaq (,%rax,8), %rcx
testl %eax, %eax
movq $-0x1, %rdi
cmovnsq %rcx, %rdi
callq 0x9ef0
movq %rax, 0x18(%rbx)
movq %rax, %rdi
movl $0x80, %esi
movq %r15, %rdx
callq 0x4070
movl $0xffffffff, 0x10(%rbx) # imm = 0xFFFFFFFF
cmpl $0x0, 0x4(%r14)
jle 0x9088
movq 0x18(%r14), %rax
xorl %ecx, %ecx
cmpl $0x0, (%r14)
jle 0x907c
movslq (%r14), %rdx
shlq $0x3, %rdx
addq 0x18(%rbx), %rdx
leaq (,%rcx,8), %rsi
subq %rsi, %rdx
addq $-0x8, %rdx
xorl %esi, %esi
movq (%rax), %rdi
addq $0x8, %rax
movq %rdi, (%rdx)
movslq (%r14), %rdi
leaq (%rdx,%rdi,8), %rdx
incl %esi
cmpl %edi, %esi
jl 0x9065
incq %rcx
movslq 0x4(%r14), %rdx
cmpq %rdx, %rcx
jl 0x9043
movq %r14, %rdi
movq %rbx, %rsi
xorl %edx, %edx
xorl %ecx, %ecx
callq 0x8a80
movq 0x18(%rbx), %rdi
testq %rdi, %rdi
je 0x90ad
callq 0x91b0
movq $0x0, 0x18(%rbx)
movl $0x20, %esi
movq %rbx, %rdi
popq %rbx
popq %r14
popq %r15
jmp 0x91a0
movq %rax, %r14
movl $0x20, %esi
movq %rbx, %rdi
callq 0x91a0
movq %r14, %rdi
callq 0x4310
nop
// File: /workspace/github_cpp_makefile_star2_O1/kylegranger[P]ImageScaling/linear16.cpp
// Function: CLinear16::Rotate(int)
void CLinear16::Rotate(int angle)
{
	assert(mWidth == mHeight);
	angle = angle % 360;
	switch (angle)
	{
	case 0:
		break;
	case 90:
		Rotate90();
		break;
	case 180:
		Flip(true, true);
		break;
	case 270:
		Flip(true, true);
		Rotate90();
		break;
	default:
		assert(0);
	}
}

// Assembly:
pushq %rbx
movl (%rdi), %eax
cmpl 0x4(%rdi), %eax
jne 0x9155
movq %rdi, %rbx
movslq %esi, %rax
imulq $-0x49f49f49, %rax, %rcx # imm = 0xB60B60B7
shrq $0x20, %rcx
addl %eax, %ecx
movl %ecx, %edx
shrl $0x1f, %edx
sarl $0x8, %ecx
addl %edx, %ecx
imull $0x168, %ecx, %ecx      # imm = 0x168
subl %ecx, %eax
cmpl $0xb3, %eax
jg 0x9117
testl %eax, %eax
je 0x9140
cmpl $0x5a, %eax
je 0x9137
jmp 0x9174
cmpl $0xb4, %eax
je 0x9142
cmpl $0x10e, %eax            # imm = 0x10E
jne 0x9174
movq %rbx, %rdi
movl $0x1, %esi
movl $0x1, %edx
callq 0x8e9a
movq %rbx, %rdi
popq %rbx
jmp 0x8fcc
popq %rbx
retq
movq %rbx, %rdi
movl $0x1, %esi
movl $0x1, %edx
popq %rbx
jmp 0x8e9a
leaq 0x163bc(%rip), %rdi     # 0x1f518
leaq 0x160a1(%rip), %rsi     # 0x1f204
leaq 0x163c0(%rip), %rcx     # 0x1f52a
movl $0x428, %edx            # imm = 0x428
callq 0x4100
leaq 0x16214(%rip), %rdi     # 0x1f38f
leaq 0x16082(%rip), %rsi     # 0x1f204
leaq 0x163a1(%rip), %rcx     # 0x1f52a
movl $0x439, %edx            # imm = 0x439
callq 0x4100
nopw %cs:(%rax,%rax)
nopl (%rax)
// File: /workspace/github_cpp_makefile_star2_O1/mrGoncharuk[P]foldermonitor/src/DbWriter.cpp
// Function: DBWriter::executeQuery(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&)
void 	DBWriter::executeQuery(const std::string &query)
{
	int ret;
	char *errmsg;

	std::lock_guard<std::mutex> lock(dbMutex);
	ret = sqlite3_exec(db, query.c_str(), nullptr, nullptr, &errmsg);
	if (ret == SQLITE_OK)
		syslog(LOG_NOTICE, "DW> Query executed successfully.");
	else
	{
		syslog(LOG_ERR, "DW> Error while migrating data from. Query: [%s]. Error message: %s.", query.c_str(), errmsg);
		sqlite3_free(errmsg);
	}
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
subq $0x10, %rsp
movq %rsi, %r14
movq %rdi, %r15
leaq 0x30(%rdi), %rbx
movq %rbx, %rdi
callq 0x2280
testl %eax, %eax
jne 0x2d26
movq 0x8(%r15), %rdi
movq (%r14), %rsi
leaq 0x8(%rsp), %r8
xorl %edx, %edx
xorl %ecx, %ecx
callq 0x2240
testl %eax, %eax
je 0x2d01
movq (%r14), %rdx
movq 0x8(%rsp), %rcx
leaq 0x1763(%rip), %rsi      # 0x444c
movl $0x3, %edi
xorl %eax, %eax
callq 0x2050
movq 0x8(%rsp), %rdi
callq 0x2230
jmp 0x2d14
leaq 0x1723(%rip), %rsi      # 0x442b
movl $0x5, %edi
xorl %eax, %eax
callq 0x2050
movq %rbx, %rdi
callq 0x2170
addq $0x10, %rsp
popq %rbx
popq %r14
popq %r15
retq
movl %eax, %edi
callq 0x2140
movq %rax, %r14
movq %rbx, %rdi
callq 0x2170
movq %r14, %rdi
callq 0x22e0
// File: /workspace/github_cpp_makefile_star2_O1/mrGoncharuk[P]foldermonitor/src/DirectoryMonitor.cpp
// Function: DirectoryMonitor::~DirectoryMonitor()
DirectoryMonitor::~DirectoryMonitor()
{
	syslog(LOG_NOTICE, "DM> File watcher destroyed.");
	if (fileDescriptor > 0 && watchDescriptor > 0)
		inotify_rm_watch(fileDescriptor, watchDescriptor);
	if (fileDescriptor > 0)
		close(fileDescriptor);
}

// Assembly:
pushq %rbx
movq %rdi, %rbx
leaq 0x16c1(%rip), %rsi      # 0x44c8
movl $0x5, %edi
xorl %eax, %eax
callq 0x2050
movl (%rbx), %edi
testl %edi, %edi
jle 0x2e25
movl 0x4(%rbx), %esi
testl %esi, %esi
jle 0x2e25
callq 0x20f0
movl (%rbx), %edi
testl %edi, %edi
jle 0x2e30
callq 0x2360
movq 0x8(%rbx), %rdi
addq $0x18, %rbx
cmpq %rbx, %rdi
je 0x2e43
popq %rbx
jmp 0x21c0
popq %rbx
retq
movq %rax, %rdi
callq 0x2d5e
nop
// File: /workspace/github_cpp_makefile_star2_O1/mrGoncharuk[P]foldermonitor/src/DirectoryMonitor.cpp
// Function: DirectoryMonitor::initWatcher()
bool DirectoryMonitor::initWatcher()
{
	fileDescriptor = inotify_init();
	if (fileDescriptor < 0)
	{
		syslog (LOG_ERR, "DM> Error while inotify initialization.");
		syslog (LOG_NOTICE, "DM> Daemon stops.");
		return false;
	}
	watchDescriptor = inotify_add_watch(fileDescriptor, fname.c_str(), IN_CREATE);
	if (watchDescriptor < 0)
	{
		syslog (LOG_ERR, "DM> Error while starting watching folder.");
		syslog (LOG_NOTICE, "DM> Daemon stops.");
		return false;
	}
	syslog(LOG_NOTICE, "DM> File watcher initialized successfully.");
	return true;
}

// Assembly:
pushq %rbx
movq %rdi, %rbx
callq 0x2310
movl %eax, (%rbx)
testl %eax, %eax
js 0x2edd
movq 0x8(%rbx), %rsi
movl %eax, %edi
movl $0x100, %edx            # imm = 0x100
callq 0x2110
movl %eax, 0x4(%rbx)
testl %eax, %eax
js 0x2ee6
movb $0x1, %bl
leaq 0x1687(%rip), %rsi      # 0x4562
jmp 0x2f02
leaq 0x161a(%rip), %rsi      # 0x44fe
jmp 0x2eed
leaq 0x164b(%rip), %rsi      # 0x4538
xorl %ebx, %ebx
movl $0x3, %edi
xorl %eax, %eax
callq 0x2050
leaq 0x1624(%rip), %rsi      # 0x4526
movl $0x5, %edi
xorl %eax, %eax
callq 0x2050
movl %ebx, %eax
popq %rbx
retq
// File: /workspace/github_cpp_makefile_star2_O1/mrGoncharuk[P]foldermonitor/src/MigrationManager.cpp
// Function: MigrationManager::migrateData(std::mutex&, std::__cxx11::list<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>, std::allocator<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>>>&, std::atomic<bool>&)
void	MigrationManager::migrateData(std::mutex &list_mutex, std::list<std::string> &filenames, std::atomic<bool> &isRunning)
{
	if (threadAmount == 1)
	{
		syslog(LOG_NOTICE, "MM> Data migration will be executed in solo thread mode.");
		migrateSolo(list_mutex, filenames, isRunning);
	}
	else
	{
		syslog(LOG_NOTICE, "MM> Data migration will be executed in <%d> threads.", threadAmount);
		migrateThreaded(list_mutex, filenames, isRunning);
	}
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq %rcx, %rbx
movq %rdx, %r14
movq %rsi, %r15
movq %rdi, %r12
movl 0x8(%rdi), %edx
cmpl $0x1, %edx
jne 0x3aeb
leaq 0xc07(%rip), %rsi       # 0x46ca
movl $0x5, %edi
xorl %eax, %eax
callq 0x2050
movq %r12, %rdi
movq %r15, %rsi
movq %r14, %rdx
movq %rbx, %rcx
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
jmp 0x3434
leaq 0xc11(%rip), %rsi       # 0x4703
movl $0x5, %edi
xorl %eax, %eax
callq 0x2050
movq %r12, %rdi
movq %r15, %rsi
movq %r14, %rdx
movq %rbx, %rcx
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
jmp 0x3550