// File: /workspace/github_c_makefile_star2_O1/jonof[P]jftekwar/jfbuild/src/engine.c
// Function: clippoly
static int clippoly(int npoints, int clipstat)
{
	int z, zz, s1, s2, t, npoints2, start2, z1, z2, z3, z4, splitcnt;
	int cx1, cy1, cx2, cy2;

	cx1 = windowx1;
	cy1 = windowy1;
	cx2 = windowx2+1;
	cy2 = windowy2+1;
	cx1 <<= 12; cy1 <<= 12; cx2 <<= 12; cy2 <<= 12;

	if (clipstat&0xa)   //Need to clip top or left
	{
		npoints2 = 0; start2 = 0; z = 0; splitcnt = 0;
		do
		{
			s2 = cx1-rx1[z];
			do
			{
				zz = xb1[z]; xb1[z] = -1;
				s1 = s2; s2 = cx1-rx1[zz];
				if (s1 < 0)
				{
					rx2[npoints2] = rx1[z]; ry2[npoints2] = ry1[z];
					xb2[npoints2] = npoints2+1; npoints2++;
				}
				if ((s1^s2) < 0)
				{
					rx2[npoints2] = rx1[z]+scale(rx1[zz]-rx1[z],s1,s1-s2);
					ry2[npoints2] = ry1[z]+scale(ry1[zz]-ry1[z],s1,s1-s2);
					if (s1 < 0) p2[splitcnt++] = npoints2;
					xb2[npoints2] = npoints2+1;
					npoints2++;
				}
				z = zz;
			} while (xb1[z] >= 0);

			if (npoints2 >= start2+3)
				xb2[npoints2-1] = start2, start2 = npoints2;
			else
				npoints2 = start2;

			z = 1;
			while ((z < npoints) && (xb1[z] < 0)) z++;
		} while (z < npoints);
		if (npoints2 <= 2) return(0);

		for(z=1;z<splitcnt;z++)
			for(zz=0;zz<z;zz++)
			{
				z1 = p2[z]; z2 = xb2[z1]; z3 = p2[zz]; z4 = xb2[z3];
				s1  = klabs(rx2[z1]-rx2[z2])+klabs(ry2[z1]-ry2[z2]);
				s1 += klabs(rx2[z3]-rx2[z4])+klabs(ry2[z3]-ry2[z4]);
				s2  = klabs(rx2[z1]-rx2[z4])+klabs(ry2[z1]-ry2[z4]);
				s2 += klabs(rx2[z3]-rx2[z2])+klabs(ry2[z3]-ry2[z2]);
				if (s2 < s1)
					{ t = xb2[p2[z]]; xb2[p2[z]] = xb2[p2[zz]]; xb2[p2[zz]] = t; }
			}


		npoints = 0; start2 = 0; z = 0; splitcnt = 0;
		do
		{
			s2 = cy1-ry2[z];
			do
			{
				zz = xb2[z]; xb2[z] = -1;
				s1 = s2; s2 = cy1-ry2[zz];
				if (s1 < 0)
				{
					rx1[npoints] = rx2[z]; ry1[npoints] = ry2[z];
					xb1[npoints] = npoints+1; npoints++;
				}
				if ((s1^s2) < 0)
				{
					rx1[npoints] = rx2[z]+scale(rx2[zz]-rx2[z],s1,s1-s2);
					ry1[npoints] = ry2[z]+scale(ry2[zz]-ry2[z],s1,s1-s2);
					if (s1 < 0) p2[splitcnt++] = npoints;
					xb1[npoints] = npoints+1;
					npoints++;
				}
				z = zz;
			} while (xb2[z] >= 0);

			if (npoints >= start2+3)
				xb1[npoints-1] = start2, start2 = npoints;
			else
				npoints = start2;

			z = 1;
			while ((z < npoints2) && (xb2[z] < 0)) z++;
		} while (z < npoints2);
		if (npoints <= 2) return(0);

		for(z=1;z<splitcnt;z++)
			for(zz=0;zz<z;zz++)
			{
				z1 = p2[z]; z2 = xb1[z1]; z3 = p2[zz]; z4 = xb1[z3];
				s1  = klabs(rx1[z1]-rx1[z2])+klabs(ry1[z1]-ry1[z2]);
				s1 += klabs(rx1[z3]-rx1[z4])+klabs(ry1[z3]-ry1[z4]);
				s2  = klabs(rx1[z1]-rx1[z4])+klabs(ry1[z1]-ry1[z4]);
				s2 += klabs(rx1[z3]-rx1[z2])+klabs(ry1[z3]-ry1[z2]);
				if (s2 < s1)
					{ t = xb1[p2[z]]; xb1[p2[z]] = xb1[p2[zz]]; xb1[p2[zz]] = t; }
			}
	}
	if (clipstat&0x5)   //Need to clip bottom or right
	{
		npoints2 = 0; start2 = 0; z = 0; splitcnt = 0;
		do
		{
			s2 = rx1[z]-cx2;
			do
			{
				zz = xb1[z]; xb1[z] = -1;
				s1 = s2; s2 = rx1[zz]-cx2;
				if (s1 < 0)
				{
					rx2[npoints2] = rx1[z]; ry2[npoints2] = ry1[z];
					xb2[npoints2] = npoints2+1; npoints2++;
				}
				if ((s1^s2) < 0)
				{
					rx2[npoints2] = rx1[z]+scale(rx1[zz]-rx1[z],s1,s1-s2);
					ry2[npoints2] = ry1[z]+scale(ry1[zz]-ry1[z],s1,s1-s2);
					if (s1 < 0) p2[splitcnt++] = npoints2;
					xb2[npoints2] = npoints2+1;
					npoints2++;
				}
				z = zz;
			} while (xb1[z] >= 0);

			if (npoints2 >= start2+3)
				xb2[npoints2-1] = start2, start2 = npoints2;
			else
				npoints2 = start2;

			z = 1;
			while ((z < npoints) && (xb1[z] < 0)) z++;
		} while (z < npoints);
		if (npoints2 <= 2) return(0);

		for(z=1;z<splitcnt;z++)
			for(zz=0;zz<z;zz++)
			{
				z1 = p2[z]; z2 = xb2[z1]; z3 = p2[zz]; z4 = xb2[z3];
				s1  = klabs(rx2[z1]-rx2[z2])+klabs(ry2[z1]-ry2[z2]);
				s1 += klabs(rx2[z3]-rx2[z4])+klabs(ry2[z3]-ry2[z4]);
				s2  = klabs(rx2[z1]-rx2[z4])+klabs(ry2[z1]-ry2[z4]);
				s2 += klabs(rx2[z3]-rx2[z2])+klabs(ry2[z3]-ry2[z2]);
				if (s2 < s1)
					{ t = xb2[p2[z]]; xb2[p2[z]] = xb2[p2[zz]]; xb2[p2[zz]] = t; }
			}


		npoints = 0; start2 = 0; z = 0; splitcnt = 0;
		do
		{
			s2 = ry2[z]-cy2;
			do
			{
				zz = xb2[z]; xb2[z] = -1;
				s1 = s2; s2 = ry2[zz]-cy2;
				if (s1 < 0)
				{
					rx1[npoints] = rx2[z]; ry1[npoints] = ry2[z];
					xb1[npoints] = npoints+1; npoints++;
				}
				if ((s1^s2) < 0)
				{
					rx1[npoints] = rx2[z]+scale(rx2[zz]-rx2[z],s1,s1-s2);
					ry1[npoints] = ry2[z]+scale(ry2[zz]-ry2[z],s1,s1-s2);
					if (s1 < 0) p2[splitcnt++] = npoints;
					xb1[npoints] = npoints+1;
					npoints++;
				}
				z = zz;
			} while (xb2[z] >= 0);

			if (npoints >= start2+3)
				xb1[npoints-1] = start2, start2 = npoints;
			else
				npoints = start2;

			z = 1;
			while ((z < npoints2) && (xb2[z] < 0)) z++;
		} while (z < npoints2);
		if (npoints <= 2) return(0);

		for(z=1;z<splitcnt;z++)
			for(zz=0;zz<z;zz++)
			{
				z1 = p2[z]; z2 = xb1[z1]; z3 = p2[zz]; z4 = xb1[z3];
				s1  = klabs(rx1[z1]-rx1[z2])+klabs(ry1[z1]-ry1[z2]);
				s1 += klabs(rx1[z3]-rx1[z4])+klabs(ry1[z3]-ry1[z4]);
				s2  = klabs(rx1[z1]-rx1[z4])+klabs(ry1[z1]-ry1[z4]);
				s2 += klabs(rx1[z3]-rx1[z2])+klabs(ry1[z3]-ry1[z2]);
				if (s2 < s1)
					{ t = xb1[p2[z]]; xb1[p2[z]] = xb1[p2[zz]]; xb1[p2[zz]] = t; }
			}
	}
	return(npoints);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
movl %edi, %r10d
movl 0x3d8b25(%rip), %r12d   # 0x406fe0
movl 0x3d8b23(%rip), %eax    # 0x406fe4
movl %eax, -0x20(%rsp)
testb $0xa, %sil
je 0x2eaeb
movl %r12d, -0x40(%rsp)
movl %esi, -0x14(%rsp)
movl 0x3a2892(%rip), %edi    # 0x3d0d70
movl 0x3a469c(%rip), %eax    # 0x3d2b80
shll $0xc, %edi
shll $0xc, %eax
movl %eax, -0x38(%rsp)
movq %r10, -0x60(%rsp)
movl %r10d, %eax
movq %rax, -0x68(%rsp)
xorl %r9d, %r9d
leaq 0x3d8afb(%rip), %rdx    # 0x407000
leaq 0x23c564(%rip), %r11    # 0x26aa70
leaq 0x24056d(%rip), %r13    # 0x26ea80
xorl %ecx, %ecx
xorl %r12d, %r12d
movl %r9d, %eax
movl %edi, %r8d
subl (%rdx,%rax,4), %r8d
movq %rcx, -0x10(%rsp)
movl %ecx, %ebp
movslq %r9d, %r10
movl (%r11,%r10,4), %r9d
movl $0xffffffff, (%r11,%r10,4) # imm = 0xFFFFFFFF
testl %r8d, %r8d
jns 0x2e56b
movl (%rdx,%r10,4), %eax
movslq %ebp, %rcx
leaq 0x46c9c5(%rip), %rsi    # 0x49af10
movl %eax, (%rsi,%rcx,4)
leaq 0x3dcaab(%rip), %rax    # 0x40b000
movl (%rax,%r10,4), %eax
leaq 0x4709b0(%rip), %rsi    # 0x49ef10
movl %eax, (%rsi,%rcx,4)
leal 0x1(%rcx), %ebp
movl %ebp, (%r13,%rcx,4)
movslq %r9d, %r14
movl (%rdx,%r14,4), %eax
movl %edi, %esi
subl %eax, %esi
movl %esi, %ecx
xorl %r8d, %ecx
jns 0x2e605
movl (%rdx,%r10,4), %r11d
subl %r11d, %eax
movl %r8d, %ecx
subl %esi, %ecx
cltq
movslq %r8d, %rbx
imulq %rbx, %rax
movslq %ecx, %r15
cqto
idivq %r15
movq %rax, %rcx
addl %r11d, %ecx
leaq 0x3dca55(%rip), %rax    # 0x40b000
movslq (%rax,%r10,4), %r10
movslq (%rax,%r14,4), %rax
subq %r10, %rax
imulq %rbx, %rax
cqto
idivq %r15
addl %r10d, %eax
movslq %ebp, %rdx
leaq 0x46c944(%rip), %r10    # 0x49af10
movl %ecx, (%r10,%rdx,4)
leaq 0x470939(%rip), %rcx    # 0x49ef10
movl %eax, (%rcx,%rdx,4)
testl %r8d, %r8d
jns 0x2e5f0
movslq %r12d, %rax
incl %r12d
leaq 0x3b01e4(%rip), %rcx    # 0x3de7d0
movw %bp, (%rcx,%rax,2)
leaq 0x23c479(%rip), %r11    # 0x26aa70
incl %ebp
movl %ebp, (%r13,%rdx,4)
leaq 0x3d89fb(%rip), %rdx    # 0x407000
cmpl $0x0, (%r11,%r14,4)
movl %esi, %r8d
jns 0x2e529
movq -0x10(%rsp), %rcx
leal 0x3(%rcx), %eax
cmpl %eax, %ebp
jl 0x2e629
leal -0x1(%rbp), %eax
movl %ecx, (%r13,%rax,4)
movl %ebp, %ecx
movq -0x68(%rsp), %rax
cmpl $0x2, -0x60(%rsp)
jl 0x2e64e
movl $0x1, %r9d
cmpl $0x0, (%r11,%r9,4)
jns 0x2e518
incq %r9
cmpq %r9, %rax
jne 0x2e63b
cmpl $0x3, %ecx
jl 0x2ef6f
movq %rcx, -0x10(%rsp)
cmpl $0x2, %r12d
jl 0x2e7cc
movl %r12d, %eax
movq %rax, -0x8(%rsp)
movl $0x1, %ecx
movl $0x2, %eax
movq %rax, -0x50(%rsp)
leaq 0x3b014c(%rip), %rax    # 0x3de7d0
movq %rcx, -0x60(%rsp)
movswq (%rax,%rcx,2), %rcx
leaq 0x46c87b(%rip), %rax    # 0x49af10
movl (%rax,%rcx,4), %eax
movl %eax, -0x54(%rsp)
leaq 0x47086d(%rip), %rax    # 0x49ef10
movq %rcx, -0x48(%rsp)
movl (%rax,%rcx,4), %eax
movl %eax, -0x58(%rsp)
xorl %r9d, %r9d
movq -0x48(%rsp), %rax
movslq (%r13,%rax,4), %rdi
leaq 0x3b010d(%rip), %rax    # 0x3de7d0
movswq (%r9,%rax), %r10
movslq (%r13,%r10,4), %rax
leaq 0x46c83c(%rip), %rdx    # 0x49af10
movl (%rdx,%rdi,4), %esi
movl %esi, -0x68(%rsp)
movl -0x54(%rsp), %ebp
movl %ebp, %ecx
subl %esi, %ecx
movl %ecx, %r12d
negl %r12d
cmovsl %ecx, %r12d
leaq 0x47081c(%rip), %rsi    # 0x49ef10
movq %rdi, -0x28(%rsp)
movl (%rsi,%rdi,4), %ecx
movl -0x58(%rsp), %r14d
movl %r14d, %r11d
subl %ecx, %r11d
movl %r11d, %ebx
negl %ebx
cmovsl %r11d, %ebx
movl (%rdx,%r10,4), %r11d
movl (%rdx,%rax,4), %r13d
movl %r11d, %r15d
subl %r13d, %r15d
movl %r15d, %edx
negl %edx
cmovsl %r15d, %edx
movl (%rsi,%r10,4), %r8d
movq %rax, -0x30(%rsp)
movl (%rsi,%rax,4), %esi
movl %r8d, %edi
subl %esi, %edi
movl %edi, %r15d
negl %r15d
cmovsl %edi, %r15d
addl %r12d, %ebx
addl %edx, %ebx
addl %r15d, %ebx
subl %r13d, %ebp
leaq 0x24032c(%rip), %r13    # 0x26ea80
movl %ebp, %edi
negl %edi
cmovsl %ebp, %edi
subl %esi, %r14d
movl %r14d, %esi
negl %esi
cmovsl %r14d, %esi
subl -0x68(%rsp), %r11d
movl %r11d, %edx
negl %edx
cmovsl %r11d, %edx
subl %ecx, %r8d
movl %r8d, %ecx
negl %ecx
cmovsl %r8d, %ecx
addl %edx, %ecx
addl %edi, %ecx
addl %esi, %ecx
cmpl %ebx, %ecx
jae 0x2e7a4
movq -0x48(%rsp), %rcx
movq -0x30(%rsp), %rdx
movl %edx, (%r13,%rcx,4)
movq -0x28(%rsp), %rcx
movl %ecx, (%r13,%r10,4)
addq $0x2, %r9
cmpq %r9, -0x50(%rsp)
jne 0x2e6b2
movq -0x60(%rsp), %rcx
incq %rcx
addq $0x2, -0x50(%rsp)
cmpq -0x8(%rsp), %rcx
jne 0x2e67d
movq -0x10(%rsp), %rax
cmpl $0x3, %eax
movl $0x2, %edi
cmovgel %eax, %edi
xorl %r10d, %r10d
xorl %r8d, %r8d
movl $0x0, -0x68(%rsp)
movl -0x40(%rsp), %r12d
leaq 0x3d880a(%rip), %rbx    # 0x407000
leaq 0x470713(%rip), %rdx    # 0x49ef10
movl %r8d, %eax
movl -0x38(%rsp), %ebp
subl (%rdx,%rax,4), %ebp
movq %r10, -0x60(%rsp)
movl %r10d, %r9d
movslq %r8d, %r10
movl (%r13,%r10,4), %r8d
movl $0xffffffff, (%r13,%r10,4) # imm = 0xFFFFFFFF
testl %ebp, %ebp
jns 0x2e859
leaq 0x46c6e5(%rip), %rax    # 0x49af10
movl (%rax,%r10,4), %eax
movslq %r9d, %rcx
movl %eax, (%rbx,%rcx,4)
movl (%rdx,%r10,4), %eax
leaq 0x3dc7c0(%rip), %rdx    # 0x40b000
movl %eax, (%rdx,%rcx,4)
leaq 0x4706c6(%rip), %rdx    # 0x49ef10
leal 0x1(%rcx), %r9d
leaq 0x23c21b(%rip), %rax    # 0x26aa70
movl %r9d, (%rax,%rcx,4)
movslq %r8d, %rsi
movl (%rdx,%rsi,4), %r11d
movl -0x38(%rsp), %r14d
subl %r11d, %r14d
movl %r14d, %eax
xorl %ebp, %eax
jns 0x2e90d
leaq 0x46c696(%rip), %rax    # 0x49af10
movslq (%rax,%r10,4), %rbx
movslq (%rax,%rsi,4), %rax
subq %rbx, %rax
movl %ebp, %ecx
subl %r14d, %ecx
movslq %ebp, %r15
imulq %r15, %rax
movslq %ecx, %r12
movq %rdx, %r13
cqto
idivq %r12
movq %rax, %rcx
addl %ebx, %ecx
movl (%r13,%r10,4), %r10d
subl %r10d, %r11d
movslq %r11d, %rax
imulq %r15, %rax
leaq 0x3d8749(%rip), %rbx    # 0x407000
cqto
idivq %r12
addl %r10d, %eax
movslq %r9d, %rdx
movl %ecx, (%rbx,%rdx,4)
leaq 0x3dc734(%rip), %rcx    # 0x40b000
movl %eax, (%rcx,%rdx,4)
testl %ebp, %ebp
jns 0x2e8ec
movl -0x68(%rsp), %ecx
movslq %ecx, %rax
incl %ecx
movl %ecx, -0x68(%rsp)
leaq 0x3afee9(%rip), %rcx    # 0x3de7d0
movw %r9w, (%rcx,%rax,2)
movl -0x40(%rsp), %r12d
leaq 0x240188(%rip), %r13    # 0x26ea80
incl %r9d
leaq 0x23c16e(%rip), %rax    # 0x26aa70
movl %r9d, (%rax,%rdx,4)
leaq 0x470603(%rip), %rdx    # 0x49ef10
cmpl $0x0, (%r13,%rsi,4)
movl %r14d, %ebp
jns 0x2e80f
movq -0x60(%rsp), %r10
leal 0x3(%r10), %eax
cmpl %eax, %r9d
jl 0x2e93c
leal -0x1(%r9), %eax
leaq 0x23c13b(%rip), %rcx    # 0x26aa70
movl %r10d, (%rcx,%rax,4)
movl %r9d, %r10d
movl $0x1, %r8d
cmpl $0x0, (%r13,%r8,4)
jns 0x2e7fd
incq %r8
cmpq %r8, %rdi
jne 0x2e942
cmpl $0x3, %r10d
jl 0x2ef6f
movl -0x68(%rsp), %eax
cmpl $0x2, %eax
jl 0x2eae7
movq %r10, -0x60(%rsp)
movl %eax, %eax
movq %rax, -0x8(%rsp)
movl $0x1, %ecx
movl $0x2, %eax
movq %rax, -0x50(%rsp)
leaq 0x3afe41(%rip), %rax    # 0x3de7d0
movq %rcx, -0x38(%rsp)
movswq (%rax,%rcx,2), %rcx
movl (%rbx,%rcx,4), %eax
movl %eax, -0x54(%rsp)
leaq 0x3dc659(%rip), %rax    # 0x40b000
movq %rcx, -0x48(%rsp)
movl (%rax,%rcx,4), %eax
movl %eax, -0x58(%rsp)
xorl %r9d, %r9d
leaq 0x23c0b3(%rip), %rax    # 0x26aa70
movq -0x48(%rsp), %rcx
movslq (%rax,%rcx,4), %rdi
leaq 0x3afe03(%rip), %rcx    # 0x3de7d0
movswq (%r9,%rcx), %r10
movslq (%rax,%r10,4), %r12
leaq 0x3d8623(%rip), %rcx    # 0x407000
movl (%rcx,%rdi,4), %eax
movl %eax, -0x68(%rsp)
movl -0x54(%rsp), %r15d
movl %r15d, %r11d
subl %eax, %r11d
movl %r11d, %eax
negl %eax
cmovsl %r11d, %eax
leaq 0x3dc601(%rip), %rsi    # 0x40b000
movq %rdi, -0x28(%rsp)
movl (%rsi,%rdi,4), %ebp
movl -0x58(%rsp), %r14d
movl %r14d, %r11d
subl %ebp, %r11d
movl %r11d, %ebx
negl %ebx
cmovsl %r11d, %ebx
movl (%rcx,%r10,4), %r11d
movl (%rcx,%r12,4), %ecx
movl %r11d, %r13d
subl %ecx, %r13d
movl %r13d, %edx
negl %edx
cmovsl %r13d, %edx
movl (%rsi,%r10,4), %r8d
movq %r12, -0x30(%rsp)
movl (%rsi,%r12,4), %esi
movl %r8d, %edi
subl %esi, %edi
movl %edi, %r13d
negl %r13d
cmovsl %edi, %r13d
addl %eax, %ebx
addl %edx, %ebx
addl %r13d, %ebx
subl %ecx, %r15d
movl %r15d, %ecx
negl %ecx
cmovsl %r15d, %ecx
subl %esi, %r14d
movl %r14d, %edx
negl %edx
cmovsl %r14d, %edx
subl -0x68(%rsp), %r11d
movl %r11d, %eax
negl %eax
cmovsl %r11d, %eax
subl %ebp, %r8d
movl %r8d, %esi
negl %esi
cmovsl %r8d, %esi
addl %eax, %esi
addl %ecx, %esi
addl %edx, %esi
cmpl %ebx, %esi
leaq 0x23bfda(%rip), %rax    # 0x26aa70
jae 0x2eaae
movq -0x48(%rsp), %rcx
movq -0x30(%rsp), %rdx
movl %edx, (%rax,%rcx,4)
movq -0x28(%rsp), %rcx
movl %ecx, (%rax,%r10,4)
addq $0x2, %r9
cmpq %r9, -0x50(%rsp)
jne 0x2e9bd
movq -0x38(%rsp), %rcx
incq %rcx
addq $0x2, -0x50(%rsp)
cmpq -0x8(%rsp), %rcx
leaq 0x3d8529(%rip), %rbx    # 0x407000
jne 0x2e988
movq -0x60(%rsp), %r10
movl -0x40(%rsp), %r12d
movl -0x14(%rsp), %esi
testb $0x5, %sil
je 0x2ef72
shll $0xc, %r12d
movl $0x1000, %eax           # imm = 0x1000
addl %eax, %r12d
movl -0x20(%rsp), %ecx
shll $0xc, %ecx
addl %eax, %ecx
movl %ecx, -0x20(%rsp)
movq %r10, -0x60(%rsp)
movl %r10d, %edi
xorl %ebp, %ebp
leaq 0x3d84e1(%rip), %rdx    # 0x407000
leaq 0x23bf4a(%rip), %r10    # 0x26aa70
leaq 0x23ff53(%rip), %r14    # 0x26ea80
xorl %ecx, %ecx
xorl %r15d, %r15d
movl %ebp, %eax
movl (%rdx,%rax,4), %r13d
subl %r12d, %r13d
movq %rcx, -0x40(%rsp)
movl %ecx, %r9d
movslq %ebp, %rsi
movl (%r10,%rsi,4), %ebp
movl $0xffffffff, (%r10,%rsi,4) # imm = 0xFFFFFFFF
testl %r13d, %r13d
jns 0x2eb85
movl (%rdx,%rsi,4), %eax
movslq %r9d, %rcx
leaq 0x46c3ac(%rip), %r8     # 0x49af10
movl %eax, (%r8,%rcx,4)
leaq 0x3dc491(%rip), %rax    # 0x40b000
movl (%rax,%rsi,4), %eax
leaq 0x470397(%rip), %r8     # 0x49ef10
movl %eax, (%r8,%rcx,4)
leal 0x1(%rcx), %r9d
movl %r9d, (%r14,%rcx,4)
movslq %ebp, %rbx
movl (%rdx,%rbx,4), %eax
movl %eax, %r8d
subl %r12d, %r8d
movl %r8d, %ecx
xorl %r13d, %ecx
jns 0x2ec28
movl (%rdx,%rsi,4), %r10d
subl %r10d, %eax
movl %r13d, %ecx
subl %r8d, %ecx
cltq
movslq %r13d, %r11
imulq %r11, %rax
movslq %ecx, %r14
cqto
idivq %r14
movq %rax, %rcx
addl %r10d, %ecx
leaq 0x3dc438(%rip), %rax    # 0x40b000
movslq (%rax,%rsi,4), %rsi
movslq (%rax,%rbx,4), %rax
subq %rsi, %rax
imulq %r11, %rax
cqto
idivq %r14
addl %esi, %eax
movslq %r9d, %rdx
leaq 0x46c328(%rip), %rsi    # 0x49af10
movl %ecx, (%rsi,%rdx,4)
leaq 0x47031e(%rip), %rcx    # 0x49ef10
movl %eax, (%rcx,%rdx,4)
testl %r13d, %r13d
jns 0x2ec0c
movslq %r15d, %rax
incl %r15d
leaq 0x3afbc9(%rip), %rcx    # 0x3de7d0
movw %r9w, (%rcx,%rax,2)
leaq 0x23be5d(%rip), %r10    # 0x26aa70
leaq 0x23fe66(%rip), %r14    # 0x26ea80
incl %r9d
movl %r9d, (%r14,%rdx,4)
leaq 0x3d83d8(%rip), %rdx    # 0x407000
cmpl $0x0, (%r10,%rbx,4)
movl %r8d, %r13d
jns 0x2eb43
movq -0x40(%rsp), %rcx
leal 0x3(%rcx), %eax
cmpl %eax, %r9d
jl 0x2ec4e
leal -0x1(%r9), %eax
movl %ecx, (%r14,%rax,4)
movl %r9d, %ecx
movq -0x60(%rsp), %rax
cmpl $0x2, %eax
jl 0x2ec70
movl $0x1, %ebp
cmpl $0x0, (%r10,%rbp,4)
jns 0x2eb32
incq %rbp
cmpq %rbp, %rdi
jne 0x2ec5d
cmpl $0x3, %ecx
jl 0x2ef6f
movq %rcx, -0x40(%rsp)
cmpl $0x2, %r15d
jl 0x2edf2
movl %r15d, %eax
movq %rax, -0x60(%rsp)
movl $0x1, %ecx
movl $0x2, %eax
movq %rax, -0x50(%rsp)
leaq 0x3afb2a(%rip), %rax    # 0x3de7d0
movq %rcx, -0x38(%rsp)
movswq (%rax,%rcx,2), %rcx
leaq 0x46c259(%rip), %rax    # 0x49af10
movl (%rax,%rcx,4), %eax
movl %eax, -0x54(%rsp)
leaq 0x47024b(%rip), %rax    # 0x49ef10
movq %rcx, -0x48(%rsp)
movl (%rax,%rcx,4), %eax
movl %eax, -0x58(%rsp)
xorl %ebp, %ebp
movq -0x48(%rsp), %rax
movslq (%r14,%rax,4), %r8
leaq 0x3afaed(%rip), %rax    # 0x3de7d0
movswq (%rbp,%rax), %rsi
movslq (%r14,%rsi,4), %rax
leaq 0x46c21c(%rip), %rdx    # 0x49af10
movl (%rdx,%r8,4), %edi
movl %edi, -0x68(%rsp)
movl -0x54(%rsp), %r13d
movl %r13d, %ecx
subl %edi, %ecx
movl %ecx, %r15d
negl %r15d
cmovsl %ecx, %r15d
leaq 0x4701f9(%rip), %rdi    # 0x49ef10
movq %r8, -0x28(%rsp)
movl (%rdi,%r8,4), %ecx
movl -0x58(%rsp), %ebx
movl %ebx, %r10d
subl %ecx, %r10d
movl %r10d, %r11d
negl %r11d
cmovsl %r10d, %r11d
movl (%rdx,%rsi,4), %r10d
movl (%rdx,%rax,4), %r12d
movl %r10d, %r14d
subl %r12d, %r14d
movl %r14d, %edx
negl %edx
cmovsl %r14d, %edx
movl (%rdi,%rsi,4), %r9d
movq %rax, -0x30(%rsp)
movl (%rdi,%rax,4), %edi
movl %r9d, %r8d
subl %edi, %r8d
movl %r8d, %r14d
negl %r14d
cmovsl %r8d, %r14d
addl %r15d, %r11d
addl %edx, %r11d
addl %r14d, %r11d
leaq 0x23fd09(%rip), %r14    # 0x26ea80
subl %r12d, %r13d
movl %r13d, %r8d
negl %r8d
cmovsl %r13d, %r8d
subl %edi, %ebx
movl %ebx, %edi
negl %edi
cmovsl %ebx, %edi
subl -0x68(%rsp), %r10d
movl %r10d, %edx
negl %edx
cmovsl %r10d, %edx
subl %ecx, %r9d
movl %r9d, %ecx
negl %ecx
cmovsl %r9d, %ecx
addl %edx, %ecx
addl %r8d, %ecx
addl %edi, %ecx
cmpl %r11d, %ecx
jae 0x2edca
movq -0x48(%rsp), %rcx
movq -0x30(%rsp), %rdx
movl %edx, (%r14,%rcx,4)
movq -0x28(%rsp), %rcx
movl %ecx, (%r14,%rsi,4)
addq $0x2, %rbp
cmpq %rbp, -0x50(%rsp)
jne 0x2ecd3
movq -0x38(%rsp), %rcx
incq %rcx
addq $0x2, -0x50(%rsp)
cmpq -0x60(%rsp), %rcx
jne 0x2ec9f
movq -0x40(%rsp), %rax
cmpl $0x3, %eax
movl $0x2, %r8d
cmovgel %eax, %r8d
xorl %r13d, %r13d
xorl %r9d, %r9d
movl $0x0, -0x68(%rsp)
leaq 0x3d81e7(%rip), %r11    # 0x407000
leaq 0x4700f0(%rip), %r15    # 0x49ef10
movl %r9d, %eax
movl (%r15,%rax,4), %ebp
subl -0x20(%rsp), %ebp
movq %r13, -0x60(%rsp)
movslq %r9d, %rsi
movl (%r14,%rsi,4), %r9d
movl $0xffffffff, (%r14,%rsi,4) # imm = 0xFFFFFFFF
testl %ebp, %ebp
jns 0x2ee71
leaq 0x46c0c6(%rip), %rax    # 0x49af10
movl (%rax,%rsi,4), %eax
movslq %r13d, %rcx
movl %eax, (%r11,%rcx,4)
movl (%r15,%rsi,4), %eax
leaq 0x3dc1a1(%rip), %rdx    # 0x40b000
movl %eax, (%rdx,%rcx,4)
leal 0x1(%rcx), %r13d
leaq 0x23bc03(%rip), %rax    # 0x26aa70
movl %r13d, (%rax,%rcx,4)
movslq %r9d, %rdi
movl (%r15,%rdi,4), %r10d
movl %r10d, %ebx
subl -0x20(%rsp), %ebx
movl %ebx, %eax
xorl %ebp, %eax
jns 0x2ef1d
leaq 0x46c080(%rip), %rax    # 0x49af10
movslq (%rax,%rsi,4), %r11
movslq (%rax,%rdi,4), %rax
subq %r11, %rax
movl %ebp, %ecx
subl %ebx, %ecx
movslq %ebp, %r14
imulq %r14, %rax
movq %r15, %r12
movslq %ecx, %r15
cqto
idivq %r15
movq %rax, %rcx
addl %r11d, %ecx
movl (%r12,%rsi,4), %esi
subl %esi, %r10d
movslq %r10d, %rax
imulq %r14, %rax
leaq 0x3d8134(%rip), %r11    # 0x407000
cqto
idivq %r15
addl %esi, %eax
movslq %r13d, %rdx
movl %ecx, (%r11,%rdx,4)
leaq 0x3dc11f(%rip), %rcx    # 0x40b000
movl %eax, (%rcx,%rdx,4)
testl %ebp, %ebp
jns 0x2ef01
movl -0x68(%rsp), %ecx
movslq %ecx, %rax
incl %ecx
movl %ecx, -0x68(%rsp)
leaq 0x3af8d4(%rip), %rcx    # 0x3de7d0
movw %r13w, (%rcx,%rax,2)
leaq 0x23fb78(%rip), %r14    # 0x26ea80
incl %r13d
leaq 0x23bb5e(%rip), %rax    # 0x26aa70
movl %r13d, (%rax,%rdx,4)
leaq 0x46fff3(%rip), %r15    # 0x49ef10
cmpl $0x0, (%r14,%rdi,4)
movl %ebx, %ebp
jns 0x2ee30
movq -0x60(%rsp), %r10
leal 0x3(%r10), %eax
cmpl %eax, %r13d
jl 0x2ef4a
leal -0x1(%r13), %eax
leaq 0x23bb2d(%rip), %rcx    # 0x26aa70
movl %r10d, (%rcx,%rax,4)
movl %r13d, %r10d
movl $0x1, %r9d
cmpl $0x0, (%r14,%r9,4)
jns 0x2ef61
incq %r9
cmpq %r9, %r8
jne 0x2ef50
jmp 0x2ef69
movq %r10, %r13
jmp 0x2ee20
cmpl $0x3, %r10d
jge 0x2ef80
xorl %r10d, %r10d
movl %r10d, %eax
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movl -0x68(%rsp), %eax
cmpl $0x2, %eax
jl 0x2ef72
movq %r10, -0x60(%rsp)
movl %eax, %eax
movq %rax, -0x20(%rsp)
movl $0x1, %ecx
movl $0x2, %eax
movq %rax, -0x50(%rsp)
leaq 0x3af825(%rip), %rax    # 0x3de7d0
movq %rcx, -0x38(%rsp)
movswq (%rax,%rcx,2), %rcx
movl (%r11,%rcx,4), %eax
movl %eax, -0x54(%rsp)
leaq 0x3dc03c(%rip), %rax    # 0x40b000
movq %rcx, -0x48(%rsp)
movl (%rax,%rcx,4), %eax
movl %eax, -0x58(%rsp)
xorl %r14d, %r14d
leaq 0x23ba96(%rip), %rax    # 0x26aa70
movq -0x48(%rsp), %rcx
movslq (%rax,%rcx,4), %r8
leaq 0x3af7e6(%rip), %rcx    # 0x3de7d0
movswq (%r14,%rcx), %rbp
movslq (%rax,%rbp,4), %r12
leaq 0x3d8006(%rip), %rcx    # 0x407000
movl (%rcx,%r8,4), %eax
movl %eax, -0x68(%rsp)
movl -0x54(%rsp), %r15d
movl %r15d, %r10d
subl %eax, %r10d
movl %r10d, %eax
negl %eax
cmovsl %r10d, %eax
leaq 0x3dbfe3(%rip), %rdi    # 0x40b000
movq %r8, -0x28(%rsp)
movl (%rdi,%r8,4), %esi
movl -0x58(%rsp), %ebx
movl %ebx, %r10d
subl %esi, %r10d
movl %r10d, %r11d
negl %r11d
cmovsl %r10d, %r11d
movl (%rcx,%rbp,4), %r10d
movl (%rcx,%r12,4), %ecx
movl %r10d, %r13d
subl %ecx, %r13d
movl %r13d, %edx
negl %edx
cmovsl %r13d, %edx
movl (%rdi,%rbp,4), %r9d
movq %r12, -0x30(%rsp)
movl (%rdi,%r12,4), %edi
movl %r9d, %r8d
subl %edi, %r8d
movl %r8d, %r13d
negl %r13d
cmovsl %r8d, %r13d
addl %eax, %r11d
addl %edx, %r11d
addl %r13d, %r11d
subl %ecx, %r15d
movl %r15d, %ecx
negl %ecx
cmovsl %r15d, %ecx
subl %edi, %ebx
movl %ebx, %edx
negl %edx
cmovsl %ebx, %edx
subl -0x68(%rsp), %r10d
movl %r10d, %eax
negl %eax
cmovsl %r10d, %eax
subl %esi, %r9d
movl %r9d, %esi
negl %esi
cmovsl %r9d, %esi
addl %eax, %esi
addl %ecx, %esi
addl %edx, %esi
cmpl %r11d, %esi
leaq 0x23b9ba(%rip), %rax    # 0x26aa70
jae 0x2f0cd
movq -0x48(%rsp), %rcx
movq -0x30(%rsp), %rdx
movl %edx, (%rax,%rcx,4)
movq -0x28(%rsp), %rcx
movl %ecx, (%rax,%rbp,4)
addq $0x2, %r14
cmpq %r14, -0x50(%rsp)
jne 0x2efda
movq -0x38(%rsp), %rcx
incq %rcx
addq $0x2, -0x50(%rsp)
cmpq -0x20(%rsp), %rcx
leaq 0x3d7f0a(%rip), %r11    # 0x407000
jne 0x2efa4
movq -0x60(%rsp), %r10
jmp 0x2ef72