// File: /workspace/github_c_makefile_star2_O0/tditlu[P]shadetabler/src/shadetabler.c
// Function: exq_feed_extened
static void exq_feed_extened(exq_data *pExq, unsigned char *pData, int nPixels, int shade, unsigned int forceBlackWhite)
{
	int i;
	unsigned int hash;
	unsigned char r, g, b, a;
	exq_histogram *pCur;
	unsigned char channelMask = 0xff00 >> pExq->numBitsPerChannel;

	for(i = 0; i < nPixels; i++)
	{
		r = *pData++; g = *pData++; b = *pData++; a = *pData++;

		r = (unsigned char)CLAMP(((int)r) + shade, 0, 255);
		g = (unsigned char)CLAMP(((int)g) + shade, 0, 255);
		b = (unsigned char)CLAMP(((int)b) + shade, 0, 255);

		if(forceBlackWhite && !pExq->transparency)
		{
			if (r == 0 && g == 0 && b == 0) { continue; }
			if (r == 255 && g == 255 && b == 255) { continue; }
		}

		hash = exq_make_hash(((unsigned int)r) | (((unsigned int)g) << 8) | (((unsigned int)b) << 16) | (((unsigned int)a) << 24));

		pCur = pExq->pHash[hash];
		while(pCur != NULL && (pCur->ored != r || pCur->ogreen != g ||
			pCur->oblue != b || pCur->oalpha != a))
			pCur = pCur->pNextInHash;

		if(pCur != NULL)
			pCur->num++;
		else
		{
			pCur = (exq_histogram*)malloc(sizeof(exq_histogram));
			pCur->pNextInHash = pExq->pHash[hash];
			pExq->pHash[hash] = pCur;
			pCur->ored = r; pCur->ogreen = g; pCur->oblue = b; pCur->oalpha = a;
			r &= channelMask; g &= channelMask; b &= channelMask;

			pCur->color.r = r / 255.0f * EXQ_SCALE_R;
			pCur->color.g = g / 255.0f * EXQ_SCALE_G;
			pCur->color.b = b / 255.0f * EXQ_SCALE_B;
			pCur->color.a = a / 255.0f * EXQ_SCALE_A;

			if(pExq->transparency)
			{
				pCur->color.r *= pCur->color.a;
				pCur->color.g *= pCur->color.a;
				pCur->color.b *= pCur->color.a;
			}

			pCur->num = 1;
			pCur->palIndex = -1;
			pCur->ditherScale.r = pCur->ditherScale.g = pCur->ditherScale.b =
				pCur->ditherScale.a = -1;
			pCur->ditherIndex[0] = pCur->ditherIndex[1] = pCur->ditherIndex[2] =
				pCur->ditherIndex[3] = -1;
		}
	}
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x50, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movl %edx, -0x14(%rbp)
movl %ecx, -0x18(%rbp)
movl %r8d, -0x1c(%rbp)
movq -0x8(%rbp), %rax
movl 0x86804(%rax), %ecx
movl $0xff00, %eax           # imm = 0xFF00
sarl %cl, %eax
movb %al, -0x31(%rbp)
movl $0x0, -0x20(%rbp)
movl -0x20(%rbp), %eax
cmpl -0x14(%rbp), %eax
jge 0x1a628
movq -0x10(%rbp), %rax
movq %rax, %rcx
addq $0x1, %rcx
movq %rcx, -0x10(%rbp)
movb (%rax), %al
movb %al, -0x25(%rbp)
movq -0x10(%rbp), %rax
movq %rax, %rcx
addq $0x1, %rcx
movq %rcx, -0x10(%rbp)
movb (%rax), %al
movb %al, -0x26(%rbp)
movq -0x10(%rbp), %rax
movq %rax, %rcx
addq $0x1, %rcx
movq %rcx, -0x10(%rbp)
movb (%rax), %al
movb %al, -0x27(%rbp)
movq -0x10(%rbp), %rax
movq %rax, %rcx
addq $0x1, %rcx
movq %rcx, -0x10(%rbp)
movb (%rax), %al
movb %al, -0x28(%rbp)
movzbl -0x25(%rbp), %eax
addl -0x18(%rbp), %eax
cmpl $0x0, %eax
jge 0x1a234
xorl %eax, %eax
movl %eax, -0x38(%rbp)
jmp 0x1a25e
movzbl -0x25(%rbp), %ecx
addl -0x18(%rbp), %ecx
movl $0xff, %eax
cmpl %ecx, %eax
jge 0x1a24e
movl $0xff, %eax
movl %eax, -0x3c(%rbp)
jmp 0x1a258
movzbl -0x25(%rbp), %eax
addl -0x18(%rbp), %eax
movl %eax, -0x3c(%rbp)
movl -0x3c(%rbp), %eax
movl %eax, -0x38(%rbp)
movl -0x38(%rbp), %eax
movb %al, -0x25(%rbp)
movzbl -0x26(%rbp), %eax
addl -0x18(%rbp), %eax
cmpl $0x0, %eax
jge 0x1a277
xorl %eax, %eax
movl %eax, -0x40(%rbp)
jmp 0x1a2a1
movzbl -0x26(%rbp), %ecx
addl -0x18(%rbp), %ecx
movl $0xff, %eax
cmpl %ecx, %eax
jge 0x1a291
movl $0xff, %eax
movl %eax, -0x44(%rbp)
jmp 0x1a29b
movzbl -0x26(%rbp), %eax
addl -0x18(%rbp), %eax
movl %eax, -0x44(%rbp)
movl -0x44(%rbp), %eax
movl %eax, -0x40(%rbp)
movl -0x40(%rbp), %eax
movb %al, -0x26(%rbp)
movzbl -0x27(%rbp), %eax
addl -0x18(%rbp), %eax
cmpl $0x0, %eax
jge 0x1a2ba
xorl %eax, %eax
movl %eax, -0x48(%rbp)
jmp 0x1a2e4
movzbl -0x27(%rbp), %ecx
addl -0x18(%rbp), %ecx
movl $0xff, %eax
cmpl %ecx, %eax
jge 0x1a2d4
movl $0xff, %eax
movl %eax, -0x4c(%rbp)
jmp 0x1a2de
movzbl -0x27(%rbp), %eax
addl -0x18(%rbp), %eax
movl %eax, -0x4c(%rbp)
movl -0x4c(%rbp), %eax
movl %eax, -0x48(%rbp)
movl -0x48(%rbp), %eax
movb %al, -0x27(%rbp)
cmpl $0x0, -0x1c(%rbp)
je 0x1a345
movq -0x8(%rbp), %rax
cmpl $0x0, 0x8680c(%rax)
jne 0x1a345
movzbl -0x25(%rbp), %eax
cmpl $0x0, %eax
jne 0x1a31d
movzbl -0x26(%rbp), %eax
cmpl $0x0, %eax
jne 0x1a31d
movzbl -0x27(%rbp), %eax
cmpl $0x0, %eax
jne 0x1a31d
jmp 0x1a61a
movzbl -0x25(%rbp), %eax
cmpl $0xff, %eax
jne 0x1a343
movzbl -0x26(%rbp), %eax
cmpl $0xff, %eax
jne 0x1a343
movzbl -0x27(%rbp), %eax
cmpl $0xff, %eax
jne 0x1a343
jmp 0x1a61a
jmp 0x1a345
movzbl -0x25(%rbp), %edi
movzbl -0x26(%rbp), %eax
shll $0x8, %eax
orl %eax, %edi
movzbl -0x27(%rbp), %eax
shll $0x10, %eax
orl %eax, %edi
movzbl -0x28(%rbp), %eax
shll $0x18, %eax
orl %eax, %edi
callq 0x1af20
movl %eax, -0x24(%rbp)
movq -0x8(%rbp), %rax
movl -0x24(%rbp), %ecx
movq (%rax,%rcx,8), %rax
movq %rax, -0x30(%rbp)
xorl %eax, %eax
cmpq $0x0, -0x30(%rbp)
movb %al, -0x4d(%rbp)
je 0x1a3e0
movq -0x30(%rbp), %rax
movzbl 0x20(%rax), %ecx
movzbl -0x25(%rbp), %edx
movb $0x1, %al
cmpl %edx, %ecx
movb %al, -0x4e(%rbp)
jne 0x1a3da
movq -0x30(%rbp), %rax
movzbl 0x21(%rax), %ecx
movzbl -0x26(%rbp), %edx
movb $0x1, %al
cmpl %edx, %ecx
movb %al, -0x4e(%rbp)
jne 0x1a3da
movq -0x30(%rbp), %rax
movzbl 0x22(%rax), %ecx
movzbl -0x27(%rbp), %edx
movb $0x1, %al
cmpl %edx, %ecx
movb %al, -0x4e(%rbp)
jne 0x1a3da
movq -0x30(%rbp), %rax
movzbl 0x23(%rax), %eax
movzbl -0x28(%rbp), %ecx
cmpl %ecx, %eax
setne %al
movb %al, -0x4e(%rbp)
movb -0x4e(%rbp), %al
movb %al, -0x4d(%rbp)
movb -0x4d(%rbp), %al
testb $0x1, %al
jne 0x1a3e9
jmp 0x1a3f7
movq -0x30(%rbp), %rax
movq 0x68(%rax), %rax
movq %rax, -0x30(%rbp)
jmp 0x1a37b
cmpq $0x0, -0x30(%rbp)
je 0x1a410
movq -0x30(%rbp), %rax
movl 0x58(%rax), %ecx
addl $0x1, %ecx
movl %ecx, 0x58(%rax)
jmp 0x1a618
movl $0x70, %edi
callq 0x1120
movq %rax, -0x30(%rbp)
movq -0x8(%rbp), %rax
movl -0x24(%rbp), %ecx
movq (%rax,%rcx,8), %rcx
movq -0x30(%rbp), %rax
movq %rcx, 0x68(%rax)
movq -0x30(%rbp), %rdx
movq -0x8(%rbp), %rax
movl -0x24(%rbp), %ecx
movq %rdx, (%rax,%rcx,8)
movb -0x25(%rbp), %cl
movq -0x30(%rbp), %rax
movb %cl, 0x20(%rax)
movb -0x26(%rbp), %cl
movq -0x30(%rbp), %rax
movb %cl, 0x21(%rax)
movb -0x27(%rbp), %cl
movq -0x30(%rbp), %rax
movb %cl, 0x22(%rax)
movb -0x28(%rbp), %cl
movq -0x30(%rbp), %rax
movb %cl, 0x23(%rax)
movzbl -0x31(%rbp), %ecx
movzbl -0x25(%rbp), %eax
andl %ecx, %eax
movb %al, -0x25(%rbp)
movzbl -0x31(%rbp), %ecx
movzbl -0x26(%rbp), %eax
andl %ecx, %eax
movb %al, -0x26(%rbp)
movzbl -0x31(%rbp), %ecx
movzbl -0x27(%rbp), %eax
andl %ecx, %eax
movb %al, -0x27(%rbp)
movzbl -0x25(%rbp), %eax
cvtsi2ss %eax, %xmm0
movss 0xb69(%rip), %xmm1      # 0x1b008
divss %xmm1, %xmm0
movss 0xb59(%rip), %xmm1      # 0x1b004
mulss %xmm1, %xmm0
cvtss2sd %xmm0, %xmm0
movq -0x30(%rbp), %rax
movsd %xmm0, (%rax)
movzbl -0x26(%rbp), %eax
cvtsi2ss %eax, %xmm0
movss 0xb3d(%rip), %xmm1      # 0x1b008
divss %xmm1, %xmm0
movss 0xb39(%rip), %xmm1      # 0x1b010
mulss %xmm1, %xmm0
cvtss2sd %xmm0, %xmm0
movq -0x30(%rbp), %rax
movsd %xmm0, 0x8(%rax)
movzbl -0x27(%rbp), %eax
cvtsi2ss %eax, %xmm0
movss 0xb10(%rip), %xmm1      # 0x1b008
divss %xmm1, %xmm0
movss 0xb08(%rip), %xmm1      # 0x1b00c
mulss %xmm1, %xmm0
cvtss2sd %xmm0, %xmm0
movq -0x30(%rbp), %rax
movsd %xmm0, 0x10(%rax)
movzbl -0x28(%rbp), %eax
cvtsi2ss %eax, %xmm0
movss 0xae3(%rip), %xmm1      # 0x1b008
divss %xmm1, %xmm0
movss 0xad3(%rip), %xmm1      # 0x1b004
mulss %xmm1, %xmm0
cvtss2sd %xmm0, %xmm0
movq -0x30(%rbp), %rax
movsd %xmm0, 0x18(%rax)
movq -0x8(%rbp), %rax
cmpl $0x0, 0x8680c(%rax)
je 0x1a592
movq -0x30(%rbp), %rax
movsd 0x18(%rax), %xmm0
movq -0x30(%rbp), %rax
mulsd (%rax), %xmm0
movsd %xmm0, (%rax)
movq -0x30(%rbp), %rax
movsd 0x18(%rax), %xmm0
movq -0x30(%rbp), %rax
mulsd 0x8(%rax), %xmm0
movsd %xmm0, 0x8(%rax)
movq -0x30(%rbp), %rax
movsd 0x18(%rax), %xmm0
movq -0x30(%rbp), %rax
mulsd 0x10(%rax), %xmm0
movsd %xmm0, 0x10(%rax)
movq -0x30(%rbp), %rax
movl $0x1, 0x58(%rax)
movq -0x30(%rbp), %rax
movl $0xffffffff, 0x24(%rax) # imm = 0xFFFFFFFF
movq -0x30(%rbp), %rax
movsd 0xa64(%rip), %xmm0      # 0x1b018
movsd %xmm0, 0x40(%rax)
movq -0x30(%rbp), %rax
movsd 0xa53(%rip), %xmm0      # 0x1b018
movsd %xmm0, 0x38(%rax)
movq -0x30(%rbp), %rax
movsd 0xa42(%rip), %xmm0      # 0x1b018
movsd %xmm0, 0x30(%rax)
movq -0x30(%rbp), %rax
movsd 0xa31(%rip), %xmm0      # 0x1b018
movsd %xmm0, 0x28(%rax)
movq -0x30(%rbp), %rax
movl $0xffffffff, 0x54(%rax) # imm = 0xFFFFFFFF
movq -0x30(%rbp), %rax
movl $0xffffffff, 0x50(%rax) # imm = 0xFFFFFFFF
movq -0x30(%rbp), %rax
movl $0xffffffff, 0x4c(%rax) # imm = 0xFFFFFFFF
movq -0x30(%rbp), %rax
movl $0xffffffff, 0x48(%rax) # imm = 0xFFFFFFFF
jmp 0x1a61a
movl -0x20(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x20(%rbp)
jmp 0x1a1c5
addq $0x50, %rsp
popq %rbp
retq
nop