// File: /workspace/github_c_makefile_star2_O1/jonof[P]jftekwar/jfbuild/src/engine.c
// Function: drawvox
static void drawvox(int dasprx, int daspry, int dasprz, int dasprang,
		  int daxscale, int dayscale, unsigned char daindex,
		  signed char dashade, unsigned char dapal, int *daumost, int *dadmost)
{
	int i, j, k, x, y, syoff, ggxstart, ggystart, nxoff;
	int cosang, sinang, sprcosang, sprsinang, backx, backy, gxinc, gyinc;
	int daxsiz, daysiz, dazsiz, daxpivot, daypivot, dazpivot;
	int daxscalerecip, dayscalerecip, cnt, gxstart, gystart, odayscale;
	int l1, l2, xyvoxoffs, *longptr;
	intptr_t slabxoffs;
	int lx, rx, nx, ny, x1=0, y1=0, z1, x2=0, y2=0, z2, yplc, yinc=0;
	int yoff, xs=0, ys=0, xe, ye, xi=0, yi=0, cbackx, cbacky, dagxinc, dagyinc;
	short *shortptr;
	unsigned char *voxptr, *voxend, *davoxptr, oand, oand16, oand32;

	(void)dazsiz;

	cosang = sintable[(globalang+512)&2047];
	sinang = sintable[globalang&2047];
	sprcosang = sintable[(dasprang+512)&2047];
	sprsinang = sintable[dasprang&2047];

	i = klabs(dmulscale6(dasprx-globalposx,cosang,daspry-globalposy,sinang));
	j = (int)(getpalookup((int)mulscale21(globvis,i),(int)dashade)<<8);
	setupdrawslab(ylookup[1], palookup[dapal]+j);
	j = 1310720;
	j *= min(daxscale,dayscale); j >>= 6;  //New hacks (for sized-down voxels)
	for(k=0;k<MAXVOXMIPS;k++)
	{
		if (i < j) { i = k; break; }
		j <<= 1;
	}
	if (k >= MAXVOXMIPS) i = MAXVOXMIPS-1;

	if (novoxmips) i = 0;
	davoxptr = (unsigned char *)voxoff[daindex][i];
	if (!davoxptr && i > 0) { davoxptr = (unsigned char *)voxoff[daindex][0]; i = 0; }
	if (!davoxptr) return;

	if (voxscale[daindex] == 65536)
		{ daxscale <<= (i+8); dayscale <<= (i+8); }
	else
	{
		daxscale = mulscale8(daxscale<<i,voxscale[daindex]);
		dayscale = mulscale8(dayscale<<i,voxscale[daindex]);
	}

	odayscale = dayscale;
	daxscale = mulscale16(daxscale,xyaspect);
	daxscale = scale(daxscale,xdimenscale,xdimen<<8);
	dayscale = scale(dayscale,mulscale16(xdimenscale,viewingrangerecip),xdimen<<8);

	daxscalerecip = (1<<30)/daxscale;
	dayscalerecip = (1<<30)/dayscale;

	longptr = (int *)davoxptr;
	daxsiz = B_LITTLE32(longptr[0]); daysiz = B_LITTLE32(longptr[1]); dazsiz = B_LITTLE32(longptr[2]);
	daxpivot = B_LITTLE32(longptr[3]); daypivot = B_LITTLE32(longptr[4]); dazpivot = B_LITTLE32(longptr[5]);
	davoxptr += (6<<2);

	x = mulscale16(globalposx-dasprx,daxscalerecip);
	y = mulscale16(globalposy-daspry,daxscalerecip);
	backx = ((dmulscale10(x,sprcosang,y,sprsinang)+daxpivot)>>8);
	backy = ((dmulscale10(y,sprcosang,x,-sprsinang)+daypivot)>>8);
	cbackx = min(max(backx,0),daxsiz-1);
	cbacky = min(max(backy,0),daysiz-1);

	sprcosang = mulscale14(daxscale,sprcosang);
	sprsinang = mulscale14(daxscale,sprsinang);

	x = (dasprx-globalposx) - dmulscale18(daxpivot,sprcosang,daypivot,-sprsinang);
	y = (daspry-globalposy) - dmulscale18(daypivot,sprcosang,daxpivot,sprsinang);

	cosang = mulscale16(cosang,dayscalerecip);
	sinang = mulscale16(sinang,dayscalerecip);

	gxstart = y*cosang - x*sinang;
	gystart = x*cosang + y*sinang;
	gxinc = dmulscale10(sprsinang,cosang,sprcosang,-sinang);
	gyinc = dmulscale10(sprcosang,cosang,sprsinang,sinang);

	x = 0; y = 0; j = max(daxsiz,daysiz);
	for(i=0;i<=j;i++)
	{
		ggxinc[i] = x; x += gxinc;
		ggyinc[i] = y; y += gyinc;
	}

	if ((klabs(globalposz-dasprz)>>10) >= klabs(odayscale)) return;
	syoff = divscale21(globalposz-dasprz,odayscale) + (dazpivot<<7);
	yoff = ((klabs(gxinc)+klabs(gyinc))>>1);
	longptr = (int *)davoxptr;
	xyvoxoffs = ((daxsiz+1)<<2);

	for(cnt=0;cnt<8;cnt++)
	{
		switch(cnt)
		{
			case 0: xs = 0;        ys = 0;        xi = 1;  yi = 1;  break;
			case 1: xs = daxsiz-1; ys = 0;        xi = -1; yi = 1;  break;
			case 2: xs = 0;        ys = daysiz-1; xi = 1;  yi = -1; break;
			case 3: xs = daxsiz-1; ys = daysiz-1; xi = -1; yi = -1; break;
			case 4: xs = 0;        ys = cbacky;   xi = 1;  yi = 2;  break;
			case 5: xs = daxsiz-1; ys = cbacky;   xi = -1; yi = 2;  break;
			case 6: xs = cbackx;   ys = 0;        xi = 2;  yi = 1;  break;
			case 7: xs = cbackx;   ys = daysiz-1; xi = 2;  yi = -1; break;
		}
		xe = cbackx; ye = cbacky;
		if (cnt < 4)
		{
			if ((xi < 0) && (xe >= xs)) continue;
			if ((xi > 0) && (xe <= xs)) continue;
			if ((yi < 0) && (ye >= ys)) continue;
			if ((yi > 0) && (ye <= ys)) continue;
		}
		else
		{
			if ((xi < 0) && (xe > xs)) continue;
			if ((xi > 0) && (xe < xs)) continue;
			if ((yi < 0) && (ye > ys)) continue;
			if ((yi > 0) && (ye < ys)) continue;
			xe += xi; ye += yi;
		}

		i = ksgn(ys-backy)+ksgn(xs-backx)*3+4;
		switch(i)
		{
			case 6: case 7: x1 = 0; y1 = 0; break;
			case 8: case 5: x1 = gxinc; y1 = gyinc; break;
			case 0: case 3: x1 = gyinc; y1 = -gxinc; break;
			case 2: case 1: x1 = gxinc+gyinc; y1 = gyinc-gxinc; break;
		}
		switch(i)
		{
			case 2: case 5: x2 = 0; y2 = 0; break;
			case 0: case 1: x2 = gxinc; y2 = gyinc; break;
			case 8: case 7: x2 = gyinc; y2 = -gxinc; break;
			case 6: case 3: x2 = gxinc+gyinc; y2 = gyinc-gxinc; break;
		}
		oand = pow2char[(xs<backx)+0]+pow2char[(ys<backy)+2];
		oand16 = oand+16;
		oand32 = oand+32;

		if (yi > 0) { dagxinc = gxinc; dagyinc = mulscale16(gyinc,viewingrangerecip); }
		else { dagxinc = -gxinc; dagyinc = -mulscale16(gyinc,viewingrangerecip); }

			//Fix for non 90 degree viewing ranges
		nxoff = mulscale16(x2-x1,viewingrangerecip);
		x1 = mulscale16(x1,viewingrangerecip);

		ggxstart = gxstart+ggyinc[ys];
		ggystart = gystart-ggxinc[ys];

		for(x=xs;x!=xe;x+=xi)
		{
			slabxoffs = (intptr_t)&davoxptr[B_LITTLE32(longptr[x])];
			shortptr = (short *)&davoxptr[((x*(daysiz+1))<<1)+xyvoxoffs];

			nx = mulscale16(ggxstart+ggxinc[x],viewingrangerecip)+x1;
			ny = ggystart+ggyinc[x];
			for(y=ys;y!=ye;y+=yi,nx+=dagyinc,ny-=dagxinc)
			{
				if ((ny <= nytooclose) || (ny >= nytoofar)) continue;
				voxptr = (unsigned char *)(B_LITTLE16(shortptr[y])+slabxoffs);
				voxend = (unsigned char *)(B_LITTLE16(shortptr[y+1])+slabxoffs);
				if (voxptr == voxend) continue;

				lx = mulscale32(nx>>3,distrecip[(ny+y1)>>14])+halfxdimen;
				if (lx < 0) lx = 0;
				rx = mulscale32((nx+nxoff)>>3,distrecip[(ny+y2)>>14])+halfxdimen;
				if (rx > xdimen) rx = xdimen;
				if (rx <= lx) continue;
				rx -= lx;

				l1 = distrecip[(ny-yoff)>>14];
				l2 = distrecip[(ny+yoff)>>14];
				for(;voxptr<voxend;voxptr+=voxptr[1]+3)
				{
					j = (voxptr[0]<<15)-syoff;
					if (j < 0)
					{
						k = j+(voxptr[1]<<15);
						if (k < 0)
						{
							if ((voxptr[2]&oand32) == 0) continue;
							z2 = mulscale32(l2,k) + globalhoriz;     //Below slab
						}
						else
						{
							if ((voxptr[2]&oand) == 0) continue;    //Middle of slab
							z2 = mulscale32(l1,k) + globalhoriz;
						}
						z1 = mulscale32(l1,j) + globalhoriz;
					}
					else
					{
						if ((voxptr[2]&oand16) == 0) continue;
						z1 = mulscale32(l2,j) + globalhoriz;        //Above slab
						z2 = mulscale32(l1,j+(voxptr[1]<<15)) + globalhoriz;
					}

					if (voxptr[1] == 1)
					{
						yplc = 0; yinc = 0;
						if (z1 < daumost[lx]) z1 = daumost[lx];
					}
					else
					{
						if (z2-z1 >= 1024) yinc = divscale16(voxptr[1],z2-z1);
						else if (z2 > z1) yinc = (lowrecip[z2-z1]*voxptr[1]>>8);
						if (z1 < daumost[lx]) { yplc = yinc*(daumost[lx]-z1); z1 = daumost[lx]; } else yplc = 0;
					}
					if (z2 > dadmost[lx]) z2 = dadmost[lx];
					z2 -= z1; if (z2 <= 0) continue;

					drawslab(rx,yplc,z2,yinc,&voxptr[3],(void *)(ylookup[z1]+lx+frameoffset));
				}
			}
		}
	}
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x158, %rsp            # imm = 0x158
movl %r9d, %r14d
movl %r8d, %r12d
movl %edx, 0x48(%rsp)
movzbl 0x1a0(%rsp), %eax
movzwl 0x38f1f6(%rip), %r10d   # 0x3cdd30
movl $0x200, %edx            # imm = 0x200
leal (%r10,%rdx), %r8d
movl $0x7ff, %r9d            # imm = 0x7FF
andl %r9d, %r8d
leaq 0x38f1fd(%rip), %rbx    # 0x3cdd50
movswq (%rbx,%r8,2), %r15
andl %r9d, %r10d
movswq (%rbx,%r10,2), %r11
addl %ecx, %edx
andl %r9d, %edx
andl %r9d, %ecx
movslq 0x1faee1(%rip), %r9     # 0x239a50
movl %edi, 0xa8(%rsp)
movslq %edi, %r8
subq %r9, %r8
movslq 0x1faed1(%rip), %r10    # 0x239a54
movl %esi, 0x34(%rsp)
movslq %esi, %r9
subq %r10, %r9
movq %r15, 0x28(%rsp)
imulq %r15, %r8
movq %r11, 0xb8(%rsp)
imulq %r11, %r9
addq %r8, %r9
shrq $0x6, %r9
movl %r9d, %ebp
negl %ebp
cmovsl %r9d, %ebp
movsbl 0x198(%rsp), %esi
movslq 0x3d4c6f(%rip), %r8     # 0x413830
imulq %rbp, %r8
shrq $0x15, %r8
sarl $0x8, %r8d
addl %esi, %r8d
xorl %r15d, %r15d
testl %r8d, %r8d
cmovlel %r15d, %r8d
movswl 0x3d4c47(%rip), %esi    # 0x413828
decl %esi
cmpl %esi, %r8d
cmovll %r8d, %esi
shll $0x8, %esi
leaq 0x358eec(%rip), %r8     # 0x397ae0
movslq %esi, %rsi
addq (%r8,%rax,8), %rsi
movswq (%rbx,%rdx,2), %r13
movswq (%rbx,%rcx,2), %rbx
movl 0x3d7099(%rip), %edi    # 0x415ca4
callq 0x6e427
cmpl %r14d, %r12d
movl %r14d, %eax
cmovll %r12d, %eax
shll $0xc, %eax
leal (%rax,%rax,4), %eax
cmpl %eax, %ebp
jl 0x3ec37
addl %eax, %eax
incl %r15d
cmpl $0x5, %r15d
jne 0x3ec20
movl $0x5, %r15d
jmp 0x3ec3a
movl %r15d, %ebp
cmpl $0x5, %r15d
movl $0x4, %ecx
cmovbl %ebp, %ecx
xorl %eax, %eax
cmpl $0x0, 0x178db1(%rip)    # 0x1b7a00
cmovnel %eax, %ecx
movzbl 0x190(%rsp), %eax
leaq (%rax,%rax,4), %rdx
leaq 0x31ee6b(%rip), %rsi    # 0x35dad0
leaq (%rsi,%rdx,8), %rdi
movq (%rdi,%rcx,8), %r15
testq %r15, %r15
setne %dil
testl %ecx, %ecx
sete %r8b
orb %dil, %r8b
jne 0x3ec85
movq (%rsi,%rdx,8), %r15
xorl %ecx, %ecx
testq %r15, %r15
movq 0xb8(%rsp), %r11
je 0x3f91e
leaq 0x354e33(%rip), %rdx    # 0x393ad0
movslq (%rdx,%rax,4), %rax
cmpq $0x10000, %rax          # imm = 0x10000
jne 0x3ecb4
addb $0x8, %cl
shll %cl, %r12d
shll %cl, %r14d
jmp 0x3ecd0
shll %cl, %r12d
movslq %r12d, %r12
imulq %rax, %r12
shll %cl, %r14d
shrq $0x8, %r12
movslq %r14d, %r14
imulq %rax, %r14
shrq $0x8, %r14
movslq 0x31dbe1(%rip), %rax    # 0x35c8b8
movslq %r12d, %rcx
imulq %rax, %rcx
movslq 0x23bdb3(%rip), %rsi    # 0x27aa98
movl 0x64b45(%rip), %edx     # 0xa3830
shll $0x8, %edx
shrq $0x10, %rcx
movslq %ecx, %rax
imulq %rsi, %rax
movslq %edx, %rdi
cqto
idivq %rdi
movq %rax, %rcx
movslq 0x38f02d(%rip), %rax    # 0x3cdd38
movq %r14, 0x88(%rsp)
movslq %r14d, %rdx
imulq %rsi, %rax
shrq $0x10, %rax
cltq
movq %rdx, 0x40(%rsp)
imulq %rdx, %rax
cqto
idivq %rdi
movq %rax, %rsi
xorl %r12d, %r12d
movl $0x40000000, %eax       # imm = 0x40000000
xorl %edx, %edx
idivl %ecx
movl %eax, %edi
movl $0x40000000, %eax       # imm = 0x40000000
xorl %edx, %edx
idivl %esi
movl (%r15), %ebp
movslq 0xc(%r15), %rsi
movslq 0x10(%r15), %r14
movl 0x1facf6(%rip), %r8d    # 0x239a50
movl %r8d, 0x64(%rsp)
subl 0xa8(%rsp), %r8d
movslq %r8d, %r8
movslq %edi, %rdx
movl 0x1face0(%rip), %r9d    # 0x239a54
movl %r9d, 0x4(%rsp)
subl 0x34(%rsp), %r9d
movslq %r9d, %r9
shlq $0x10, %rdx
imulq %rdx, %r8
sarq $0x20, %r8
movq %r8, %r10
imulq %r13, %r10
imulq %r9, %rdx
sarq $0x20, %rdx
movq %rdx, %rdi
imulq %rbx, %rdi
addq %r10, %rdi
shrq $0xa, %rdi
movq %rsi, 0xa0(%rsp)
addl %esi, %edi
sarl $0x8, %edi
imulq %r13, %rdx
imulq %rbx, %r8
subq %r8, %rdx
shrq $0xa, %rdx
movq %r14, 0xc8(%rsp)
addl %r14d, %edx
sarl $0x8, %edx
testl %edi, %edi
movl $0x0, %r8d
movq %rdi, 0xe8(%rsp)
cmovgl %edi, %r8d
leal -0x1(%rbp), %edi
cmpl %edi, %r8d
movl %edi, 0x5c(%rsp)
cmovgel %edi, %r8d
movq %r8, 0x20(%rsp)
testl %edx, %edx
movl $0x0, %edi
movq %rdx, 0xf0(%rsp)
cmovgl %edx, %edi
movl 0x4(%r15), %r9d
leal -0x1(%r9), %edx
cmpl %edx, %edi
movl %edx, 0x58(%rsp)
cmovgel %edx, %edi
movq %rdi, 0x38(%rsp)
movslq %ecx, %rcx
imulq %rcx, %rbx
imulq %rcx, %r13
cltq
movq 0x28(%rsp), %rcx
imulq %rax, %rcx
imulq %rax, %r11
shrq $0xe, %rbx
shrq $0xe, %r13
movslq %r13d, %r8
movq %r11, %rsi
shrq $0x10, %rsi
movq %rcx, 0x28(%rsp)
movq %rcx, %rax
sarq $0x10, %rax
movslq %ebx, %r13
movq %rax, %r10
imulq %r13, %r10
movabsq $-0x100000000, %rdx     # imm = 0xFFFFFFFF00000000
movq %rsi, %rcx
imulq %rdx, %rcx
sarq $0x20, %rcx
imulq %r8, %rcx
addq %r10, %rcx
imulq %r8, %rax
sarq $0x10, %r11
imulq %r13, %r11
addq %rax, %r11
shrq $0xa, %rcx
shrq $0xa, %r11
cmpl %r9d, %ebp
movl %r9d, %eax
movq %rbp, 0x80(%rsp)
cmovgl %ebp, %eax
movq %r15, %rdi
movl 0x14(%r15), %edx
movl %edx, 0x68(%rsp)
testl %eax, %eax
movq %r11, %rdx
js 0x3eee8
incl %eax
leaq 0x56dd1c(%rip), %r15    # 0x5acbe0
leaq 0x56e125(%rip), %rbp    # 0x5acff0
xorl %r10d, %r10d
xorl %r11d, %r11d
movl %r12d, (%r10,%r15)
addl %ecx, %r12d
movl %r11d, (%r10,%rbp)
addl %edx, %r11d
addq $0x4, %r10
decq %rax
jne 0x3eed1
movq %rcx, 0xb0(%rsp)
movslq 0x22bb69(%rip), %rax    # 0x26aa60
movslq 0x48(%rsp), %r10
subq %r10, %rax
movl %eax, %r10d
negl %r10d
cmovsl %eax, %r10d
shrl $0xa, %r10d
movq 0x88(%rsp), %rcx
movl %ecx, %r11d
negl %r11d
cmovsl %ecx, %r11d
cmpl %r11d, %r10d
movq 0xf0(%rsp), %r15
movq 0xe8(%rsp), %r12
jae 0x3f91e
movq %rdx, %r11
movq %rdi, %r14
movabsq $-0x100000000, %rcx     # imm = 0xFFFFFFFF00000000
imulq %rcx, %rbx
sarq $0x20, %rbx
movq %r8, %r10
movq 0xa0(%rsp), %rcx
imulq %rcx, %r10
movq 0xc8(%rsp), %rdx
imulq %rdx, %rbx
addq %r10, %rbx
movl 0x68(%rsp), %r10d
imulq %rdx, %r8
imulq %rcx, %r13
addq %r8, %r13
shrq $0x12, %rbx
shrq $0x12, %r13
movl 0x64(%rsp), %edx
addl %ebx, %edx
movl 0x4(%rsp), %edi
addl %r13d, %edi
movq 0x28(%rsp), %rbx
shrq $0x10, %rbx
movl 0xa8(%rsp), %ecx
subl %edx, %ecx
movl 0x34(%rsp), %r8d
subl %edi, %r8d
movl %r8d, %edi
imull %ebx, %edi
movl %ecx, %edx
imull %esi, %edx
subl %edx, %edi
imull %ebx, %ecx
imull %esi, %r8d
addl %ecx, %r8d
movl %r8d, 0x34(%rsp)
addq $0x18, %r14
shlq $0x15, %rax
cqto
idivq 0x40(%rsp)
movq 0xb0(%rsp), %rdx
movl %edx, %esi
negl %esi
movl %edx, %ecx
movl %esi, 0x54(%rsp)
cmovnsl %esi, %ecx
movl %r11d, %esi
negl %esi
cmovsl %r11d, %esi
addl %ecx, %esi
shrl %esi
movq %rsi, 0x120(%rsp)
movq 0x80(%rsp), %rcx
leal 0x4(,%rcx,4), %ecx
movl %ecx, 0xd8(%rsp)
leal (%rdx,%r11), %ecx
movl %ecx, 0x94(%rsp)
movl %r11d, %ecx
subl %edx, %ecx
movl %ecx, 0x90(%rsp)
movslq %r11d, %rcx
movq %rcx, 0xe0(%rsp)
leal 0x2(,%r9,2), %ecx
movl %ecx, 0xd4(%rsp)
shll $0x7, %r10d
addl %eax, %r10d
negl %r10d
movslq %edi, %rax
movq %rax, 0x108(%rsp)
movq $0x0, 0x8(%rsp)
movq $0x0, 0x10(%rsp)
movl $0x0, (%rsp)
xorl %r8d, %r8d
movl $0x0, 0x28(%rsp)
movq $0x0, 0x78(%rsp)
movl $0x0, 0x18(%rsp)
movq $0x0, 0x70(%rsp)
xorl %eax, %eax
movl $0x0, 0x1c(%rsp)
movq %r14, 0x130(%rsp)
movq %r11, 0xb8(%rsp)
cmpl $0x7, 0x1c(%rsp)
ja 0x3f1ac
movl 0x1c(%rsp), %ecx
leaq 0x36da4(%rip), %rdx     # 0x75e70
movslq (%rdx,%rcx,4), %rcx
addq %rdx, %rcx
jmpq *%rcx
movl $0x1, %ecx
movq %rcx, 0x10(%rsp)
xorl %r8d, %r8d
movl $0x0, (%rsp)
movl $0x1, %ecx
jmp 0x3f140
movl $0x2, %ecx
movq %rcx, 0x8(%rsp)
movl $0x1, %ecx
movq %rcx, 0x10(%rsp)
xorl %r8d, %r8d
jmp 0x3f1a4
movl $0xffffffff, %ecx       # imm = 0xFFFFFFFF
movq %rcx, 0x8(%rsp)
movl $0x1, %ecx
movq %rcx, 0x10(%rsp)
xorl %r8d, %r8d
jmp 0x3f163
movl $0xffffffff, %ecx       # imm = 0xFFFFFFFF
movq %rcx, 0x10(%rsp)
movl 0x5c(%rsp), %r8d
movl 0x58(%rsp), %ecx
movl %ecx, (%rsp)
movl $0xffffffff, %ecx       # imm = 0xFFFFFFFF
movq %rcx, 0x8(%rsp)
jmp 0x3f1ac
movl $0xffffffff, %ecx       # imm = 0xFFFFFFFF
movq %rcx, 0x8(%rsp)
movl $0x2, %ecx
movq %rcx, 0x10(%rsp)
movq 0x20(%rsp), %rcx
movl %ecx, %r8d
movl 0x58(%rsp), %ecx
jmp 0x3f1a9
movl $0x1, %ecx
movq %rcx, 0x8(%rsp)
movl $0xffffffff, %ecx       # imm = 0xFFFFFFFF
movq %rcx, 0x10(%rsp)
movl $0x0, (%rsp)
movl 0x5c(%rsp), %r8d
jmp 0x3f1ac
movl $0x2, %ecx
movq %rcx, 0x8(%rsp)
movl $0xffffffff, %ecx       # imm = 0xFFFFFFFF
movq %rcx, 0x10(%rsp)
movl 0x5c(%rsp), %r8d
movq 0x38(%rsp), %rcx
movl %ecx, (%rsp)
cmpl $0x3, 0x1c(%rsp)
movl %r8d, 0x4(%rsp)
ja 0x3f22e
cmpl $0x0, 0x10(%rsp)
jns 0x3f1ca
cmpl %r8d, 0x20(%rsp)
jge 0x3f90b
cmpl $0x0, 0x10(%rsp)
jle 0x3f1dc
cmpl %r8d, 0x20(%rsp)
jle 0x3f90b
cmpl $0x0, 0x8(%rsp)
jns 0x3f1f0
movl (%rsp), %ecx
cmpl %ecx, 0x38(%rsp)
jge 0x3f90b
movq 0x20(%rsp), %rcx
movl %ecx, %esi
movq 0x38(%rsp), %rcx
movl %ecx, %edx
cmpl $0x0, 0x8(%rsp)
movq 0xb0(%rsp), %r8
jle 0x3f29b
movq 0x20(%rsp), %rcx
movl %ecx, %esi
movq 0x38(%rsp), %rcx
movl %ecx, %edx
cmpl (%rsp), %ecx
jg 0x3f29b
movl 0x4(%rsp), %r8d
jmp 0x3f90b
cmpl $0x0, 0x10(%rsp)
jns 0x3f240
cmpl %r8d, 0x20(%rsp)
jg 0x3f90b
cmpl $0x0, 0x10(%rsp)
jle 0x3f252
cmpl %r8d, 0x20(%rsp)
jl 0x3f90b
cmpl $0x0, 0x8(%rsp)
jns 0x3f266
movl (%rsp), %ecx
cmpl %ecx, 0x38(%rsp)
jg 0x3f90b
cmpl $0x0, 0x8(%rsp)
jle 0x3f27a
movl (%rsp), %ecx
cmpl %ecx, 0x38(%rsp)
jl 0x3f90b
movq 0x20(%rsp), %rcx
movq 0x10(%rsp), %rdx
leal (%rdx,%rcx), %esi
movq 0x38(%rsp), %rcx
movq 0x8(%rsp), %rdx
addl %ecx, %edx
movq 0xb0(%rsp), %r8
movl %edx, 0x9c(%rsp)
movl %esi, 0x98(%rsp)
movl (%rsp), %edx
subl %r15d, %edx
movl %edx, %ecx
sarl $0x1f, %ecx
testl %edx, %edx
movl $0x1, %edx
cmovgl %edx, %ecx
movl 0x4(%rsp), %esi
subl %r12d, %esi
movl %esi, %edx
sarl $0x1f, %edx
andl $-0x3, %edx
testl %esi, %esi
movl $0x3, %esi
cmovgl %esi, %edx
leal (%rcx,%rdx), %esi
addl $0x4, %esi
cmpl $0x8, %esi
ja 0x3f34b
leaq 0x36ba7(%rip), %rdi     # 0x75e90
movslq (%rdi,%rsi,4), %rsi
addq %rdi, %rsi
jmpq *%rsi
movl %r11d, %eax
movl 0x54(%rsp), %esi
jmp 0x3f346
movl $0x1, %ecx
movq %rcx, 0x8(%rsp)
movl $0x2, %ecx
movq %rcx, 0x10(%rsp)
movl $0x0, (%rsp)
movq 0x20(%rsp), %rcx
movl %ecx, %r8d
jmp 0x3f1ac
xorl %eax, %eax
movq $0x0, 0x70(%rsp)
jmp 0x3f34b
movl %r8d, %eax
movl %r11d, %esi
jmp 0x3f346
movl 0x94(%rsp), %eax
movl 0x90(%rsp), %esi
movq %rsi, 0x70(%rsp)
addl %edx, %ecx
addl $0x4, %ecx
cmpl $0x8, %ecx
ja 0x3f3a4
leaq 0x36b58(%rip), %rdx     # 0x75eb4
movslq (%rdx,%rcx,4), %rcx
addq %rdx, %rcx
jmpq *%rcx
movl %r8d, 0x18(%rsp)
movl %r11d, %ecx
jmp 0x3f38c
movl %r11d, 0x18(%rsp)
movl 0x54(%rsp), %ecx
jmp 0x3f38c
movl 0x94(%rsp), %ecx
movl %ecx, 0x18(%rsp)
movl 0x90(%rsp), %ecx
movq %rcx, 0x78(%rsp)
jmp 0x3f3a4
movl $0x0, 0x18(%rsp)
movq $0x0, 0x78(%rsp)
xorl %ecx, %ecx
movq %r12, %rbx
cmpl %r12d, 0x4(%rsp)
setl %sil
xorl %edx, %edx
movq %r15, %r12
cmpl %r15d, (%rsp)
setl %r15b
movslq 0x38e972(%rip), %r13    # 0x3cdd38
cmpl $0x0, 0x8(%rsp)
jle 0x3f3e9
imulq 0xe0(%rsp), %r13
shrq $0x10, %r13
movq %r13, 0xc0(%rsp)
movl %r8d, 0x60(%rsp)
jmp 0x3f409
imulq 0xe0(%rsp), %r13
shrq $0x10, %r13
negl %r13d
movq %r13, 0xc0(%rsp)
movl 0x54(%rsp), %edi
movl %edi, 0x60(%rsp)
movslq 0x38e928(%rip), %rdi    # 0x3cdd38
movslq %eax, %r13
imulq %rdi, %r13
shrq $0x10, %r13
movl 0x4(%rsp), %r8d
cmpl 0x98(%rsp), %r8d
jne 0x3f438
movl %r13d, %eax
movq %r12, %r15
movq %rbx, %r12
jmp 0x3f90b
movb %sil, %cl
movb %r15b, %dl
leaq 0x6435b(%rip), %rsi     # 0xa37a0
movb 0x2(%rdx,%rsi), %dl
addb (%rcx,%rsi), %dl
leal 0x10(%rdx), %ecx
movl %ecx, 0x64(%rsp)
movq %rdx, 0x148(%rsp)
leal 0x20(%rdx), %ecx
movl %ecx, 0xdc(%rsp)
movl 0x18(%rsp), %ecx
subl %eax, %ecx
movslq %ecx, %rax
imulq %rax, %rdi
shrq $0x10, %rdi
movslq (%rsp), %rcx
leaq 0x56db6f(%rip), %rax    # 0x5acff0
movslq (%rax,%rcx,4), %rdx
movl 0x34(%rsp), %esi
leaq 0x56d750(%rip), %rax    # 0x5acbe0
movq %rcx, 0x118(%rsp)
subl (%rax,%rcx,4), %esi
movl %esi, 0xd0(%rsp)
addq 0x108(%rsp), %rdx
movq %rdx, 0x110(%rsp)
movslq 0x8(%rsp), %rax
movq %rax, 0xa8(%rsp)
movslq %r8d, %rsi
movslq 0x10(%rsp), %rax
movq %rax, 0x128(%rsp)
movl 0x9c(%rsp), %r11d
movq 0xc0(%rsp), %r12
movq %r13, %rdx
movq %rdi, 0x68(%rsp)
movq %r13, 0x40(%rsp)
cmpl %r11d, (%rsp)
movq %rsi, 0x140(%rsp)
je 0x3f8cc
movslq (%r14,%rsi,4), %rax
addq %r14, %rax
movq %rax, 0x138(%rsp)
movl 0xd4(%rsp), %eax
imull %esi, %eax
addl 0xd8(%rsp), %eax
cltq
addq %r14, %rax
movq %rax, 0x150(%rsp)
leaq 0x56dabe(%rip), %rax    # 0x5acff0
movl (%rax,%rsi,4), %ebx
addl 0xd0(%rsp), %ebx
movslq 0x38e7f5(%rip), %rax    # 0x3cdd38
leaq 0x56d696(%rip), %rcx    # 0x5acbe0
movslq (%rcx,%rsi,4), %rsi
addq 0x110(%rsp), %rsi
imulq %rax, %rsi
shrq $0x10, %rsi
addl %edx, %esi
movq 0x118(%rsp), %r15
movl 0x60(%rsp), %r14d
cmpl 0x45b98d(%rip), %ebx    # 0x49af00
jle 0x3f8b5
cmpb $0x0, 0x45b984(%rip)    # 0x49af04
movl $0x0, %eax
movl $0x3ff00000, %ecx       # imm = 0x3FF00000
cmovnel %ecx, %eax
cmpl %eax, %ebx
jge 0x3f8b5
movl %r10d, %ebp
movq 0x150(%rsp), %rax
movswq (%rax,%r15,2), %r13
movswq 0x2(%rax,%r15,2), %r10
cmpw %r10w, %r13w
je 0x3f8b2
movl %esi, %eax
sarl $0x3, %eax
movq 0x70(%rsp), %rcx
addl %ebx, %ecx
sarl $0xe, %ecx
movslq %ecx, %rcx
leaq 0x41b932(%rip), %r8     # 0x45af00
movslq (%r8,%rcx,4), %rcx
movslq %eax, %r9
imulq %rcx, %r9
shrq $0x20, %r9
movl 0x3d8881(%rip), %eax    # 0x417e64
addl %eax, %r9d
testl %r9d, %r9d
movl $0x0, %ecx
cmovlel %ecx, %r9d
movq %rsi, 0x48(%rsp)
leal (%rsi,%rdi), %ecx
sarl $0x3, %ecx
movq 0x78(%rsp), %rdx
addl %ebx, %edx
sarl $0xe, %edx
movslq %edx, %rdx
movslq (%r8,%rdx,4), %rdx
movslq %ecx, %rcx
imulq %rdx, %rcx
shrq $0x20, %rcx
addl %eax, %ecx
movl 0x6420f(%rip), %eax     # 0xa3830
cmpl %eax, %ecx
cmovgel %eax, %ecx
movq %r9, 0xa0(%rsp)
subl %r9d, %ecx
movq %rcx, 0xc8(%rsp)
jle 0x3f897
movq 0x138(%rsp), %rax
addq %rax, %r13
addq %rax, %r10
movq %r10, 0xf8(%rsp)
cmpq %r10, %r13
movl 0x4(%rsp), %r8d
jae 0x3f8a8
movq 0x120(%rsp), %rcx
leal (%rbx,%rcx), %eax
sarl $0xe, %eax
cltq
leaq 0x41b886(%rip), %rdx    # 0x45af00
movslq (%rdx,%rax,4), %rax
movq %rax, 0x100(%rsp)
movl %ebx, %eax
subl %ecx, %eax
sarl $0xe, %eax
cltq
movslq (%rdx,%rax,4), %rax
movq %rax, 0x80(%rsp)
movl 0xa0(%rsp), %eax
movq %rax, 0x88(%rsp)
movq 0x40(%rsp), %rdx
movq 0x48(%rsp), %rsi
movq 0xf8(%rsp), %r9
movl %ebp, %r10d
movzbl (%r13), %eax
shll $0xf, %eax
addl %r10d, %eax
js 0x3f714
movl 0x64(%rsp), %ecx
testb %cl, 0x2(%r13)
je 0x3f879
movl %eax, %edi
imulq 0x100(%rsp), %rdi
shrq $0x20, %rdi
movl 0x23b3ad(%rip), %edx    # 0x27aa9c
addl %edx, %edi
movzbl 0x1(%r13), %ecx
shll $0xf, %ecx
addl %eax, %ecx
imulq 0x80(%rsp), %rcx
shrq $0x20, %rcx
addl %edx, %ecx
movq 0x88(%rsp), %rbp
jmp 0x3f78b
movzbl 0x1(%r13), %ecx
shll $0xf, %ecx
movslq %eax, %rdi
addq %rdi, %rcx
movb 0x2(%r13), %al
testl %ecx, %ecx
js 0x3f74f
testb %al, 0x148(%rsp)
movq 0x88(%rsp), %rbp
je 0x3f890
movl %ecx, %ecx
movq 0x80(%rsp), %rdx
imulq %rdx, %rcx
jmp 0x3f775
testb %al, 0xdc(%rsp)
movq 0x88(%rsp), %rbp
je 0x3f890
imulq 0x100(%rsp), %rcx
movq 0x80(%rsp), %rdx
shrq $0x20, %rcx
movl 0x23b31d(%rip), %eax    # 0x27aa9c
addl %eax, %ecx
imulq %rdx, %rdi
shrq $0x20, %rdi
addl %eax, %edi
movzbl 0x1(%r13), %eax
cmpl $0x1, %eax
jne 0x3f7b0
leaq 0x46e174(%rip), %rax    # 0x4ad910
movl (%rax,%rbp,4), %eax
cmpl %eax, %edi
cmovgl %edi, %eax
xorl %esi, %esi
movl $0x0, 0x28(%rsp)
jmp 0x3f7fb
movl %ecx, %esi
subl %edi, %esi
cmpl $0x400, %esi            # imm = 0x400
jl 0x3f7c5
shll $0x10, %eax
xorl %edx, %edx
divl %esi
jmp 0x3f7da
cmpl %edi, %ecx
jle 0x3f7de
movslq %esi, %rdx
leaq 0x31d2fd(%rip), %rsi    # 0x35cad0
imull (%rsi,%rdx,4), %eax
sarl $0x8, %eax
movl %eax, 0x28(%rsp)
leaq 0x46e12b(%rip), %rax    # 0x4ad910
movl (%rax,%rbp,4), %eax
xorl %esi, %esi
movl %eax, %edx
subl %edi, %edx
jle 0x3f7f9
imull 0x28(%rsp), %edx
movl %edx, %esi
jmp 0x3f7fb
movl %edi, %eax
leaq 0x46a50e(%rip), %rdx    # 0x4a9d10
movl (%rdx,%rbp,4), %edx
cmpl %edx, %ecx
cmovll %ecx, %edx
subl %eax, %edx
jle 0x3f86a
leaq 0x3(%r13), %r8
cltq
leaq 0x3d6485(%rip), %rcx    # 0x415ca0
movslq (%rcx,%rax,4), %rax
movslq 0xa0(%rsp), %r9
addq %rax, %r9
addq 0x396f5f(%rip), %r9     # 0x3d6790
movq 0xc8(%rsp), %rdi
movl 0x28(%rsp), %ecx
movl %r10d, %ebp
callq 0x6e435
movq 0xf8(%rsp), %r9
movl 0x9c(%rsp), %r11d
movl 0x4(%rsp), %r8d
movl 0x60(%rsp), %r14d
movl %ebp, %r10d
movq 0xc0(%rsp), %r12
movq 0x40(%rsp), %rdx
movq 0x68(%rsp), %rdi
movq 0x48(%rsp), %rsi
movzbl 0x1(%r13), %eax
addq %rax, %r13
addq $0x3, %r13
cmpq %r9, %r13
jb 0x3f6bf
jmp 0x3f8b5
movq 0x68(%rsp), %rdi
jmp 0x3f879
movq 0x40(%rsp), %rdx
movq 0x48(%rsp), %rsi
movl 0x4(%rsp), %r8d
jmp 0x3f8b2
movq 0x40(%rsp), %rdx
movq 0x48(%rsp), %rsi
movl %ebp, %r10d
addq 0xa8(%rsp), %r15
addl %r12d, %esi
subl %r14d, %ebx
cmpl %r15d, %r11d
jne 0x3f56d
movq 0x140(%rsp), %rsi
addq 0x128(%rsp), %rsi
cmpl %esi, 0x98(%rsp)
movq 0x130(%rsp), %r14
jne 0x3f4ec
movl %edx, %eax
movq 0xb8(%rsp), %r11
movq 0xf0(%rsp), %r15
movq 0xe8(%rsp), %r12
movl 0x1c(%rsp), %ecx
incl %ecx
movl %ecx, 0x1c(%rsp)
cmpl $0x8, %ecx
jne 0x3f0b6
addq $0x158, %rsp            # imm = 0x158
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq