// File: /workspace/github_c_makefile_star2_O2/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, %r13d
movl 0x3d503d(%rip), %edx    # 0x400fe0
movl 0x3d503b(%rip), %eax    # 0x400fe4
movl %eax, -0x20(%rsp)
testb $0xa, %sil
je 0x2c5eb
movl %esi, -0x4(%rsp)
movl %edx, -0x10(%rsp)
movl 0x39edab(%rip), %ecx    # 0x3cad70
movl 0x3a0bb5(%rip), %eax    # 0x3ccb80
shll $0xc, %ecx
shll $0xc, %eax
movl %eax, -0x40(%rsp)
movabsq $0x2, %rax
movq %rax, -0x48(%rsp)
movslq %r13d, %rax
movq %rax, -0x60(%rsp)
movl %ecx, %r13d
xorl %ebp, %ebp
leaq 0x3d5008(%rip), %rcx    # 0x401000
leaq 0x238a71(%rip), %rdx    # 0x264a70
leaq 0x23ca7a(%rip), %r12    # 0x268a80
xorl %r9d, %r9d
movl $0x0, -0x68(%rsp)
leaq 0x468ef8(%rip), %rdi    # 0x494f10
movl %ebp, %eax
movl %r13d, %r8d
subl (%rcx,%rax,4), %r8d
movslq %ebp, %rax
movl (%rdx,%rax,4), %eax
movq %r9, -0x58(%rsp)
movslq %ebp, %r10
movl %eax, %ebp
orl $-0x1, (%rdx,%r10,4)
leaq 0x3d4fc3(%rip), %rdx    # 0x401000
testl %r8d, %r8d
jns 0x2c070
movl (%rdx,%r10,4), %eax
movslq %r9d, %rcx
leaq 0x468ec0(%rip), %rsi    # 0x494f10
movl %eax, (%rsi,%rcx,4)
leaq 0x3d8fa6(%rip), %rax    # 0x405000
movl (%rax,%r10,4), %eax
leaq 0x46ceab(%rip), %rsi    # 0x498f10
movl %eax, (%rsi,%rcx,4)
leal 0x1(%rcx), %r9d
movl %r9d, (%r12,%rcx,4)
movslq %ebp, %r14
movl (%rdx,%r14,4), %eax
movl %r13d, %esi
subl %eax, %esi
movl %esi, %ecx
xorl %r8d, %ecx
jns 0x2c0f9
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 0x3d8f53(%rip), %rax    # 0x405000
movslq (%rax,%r10,4), %r10
movslq (%rax,%r14,4), %rax
subq %r10, %rax
imulq %rbx, %rax
cqto
idivq %r15
addl %r10d, %eax
movslq %r9d, %rdx
movl %ecx, (%rdi,%rdx,4)
leaq 0x46ce3f(%rip), %rcx    # 0x498f10
movl %eax, (%rcx,%rdx,4)
testl %r8d, %r8d
jns 0x2c0f2
movl -0x68(%rsp), %ecx
movslq %ecx, %rax
incl %ecx
movl %ecx, -0x68(%rsp)
leaq 0x3ac6e3(%rip), %rcx    # 0x3d87d0
movw %r9w, (%rcx,%rax,2)
incl %r9d
movl %r9d, (%r12,%rdx,4)
leaq 0x238970(%rip), %rdx    # 0x264a70
movl (%rdx,%r14,4), %eax
movl %esi, %r8d
testl %eax, %eax
jns 0x2c02c
movq -0x58(%rsp), %rcx
leal 0x3(%rcx), %eax
cmpl %eax, %r9d
jl 0x2c129
leal -0x1(%r9), %eax
movl %ecx, (%r12,%rax,4)
movq %r9, -0x58(%rsp)
movq -0x60(%rsp), %rcx
movabsq $0x1, %rbp
leaq 0x46cdd1(%rip), %rsi    # 0x498f10
cmpq %rcx, %rbp
jge 0x2c16e
leaq 0x238925(%rip), %rax    # 0x264a70
cmpl $0x0, (%rax,%rbp,4)
jns 0x2c156
incq %rbp
jmp 0x2c13f
leaq 0x3d4ea3(%rip), %rcx    # 0x401000
leaq 0x23890c(%rip), %rdx    # 0x264a70
movq -0x58(%rsp), %r9
jmp 0x2c018
cmpl $0x3, -0x58(%rsp)
jl 0x2ca98
movslq -0x68(%rsp), %rax
movq %rax, -0x18(%rsp)
movabsq $0x1, %rcx
cmpq -0x18(%rsp), %rcx
jge 0x2c2de
leaq 0x3ac631(%rip), %rax    # 0x3d87d0
movq %rcx, -0x50(%rsp)
movswq (%rax,%rcx,2), %rcx
leaq 0x468d60(%rip), %rax    # 0x494f10
movl (%rax,%rcx,4), %eax
movl %eax, -0x28(%rsp)
movq %rcx, -0x60(%rsp)
movl (%rsi,%rcx,4), %eax
movl %eax, -0x38(%rsp)
xorl %ecx, %ecx
cmpq %rcx, -0x48(%rsp)
je 0x2c2cb
movq -0x60(%rsp), %rax
movslq (%r12,%rax,4), %rdi
leaq 0x3ac5f0(%rip), %rax    # 0x3d87d0
movq %rcx, -0x68(%rsp)
movswq (%rcx,%rax), %rax
movslq (%r12,%rax,4), %rcx
leaq 0x468d1b(%rip), %rdx    # 0x494f10
movl (%rdx,%rdi,4), %ebx
movl -0x28(%rsp), %ebp
movl %ebp, %r10d
subl %ebx, %r10d
movl %r10d, %r12d
negl %r12d
cmovsl %r10d, %r12d
movq %rdi, -0x30(%rsp)
movl (%rsi,%rdi,4), %r10d
movl -0x38(%rsp), %r9d
movl %r9d, %r11d
subl %r10d, %r11d
movl %r11d, %r14d
negl %r14d
cmovsl %r11d, %r14d
movl (%rdx,%rax,4), %r11d
movl (%rdx,%rcx,4), %r13d
movl %r11d, %r15d
subl %r13d, %r15d
movl %r15d, %edi
negl %edi
cmovsl %r15d, %edi
movl (%rsi,%rax,4), %r8d
movl (%rsi,%rcx,4), %edx
movl %r8d, %esi
subl %edx, %esi
movl %esi, %r15d
negl %r15d
cmovsl %esi, %r15d
addl %r12d, %r14d
leaq 0x23c81f(%rip), %r12    # 0x268a80
addl %edi, %r14d
addl %r15d, %r14d
subl %r13d, %ebp
movl %ebp, %edi
negl %edi
cmovsl %ebp, %edi
subl %edx, %r9d
movl %r9d, %edx
negl %edx
cmovsl %r9d, %edx
subl %ebx, %r11d
movl %r11d, %esi
negl %esi
cmovsl %r11d, %esi
subl %r10d, %r8d
movl %r8d, %r10d
negl %r10d
cmovsl %r8d, %r10d
addl %esi, %r10d
addl %edi, %r10d
addl %edx, %r10d
cmpl %r14d, %r10d
jae 0x2c2b6
movq -0x60(%rsp), %rdx
movl %ecx, (%r12,%rdx,4)
movq -0x30(%rsp), %rcx
movl %ecx, (%r12,%rax,4)
movq -0x68(%rsp), %rcx
addq $0x2, %rcx
leaq 0x46cc4a(%rip), %rsi    # 0x498f10
jmp 0x2c1c5
movq -0x50(%rsp), %rcx
incq %rcx
addq $0x2, -0x48(%rsp)
jmp 0x2c18d
movl -0x58(%rsp), %eax
movq %rax, -0x60(%rsp)
xorl %r13d, %r13d
xorl %r9d, %r9d
movl $0x0, -0x68(%rsp)
movl %r9d, %eax
movl -0x40(%rsp), %r8d
leaq 0x46cc0c(%rip), %rcx    # 0x498f10
subl (%rcx,%rax,4), %r8d
movslq %r9d, %rax
movl (%r12,%rax,4), %eax
movl %r13d, %ebp
movslq %r9d, %rbx
movl %eax, %r9d
orl $-0x1, (%r12,%rbx,4)
testl %r8d, %r8d
js 0x2c32b
leaq 0x46cbe7(%rip), %rsi    # 0x498f10
jmp 0x2c363
leaq 0x468bde(%rip), %rax    # 0x494f10
movl (%rax,%rbx,4), %eax
movslq %ebp, %rcx
leaq 0x3d4cc1(%rip), %rdx    # 0x401000
movl %eax, (%rdx,%rcx,4)
leaq 0x46cbc7(%rip), %rsi    # 0x498f10
movl (%rsi,%rbx,4), %eax
leaq 0x3d8cad(%rip), %rdx    # 0x405000
movl %eax, (%rdx,%rcx,4)
leal 0x1(%rcx), %ebp
leaq 0x238710(%rip), %rax    # 0x264a70
movl %ebp, (%rax,%rcx,4)
movslq %r9d, %r14
movl (%rsi,%r14,4), %r10d
movl -0x40(%rsp), %edi
subl %r10d, %edi
movl %edi, %eax
xorl %r8d, %eax
jns 0x2c406
leaq 0x468b8d(%rip), %rax    # 0x494f10
movslq (%rax,%rbx,4), %r11
movslq (%rax,%r14,4), %rax
subq %r11, %rax
movl %r8d, %ecx
subl %edi, %ecx
movslq %r8d, %r15
imulq %r15, %rax
movslq %ecx, %r12
cqto
idivq %r12
movq %rax, %rcx
addl %r11d, %ecx
movl (%rsi,%rbx,4), %r11d
subl %r11d, %r10d
movslq %r10d, %rax
imulq %r15, %rax
cqto
idivq %r12
addl %r11d, %eax
movslq %ebp, %rdx
leaq 0x3d4c38(%rip), %r10    # 0x401000
movl %ecx, (%r10,%rdx,4)
leaq 0x3d8c2d(%rip), %rcx    # 0x405000
movl %eax, (%rcx,%rdx,4)
testl %r8d, %r8d
jns 0x2c3f3
movl -0x68(%rsp), %ecx
movslq %ecx, %rax
incl %ecx
movl %ecx, -0x68(%rsp)
leaq 0x3ac3e1(%rip), %rcx    # 0x3d87d0
movw %bp, (%rcx,%rax,2)
leaq 0x23c686(%rip), %r12    # 0x268a80
incl %ebp
leaq 0x23866d(%rip), %rax    # 0x264a70
movl %ebp, (%rax,%rdx,4)
movl (%r12,%r14,4), %eax
movl %edi, %r8d
testl %eax, %eax
jns 0x2c312
leal 0x3(%r13), %eax
cmpl %eax, %ebp
jl 0x2c42e
leal -0x1(%rbp), %eax
leaq 0x238649(%rip), %rcx    # 0x264a70
movl %r13d, (%rcx,%rax,4)
movl %ebp, %r13d
leaq 0x3d4bcb(%rip), %rcx    # 0x401000
movq -0x60(%rsp), %rdx
movabsq $0x1, %r9
leaq 0x238625(%rip), %rax    # 0x264a70
cmpq %r9, %rdx
je 0x2c460
cmpl $0x0, (%r12,%r9,4)
jns 0x2c2f5
incq %r9
jmp 0x2c44b
cmpl $0x3, %r13d
jl 0x2ca98
movslq -0x68(%rsp), %rdx
movq %rdx, -0x18(%rsp)
movabsq $0x1, %rsi
movabsq $0x2, %rdx
movq %rdx, -0x48(%rsp)
movq %r13, -0x50(%rsp)
cmpq -0x18(%rsp), %rsi
jge 0x2c5e3
leaq 0x3ac32c(%rip), %rdx    # 0x3d87d0
movq %rsi, -0x40(%rsp)
movswq (%rdx,%rsi,2), %rsi
movl (%rcx,%rsi,4), %edx
movl %edx, -0x28(%rsp)
leaq 0x3d8b44(%rip), %rdx    # 0x405000
movq %rsi, -0x60(%rsp)
movl (%rdx,%rsi,4), %edx
movl %edx, -0x38(%rsp)
xorl %esi, %esi
cmpq %rsi, -0x48(%rsp)
je 0x2c5cb
movq -0x60(%rsp), %rdx
movslq (%rax,%rdx,4), %rdi
leaq 0x3ac2eb(%rip), %rdx    # 0x3d87d0
movq %rsi, -0x68(%rsp)
movswq (%rsi,%rdx), %r12
movslq (%rax,%r12,4), %r13
movl (%rcx,%rdi,4), %r14d
movl -0x28(%rsp), %r15d
movl %r15d, %r10d
subl %r14d, %r10d
movl %r10d, %eax
negl %eax
cmovsl %r10d, %eax
leaq 0x3d8aee(%rip), %rsi    # 0x405000
movq %rdi, -0x30(%rsp)
movl (%rsi,%rdi,4), %ebx
movl -0x38(%rsp), %r9d
movl %r9d, %r10d
subl %ebx, %r10d
movl %r10d, %ebp
negl %ebp
cmovsl %r10d, %ebp
movl (%rcx,%r12,4), %r10d
movl (%rcx,%r13,4), %ecx
movl %r10d, %r11d
subl %ecx, %r11d
movl %r11d, %edx
negl %edx
cmovsl %r11d, %edx
movl (%rsi,%r12,4), %r8d
movl (%rsi,%r13,4), %esi
movl %r8d, %edi
subl %esi, %edi
movl %edi, %r11d
negl %r11d
cmovsl %edi, %r11d
addl %eax, %ebp
addl %edx, %ebp
addl %r11d, %ebp
subl %ecx, %r15d
movl %r15d, %ecx
negl %ecx
cmovsl %r15d, %ecx
subl %esi, %r9d
movl %r9d, %edx
negl %edx
cmovsl %r9d, %edx
subl %r14d, %r10d
movl %r10d, %eax
negl %eax
cmovsl %r10d, %eax
subl %ebx, %r8d
movl %r8d, %esi
negl %esi
cmovsl %r8d, %esi
addl %eax, %esi
addl %ecx, %esi
addl %edx, %esi
cmpl %ebp, %esi
leaq 0x2384ce(%rip), %rax    # 0x264a70
jae 0x2c5b6
movq -0x60(%rsp), %rcx
movl %r13d, (%rax,%rcx,4)
movq -0x30(%rsp), %rcx
movl %ecx, (%rax,%r12,4)
movq -0x68(%rsp), %rsi
addq $0x2, %rsi
leaq 0x3d4a3a(%rip), %rcx    # 0x401000
jmp 0x2c4ca
movq -0x40(%rsp), %rsi
incq %rsi
addq $0x2, -0x48(%rsp)
movq -0x50(%rsp), %r13
jmp 0x2c492
movl -0x10(%rsp), %edx
movl -0x4(%rsp), %esi
testb $0x5, %sil
je 0x2ca9b
shll $0xc, %edx
movl $0x1000, %eax           # imm = 0x1000
addl %eax, %edx
movl -0x20(%rsp), %ecx
shll $0xc, %ecx
addl %eax, %ecx
movl %ecx, -0x20(%rsp)
movslq %r13d, %r15
xorl %r13d, %r13d
leaq 0x3d49e7(%rip), %rcx    # 0x401000
leaq 0x238450(%rip), %r10    # 0x264a70
leaq 0x23c459(%rip), %r12    # 0x268a80
xorl %edi, %edi
movl $0x0, -0x68(%rsp)
movl %r13d, %eax
movl (%rcx,%rax,4), %r9d
movl %edx, %r14d
subl %edx, %r9d
movslq %r13d, %rax
movl (%r10,%rax,4), %eax
movq %rdi, -0x58(%rsp)
movslq %r13d, %rsi
movl %eax, %r13d
orl $-0x1, (%r10,%rsi,4)
leaq 0x3d49a4(%rip), %rdx    # 0x401000
testl %r9d, %r9d
jns 0x2c68c
movl (%rdx,%rsi,4), %eax
movslq %edi, %rcx
leaq 0x4688a2(%rip), %rdi    # 0x494f10
movl %eax, (%rdi,%rcx,4)
leaq 0x3d8988(%rip), %rax    # 0x405000
movl (%rax,%rsi,4), %eax
leaq 0x46c88e(%rip), %rdi    # 0x498f10
movl %eax, (%rdi,%rcx,4)
leal 0x1(%rcx), %edi
movl %edi, (%r12,%rcx,4)
movslq %r13d, %r8
movl (%rdx,%r8,4), %eax
movl %eax, %ebp
subl %r14d, %ebp
movl %ebp, %ecx
xorl %r9d, %ecx
jns 0x2c724
movl (%rdx,%rsi,4), %r10d
subl %r10d, %eax
movl %r9d, %ecx
subl %ebp, %ecx
cltq
movslq %r9d, %r11
imulq %r11, %rax
movslq %ecx, %rbx
cqto
idivq %rbx
movq %rax, %rcx
addl %r10d, %ecx
leaq 0x3d8933(%rip), %rax    # 0x405000
movslq (%rax,%rsi,4), %rsi
movslq (%rax,%r8,4), %rax
subq %rsi, %rax
imulq %r11, %rax
cqto
idivq %rbx
addl %esi, %eax
movslq %edi, %rdx
leaq 0x468823(%rip), %rsi    # 0x494f10
movl %ecx, (%rsi,%rdx,4)
leaq 0x46c819(%rip), %rcx    # 0x498f10
movl %eax, (%rcx,%rdx,4)
testl %r9d, %r9d
jns 0x2c717
movl -0x68(%rsp), %ecx
movslq %ecx, %rax
incl %ecx
movl %ecx, -0x68(%rsp)
leaq 0x3ac0bd(%rip), %rcx    # 0x3d87d0
movw %di, (%rcx,%rax,2)
leaq 0x238352(%rip), %r10    # 0x264a70
incl %edi
movl %edi, (%r12,%rdx,4)
movl (%r10,%r8,4), %eax
movl %ebp, %r9d
testl %eax, %eax
jns 0x2c64a
movq -0x58(%rsp), %rcx
leal 0x3(%rcx), %eax
cmpl %eax, %edi
jl 0x2c74b
leal -0x1(%rdi), %eax
movl %ecx, (%r12,%rax,4)
movq %rdi, -0x58(%rsp)
movabsq $0x1, %r13
cmpq %r15, %r13
jge 0x2c77a
cmpl $0x0, (%r10,%r13,4)
jns 0x2c766
incq %r13
jmp 0x2c755
movl %r14d, %edx
leaq 0x3d4890(%rip), %rcx    # 0x401000
movq -0x58(%rsp), %rdi
jmp 0x2c631
movq -0x58(%rsp), %rax
cmpl $0x3, %eax
jl 0x2ca98
movslq -0x68(%rsp), %rcx
movq %rcx, -0x10(%rsp)
movabsq $0x1, %rdx
movabsq $0x2, %rcx
movq %rcx, -0x38(%rsp)
cmpq -0x10(%rsp), %rdx
leaq 0x46c759(%rip), %rcx    # 0x498f10
jge 0x2c916
leaq 0x3ac00c(%rip), %rax    # 0x3d87d0
movq %rdx, -0x18(%rsp)
movswq (%rax,%rdx,2), %rdx
leaq 0x46873b(%rip), %rax    # 0x494f10
movl (%rax,%rdx,4), %eax
movl %eax, -0x50(%rsp)
movq %rdx, -0x30(%rsp)
movl (%rcx,%rdx,4), %eax
movl %eax, -0x40(%rsp)
xorl %ecx, %ecx
cmpq %rcx, -0x38(%rsp)
je 0x2c8fe
movq -0x30(%rsp), %rax
movslq (%r12,%rax,4), %r8
leaq 0x3abfcb(%rip), %rax    # 0x3d87d0
movq %rcx, -0x68(%rsp)
movswq (%rcx,%rax), %r11
movslq (%r12,%r11,4), %rax
leaq 0x4686f6(%rip), %rdx    # 0x494f10
movl (%rdx,%r8,4), %ecx
movl %ecx, -0x60(%rsp)
movl -0x50(%rsp), %r13d
movl %r13d, %esi
subl %ecx, %esi
movl %esi, %r15d
negl %r15d
cmovsl %esi, %r15d
leaq 0x46c6d3(%rip), %rdi    # 0x498f10
movq %r8, -0x48(%rsp)
movl (%rdi,%r8,4), %esi
movl -0x40(%rsp), %ecx
movl %ecx, %r10d
subl %esi, %r10d
movl %r10d, %ebx
negl %ebx
cmovsl %r10d, %ebx
movl (%rdx,%r11,4), %r10d
movq %r12, %r9
movl (%rdx,%rax,4), %r12d
movl %r10d, %r14d
subl %r12d, %r14d
movl %r14d, %edx
negl %edx
cmovsl %r14d, %edx
movl (%rdi,%r11,4), %ebp
movq %rax, -0x28(%rsp)
movl (%rdi,%rax,4), %edi
movl %ebp, %r8d
subl %edi, %r8d
movl %r8d, %r14d
negl %r14d
cmovsl %r8d, %r14d
addl %r15d, %ebx
addl %edx, %ebx
addl %r14d, %ebx
subl %r12d, %r13d
movq %r9, %r12
movl %r13d, %r8d
negl %r8d
cmovsl %r13d, %r8d
subl %edi, %ecx
movl %ecx, %edi
negl %edi
cmovsl %ecx, %edi
subl -0x60(%rsp), %r10d
movl %r10d, %edx
negl %edx
cmovsl %r10d, %edx
subl %esi, %ebp
movl %ebp, %esi
negl %esi
cmovsl %ebp, %esi
addl %edx, %esi
addl %r8d, %esi
addl %edi, %esi
cmpl %ebx, %esi
jae 0x2c8e9
movq -0x30(%rsp), %rdx
movq -0x28(%rsp), %rcx
movl %ecx, (%r12,%rdx,4)
movq -0x48(%rsp), %rcx
movl %ecx, (%r12,%r11,4)
movq -0x68(%rsp), %rcx
addq $0x2, %rcx
leaq 0x238177(%rip), %r10    # 0x264a70
jmp 0x2c7ea
movq -0x18(%rsp), %rdx
incq %rdx
addq $0x2, -0x38(%rsp)
movq -0x58(%rsp), %rax
jmp 0x2c7ab
movl %eax, %eax
movq %rax, -0x60(%rsp)
xorl %ebp, %ebp
xorl %r13d, %r13d
movl $0x0, -0x68(%rsp)
movl %r13d, %eax
leaq 0x46c5dc(%rip), %rcx    # 0x498f10
movl (%rcx,%rax,4), %r9d
subl -0x20(%rsp), %r9d
movslq %r13d, %rax
movl (%r12,%rax,4), %eax
movq %rbp, -0x50(%rsp)
movslq %r13d, %r11
movl %eax, %r13d
orl $-0x1, (%r12,%r11,4)
testl %r9d, %r9d
js 0x2c962
leaq 0x46c5b0(%rip), %r15    # 0x498f10
jmp 0x2c996
leaq 0x4685a7(%rip), %rax    # 0x494f10
movl (%rax,%r11,4), %eax
movslq %ebp, %rcx
leaq 0x3d4689(%rip), %rdx    # 0x401000
movl %eax, (%rdx,%rcx,4)
leaq 0x46c58f(%rip), %r15    # 0x498f10
movl (%r15,%r11,4), %eax
leaq 0x3d8674(%rip), %rdx    # 0x405000
movl %eax, (%rdx,%rcx,4)
leal 0x1(%rcx), %ebp
movl %ebp, (%r10,%rcx,4)
movslq %r13d, %rdi
movl (%r15,%rdi,4), %esi
movl %esi, %r8d
subl -0x20(%rsp), %r8d
movl %r8d, %eax
xorl %r9d, %eax
jns 0x2ca35
leaq 0x468558(%rip), %rax    # 0x494f10
movslq (%rax,%r11,4), %r10
movslq (%rax,%rdi,4), %rax
subq %r10, %rax
movl %r9d, %ecx
subl %r8d, %ecx
movslq %r9d, %rbx
imulq %rbx, %rax
movslq %ecx, %r14
cqto
idivq %r14
movq %rax, %rcx
addl %r10d, %ecx
movl (%r15,%r11,4), %r10d
subl %r10d, %esi
movslq %esi, %rax
imulq %rbx, %rax
cqto
idivq %r14
addl %r10d, %eax
movslq %ebp, %rdx
leaq 0x3d4602(%rip), %rsi    # 0x401000
movl %ecx, (%rsi,%rdx,4)
leaq 0x3d85f8(%rip), %rcx    # 0x405000
movl %eax, (%rcx,%rdx,4)
testl %r9d, %r9d
jns 0x2ca28
movl -0x68(%rsp), %ecx
movslq %ecx, %rax
incl %ecx
movl %ecx, -0x68(%rsp)
leaq 0x3abdac(%rip), %rcx    # 0x3d87d0
movw %bp, (%rcx,%rax,2)
leaq 0x238041(%rip), %r10    # 0x264a70
incl %ebp
movl %ebp, (%r10,%rdx,4)
movl (%r12,%rdi,4), %eax
movl %r8d, %r9d
testl %eax, %eax
jns 0x2c949
movq -0x50(%rsp), %rcx
leal 0x3(%rcx), %eax
cmpl %eax, %ebp
jl 0x2ca5c
leal -0x1(%rbp), %eax
movl %ecx, (%r10,%rax,4)
movq %rbp, -0x50(%rsp)
leaq 0x3d459d(%rip), %rax    # 0x401000
movq -0x60(%rsp), %rcx
movabsq $0x1, %r13
cmpq %r13, %rcx
je 0x2ca8d
cmpl $0x0, (%r12,%r13,4)
jns 0x2ca83
incq %r13
jmp 0x2ca72
movq -0x50(%rsp), %rbp
jmp 0x2c92a
movq -0x50(%rsp), %r13
cmpl $0x3, %r13d
jge 0x2caa9
xorl %r13d, %r13d
movl %r13d, %eax
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movslq -0x68(%rsp), %rcx
movq %rcx, -0x20(%rsp)
movabsq $0x1, %rdx
movabsq $0x2, %rcx
movq %rcx, -0x48(%rsp)
cmpq -0x20(%rsp), %rdx
jge 0x2ca9b
leaq 0x3abcf6(%rip), %rcx    # 0x3d87d0
movq %rdx, -0x40(%rsp)
movswq (%rcx,%rdx,2), %rdx
movl (%rax,%rdx,4), %ecx
movl %ecx, -0x28(%rsp)
leaq 0x3d850e(%rip), %rcx    # 0x405000
movq %rdx, -0x60(%rsp)
movl (%rcx,%rdx,4), %ecx
movl %ecx, -0x38(%rsp)
xorl %edx, %edx
cmpq %rdx, -0x48(%rsp)
je 0x2cc03
movq -0x60(%rsp), %rcx
movslq (%r10,%rcx,4), %r8
leaq 0x3abcb5(%rip), %rcx    # 0x3d87d0
movq %rdx, -0x68(%rsp)
movswq (%rdx,%rcx), %r12
movslq (%r10,%r12,4), %r13
movl (%rax,%r8,4), %ebx
movl -0x28(%rsp), %r15d
movl %r15d, %esi
subl %ebx, %esi
movq %rax, %rcx
movl %esi, %eax
negl %eax
cmovsl %esi, %eax
leaq 0x3d84b8(%rip), %rdi    # 0x405000
movq %r8, -0x30(%rsp)
movl (%rdi,%r8,4), %r11d
movl -0x38(%rsp), %r14d
movl %r14d, %esi
subl %r11d, %esi
movl %esi, %ebp
negl %ebp
cmovsl %esi, %ebp
movl (%rcx,%r12,4), %esi
movl (%rcx,%r13,4), %ecx
movl %esi, %r10d
subl %ecx, %r10d
movl %r10d, %edx
negl %edx
cmovsl %r10d, %edx
movl (%rdi,%r12,4), %r9d
movl (%rdi,%r13,4), %edi
movl %r9d, %r8d
subl %edi, %r8d
movl %r8d, %r10d
negl %r10d
cmovsl %r8d, %r10d
addl %eax, %ebp
addl %edx, %ebp
addl %r10d, %ebp
leaq 0x237ed0(%rip), %r10    # 0x264a70
subl %ecx, %r15d
movl %r15d, %ecx
negl %ecx
cmovsl %r15d, %ecx
subl %edi, %r14d
movl %r14d, %edx
negl %edx
cmovsl %r14d, %edx
subl %ebx, %esi
movl %esi, %eax
negl %eax
cmovsl %esi, %eax
subl %r11d, %r9d
movl %r9d, %esi
negl %esi
cmovsl %r9d, %esi
addl %eax, %esi
addl %ecx, %esi
addl %edx, %esi
cmpl %ebp, %esi
jae 0x2cbe9
movq -0x60(%rsp), %rax
movl %r13d, (%r10,%rax,4)
movq -0x30(%rsp), %rax
movl %eax, (%r10,%r12,4)
movq -0x68(%rsp), %rdx
addq $0x2, %rdx
movq -0x50(%rsp), %r13
leaq 0x3d4402(%rip), %rax    # 0x401000
jmp 0x2cb00
movq -0x40(%rsp), %rdx
incq %rdx
addq $0x2, -0x48(%rsp)
jmp 0x2cacc