// File: /workspace/github_c_makefile_star2_O3/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 $0xb8, %rsp
movl %ecx, 0xc(%rsp)
leaq 0x19f0f0(%rip), %rax    # 0x1b8a28
cmpl $0xc8, (%rax)
jne 0x19952
addq $0xb8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movl %esi, %r14d
movl %edi, %r15d
movl %edx, 0x9c(%rsp)
leaq 0x19f0d6(%rip), %rax    # 0x1b8a3c
cmpw $0x0, (%rax)
jne 0x199b2
movl %r8d, %r12d
callq 0xacd7
leaq 0x164735(%rip), %rax    # 0x17e0b0
movq (%rax), %rdi
leaq 0x1648ff(%rip), %rax    # 0x17e284
movl 0x1143dd(%rip), %esi    # 0x12dd68
imull (%rax), %esi
sarl $0x2, %esi
xorl %edx, %edx
callq 0x4d2d8
callq 0xacd7
movswl %r12w, %r8d
movl %r15d, %edi
movl %r14d, %esi
xorl %edx, %edx
movl 0xc(%rsp), %ecx
callq 0x196b4
callq 0xacd7
leaq 0x3fd2aa(%rip), %rax    # 0x416c68
movswl (%rax), %r11d
movslq 0xc(%rsp), %r10
movslq %r15d, %rbx
movslq %r14d, %rax
movq %rax, 0x90(%rsp)
testl %r11d, %r11d
movq %r10, 0x38(%rsp)
movq %rbx, 0xa0(%rsp)
jle 0x19e1e
leal -0x1(%r11), %ecx
leaq 0x19f046(%rip), %rax    # 0x1b8a3c
movzwl (%rax), %eax
shlq $0x5, %rcx
leaq 0x19f04c(%rip), %rdx    # 0x1b8a50
leaq (%rcx,%rdx), %rbp
addq $0xe, %rbp
leal -0x1(%r11), %edi
testw %ax, %ax
je 0x19a2e
movswl -0x4(%rbp), %ecx
testl %ecx, %ecx
setns %dl
cmpl %ecx, %edi
setg %sil
testb %sil, %dl
je 0x19a87
jmp 0x19e11
movl %edi, %eax
shrl $0x3, %eax
movl %edi, %ecx
andl $0x7, %ecx
leaq 0x8ad61(%rip), %rdx     # 0xa47a0
movb (%rdx,%rcx), %cl
leaq 0x392297(%rip), %rdx    # 0x3abce0
testb %cl, (%rdx,%rax)
je 0x19a80
movswl -0x4(%rbp), %ecx
testl %ecx, %ecx
sets %al
cmpl %ecx, %edi
setle %dl
orb %al, %dl
jne 0x19a87
movl %ecx, %eax
shrl $0x3, %eax
movl %ecx, %edx
andl $0x7, %edx
leaq 0x8ad2f(%rip), %rsi     # 0xa47a0
movb (%rsi,%rdx), %dl
leaq 0x392265(%rip), %rsi    # 0x3abce0
testb %dl, (%rsi,%rax)
je 0x19a87
xorl %eax, %eax
jmp 0x19e11
testl %ecx, %ecx
js 0x19ad0
movb (%rbp), %r8b
andb $0x1, %r8b
orb $0x4, %r8b
leaq 0x392a46(%rip), %rax    # 0x3ac4e4
movswl (%rax), %eax
cmpl %eax, %edi
je 0x19ac0
cltq
testw %ax, %ax
js 0x19af3
shlq $0x5, %rax
leaq 0x19ef99(%rip), %rcx    # 0x1b8a50
movswl 0xa(%rcx,%rax), %eax
cmpl %eax, %edi
jne 0x19af3
leaq 0x392a21(%rip), %rax    # 0x3ac4e8
movb (%rax), %al
andb $0x8, %al
orb %al, %r8b
jmp 0x19af3
leaq 0x392a0d(%rip), %rax    # 0x3ac4e4
movswl (%rax), %eax
movb $0x7, %r8b
cmpl %eax, %edi
jne 0x19af3
leaq 0x392a00(%rip), %rax    # 0x3ac4e8
movb (%rax), %r8b
andb $0x8, %r8b
orb $0x7, %r8b
movslq -0xe(%rbp), %r12
subq %rbx, %r12
imulq %r10, %r12
shrq $0xe, %r12
movslq -0xa(%rbp), %r13
movq 0x90(%rsp), %rcx
subq %rcx, %r13
imulq %r10, %r13
shrq $0xe, %r13
movswq -0x6(%rbp), %rax
shlq $0x5, %rax
leaq 0x19ef27(%rip), %rdx    # 0x1b8a50
movslq (%rdx,%rax), %r14
subq %rbx, %r14
imulq %r10, %r14
shrq $0xe, %r14
movslq 0x4(%rdx,%rax), %r15
subq %rcx, %r15
imulq %r10, %r15
shrq $0xe, %r15
testb $0x40, (%rbp)
movq %r11, 0x10(%rsp)
movq %rdi, 0x68(%rsp)
je 0x19c1b
movl %r14d, %eax
subl %r12d, %eax
movl %eax, %ecx
negl %ecx
cmovsl %eax, %ecx
movl %r15d, %eax
subl %r13d, %eax
movl %eax, %esi
negl %esi
cmovsl %eax, %esi
movl 0x160648(%rip), %edx    # 0x17a1c4
movb %r8b, 0x60(%rsp)
movzbl %r8b, %ebx
cmpl %esi, %ecx
jae 0x19bca
leal (%r12,%rdx), %edi
incl %edi
movl 0x160633(%rip), %ecx    # 0x17a1c8
leal (%rcx,%r13), %esi
addl %r14d, %edx
incl %edx
addl %r15d, %ecx
movl %ebx, %r8d
callq 0x18ded
movl 0x160615(%rip), %eax    # 0x17a1c4
leal (%r12,%rax), %edi
decl %edi
movl 0x16060d(%rip), %ecx    # 0x17a1c8
leal (%rcx,%r13), %esi
leal (%r14,%rax), %edx
decl %edx
addl %r15d, %ecx
jmp 0x19c0a
leal (%rdx,%r12), %edi
movl 0x1605f4(%rip), %eax    # 0x17a1c8
leal (%rax,%r13), %esi
incl %esi
addl %r14d, %edx
leal (%r15,%rax), %ecx
incl %ecx
movl %ebx, %r8d
callq 0x18ded
movl 0x1605d3(%rip), %edx    # 0x17a1c4
leal (%rdx,%r12), %edi
movl 0x1605cd(%rip), %eax    # 0x17a1c8
leal (%rax,%r13), %esi
decl %esi
addl %r14d, %edx
leal (%r15,%rax), %ecx
decl %ecx
movl %ebx, %r8d
callq 0x18ded
movb 0x60(%rsp), %r8b
addb $0x8, %r8b
cmpl $0x100, 0xc(%rsp)       # imm = 0x100
setge %bl
movl 0x160598(%rip), %eax    # 0x17a1c4
leal (%rax,%r12), %edi
movl 0x160592(%rip), %ecx    # 0x17a1c8
leal (%rcx,%r13), %esi
addl %eax, %r14d
addl %ecx, %r15d
movzbl %r8b, %r8d
movl %r14d, %edx
movl %r15d, %ecx
callq 0x18ded
leaq 0x19ede6(%rip), %rax    # 0x1b8a3c
movzwl (%rax), %eax
cmpw $0x1, %ax
sete %cl
andb %bl, %cl
cmpb $0x1, %cl
movq 0x38(%rsp), %r10
movq 0xa0(%rsp), %rbx
movq 0x10(%rsp), %r11
movq 0x68(%rsp), %rsi
jne 0x19e11
addl 0x16053b(%rip), %r12d   # 0x17a1c4
movw $0x1, %ax
cmpl $0x2, %r12d
jl 0x19e11
leaq 0x3ee34e(%rip), %rcx    # 0x407fec
movl (%rcx), %ecx
addl $-0x3, %ecx
cmpl %ecx, %r12d
jg 0x19e11
addl 0x160515(%rip), %r13d   # 0x17a1c8
cmpl $0x2, %r13d
jl 0x19e11
movl 0x1140a5(%rip), %ecx    # 0x12dd68
addl $-0x3, %ecx
cmpl %ecx, %r13d
jg 0x19e11
leaq 0x39280c(%rip), %rax    # 0x3ac4e2
movswl (%rax), %eax
cmpl %eax, %esi
je 0x19d0a
movb $0x2, %al
leaq 0x392800(%rip), %rcx    # 0x3ac4e6
cmpw $0x0, (%rcx)
jle 0x19d17
movl %esi, %ecx
shrl $0x3, %ecx
andl $0x7, %esi
leaq 0x8aaa5(%rip), %rdx     # 0xa47a0
movb (%rdx,%rsi), %dl
leaq 0x391fdb(%rip), %rsi    # 0x3abce0
testb %dl, (%rsi,%rcx)
je 0x19d17
leaq 0x3927d7(%rip), %rax    # 0x3ac4e8
movb (%rax), %al
andb $0x8, %al
orb $0x2, %al
leaq 0x164566(%rip), %r14    # 0x17e284
movl (%r14), %r8d
imull %r8d, %r13d
addl %r12d, %r13d
movslq %r13d, %rsi
leaq 0x16437e(%rip), %rcx    # 0x17e0b0
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 (%r14), %r9d
addl %r9d, %r9d
movslq %r9d, %r9
subq %r9, %r8
movb %al, (%r8)
movl (%r14), %r8d
addl %r8d, %r8d
movslq %r8d, %r8
movq %rcx, %r9
subq %r8, %r9
movb %al, (%r9)
leaq (%rdi,%rsi), %r8
incq %r8
movl (%r14), %r9d
addl %r9d, %r9d
movslq %r9d, %r9
subq %r9, %r8
movb %al, (%r8)
addq %rdi, %rsi
addq $0x2, %rsi
movl (%r14), %edi
addl %edi, %edi
movslq %edi, %rdi
movq %rsi, %r8
subq %rdi, %r8
movb %al, (%r8)
movl (%r14), %edi
addl %edi, %edi
movslq %edi, %rdi
movb %al, -0x2(%rdi,%rcx)
movl (%r14), %edi
addl %edi, %edi
movslq %edi, %rdi
movb %al, -0x1(%rdi,%rcx)
movl (%r14), %edi
addl %edi, %edi
movslq %edi, %rdi
movb %al, (%rdi,%rcx)
movl (%r14), %edi
addl %edi, %edi
movslq %edi, %rdi
movb %al, 0x1(%rdi,%rcx)
movl (%r14), %edi
addl %edi, %edi
movslq %edi, %rdi
movb %al, 0x2(%rdi,%rcx)
movslq (%r14), %rdi
subq %rdi, %rdx
movb %al, (%rdx)
movb %al, -0x4(%rsi)
movslq (%r14), %rdx
movb %al, -0x2(%rdx,%rcx)
movslq (%r14), %rdx
movq %rsi, %rdi
subq %rdx, %rdi
movb %al, (%rdi)
movb %al, (%rsi)
movslq (%r14), %rdx
movb %al, 0x2(%rdx,%rcx)
leaq 0x19ec2e(%rip), %rax    # 0x1b8a3c
movzwl (%rax), %eax
addq $-0x20, %rbp
decl %r11d
jg 0x19a0c
callq 0xacd7
movq 0x38(%rsp), %r11
cmpl $0x100, 0xc(%rsp)       # imm = 0x100
setge %cl
leaq 0x19ec02(%rip), %rax    # 0x1b8a3c
movzwl (%rax), %eax
testw %ax, %ax
sete %dl
orb %cl, %dl
leaq 0x3b6114(%rip), %rcx    # 0x3cff60
movzwl (%rcx), %ecx
testw %cx, %cx
setg %sil
andb %dl, %sil
cmpb $0x1, %sil
movq 0x90(%rsp), %rdi
jne 0x1a6cf
xorl %esi, %esi
leaq 0x262e3c(%rip), %r8     # 0x27ccb0
leaq 0x392667(%rip), %r9     # 0x3ac4e2
leaq 0x392666(%rip), %r10    # 0x3ac4e8
leaq 0x39265d(%rip), %r13    # 0x3ac4e6
leaq 0x392680(%rip), %rdx    # 0x3ac510
movzwl (%rdx,%rsi,2), %edx
testw %dx, %dx
js 0x1a6bf
movq %rsi, 0xb0(%rsp)
movzwl %dx, %ecx
movl %ecx, %ebp
cmpw $0x1, %ax
jne 0x19f11
imulq $0x2c, %rbp, %rdx
leaq (%r8,%rdx), %r15
addq %r8, %rdx
addq $0xc, %rdx
movq %rdx, 0x10(%rsp)
movb (%rdx), %r12b
andb $0x1, %r12b
addb %r12b, %r12b
addb $0x3, %r12b
leal 0x4000(%rcx), %edx
movswl (%r9), %esi
cmpl %esi, %edx
je 0x19f06
cmpw $0x0, (%r13)
jle 0x19f55
movl %ecx, %edx
shrl $0x3, %edx
andl $0x7, %ecx
leaq 0x8a8a9(%rip), %rsi     # 0xa47a0
movb (%rsi,%rcx), %cl
leaq 0x3915df(%rip), %rsi    # 0x3ab4e0
testb %cl, (%rsi,%rdx)
je 0x19f55
movb (%r10), %cl
andb $0x8, %cl
orb %cl, %r12b
jmp 0x19f55
movl %ecx, %edx
shrl $0x3, %edx
andl $0x7, %ecx
leaq 0x8a880(%rip), %rsi     # 0xa47a0
movb (%rsi,%rcx), %cl
leaq 0x3915b6(%rip), %rsi    # 0x3ab4e0
testb %cl, (%rsi,%rdx)
je 0x1a699
imulq $0x2c, %rbp, %rcx
leaq (%r8,%rcx), %r15
addq %r8, %rcx
addq $0xc, %rcx
movq %rcx, 0x10(%rsp)
movb (%rcx), %r12b
andb $0x1, %r12b
addb %r12b, %r12b
addb $0x3, %r12b
movslq (%r15), %r14
subq %rbx, %r14
imulq %r11, %r14
shrq $0xe, %r14
movl 0x16025b(%rip), %ecx    # 0x17a1c4
addl %r14d, %ecx
cmpl $0x2, %ecx
jl 0x1a699
leaq 0x3ee070(%rip), %rdx    # 0x407fec
movl (%rdx), %edx
addl $-0x3, %edx
cmpl %edx, %ecx
jg 0x1a699
movq %r15, 0x68(%rsp)
movslq 0x4(%r15), %r15
subq %rdi, %r15
imulq %r11, %r15
shrq $0xe, %r15
movl 0x160225(%rip), %edx    # 0x17a1c8
addl %r15d, %edx
cmpl $0x2, %edx
jl 0x1a699
movl 0x113db3(%rip), %esi    # 0x12dd68
addl $-0x3, %esi
cmpl %esi, %edx
jg 0x1a699
leaq 0x1642bd(%rip), %r13    # 0x17e284
movl (%r13), %edi
imull %edi, %edx
addl %ecx, %edx
movslq %edx, %rdx
leaq 0x1640d6(%rip), %rax    # 0x17e0b0
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 %r12b, (%r8)
movl (%r13), %edi
addl %edi, %edi
movslq %edi, %rdi
movq %rcx, %r8
subq %rdi, %r8
movb %r12b, (%r8)
leaq (%rsi,%rdx), %rdi
incq %rdi
movl (%r13), %r8d
addl %r8d, %r8d
movslq %r8d, %r8
movq %rdi, %r9
subq %r8, %r9
movb %r12b, (%r9)
movl (%r13), %r8d
addl %r8d, %r8d
movslq %r8d, %r8
movb %r12b, -0x1(%r8,%rcx)
movl (%r13), %r8d
addl %r8d, %r8d
movslq %r8d, %r8
movb %r12b, (%r8,%rcx)
movl (%r13), %r8d
addl %r8d, %r8d
movslq %r8d, %r8
movb %r12b, 0x1(%r8,%rcx)
leaq (%rsi,%rdx), %r8
addq $-0x2, %r8
movslq (%r13), %r9
movq %r8, %r10
subq %r9, %r10
movb %r12b, (%r10)
movb %r12b, (%r8)
movslq (%r13), %r8
movb %r12b, -0x2(%r8,%rcx)
addq %rsi, %rdx
addq $0x2, %rdx
movslq (%r13), %rsi
movq %rdx, %r8
subq %rsi, %r8
movb %r12b, (%r8)
movb %r12b, (%rdx)
movslq (%r13), %rdx
movb %r12b, 0x2(%rdx,%rcx)
movslq (%r13), %rdx
movb %r12b, 0x1(%rdx,%rcx)
movslq (%r13), %rdx
movb %r12b, -0x1(%rdx,%rcx)
movslq (%r13), %rcx
subq %rcx, %rdi
movb %r12b, (%rdi)
movslq (%r13), %rcx
subq %rcx, %rax
movb %r12b, (%rax)
movzwl 0x11386c(%rip), %eax    # 0x12d928
movq 0x10(%rsp), %rcx
movzwl (%rcx), %edx
movzbl %r12b, %ecx
movl %ecx, 0xc(%rsp)
testw %ax, %ax
movq %rbp, 0x60(%rsp)
je 0x1a508
movl %edx, %ecx
andl $0x30, %ecx
je 0x1a508
xorps %xmm0, %xmm0
movaps %xmm0, 0x80(%rsp)
movaps %xmm0, 0x70(%rsp)
movq 0x68(%rsp), %r11
movswq 0xe(%r11), %rcx
movzwl 0x1c(%r11), %r13d
movzbl 0x14(%r11), %r9d
leaq 0x220950(%rip), %rsi    # 0x23aa60
movl (%rsi,%rcx,4), %esi
movl %esi, %edi
shrl $0x8, %edi
movsbl %dil, %edi
movsbl 0x16(%r11), %r10d
addl %edi, %r10d
movl %r10d, %r8d
negl %r8d
testb $0x4, %dl
cmovel %r10d, %r8d
testb $0x20, %dl
jne 0x1a1e8
movl %r13d, %edx
movl $0x7ff, %edi            # imm = 0x7FF
andl %edi, %edx
leaq 0x3b4c05(%rip), %r10    # 0x3ced50
movswq (%r10,%rdx,2), %rdx
imulq %r9, %rdx
leal 0x600(%r13), %esi
andl %edi, %esi
movswq (%r10,%rsi,2), %rdi
imulq %r9, %rdi
leaq 0x3f5eb3(%rip), %rsi    # 0x410020
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, 0x24(%rsp)
movl %r9d, 0x28(%rsp)
movl %edx, 0x20(%rsp)
movl %edx, 0x2c(%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 $0x1, %ebx
movl %edi, %r8d
movl %edx, %r10d
movl %r11d, %esi
movl %r9d, 0x58(%rsp)
jmp 0x1a314
shrl $0x10, %esi
movsbl %sil, %esi
movsbl 0x17(%r11), %edi
addl %esi, %edi
movl %edi, %r10d
negl %r10d
testb $0x8, %dl
cmovel %edi, %r10d
movq %r9, %rdx
movzbl 0x15(%r11), %r9d
movq %r9, 0x58(%rsp)
leal 0x200(%r13), %esi
movl $0x7ff, %r11d           # imm = 0x7FF
andl %r11d, %esi
leaq 0x3b4b29(%rip), %rbx    # 0x3ced50
movswq (%rbx,%rsi,2), %rdi
movl %r13d, %esi
andl %r11d, %esi
movswq (%rbx,%rsi,2), %r11
leaq 0x3f5de2(%rip), %rsi    # 0x410020
movswq (%rsi,%rcx,2), %rsi
movl %esi, %ebx
sarl %ebx
addl %ebx, %r8d
movw %ax, 0x1c(%rsp)
movq %r13, %rax
movslq %r8d, %r13
imulq %rdx, %r13
leaq 0x3e7580(%rip), %r8     # 0x4017e0
movswq (%r8,%rcx,2), %rbx
movl %ebx, %ecx
sarl %ecx
addl %r10d, %ecx
movslq %ecx, %r8
imulq %r9, %r8
movq %r13, %rcx
imulq %r11, %rcx
movq %r8, %r10
imulq %rdi, %r10
addq %rcx, %r10
shrq $0x10, %r10
movl %r10d, 0x20(%rsp)
imulq %r11, %r8
imulq %rdi, %r13
subq %r13, %r8
movq %rax, %r13
movzwl 0x1c(%rsp), %eax
shrq $0x10, %r8
movl %r8d, 0x40(%rsp)
imulq %rdx, %rsi
movq %rsi, %r9
imulq %r11, %r9
shrq $0x10, %r9
movl %r10d, %ecx
subl %r9d, %ecx
movl %ecx, 0x24(%rsp)
imulq %rdi, %rsi
shrq $0x10, %rsi
addl %r8d, %esi
movl %esi, 0x44(%rsp)
imulq 0x58(%rsp), %rbx
imulq %rbx, %rdi
shrq $0x10, %rdi
movl %ecx, 0x58(%rsp)
movl %ecx, %r9d
subl %edi, %r9d
movl %r9d, 0x28(%rsp)
movl %r10d, %edx
subl %edi, %edx
movl %edx, 0x2c(%rsp)
imulq %r11, %rbx
shrq $0x10, %rbx
movl %esi, %r11d
subl %ebx, %r11d
movl %r11d, 0x48(%rsp)
movl %r8d, %edi
subl %ebx, %edi
movl $0x4, %ebx
movl %edi, 0x4c(%rsp)
cmpw $0x2, %ax
jl 0x1a3cf
movq %r13, %rax
addl $0x700, %r13d           # imm = 0x700
addl $0x100, %eax            # imm = 0x100
movl $0x7ff, %ecx            # imm = 0x7FF
andl %ecx, %eax
movl %r9d, 0x1c(%rsp)
movl 0x58(%rsp), %r9d
leaq 0x3b4a07(%rip), %rcx    # 0x3ced50
movswq (%rcx,%rax,2), %rax
movslq 0x89ca3(%rip), %rcx     # 0xa3ff8
movq %rcx, 0xa8(%rsp)
imulq %rcx, %rax
shrq $0xe, %rax
movl $0x7ff, %ecx            # imm = 0x7FF
andl %ecx, %r13d
leaq 0x3b49dc(%rip), %rcx    # 0x3ced50
movswq (%rcx,%r13,2), %r13
imulq 0xa8(%rsp), %r13
shrq $0xe, %r13
subl %r13d, %r9d
movl %r9d, 0x84(%rsp)
addl %eax, %esi
movl %esi, 0x74(%rsp)
addl %eax, %r10d
movl %r10d, 0x80(%rsp)
addl %r13d, %r8d
movl %r8d, 0x70(%rsp)
addl %r13d, %edx
movl %edx, 0x8c(%rsp)
subl %eax, %edi
movl %edi, 0x7c(%rsp)
movl 0x1c(%rsp), %ecx
subl %eax, %ecx
movl %ecx, 0x88(%rsp)
subl %r13d, %r11d
movl %r11d, 0x78(%rsp)
xorl %eax, %eax
movq 0x38(%rsp), %rdx
movslq 0x20(%rsp,%rax,4), %rcx
imulq %rdx, %rcx
shrq $0xe, %rcx
movl %ecx, 0x20(%rsp,%rax,4)
movslq 0x40(%rsp,%rax,4), %rcx
imulq %rdx, %rcx
shrq $0xe, %rcx
movl %ecx, 0x40(%rsp,%rax,4)
movslq 0x80(%rsp,%rax,4), %rcx
imulq %rdx, %rcx
shrq $0xe, %rcx
movl %ecx, 0x80(%rsp,%rax,4)
movslq 0x70(%rsp,%rax,4), %rcx
imulq %rdx, %rcx
shrq $0xe, %rcx
movl %ecx, 0x70(%rsp,%rax,4)
incq %rax
cmpq $0x4, %rax
jne 0x1a3d6
movl $0x99999999, 0x89be5(%rip) # imm = 0x99999999
negq %rbx
movl $0x1, %r13d
movl 0xc(%rsp), %ebp
movl 0x15fd7e(%rip), %edx    # 0x17a1c4
addl %r14d, %edx
movl 0x1c(%rsp,%r13,4), %edi
addl %edx, %edi
movl 0x15fd72(%rip), %ecx    # 0x17a1c8
addl %r15d, %ecx
movl 0x3c(%rsp,%r13,4), %esi
addl %ecx, %esi
movl %r13d, %eax
andl $0x3, %eax
shll $0x2, %eax
addl 0x20(%rsp,%rax), %edx
addl 0x40(%rsp,%rax), %ecx
movl %ebp, %r8d
callq 0x18ded
leaq (%rbx,%r13), %rax
incq %rax
incq %r13
cmpq $0x1, %rax
jne 0x1a440
cmpw $0x2, 0x113497(%rip)    # 0x12d928
jl 0x1a4e4
movl $0x11111111, 0x89b7b(%rip) # imm = 0x11111111
movl $0x1, %ebx
movl 0x15fd1c(%rip), %edx    # 0x17a1c4
addl %r14d, %edx
movl 0x7c(%rsp,%rbx,4), %edi
addl %edx, %edi
movl 0x15fd11(%rip), %ecx    # 0x17a1c8
addl %r15d, %ecx
movl 0x6c(%rsp,%rbx,4), %esi
addl %ecx, %esi
movl %ebx, %eax
andl $0x3, %eax
shll $0x2, %eax
addl 0x80(%rsp,%rax), %edx
addl 0x70(%rsp,%rax), %ecx
movl %ebp, %r8d
callq 0x18ded
incq %rbx
cmpq $0x5, %rbx
jne 0x1a4a2
movl $0xffffffff, 0x89b2a(%rip) # imm = 0xFFFFFFFF
movq 0x10(%rsp), %rax
movzwl (%rax), %edx
movq 0x38(%rsp), %r11
movq 0xa0(%rsp), %rbx
movq 0x60(%rsp), %rbp
movq 0x68(%rsp), %rax
movl 0x1c(%rax), %eax
leal 0x200(%rax), %ecx
movl $0x7ff, %esi            # imm = 0x7FF
andl %esi, %ecx
leaq 0x3b482c(%rip), %rdi    # 0x3ced50
movswq (%rdi,%rcx,2), %rcx
imulq %r11, %rcx
shrq $0xb, %rcx
movslq %ecx, %rcx
imulq $0x2aaaaaab, %rcx, %r9  # imm = 0x2AAAAAAB
movq %r9, %rcx
shrq $0x3f, %rcx
sarq $0x27, %r9
addl %ecx, %r9d
movl %eax, %ecx
andl %esi, %ecx
movswq (%rdi,%rcx,2), %rcx
imulq %r11, %rcx
shrq $0xb, %rcx
movslq %ecx, %rcx
imulq $0x2aaaaaab, %rcx, %r13 # imm = 0x2AAAAAAB
movq %r13, %rcx
shrq $0x3f, %rcx
sarq $0x27, %r13
addl %ecx, %r13d
btl $0x8, %edx
jae 0x1a63d
addl $0x100, %eax            # imm = 0x100
movl 0x15fc3d(%rip), %edi    # 0x17a1c4
addl %r14d, %edi
btl $0x9, %eax
movq %r9, 0x10(%rsp)
jb 0x1a5de
movl 0x15fc2d(%rip), %eax    # 0x17a1c8
leal (%rax,%r15), %esi
decl %esi
addl %r15d, %eax
leal (%rdi,%r9), %edx
leal (%rax,%r13), %ecx
decl %ecx
movl 0xc(%rsp), %r8d
movq %r9, %rbp
callq 0x18ded
movl 0x15fc03(%rip), %edi    # 0x17a1c4
addl %r14d, %edi
movl 0x15fbfe(%rip), %eax    # 0x17a1c8
leal (%rax,%r15), %esi
incl %esi
addl %r15d, %eax
leal (%rdi,%rbp), %edx
leal (%rax,%r13), %ecx
incl %ecx
jmp 0x1a625
movl 0x15fbe4(%rip), %esi    # 0x17a1c8
addl %r15d, %esi
movl %edi, %eax
decl %eax
leal (%rdi,%r9), %edx
decl %edx
leal (%rsi,%r13), %ecx
movl %eax, %edi
movl 0xc(%rsp), %r8d
movq %r9, %rbp
callq 0x18ded
movl 0x15fbba(%rip), %eax    # 0x17a1c4
leal (%rax,%r14), %edi
incl %edi
addl %r14d, %eax
movl 0x15fbaf(%rip), %esi    # 0x17a1c8
addl %r15d, %esi
leal (%rax,%rbp), %edx
incl %edx
leal (%rsi,%r13), %ecx
movl 0xc(%rsp), %r8d
callq 0x18ded
addb $0x8, %r12b
movq 0x60(%rsp), %rbp
movq 0x10(%rsp), %r9
addl 0x15fb80(%rip), %r14d   # 0x17a1c4
addl 0x15fb7d(%rip), %r15d   # 0x17a1c8
addl %r14d, %r9d
addl %r15d, %r13d
movzbl %r12b, %r8d
movl %r14d, %edi
movl %r15d, %esi
movl %r9d, %edx
movl %r13d, %ecx
callq 0x18ded
leaq 0x19e3cf(%rip), %rax    # 0x1b8a3c
movzwl (%rax), %eax
movq 0x38(%rsp), %r11
movq 0x90(%rsp), %rdi
leaq 0x26262c(%rip), %r8     # 0x27ccb0
leaq 0x391e57(%rip), %r9     # 0x3ac4e2
leaq 0x391e56(%rip), %r10    # 0x3ac4e8
leaq 0x391e4d(%rip), %r13    # 0x3ac4e6
leaq 0x39be80(%rip), %rcx    # 0x3b6520
movzwl (%rcx,%rbp,2), %edx
testw %dx, %dx
jns 0x19ea5
leaq 0x3b58ac(%rip), %rcx    # 0x3cff60
movzwl (%rcx), %ecx
movq 0xb0(%rsp), %rsi
incq %rsi
movswq %cx, %rdx
cmpq %rdx, %rsi
jl 0x19e89
movq %r11, %rbx
callq 0xacd7
movzwl 0x9c(%rsp), %eax
leal 0x200(%rax), %ecx
movl $0x7ff, %edx            # imm = 0x7FF
andl %edx, %ecx
leaq 0x3b465d(%rip), %rsi    # 0x3ced50
movswq (%rsi,%rcx,2), %rcx
imulq %rbx, %rcx
shrq $0xb, %rcx
movslq %ecx, %rcx
imulq $0x2aaaaaab, %rcx, %r14 # imm = 0x2AAAAAAB
movq %r14, %rcx
shrq $0x3f, %rcx
sarq $0x27, %r14
addl %ecx, %r14d
andl %edx, %eax
movswq (%rsi,%rax,2), %rax
imulq %rbx, %rax
shrq $0xb, %rax
cltq
imulq $0x2aaaaaab, %rax, %rbx # imm = 0x2AAAAAAB
movq %rbx, %rax
shrq $0x3f, %rax
sarq $0x27, %rbx
addl %eax, %ebx
movl 0x15fa81(%rip), %edx    # 0x17a1c4
leal (%r14,%rdx), %edi
movl 0x15fa7b(%rip), %ecx    # 0x17a1c8
leal (%rbx,%rcx), %esi
subl %r14d, %edx
subl %ebx, %ecx
movl $0xf, %r8d
callq 0x18ded
movl 0x15fa5e(%rip), %edi    # 0x17a1c4
movl 0x15fa5c(%rip), %ecx    # 0x17a1c8
leal (%rcx,%rbx), %esi
leal (%rbx,%rdi), %edx
addl %r14d, %edi
subl %r14d, %ecx
movl $0xf, %r8d
callq 0x18ded
movl 0x15fa3b(%rip), %edx    # 0x17a1c4
leal (%rdx,%r14), %edi
movl 0x15fa35(%rip), %eax    # 0x17a1c8
leal (%rax,%rbx), %esi
subl %ebx, %edx
addl %eax, %r14d
movl %r14d, %ecx
movl $0xf, %r8d
addq $0xb8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x18ded