// File: /workspace/github_c_makefile_star2_O2/jonof[P]jftekwar/jfbuild/src/build.c
// Function: draw2dscreen
void draw2dscreen(int posxe, int posye, short ange, int zoome, short gride)
{
	walltype *wal;
	int i, j, xp1, yp1, xp2, yp2;
	intptr_t templong;
	unsigned char col;

	if (qsetmode == 200) return;

	if (editstatus == 0)
	{
		faketimerhandler();
		clear2dscreen();

		faketimerhandler();
		draw2dgrid(posxe,posye,ange,zoome,gride);
	}

	faketimerhandler();
	for(i=numwalls-1,wal=&wall[i];i>=0;i--,wal--)
	{
		if (editstatus == 0)
		{
			if ((show2dwall[i>>3]&pow2char[i&7]) == 0) continue;
			j = wal->nextwall;
			if ((j >= 0) && (i > j))
				if ((show2dwall[j>>3]&pow2char[j&7]) > 0) continue;
		}
		else
		{
			j = wal->nextwall;
			if ((j >= 0) && (i > j)) continue;
		}

		if (j < 0)
		{
			col = 7;
			if (i == linehighlight) if (totalclock & 8) col += (2<<2);
		}
		else
		{
			col = 4;
			if ((wal->cstat&1) != 0) col = 5;
			if ((i == linehighlight) || ((linehighlight >= 0) && (i == wall[linehighlight].nextwall)))
				if (totalclock & 8) col += (2<<2);
		}

		xp1 = mulscale14(wal->x-posxe,zoome);
		yp1 = mulscale14(wal->y-posye,zoome);
		xp2 = mulscale14(wall[wal->point2].x-posxe,zoome);
		yp2 = mulscale14(wall[wal->point2].y-posye,zoome);

		if ((wal->cstat&64) > 0)
		{
			if (klabs(xp2-xp1) >= klabs(yp2-yp1))
			{
				drawline16(halfxdim16+xp1,midydim16+yp1+1,halfxdim16+xp2,midydim16+yp2+1,col);
				drawline16(halfxdim16+xp1,midydim16+yp1-1,halfxdim16+xp2,midydim16+yp2-1,col);
			}
			else
			{
				drawline16(halfxdim16+xp1+1,midydim16+yp1,halfxdim16+xp2+1,midydim16+yp2,col);
				drawline16(halfxdim16+xp1-1,midydim16+yp1,halfxdim16+xp2-1,midydim16+yp2,col);
			}
			col += 8;
		}
		drawline16(halfxdim16+xp1,midydim16+yp1,halfxdim16+xp2,midydim16+yp2,col);

		if ((zoome >= 256) && (editstatus == 1))
			if (((halfxdim16+xp1) >= 2) && ((halfxdim16+xp1) <= xdim-3))
				if (((midydim16+yp1) >= 2) && ((midydim16+yp1) <= ydim16-3))
				{
					col = 2;
					if (i == pointhighlight) {
						if (totalclock & 8) col += (2<<2);
					}
					else if ((highlightcnt > 0) && (editstatus == 1))
					{
						if (show2dwall[i>>3]&pow2char[i&7])
							if (totalclock & 8) col += (2<<2);
					}

					templong = ((midydim16+yp1)*bytesperline)+(halfxdim16+xp1)+frameplace;
					drawpixel((void *)(templong-2-(bytesperline<<1)), col);
					drawpixel((void *)(templong-1-(bytesperline<<1)), col);
					drawpixel((void *)(templong+0-(bytesperline<<1)), col);
					drawpixel((void *)(templong+1-(bytesperline<<1)), col);
					drawpixel((void *)(templong+2-(bytesperline<<1)), col);

					drawpixel((void *)(templong-2+(bytesperline<<1)), col);
					drawpixel((void *)(templong-1+(bytesperline<<1)), col);
					drawpixel((void *)(templong+0+(bytesperline<<1)), col);
					drawpixel((void *)(templong+1+(bytesperline<<1)), col);
					drawpixel((void *)(templong+2+(bytesperline<<1)), col);

					drawpixel((void *)(templong-2-bytesperline), col);
					drawpixel((void *)(templong-2+0), col);
					drawpixel((void *)(templong-2+bytesperline), col);

					drawpixel((void *)(templong+2-bytesperline), col);
					drawpixel((void *)(templong+2+0), col);
					drawpixel((void *)(templong+2+bytesperline), col);
				}
	}
	faketimerhandler();

	if ((zoome >= 256) || (editstatus == 0))
		for(i=0;i<numsectors;i++)
			for(j=headspritesect[i];j>=0;j=nextspritesect[j])
				if ((editstatus == 1) || (show2dsprite[j>>3]&pow2char[j&7]))
				{
					col = 3;
					if ((sprite[j].cstat&1) > 0) col = 5;
					if (editstatus == 1)
					{
						if (j+16384 == pointhighlight) {
							if (totalclock & 8) col += (2<<2);
						}
						else if ((highlightcnt > 0) && (editstatus == 1))
						{
							if (show2dsprite[j>>3]&pow2char[j&7])
								if (totalclock & 8) col += (2<<2);
						}
					}

					xp1 = mulscale14(sprite[j].x-posxe,zoome);
					yp1 = mulscale14(sprite[j].y-posye,zoome);
					if (((halfxdim16+xp1) >= 2) && ((halfxdim16+xp1) <= xdim-3))
						if (((midydim16+yp1) >= 2) && ((midydim16+yp1) <= ydim16-3))
						{
							templong = ((midydim16+yp1)*bytesperline)+(halfxdim16+xp1)+frameplace;
							drawpixel((void *)(templong-1-(bytesperline<<1)), col);
							drawpixel((void *)(templong+0-(bytesperline<<1)), col);
							drawpixel((void *)(templong+1-(bytesperline<<1)), col);

							drawpixel((void *)(templong-1+(bytesperline<<1)), col);
							drawpixel((void *)(templong+0+(bytesperline<<1)), col);
							drawpixel((void *)(templong+1+(bytesperline<<1)), col);

							drawpixel((void *)(templong-2-bytesperline), col);
							drawpixel((void *)(templong-2+0), col);
							drawpixel((void *)(templong-2+bytesperline), col);

							drawpixel((void *)(templong+2-bytesperline), col);
							drawpixel((void *)(templong+2+0), col);
							drawpixel((void *)(templong+2+bytesperline), col);

							drawpixel((void *)(templong+1+bytesperline), col);
							drawpixel((void *)(templong-1+bytesperline), col);
							drawpixel((void *)(templong+1-bytesperline), col);
							drawpixel((void *)(templong-1-bytesperline), col);

							if (showspriteextents && (sprite[j].cstat&(32|16))) {
								int np, p;
								int xoff, yoff, dax, day;
								int rxi[4], ryi[4];
								int clipx[4] = {0}, clipy[4] = {0};

								int tilenum = sprite[j].picnum;
								int ang = sprite[j].ang;
								int xrepeat = sprite[j].xrepeat, yrepeat = sprite[j].yrepeat;

								xoff = (int)((signed char)((picanm[tilenum]>>8)&255))+((int)sprite[j].xoffset);
								yoff = (int)((signed char)((picanm[tilenum]>>16)&255))+((int)sprite[j].yoffset);
								if ((sprite[j].cstat&4) > 0) xoff = -xoff;
								if ((sprite[j].cstat&8) > 0) yoff = -yoff;

								if (sprite[j].cstat & 32) {
									// Floor sprite
									int cosang = sintable[(ang+512)&2047];
									int sinang = sintable[(ang)&2047];

									dax = ((tilesizx[tilenum]>>1)+xoff)*xrepeat;
									day = ((tilesizy[tilenum]>>1)+yoff)*yrepeat;

									rxi[0] = dmulscale16(sinang,dax,cosang,day);
									ryi[0] = dmulscale16(sinang,day,-cosang,dax);
									rxi[1] = rxi[0] - mulscale16(sinang,tilesizx[tilenum]*xrepeat);
									ryi[1] = ryi[0] + mulscale16(cosang,tilesizx[tilenum]*xrepeat);
									rxi[2] = rxi[1] - mulscale16(cosang,tilesizy[tilenum]*yrepeat);
									rxi[3] = rxi[0] - mulscale16(cosang,tilesizy[tilenum]*yrepeat);
									ryi[2] = ryi[1] - mulscale16(sinang,tilesizy[tilenum]*yrepeat);
									ryi[3] = ryi[0] - mulscale16(sinang,tilesizy[tilenum]*yrepeat);
									np = 4;
								} else {
									// Wall sprite
									dax = sintable[ang&2047]*xrepeat;
									day = sintable[(ang+1536)&2047]*xrepeat;
									rxi[2] = rxi[1] = -mulscale16(dax,(tilesizx[tilenum]>>1)+xoff);
									rxi[3] = rxi[0] = rxi[1] + mulscale16(dax,tilesizx[tilenum]);
									ryi[2] = ryi[1] = -mulscale16(day,(tilesizx[tilenum]>>1)+xoff);
									ryi[3] = ryi[0] = ryi[1] + mulscale16(day,tilesizx[tilenum]);
									np = 1;
								}

								if (showspriteextents >= 2) {
									// Apply clipping boundary.
									dax = mulscale14(sintable[(ang-256+512)&2047],kenswalldist);
									day = mulscale14(sintable[(ang-256)&2047],kenswalldist);
									clipx[1] = rxi[1]-day; clipy[1] = ryi[1]+dax;
									clipx[0] = rxi[0]+dax; clipy[0] = ryi[0]+day;
									clipx[3] = rxi[3]+day; clipy[3] = ryi[3]-dax;
									clipx[2] = rxi[2]-dax; clipy[2] = ryi[2]-day;
								}

								// Correct for zoom.
								for (p=0;p<4;p++) {
									rxi[p] = mulscale14(rxi[p],zoome);
									ryi[p] = mulscale14(ryi[p],zoome);
									clipx[p] = mulscale14(clipx[p],zoome);
									clipy[p] = mulscale14(clipy[p],zoome);
								}

								drawlinepat = 0x99999999;
								for (p=0;p<np;p++) {
									drawline16(halfxdim16 + xp1 + rxi[p], midydim16 + yp1 + ryi[p],
										halfxdim16 + xp1 + rxi[(p+1)&3], midydim16 + yp1 + ryi[(p+1)&3],
										col);
								}
								if (showspriteextents >= 2) {
									drawlinepat = 0x11111111;
									for (p=0;p<4;p++) {
										drawline16(halfxdim16 + xp1 + clipx[p], midydim16 + yp1 + clipy[p],
											halfxdim16 + xp1 + clipx[(p+1)&3], midydim16 + yp1 + clipy[(p+1)&3],
											col);
									}
								}
								drawlinepat = 0xffffffff;
							}

							xp2 = mulscale11(sintable[(sprite[j].ang+2560)&2047],zoome) / 768;
							yp2 = mulscale11(sintable[(sprite[j].ang+2048)&2047],zoome) / 768;

							if ((sprite[j].cstat&256) > 0)
							{
								if (((sprite[j].ang+256)&512) == 0)
								{
									drawline16(halfxdim16+xp1,midydim16+yp1-1,halfxdim16+xp1+xp2,midydim16+yp1+yp2-1,col);
									drawline16(halfxdim16+xp1,midydim16+yp1+1,halfxdim16+xp1+xp2,midydim16+yp1+yp2+1,col);
								}
								else
								{
									drawline16(halfxdim16+xp1-1,midydim16+yp1,halfxdim16+xp1+xp2-1,midydim16+yp1+yp2,col);
									drawline16(halfxdim16+xp1+1,midydim16+yp1,halfxdim16+xp1+xp2+1,midydim16+yp1+yp2,col);
								}
								col += 8;
							}
							drawline16(halfxdim16+xp1,midydim16+yp1,halfxdim16+xp1+xp2,midydim16+yp1+yp2,col);
						}
				}

	faketimerhandler();
	xp1 = mulscale11(sintable[(ange+2560)&2047],zoome) / 768; //Draw white arrow
	yp1 = mulscale11(sintable[(ange+2048)&2047],zoome) / 768;
	drawline16(halfxdim16+xp1,midydim16+yp1,halfxdim16-xp1,midydim16-yp1,15);
	drawline16(halfxdim16+xp1,midydim16+yp1,halfxdim16+yp1,midydim16-xp1,15);
	drawline16(halfxdim16+xp1,midydim16+yp1,halfxdim16-yp1,midydim16+xp1,15);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x98, %rsp
movl %ecx, 0x28(%rsp)
leaq 0x199c89(%rip), %rax    # 0x1b1a28
cmpl $0xc8, (%rax)
jne 0x17db9
addq $0x98, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movl %esi, %r14d
movl %edi, %r15d
movl %edx, 0x8c(%rsp)
leaq 0x199c6f(%rip), %rbx    # 0x1b1a3c
cmpw $0x0, (%rbx)
jne 0x17dfa
movl %r8d, %r12d
callq 0x9fd2
callq 0x17b07
callq 0x9fd2
movswl %r12w, %r8d
movl %r15d, %edi
movl %r14d, %esi
xorl %edx, %edx
movl 0x28(%rsp), %ecx
callq 0x17b2b
callq 0x9fd2
leaq 0x3f7e62(%rip), %rax    # 0x40fc68
movswq (%rax), %rax
leal -0x1(%rax), %edi
movslq 0x28(%rsp), %rcx
shlq $0x5, %rax
leaq 0x199c33(%rip), %rdx    # 0x1b1a50
leaq (%rax,%rdx), %r9
addq $-0x12, %r9
leaq 0x85974(%rip), %r10     # 0x9d7a0
movslq %r15d, %rax
movq %rax, 0x80(%rsp)
movq %rcx, %r15
movslq %r14d, %rax
movq %rax, 0x78(%rsp)
movq %rcx, 0x70(%rsp)
testl %edi, %edi
js 0x18237
cmpw $0x0, (%rbx)
je 0x17e6d
movswl -0x4(%r9), %eax
testl %eax, %eax
setns %cl
cmpl %eax, %edi
setg %dl
testb %dl, %cl
je 0x17ebc
jmp 0x1822c
movl %edi, %eax
shrl $0x3, %eax
movl %edi, %ecx
andl $0x7, %ecx
movb (%r10,%rcx), %cl
leaq 0x38ce5e(%rip), %rdx    # 0x3a4ce0
testb %cl, (%rdx,%rax)
je 0x1822c
movswl -0x4(%r9), %eax
testl %eax, %eax
sets %cl
cmpl %eax, %edi
setle %dl
orb %cl, %dl
jne 0x17ebc
movl %eax, %ecx
shrl $0x3, %ecx
movl %eax, %edx
andl $0x7, %edx
movb (%r10,%rdx), %dl
leaq 0x38ce2d(%rip), %rsi    # 0x3a4ce0
testb %dl, (%rsi,%rcx)
jne 0x1822c
testl %eax, %eax
movq 0x80(%rsp), %rdx
movq 0x78(%rsp), %rsi
js 0x17f12
movb (%r9), %r13b
andb $0x1, %r13b
orb $0x4, %r13b
leaq 0x38d605(%rip), %rax    # 0x3a54e4
movswl (%rax), %eax
cmpl %eax, %edi
leaq 0x38d5fd(%rip), %rcx    # 0x3a54e8
je 0x17f09
cltq
testw %ax, %ax
js 0x17f35
shlq $0x5, %rax
leaq 0x199b51(%rip), %r8     # 0x1b1a50
movswl 0xa(%r8,%rax), %eax
cmpl %eax, %edi
jne 0x17f35
movb (%rcx), %al
andb $0x8, %al
orb %al, %r13b
jmp 0x17f35
leaq 0x38d5cb(%rip), %rax    # 0x3a54e4
movswl (%rax), %eax
movb $0x7, %r13b
cmpl %eax, %edi
leaq 0x38d5c0(%rip), %rax    # 0x3a54e8
jne 0x17f35
movb (%rax), %r13b
andb $0x8, %r13b
orb $0x7, %r13b
movslq -0xe(%r9), %r12
subq %rdx, %r12
imulq %r15, %r12
shrq $0xe, %r12
movslq -0xa(%r9), %rbp
subq %rsi, %rbp
imulq %r15, %rbp
shrq $0xe, %rbp
movswq -0x6(%r9), %rax
shlq $0x5, %rax
leaq 0x199aed(%rip), %r8     # 0x1b1a50
movslq (%r8,%rax), %r14
subq %rdx, %r14
imulq %r15, %r14
shrq $0xe, %r14
movq %r15, %rcx
movslq 0x4(%r8,%rax), %r15
subq %rsi, %r15
imulq %rcx, %r15
shrq $0xe, %r15
testb $0x40, (%r9)
movl %edi, 0x10(%rsp)
movq %r9, 0x18(%rsp)
je 0x18049
movl %r14d, %eax
subl %r12d, %eax
movl %eax, %ecx
negl %ecx
cmovsl %eax, %ecx
movl %r15d, %eax
subl %ebp, %eax
movl %eax, %esi
negl %esi
cmovsl %eax, %esi
movl 0x15b20d(%rip), %edx    # 0x1731c4
movzbl %r13b, %r8d
cmpl %esi, %ecx
movl %r8d, 0x8(%rsp)
jae 0x18000
leal (%r12,%rdx), %edi
incl %edi
movl 0x15b1f8(%rip), %ecx    # 0x1731c8
leal (%rcx,%rbp), %esi
addl %r14d, %edx
incl %edx
addl %r15d, %ecx
callq 0x1737f
movl 0x15b1de(%rip), %eax    # 0x1731c4
leal (%r12,%rax), %edi
decl %edi
movl 0x15b1d6(%rip), %ecx    # 0x1731c8
leal (%rcx,%rbp), %esi
leal (%r14,%rax), %edx
decl %edx
addl %r15d, %ecx
jmp 0x1803b
leal (%rdx,%r12), %edi
movl 0x15b1be(%rip), %eax    # 0x1731c8
leal (%rax,%rbp), %esi
incl %esi
addl %r14d, %edx
leal (%r15,%rax), %ecx
incl %ecx
callq 0x1737f
movl 0x15b1a1(%rip), %edx    # 0x1731c4
leal (%rdx,%r12), %edi
movl 0x15b19b(%rip), %eax    # 0x1731c8
leal (%rax,%rbp), %esi
decl %esi
addl %r14d, %edx
leal (%r15,%rax), %ecx
decl %ecx
movl 0x8(%rsp), %r8d
callq 0x1737f
addb $0x8, %r13b
movl 0x15b175(%rip), %eax    # 0x1731c4
leal (%rax,%r12), %edi
movl 0x15b16f(%rip), %ecx    # 0x1731c8
leal (%rcx,%rbp), %esi
addl %eax, %r14d
addl %ecx, %r15d
movzbl %r13b, %r8d
movl %r14d, %edx
movl %r15d, %ecx
callq 0x1737f
cmpl $0x100, 0x28(%rsp)      # imm = 0x100
movq 0x70(%rsp), %r15
leaq 0x8571b(%rip), %r10     # 0x9d7a0
movl 0x10(%rsp), %edi
movq 0x18(%rsp), %r9
jl 0x1822c
cmpw $0x1, (%rbx)
jne 0x1822c
addl 0x15b11f(%rip), %r12d   # 0x1731c4
cmpl $0x2, %r12d
jl 0x1822c
leaq 0x3e8f36(%rip), %rax    # 0x400fec
movl (%rax), %eax
addl $-0x3, %eax
cmpl %eax, %r12d
jg 0x1822c
addl 0x15b0fe(%rip), %ebp    # 0x1731c8
cmpl $0x2, %ebp
jl 0x1822c
movl 0x10ec8f(%rip), %eax    # 0x126d68
addl $-0x3, %eax
cmpl %eax, %ebp
jg 0x1822c
leaq 0x38d3f7(%rip), %rax    # 0x3a54e2
movswl (%rax), %eax
cmpl %eax, %edi
jne 0x180f7
movq %r9, %r14
jmp 0x18123
movb $0x2, %al
leaq 0x38d3e6(%rip), %rcx    # 0x3a54e6
cmpw $0x0, (%rcx)
jle 0x18132
movq %r9, %r14
movl %edi, %ecx
shrl $0x3, %ecx
movl %edi, %edx
andl $0x7, %edx
movb (%r10,%rdx), %dl
leaq 0x38cbc2(%rip), %rsi    # 0x3a4ce0
testb %dl, (%rsi,%rcx)
je 0x18135
leaq 0x38d3be(%rip), %rax    # 0x3a54e8
movb (%rax), %al
andb $0x8, %al
orb $0x2, %al
jmp 0x18135
movq %r9, %r14
leaq 0x15f148(%rip), %r11    # 0x177284
movl (%r11), %r8d
imull %r8d, %ebp
addl %r12d, %ebp
movslq %ebp, %rsi
leaq 0x15ef60(%rip), %rcx    # 0x1770b0
movq (%rcx), %rdi
leaq (%rdi,%rsi), %rcx
leaq (%rdi,%rsi), %rdx
addq $-0x2, %rdx
addl %r8d, %r8d
movslq %r8d, %r8
movq %rdx, %r9
subq %r8, %r9
movb %al, (%r9)
leaq (%rdi,%rsi), %r8
decq %r8
movl (%r11), %r9d
addl %r9d, %r9d
movslq %r9d, %r9
subq %r9, %r8
movb %al, (%r8)
movl (%r11), %r8d
addl %r8d, %r8d
movslq %r8d, %r8
movq %rcx, %r9
subq %r8, %r9
movb %al, (%r9)
leaq (%rdi,%rsi), %r8
incq %r8
movl (%r11), %r9d
addl %r9d, %r9d
movslq %r9d, %r9
subq %r9, %r8
movb %al, (%r8)
addq %rdi, %rsi
addq $0x2, %rsi
movl (%r11), %edi
addl %edi, %edi
movslq %edi, %rdi
movq %rsi, %r8
subq %rdi, %r8
movb %al, (%r8)
movl (%r11), %edi
addl %edi, %edi
movslq %edi, %rdi
movb %al, -0x2(%rdi,%rcx)
movl (%r11), %edi
addl %edi, %edi
movslq %edi, %rdi
movb %al, -0x1(%rdi,%rcx)
movl (%r11), %edi
addl %edi, %edi
movslq %edi, %rdi
movb %al, (%rdi,%rcx)
movl (%r11), %edi
addl %edi, %edi
movslq %edi, %rdi
movb %al, 0x1(%rdi,%rcx)
movl (%r11), %edi
addl %edi, %edi
movslq %edi, %rdi
movb %al, 0x2(%rdi,%rcx)
movslq (%r11), %rdi
subq %rdi, %rdx
movb %al, (%rdx)
movb %al, -0x4(%rsi)
movslq (%r11), %rdx
movb %al, -0x2(%rdx,%rcx)
movslq (%r11), %rdx
movq %rsi, %rdi
subq %rdx, %rdi
movb %al, (%rdi)
movb %al, (%rsi)
movslq (%r11), %rdx
movb %al, 0x2(%rdx,%rcx)
movl 0x10(%rsp), %edi
movq %r14, %r9
decl %edi
addq $-0x20, %r9
jmp 0x17e47
callq 0x9fd2
cmpl $0xff, 0x28(%rsp)
leaq 0x38d29d(%rip), %r8     # 0x3a54e8
movq 0x80(%rsp), %r9
movq 0x78(%rsp), %r10
jg 0x18335
cmpw $0x0, (%rbx)
je 0x18335
callq 0x9fd2
movzwl 0x8c(%rsp), %ecx
leal 0x200(%rcx), %eax
movl $0x7ff, %esi            # imm = 0x7FF
andl %esi, %eax
leaq 0x3afac7(%rip), %rdi    # 0x3c7d50
movswq (%rdi,%rax,2), %rax
imulq %r15, %rax
shrq $0xb, %rax
movl $0x300, %r8d            # imm = 0x300
cltd
idivl %r8d
movq %r15, %rdx
movl %eax, %r15d
andl %esi, %ecx
movswq (%rdi,%rcx,2), %rax
imulq %rdx, %rax
shrq $0xb, %rax
cltd
idivl %r8d
movl %eax, %r14d
movl 0x15af02(%rip), %edx    # 0x1731c4
leal (%r15,%rdx), %edi
movl 0x15aefc(%rip), %ecx    # 0x1731c8
leal (%r14,%rcx), %esi
subl %r15d, %edx
subl %eax, %ecx
pushq $0xf
popq %rbp
movl %ebp, %r8d
callq 0x1737f
movl 0x15aede(%rip), %edi    # 0x1731c4
movl 0x15aedc(%rip), %ecx    # 0x1731c8
leal (%rcx,%r14), %esi
leal (%r14,%rdi), %edx
addl %r15d, %edi
subl %r15d, %ecx
movl %ebp, %r8d
callq 0x1737f
movl 0x15aebc(%rip), %edx    # 0x1731c4
leal (%rdx,%r15), %edi
movl 0x15aeb6(%rip), %ecx    # 0x1731c8
leal (%rcx,%r14), %esi
subl %r14d, %edx
addl %r15d, %ecx
movl %ebp, %r8d
addq $0x98, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x1737f
xorl %ecx, %ecx
leaq 0x25d972(%rip), %r11    # 0x275cb0
leaq 0x3b0c1b(%rip), %rax    # 0x3c8f60
movswq (%rax), %rax
cmpq %rax, %rcx
jge 0x18268
movq %rcx, 0x28(%rsp)
leaq (%rcx,%rcx), %r12
addq 0x73c5e(%rip), %r12     # 0x8bfc0
leaq 0x85437(%rip), %rdi     # 0x9d7a0
movswl (%r12), %eax
testl %eax, %eax
js 0x18ae5
movzwl (%rbx), %ecx
movl %eax, %r12d
cmpw $0x1, %cx
je 0x183a1
movl %eax, %edx
shrl $0x3, %edx
movl %eax, %esi
andl $0x7, %esi
movb (%rdi,%rsi), %sil
leaq 0x38c149(%rip), %r14    # 0x3a44e0
testb %sil, (%r14,%rdx)
je 0x18ad6
imulq $0x2c, %r12, %rbp
movb 0xc(%r11,%rbp), %r13b
andb $0x1, %r13b
addb %r13b, %r13b
addb $0x3, %r13b
cmpw $0x1, %cx
jne 0x183fb
leal 0x4000(%rax), %ecx
leaq 0x38d11a(%rip), %rdx    # 0x3a54e2
movswl (%rdx), %edx
cmpl %edx, %ecx
je 0x183f3
leaq 0x38d110(%rip), %rcx    # 0x3a54e6
cmpw $0x0, (%rcx)
jle 0x183fb
movl %eax, %ecx
shrl $0x3, %ecx
andl $0x7, %eax
movb (%rdi,%rax), %al
leaq 0x38c0f2(%rip), %rdx    # 0x3a44e0
testb %al, (%rdx,%rcx)
je 0x183fb
movb (%r8), %al
andb $0x8, %al
orb %al, %r13b
addq %r11, %rbp
movslq (%rbp), %r14
subq %r9, %r14
imulq %r15, %r14
shrq $0xe, %r14
movl 0x15adb1(%rip), %eax    # 0x1731c4
addl %r14d, %eax
cmpl $0x2, %eax
jl 0x18ad6
leaq 0x3e8bc6(%rip), %rcx    # 0x400fec
movl (%rcx), %ecx
addl $-0x3, %ecx
cmpl %ecx, %eax
jg 0x18ad6
movslq 0x4(%rbp), %rdx
subq %r10, %rdx
imulq %r15, %rdx
shrq $0xe, %rdx
movl 0x15ad80(%rip), %ecx    # 0x1731c8
movq %rdx, 0x10(%rsp)
addl %edx, %ecx
cmpl $0x2, %ecx
jl 0x18ad6
movl 0x10e90a(%rip), %edx    # 0x126d68
addl $-0x3, %edx
cmpl %edx, %ecx
jg 0x18ad6
leaq 0x15ee14(%rip), %r11    # 0x177284
movl (%r11), %edi
imull %edi, %ecx
addl %eax, %ecx
movslq %ecx, %rdx
leaq 0x15ec2e(%rip), %rax    # 0x1770b0
movq (%rax), %rsi
leaq (%rsi,%rdx), %rcx
leaq (%rsi,%rdx), %rax
decq %rax
addl %edi, %edi
movslq %edi, %rdi
movq %rax, %r8
subq %rdi, %r8
movb %r13b, (%r8)
movl (%r11), %edi
addl %edi, %edi
movslq %edi, %rdi
movq %rcx, %r8
subq %rdi, %r8
movb %r13b, (%r8)
leaq (%rsi,%rdx), %rdi
incq %rdi
movl (%r11), %r8d
addl %r8d, %r8d
movslq %r8d, %r8
movq %rdi, %r9
subq %r8, %r9
movb %r13b, (%r9)
movl (%r11), %r8d
addl %r8d, %r8d
movslq %r8d, %r8
movb %r13b, -0x1(%r8,%rcx)
movl (%r11), %r8d
addl %r8d, %r8d
movslq %r8d, %r8
movb %r13b, (%r8,%rcx)
movl (%r11), %r8d
addl %r8d, %r8d
movslq %r8d, %r8
movb %r13b, 0x1(%r8,%rcx)
leaq (%rsi,%rdx), %r8
addq $-0x2, %r8
movslq (%r11), %r9
movq %r8, %r10
subq %r9, %r10
movb %r13b, (%r10)
movb %r13b, (%r8)
movslq (%r11), %r8
movb %r13b, -0x2(%r8,%rcx)
addq %rsi, %rdx
addq $0x2, %rdx
movslq (%r11), %rsi
movq %rdx, %r8
subq %rsi, %r8
movb %r13b, (%r8)
movb %r13b, (%rdx)
movslq (%r11), %rdx
movb %r13b, 0x2(%rdx,%rcx)
movslq (%r11), %rdx
movb %r13b, 0x1(%rdx,%rcx)
movslq (%r11), %rdx
movb %r13b, -0x1(%rdx,%rcx)
movslq (%r11), %rcx
subq %rcx, %rdi
movb %r13b, (%rdi)
movslq (%r11), %rcx
subq %rcx, %rax
movb %r13b, (%rax)
movzwl 0x10e3d1(%rip), %eax    # 0x126928
movzwl 0xc(%rbp), %esi
movzbl %r13b, %ecx
movl %ecx, 0x18(%rsp)
testw %ax, %ax
je 0x18969
movl %esi, %ecx
andl $0x30, %ecx
je 0x18969
xorps %xmm0, %xmm0
movaps %xmm0, 0x60(%rsp)
movaps %xmm0, 0x50(%rsp)
movswq 0xe(%rbp), %rcx
movzwl 0x1c(%rbp), %r15d
movzbl 0x14(%rbp), %r9d
leaq 0x21b4c6(%rip), %rdx    # 0x233a60
movl (%rdx,%rcx,4), %edx
movl %edx, %edi
shrl $0x8, %edi
movsbl %dil, %edi
movsbl 0x16(%rbp), %r10d
addl %edi, %r10d
movl %r10d, %r8d
negl %r8d
testb $0x4, %sil
cmovel %r10d, %r8d
testb $0x20, %sil
jne 0x18671
movl %r15d, %edx
movl $0x7ff, %edi            # imm = 0x7FF
andl %edi, %edx
leaq 0x3af779(%rip), %r10    # 0x3c7d50
movswq (%r10,%rdx,2), %rdx
imulq %r9, %rdx
leal 0x600(%r15), %esi
andl %edi, %esi
movswq (%r10,%rsi,2), %rdi
imulq %r9, %rdi
leaq 0x3f0a27(%rip), %rsi    # 0x409020
movswq (%rsi,%rcx,2), %rcx
movl %ecx, %esi
sarl %esi
addl %esi, %r8d
movslq %r8d, %rsi
movq %rsi, %r8
imulq %rdx, %r8
shrq $0x10, %r8
imulq %rcx, %rdx
shrq $0x10, %rdx
subl %r8d, %edx
movl %r8d, %r9d
negl %r9d
movl %r9d, 0x34(%rsp)
movl %r9d, 0x38(%rsp)
movl %edx, 0x30(%rsp)
movl %edx, 0x3c(%rsp)
imulq %rdi, %rsi
shrq $0x10, %rsi
imulq %rcx, %rdi
shrq $0x10, %rdi
subl %esi, %edi
movl %esi, %r11d
negl %r11d
movl %r11d, 0x44(%rsp)
movl %r11d, 0x48(%rsp)
movl %edi, 0x40(%rsp)
movl %edi, %r8d
movl %edx, %r10d
movl %r11d, %esi
movl %r9d, 0x8(%rsp)
pushq $0x1
jmp 0x18795
shrl $0x10, %edx
movsbl %dl, %edx
movsbl 0x17(%rbp), %edi
addl %edx, %edi
movl %edi, %r10d
negl %r10d
testb $0x8, %sil
cmovel %edi, %r10d
movw %ax, 0x20(%rsp)
movzbl 0x15(%rbp), %eax
movq %rax, 0x8(%rsp)
leal 0x200(%r15), %esi
movl $0x7ff, %r11d           # imm = 0x7FF
andl %r11d, %esi
leaq 0x3af6a0(%rip), %rbx    # 0x3c7d50
movswq (%rbx,%rsi,2), %rdi
movl %r15d, %esi
andl %r11d, %esi
movswq (%rbx,%rsi,2), %r11
leaq 0x3f0959(%rip), %rsi    # 0x409020
movswq (%rsi,%rcx,2), %rsi
movl %esi, %ebx
sarl %ebx
addl %ebx, %r8d
movq %r15, %rdx
movslq %r8d, %r15
imulq %r9, %r15
leaq 0x3e20fc(%rip), %r8     # 0x3fa7e0
movswq (%r8,%rcx,2), %rbx
movl %ebx, %ecx
sarl %ecx
addl %r10d, %ecx
movslq %ecx, %r8
imulq %rax, %r8
movzwl 0x20(%rsp), %eax
movq %r15, %rcx
imulq %r11, %rcx
movq %r8, %r10
imulq %rdi, %r10
addq %rcx, %r10
shrq $0x10, %r10
movl %r10d, 0x30(%rsp)
imulq %r11, %r8
imulq %rdi, %r15
subq %r15, %r8
movq %rdx, %r15
shrq $0x10, %r8
movl %r8d, 0x40(%rsp)
imulq %r9, %rsi
movq %rsi, %r9
imulq %r11, %r9
shrq $0x10, %r9
movl %r10d, %ecx
subl %r9d, %ecx
movl %ecx, 0x34(%rsp)
imulq %rdi, %rsi
shrq $0x10, %rsi
addl %r8d, %esi
movl %esi, 0x44(%rsp)
imulq 0x8(%rsp), %rbx
imulq %rbx, %rdi
shrq $0x10, %rdi
movl %ecx, 0x8(%rsp)
movl %ecx, %r9d
subl %edi, %r9d
movl %r9d, 0x38(%rsp)
movl %r10d, %edx
subl %edi, %edx
movl %edx, 0x3c(%rsp)
imulq %r11, %rbx
shrq $0x10, %rbx
movl %esi, %r11d
subl %ebx, %r11d
movl %r11d, 0x48(%rsp)
movl %r8d, %edi
subl %ebx, %edi
pushq $0x4
popq %rbx
movl %edi, 0x4c(%rsp)
cmpw $0x2, %ax
jl 0x18845
movq %r15, %rax
addl $0x700, %r15d           # imm = 0x700
addl $0x100, %eax            # imm = 0x100
movl $0x7ff, %ecx            # imm = 0x7FF
andl %ecx, %eax
movl %r9d, 0x20(%rsp)
movl 0x8(%rsp), %r9d
leaq 0x3af585(%rip), %rcx    # 0x3c7d50
movswq (%rcx,%rax,2), %rax
movslq 0x84821(%rip), %rcx     # 0x9cff8
movq %rcx, 0x90(%rsp)
imulq %rcx, %rax
shrq $0xe, %rax
movl $0x7ff, %ecx            # imm = 0x7FF
andl %ecx, %r15d
leaq 0x3af55a(%rip), %rcx    # 0x3c7d50
movswq (%rcx,%r15,2), %r15
imulq 0x90(%rsp), %r15
shrq $0xe, %r15
subl %r15d, %r9d
movl %r9d, 0x64(%rsp)
addl %eax, %esi
movl %esi, 0x54(%rsp)
addl %eax, %r10d
movl %r10d, 0x60(%rsp)
addl %r15d, %r8d
movl %r8d, 0x50(%rsp)
addl %r15d, %edx
movl %edx, 0x6c(%rsp)
subl %eax, %edi
movl %edi, 0x5c(%rsp)
movl 0x20(%rsp), %ecx
subl %eax, %ecx
movl %ecx, 0x68(%rsp)
subl %r15d, %r11d
movl %r11d, 0x58(%rsp)
xorl %eax, %eax
movq 0x70(%rsp), %rdx
cmpq $0x4, %rax
je 0x1889b
movslq 0x30(%rsp,%rax,4), %rcx
imulq %rdx, %rcx
shrq $0xe, %rcx
movl %ecx, 0x30(%rsp,%rax,4)
movslq 0x40(%rsp,%rax,4), %rcx
imulq %rdx, %rcx
shrq $0xe, %rcx
movl %ecx, 0x40(%rsp,%rax,4)
movslq 0x60(%rsp,%rax,4), %rcx
imulq %rdx, %rcx
shrq $0xe, %rcx
movl %ecx, 0x60(%rsp,%rax,4)
movslq 0x50(%rsp,%rax,4), %rcx
imulq %rdx, %rcx
shrq $0xe, %rcx
movl %ecx, 0x50(%rsp,%rax,4)
incq %rax
jmp 0x1884c
movl $0x99999999, 0x84773(%rip) # imm = 0x99999999
negq %rbx
pushq $0x1
popq %r15
leaq (%rbx,%r15), %rax
cmpq $0x1, %rax
je 0x188f7
movl 0x15a908(%rip), %edx    # 0x1731c4
addl %r14d, %edx
movl 0x2c(%rsp,%r15,4), %edi
addl %edx, %edi
movl 0x15a8fc(%rip), %ecx    # 0x1731c8
addl 0x10(%rsp), %ecx
movl 0x3c(%rsp,%r15,4), %esi
addl %ecx, %esi
movl %r15d, %eax
andl $0x3, %eax
shll $0x2, %eax
addl 0x30(%rsp,%rax), %edx
addl 0x40(%rsp,%rax), %ecx
movl 0x18(%rsp), %r8d
callq 0x1737f
incq %r15
jmp 0x188ac
cmpw $0x2, 0x10e029(%rip)    # 0x126928
movq 0x70(%rsp), %r15
jl 0x18957
movl $0x11111111, 0x84708(%rip) # imm = 0x11111111
pushq $0x1
popq %rbx
cmpq $0x5, %rbx
je 0x18957
movl 0x15a8a5(%rip), %edx    # 0x1731c4
addl %r14d, %edx
movl 0x5c(%rsp,%rbx,4), %edi
addl %edx, %edi
movl 0x15a89a(%rip), %ecx    # 0x1731c8
addl 0x10(%rsp), %ecx
movl 0x4c(%rsp,%rbx,4), %esi
addl %ecx, %esi
movl %ebx, %eax
andl $0x3, %eax
shll $0x2, %eax
addl 0x60(%rsp,%rax), %edx
addl 0x50(%rsp,%rax), %ecx
movl 0x18(%rsp), %r8d
callq 0x1737f
incq %rbx
jmp 0x18913
orl $-0x1, 0x846ba(%rip)    # 0x9d018
movzwl 0xc(%rbp), %esi
leaq 0x1990d3(%rip), %rbx    # 0x1b1a3c
movl 0x1c(%rbp), %ecx
leal 0x200(%rcx), %eax
movl $0x7ff, %edi            # imm = 0x7FF
andl %edi, %eax
leaq 0x3af3d0(%rip), %r8     # 0x3c7d50
movswq (%r8,%rax,2), %rax
imulq %r15, %rax
shrq $0xb, %rax
cltd
movl $0x300, %r9d            # imm = 0x300
idivl %r9d
movl %eax, %r10d
movl %ecx, %eax
andl %edi, %eax
movswq (%r8,%rax,2), %rax
imulq %r15, %rax
shrq $0xb, %rax
cltd
idivl %r9d
movl %eax, %ebp
btl $0x8, %esi
jae 0x18a8c
addl $0x100, %ecx            # imm = 0x100
movl 0x15a7fd(%rip), %edi    # 0x1731c4
addl %r14d, %edi
btl $0x9, %ecx
movq %r10, 0x8(%rsp)
movq %rbp, 0x20(%rsp)
jb 0x18a2d
movl 0x15a7e8(%rip), %eax    # 0x1731c8
movq 0x10(%rsp), %rbp
leal (%rax,%rbp), %esi
decl %esi
addl %ebp, %eax
leal (%rdi,%r10), %edx
movq 0x20(%rsp), %rcx
addl %eax, %ecx
decl %ecx
movl 0x18(%rsp), %r8d
callq 0x1737f
movl 0x15a7bb(%rip), %edi    # 0x1731c4
addl %r14d, %edi
movl 0x15a7b6(%rip), %eax    # 0x1731c8
leal (%rax,%rbp), %esi
incl %esi
addl %ebp, %eax
movq 0x20(%rsp), %rbp
movq 0x8(%rsp), %rcx
leal (%rdi,%rcx), %edx
leal (%rax,%rbp), %ecx
incl %ecx
jmp 0x18a79
movl 0x15a795(%rip), %esi    # 0x1731c8
addl 0x10(%rsp), %esi
movl %edi, %eax
decl %eax
leal (%rdi,%r10), %edx
decl %edx
leal (%rsi,%rbp), %ecx
movl %eax, %edi
movl 0x18(%rsp), %r8d
movq %r10, %rbp
callq 0x1737f
movl 0x15a76b(%rip), %eax    # 0x1731c4
leal (%rax,%r14), %edi
incl %edi
addl %r14d, %eax
movl 0x15a760(%rip), %esi    # 0x1731c8
addl 0x10(%rsp), %esi
leal (%rax,%rbp), %edx
incl %edx
movq 0x20(%rsp), %rbp
leal (%rsi,%rbp), %ecx
movl 0x18(%rsp), %r8d
callq 0x1737f
addb $0x8, %r13b
movq 0x8(%rsp), %r10
addl 0x15a731(%rip), %r14d   # 0x1731c4
movq 0x10(%rsp), %rsi
addl 0x15a72a(%rip), %esi    # 0x1731c8
addl %r14d, %r10d
addl %esi, %ebp
movzbl %r13b, %r8d
movl %r14d, %edi
movl %r10d, %edx
movl %ebp, %ecx
callq 0x1737f
leaq 0x84ce5(%rip), %rdi     # 0x9d7a0
leaq 0x38ca26(%rip), %r8     # 0x3a54e8
movq 0x80(%rsp), %r9
movq 0x78(%rsp), %r10
leaq 0x25d1da(%rip), %r11    # 0x275cb0
addq %r12, %r12
addq 0x734b0(%rip), %r12     # 0x8bf90
jmp 0x18369
movq 0x28(%rsp), %rcx
incq %rcx
jmp 0x1833e