// File: /workspace/github_c_makefile_star2_O2/jonof[P]jftekwar/jfbuild/src/engine.c
// Function: drawmapview
void drawmapview(int dax, int day, int zoome, short ang)
{
	walltype *wal;
	sectortype *sec;
	spritetype *spr;
	int tilenum, xoff, yoff, i, j, k, l, cosang, sinang, xspan, yspan;
	int xrepeat, yrepeat, x, y, x1, y1, x2, y2, x3, y3, x4, y4, bakx1, baky1;
	int s, w, ox, oy, startwall, cx1, cy1, cx2, cy2;
	int bakgxvect, bakgyvect, sortnum, gap, npoints;
	int xvect, yvect, xvect2, yvect2, daslope;

	beforedrawrooms = 0;

	clearbuf(&gotsector[0],(int)((numsectors+31)>>5),0L);

	cx1 = (windowx1<<12); cy1 = (windowy1<<12);
	cx2 = ((windowx2+1)<<12)-1; cy2 = ((windowy2+1)<<12)-1;
	zoome <<= 8;
	bakgxvect = divscale28(sintable[(1536-ang)&2047],zoome);
	bakgyvect = divscale28(sintable[(2048-ang)&2047],zoome);
	xvect = mulscale8(sintable[(2048-ang)&2047],zoome);
	yvect = mulscale8(sintable[(1536-ang)&2047],zoome);
	xvect2 = mulscale16(xvect,yxaspect);
	yvect2 = mulscale16(yvect,yxaspect);

	sortnum = 0;

	for(s=0,sec=&sector[s];s<numsectors;s++,sec++)
		if (show2dsector[s>>3]&pow2char[s&7])
		{
			npoints = 0; i = 0;
			startwall = sec->wallptr;
#if 0
			for(w=sec->wallnum,wal=&wall[startwall];w>0;w--,wal++)
			{
				ox = wal->x - dax; oy = wal->y - day;
				x = dmulscale16(ox,xvect,-oy,yvect) + (xdim<<11);
				y = dmulscale16(oy,xvect2,ox,yvect2) + (ydim<<11);
				i |= getclipmask(x-cx1,cx2-x,y-cy1,cy2-y);
				rx1[npoints] = x;
				ry1[npoints] = y;
				xb1[npoints] = wal->point2 - startwall;
				npoints++;
			}
#else
			j = startwall; l = 0;
			for(w=sec->wallnum,wal=&wall[startwall];w>0;w--,wal++,j++)
			{
				k = lastwall(j);
				if ((k > j) && (npoints > 0)) { xb1[npoints-1] = l; l = npoints; } //overwrite point2
					//wall[k].x wal->x wall[wal->point2].x
					//wall[k].y wal->y wall[wal->point2].y
				if (!dmulscale1(wal->x-wall[k].x,wall[wal->point2].y-wal->y,-(wal->y-wall[k].y),wall[wal->point2].x-wal->x)) continue;
				ox = wal->x - dax; oy = wal->y - day;
				x = dmulscale16(ox,xvect,-oy,yvect) + (xdim<<11);
				y = dmulscale16(oy,xvect2,ox,yvect2) + (ydim<<11);
				i |= getclipmask(x-cx1,cx2-x,y-cy1,cy2-y);
				rx1[npoints] = x;
				ry1[npoints] = y;
				xb1[npoints] = npoints+1;
				npoints++;
			}
			if (npoints > 0) xb1[npoints-1] = l; //overwrite point2
#endif
			if ((i&0xf0) != 0xf0) continue;
			bakx1 = rx1[0]; baky1 = mulscale16(ry1[0]-(ydim<<11),xyaspect)+(ydim<<11);
			if (i&0x0f)
			{
				npoints = clippoly(npoints,i);
				if (npoints < 3) continue;
			}

				//Collect floor sprites to draw
			for(i=headspritesect[s];i>=0;i=nextspritesect[i])
				if ((sprite[i].cstat&48) == 32)
				{
					if ((sprite[i].cstat&(64+8)) == (64+8)) continue;
					tsprite[sortnum++].owner = i;
				}

			gotsector[s>>3] |= pow2char[s&7];

			globalorientation = (int)sec->floorstat;
			if ((globalorientation&1) != 0) continue;

			globalpal = sec->floorpal;
			if (palookup[sec->floorpal] != globalpalwritten)
			{
				globalpalwritten = palookup[sec->floorpal];
				if (!globalpalwritten) globalpalwritten = palookup[0];	// JBF: fixes null-pointer crash
				setpalookupaddress(globalpalwritten);
			}
			globalpicnum = sec->floorpicnum;
			if ((unsigned)globalpicnum >= (unsigned)MAXTILES) globalpicnum = 0;
			setgotpic(globalpicnum);
			if ((tilesizx[globalpicnum] <= 0) || (tilesizy[globalpicnum] <= 0)) continue;
			if ((picanm[globalpicnum]&192) != 0) globalpicnum += animateoffs((short)globalpicnum,s);
			if (waloff[globalpicnum] == 0) loadtile(globalpicnum);
			globalbufplc = waloff[globalpicnum];
			globalshade = max(min(sec->floorshade,numpalookups-1),0);
			globvis = globalhisibility;
			if (sec->visibility != 0) globvis = mulscale4(globvis,(int)((unsigned char)(sec->visibility+16)));
			globalpolytype = 0;
			if ((globalorientation&64) == 0)
			{
				globalposx = dax; globalx1 = bakgxvect; globaly1 = bakgyvect;
				globalposy = day; globalx2 = bakgxvect; globaly2 = bakgyvect;
			}
			else
			{
				ox = wall[wall[startwall].point2].x - wall[startwall].x;
				oy = wall[wall[startwall].point2].y - wall[startwall].y;
				i = nsqrtasm(ox*ox+oy*oy); if (i == 0) continue;
				i = 1048576/i;
				globalx1 = mulscale10(dmulscale10(ox,bakgxvect,oy,bakgyvect),i);
				globaly1 = mulscale10(dmulscale10(ox,bakgyvect,-oy,bakgxvect),i);
				ox = (bakx1>>4)-(xdim<<7); oy = (baky1>>4)-(ydim<<7);
				globalposx = dmulscale28(-oy,globalx1,-ox,globaly1);
				globalposy = dmulscale28(-ox,globalx1,oy,globaly1);
				globalx2 = -globalx1;
				globaly2 = -globaly1;

				daslope = sector[s].floorheinum;
				i = nsqrtasm(daslope*daslope+16777216);
				globalposy = mulscale12(globalposy,i);
				globalx2 = mulscale12(globalx2,i);
				globaly2 = mulscale12(globaly2,i);
			}
			globalxshift = (8-(picsiz[globalpicnum]&15));
			globalyshift = (8-(picsiz[globalpicnum]>>4));
			if (globalorientation&8) {globalxshift++; globalyshift++; }

			sethlinesizes(picsiz[globalpicnum]&15,picsiz[globalpicnum]>>4,(void *)globalbufplc);

			if ((globalorientation&0x4) > 0)
			{
				i = globalposx; globalposx = -globalposy; globalposy = -i;
				i = globalx2; globalx2 = globaly1; globaly1 = i;
				i = globalx1; globalx1 = -globaly2; globaly2 = -i;
			}
			if ((globalorientation&0x10) > 0) globalx1 = -globalx1, globaly1 = -globaly1, globalposx = -globalposx;
			if ((globalorientation&0x20) > 0) globalx2 = -globalx2, globaly2 = -globaly2, globalposy = -globalposy;
			asm1 = (globaly1<<globalxshift);
			asm2 = (globalx2<<globalyshift);
			globalx1 <<= globalxshift;
			globaly2 <<= globalyshift;
			globalposx = (globalposx<<(20+globalxshift))+(((int)sec->floorxpanning)<<24);
			globalposy = (globalposy<<(20+globalyshift))-(((int)sec->floorypanning)<<24);

			fillpolygon(npoints);
		}

		//Sort sprite list
	gap = 1; while (gap < sortnum) gap = (gap<<1)+1;
	for(gap>>=1;gap>0;gap>>=1)
		for(i=0;i<sortnum-gap;i++)
			for(j=i;j>=0;j-=gap)
			{
				if (sprite[tsprite[j].owner].z <= sprite[tsprite[j+gap].owner].z) break;
				swapshort(&tsprite[j].owner,&tsprite[j+gap].owner);
			}

	for(s=sortnum-1;s>=0;s--)
	{
		spr = &sprite[tsprite[s].owner];
		if ((spr->cstat&48) == 32)
		{
			npoints = 0;

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

			k = spr->ang;
			cosang = sintable[(k+512)&2047]; sinang = sintable[k];
			xspan = tilesizx[tilenum]; xrepeat = spr->xrepeat;
			yspan = tilesizy[tilenum]; yrepeat = spr->yrepeat;

			ox = ((xspan>>1)+xoff)*xrepeat; oy = ((yspan>>1)+yoff)*yrepeat;
			x1 = spr->x + mulscale16(sinang,ox) + mulscale16(cosang,oy);
			y1 = spr->y + mulscale16(sinang,oy) - mulscale16(cosang,ox);
			l = xspan*xrepeat;
			x2 = x1 - mulscale16(sinang,l);
			y2 = y1 + mulscale16(cosang,l);
			l = yspan*yrepeat;
			k = -mulscale16(cosang,l); x3 = x2+k; x4 = x1+k;
			k = -mulscale16(sinang,l); y3 = y2+k; y4 = y1+k;

			xb1[0] = 1; xb1[1] = 2; xb1[2] = 3; xb1[3] = 0;
			npoints = 4;

			i = 0;

			ox = x1 - dax; oy = y1 - day;
			x = dmulscale16(ox,xvect,-oy,yvect) + (xdim<<11);
			y = dmulscale16(oy,xvect2,ox,yvect2) + (ydim<<11);
			i |= getclipmask(x-cx1,cx2-x,y-cy1,cy2-y);
			rx1[0] = x; ry1[0] = y;

			ox = x2 - dax; oy = y2 - day;
			x = dmulscale16(ox,xvect,-oy,yvect) + (xdim<<11);
			y = dmulscale16(oy,xvect2,ox,yvect2) + (ydim<<11);
			i |= getclipmask(x-cx1,cx2-x,y-cy1,cy2-y);
			rx1[1] = x; ry1[1] = y;

			ox = x3 - dax; oy = y3 - day;
			x = dmulscale16(ox,xvect,-oy,yvect) + (xdim<<11);
			y = dmulscale16(oy,xvect2,ox,yvect2) + (ydim<<11);
			i |= getclipmask(x-cx1,cx2-x,y-cy1,cy2-y);
			rx1[2] = x; ry1[2] = y;

			x = rx1[0]+rx1[2]-rx1[1];
			y = ry1[0]+ry1[2]-ry1[1];
			i |= getclipmask(x-cx1,cx2-x,y-cy1,cy2-y);
			rx1[3] = x; ry1[3] = y;

			if ((i&0xf0) != 0xf0) continue;
			bakx1 = rx1[0]; baky1 = mulscale16(ry1[0]-(ydim<<11),xyaspect)+(ydim<<11);
			if (i&0x0f)
			{
				npoints = clippoly(npoints,i);
				if (npoints < 3) continue;
			}

			globalpicnum = spr->picnum;
			if ((unsigned)globalpicnum >= (unsigned)MAXTILES) globalpicnum = 0;
			setgotpic(globalpicnum);
			if ((tilesizx[globalpicnum] <= 0) || (tilesizy[globalpicnum] <= 0)) continue;
			if ((picanm[globalpicnum]&192) != 0) globalpicnum += animateoffs((short)globalpicnum,s);
			if (waloff[globalpicnum] == 0) loadtile(globalpicnum);
			globalbufplc = waloff[globalpicnum];
			if ((sector[spr->sectnum].ceilingstat&1) > 0)
				globalshade = ((int)sector[spr->sectnum].ceilingshade);
			else
				globalshade = ((int)sector[spr->sectnum].floorshade);
			globalshade = max(min(globalshade+spr->shade+6,numpalookups-1),0);
			asm3 = (intptr_t)palookup[spr->pal]+(globalshade<<8);
			globvis = globalhisibility;
			if (sec->visibility != 0) globvis = mulscale4(globvis,(int)((unsigned char)(sec->visibility+16)));
			globalpolytype = ((spr->cstat&2)>>1)+1;

				//relative alignment stuff
			ox = x2-x1; oy = y2-y1;
			i = ox*ox+oy*oy; if (i == 0) continue; i = (65536*16384)/i;
			globalx1 = mulscale10(dmulscale10(ox,bakgxvect,oy,bakgyvect),i);
			globaly1 = mulscale10(dmulscale10(ox,bakgyvect,-oy,bakgxvect),i);
			ox = y1-y4; oy = x4-x1;
			i = ox*ox+oy*oy; if (i == 0) continue; i = (65536*16384)/i;
			globalx2 = mulscale10(dmulscale10(ox,bakgxvect,oy,bakgyvect),i);
			globaly2 = mulscale10(dmulscale10(ox,bakgyvect,-oy,bakgxvect),i);

			ox = picsiz[globalpicnum]; oy = ((ox>>4)&15); ox &= 15;
			if (pow2long[ox] != xspan)
			{
				ox++;
				globalx1 = mulscale(globalx1,xspan,ox);
				globaly1 = mulscale(globaly1,xspan,ox);
			}

			bakx1 = (bakx1>>4)-(xdim<<7); baky1 = (baky1>>4)-(ydim<<7);
			globalposx = dmulscale28(-baky1,globalx1,-bakx1,globaly1);
			globalposy = dmulscale28(bakx1,globalx2,-baky1,globaly2);

			if ((spr->cstat&2) == 0)
				msethlineshift(ox,oy);
			else {
				if (spr->cstat&512) settransreverse(); else settransnormal();
				tsethlineshift(ox,oy);
			}

			if ((spr->cstat&0x4) > 0) globalx1 = -globalx1, globaly1 = -globaly1, globalposx = -globalposx;
			asm1 = (globaly1<<2); globalx1 <<= 2; globalposx <<= (20+2);
			asm2 = (globalx2<<2); globaly2 <<= 2; globalposy <<= (20+2);

			globalorientation = ((spr->cstat&2)<<7) | ((spr->cstat&512)>>2);	// so polymost can get the translucency. ignored in software mode.
			fillpolygon(npoints);
		}
	}
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0xc8, %rsp
movl %ecx, %r12d
movl %edx, %ebp
movq %rsi, 0x60(%rsp)
andl $0x0, 0x729e7(%rip)     # 0x9d788
movq %rdi, 0x58(%rsp)
movswl 0x39e1b3(%rip), %esi    # 0x3c8f60
addl $0x1f, %esi
sarl $0x5, %esi
leaq 0x39dfa6(%rip), %rdi    # 0x3c8d60
xorl %edx, %edx
callq 0x444af
movl 0x39ffa9(%rip), %eax    # 0x3cad70
shll $0xc, %eax
movl %eax, 0x34(%rsp)
movl 0x3a1dac(%rip), %eax    # 0x3ccb80
shll $0xc, %eax
movl %eax, 0x30(%rsp)
movl 0x3d61ff(%rip), %ecx    # 0x400fe0
shll $0xc, %ecx
movl $0xfff, %eax            # imm = 0xFFF
orl %eax, %ecx
movl %ecx, 0x2c(%rsp)
movl 0x3d61ef(%rip), %ecx    # 0x400fe4
shll $0xc, %ecx
orl %eax, %ecx
movl %ecx, 0x28(%rsp)
shll $0x8, %ebp
movl $0x600, %eax            # imm = 0x600
subl %r12d, %eax
movl $0x7ff, %esi            # imm = 0x7FF
andl %esi, %eax
leaq 0x39cf39(%rip), %rdi    # 0x3c7d50
movswq (%rdi,%rax,2), %rcx
movq %rcx, %rax
shlq $0x1c, %rax
movslq %ebp, %r8
cqto
idivq %r8
movq %rax, %r9
negl %r12d
andl %esi, %r12d
movswq (%rdi,%r12,2), %rsi
movq %rsi, %rax
shlq $0x1c, %rax
cqto
idivq %r8
movq %rax, %rdi
movslq 0x3d6199(%rip), %rax    # 0x400fe8
shlq $0x18, %r8
imulq %r8, %rsi
sarq $0x20, %rsi
movq %rsi, 0xb0(%rsp)
movq %rsi, %rdx
imulq %rax, %rdx
imulq %rcx, %r8
sarq $0x20, %r8
movq %r8, 0x98(%rsp)
imulq %r8, %rax
shrq $0x10, %rdx
movslq %edx, %rcx
movq %rcx, 0x90(%rsp)
shrq $0x10, %rax
cltq
movq %rax, 0x88(%rsp)
movq %r9, 0x70(%rsp)
movslq %r9d, %rax
movq %rax, 0xa8(%rsp)
movq %rdi, 0x68(%rsp)
movslq %edi, %rax
movq %rax, 0xa0(%rsp)
leaq 0x211b9e(%rip), %rbp    # 0x23ca60
leaq 0x24ade7(%rip), %r13    # 0x275cb0
leaq 0x3af900(%rip), %r14    # 0x3da7d0
xorl %ecx, %ecx
xorl %r15d, %r15d
movswq 0x39e083(%rip), %rax    # 0x3c8f60
cmpq %rax, %rcx
jge 0x2b67c
movl %ecx, %edx
shrl $0x3, %edx
movq %rcx, 0x10(%rsp)
movl %ecx, %esi
andl $0x7, %esi
leaq 0x728a4(%rip), %rax     # 0x9d7a0
movb (%rsi,%rax), %al
leaq 0x3793da(%rip), %rcx    # 0x3a42e0
testb %al, (%rdx,%rcx)
je 0x2b668
movq %rsi, 0x80(%rsp)
movq %rdx, 0x48(%rsp)
movl %r15d, 0x4(%rsp)
movswq (%rbp), %r13
movq %rbp, 0x50(%rsp)
movswl 0x2(%rbp), %r15d
movq %r13, %rbp
shlq $0x5, %rbp
leaq 0x186b12(%rip), %rax    # 0x1b1a50
addq %rax, %rbp
movl 0x3d60a5(%rip), %eax    # 0x400fec
shll $0xb, %eax
movl %eax, 0x40(%rsp)
movl 0x3d609c(%rip), %eax    # 0x400ff0
shll $0xb, %eax
movl %eax, 0x38(%rsp)
movl $0x0, 0x18(%rsp)
xorl %ebx, %ebx
xorl %esi, %esi
movq %rbp, 0x78(%rsp)
testl %r15d, %r15d
jle 0x2b0c3
movl %esi, 0x8(%rsp)
movswl %r13w, %edi
callq 0x2bf2f
cmpl %r13d, %eax
setg %cl
testl %ebx, %ebx
setg %dl
andb %cl, %dl
cmpb $0x1, %dl
jne 0x2afa9
leal -0x1(%rbx), %ecx
leaq 0x239ad2(%rip), %rdx    # 0x264a70
movl 0x18(%rsp), %esi
movl %esi, (%rdx,%rcx,4)
movl %ebx, 0x18(%rsp)
movslq (%rbp), %r12
movslq %eax, %rcx
shlq $0x5, %rcx
leaq 0x186a95(%rip), %r8     # 0x1b1a50
movslq (%rcx,%r8), %rax
movq %r12, %rdx
subq %rax, %rdx
movswq 0x8(%rbp), %rsi
shlq $0x5, %rsi
movslq 0x4(%rsi,%r8), %rdi
movslq 0x4(%rbp), %rax
subq %rax, %rdi
imulq %rdx, %rdi
movslq 0x4(%rcx,%r8), %rcx
subq %rax, %rcx
movslq (%rsi,%r8), %rdx
subq %r12, %rdx
imulq %rcx, %rdx
addq %rdi, %rdx
shrq %rdx
testl %edx, %edx
je 0x2b0b0
movslq 0x58(%rsp), %rcx
subq %rcx, %r12
movslq 0x60(%rsp), %rcx
subq %rcx, %rax
movl %r15d, 0x20(%rsp)
movq %rbx, %r15
movq %rax, %rbx
negq %rbx
movq 0xb0(%rsp), %rcx
imulq %r12, %rcx
imulq 0x98(%rsp), %rbx
addq %rcx, %rbx
shrq $0x10, %rbx
addl 0x40(%rsp), %ebx
cltq
imulq 0x90(%rsp), %rax
imulq 0x88(%rsp), %r12
addq %rax, %r12
shrq $0x10, %r12
addl 0x38(%rsp), %r12d
movl %ebx, %edi
subl 0x34(%rsp), %edi
movl 0x2c(%rsp), %esi
subl %ebx, %esi
movl %r12d, %edx
subl 0x30(%rsp), %edx
movl 0x28(%rsp), %ecx
subl %r12d, %ecx
callq 0x2bf70
movl 0x8(%rsp), %esi
orl %eax, %esi
movslq %r15d, %rax
leaq 0x3d5f74(%rip), %rcx    # 0x401000
movl %ebx, (%rcx,%rax,4)
movq %r15, %rbx
movl 0x20(%rsp), %r15d
leaq 0x3d9f62(%rip), %rcx    # 0x405000
movl %r12d, (%rcx,%rax,4)
incl %ebx
leaq 0x2399c5(%rip), %rcx    # 0x264a70
movl %ebx, (%rcx,%rax,4)
jmp 0x2b0b4
movl 0x8(%rsp), %esi
decl %r15d
addq $0x20, %rbp
incl %r13d
jmp 0x2af6c
testl %ebx, %ebx
jle 0x2b0d8
leal -0x1(%rbx), %eax
leaq 0x23999f(%rip), %rcx    # 0x264a70
movl 0x18(%rsp), %edx
movl %edx, (%rcx,%rax,4)
movl %esi, %eax
notl %eax
testb $-0x10, %al
leaq 0x24abcb(%rip), %r13    # 0x275cb0
movq 0x50(%rsp), %rbp
jne 0x2b663
movq %rbx, 0x8(%rsp)
movl 0x3d5f04(%rip), %r12d   # 0x401000
movslq 0x3d9efd(%rip), %rbx    # 0x405000
movslq 0x32b7ae(%rip), %r15    # 0x3568b8
testb $0xf, %sil
je 0x2b128
movq 0x8(%rsp), %rdi
callq 0x2bf90
movq %rax, 0x8(%rsp)
cmpl $0x3, %eax
jl 0x2b663
movl %r12d, 0x20(%rsp)
movslq 0x38(%rsp), %r12
subq %r12, %rbx
imulq %r15, %rbx
shrq $0x10, %rbx
addl %ebx, %r12d
leaq 0x37a3c9(%rip), %rax    # 0x3a5510
movq 0x10(%rsp), %rcx
leaq (%rax,%rcx,2), %rax
movl 0x4(%rsp), %r15d
movq 0x8(%rsp), %rbx
movswq (%rax), %rax
testq %rax, %rax
js 0x2b1a1
imulq $0x2c, %rax, %rcx
movzwl 0xc(%rcx,%r13), %ecx
movl %ecx, %edx
andl $0x30, %edx
cmpl $0x20, %edx
setne %dl
notl %ecx
testb $0x48, %cl
sete %cl
orb %dl, %cl
jne 0x2b194
movslq %r15d, %rcx
incl %r15d
imulq $0x2c, %rcx, %rcx
movw %ax, 0x1e(%rcx,%r14)
leaq 0x384385(%rip), %rcx    # 0x3af520
leaq (%rcx,%rax,2), %rax
jmp 0x2b15a
leaq 0x725f8(%rip), %rax     # 0x9d7a0
movq 0x80(%rsp), %rcx
movb (%rcx,%rax), %al
leaq 0x39dba6(%rip), %rcx    # 0x3c8d60
movq 0x48(%rsp), %rdx
orb %al, (%rdx,%rcx)
movswl 0xe(%rbp), %eax
movl %eax, 0x3dde34(%rip)    # 0x409000
testb $0x1, %al
jne 0x2b668
movl %r15d, 0x4(%rsp)
movzbl 0x1d(%rbp), %eax
movl %eax, 0x3dde21(%rip)    # 0x409004
leaq 0x3668f6(%rip), %rcx    # 0x391ae0
movq (%rcx,%rax,8), %rdi
cmpq 0x3dde13(%rip), %rdi    # 0x409008
je 0x2b216
movq %rdi, 0x3dde0a(%rip)    # 0x409008
testq %rdi, %rdi
jne 0x2b211
movq 0x3668d6(%rip), %rdi    # 0x391ae0
movq %rdi, 0x3dddf7(%rip)    # 0x409008
callq 0x641cb
movl 0x18(%rbp), %eax
cmpw $0x2400, %ax            # imm = 0x2400
movl $0x0, %ecx
cmovael %ecx, %eax
movw %ax, 0x3ddde4(%rip)     # 0x409010
movswl %ax, %edi
callq 0x2cc16
movzwl 0x3dddd4(%rip), %r15d   # 0x409010
movswq %r15w, %rax
leaq 0x3dddd9(%rip), %rcx    # 0x409020
cmpw $0x0, (%rcx,%rax,2)
jle 0x2b663
leaq 0x3cf587(%rip), %rcx    # 0x3fa7e0
cmpw $0x0, (%rcx,%rax,2)
jle 0x2b663
leaq 0x2087f5(%rip), %rcx    # 0x233a60
testb $-0x40, (%rcx,%rax,4)
je 0x2b28b
movswl %r15w, %edi
xorl %esi, %esi
callq 0x2163b
addl %eax, %r15d
movw %r15w, 0x3ddd89(%rip)   # 0x409010
movswq %r15w, %rax
leaq 0x36704e(%rip), %rcx    # 0x3922e0
cmpq $0x0, (%rcx,%rax,8)
jne 0x2b2aa
movswl %r15w, %edi
callq 0x2cc4a
movzwl 0x3ddd66(%rip), %r15d   # 0x409010
movswq %r15w, %rdi
leaq 0x36702b(%rip), %rax    # 0x3922e0
movq (%rax,%rdi,8), %rdx
movq %rdx, 0x3e2560(%rip)    # 0x40d820
movsbl 0x1c(%rbp), %eax
movswl 0x3e255d(%rip), %ecx    # 0x40d828
decl %ecx
cmpl %eax, %ecx
cmovgel %eax, %ecx
testl %ecx, %ecx
movl $0x0, %eax
cmovlel %eax, %ecx
movl %ecx, 0x3e254a(%rip)    # 0x40d82c
movslq 0x39ca5b(%rip), %rax    # 0x3c7d44
movl %eax, 0x3e2541(%rip)    # 0x40d830
movb 0x20(%rbp), %cl
testb %cl, %cl
je 0x2b30a
addb $0x10, %cl
movzbl %cl, %ecx
imulq %rax, %rcx
shrq $0x4, %rcx
movl %ecx, 0x3e2526(%rip)    # 0x40d830
movb $0x0, 0x3e2523(%rip)    # 0x40d834
movl 0x3ddce8(%rip), %r15d   # 0x409000
testb $0x40, %r15b
jne 0x2b357
movq 0x58(%rsp), %rax
movl %eax, 0x208727(%rip)    # 0x233a50
movq 0x70(%rsp), %rcx
movl %ecx, 0x3e2504(%rip)    # 0x40d838
movq 0x68(%rsp), %rsi
movl %esi, 0x3e24fd(%rip)    # 0x40d83c
movq 0x60(%rsp), %rax
movl %eax, 0x20870a(%rip)    # 0x233a54
movl %ecx, 0x3e24f0(%rip)    # 0x40d840
movl %esi, %eax
jmp 0x2b4ee
movq %rdi, 0x38(%rsp)
movq %rdx, 0x18(%rsp)
movq 0x78(%rsp), %rsi
movswq 0x8(%rsi), %rax
shlq $0x5, %rax
leaq 0x1866da(%rip), %rdx    # 0x1b1a50
movslq (%rax,%rdx), %r13
movslq (%rsi), %rcx
subq %rcx, %r13
movslq 0x4(%rax,%rdx), %rbp
movslq 0x4(%rsi), %rax
subq %rax, %rbp
movl %r13d, %eax
imull %r13d, %eax
movl %ebp, %edi
imull %ebp, %edi
addl %eax, %edi
callq 0x22169
testl %eax, %eax
je 0x2b657
movl %eax, %ecx
movl $0x100000, %eax         # imm = 0x100000
xorl %edx, %edx
idivl %ecx
movq 0xa8(%rsp), %rsi
movq %rsi, %rcx
imulq %r13, %rcx
movq %rbp, %rdx
movq 0xa0(%rsp), %rdi
imulq %rdi, %rdx
addq %rcx, %rdx
shrq $0xa, %rdx
movslq %edx, %rcx
cltq
imulq %rax, %rcx
shrq $0xa, %rcx
movl %ecx, 0x3e244e(%rip)    # 0x40d838
negl %ebp
imulq %rdi, %r13
movslq %ebp, %rdx
imulq %rsi, %rdx
addq %r13, %rdx
shrq $0xa, %rdx
movslq %edx, %rdx
imulq %rax, %rdx
shrq $0xa, %rdx
movl %edx, 0x3e242d(%rip)    # 0x40d83c
movl 0x20(%rsp), %esi
sarl $0x4, %esi
movl 0x3d5bd0(%rip), %eax    # 0x400fec
shll $0x7, %eax
subl %esi, %eax
sarl $0x4, %r12d
movl 0x3d5bc5(%rip), %esi    # 0x400ff0
shll $0x7, %esi
subl %esi, %r12d
movl %r12d, %esi
negl %esi
movslq %esi, %rsi
movslq %ecx, %rbp
imulq %rbp, %rsi
cltq
movslq %edx, %r13
movq %r13, %rcx
imulq %rax, %rcx
addq %rsi, %rcx
shrq $0x1c, %rcx
movl %ecx, 0x2085f7(%rip)    # 0x233a50
imulq %rbp, %rax
movslq %r12d, %rbx
imulq %r13, %rbx
addq %rax, %rbx
shrq $0x1c, %rbx
movl %ebx, 0x2085e3(%rip)    # 0x233a54
negl %ebp
movl %ebp, 0x3e23c7(%rip)    # 0x40d840
negl %r13d
movl %r13d, 0x3e23c1(%rip)   # 0x40d844
imulq $0x28, 0x10(%rsp), %rax
leaq 0x2115d0(%rip), %rcx    # 0x23ca60
movswl 0x1a(%rax,%rcx), %edi
imull %edi, %edi
addl $0x1000000, %edi        # imm = 0x1000000
callq 0x22169
movslq %ebx, %rcx
movq 0x8(%rsp), %rbx
movslq %eax, %rdx
imulq %rdx, %rcx
shrq $0xc, %rcx
movl %ecx, 0x208598(%rip)    # 0x233a54
movslq %ebp, %rax
imulq %rdx, %rax
shrq $0xc, %rax
movl %eax, 0x3e2373(%rip)    # 0x40d840
movslq %r13d, %rax
imulq %rdx, %rax
shrq $0xc, %rax
leaq 0x24a7d1(%rip), %r13    # 0x275cb0
movq 0x50(%rsp), %rbp
movq 0x18(%rsp), %rdx
movq 0x38(%rsp), %rdi
movl %eax, 0x3e2350(%rip)    # 0x40d844
leaq 0x3e2355(%rip), %rax    # 0x40d850
movzbl (%rdi,%rax), %esi
movl %esi, %eax
andb $0xf, %al
movb $0x8, %cl
subb %al, %cl
movb %cl, 0x3e4743(%rip)     # 0x40fc50
movl %esi, %ecx
shrb $0x4, %cl
movb $0x8, %dil
subb %cl, %dil
movb %dil, 0x3e4732(%rip)    # 0x40fc51
testb $0x8, %r15b
je 0x2b53c
movb $0x9, %dil
subb %al, %dil
movb %dil, 0x3e471e(%rip)    # 0x40fc50
movb $0x9, %al
subb %cl, %al
movb %al, 0x3e4715(%rip)     # 0x40fc51
movl %esi, %edi
andl $0xf, %edi
shrl $0x4, %esi
callq 0x641b7
movl 0x3ddab1(%rip), %eax    # 0x409000
testb $0x4, %al
movl 0x4(%rsp), %r15d
je 0x2b5a8
xorl %ecx, %ecx
subl 0x2084f4(%rip), %ecx    # 0x233a54
xorl %edx, %edx
subl 0x2084e8(%rip), %edx    # 0x233a50
movl %ecx, 0x2084e2(%rip)    # 0x233a50
movl %edx, 0x2084e0(%rip)    # 0x233a54
movl 0x3e22c6(%rip), %ecx    # 0x40d840
movl 0x3e22bc(%rip), %edx    # 0x40d83c
movl %edx, 0x3e22ba(%rip)    # 0x40d840
movl %ecx, 0x3e22b0(%rip)    # 0x40d83c
xorl %ecx, %ecx
subl 0x3e22b0(%rip), %ecx    # 0x40d844
xorl %edx, %edx
subl 0x3e229c(%rip), %edx    # 0x40d838
movl %ecx, 0x3e2296(%rip)    # 0x40d838
movl %edx, 0x3e229c(%rip)    # 0x40d844
testb $0x10, %al
je 0x2b5be
negl 0x3e2286(%rip)          # 0x40d838
negl 0x3e2284(%rip)          # 0x40d83c
negl 0x208492(%rip)          # 0x233a50
movl 0x3e227b(%rip), %r8d    # 0x40d840
movl 0x3e2279(%rip), %edi    # 0x40d844
movl 0x208483(%rip), %esi    # 0x233a54
testb $0x20, %al
je 0x2b5e3
negl %r8d
movl %r8d, 0x3e2261(%rip)    # 0x40d840
negl %edi
negl %esi
movl 0x3e2253(%rip), %edx    # 0x40d83c
movb 0x3e4661(%rip), %al     # 0x40fc50
movl %eax, %ecx
shll %cl, %edx
movl %edx, 0x3e465b(%rip)    # 0x40fc54
movb 0x3e4652(%rip), %dl     # 0x40fc51
movl %edx, %ecx
shll %cl, %r8d
movl %r8d, 0x3e464d(%rip)    # 0x40fc58
movl %eax, %ecx
shll %cl, 0x3e2225(%rip)     # 0x40d838
movl %edx, %ecx
shll %cl, %edi
movl %edi, 0x3e2227(%rip)    # 0x40d844
movl 0x20842d(%rip), %edi    # 0x233a50
addb $0x14, %al
movl %eax, %ecx
shll %cl, %edi
movzbl 0x1e(%rbp), %eax
shll $0x18, %eax
addl %edi, %eax
movl %eax, 0x208418(%rip)    # 0x233a50
addb $0x14, %dl
movl %edx, %ecx
shll %cl, %esi
movzbl 0x1f(%rbp), %eax
shll $0x18, %eax
subl %eax, %esi
movl %esi, 0x208406(%rip)    # 0x233a54
movl %ebx, %edi
callq 0x2cd9a
jmp 0x2b668
leaq 0x24a652(%rip), %r13    # 0x275cb0
movq 0x50(%rsp), %rbp
movl 0x4(%rsp), %r15d
movq 0x10(%rsp), %rax
incq %rax
addq $0x28, %rbp
movq %rax, %rcx
jmp 0x2aed5
pushq $0x1
popq %rax
cmpl %r15d, %eax
jge 0x2b68d
leal 0x1(,%rax,2), %eax
jmp 0x2b67f
sarl %eax
testl %eax, %eax
jle 0x2b6f9
movl %r15d, %ecx
subl %eax, %ecx
xorl %edx, %edx
testl %ecx, %ecx
cmovlel %edx, %ecx
cmpl %ecx, %edx
je 0x2b6f5
movl %edx, %esi
testl %esi, %esi
js 0x2b6f1
movl %esi, %edi
imulq $0x2c, %rdi, %r8
movswq 0x1e(%r8,%r14), %rdi
imulq $0x2c, %rdi, %r9
movl 0x8(%r9,%r13), %r11d
leal (%rax,%rsi), %r9d
imulq $0x2c, %r9, %r10
movswq 0x1e(%r10,%r14), %r9
imulq $0x2c, %r9, %rbx
cmpl 0x8(%rbx,%r13), %r11d
jle 0x2b6f1
addq %r14, %r8
addq $0x1e, %r8
addq %r14, %r10
addq $0x1e, %r10
movw %di, (%r10)
movw %r9w, (%r8)
subl %eax, %esi
jmp 0x2b6a5
incl %edx
jmp 0x2b69f
shrl %eax
jmp 0x2b68f
movl %r15d, %ebx
movq %rbp, 0x50(%rsp)
testl %ebx, %ebx
jle 0x2bf1d
decq %rbx
movl %ebx, %eax
imulq $0x2c, %rax, %rax
movswq 0x1e(%rax,%r14), %rax
imulq $0x2c, %rax, %r9
movzwl 0xc(%r9,%r13), %eax
movl %eax, %ecx
andl $0x30, %ecx
cmpl $0x20, %ecx
jne 0x2b701
addq %r13, %r9
movq %r9, 0x40(%rsp)
movswq 0xe(%r9), %rcx
leaq 0x208320(%rip), %rdx    # 0x233a60
movl (%rdx,%rcx,4), %edx
movl %edx, %esi
shrl $0x8, %esi
movsbl %sil, %esi
movsbl 0x16(%r9), %edi
addl %esi, %edi
shrl $0x10, %edx
movsbl %dl, %edx
movsbl 0x17(%r9), %esi
addl %edx, %esi
movl %edi, %r8d
negl %r8d
testb $0x4, %al
cmovel %edi, %r8d
movl %esi, %edx
negl %edx
testb $0x8, %al
cmovel %esi, %edx
movswq 0x1c(%r9), %rax
leal 0x200(%rax), %esi
andl $0x7ff, %esi            # imm = 0x7FF
leaq 0x39c5c3(%rip), %rdi    # 0x3c7d50
movswq (%rdi,%rsi,2), %rbp
movswq (%rdi,%rax,2), %rax
leaq 0x3dd882(%rip), %rsi    # 0x409020
movswq (%rsi,%rcx,2), %r10
movzbl 0x14(%r9), %r15d
leaq 0x3cf031(%rip), %rsi    # 0x3fa7e0
movswq (%rsi,%rcx,2), %rcx
movzbl 0x15(%r9), %r12d
movl %r10d, %esi
sarl %esi
addl %r8d, %esi
movslq %esi, %rdi
imulq %r15, %rdi
movl %ecx, %esi
sarl %esi
addl %edx, %esi
movslq %esi, %r8
movq %rdi, %rsi
imulq %rax, %rsi
shrq $0x10, %rsi
addl (%r9), %esi
imulq %r12, %r8
movq %r8, %rdx
imulq %rbp, %rdx
shrq $0x10, %rdx
addl %esi, %edx
movl 0x4(%r9), %esi
imulq %rax, %r8
shrq $0x10, %r8
imulq %rbp, %rdi
shrq $0x10, %rdi
subl %edi, %esi
addl %r8d, %esi
movq %r10, 0xc0(%rsp)
imulq %r10, %r15
movq %r15, %rdi
imulq %rax, %rdi
shrq $0x10, %rdi
movl %edx, %r8d
movq %rdi, 0x78(%rsp)
subl %edi, %r8d
movl %r8d, 0x20(%rsp)
imulq %rbp, %r15
shrq $0x10, %r15
movq %r15, 0x80(%rsp)
leal (%rsi,%r15), %edi
movl %edi, 0x18(%rsp)
imulq %rcx, %r12
imulq %r12, %rbp
shrq $0x10, %rbp
imulq %rax, %r12
shrq $0x10, %r12
movaps 0x4075d(%rip), %xmm0    # 0x6bfc0
movaps %xmm0, 0x239206(%rip)   # 0x264a70
subl 0x58(%rsp), %edx
subl 0x60(%rsp), %esi
movslq %esi, %rax
negl %esi
movslq %edx, %rdi
movq 0xb0(%rsp), %r15
movq %r15, %rcx
imulq %rdi, %rcx
movq %rbx, %rdx
movslq %esi, %rbx
imulq 0x98(%rsp), %rbx
addq %rcx, %rbx
shrq $0x10, %rbx
movl 0x3d5747(%rip), %ecx    # 0x400fec
shll $0xb, %ecx
movl %ecx, 0x38(%rsp)
addl %ecx, %ebx
imulq 0x90(%rsp), %rax
imulq 0x88(%rsp), %rdi
addq %rax, %rdi
shrq $0x10, %rdi
movl 0x3d5723(%rip), %eax    # 0x400ff0
shll $0xb, %eax
movq %rax, 0x8(%rsp)
movq %rdi, 0xb8(%rsp)
leal (%rax,%rdi), %r13d
movl %ebx, %edi
movq %rdx, 0x10(%rsp)
subl 0x34(%rsp), %edi
movl 0x2c(%rsp), %esi
subl %ebx, %esi
movl %r13d, %edx
subl 0x30(%rsp), %edx
movl 0x28(%rsp), %ecx
subl %r13d, %ecx
movl %r13d, 0x4(%rsp)
callq 0x2bf70
movl %eax, 0x48(%rsp)
movl %ebx, 0x3d56ec(%rip)    # 0x401000
movl %r13d, 0x3d96e5(%rip)   # 0x405000
movl 0x20(%rsp), %eax
subl 0x58(%rsp), %eax
movl 0x18(%rsp), %ecx
subl 0x60(%rsp), %ecx
movslq %ecx, %rdx
negl %ecx
movslq %eax, %r13
movq %r15, %rax
imulq %r13, %rax
movslq %ecx, %r15
imulq 0x98(%rsp), %r15
addq %rax, %r15
shrq $0x10, %r15
addl 0x38(%rsp), %r15d
imulq 0x90(%rsp), %rdx
imulq 0x88(%rsp), %r13
addq %rdx, %r13
shrq $0x10, %r13
addl 0x8(%rsp), %r13d
movl %r15d, %edi
subl 0x34(%rsp), %edi
movl 0x2c(%rsp), %esi
subl %r15d, %esi
movl %r13d, %edx
subl 0x30(%rsp), %edx
movl 0x28(%rsp), %ecx
subl %r13d, %ecx
callq 0x2bf70
orl 0x48(%rsp), %eax
movl %eax, 0x48(%rsp)
movl %r15d, 0x3d5664(%rip)   # 0x401004
movl %r13d, 0x3d965d(%rip)   # 0x405004
movq %rbp, 0x70(%rsp)
movq 0x58(%rsp), %rax
addl %ebp, %eax
movl 0x20(%rsp), %ecx
subl %eax, %ecx
movq %r12, 0x68(%rsp)
movq 0x60(%rsp), %rax
addl %r12d, %eax
movl 0x18(%rsp), %edx
subl %eax, %edx
movslq %edx, %rax
negl %edx
movslq %ecx, %rbp
movq 0xb0(%rsp), %rcx
imulq %rbp, %rcx
movslq %edx, %r12
imulq 0x98(%rsp), %r12
addq %rcx, %r12
shrq $0x10, %r12
addl 0x38(%rsp), %r12d
imulq 0x90(%rsp), %rax
imulq 0x88(%rsp), %rbp
addq %rax, %rbp
shrq $0x10, %rbp
addl 0x8(%rsp), %ebp
movl %r12d, %edi
subl 0x34(%rsp), %edi
movl 0x2c(%rsp), %esi
subl %r12d, %esi
movl %ebp, %edx
subl 0x30(%rsp), %edx
movl 0x28(%rsp), %ecx
subl %ebp, %ecx
callq 0x2bf70
orl 0x48(%rsp), %eax
movl %eax, 0x20(%rsp)
movl %r12d, 0x3d55c5(%rip)   # 0x401008
movl %ebp, 0x3d95bf(%rip)    # 0x405008
movq %rbx, 0x18(%rsp)
addl %ebx, %r12d
subl %r15d, %r12d
addl 0x4(%rsp), %ebp
subl %r13d, %ebp
leaq 0x24a24e(%rip), %r13    # 0x275cb0
movl %r12d, %edi
subl 0x34(%rsp), %edi
movq 0x10(%rsp), %rbx
movl 0x2c(%rsp), %esi
subl %r12d, %esi
movl %ebp, %edx
subl 0x30(%rsp), %edx
movl 0x28(%rsp), %ecx
subl %ebp, %ecx
callq 0x2bf70
movq 0x40(%rsp), %rdx
orl 0x20(%rsp), %eax
movl %r12d, 0x3d5576(%rip)   # 0x40100c
movl %ebp, 0x3d9570(%rip)    # 0x40500c
movq 0x50(%rsp), %rbp
movl %eax, %ecx
notl %ecx
testb $-0x10, %cl
jne 0x2b701
movslq 0x32ae03(%rip), %rcx    # 0x3568b8
movq %rcx, 0x20(%rsp)
pushq $0x4
popq %r15
testb $0xf, %al
je 0x2badd
pushq $0x4
popq %rdi
movl %eax, %esi
callq 0x2bf90
movq 0x40(%rsp), %rdx
movl %eax, %r15d
cmpl $0x3, %eax
jl 0x2b701
movzwl 0xe(%rdx), %eax
cmpw $0x2400, %ax            # imm = 0x2400
movl $0x0, %ecx
cmovael %ecx, %eax
movw %ax, 0x3dd51c(%rip)     # 0x409010
movswl %ax, %edi
callq 0x2cc16
movq 0x40(%rsp), %rdi
movzwl 0x3dd507(%rip), %r12d   # 0x409010
movswq %r12w, %rax
leaq 0x3dd50c(%rip), %rcx    # 0x409020
cmpw $0x0, (%rcx,%rax,2)
jle 0x2b701
leaq 0x3cecba(%rip), %rcx    # 0x3fa7e0
cmpw $0x0, (%rcx,%rax,2)
jle 0x2b701
leaq 0x207f28(%rip), %rcx    # 0x233a60
testb $-0x40, (%rcx,%rax,4)
je 0x2bb5d
movswl %r12w, %edi
xorl %esi, %esi
callq 0x2163b
movq 0x40(%rsp), %rdi
addl %eax, %r12d
movw %r12w, 0x3dd4b7(%rip)   # 0x409010
movswq %r12w, %rax
leaq 0x36677c(%rip), %rcx    # 0x3922e0
cmpq $0x0, (%rcx,%rax,8)
jne 0x2bb81
movswl %r12w, %edi
callq 0x2cc4a
movq 0x40(%rsp), %rdi
movzwl 0x3dd48f(%rip), %r12d   # 0x409010
movswq %r12w, %rcx
leaq 0x366754(%rip), %rax    # 0x3922e0
movq (%rax,%rcx,8), %rax
movq %rax, 0x3e1c89(%rip)    # 0x40d820
movswq 0x18(%rdi), %rax
imulq $0x28, %rax, %rax
leaq 0x210eb9(%rip), %rsi    # 0x23ca60
leaq (%rsi,%rax), %rdx
movzwl 0xc(%rax,%rsi), %eax
xorl %esi, %esi
testb $0x1, %al
sete %sil
movsbl 0x14(%rdx,%rsi,8), %eax
movsbl 0x10(%rdi), %edx
addl %edx, %eax
addl $0x6, %eax
movswl 0x3e1c5b(%rip), %edx    # 0x40d828
decl %edx
cmpl %edx, %eax
cmovll %eax, %edx
testl %edx, %edx
movl $0x0, %eax
cmovlel %eax, %edx
movl %edx, 0x3e1c48(%rip)    # 0x40d82c
movzbl 0x11(%rdi), %eax
shll $0x8, %edx
leaq 0x365eee(%rip), %rsi    # 0x391ae0
addq (%rsi,%rax,8), %rdx
movq %rdx, 0x3e4063(%rip)    # 0x40fc60
movslq 0x39c140(%rip), %rax    # 0x3c7d44
movl %eax, 0x3e1c26(%rip)    # 0x40d830
movb 0x20(%rbp), %dl
testb %dl, %dl
je 0x2bc25
addb $0x10, %dl
movzbl %dl, %edx
imulq %rax, %rdx
shrq $0x4, %rdx
movl %edx, 0x3e1c0b(%rip)    # 0x40d830
movzwl 0xc(%rdi), %esi
btl $0x1, %esi
movl $0x0, %eax
adcb $0x1, %al
movb %al, 0x3e1bfa(%rip)     # 0x40d834
movq 0x78(%rsp), %rax
imull %eax, %eax
movq 0x80(%rsp), %rdx
movl %edx, %edi
imull %edx, %edi
addl %eax, %edi
je 0x2b701
movl $0x40000000, %eax       # imm = 0x40000000
xorl %edx, %edx
idivl %edi
movabsq $-0x100000000, %r10     # imm = 0xFFFFFFFF00000000
movq 0x78(%rsp), %r12
imulq %r10, %r12
sarq $0x20, %r12
movq %r12, %rdx
movq 0xa8(%rsp), %r8
imulq %r8, %rdx
movq 0x80(%rsp), %r11
movslq %r11d, %rdi
movq 0xa0(%rsp), %r9
imulq %r9, %rdi
addq %rdx, %rdi
shrq $0xa, %rdi
movslq %edi, %rdi
cltq
imulq %rax, %rdi
shrq $0xa, %rdi
movl %edi, 0x3e1b81(%rip)    # 0x40d838
imulq %r9, %r12
imulq %r10, %r11
sarq $0x20, %r11
imulq %r8, %r11
addq %r12, %r11
shrq $0xa, %r11
movslq %r11d, %r8
imulq %rax, %r8
shrq $0xa, %r8
movl %r8d, 0x3e1b5c(%rip)    # 0x40d83c
movq 0x68(%rsp), %rax
imull %eax, %eax
movq 0x70(%rsp), %rdx
movl %edx, %r9d
imull %edx, %r9d
addl %eax, %r9d
je 0x2b701
movl %esi, 0x38(%rsp)
movl $0x40000000, %eax       # imm = 0x40000000
xorl %edx, %edx
divl %r9d
movslq 0x68(%rsp), %r9
movq %r9, %rdx
movq 0xa8(%rsp), %r11
imulq %r11, %rdx
movq 0x70(%rsp), %r12
movq %r12, %r10
movabsq $-0x100000000, %rbx     # imm = 0xFFFFFFFF00000000
imulq %rbx, %r10
sarq $0x20, %r10
movq 0xa0(%rsp), %rbx
imulq %rbx, %r10
addq %rdx, %r10
shrq $0xa, %r10
movslq %r10d, %rdx
imulq %rax, %rdx
shrq $0xa, %rdx
movl %edx, 0x3e1ae3(%rip)    # 0x40d840
imulq %rbx, %r9
movslq %r12d, %r10
imulq %r11, %r10
addq %r9, %r10
shrq $0xa, %r10
movslq %r10d, %r9
imulq %rax, %r9
shrq $0xa, %r9
movl %r9d, 0x3e1ac3(%rip)    # 0x40d844
leaq 0x3e1ac8(%rip), %rax    # 0x40d850
movzbl (%rcx,%rax), %esi
movl %esi, %r12d
andl $0xf, %r12d
leaq 0x71a16(%rip), %rax     # 0x9d7b0
movq 0xc0(%rsp), %rcx
cmpl %ecx, (%rax,%r12,4)
je 0x2bdd4
movq %rcx, %rax
incl %r12d
movslq %edi, %rdi
cltq
imulq %rax, %rdi
movl %r12d, %ecx
sarq %cl, %rdi
movl %edi, 0x3e1a75(%rip)    # 0x40d838
movslq %r8d, %r8
imulq %rax, %r8
sarq %cl, %r8
movl %r8d, 0x3e1a68(%rip)    # 0x40d83c
movq 0x18(%rsp), %r10
movq 0xb8(%rsp), %rax
movq 0x8(%rsp), %rcx
movq 0x20(%rsp), %r11
cltq
imulq %r11, %rax
shrq $0x10, %rax
addl %eax, %ecx
shrl $0x4, %esi
sarl $0x4, %r10d
movl 0x3d51e8(%rip), %eax    # 0x400fec
shll $0x7, %eax
subl %eax, %r10d
sarl $0x4, %ecx
movl 0x3d51dd(%rip), %eax    # 0x400ff0
shll $0x7, %eax
subl %ecx, %eax
movl %r10d, %ecx
negl %ecx
cltq
movslq %edi, %rdi
imulq %rax, %rdi
movslq %ecx, %rcx
movslq %r8d, %r8
imulq %rcx, %r8
addq %rdi, %r8
shrq $0x1c, %r8
movl %r8d, 0x207c12(%rip)    # 0x233a50
movslq %r10d, %rcx
movslq %edx, %rdx
imulq %rcx, %rdx
movslq %r9d, %rcx
imulq %rax, %rcx
addq %rdx, %rcx
shrq $0x1c, %rcx
movl %ecx, 0x207bf8(%rip)    # 0x233a54
movl 0x38(%rsp), %eax
testb $0x2, %al
movq 0x10(%rsp), %rbx
jne 0x2be73
movl %r12d, %edi
callq 0x6448a
jmp 0x2be95
movl %esi, 0x8(%rsp)
btl $0x9, %eax
jb 0x2be84
callq 0x641a7
jmp 0x2be89
callq 0x641af
movl %r12d, %edi
movl 0x8(%rsp), %esi
callq 0x64526
movq 0x40(%rsp), %rax
movswl 0xc(%rax), %eax
movl 0x3e1998(%rip), %esi    # 0x40d83c
movl 0x3e198e(%rip), %edx    # 0x40d838
movl 0x207ba0(%rip), %ecx    # 0x233a50
testb $0x4, %al
je 0x2bec0
negl %edx
negl %esi
movl %esi, 0x3e197e(%rip)    # 0x40d83c
negl %ecx
shll $0x2, %esi
movl %esi, 0x3e3d8b(%rip)    # 0x40fc54
shll $0x2, %edx
movl %edx, 0x3e1966(%rip)    # 0x40d838
shll $0x16, %ecx
movl %ecx, 0x207b75(%rip)    # 0x233a50
movl 0x3e195f(%rip), %ecx    # 0x40d840
shll $0x2, %ecx
shll $0x2, 0x3e1959(%rip)    # 0x40d844
shll $0x16, 0x207b62(%rip)   # 0x233a54
movl %ecx, 0x3e3d60(%rip)    # 0x40fc58
movl %eax, %ecx
andl $0x2, %ecx
shll $0x7, %ecx
shrl $0x2, %eax
andl $0x80, %eax
orl %ecx, %eax
movl %eax, 0x3dd0f0(%rip)    # 0x409000
movl %r15d, %edi
callq 0x2cd9a
jmp 0x2b701
addq $0xc8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq