// File: /workspace/github_c_makefile_star2_O0/enzo1982[P]smooth/misc/codecs.cpp
// Function: GetDelta(int*, int*, int, int)
int GetDelta(int line[], int prevline[], int x, int parts)
{
	int	 pixb1 = (x > 0 ? line[x - 1] : 0);

	int	 bias;
	int	 redbias;
	int	 greenbias;
	int	 bluebias;
	int	 alphabias;

	switch (parts)
	{
		case 1:
			bias = line[x] - (pixb1 + prevline[x]) / 2;

			if ((bias > -Math::Pow(2l, 3)) && (bias <= Math::Pow(2l, 3))) return 1;

			break;
		case 3:
			redbias	  = Color(line[x]).GetRed()   - (Color(pixb1).GetRed()	 + Color(prevline[x]).GetRed())	  / 2;
			greenbias = Color(line[x]).GetGreen() - (Color(pixb1).GetGreen() + Color(prevline[x]).GetGreen()) / 2;
			bluebias  = Color(line[x]).GetBlue()  - (Color(pixb1).GetBlue()	 + Color(prevline[x]).GetBlue())  / 2;

			if (((redbias > -Math::Pow(2l, 5)) && (redbias <= Math::Pow(2l, 5))) && ((greenbias > -Math::Pow(2l, 5)) && (greenbias <= Math::Pow(2l, 5))) && ((bluebias > -Math::Pow(2l, 5)) && (bluebias <= Math::Pow(2l, 5)))) return 1;

			break;
		case 4:
			redbias	  = Color(line[x]).GetRed()   - (Color(pixb1).GetRed()	 + Color(prevline[x]).GetRed())	  / 2;
			greenbias = Color(line[x]).GetGreen() - (Color(pixb1).GetGreen() + Color(prevline[x]).GetGreen()) / 2;
			bluebias  = Color(line[x]).GetBlue()  - (Color(pixb1).GetBlue()	 + Color(prevline[x]).GetBlue())  / 2;
			alphabias = Color(line[x]).GetAlpha() - (Color(pixb1).GetAlpha() + Color(prevline[x]).GetAlpha()) / 2;

			if (((redbias > -Math::Pow(2l, 5)) && (redbias <= Math::Pow(2l, 5))) && ((greenbias > -Math::Pow(2l, 5)) && (greenbias <= Math::Pow(2l, 5))) && ((bluebias > -Math::Pow(2l, 5)) && (bluebias <= Math::Pow(2l, 5))) && ((alphabias > -Math::Pow(2l, 5)) && (alphabias <= Math::Pow(2l, 5)))) return 1;

			break;
	}

	return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x250, %rsp            # imm = 0x250
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movl %edx, -0x1c(%rbp)
movl %ecx, -0x20(%rbp)
cmpl $0x0, -0x1c(%rbp)
jle 0x116997
movq -0x10(%rbp), %rax
movl -0x1c(%rbp), %ecx
subl $0x1, %ecx
movslq %ecx, %rcx
movl (%rax,%rcx,4), %eax
movl %eax, -0x18c(%rbp)
jmp 0x1169a1
xorl %eax, %eax
movl %eax, -0x18c(%rbp)
jmp 0x1169a1
movl -0x18c(%rbp), %eax
movl %eax, -0x24(%rbp)
movl -0x20(%rbp), %eax
movl %eax, -0x190(%rbp)
subl $0x1, %eax
je 0x1169df
jmp 0x1169ba
movl -0x190(%rbp), %eax
subl $0x3, %eax
je 0x116a92
jmp 0x1169cb
movl -0x190(%rbp), %eax
subl $0x4, %eax
je 0x116da0
jmp 0x1171cb
movq -0x10(%rbp), %rax
movslq -0x1c(%rbp), %rcx
movl (%rax,%rcx,4), %eax
movl %eax, -0x19c(%rbp)
movl -0x24(%rbp), %eax
movq -0x18(%rbp), %rcx
movslq -0x1c(%rbp), %rdx
addl (%rcx,%rdx,4), %eax
movl $0x2, %ecx
cltd
idivl %ecx
movl %eax, %ecx
movl -0x19c(%rbp), %eax
subl %ecx, %eax
movl %eax, -0x28(%rbp)
cvtsi2sdl -0x28(%rbp), %xmm0
movsd %xmm0, -0x198(%rbp)
movl $0x2, %edi
movl $0x3, %esi
callq 0x5a330
movaps %xmm0, %xmm1
movsd -0x198(%rbp), %xmm0
movq %xmm1, %rax
movabsq $-0x8000000000000000, %rcx # imm = 0x8000000000000000
xorq %rcx, %rax
movq %rax, %xmm1
ucomisd %xmm1, %xmm0
jbe 0x116a8d
cvtsi2sdl -0x28(%rbp), %xmm0
movsd %xmm0, -0x1a8(%rbp)
movl $0x2, %edi
movl $0x3, %esi
callq 0x5a330
movsd -0x1a8(%rbp), %xmm1
ucomisd %xmm1, %xmm0
jb 0x116a8d
movl $0x1, -0x4(%rbp)
jmp 0x1171d2
jmp 0x1171cb
movq -0x10(%rbp), %rax
movslq -0x1c(%rbp), %rcx
movslq (%rax,%rcx,4), %rsi
leaq -0x48(%rbp), %rdi
xorl %edx, %edx
callq 0x59be0
leaq -0x48(%rbp), %rdi
callq 0x59f20
movl %eax, -0x1c4(%rbp)
movslq -0x24(%rbp), %rsi
leaq -0x58(%rbp), %rdi
xorl %edx, %edx
callq 0x59be0
leaq -0x58(%rbp), %rdi
callq 0x59f20
movl %eax, -0x1c8(%rbp)
movq -0x18(%rbp), %rax
movslq -0x1c(%rbp), %rcx
movslq (%rax,%rcx,4), %rsi
leaq -0x68(%rbp), %rdi
xorl %edx, %edx
callq 0x59be0
leaq -0x68(%rbp), %rdi
callq 0x59f20
movl %eax, %ecx
movl -0x1c8(%rbp), %eax
addl %ecx, %eax
movl $0x2, %ecx
cltd
idivl %ecx
movl %eax, %ecx
movl -0x1c4(%rbp), %eax
subl %ecx, %eax
movl %eax, -0x2c(%rbp)
movq -0x10(%rbp), %rax
movslq -0x1c(%rbp), %rcx
movslq (%rax,%rcx,4), %rsi
leaq -0x78(%rbp), %rdi
xorl %edx, %edx
callq 0x59be0
leaq -0x78(%rbp), %rdi
callq 0x5d920
movl %eax, -0x1bc(%rbp)
movslq -0x24(%rbp), %rsi
leaq -0x88(%rbp), %rdi
xorl %edx, %edx
callq 0x59be0
leaq -0x88(%rbp), %rdi
callq 0x5d920
movl %eax, -0x1c0(%rbp)
movq -0x18(%rbp), %rax
movslq -0x1c(%rbp), %rcx
movslq (%rax,%rcx,4), %rsi
leaq -0x98(%rbp), %rdi
xorl %edx, %edx
callq 0x59be0
leaq -0x98(%rbp), %rdi
callq 0x5d920
movl %eax, %ecx
movl -0x1c0(%rbp), %eax
addl %ecx, %eax
movl $0x2, %ecx
cltd
idivl %ecx
movl %eax, %ecx
movl -0x1bc(%rbp), %eax
subl %ecx, %eax
movl %eax, -0x30(%rbp)
movq -0x10(%rbp), %rax
movslq -0x1c(%rbp), %rcx
movslq (%rax,%rcx,4), %rsi
leaq -0xa8(%rbp), %rdi
xorl %edx, %edx
callq 0x59be0
leaq -0xa8(%rbp), %rdi
callq 0x5b650
movl %eax, -0x1b4(%rbp)
movslq -0x24(%rbp), %rsi
leaq -0xb8(%rbp), %rdi
xorl %edx, %edx
callq 0x59be0
leaq -0xb8(%rbp), %rdi
callq 0x5b650
movl %eax, -0x1b8(%rbp)
movq -0x18(%rbp), %rax
movslq -0x1c(%rbp), %rcx
movslq (%rax,%rcx,4), %rsi
leaq -0xc8(%rbp), %rdi
xorl %edx, %edx
callq 0x59be0
leaq -0xc8(%rbp), %rdi
callq 0x5b650
movl %eax, %ecx
movl -0x1b8(%rbp), %eax
addl %ecx, %eax
movl $0x2, %ecx
cltd
idivl %ecx
movl %eax, %ecx
movl -0x1b4(%rbp), %eax
subl %ecx, %eax
movl %eax, -0x34(%rbp)
cvtsi2sdl -0x2c(%rbp), %xmm0
movsd %xmm0, -0x1b0(%rbp)
movl $0x2, %edi
movl $0x5, %esi
callq 0x5a330
movaps %xmm0, %xmm1
movsd -0x1b0(%rbp), %xmm0
movq %xmm1, %rax
movabsq $-0x8000000000000000, %rcx # imm = 0x8000000000000000
xorq %rcx, %rax
movq %rax, %xmm1
ucomisd %xmm1, %xmm0
jbe 0x116d9b
cvtsi2sdl -0x2c(%rbp), %xmm0
movsd %xmm0, -0x1d0(%rbp)
movl $0x2, %edi
movl $0x5, %esi
callq 0x5a330
movsd -0x1d0(%rbp), %xmm1
ucomisd %xmm1, %xmm0
jb 0x116d9b
cvtsi2sdl -0x30(%rbp), %xmm0
movsd %xmm0, -0x1d8(%rbp)
movl $0x2, %edi
movl $0x5, %esi
callq 0x5a330
movaps %xmm0, %xmm1
movsd -0x1d8(%rbp), %xmm0
movq %xmm1, %rax
movabsq $-0x8000000000000000, %rcx # imm = 0x8000000000000000
xorq %rcx, %rax
movq %rax, %xmm1
ucomisd %xmm1, %xmm0
jbe 0x116d9b
cvtsi2sdl -0x30(%rbp), %xmm0
movsd %xmm0, -0x1e0(%rbp)
movl $0x2, %edi
movl $0x5, %esi
callq 0x5a330
movsd -0x1e0(%rbp), %xmm1
ucomisd %xmm1, %xmm0
jb 0x116d9b
cvtsi2sdl -0x34(%rbp), %xmm0
movsd %xmm0, -0x1e8(%rbp)
movl $0x2, %edi
movl $0x5, %esi
callq 0x5a330
movaps %xmm0, %xmm1
movsd -0x1e8(%rbp), %xmm0
movq %xmm1, %rax
movabsq $-0x8000000000000000, %rcx # imm = 0x8000000000000000
xorq %rcx, %rax
movq %rax, %xmm1
ucomisd %xmm1, %xmm0
jbe 0x116d9b
cvtsi2sdl -0x34(%rbp), %xmm0
movsd %xmm0, -0x1f0(%rbp)
movl $0x2, %edi
movl $0x5, %esi
callq 0x5a330
movsd -0x1f0(%rbp), %xmm1
ucomisd %xmm1, %xmm0
jb 0x116d9b
movl $0x1, -0x4(%rbp)
jmp 0x1171d2
jmp 0x1171cb
movq -0x10(%rbp), %rax
movslq -0x1c(%rbp), %rcx
movslq (%rax,%rcx,4), %rsi
leaq -0xd8(%rbp), %rdi
xorl %edx, %edx
callq 0x59be0
leaq -0xd8(%rbp), %rdi
callq 0x59f20
movl %eax, -0x214(%rbp)
movslq -0x24(%rbp), %rsi
leaq -0xe8(%rbp), %rdi
xorl %edx, %edx
callq 0x59be0
leaq -0xe8(%rbp), %rdi
callq 0x59f20
movl %eax, -0x218(%rbp)
movq -0x18(%rbp), %rax
movslq -0x1c(%rbp), %rcx
movslq (%rax,%rcx,4), %rsi
leaq -0xf8(%rbp), %rdi
xorl %edx, %edx
callq 0x59be0
leaq -0xf8(%rbp), %rdi
callq 0x59f20
movl %eax, %ecx
movl -0x218(%rbp), %eax
addl %ecx, %eax
movl $0x2, %ecx
cltd
idivl %ecx
movl %eax, %ecx
movl -0x214(%rbp), %eax
subl %ecx, %eax
movl %eax, -0x2c(%rbp)
movq -0x10(%rbp), %rax
movslq -0x1c(%rbp), %rcx
movslq (%rax,%rcx,4), %rsi
leaq -0x108(%rbp), %rdi
xorl %edx, %edx
callq 0x59be0
leaq -0x108(%rbp), %rdi
callq 0x5d920
movl %eax, -0x20c(%rbp)
movslq -0x24(%rbp), %rsi
leaq -0x118(%rbp), %rdi
xorl %edx, %edx
callq 0x59be0
leaq -0x118(%rbp), %rdi
callq 0x5d920
movl %eax, -0x210(%rbp)
movq -0x18(%rbp), %rax
movslq -0x1c(%rbp), %rcx
movslq (%rax,%rcx,4), %rsi
leaq -0x128(%rbp), %rdi
xorl %edx, %edx
callq 0x59be0
leaq -0x128(%rbp), %rdi
callq 0x5d920
movl %eax, %ecx
movl -0x210(%rbp), %eax
addl %ecx, %eax
movl $0x2, %ecx
cltd
idivl %ecx
movl %eax, %ecx
movl -0x20c(%rbp), %eax
subl %ecx, %eax
movl %eax, -0x30(%rbp)
movq -0x10(%rbp), %rax
movslq -0x1c(%rbp), %rcx
movslq (%rax,%rcx,4), %rsi
leaq -0x138(%rbp), %rdi
xorl %edx, %edx
callq 0x59be0
leaq -0x138(%rbp), %rdi
callq 0x5b650
movl %eax, -0x204(%rbp)
movslq -0x24(%rbp), %rsi
leaq -0x148(%rbp), %rdi
xorl %edx, %edx
callq 0x59be0
leaq -0x148(%rbp), %rdi
callq 0x5b650
movl %eax, -0x208(%rbp)
movq -0x18(%rbp), %rax
movslq -0x1c(%rbp), %rcx
movslq (%rax,%rcx,4), %rsi
leaq -0x158(%rbp), %rdi
xorl %edx, %edx
callq 0x59be0
leaq -0x158(%rbp), %rdi
callq 0x5b650
movl %eax, %ecx
movl -0x208(%rbp), %eax
addl %ecx, %eax
movl $0x2, %ecx
cltd
idivl %ecx
movl %eax, %ecx
movl -0x204(%rbp), %eax
subl %ecx, %eax
movl %eax, -0x34(%rbp)
movq -0x10(%rbp), %rax
movslq -0x1c(%rbp), %rcx
movslq (%rax,%rcx,4), %rsi
leaq -0x168(%rbp), %rdi
xorl %edx, %edx
callq 0x59be0
leaq -0x168(%rbp), %rdi
callq 0x5bac0
movl %eax, -0x1fc(%rbp)
movslq -0x24(%rbp), %rsi
leaq -0x178(%rbp), %rdi
xorl %edx, %edx
callq 0x59be0
leaq -0x178(%rbp), %rdi
callq 0x5bac0
movl %eax, -0x200(%rbp)
movq -0x18(%rbp), %rax
movslq -0x1c(%rbp), %rcx
movslq (%rax,%rcx,4), %rsi
leaq -0x188(%rbp), %rdi
xorl %edx, %edx
callq 0x59be0
leaq -0x188(%rbp), %rdi
callq 0x5bac0
movl %eax, %ecx
movl -0x200(%rbp), %eax
addl %ecx, %eax
movl $0x2, %ecx
cltd
idivl %ecx
movl %eax, %ecx
movl -0x1fc(%rbp), %eax
subl %ecx, %eax
movl %eax, -0x38(%rbp)
cvtsi2sdl -0x2c(%rbp), %xmm0
movsd %xmm0, -0x1f8(%rbp)
movl $0x2, %edi
movl $0x5, %esi
callq 0x5a330
movaps %xmm0, %xmm1
movsd -0x1f8(%rbp), %xmm0
movq %xmm1, %rax
movabsq $-0x8000000000000000, %rcx # imm = 0x8000000000000000
xorq %rcx, %rax
movq %rax, %xmm1
ucomisd %xmm1, %xmm0
jbe 0x1171c9
cvtsi2sdl -0x2c(%rbp), %xmm0
movsd %xmm0, -0x220(%rbp)
movl $0x2, %edi
movl $0x5, %esi
callq 0x5a330
movsd -0x220(%rbp), %xmm1
ucomisd %xmm1, %xmm0
jb 0x1171c9
cvtsi2sdl -0x30(%rbp), %xmm0
movsd %xmm0, -0x228(%rbp)
movl $0x2, %edi
movl $0x5, %esi
callq 0x5a330
movaps %xmm0, %xmm1
movsd -0x228(%rbp), %xmm0
movq %xmm1, %rax
movabsq $-0x8000000000000000, %rcx # imm = 0x8000000000000000
xorq %rcx, %rax
movq %rax, %xmm1
ucomisd %xmm1, %xmm0
jbe 0x1171c9
cvtsi2sdl -0x30(%rbp), %xmm0
movsd %xmm0, -0x230(%rbp)
movl $0x2, %edi
movl $0x5, %esi
callq 0x5a330
movsd -0x230(%rbp), %xmm1
ucomisd %xmm1, %xmm0
jb 0x1171c9
cvtsi2sdl -0x34(%rbp), %xmm0
movsd %xmm0, -0x238(%rbp)
movl $0x2, %edi
movl $0x5, %esi
callq 0x5a330
movaps %xmm0, %xmm1
movsd -0x238(%rbp), %xmm0
movq %xmm1, %rax
movabsq $-0x8000000000000000, %rcx # imm = 0x8000000000000000
xorq %rcx, %rax
movq %rax, %xmm1
ucomisd %xmm1, %xmm0
jbe 0x1171c9
cvtsi2sdl -0x34(%rbp), %xmm0
movsd %xmm0, -0x240(%rbp)
movl $0x2, %edi
movl $0x5, %esi
callq 0x5a330
movsd -0x240(%rbp), %xmm1
ucomisd %xmm1, %xmm0
jb 0x1171c9
cvtsi2sdl -0x38(%rbp), %xmm0
movsd %xmm0, -0x248(%rbp)
movl $0x2, %edi
movl $0x5, %esi
callq 0x5a330
movaps %xmm0, %xmm1
movsd -0x248(%rbp), %xmm0
movq %xmm1, %rax
movabsq $-0x8000000000000000, %rcx # imm = 0x8000000000000000
xorq %rcx, %rax
movq %rax, %xmm1
ucomisd %xmm1, %xmm0
jbe 0x1171c9
cvtsi2sdl -0x38(%rbp), %xmm0
movsd %xmm0, -0x250(%rbp)
movl $0x2, %edi
movl $0x5, %esi
callq 0x5a330
movsd -0x250(%rbp), %xmm1
ucomisd %xmm1, %xmm0
jb 0x1171c9
movl $0x1, -0x4(%rbp)
jmp 0x1171d2
jmp 0x1171cb
movl $0x0, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x250, %rsp            # imm = 0x250
popq %rbp
retq
nop