// File: /workspace/github_c_makefile_star2_O1/jonof[P]jftekwar/jfbuild/src/kplib.c
// Function: yrbrend
static void yrbrend (int x, int y)
{
	int i, j, ox, oy, xx, yy, xxx, yyy, xxxend, yyyend, yv, cr=0, cb=0, *odc, *dc, *dc2;
	intptr_t p, pp;

	odc = dct[0]; dc2 = dct[10];
	for(yy=0;yy<(lcompvsamp[0]<<3);yy+=8)
	{
		oy = y+yy+globyoffs; if ((unsigned)oy >= (unsigned)clipydim) { odc += (lcomphsamp[0]<<6); continue; }
		pp = oy*bytesperline + ((x+globxoffs)<<2) + frameplace;
		for(xx=0;xx<(lcomphsamp[0]<<3);xx+=8,odc+=64)
		{
			ox = x+xx+globxoffs; if ((unsigned)ox >= (unsigned)clipxdim) continue;
			p = pp+(xx<<2);
			dc = odc;
			if (lnumcomponents > 1) dc2 = &dct[lcomphvsamp0][((yy>>lcompvsampshift0)<<3)+(xx>>lcomphsampshift0)];
			xxxend = min(clipxdim-ox,8);
			yyyend = min(clipydim-oy,8);
			if ((lcomphsamp[0] == 1) && (xxxend == 8))
			{
				for(yyy=0;yyy<yyyend;yyy++)
				{
					for(xxx=0;xxx<8;xxx++)
					{
						yv = dc[xxx];
						cr = (dc2[xxx+64]>>13)&~1;
						cb = (dc2[xxx   ]>>13)&~1;
						((int *)p)[xxx] = colclipup16[(unsigned)(yv+crmul[cr+2048]               )>>22]+
												  colclipup8[(unsigned)(yv+crmul[cr+2049]+cbmul[cb+2048])>>22]+
													  colclip[(unsigned)(yv+cbmul[cb+2049]               )>>22];
					}
					p += bytesperline;
					dc += 8;
					if (!((yyy+1)&(lcompvsamp[0]-1))) dc2 += 8;
				}
			}
			else if ((lcomphsamp[0] == 2) && (xxxend == 8))
			{
				for(yyy=0;yyy<yyyend;yyy++)
				{
					for(xxx=0;xxx<8;xxx+=2)
					{
						yv = dc[xxx];
						cr = (dc2[(xxx>>1)+64]>>13)&~1;
						cb = (dc2[(xxx>>1)   ]>>13)&~1;
						i = crmul[cr+2049]+cbmul[cb+2048];
						cr = crmul[cr+2048];
						cb = cbmul[cb+2049];
						((int *)p)[xxx] = colclipup16[(unsigned)(yv+cr)>>22]+
												  colclipup8[(unsigned)(yv+ i)>>22]+
													  colclip[(unsigned)(yv+cb)>>22];
						yv = dc[xxx+1];
						((int *)p)[xxx+1] = colclipup16[(unsigned)(yv+cr)>>22]+
													 colclipup8[(unsigned)(yv+ i)>>22]+
														 colclip[(unsigned)(yv+cb)>>22];
					}
					p += bytesperline;
					dc += 8;
					if (!((yyy+1)&(lcompvsamp[0]-1))) dc2 += 8;
				}
			}
			else
			{
				for(yyy=0;yyy<yyyend;yyy++)
				{
					i = 0; j = 1;
					for(xxx=0;xxx<xxxend;xxx++)
					{
						yv = dc[xxx];
						j--;
						if (!j)
						{
							j = lcomphsamp[0];
							cr = (dc2[i+64]>>13)&~1;
							cb = (dc2[i   ]>>13)&~1;
							i++;
						}
						((int *)p)[xxx] = colclipup16[(unsigned)(yv+crmul[cr+2048]               )>>22]+
												  colclipup8[(unsigned)(yv+crmul[cr+2049]+cbmul[cb+2048])>>22]+
													  colclip[(unsigned)(yv+cbmul[cb+2049]               )>>22];
					}
					p += bytesperline;
					dc += 8;
					if (!((yyy+1)&(lcompvsamp[0]-1))) dc2 += 8;
				}
			}
		}
	}
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
movq %rsi, -0x30(%rsp)
movq %rdi, -0x20(%rsp)
movl 0x5987ef(%rip), %eax    # 0x5e1210
shll $0x3, %eax
testl %eax, %eax
jle 0x48f1a
movq -0x30(%rsp), %rax
negl %eax
movl %eax, -0x40(%rsp)
xorl %esi, %esi
leaq 0x598810(%rip), %r11    # 0x5e1250
leaq 0x599209(%rip), %rcx    # 0x5e1c50
leaq 0x59c542(%rip), %r10    # 0x5e4f90
leaq 0x59b53b(%rip), %r14    # 0x5e3f90
leaq 0x5a0534(%rip), %rbx    # 0x5e8f90
leaq 0x59a52d(%rip), %r15    # 0x5e2f90
xorl %r8d, %r8d
xorl %edx, %edx
movq -0x30(%rsp), %rax
movq %rdx, -0x28(%rsp)
addl %eax, %edx
movl 0x5873a6(%rip), %eax    # 0x5cfe20
addl %eax, %edx
movl %edx, -0x3c(%rsp)
cmpl 0x5987ba(%rip), %edx    # 0x5e1240
jae 0x48eed
movl 0x59876d(%rip), %r12d   # 0x5e1200
leal (,%r12,8), %edx
testl %edx, %edx
jle 0x48efc
movl 0x587367(%rip), %edx    # 0x5cfe10
imull -0x3c(%rsp), %edx
movl 0x587368(%rip), %edi    # 0x5cfe1c
addl -0x20(%rsp), %edi
leal (%rdx,%rdi,4), %edx
movslq %edx, %rdx
addq 0x587343(%rip), %rdx    # 0x5cfe08
movq %rdx, -0x18(%rsp)
movl -0x40(%rsp), %edx
subl %eax, %edx
movl %edx, -0x4c(%rsp)
xorl %r13d, %r13d
movq -0x20(%rsp), %rax
addl %r13d, %eax
addl 0x587337(%rip), %eax    # 0x5cfe1c
movl 0x598751(%rip), %edx    # 0x5e123c
subl %eax, %edx
movq %r11, -0x8(%rsp)
movq %r13, -0x10(%rsp)
jbe 0x48ebc
cmpl $0x2, 0x5986bc(%rip)    # 0x5e11c0
jl 0x48b42
movb 0x598728(%rip), %cl     # 0x5e1234
movq -0x28(%rsp), %rax
shrl %cl, %eax
movl %edx, %r9d
movslq 0x59871b(%rip), %rdx    # 0x5e1238
movb 0x59870d(%rip), %cl     # 0x5e1230
movl %r13d, %edi
shrl %cl, %edi
leal (%rdi,%rax,8), %eax
cltq
shlq $0x8, %rdx
leaq 0x598718(%rip), %rcx    # 0x5e1250
addq %rcx, %rdx
leaq (%rdx,%rax,4), %rcx
movl %r9d, %edx
leal (,%r13,4), %eax
movslq %eax, %r9
addq -0x18(%rsp), %r9
cmpl $0x8, %edx
movl $0x8, %eax
cmovll %edx, %eax
movl %edx, %ebp
movl 0x5986db(%rip), %edx    # 0x5e1240
movl %edx, %edi
subl -0x3c(%rsp), %edx
cmpl $0x1, %r12d
jne 0x48c63
cmpl $0x8, %ebp
jl 0x48c63
testl %edx, %edx
jle 0x48ebc
addl -0x4c(%rsp), %edi
cmpl $0x8, %edi
movl $0x8, %eax
cmovgel %eax, %edi
cmpl $0x2, %edi
movl $0x1, %eax
cmovll %eax, %edi
movl %edi, -0x50(%rsp)
xorl %ebp, %ebp
movq %r11, %rax
movl %ebp, -0x48(%rsp)
xorl %edx, %edx
leaq 0x5993da(%rip), %rdi    # 0x5e1f90
movl (%rax,%rdx,4), %r12d
movl (%rcx,%rdx,4), %esi
movl 0x100(%rcx,%rdx,4), %r8d
sarl $0xd, %r8d
andl $-0x2, %r8d
sarl $0xd, %esi
andl $-0x2, %esi
movslq %r8d, %r13
movl 0x2000(%r10,%r13,4), %ebp
addl %r12d, %ebp
shrl $0x16, %ebp
movl 0x2004(%r10,%r13,4), %r13d
addl %r12d, %r13d
movslq %esi, %r11
addl 0x2000(%rbx,%r11,4), %r13d
shrl $0x16, %r13d
movl (%r15,%r13,4), %r13d
addl (%r14,%rbp,4), %r13d
addl 0x2004(%rbx,%r11,4), %r12d
shrl $0x16, %r12d
addl (%rdi,%r12,4), %r13d
movl %r13d, (%r9,%rdx,4)
incq %rdx
cmpq $0x8, %rdx
jne 0x48bb6
movslq 0x5871e6(%rip), %rdx    # 0x5cfe10
addq %rdx, %r9
addq $0x20, %rax
movl -0x48(%rsp), %ebp
incl %ebp
movl 0x5985d3(%rip), %edx    # 0x5e1210
movl $0x7fffffff, %edi       # imm = 0x7FFFFFFF
addl %edi, %edx
xorl %r11d, %r11d
testl %ebp, %edx
sete %r11b
shll $0x5, %r11d
addq %r11, %rcx
cmpl -0x50(%rsp), %ebp
jne 0x48ba9
jmp 0x48ebc
movl %ebp, -0x38(%rsp)
cmpl $0x2, %r12d
jne 0x48d96
cmpl $0x7, -0x38(%rsp)
jle 0x48d96
testl %edx, %edx
jle 0x48ebc
addl -0x4c(%rsp), %edi
cmpl $0x8, %edi
movl $0x8, %eax
cmovgel %eax, %edi
cmpl $0x2, %edi
movl $0x1, %eax
cmovll %eax, %edi
movl %edi, -0x50(%rsp)
xorl %edi, %edi
movq %r11, %r12
movl %edi, -0x48(%rsp)
movq $-0x2, %rax
leaq 0x5992d7(%rip), %rdi    # 0x5e1f90
movl 0x8(%r12,%rax,4), %r13d
movl 0x4(%rcx,%rax,2), %edx
movl 0x104(%rcx,%rax,2), %esi
sarl $0xd, %esi
andl $-0x2, %esi
sarl $0xd, %edx
andl $-0x2, %edx
movslq %esi, %r8
movslq %edx, %rsi
movl 0x2000(%rbx,%rsi,4), %edx
movl 0x2004(%rbx,%rsi,4), %esi
addl 0x2004(%r10,%r8,4), %edx
movl 0x2000(%r10,%r8,4), %r8d
leal (%r8,%r13), %r11d
shrl $0x16, %r11d
leal (%rdx,%r13), %ebp
shrl $0x16, %ebp
movl (%r15,%rbp,4), %ebp
addl (%r14,%r11,4), %ebp
addl %esi, %r13d
shrl $0x16, %r13d
addl (%rdi,%r13,4), %ebp
movl %ebp, 0x8(%r9,%rax,4)
movl 0xc(%r12,%rax,4), %r11d
leal (%r11,%r8), %r13d
shrl $0x16, %r13d
addl %r11d, %edx
shrl $0x16, %edx
movl (%r15,%rdx,4), %edx
addl (%r14,%r13,4), %edx
addl %esi, %r11d
shrl $0x16, %r11d
addl (%rdi,%r11,4), %edx
movl %edx, 0xc(%r9,%rax,4)
addq $0x2, %rax
cmpq $0x6, %rax
jb 0x48cb9
movslq 0x5870b0(%rip), %rax    # 0x5cfe10
addq %rax, %r9
addq $0x20, %r12
movl -0x48(%rsp), %edi
incl %edi
movl 0x59849d(%rip), %eax    # 0x5e1210
movl $0x7fffffff, %edx       # imm = 0x7FFFFFFF
addl %edx, %eax
xorl %edx, %edx
testl %edi, %eax
sete %dl
shll $0x5, %edx
addq %rdx, %rcx
cmpl -0x50(%rsp), %edi
jne 0x48ca7
jmp 0x48ebc
testl %edx, %edx
jle 0x48ebc
cltq
movq %rax, -0x48(%rsp)
addl -0x4c(%rsp), %edi
cmpl $0x8, %edi
movl $0x8, %eax
cmovgel %eax, %edi
cmpl $0x2, %edi
movl $0x1, %eax
cmovll %eax, %edi
movl %edi, -0x50(%rsp)
xorl %edi, %edi
movq %r11, %r12
movl %edi, -0x34(%rsp)
cmpl $0x0, -0x38(%rsp)
jle 0x48e76
movl $0x1, %edi
xorl %eax, %eax
xorl %edx, %edx
decl %edi
jne 0x48e08
movl 0x598416(%rip), %edi    # 0x5e1200
movslq %edx, %rdx
movl (%rcx,%rdx,4), %esi
movl 0x100(%rcx,%rdx,4), %r8d
sarl $0xd, %r8d
andl $-0x2, %r8d
sarl $0xd, %esi
andl $-0x2, %esi
incl %edx
movl (%r12,%rax,4), %r11d
movslq %r8d, %rbp
movl 0x2000(%r10,%rbp,4), %r13d
addl %r11d, %r13d
shrl $0x16, %r13d
movl 0x2004(%r10,%rbp,4), %ebp
addl %r11d, %ebp
movslq %esi, %r14
addl 0x2000(%rbx,%r14,4), %ebp
shrl $0x16, %ebp
leaq 0x59a152(%rip), %r15    # 0x5e2f90
movl (%r15,%rbp,4), %ebp
leaq 0x59b147(%rip), %r15    # 0x5e3f90
addl (%r15,%r13,4), %ebp
addl 0x2004(%rbx,%r14,4), %r11d
shrl $0x16, %r11d
leaq 0x599130(%rip), %r14    # 0x5e1f90
addl (%r14,%r11,4), %ebp
movl %ebp, (%r9,%rax,4)
incq %rax
cmpq -0x48(%rsp), %rax
jl 0x48de0
movslq 0x586f93(%rip), %rax    # 0x5cfe10
addq %rax, %r9
addq $0x20, %r12
movl -0x34(%rsp), %edi
incl %edi
movl 0x598380(%rip), %eax    # 0x5e1210
movl $0x7fffffff, %edx       # imm = 0x7FFFFFFF
addl %edx, %eax
xorl %edx, %edx
testl %edi, %eax
sete %dl
shll $0x5, %edx
addq %rdx, %rcx
cmpl -0x50(%rsp), %edi
leaq 0x59b0e1(%rip), %r14    # 0x5e3f90
leaq 0x59a0da(%rip), %r15    # 0x5e2f90
jne 0x48dc8
movq -0x10(%rsp), %r13
addq $0x8, %r13
movq -0x8(%rsp), %r11
addq $0x100, %r11            # imm = 0x100
movl 0x598328(%rip), %r12d   # 0x5e1200
leal (,%r12,8), %eax
cltq
cmpq %rax, %r13
jl 0x48ad7
jmp 0x48efc
movl 0x59830d(%rip), %eax    # 0x5e1200
shll $0x6, %eax
cltq
leaq (%r11,%rax,4), %r11
movq -0x28(%rsp), %rdx
addl $0x8, %edx
movl 0x598306(%rip), %eax    # 0x5e1210
shll $0x3, %eax
addl $-0x8, -0x40(%rsp)
cmpl %eax, %edx
jl 0x48a68
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
nopl (%rax)