// File: /workspace/github_c_makefile_star2_O1/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, 0x40(%rsp)
leaq 0x19e12a(%rip), %rax    # 0x1b7a28
cmpl $0xc8, (%rax)
jne 0x19918
addq $0x98, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movl %esi, %r14d
movl %edi, %r15d
movl %edx, 0x94(%rsp)
leaq 0x19e110(%rip), %rax    # 0x1b7a3c
cmpw $0x0, (%rax)
jne 0x19978
movl %r8d, %r12d
callq 0xab51
leaq 0x16376f(%rip), %rax    # 0x17d0b0
movq (%rax), %rdi
leaq 0x163939(%rip), %rax    # 0x17d284
movl 0x113417(%rip), %esi    # 0x12cd68
imull (%rax), %esi
sarl $0x2, %esi
xorl %edx, %edx
callq 0x4abc9
callq 0xab51
movswl %r12w, %r8d
movl %r15d, %edi
movl %r14d, %esi
xorl %edx, %edx
movl 0x40(%rsp), %ecx
callq 0x19640
callq 0xab51
leaq 0x3fc2e4(%rip), %rax    # 0x415c68
movswl (%rax), %r11d
movslq 0x40(%rsp), %rax
movq %rax, 0x48(%rsp)
movslq %r15d, %rax
movq %rax, 0x80(%rsp)
movslq %r14d, %rax
movq %rax, 0x78(%rsp)
testl %r11d, %r11d
leaq 0x19e08d(%rip), %r10    # 0x1b7a3c
jle 0x19dbb
movzwl %r11w, %eax
shll $0x5, %eax
leaq 0x19e08d(%rip), %rcx    # 0x1b7a50
leaq (%rax,%rcx), %r13
addq $-0x12, %r13
leal -0x1(%r11), %r8d
cmpw $0x0, (%r10)
je 0x199ef
movswl -0x4(%r13), %eax
testl %eax, %eax
setns %cl
cmpl %eax, %r8d
setg %dl
testb %dl, %cl
je 0x19a4d
jmp 0x19dae
movl %r8d, %eax
shrl $0x3, %eax
movl %r8d, %ecx
andl $0x7, %ecx
leaq 0x89d9e(%rip), %rdx     # 0xa37a0
movb (%rdx,%rcx), %cl
leaq 0x3912d4(%rip), %rdx    # 0x3aace0
testb %cl, (%rdx,%rax)
je 0x19dae
movswl -0x4(%r13), %eax
testl %eax, %eax
sets %cl
cmpl %eax, %r8d
setle %dl
orb %cl, %dl
jne 0x19a4d
movl %eax, %ecx
shrl $0x3, %ecx
movl %eax, %edx
andl $0x7, %edx
leaq 0x89d66(%rip), %rsi     # 0xa37a0
movb (%rsi,%rdx), %dl
leaq 0x39129c(%rip), %rsi    # 0x3aace0
testb %dl, (%rsi,%rcx)
jne 0x19dae
testl %eax, %eax
movq 0x80(%rsp), %rdx
movq 0x78(%rsp), %rsi
js 0x19aa7
movb (%r13), %bl
andb $0x1, %bl
orb $0x4, %bl
leaq 0x391a75(%rip), %rax    # 0x3ab4e4
movswl (%rax), %eax
cmpl %eax, %r8d
movq 0x48(%rsp), %rcx
je 0x19a98
cltq
testw %ax, %ax
js 0x19acc
shlq $0x5, %rax
leaq 0x19dfc2(%rip), %rdi    # 0x1b7a50
movswl 0xa(%rdi,%rax), %eax
cmpl %eax, %r8d
jne 0x19acc
leaq 0x391a49(%rip), %rax    # 0x3ab4e8
movb (%rax), %al
andb $0x8, %al
orb %al, %bl
jmp 0x19acc
leaq 0x391a36(%rip), %rax    # 0x3ab4e4
movswl (%rax), %eax
movb $0x7, %bl
cmpl %eax, %r8d
movq 0x48(%rsp), %rcx
jne 0x19acc
leaq 0x391a24(%rip), %rax    # 0x3ab4e8
movb (%rax), %bl
andb $0x8, %bl
orb $0x7, %bl
movslq -0xe(%r13), %r12
subq %rdx, %r12
imulq %rcx, %r12
shrq $0xe, %r12
movslq -0xa(%r13), %rbp
subq %rsi, %rbp
imulq %rcx, %rbp
shrq $0xe, %rbp
movswq -0x6(%r13), %rax
shlq $0x5, %rax
leaq 0x19df56(%rip), %rdi    # 0x1b7a50
movslq (%rdi,%rax), %r14
subq %rdx, %r14
imulq %rcx, %r14
shrq $0xe, %r14
movslq 0x4(%rdi,%rax), %r15
subq %rsi, %r15
imulq %rcx, %r15
shrq $0xe, %r15
testb $0x40, (%r13)
movq %r11, 0x38(%rsp)
movq %r8, 0x88(%rsp)
je 0x19be1
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 0x15f674(%rip), %edx    # 0x1791c4
movzbl %bl, %r8d
cmpl %esi, %ecx
movl %r8d, 0x8(%rsp)
jae 0x19b99
leal (%r12,%rdx), %edi
incl %edi
movl 0x15f65f(%rip), %ecx    # 0x1791c8
leal (%rcx,%rbp), %esi
addl %r14d, %edx
incl %edx
addl %r15d, %ecx
callq 0x18db3
movl 0x15f645(%rip), %eax    # 0x1791c4
leal (%r12,%rax), %edi
decl %edi
movl 0x15f63d(%rip), %ecx    # 0x1791c8
leal (%rcx,%rbp), %esi
leal (%r14,%rax), %edx
decl %edx
addl %r15d, %ecx
jmp 0x19bd4
leal (%rdx,%r12), %edi
movl 0x15f625(%rip), %eax    # 0x1791c8
leal (%rax,%rbp), %esi
incl %esi
addl %r14d, %edx
leal (%r15,%rax), %ecx
incl %ecx
callq 0x18db3
movl 0x15f608(%rip), %edx    # 0x1791c4
leal (%rdx,%r12), %edi
movl 0x15f602(%rip), %eax    # 0x1791c8
leal (%rax,%rbp), %esi
decl %esi
addl %r14d, %edx
leal (%r15,%rax), %ecx
decl %ecx
movl 0x8(%rsp), %r8d
callq 0x18db3
addb $0x8, %bl
movl 0x15f5dd(%rip), %eax    # 0x1791c4
leal (%rax,%r12), %edi
movl 0x15f5d7(%rip), %ecx    # 0x1791c8
leal (%rcx,%rbp), %esi
addl %eax, %r14d
addl %ecx, %r15d
movzbl %bl, %r8d
movl %r14d, %edx
movl %r15d, %ecx
callq 0x18db3
cmpl $0x100, 0x40(%rsp)      # imm = 0x100
leaq 0x19de24(%rip), %r10    # 0x1b7a3c
movq 0x38(%rsp), %r11
movq 0x88(%rsp), %rsi
jl 0x19dae
cmpw $0x1, (%r10)
jne 0x19dae
addl 0x15f587(%rip), %r12d   # 0x1791c4
cmpl $0x2, %r12d
jl 0x19dae
leaq 0x3ed39e(%rip), %rax    # 0x406fec
movl (%rax), %eax
addl $-0x3, %eax
cmpl %eax, %r12d
jg 0x19dae
addl 0x15f566(%rip), %ebp    # 0x1791c8
cmpl $0x2, %ebp
jl 0x19dae
movl 0x1130f7(%rip), %eax    # 0x12cd68
addl $-0x3, %eax
cmpl %eax, %ebp
jg 0x19dae
leaq 0x39185f(%rip), %rax    # 0x3ab4e2
movswl (%rax), %eax
cmpl %eax, %esi
je 0x19cb7
movb $0x2, %al
leaq 0x391853(%rip), %rcx    # 0x3ab4e6
cmpw $0x0, (%rcx)
jle 0x19cc4
movl %esi, %ecx
shrl $0x3, %ecx
andl $0x7, %esi
leaq 0x89af8(%rip), %rdx     # 0xa37a0
movb (%rdx,%rsi), %dl
leaq 0x39102e(%rip), %rsi    # 0x3aace0
testb %dl, (%rsi,%rcx)
je 0x19cc4
leaq 0x39182a(%rip), %rax    # 0x3ab4e8
movb (%rax), %al
andb $0x8, %al
orb $0x2, %al
leaq 0x1635b9(%rip), %rbx    # 0x17d284
movl (%rbx), %r8d
imull %r8d, %ebp
addl %r12d, %ebp
movslq %ebp, %rsi
leaq 0x1633d1(%rip), %rcx    # 0x17d0b0
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 (%rbx), %r9d
addl %r9d, %r9d
movslq %r9d, %r9
subq %r9, %r8
movb %al, (%r8)
movl (%rbx), %r8d
addl %r8d, %r8d
movslq %r8d, %r8
movq %rcx, %r9
subq %r8, %r9
movb %al, (%r9)
leaq (%rdi,%rsi), %r8
incq %r8
movl (%rbx), %r9d
addl %r9d, %r9d
movslq %r9d, %r9
subq %r9, %r8
movb %al, (%r8)
addq %rdi, %rsi
addq $0x2, %rsi
movl (%rbx), %edi
addl %edi, %edi
movslq %edi, %rdi
movq %rsi, %r8
subq %rdi, %r8
movb %al, (%r8)
movl (%rbx), %edi
addl %edi, %edi
movslq %edi, %rdi
movb %al, -0x2(%rdi,%rcx)
movl (%rbx), %edi
addl %edi, %edi
movslq %edi, %rdi
movb %al, -0x1(%rdi,%rcx)
movl (%rbx), %edi
addl %edi, %edi
movslq %edi, %rdi
movb %al, (%rdi,%rcx)
movl (%rbx), %edi
addl %edi, %edi
movslq %edi, %rdi
movb %al, 0x1(%rdi,%rcx)
movl (%rbx), %edi
addl %edi, %edi
movslq %edi, %rdi
movb %al, 0x2(%rdi,%rcx)
movslq (%rbx), %rdi
subq %rdi, %rdx
movb %al, (%rdx)
movb %al, -0x4(%rsi)
movslq (%rbx), %rdx
movb %al, -0x2(%rdx,%rcx)
movslq (%rbx), %rdx
movq %rsi, %rdi
subq %rdx, %rdi
movb %al, (%rdi)
movb %al, (%rsi)
movslq (%rbx), %rdx
movb %al, 0x2(%rdx,%rcx)
addq $-0x20, %r13
decl %r11d
jg 0x199cb
callq 0xab51
leaq 0x19dc75(%rip), %rdi    # 0x1b7a3c
cmpl $0x100, 0x40(%rsp)      # imm = 0x100
setge %al
cmpw $0x0, (%rdi)
sete %cl
orb %al, %cl
cmpb $0x1, %cl
movq 0x48(%rsp), %rbp
movq 0x80(%rsp), %r8
movq 0x78(%rsp), %r9
jne 0x1a5d3
leaq 0x3b5163(%rip), %rax    # 0x3cef60
cmpw $0x0, (%rax)
jle 0x1a5d3
xorl %ecx, %ecx
leaq 0x261ea0(%rip), %r10    # 0x27bcb0
leaq 0x3916cb(%rip), %r11    # 0x3ab4e2
leaq 0x3916ca(%rip), %r13    # 0x3ab4e8
movq %rcx, 0x40(%rsp)
leaq 0x3916e6(%rip), %rax    # 0x3ab510
movzwl (%rax,%rcx,2), %eax
testw %ax, %ax
js 0x1a5b7
movzwl %ax, %eax
movzwl (%rdi), %ecx
movl %eax, %esi
cmpw $0x1, %cx
je 0x19e71
movl %eax, %edx
shrl $0x3, %edx
movq %rsi, %r14
movl %eax, %esi
andl $0x7, %esi
leaq 0x89947(%rip), %rbx     # 0xa37a0
movb (%rbx,%rsi), %sil
leaq 0x39067c(%rip), %rbx    # 0x3aa4e0
testb %sil, (%rbx,%rdx)
movq %r14, %rsi
je 0x1a5a7
imulq $0x2c, %rsi, %r12
movb 0xc(%r10,%r12), %bl
andb $0x1, %bl
addb %bl, %bl
addb $0x3, %bl
cmpw $0x1, %cx
jne 0x19ec9
leal 0x4000(%rax), %ecx
movswl (%r11), %edx
cmpl %edx, %ecx
je 0x19ec1
leaq 0x391649(%rip), %rcx    # 0x3ab4e6
cmpw $0x0, (%rcx)
jle 0x19ec9
movl %eax, %ecx
shrl $0x3, %ecx
andl $0x7, %eax
leaq 0x898ee(%rip), %rdx     # 0xa37a0
movb (%rdx,%rax), %al
leaq 0x390624(%rip), %rdx    # 0x3aa4e0
testb %al, (%rdx,%rcx)
je 0x19ec9
movb (%r13), %al
andb $0x8, %al
orb %al, %bl
addq %r10, %r12
movslq (%r12), %r14
subq %r8, %r14
imulq %rbp, %r14
shrq $0xe, %r14
movl 0x15f2e3(%rip), %eax    # 0x1791c4
addl %r14d, %eax
cmpl $0x2, %eax
jl 0x1a5a7
leaq 0x3ed0f8(%rip), %rcx    # 0x406fec
movl (%rcx), %ecx
addl $-0x3, %ecx
cmpl %ecx, %eax
jg 0x1a5a7
movslq 0x4(%r12), %r15
subq %r9, %r15
imulq %rbp, %r15
shrq $0xe, %r15
movl 0x15f2b1(%rip), %ecx    # 0x1791c8
addl %r15d, %ecx
cmpl $0x2, %ecx
jl 0x1a5a7
movl 0x112e3f(%rip), %edx    # 0x12cd68
addl $-0x3, %edx
cmpl %edx, %ecx
jg 0x1a5a7
movq %rsi, 0x88(%rsp)
leaq 0x163341(%rip), %r11    # 0x17d284
movl (%r11), %edi
imull %edi, %ecx
addl %eax, %ecx
movslq %ecx, %rdx
leaq 0x16315b(%rip), %rax    # 0x17d0b0
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 %bl, (%r8)
movl (%r11), %edi
addl %edi, %edi
movslq %edi, %rdi
movq %rcx, %r8
subq %rdi, %r8
movb %bl, (%r8)
leaq (%rsi,%rdx), %rdi
incq %rdi
movl (%r11), %r8d
addl %r8d, %r8d
movslq %r8d, %r8
movq %rdi, %r9
subq %r8, %r9
movb %bl, (%r9)
movl (%r11), %r8d
addl %r8d, %r8d
movslq %r8d, %r8
movb %bl, -0x1(%r8,%rcx)
movl (%r11), %r8d
addl %r8d, %r8d
movslq %r8d, %r8
movb %bl, (%r8,%rcx)
movl (%r11), %r8d
addl %r8d, %r8d
movslq %r8d, %r8
movb %bl, 0x1(%r8,%rcx)
leaq (%rsi,%rdx), %r8
addq $-0x2, %r8
movslq (%r11), %r9
movq %r8, %r10
subq %r9, %r10
movb %bl, (%r10)
movb %bl, (%r8)
movslq (%r11), %r8
movb %bl, -0x2(%r8,%rcx)
addq %rsi, %rdx
addq $0x2, %rdx
movslq (%r11), %rsi
movq %rdx, %r8
subq %rsi, %r8
movb %bl, (%r8)
movb %bl, (%rdx)
movslq (%r11), %rdx
movb %bl, 0x2(%rdx,%rcx)
movslq (%r11), %rdx
movb %bl, 0x1(%rdx,%rcx)
movslq (%r11), %rdx
movb %bl, -0x1(%rdx,%rcx)
movslq (%r11), %rcx
subq %rcx, %rdi
movb %bl, (%rdi)
movslq (%r11), %rcx
subq %rcx, %rax
movb %bl, (%rax)
movzwl 0x112904(%rip), %eax    # 0x12c928
movzbl %bl, %ecx
movl %ecx, 0x38(%rsp)
testw %ax, %ax
je 0x1a41d
movzwl 0xc(%r12), %esi
testb $0x30, %sil
je 0x1a41d
xorps %xmm0, %xmm0
movaps %xmm0, 0x60(%rsp)
movaps %xmm0, 0x50(%rsp)
movswq 0xe(%r12), %rdi
movzwl 0x1c(%r12), %r13d
movzbl 0x14(%r12), %edx
leaq 0x21f9f6(%rip), %rcx    # 0x239a60
movl (%rcx,%rdi,4), %r8d
movl %r8d, %r9d
shrl $0x8, %r9d
movsbl %r9b, %r9d
movsbl 0x16(%r12), %r11d
addl %r9d, %r11d
movl %r11d, %r10d
negl %r10d
testb $0x4, %sil
cmovel %r11d, %r10d
testb $0x20, %sil
jne 0x1a137
movl %r13d, %ecx
movl $0x7ff, %esi            # imm = 0x7FF
andl %esi, %ecx
leaq 0x3b3ca5(%rip), %r9     # 0x3cdd50
movswq (%r9,%rcx,2), %r8
imulq %rdx, %r8
leal 0x600(%r13), %ecx
andl %esi, %ecx
movswq (%r9,%rcx,2), %rsi
imulq %rdx, %rsi
leaq 0x3f4f53(%rip), %rcx    # 0x40f020
movswq (%rcx,%rdi,2), %rdx
movl %edx, %ecx
sarl %ecx
addl %ecx, %r10d
movslq %r10d, %rdi
movq %rdi, %rcx
imulq %r8, %rcx
shrq $0x10, %rcx
imulq %rdx, %r8
shrq $0x10, %r8
subl %ecx, %r8d
negl %ecx
movl %ecx, 0x24(%rsp)
movl %ecx, 0x28(%rsp)
movl %r8d, 0x20(%rsp)
movl %r8d, 0x2c(%rsp)
imulq %rsi, %rdi
shrq $0x10, %rdi
imulq %rdx, %rsi
shrq $0x10, %rsi
subl %edi, %esi
movl %edi, %ecx
negl %ecx
movl %ecx, 0x14(%rsp)
movl %ecx, 0x18(%rsp)
movl %esi, 0x10(%rsp)
movl %esi, 0x1c(%rsp)
movl $0x1, %r8d
jmp 0x1a252
shrl $0x10, %r8d
movsbl %r8b, %r8d
movsbl 0x17(%r12), %r9d
addl %r8d, %r9d
movl %r9d, %ebp
negl %ebp
testb $0x8, %sil
cmovel %r9d, %ebp
movzbl 0x15(%r12), %r11d
leal 0x200(%r13), %esi
movl $0x7ff, %ecx            # imm = 0x7FF
andl %ecx, %esi
leaq 0x3b3be0(%rip), %r9     # 0x3cdd50
movswq (%r9,%rsi,2), %r8
movl %r13d, %esi
andl %ecx, %esi
movswq (%r9,%rsi,2), %r9
leaq 0x3f4e9a(%rip), %rcx    # 0x40f020
movswq (%rcx,%rdi,2), %rsi
movq %r13, 0x8(%rsp)
movl %esi, %r13d
sarl %r13d
addl %r13d, %r10d
movslq %r10d, %rcx
imulq %rdx, %rcx
leaq 0x3e6639(%rip), %r10    # 0x4007e0
movswq (%r10,%rdi,2), %rdi
movl %edi, %r10d
sarl %r10d
addl %ebp, %r10d
movslq %r10d, %r10
imulq %r11, %r10
movq %rcx, %rbp
imulq %r9, %rbp
movq %r10, %r13
imulq %r8, %r13
addq %rbp, %r13
movq 0x48(%rsp), %rbp
shrq $0x10, %r13
imulq %r9, %r10
imulq %r8, %rcx
subq %rcx, %r10
imulq %rdx, %rsi
movq %rsi, %rcx
imulq %r9, %rcx
shrq $0x10, %rcx
movl %r13d, %edx
subl %ecx, %edx
imulq %r11, %rdi
movl %r13d, 0x20(%rsp)
movl %edx, 0x24(%rsp)
imulq %r8, %rsi
imulq %rdi, %r8
shrq $0x10, %r8
subl %r8d, %edx
movl %edx, 0x28(%rsp)
subl %r8d, %r13d
movl %r13d, 0x2c(%rsp)
movq 0x8(%rsp), %r13
imulq %r9, %rdi
shrq $0x10, %r10
movl %r10d, 0x10(%rsp)
shrq $0x10, %rsi
addl %r10d, %esi
movl %esi, 0x14(%rsp)
shrq $0x10, %rdi
subl %edi, %esi
movl %esi, 0x18(%rsp)
subl %edi, %r10d
movl %r10d, 0x1c(%rsp)
movl $0x4, %r8d
cmpw $0x2, %ax
jl 0x1a2ed
movl %r13d, %ecx
addl $0x700, %ecx            # imm = 0x700
leal 0x100(%r13), %eax
movl $0x7ff, %esi            # imm = 0x7FF
andl %esi, %eax
leaq 0x3b3ad6(%rip), %rdi    # 0x3cdd50
movswq (%rdi,%rax,2), %rax
movslq 0x88d72(%rip), %rdx     # 0xa2ff8
imulq %rdx, %rax
shrq $0xe, %rax
andl %esi, %ecx
movswq (%rdi,%rcx,2), %rcx
imulq %rdx, %rcx
shrq $0xe, %rcx
movl 0x24(%rsp), %edx
movl 0x28(%rsp), %esi
subl %ecx, %edx
movl %edx, 0x64(%rsp)
movl 0x14(%rsp), %edx
addl %eax, %edx
movl %edx, 0x54(%rsp)
movl 0x20(%rsp), %edx
addl %eax, %edx
movl %edx, 0x60(%rsp)
movl 0x10(%rsp), %edx
addl %ecx, %edx
movl %edx, 0x50(%rsp)
movl 0x2c(%rsp), %edx
addl %ecx, %edx
movl %edx, 0x6c(%rsp)
movl 0x18(%rsp), %edx
movl 0x1c(%rsp), %edi
subl %eax, %edi
movl %edi, 0x5c(%rsp)
subl %eax, %esi
movl %esi, 0x68(%rsp)
subl %ecx, %edx
movl %edx, 0x58(%rsp)
movq %r12, 0x8(%rsp)
xorl %eax, %eax
movslq 0x20(%rsp,%rax,4), %rcx
imulq %rbp, %rcx
shrq $0xe, %rcx
movl %ecx, 0x20(%rsp,%rax,4)
movslq 0x10(%rsp,%rax,4), %rcx
imulq %rbp, %rcx
shrq $0xe, %rcx
movl %ecx, 0x10(%rsp,%rax,4)
movslq 0x60(%rsp,%rax,4), %rcx
imulq %rbp, %rcx
shrq $0xe, %rcx
movl %ecx, 0x60(%rsp,%rax,4)
movslq 0x50(%rsp,%rax,4), %rcx
imulq %rbp, %rcx
shrq $0xe, %rcx
movl %ecx, 0x50(%rsp,%rax,4)
incq %rax
cmpq $0x4, %rax
jne 0x1a2f4
movl $0x99999999, 0x88ccd(%rip) # imm = 0x99999999
negq %r8
movl $0x1, %ebp
movl 0x38(%rsp), %r13d
movl 0x15ee66(%rip), %edx    # 0x1791c4
addl %r14d, %edx
movl 0x1c(%rsp,%rbp,4), %edi
addl %edx, %edi
movl 0x15ee5b(%rip), %ecx    # 0x1791c8
addl %r15d, %ecx
movl 0xc(%rsp,%rbp,4), %esi
addl %ecx, %esi
movl %ebp, %eax
andl $0x3, %eax
shll $0x2, %eax
addl 0x20(%rsp,%rax), %edx
addl 0x10(%rsp,%rax), %ecx
movq %r15, %r12
movq %r8, %r15
movl %r13d, %r8d
callq 0x18db3
movq %r15, %r8
movq %r12, %r15
leaq (%r8,%rbp), %rax
incq %rax
incq %rbp
cmpq $0x1, %rax
jne 0x1a358
cmpw $0x2, 0x112576(%rip)    # 0x12c928
jl 0x1a409
movl %r13d, %ebp
movl $0x11111111, 0x88c57(%rip) # imm = 0x11111111
movl $0x1, %r13d
movl 0x15edf7(%rip), %edx    # 0x1791c4
addl %r14d, %edx
movl 0x5c(%rsp,%r13,4), %edi
addl %edx, %edi
movl 0x15edeb(%rip), %ecx    # 0x1791c8
addl %r15d, %ecx
movl 0x4c(%rsp,%r13,4), %esi
addl %ecx, %esi
movl %r13d, %eax
andl $0x3, %eax
shll $0x2, %eax
addl 0x60(%rsp,%rax), %edx
addl 0x50(%rsp,%rax), %ecx
movl %ebp, %r8d
callq 0x18db3
incq %r13
cmpq $0x5, %r13
jne 0x1a3c7
movl $0xffffffff, 0x88c05(%rip) # imm = 0xFFFFFFFF
movq 0x48(%rsp), %rbp
movq 0x8(%rsp), %r12
movl 0x1c(%r12), %eax
leal 0x200(%rax), %ecx
movl $0x7ff, %edx            # imm = 0x7FF
andl %edx, %ecx
leaq 0x3b391a(%rip), %rsi    # 0x3cdd50
movswq (%rsi,%rcx,2), %rcx
imulq %rbp, %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 %edx, %ecx
movswq (%rsi,%rcx,2), %rcx
imulq %rbp, %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
testb $0x1, 0xd(%r12)
je 0x1a54d
addl $0x100, %eax            # imm = 0x100
movl 0x15ed29(%rip), %edi    # 0x1791c4
addl %r14d, %edi
btl $0x9, %eax
movq %r9, 0x8(%rsp)
jb 0x1a4f3
movl 0x15ed19(%rip), %eax    # 0x1791c8
leal (%rax,%r15), %esi
decl %esi
addl %r15d, %eax
leal (%rdi,%r9), %edx
leal (%rax,%r13), %ecx
decl %ecx
movl 0x38(%rsp), %r8d
movq %r9, %r12
callq 0x18db3
movl 0x15ecef(%rip), %edi    # 0x1791c4
addl %r14d, %edi
movl 0x15ecea(%rip), %eax    # 0x1791c8
leal (%rax,%r15), %esi
incl %esi
addl %r15d, %eax
leal (%rdi,%r12), %edx
leal (%rax,%r13), %ecx
incl %ecx
jmp 0x1a53b
movl 0x15eccf(%rip), %esi    # 0x1791c8
addl %r15d, %esi
movl %edi, %eax
decl %eax
leal (%rdi,%r9), %edx
decl %edx
leal (%rsi,%r13), %ecx
movl %eax, %edi
movl 0x38(%rsp), %r8d
movq %r9, %r12
callq 0x18db3
movl 0x15eca5(%rip), %eax    # 0x1791c4
leal (%rax,%r14), %edi
incl %edi
addl %r14d, %eax
movl 0x15ec9a(%rip), %esi    # 0x1791c8
addl %r15d, %esi
leal (%r12,%rax), %edx
incl %edx
leal (%rsi,%r13), %ecx
movl 0x38(%rsp), %r8d
callq 0x18db3
addb $0x8, %bl
movq 0x8(%rsp), %r9
addl 0x15ec70(%rip), %r14d   # 0x1791c4
addl 0x15ec6d(%rip), %r15d   # 0x1791c8
addl %r14d, %r9d
addl %r15d, %r13d
movzbl %bl, %r8d
movl %r14d, %edi
movl %r15d, %esi
movl %r9d, %edx
movl %r13d, %ecx
callq 0x18db3
leaq 0x19d4bf(%rip), %rdi    # 0x1b7a3c
movq 0x80(%rsp), %r8
movq 0x78(%rsp), %r9
leaq 0x26171f(%rip), %r10    # 0x27bcb0
leaq 0x390f4a(%rip), %r11    # 0x3ab4e2
leaq 0x390f49(%rip), %r13    # 0x3ab4e8
movq 0x88(%rsp), %rsi
leaq 0x39af72(%rip), %rax    # 0x3b5520
movzwl (%rax,%rsi,2), %eax
jmp 0x19e2e
movq 0x40(%rsp), %rcx
incq %rcx
leaq 0x3b499a(%rip), %rax    # 0x3cef60
movswq (%rax), %rax
cmpq %rax, %rcx
jl 0x19e1e
callq 0xab51
movzwl 0x94(%rsp), %eax
leal 0x200(%rax), %ecx
movl $0x7ff, %edx            # imm = 0x7FF
andl %edx, %ecx
leaq 0x3b375c(%rip), %rsi    # 0x3cdd50
movswq (%rsi,%rcx,2), %rcx
imulq %rbp, %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 %rbp, %rax
shrq $0xb, %rax
cltq
imulq $0x2aaaaaab, %rax, %rbx # imm = 0x2AAAAAAB
movq %rbx, %rax
shrq $0x3f, %rax
sarq $0x27, %rbx
addl %eax, %ebx
movl 0x15eb80(%rip), %edx    # 0x1791c4
leal (%r14,%rdx), %edi
movl 0x15eb7a(%rip), %ecx    # 0x1791c8
leal (%rbx,%rcx), %esi
subl %r14d, %edx
subl %ebx, %ecx
movl $0xf, %r8d
callq 0x18db3
movl 0x15eb5d(%rip), %edi    # 0x1791c4
movl 0x15eb5b(%rip), %ecx    # 0x1791c8
leal (%rcx,%rbx), %esi
leal (%rbx,%rdi), %edx
addl %r14d, %edi
subl %r14d, %ecx
movl $0xf, %r8d
callq 0x18db3
movl 0x15eb3a(%rip), %edx    # 0x1791c4
leal (%rdx,%r14), %edi
movl 0x15eb34(%rip), %eax    # 0x1791c8
leal (%rax,%rbx), %esi
subl %ebx, %edx
addl %eax, %r14d
movl %r14d, %ecx
movl $0xf, %r8d
addq $0x98, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x18db3