// File: /workspace/github_c_makefile_star2_O0/jonof[P]jftekwar/jfbuild/src/kplib.c
// Function: initkpeg
static void initkpeg (void)
{
	int i, x, y;

	x = 0;  //Back & forth diagonal pattern (aligning bytes for best compression)
	for(i=0;i<16;i+=2)
	{
		for(y=8-1;y>=0;y--)
			if ((unsigned)(i-y) < (unsigned)8) unzig[x++] = (y<<3)+i-y;
		for(y=0;y<8;y++)
			if ((unsigned)(i+1-y) < (unsigned)8) unzig[x++] = (y<<3)+i+1-y;
	}
	for(i=64-1;i>=0;i--) zigit[unzig[i]] = i;
	for(i=64-1;i>=0;i--) dcflagor[i] = (unsigned char)(1<<(unzig[i]>>3));

	for(i=0;i<128;i++) colclip[i] = i+128;
	for(i=128;i<512;i++) colclip[i] = 255;
	for(i=512;i<896;i++) colclip[i] = 0;
	for(i=896;i<1024;i++) colclip[i] = i-896;
	for(i=0;i<1024;i++)
	{
		colclipup8[i] = (colclip[i]<<8);
		colclipup16[i] = (colclip[i]<<16)+0xff000000; //Hack: set alphas to 255
	}
#if defined(BIGENDIAN)
	for(i=0;i<1024;i++)
	{
		colclip[i] = bswap(colclip[i]);
		colclipup8[i] = bswap(colclipup8[i]);
		colclipup16[i] = bswap(colclipup16[i]);
	}
#endif

	for(i=0;i<2048;i++)
	{
		crmul[(i<<1)+0] = (i-1024)*1470104; //1.402*1048576
		crmul[(i<<1)+1] = (i-1024)*-748830; //-0.71414*1048576
		cbmul[(i<<1)+0] = (i-1024)*-360857; //-0.34414*1048576
		cbmul[(i<<1)+1] = (i-1024)*1858077; //1.772*1048576
	}

	memset((void *)&dct[10][0],0,64*2*sizeof(dct[0][0]));
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x10, %rsp
movl $0x0, -0x8(%rbp)
movl $0x0, -0x4(%rbp)
cmpl $0x10, -0x4(%rbp)
jge 0x6af98
movl $0x7, -0xc(%rbp)
cmpl $0x0, -0xc(%rbp)
jl 0x6af39
movl -0x4(%rbp), %eax
subl -0xc(%rbp), %eax
cmpl $0x8, %eax
jae 0x6af2c
movl -0xc(%rbp), %edx
shll $0x3, %edx
addl -0x4(%rbp), %edx
subl -0xc(%rbp), %edx
movl -0x8(%rbp), %eax
movl %eax, %ecx
addl $0x1, %ecx
movl %ecx, -0x8(%rbp)
movslq %eax, %rcx
leaq 0x568d67(%rip), %rax    # 0x5d3c90
movl %edx, (%rax,%rcx,4)
jmp 0x6af2e
movl -0xc(%rbp), %eax
addl $-0x1, %eax
movl %eax, -0xc(%rbp)
jmp 0x6aef7
movl $0x0, -0xc(%rbp)
cmpl $0x8, -0xc(%rbp)
jge 0x6af88
movl -0x4(%rbp), %eax
addl $0x1, %eax
subl -0xc(%rbp), %eax
cmpl $0x8, %eax
jae 0x6af7b
movl -0xc(%rbp), %edx
shll $0x3, %edx
addl -0x4(%rbp), %edx
addl $0x1, %edx
subl -0xc(%rbp), %edx
movl -0x8(%rbp), %eax
movl %eax, %ecx
addl $0x1, %ecx
movl %ecx, -0x8(%rbp)
movslq %eax, %rcx
leaq 0x568d18(%rip), %rax    # 0x5d3c90
movl %edx, (%rax,%rcx,4)
jmp 0x6af7d
movl -0xc(%rbp), %eax
addl $0x1, %eax
movl %eax, -0xc(%rbp)
jmp 0x6af40
jmp 0x6af8a
movl -0x4(%rbp), %eax
addl $0x2, %eax
movl %eax, -0x4(%rbp)
jmp 0x6aee6
movl $0x3f, -0x4(%rbp)
cmpl $0x0, -0x4(%rbp)
jl 0x6afcc
movl -0x4(%rbp), %edx
movslq -0x4(%rbp), %rcx
leaq 0x568cdd(%rip), %rax    # 0x5d3c90
movslq (%rax,%rcx,4), %rcx
leaq 0x569ea2(%rip), %rax    # 0x5d4e60
movl %edx, (%rax,%rcx,4)
movl -0x4(%rbp), %eax
addl $-0x1, %eax
movl %eax, -0x4(%rbp)
jmp 0x6af9f
movl $0x3f, -0x4(%rbp)
cmpl $0x0, -0x4(%rbp)
jl 0x6b00c
movslq -0x4(%rbp), %rcx
leaq 0x568cac(%rip), %rax    # 0x5d3c90
movl (%rax,%rcx,4), %ecx
sarl $0x3, %ecx
movl $0x1, %eax
shll %cl, %eax
movb %al, %dl
movslq -0x4(%rbp), %rcx
leaq 0x569e22(%rip), %rax    # 0x5d4e20
movb %dl, (%rax,%rcx)
movl -0x4(%rbp), %eax
addl $-0x1, %eax
movl %eax, -0x4(%rbp)
jmp 0x6afd3
movl $0x0, -0x4(%rbp)
cmpl $0x80, -0x4(%rbp)
jge 0x6b03e
movl -0x4(%rbp), %edx
addl $0x80, %edx
movslq -0x4(%rbp), %rcx
leaq 0x569f30(%rip), %rax    # 0x5d4f60
movl %edx, (%rax,%rcx,4)
movl -0x4(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x4(%rbp)
jmp 0x6b013
movl $0x80, -0x4(%rbp)
cmpl $0x200, -0x4(%rbp)      # imm = 0x200
jge 0x6b06b
movslq -0x4(%rbp), %rcx
leaq 0x569f07(%rip), %rax    # 0x5d4f60
movl $0xff, (%rax,%rcx,4)
movl -0x4(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x4(%rbp)
jmp 0x6b045
movl $0x200, -0x4(%rbp)      # imm = 0x200
cmpl $0x380, -0x4(%rbp)      # imm = 0x380
jge 0x6b098
movslq -0x4(%rbp), %rcx
leaq 0x569eda(%rip), %rax    # 0x5d4f60
movl $0x0, (%rax,%rcx,4)
movl -0x4(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x4(%rbp)
jmp 0x6b072
movl $0x380, -0x4(%rbp)      # imm = 0x380
cmpl $0x400, -0x4(%rbp)      # imm = 0x400
jge 0x6b0ca
movl -0x4(%rbp), %edx
subl $0x380, %edx            # imm = 0x380
movslq -0x4(%rbp), %rcx
leaq 0x569ea4(%rip), %rax    # 0x5d4f60
movl %edx, (%rax,%rcx,4)
movl -0x4(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x4(%rbp)
jmp 0x6b09f
movl $0x0, -0x4(%rbp)
cmpl $0x400, -0x4(%rbp)      # imm = 0x400
jge 0x6b129
movslq -0x4(%rbp), %rcx
leaq 0x569e7b(%rip), %rax    # 0x5d4f60
movl (%rax,%rcx,4), %edx
shll $0x8, %edx
movslq -0x4(%rbp), %rcx
leaq 0x56ae6a(%rip), %rax    # 0x5d5f60
movl %edx, (%rax,%rcx,4)
movslq -0x4(%rbp), %rcx
leaq 0x569e5c(%rip), %rax    # 0x5d4f60
movl (%rax,%rcx,4), %edx
shll $0x10, %edx
addl $0xff000000, %edx       # imm = 0xFF000000
movslq -0x4(%rbp), %rcx
leaq 0x56be45(%rip), %rax    # 0x5d6f60
movl %edx, (%rax,%rcx,4)
movl -0x4(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x4(%rbp)
jmp 0x6b0d1
movl $0x0, -0x4(%rbp)
cmpl $0x800, -0x4(%rbp)      # imm = 0x800
jge 0x6b1d7
movl -0x4(%rbp), %eax
subl $0x400, %eax            # imm = 0x400
imull $0x166e98, %eax, %edx   # imm = 0x166E98
movl -0x4(%rbp), %eax
shll %eax
addl $0x0, %eax
movslq %eax, %rcx
leaq 0x56ce03(%rip), %rax    # 0x5d7f60
movl %edx, (%rax,%rcx,4)
movl -0x4(%rbp), %eax
subl $0x400, %eax            # imm = 0x400
imull $0xfff492e2, %eax, %edx # imm = 0xFFF492E2
movl -0x4(%rbp), %eax
shll %eax
addl $0x1, %eax
movslq %eax, %rcx
leaq 0x56cde0(%rip), %rax    # 0x5d7f60
movl %edx, (%rax,%rcx,4)
movl -0x4(%rbp), %eax
subl $0x400, %eax            # imm = 0x400
imull $0xfffa7e67, %eax, %edx # imm = 0xFFFA7E67
movl -0x4(%rbp), %eax
shll %eax
addl $0x0, %eax
movslq %eax, %rcx
leaq 0x570dbd(%rip), %rax    # 0x5dbf60
movl %edx, (%rax,%rcx,4)
movl -0x4(%rbp), %eax
subl $0x400, %eax            # imm = 0x400
imull $0x1c5a1d, %eax, %edx   # imm = 0x1C5A1D
movl -0x4(%rbp), %eax
shll %eax
addl $0x1, %eax
movslq %eax, %rcx
leaq 0x570d9a(%rip), %rax    # 0x5dbf60
movl %edx, (%rax,%rcx,4)
movl -0x4(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x4(%rbp)
jmp 0x6b130
leaq 0x569042(%rip), %rdi    # 0x5d4220
addq $0xa00, %rdi            # imm = 0xA00
xorl %esi, %esi
movl $0x200, %edx            # imm = 0x200
callq 0x62d0
addq $0x10, %rsp
popq %rbp
retq
nopw (%rax,%rax)