// File: /workspace/github_c_makefile_star2_O0/jonof[P]jftekwar/jfbuild/src/engine.c
// Function: hitscan
int hitscan(int xs, int ys, int zs, short sectnum, int vx, int vy, int vz,
	short *hitsect, short *hitwall, short *hitsprite,
	int *hitx, int *hity, int *hitz, unsigned int cliptype)
{
	sectortype *sec;
	walltype *wal, *wal2;
	spritetype *spr;
	int z, zz, x1, y1=0, z1=0, x2, y2, x3, y3, x4, y4, intx, inty, intz;
	int topt, topu, bot, dist, offx, offy, cstat;
	int i, j, k, l, tilenum, xoff, yoff, dax, day, daz, daz2;
	int ang, cosang, sinang, xspan, yspan, xrepeat, yrepeat;
	int dawalclipmask, dasprclipmask;
	short tempshortcnt, tempshortnum, dasector, startwall, endwall;
	short nextsector;
	unsigned char clipyou;

	*hitsect = -1; *hitwall = -1; *hitsprite = -1;
	if (sectnum < 0) return(-1);

	*hitx = hitscangoalx; *hity = hitscangoaly;

	dawalclipmask = (cliptype&65535);
	dasprclipmask = (cliptype>>16);

	clipsectorlist[0] = sectnum;
	tempshortcnt = 0; tempshortnum = 1;
	do
	{
		dasector = clipsectorlist[tempshortcnt]; sec = &sector[dasector];

		x1 = 0x7fffffff;
		if (sec->ceilingstat&2)
		{
			wal = &wall[sec->wallptr]; wal2 = &wall[wal->point2];
			dax = wal2->x-wal->x; day = wal2->y-wal->y;
			i = nsqrtasm(dax*dax+day*day); if (i == 0) continue;
			i = divscale15(sec->ceilingheinum,i);
			dax *= i; day *= i;

			j = (vz<<8)-dmulscale15(dax,vy,-day,vx);
			if (j != 0)
			{
				i = ((sec->ceilingz-zs)<<8)+dmulscale15(dax,ys-wal->y,-day,xs-wal->x);
				if (((i^j) >= 0) && ((klabs(i)>>1) < klabs(j)))
				{
					i = divscale30(i,j);
					x1 = xs + mulscale30(vx,i);
					y1 = ys + mulscale30(vy,i);
					z1 = zs + mulscale30(vz,i);
				}
			}
		}
		else if ((vz < 0) && (zs >= sec->ceilingz))
		{
			z1 = sec->ceilingz; i = z1-zs;
			if ((klabs(i)>>1) < -vz)
			{
				i = divscale30(i,vz);
				x1 = xs + mulscale30(vx,i);
				y1 = ys + mulscale30(vy,i);
			}
		}
		if ((x1 != 0x7fffffff) && (klabs(x1-xs)+klabs(y1-ys) < klabs((*hitx)-xs)+klabs((*hity)-ys)))
			if (inside(x1,y1,dasector) != 0)
			{
				*hitsect = dasector; *hitwall = -1; *hitsprite = -1;
				*hitx = x1; *hity = y1; *hitz = z1;
			}

		x1 = 0x7fffffff;
		if (sec->floorstat&2)
		{
			wal = &wall[sec->wallptr]; wal2 = &wall[wal->point2];
			dax = wal2->x-wal->x; day = wal2->y-wal->y;
			i = nsqrtasm(dax*dax+day*day); if (i == 0) continue;
			i = divscale15(sec->floorheinum,i);
			dax *= i; day *= i;

			j = (vz<<8)-dmulscale15(dax,vy,-day,vx);
			if (j != 0)
			{
				i = ((sec->floorz-zs)<<8)+dmulscale15(dax,ys-wal->y,-day,xs-wal->x);
				if (((i^j) >= 0) && ((klabs(i)>>1) < klabs(j)))
				{
					i = divscale30(i,j);
					x1 = xs + mulscale30(vx,i);
					y1 = ys + mulscale30(vy,i);
					z1 = zs + mulscale30(vz,i);
				}
			}
		}
		else if ((vz > 0) && (zs <= sec->floorz))
		{
			z1 = sec->floorz; i = z1-zs;
			if ((klabs(i)>>1) < vz)
			{
				i = divscale30(i,vz);
				x1 = xs + mulscale30(vx,i);
				y1 = ys + mulscale30(vy,i);
			}
		}
		if ((x1 != 0x7fffffff) && (klabs(x1-xs)+klabs(y1-ys) < klabs((*hitx)-xs)+klabs((*hity)-ys)))
			if (inside(x1,y1,dasector) != 0)
			{
				*hitsect = dasector; *hitwall = -1; *hitsprite = -1;
				*hitx = x1; *hity = y1; *hitz = z1;
			}

		startwall = sec->wallptr; endwall = startwall + sec->wallnum;
		for(z=startwall,wal=&wall[startwall];z<endwall;z++,wal++)
		{
			wal2 = &wall[wal->point2];
			x1 = wal->x; y1 = wal->y; x2 = wal2->x; y2 = wal2->y;

			if ((x1-xs)*(y2-ys) < (x2-xs)*(y1-ys)) continue;
			if (rintersect(xs,ys,zs,vx,vy,vz,x1,y1,x2,y2,&intx,&inty,&intz) == 0) continue;

			if (klabs(intx-xs)+klabs(inty-ys) >= klabs((*hitx)-xs)+klabs((*hity)-ys)) continue;

			nextsector = wal->nextsector;
			if ((nextsector < 0) || (wal->cstat&dawalclipmask))
			{
				*hitsect = dasector; *hitwall = z; *hitsprite = -1;
				*hitx = intx; *hity = inty; *hitz = intz;
				continue;
			}
			getzsofslope(nextsector,intx,inty,&daz,&daz2);
			if ((intz <= daz) || (intz >= daz2))
			{
				*hitsect = dasector; *hitwall = z; *hitsprite = -1;
				*hitx = intx; *hity = inty; *hitz = intz;
				continue;
			}

			for(zz=tempshortnum-1;zz>=0;zz--)
				if (clipsectorlist[zz] == nextsector) break;
			if (zz < 0) clipsectorlist[tempshortnum++] = nextsector;
		}

		for(z=headspritesect[dasector];z>=0;z=nextspritesect[z])
		{
			spr = &sprite[z];
			cstat = spr->cstat;
#if USE_POLYMOST
			if (!hitallsprites)
#endif
			if ((cstat&dasprclipmask) == 0) continue;

			x1 = spr->x; y1 = spr->y; z1 = spr->z;
			switch(cstat&48)
			{
				case 0:
					topt = vx*(x1-xs) + vy*(y1-ys); if (topt <= 0) continue;
					bot = vx*vx + vy*vy; if (bot == 0) continue;

					intz = zs+scale(vz,topt,bot);

					i = (tilesizy[spr->picnum]*spr->yrepeat<<2);
					if (cstat&128) z1 += (i>>1);
					if (picanm[spr->picnum]&0x00ff0000) z1 -= ((int)((signed char)((picanm[spr->picnum]>>16)&255))*spr->yrepeat<<2);
					if ((intz > z1) || (intz < z1-i)) continue;
					topu = vx*(y1-ys) - vy*(x1-xs);

					offx = scale(vx,topu,bot);
					offy = scale(vy,topu,bot);
					dist = offx*offx + offy*offy;
					i = tilesizx[spr->picnum]*spr->xrepeat; i *= i;
					if (dist > (i>>7)) continue;
					intx = xs + scale(vx,topt,bot);
					inty = ys + scale(vy,topt,bot);

					if (klabs(intx-xs)+klabs(inty-ys) > klabs((*hitx)-xs)+klabs((*hity)-ys)) continue;

					*hitsect = dasector; *hitwall = -1; *hitsprite = z;
					*hitx = intx; *hity = inty; *hitz = intz;
					break;
				case 16:
						//These lines get the 2 points of the rotated sprite
						//Given: (x1, y1) starts out as the center point
					tilenum = spr->picnum;
					xoff = (int)((signed char)((picanm[tilenum]>>8)&255))+((int)spr->xoffset);
					if ((cstat&4) > 0) xoff = -xoff;
					k = spr->ang; l = spr->xrepeat;
					dax = sintable[k&2047]*l; day = sintable[(k+1536)&2047]*l;
					l = tilesizx[tilenum]; k = (l>>1)+xoff;
					x1 -= mulscale16(dax,k); x2 = x1+mulscale16(dax,l);
					y1 -= mulscale16(day,k); y2 = y1+mulscale16(day,l);

					if ((cstat&64) != 0)   //back side of 1-way sprite
						if ((x1-xs)*(y2-ys) < (x2-xs)*(y1-ys)) continue;

					if (rintersect(xs,ys,zs,vx,vy,vz,x1,y1,x2,y2,&intx,&inty,&intz) == 0) continue;

					if (klabs(intx-xs)+klabs(inty-ys) > klabs((*hitx)-xs)+klabs((*hity)-ys)) continue;

					k = ((tilesizy[spr->picnum]*spr->yrepeat)<<2);
					if (cstat&128) daz = spr->z+(k>>1); else daz = spr->z;
					if (picanm[spr->picnum]&0x00ff0000) daz -= ((int)((signed char)((picanm[spr->picnum]>>16)&255))*spr->yrepeat<<2);
					if ((intz < daz) && (intz > daz-k))
					{
						*hitsect = dasector; *hitwall = -1; *hitsprite = z;
						*hitx = intx; *hity = inty; *hitz = intz;
					}
					break;
				case 32:
					if (vz == 0) continue;
					intz = z1;
					if (((intz-zs)^vz) < 0) continue;
					if ((cstat&64) != 0)
						if ((zs > intz) == ((cstat&8)==0)) continue;

					intx = xs+scale(intz-zs,vx,vz);
					inty = ys+scale(intz-zs,vy,vz);

					if (klabs(intx-xs)+klabs(inty-ys) > klabs((*hitx)-xs)+klabs((*hity)-ys)) continue;

					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 ((cstat&4) > 0) xoff = -xoff;
					if ((cstat&8) > 0) yoff = -yoff;

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

					dax = ((xspan>>1)+xoff)*xrepeat; day = ((yspan>>1)+yoff)*yrepeat;
					x1 += dmulscale16(sinang,dax,cosang,day)-intx;
					y1 += dmulscale16(sinang,day,-cosang,dax)-inty;
					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;

					clipyou = 0;
					if ((y1^y2) < 0)
					{
						if ((x1^x2) < 0) clipyou ^= (x1*y2<x2*y1)^(y1<y2);
						else if (x1 >= 0) clipyou ^= 1;
					}
					if ((y2^y3) < 0)
					{
						if ((x2^x3) < 0) clipyou ^= (x2*y3<x3*y2)^(y2<y3);
						else if (x2 >= 0) clipyou ^= 1;
					}
					if ((y3^y4) < 0)
					{
						if ((x3^x4) < 0) clipyou ^= (x3*y4<x4*y3)^(y3<y4);
						else if (x3 >= 0) clipyou ^= 1;
					}
					if ((y4^y1) < 0)
					{
						if ((x4^x1) < 0) clipyou ^= (x4*y1<x1*y4)^(y4<y1);
						else if (x4 >= 0) clipyou ^= 1;
					}

					if (clipyou != 0)
					{
						*hitsect = dasector; *hitwall = -1; *hitsprite = z;
						*hitx = intx; *hity = inty; *hitz = intz;
					}
					break;
			}
		}
		tempshortcnt++;
	} while (tempshortcnt < tempshortnum);
	return(0);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x1e0, %rsp            # imm = 0x1E0
movw %cx, %ax
movl 0x48(%rbp), %ecx
movq 0x40(%rbp), %rcx
movq 0x38(%rbp), %rcx
movq 0x30(%rbp), %rcx
movq 0x28(%rbp), %rcx
movq 0x20(%rbp), %rcx
movq 0x18(%rbp), %rcx
movl 0x10(%rbp), %ecx
movl %edi, -0x28(%rbp)
movl %esi, -0x2c(%rbp)
movl %edx, -0x30(%rbp)
movw %ax, -0x32(%rbp)
movl %r8d, -0x38(%rbp)
movl %r9d, -0x3c(%rbp)
movl $0x0, -0x70(%rbp)
movl $0x0, -0x74(%rbp)
movq 0x18(%rbp), %rax
movw $0xffff, (%rax)         # imm = 0xFFFF
movq 0x20(%rbp), %rax
movw $0xffff, (%rax)         # imm = 0xFFFF
movq 0x28(%rbp), %rax
movw $0xffff, (%rax)         # imm = 0xFFFF
movswl -0x32(%rbp), %eax
cmpl $0x0, %eax
jge 0x50216
movl $0xffffffff, -0x24(%rbp) # imm = 0xFFFFFFFF
jmp 0x51ada
movl 0x90b08(%rip), %ecx     # 0xe0d24
movq 0x30(%rbp), %rax
movl %ecx, (%rax)
movl 0x90b00(%rip), %ecx     # 0xe0d28
movq 0x38(%rbp), %rax
movl %ecx, (%rax)
movl 0x48(%rbp), %eax
andl $0xffff, %eax           # imm = 0xFFFF
movl %eax, -0x100(%rbp)
movl 0x48(%rbp), %eax
shrl $0x10, %eax
movl %eax, -0x104(%rbp)
movw -0x32(%rbp), %ax
movw %ax, 0x41bb2d(%rip)     # 0x46bd80
movw $0x0, -0x106(%rbp)
movw $0x1, -0x108(%rbp)
movswq -0x106(%rbp), %rcx
leaq 0x41bb0c(%rip), %rax    # 0x46bd80
movw (%rax,%rcx,2), %ax
movw %ax, -0x10a(%rbp)
movswq -0x10a(%rbp), %rcx
leaq 0x230332(%rip), %rax    # 0x2805c0
imulq $0x28, %rcx, %rcx
addq %rcx, %rax
movq %rax, -0x48(%rbp)
movl $0x7fffffff, -0x6c(%rbp) # imm = 0x7FFFFFFF
movq -0x48(%rbp), %rax
movswl 0xc(%rax), %eax
andl $0x2, %eax
cmpl $0x0, %eax
je 0x504db
movq -0x48(%rbp), %rax
movswq (%rax), %rcx
leaq 0x1a52ed(%rip), %rax    # 0x1f55b0
shlq $0x5, %rcx
addq %rcx, %rax
movq %rax, -0x50(%rbp)
movq -0x50(%rbp), %rax
movswq 0x8(%rax), %rcx
leaq 0x1a52d2(%rip), %rax    # 0x1f55b0
shlq $0x5, %rcx
addq %rcx, %rax
movq %rax, -0x58(%rbp)
movq -0x58(%rbp), %rax
movl (%rax), %eax
movq -0x50(%rbp), %rcx
subl (%rcx), %eax
movl %eax, -0xd4(%rbp)
movq -0x58(%rbp), %rax
movl 0x4(%rax), %eax
movq -0x50(%rbp), %rcx
subl 0x4(%rcx), %eax
movl %eax, -0xd8(%rbp)
movl -0xd4(%rbp), %edi
imull -0xd4(%rbp), %edi
movl -0xd8(%rbp), %eax
imull -0xd8(%rbp), %eax
addl %eax, %edi
callq 0x37570
movl %eax, -0xb8(%rbp)
cmpl $0x0, -0xb8(%rbp)
jne 0x50344
jmp 0x51abd
movq -0x48(%rbp), %rax
movswl 0x12(%rax), %edi
movl -0xb8(%rbp), %esi
callq 0x51af0
movl %eax, -0xb8(%rbp)
movl -0xb8(%rbp), %eax
imull -0xd4(%rbp), %eax
movl %eax, -0xd4(%rbp)
movl -0xb8(%rbp), %eax
imull -0xd8(%rbp), %eax
movl %eax, -0xd8(%rbp)
movl 0x10(%rbp), %eax
shll $0x8, %eax
movl %eax, -0x118(%rbp)
movl -0xd4(%rbp), %edi
movl -0x3c(%rbp), %esi
xorl %edx, %edx
subl -0xd8(%rbp), %edx
movl -0x38(%rbp), %ecx
callq 0x51b10
movl %eax, %ecx
movl -0x118(%rbp), %eax
subl %ecx, %eax
movl %eax, -0xbc(%rbp)
cmpl $0x0, -0xbc(%rbp)
je 0x504d6
movq -0x48(%rbp), %rax
movl 0x4(%rax), %eax
subl -0x30(%rbp), %eax
shll $0x8, %eax
movl %eax, -0x11c(%rbp)
movl -0xd4(%rbp), %edi
movl -0x2c(%rbp), %esi
movq -0x50(%rbp), %rax
subl 0x4(%rax), %esi
xorl %edx, %edx
subl -0xd8(%rbp), %edx
movl -0x28(%rbp), %ecx
movq -0x50(%rbp), %rax
subl (%rax), %ecx
callq 0x51b10
movl %eax, %ecx
movl -0x11c(%rbp), %eax
addl %ecx, %eax
movl %eax, -0xb8(%rbp)
movl -0xb8(%rbp), %eax
xorl -0xbc(%rbp), %eax
cmpl $0x0, %eax
jl 0x504d4
movl -0xb8(%rbp), %edi
callq 0x37610
sarl %eax
movl %eax, -0x120(%rbp)
movl -0xbc(%rbp), %edi
callq 0x37610
movl %eax, %ecx
movl -0x120(%rbp), %eax
cmpl %ecx, %eax
jge 0x504d4
movl -0xb8(%rbp), %edi
movl -0xbc(%rbp), %esi
callq 0x376e0
movl %eax, -0xb8(%rbp)
movl -0x28(%rbp), %eax
movl %eax, -0x12c(%rbp)
movl -0x38(%rbp), %edi
movl -0xb8(%rbp), %esi
callq 0x37700
movl %eax, %ecx
movl -0x12c(%rbp), %eax
addl %ecx, %eax
movl %eax, -0x6c(%rbp)
movl -0x2c(%rbp), %eax
movl %eax, -0x128(%rbp)
movl -0x3c(%rbp), %edi
movl -0xb8(%rbp), %esi
callq 0x37700
movl %eax, %ecx
movl -0x128(%rbp), %eax
addl %ecx, %eax
movl %eax, -0x70(%rbp)
movl -0x30(%rbp), %eax
movl %eax, -0x124(%rbp)
movl 0x10(%rbp), %edi
movl -0xb8(%rbp), %esi
callq 0x37700
movl %eax, %ecx
movl -0x124(%rbp), %eax
addl %ecx, %eax
movl %eax, -0x74(%rbp)
jmp 0x504d6
jmp 0x50581
cmpl $0x0, 0x10(%rbp)
jge 0x5057f
movl -0x30(%rbp), %eax
movq -0x48(%rbp), %rcx
cmpl 0x4(%rcx), %eax
jl 0x5057f
movq -0x48(%rbp), %rax
movl 0x4(%rax), %eax
movl %eax, -0x74(%rbp)
movl -0x74(%rbp), %eax
subl -0x30(%rbp), %eax
movl %eax, -0xb8(%rbp)
movl -0xb8(%rbp), %edi
callq 0x37610
sarl %eax
xorl %ecx, %ecx
subl 0x10(%rbp), %ecx
cmpl %ecx, %eax
jge 0x5057d
movl -0xb8(%rbp), %edi
movl 0x10(%rbp), %esi
callq 0x376e0
movl %eax, -0xb8(%rbp)
movl -0x28(%rbp), %eax
movl %eax, -0x134(%rbp)
movl -0x38(%rbp), %edi
movl -0xb8(%rbp), %esi
callq 0x37700
movl %eax, %ecx
movl -0x134(%rbp), %eax
addl %ecx, %eax
movl %eax, -0x6c(%rbp)
movl -0x2c(%rbp), %eax
movl %eax, -0x130(%rbp)
movl -0x3c(%rbp), %edi
movl -0xb8(%rbp), %esi
callq 0x37700
movl %eax, %ecx
movl -0x130(%rbp), %eax
addl %ecx, %eax
movl %eax, -0x70(%rbp)
jmp 0x5057f
jmp 0x50581
cmpl $0x7fffffff, -0x6c(%rbp) # imm = 0x7FFFFFFF
je 0x50644
movl -0x6c(%rbp), %edi
subl -0x28(%rbp), %edi
callq 0x37610
movl %eax, -0x140(%rbp)
movl -0x70(%rbp), %edi
subl -0x2c(%rbp), %edi
callq 0x37610
movl %eax, %ecx
movl -0x140(%rbp), %eax
addl %ecx, %eax
movl %eax, -0x138(%rbp)
movq 0x30(%rbp), %rax
movl (%rax), %edi
subl -0x28(%rbp), %edi
callq 0x37610
movl %eax, -0x13c(%rbp)
movq 0x38(%rbp), %rax
movl (%rax), %edi
subl -0x2c(%rbp), %edi
callq 0x37610
movl -0x13c(%rbp), %ecx
movl %eax, %edx
movl -0x138(%rbp), %eax
addl %edx, %ecx
cmpl %ecx, %eax
jge 0x50644
movl -0x6c(%rbp), %edi
movl -0x70(%rbp), %esi
movswl -0x10a(%rbp), %edx
callq 0x4ee70
cmpl $0x0, %eax
je 0x50642
movw -0x10a(%rbp), %cx
movq 0x18(%rbp), %rax
movw %cx, (%rax)
movq 0x20(%rbp), %rax
movw $0xffff, (%rax)         # imm = 0xFFFF
movq 0x28(%rbp), %rax
movw $0xffff, (%rax)         # imm = 0xFFFF
movl -0x6c(%rbp), %ecx
movq 0x30(%rbp), %rax
movl %ecx, (%rax)
movl -0x70(%rbp), %ecx
movq 0x38(%rbp), %rax
movl %ecx, (%rax)
movl -0x74(%rbp), %ecx
movq 0x40(%rbp), %rax
movl %ecx, (%rax)
jmp 0x50644
movl $0x7fffffff, -0x6c(%rbp) # imm = 0x7FFFFFFF
movq -0x48(%rbp), %rax
movswl 0xe(%rax), %eax
andl $0x2, %eax
cmpl $0x0, %eax
je 0x50886
movq -0x48(%rbp), %rax
movswq (%rax), %rcx
leaq 0x1a4f42(%rip), %rax    # 0x1f55b0
shlq $0x5, %rcx
addq %rcx, %rax
movq %rax, -0x50(%rbp)
movq -0x50(%rbp), %rax
movswq 0x8(%rax), %rcx
leaq 0x1a4f27(%rip), %rax    # 0x1f55b0
shlq $0x5, %rcx
addq %rcx, %rax
movq %rax, -0x58(%rbp)
movq -0x58(%rbp), %rax
movl (%rax), %eax
movq -0x50(%rbp), %rcx
subl (%rcx), %eax
movl %eax, -0xd4(%rbp)
movq -0x58(%rbp), %rax
movl 0x4(%rax), %eax
movq -0x50(%rbp), %rcx
subl 0x4(%rcx), %eax
movl %eax, -0xd8(%rbp)
movl -0xd4(%rbp), %edi
imull -0xd4(%rbp), %edi
movl -0xd8(%rbp), %eax
imull -0xd8(%rbp), %eax
addl %eax, %edi
callq 0x37570
movl %eax, -0xb8(%rbp)
cmpl $0x0, -0xb8(%rbp)
jne 0x506ef
jmp 0x51abd
movq -0x48(%rbp), %rax
movswl 0x1a(%rax), %edi
movl -0xb8(%rbp), %esi
callq 0x51af0
movl %eax, -0xb8(%rbp)
movl -0xb8(%rbp), %eax
imull -0xd4(%rbp), %eax
movl %eax, -0xd4(%rbp)
movl -0xb8(%rbp), %eax
imull -0xd8(%rbp), %eax
movl %eax, -0xd8(%rbp)
movl 0x10(%rbp), %eax
shll $0x8, %eax
movl %eax, -0x144(%rbp)
movl -0xd4(%rbp), %edi
movl -0x3c(%rbp), %esi
xorl %edx, %edx
subl -0xd8(%rbp), %edx
movl -0x38(%rbp), %ecx
callq 0x51b10
movl %eax, %ecx
movl -0x144(%rbp), %eax
subl %ecx, %eax
movl %eax, -0xbc(%rbp)
cmpl $0x0, -0xbc(%rbp)
je 0x50881
movq -0x48(%rbp), %rax
movl 0x8(%rax), %eax
subl -0x30(%rbp), %eax
shll $0x8, %eax
movl %eax, -0x148(%rbp)
movl -0xd4(%rbp), %edi
movl -0x2c(%rbp), %esi
movq -0x50(%rbp), %rax
subl 0x4(%rax), %esi
xorl %edx, %edx
subl -0xd8(%rbp), %edx
movl -0x28(%rbp), %ecx
movq -0x50(%rbp), %rax
subl (%rax), %ecx
callq 0x51b10
movl %eax, %ecx
movl -0x148(%rbp), %eax
addl %ecx, %eax
movl %eax, -0xb8(%rbp)
movl -0xb8(%rbp), %eax
xorl -0xbc(%rbp), %eax
cmpl $0x0, %eax
jl 0x5087f
movl -0xb8(%rbp), %edi
callq 0x37610
sarl %eax
movl %eax, -0x14c(%rbp)
movl -0xbc(%rbp), %edi
callq 0x37610
movl %eax, %ecx
movl -0x14c(%rbp), %eax
cmpl %ecx, %eax
jge 0x5087f
movl -0xb8(%rbp), %edi
movl -0xbc(%rbp), %esi
callq 0x376e0
movl %eax, -0xb8(%rbp)
movl -0x28(%rbp), %eax
movl %eax, -0x158(%rbp)
movl -0x38(%rbp), %edi
movl -0xb8(%rbp), %esi
callq 0x37700
movl %eax, %ecx
movl -0x158(%rbp), %eax
addl %ecx, %eax
movl %eax, -0x6c(%rbp)
movl -0x2c(%rbp), %eax
movl %eax, -0x154(%rbp)
movl -0x3c(%rbp), %edi
movl -0xb8(%rbp), %esi
callq 0x37700
movl %eax, %ecx
movl -0x154(%rbp), %eax
addl %ecx, %eax
movl %eax, -0x70(%rbp)
movl -0x30(%rbp), %eax
movl %eax, -0x150(%rbp)
movl 0x10(%rbp), %edi
movl -0xb8(%rbp), %esi
callq 0x37700
movl %eax, %ecx
movl -0x150(%rbp), %eax
addl %ecx, %eax
movl %eax, -0x74(%rbp)
jmp 0x50881
jmp 0x50928
cmpl $0x0, 0x10(%rbp)
jle 0x50926
movl -0x30(%rbp), %eax
movq -0x48(%rbp), %rcx
cmpl 0x8(%rcx), %eax
jg 0x50926
movq -0x48(%rbp), %rax
movl 0x8(%rax), %eax
movl %eax, -0x74(%rbp)
movl -0x74(%rbp), %eax
subl -0x30(%rbp), %eax
movl %eax, -0xb8(%rbp)
movl -0xb8(%rbp), %edi
callq 0x37610
sarl %eax
cmpl 0x10(%rbp), %eax
jge 0x50924
movl -0xb8(%rbp), %edi
movl 0x10(%rbp), %esi
callq 0x376e0
movl %eax, -0xb8(%rbp)
movl -0x28(%rbp), %eax
movl %eax, -0x160(%rbp)
movl -0x38(%rbp), %edi
movl -0xb8(%rbp), %esi
callq 0x37700
movl %eax, %ecx
movl -0x160(%rbp), %eax
addl %ecx, %eax
movl %eax, -0x6c(%rbp)
movl -0x2c(%rbp), %eax
movl %eax, -0x15c(%rbp)
movl -0x3c(%rbp), %edi
movl -0xb8(%rbp), %esi
callq 0x37700
movl %eax, %ecx
movl -0x15c(%rbp), %eax
addl %ecx, %eax
movl %eax, -0x70(%rbp)
jmp 0x50926
jmp 0x50928
cmpl $0x7fffffff, -0x6c(%rbp) # imm = 0x7FFFFFFF
je 0x509eb
movl -0x6c(%rbp), %edi
subl -0x28(%rbp), %edi
callq 0x37610
movl %eax, -0x16c(%rbp)
movl -0x70(%rbp), %edi
subl -0x2c(%rbp), %edi
callq 0x37610
movl %eax, %ecx
movl -0x16c(%rbp), %eax
addl %ecx, %eax
movl %eax, -0x164(%rbp)
movq 0x30(%rbp), %rax
movl (%rax), %edi
subl -0x28(%rbp), %edi
callq 0x37610
movl %eax, -0x168(%rbp)
movq 0x38(%rbp), %rax
movl (%rax), %edi
subl -0x2c(%rbp), %edi
callq 0x37610
movl -0x168(%rbp), %ecx
movl %eax, %edx
movl -0x164(%rbp), %eax
addl %edx, %ecx
cmpl %ecx, %eax
jge 0x509eb
movl -0x6c(%rbp), %edi
movl -0x70(%rbp), %esi
movswl -0x10a(%rbp), %edx
callq 0x4ee70
cmpl $0x0, %eax
je 0x509e9
movw -0x10a(%rbp), %cx
movq 0x18(%rbp), %rax
movw %cx, (%rax)
movq 0x20(%rbp), %rax
movw $0xffff, (%rax)         # imm = 0xFFFF
movq 0x28(%rbp), %rax
movw $0xffff, (%rax)         # imm = 0xFFFF
movl -0x6c(%rbp), %ecx
movq 0x30(%rbp), %rax
movl %ecx, (%rax)
movl -0x70(%rbp), %ecx
movq 0x38(%rbp), %rax
movl %ecx, (%rax)
movl -0x74(%rbp), %ecx
movq 0x40(%rbp), %rax
movl %ecx, (%rax)
jmp 0x509eb
movq -0x48(%rbp), %rax
movw (%rax), %ax
movw %ax, -0x10c(%rbp)
movswl -0x10c(%rbp), %eax
movq -0x48(%rbp), %rcx
movswl 0x2(%rcx), %ecx
addl %ecx, %eax
movw %ax, -0x10e(%rbp)
movswl -0x10c(%rbp), %eax
movl %eax, -0x64(%rbp)
movswq -0x10c(%rbp), %rcx
leaq 0x1a4b86(%rip), %rax    # 0x1f55b0
shlq $0x5, %rcx
addq %rcx, %rax
movq %rax, -0x50(%rbp)
movl -0x64(%rbp), %eax
movswl -0x10e(%rbp), %ecx
cmpl %ecx, %eax
jge 0x50d17
movq -0x50(%rbp), %rax
movswq 0x8(%rax), %rcx
leaq 0x1a4b59(%rip), %rax    # 0x1f55b0
shlq $0x5, %rcx
addq %rcx, %rax
movq %rax, -0x58(%rbp)
movq -0x50(%rbp), %rax
movl (%rax), %eax
movl %eax, -0x6c(%rbp)
movq -0x50(%rbp), %rax
movl 0x4(%rax), %eax
movl %eax, -0x70(%rbp)
movq -0x58(%rbp), %rax
movl (%rax), %eax
movl %eax, -0x78(%rbp)
movq -0x58(%rbp), %rax
movl 0x4(%rax), %eax
movl %eax, -0x7c(%rbp)
movl -0x6c(%rbp), %eax
subl -0x28(%rbp), %eax
movl -0x7c(%rbp), %ecx
subl -0x2c(%rbp), %ecx
imull %ecx, %eax
movl -0x78(%rbp), %ecx
subl -0x28(%rbp), %ecx
movl -0x70(%rbp), %edx
subl -0x2c(%rbp), %edx
imull %edx, %ecx
cmpl %ecx, %eax
jge 0x50aaf
jmp 0x50cfd
movl -0x28(%rbp), %edi
movl -0x2c(%rbp), %esi
movl -0x30(%rbp), %edx
movl -0x38(%rbp), %ecx
movl -0x3c(%rbp), %r8d
movl 0x10(%rbp), %r9d
movl -0x6c(%rbp), %r12d
movl -0x70(%rbp), %r15d
movl -0x78(%rbp), %r14d
movl -0x7c(%rbp), %ebx
leaq -0x90(%rbp), %r11
leaq -0x94(%rbp), %r10
leaq -0x98(%rbp), %rax
movl %r12d, (%rsp)
movl %r15d, 0x8(%rsp)
movl %r14d, 0x10(%rsp)
movl %ebx, 0x18(%rsp)
movq %r11, 0x20(%rsp)
movq %r10, 0x28(%rsp)
movq %rax, 0x30(%rsp)
callq 0x51b50
cmpl $0x0, %eax
jne 0x50b17
jmp 0x50cfd
movl -0x90(%rbp), %edi
subl -0x28(%rbp), %edi
callq 0x37610
movl %eax, -0x178(%rbp)
movl -0x94(%rbp), %edi
subl -0x2c(%rbp), %edi
callq 0x37610
movl %eax, %ecx
movl -0x178(%rbp), %eax
addl %ecx, %eax
movl %eax, -0x170(%rbp)
movq 0x30(%rbp), %rax
movl (%rax), %edi
subl -0x28(%rbp), %edi
callq 0x37610
movl %eax, -0x174(%rbp)
movq 0x38(%rbp), %rax
movl (%rax), %edi
subl -0x2c(%rbp), %edi
callq 0x37610
movl -0x174(%rbp), %ecx
movl %eax, %edx
movl -0x170(%rbp), %eax
addl %edx, %ecx
cmpl %ecx, %eax
jl 0x50b84
jmp 0x50cfd
movq -0x50(%rbp), %rax
movw 0xc(%rax), %ax
movw %ax, -0x110(%rbp)
movswl -0x110(%rbp), %eax
cmpl $0x0, %eax
jl 0x50bb2
movq -0x50(%rbp), %rax
movswl 0xe(%rax), %eax
andl -0x100(%rbp), %eax
cmpl $0x0, %eax
je 0x50bff
movw -0x10a(%rbp), %cx
movq 0x18(%rbp), %rax
movw %cx, (%rax)
movl -0x64(%rbp), %eax
movw %ax, %cx
movq 0x20(%rbp), %rax
movw %cx, (%rax)
movq 0x28(%rbp), %rax
movw $0xffff, (%rax)         # imm = 0xFFFF
movl -0x90(%rbp), %ecx
movq 0x30(%rbp), %rax
movl %ecx, (%rax)
movl -0x94(%rbp), %ecx
movq 0x38(%rbp), %rax
movl %ecx, (%rax)
movl -0x98(%rbp), %ecx
movq 0x40(%rbp), %rax
movl %ecx, (%rax)
jmp 0x50cfd
movw -0x110(%rbp), %ax
movl -0x90(%rbp), %esi
movl -0x94(%rbp), %edx
leaq -0xdc(%rbp), %rcx
leaq -0xe0(%rbp), %r8
movswl %ax, %edi
callq 0x393f0
movl -0x98(%rbp), %eax
cmpl -0xdc(%rbp), %eax
jle 0x50c44
movl -0x98(%rbp), %eax
cmpl -0xe0(%rbp), %eax
jl 0x50c8e
movw -0x10a(%rbp), %cx
movq 0x18(%rbp), %rax
movw %cx, (%rax)
movl -0x64(%rbp), %eax
movw %ax, %cx
movq 0x20(%rbp), %rax
movw %cx, (%rax)
movq 0x28(%rbp), %rax
movw $0xffff, (%rax)         # imm = 0xFFFF
movl -0x90(%rbp), %ecx
movq 0x30(%rbp), %rax
movl %ecx, (%rax)
movl -0x94(%rbp), %ecx
movq 0x38(%rbp), %rax
movl %ecx, (%rax)
movl -0x98(%rbp), %ecx
movq 0x40(%rbp), %rax
movl %ecx, (%rax)
jmp 0x50cfd
movswl -0x108(%rbp), %eax
subl $0x1, %eax
movl %eax, -0x68(%rbp)
cmpl $0x0, -0x68(%rbp)
jl 0x50cca
movslq -0x68(%rbp), %rcx
leaq 0x41b0d4(%rip), %rax    # 0x46bd80
movswl (%rax,%rcx,2), %eax
movswl -0x110(%rbp), %ecx
cmpl %ecx, %eax
jne 0x50cbd
jmp 0x50cca
jmp 0x50cbf
movl -0x68(%rbp), %eax
addl $-0x1, %eax
movl %eax, -0x68(%rbp)
jmp 0x50c9b
cmpl $0x0, -0x68(%rbp)
jge 0x50cfb
movw -0x110(%rbp), %dx
movw -0x108(%rbp), %ax
movw %ax, %cx
addw $0x1, %cx
movw %cx, -0x108(%rbp)
movswq %ax, %rcx
leaq 0x41b089(%rip), %rax    # 0x46bd80
movw %dx, (%rax,%rcx,2)
jmp 0x50cfd
movl -0x64(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x64(%rbp)
movq -0x50(%rbp), %rax
addq $0x20, %rax
movq %rax, -0x50(%rbp)
jmp 0x50a35
movswq -0x10a(%rbp), %rcx
leaq 0x39834a(%rip), %rax    # 0x3e9070
movswl (%rax,%rcx,2), %eax
movl %eax, -0x64(%rbp)
cmpl $0x0, -0x64(%rbp)
jl 0x51aab
movslq -0x64(%rbp), %rcx
leaq 0x268ace(%rip), %rax    # 0x2b9810
imulq $0x2c, %rcx, %rcx
addq %rcx, %rax
movq %rax, -0x60(%rbp)
movq -0x60(%rbp), %rax
movswl 0xc(%rax), %eax
movl %eax, -0xb4(%rbp)
cmpl $0x0, 0x1a4836(%rip)    # 0x1f5598
jne 0x50d7c
movl -0xb4(%rbp), %eax
andl -0x104(%rbp), %eax
cmpl $0x0, %eax
jne 0x50d7a
jmp 0x51a94
jmp 0x50d7c
movq -0x60(%rbp), %rax
movl (%rax), %eax
movl %eax, -0x6c(%rbp)
movq -0x60(%rbp), %rax
movl 0x4(%rax), %eax
movl %eax, -0x70(%rbp)
movq -0x60(%rbp), %rax
movl 0x8(%rax), %eax
movl %eax, -0x74(%rbp)
movl -0xb4(%rbp), %eax
andl $0x30, %eax
movl %eax, -0x17c(%rbp)
je 0x50dd1
jmp 0x50dac
movl -0x17c(%rbp), %eax
subl $0x10, %eax
je 0x510e4
jmp 0x50dbd
movl -0x17c(%rbp), %eax
subl $0x20, %eax
je 0x51489
jmp 0x51a92
movl -0x38(%rbp), %eax
movl -0x6c(%rbp), %ecx
subl -0x28(%rbp), %ecx
imull %ecx, %eax
movl -0x3c(%rbp), %ecx
movl -0x70(%rbp), %edx
subl -0x2c(%rbp), %edx
imull %edx, %ecx
addl %ecx, %eax
movl %eax, -0x9c(%rbp)
cmpl $0x0, -0x9c(%rbp)
jg 0x50dff
jmp 0x51a94
movl -0x38(%rbp), %eax
imull -0x38(%rbp), %eax
movl -0x3c(%rbp), %ecx
imull -0x3c(%rbp), %ecx
addl %ecx, %eax
movl %eax, -0xa4(%rbp)
cmpl $0x0, -0xa4(%rbp)
jne 0x50e23
jmp 0x51a94
movl -0x30(%rbp), %eax
movl %eax, -0x180(%rbp)
movl 0x10(%rbp), %edi
movl -0x9c(%rbp), %esi
movl -0xa4(%rbp), %edx
callq 0x37720
movl %eax, %ecx
movl -0x180(%rbp), %eax
addl %ecx, %eax
movl %eax, -0x98(%rbp)
movq -0x60(%rbp), %rax
movswq 0xe(%rax), %rcx
leaq 0x3eb6e0(%rip), %rax    # 0x43c540
movswl (%rax,%rcx,2), %eax
movq -0x60(%rbp), %rcx
movzbl 0x15(%rcx), %ecx
imull %ecx, %eax
shll $0x2, %eax
movl %eax, -0xb8(%rbp)
movl -0xb4(%rbp), %eax
andl $0x80, %eax
cmpl $0x0, %eax
je 0x50e96
movl -0xb8(%rbp), %eax
sarl %eax
addl -0x74(%rbp), %eax
movl %eax, -0x74(%rbp)
movq -0x60(%rbp), %rax
movswq 0xe(%rax), %rcx
leaq 0x22671a(%rip), %rax    # 0x2775c0
movl (%rax,%rcx,4), %eax
andl $0xff0000, %eax         # imm = 0xFF0000
cmpl $0x0, %eax
je 0x50ee7
movq -0x60(%rbp), %rax
movswq 0xe(%rax), %rcx
leaq 0x2266fd(%rip), %rax    # 0x2775c0
movl (%rax,%rcx,4), %eax
sarl $0x10, %eax
andl $0xff, %eax
movsbl %al, %ecx
movq -0x60(%rbp), %rax
movzbl 0x15(%rax), %eax
imull %eax, %ecx
shll $0x2, %ecx
movl -0x74(%rbp), %eax
subl %ecx, %eax
movl %eax, -0x74(%rbp)
movl -0x98(%rbp), %eax
cmpl -0x74(%rbp), %eax
jg 0x50f05
movl -0x98(%rbp), %eax
movl -0x74(%rbp), %ecx
subl -0xb8(%rbp), %ecx
cmpl %ecx, %eax
jge 0x50f0a
jmp 0x51a94
movl -0x38(%rbp), %eax
movl -0x70(%rbp), %ecx
subl -0x2c(%rbp), %ecx
imull %ecx, %eax
movl -0x3c(%rbp), %ecx
movl -0x6c(%rbp), %edx
subl -0x28(%rbp), %edx
imull %edx, %ecx
subl %ecx, %eax
movl %eax, -0xa0(%rbp)
movl -0x38(%rbp), %edi
movl -0xa0(%rbp), %esi
movl -0xa4(%rbp), %edx
callq 0x37720
movl %eax, -0xac(%rbp)
movl -0x3c(%rbp), %edi
movl -0xa0(%rbp), %esi
movl -0xa4(%rbp), %edx
callq 0x37720
movl %eax, -0xb0(%rbp)
movl -0xac(%rbp), %eax
imull -0xac(%rbp), %eax
movl -0xb0(%rbp), %ecx
imull -0xb0(%rbp), %ecx
addl %ecx, %eax
movl %eax, -0xa8(%rbp)
movq -0x60(%rbp), %rax
movswq 0xe(%rax), %rcx
leaq 0x3f9df0(%rip), %rax    # 0x44ad80
movswl (%rax,%rcx,2), %eax
movq -0x60(%rbp), %rcx
movzbl 0x14(%rcx), %ecx
imull %ecx, %eax
movl %eax, -0xb8(%rbp)
movl -0xb8(%rbp), %eax
imull -0xb8(%rbp), %eax
movl %eax, -0xb8(%rbp)
movl -0xa8(%rbp), %eax
movl -0xb8(%rbp), %ecx
sarl $0x7, %ecx
cmpl %ecx, %eax
jle 0x50fd0
jmp 0x51a94
movl -0x28(%rbp), %eax
movl %eax, -0x194(%rbp)
movl -0x38(%rbp), %edi
movl -0x9c(%rbp), %esi
movl -0xa4(%rbp), %edx
callq 0x37720
movl %eax, %ecx
movl -0x194(%rbp), %eax
addl %ecx, %eax
movl %eax, -0x90(%rbp)
movl -0x2c(%rbp), %eax
movl %eax, -0x190(%rbp)
movl -0x3c(%rbp), %edi
movl -0x9c(%rbp), %esi
movl -0xa4(%rbp), %edx
callq 0x37720
movl %eax, %ecx
movl -0x190(%rbp), %eax
addl %ecx, %eax
movl %eax, -0x94(%rbp)
movl -0x90(%rbp), %edi
subl -0x28(%rbp), %edi
callq 0x37610
movl %eax, -0x18c(%rbp)
movl -0x94(%rbp), %edi
subl -0x2c(%rbp), %edi
callq 0x37610
movl %eax, %ecx
movl -0x18c(%rbp), %eax
addl %ecx, %eax
movl %eax, -0x184(%rbp)
movq 0x30(%rbp), %rax
movl (%rax), %edi
subl -0x28(%rbp), %edi
callq 0x37610
movl %eax, -0x188(%rbp)
movq 0x38(%rbp), %rax
movl (%rax), %edi
subl -0x2c(%rbp), %edi
callq 0x37610
movl -0x188(%rbp), %ecx
movl %eax, %edx
movl -0x184(%rbp), %eax
addl %edx, %ecx
cmpl %ecx, %eax
jle 0x51097
jmp 0x51a94
movw -0x10a(%rbp), %cx
movq 0x18(%rbp), %rax
movw %cx, (%rax)
movq 0x20(%rbp), %rax
movw $0xffff, (%rax)         # imm = 0xFFFF
movl -0x64(%rbp), %eax
movw %ax, %cx
movq 0x28(%rbp), %rax
movw %cx, (%rax)
movl -0x90(%rbp), %ecx
movq 0x30(%rbp), %rax
movl %ecx, (%rax)
movl -0x94(%rbp), %ecx
movq 0x38(%rbp), %rax
movl %ecx, (%rax)
movl -0x98(%rbp), %ecx
movq 0x40(%rbp), %rax
movl %ecx, (%rax)
jmp 0x51a92
movq -0x60(%rbp), %rax
movswl 0xe(%rax), %eax
movl %eax, -0xc8(%rbp)
movslq -0xc8(%rbp), %rcx
leaq 0x2264c0(%rip), %rax    # 0x2775c0
movl (%rax,%rcx,4), %eax
sarl $0x8, %eax
andl $0xff, %eax
movsbl %al, %eax
movq -0x60(%rbp), %rcx
movsbl 0x16(%rcx), %ecx
addl %ecx, %eax
movl %eax, -0xcc(%rbp)
movl -0xb4(%rbp), %eax
andl $0x4, %eax
cmpl $0x0, %eax
jle 0x5113a
xorl %eax, %eax
subl -0xcc(%rbp), %eax
movl %eax, -0xcc(%rbp)
movq -0x60(%rbp), %rax
movswl 0x1c(%rax), %eax
movl %eax, -0xc0(%rbp)
movq -0x60(%rbp), %rax
movzbl 0x14(%rax), %eax
movl %eax, -0xc4(%rbp)
movl -0xc0(%rbp), %eax
andl $0x7ff, %eax            # imm = 0x7FF
movslq %eax, %rcx
leaq 0x3ba745(%rip), %rax    # 0x40b8b0
movswl (%rax,%rcx,2), %eax
imull -0xc4(%rbp), %eax
movl %eax, -0xd4(%rbp)
movl -0xc0(%rbp), %eax
addl $0x600, %eax            # imm = 0x600
andl $0x7ff, %eax            # imm = 0x7FF
movslq %eax, %rcx
leaq 0x3ba71a(%rip), %rax    # 0x40b8b0
movswl (%rax,%rcx,2), %eax
imull -0xc4(%rbp), %eax
movl %eax, -0xd8(%rbp)
movslq -0xc8(%rbp), %rcx
leaq 0x3f9bcb(%rip), %rax    # 0x44ad80
movswl (%rax,%rcx,2), %eax
movl %eax, -0xc4(%rbp)
movl -0xc4(%rbp), %eax
sarl %eax
addl -0xcc(%rbp), %eax
movl %eax, -0xc0(%rbp)
movl -0xd4(%rbp), %edi
movl -0xc0(%rbp), %esi
callq 0x39010
movl %eax, %ecx
movl -0x6c(%rbp), %eax
subl %ecx, %eax
movl %eax, -0x6c(%rbp)
movl -0x6c(%rbp), %eax
movl %eax, -0x19c(%rbp)
movl -0xd4(%rbp), %edi
movl -0xc4(%rbp), %esi
callq 0x39010
movl %eax, %ecx
movl -0x19c(%rbp), %eax
addl %ecx, %eax
movl %eax, -0x78(%rbp)
movl -0xd8(%rbp), %edi
movl -0xc0(%rbp), %esi
callq 0x39010
movl %eax, %ecx
movl -0x70(%rbp), %eax
subl %ecx, %eax
movl %eax, -0x70(%rbp)
movl -0x70(%rbp), %eax
movl %eax, -0x198(%rbp)
movl -0xd8(%rbp), %edi
movl -0xc4(%rbp), %esi
callq 0x39010
movl %eax, %ecx
movl -0x198(%rbp), %eax
addl %ecx, %eax
movl %eax, -0x7c(%rbp)
movl -0xb4(%rbp), %eax
andl $0x40, %eax
cmpl $0x0, %eax
je 0x5128e
movl -0x6c(%rbp), %eax
subl -0x28(%rbp), %eax
movl -0x7c(%rbp), %ecx
subl -0x2c(%rbp), %ecx
imull %ecx, %eax
movl -0x78(%rbp), %ecx
subl -0x28(%rbp), %ecx
movl -0x70(%rbp), %edx
subl -0x2c(%rbp), %edx
imull %edx, %ecx
cmpl %ecx, %eax
jge 0x5128c
jmp 0x51a94
jmp 0x5128e
movl -0x28(%rbp), %edi
movl -0x2c(%rbp), %esi
movl -0x30(%rbp), %edx
movl -0x38(%rbp), %ecx
movl -0x3c(%rbp), %r8d
movl 0x10(%rbp), %r9d
movl -0x6c(%rbp), %r12d
movl -0x70(%rbp), %r15d
movl -0x78(%rbp), %r14d
movl -0x7c(%rbp), %ebx
leaq -0x90(%rbp), %r11
leaq -0x94(%rbp), %r10
leaq -0x98(%rbp), %rax
movl %r12d, (%rsp)
movl %r15d, 0x8(%rsp)
movl %r14d, 0x10(%rsp)
movl %ebx, 0x18(%rsp)
movq %r11, 0x20(%rsp)
movq %r10, 0x28(%rsp)
movq %rax, 0x30(%rsp)
callq 0x51b50
cmpl $0x0, %eax
jne 0x512f6
jmp 0x51a94
movl -0x90(%rbp), %edi
subl -0x28(%rbp), %edi
callq 0x37610
movl %eax, -0x1a8(%rbp)
movl -0x94(%rbp), %edi
subl -0x2c(%rbp), %edi
callq 0x37610
movl %eax, %ecx
movl -0x1a8(%rbp), %eax
addl %ecx, %eax
movl %eax, -0x1a0(%rbp)
movq 0x30(%rbp), %rax
movl (%rax), %edi
subl -0x28(%rbp), %edi
callq 0x37610
movl %eax, -0x1a4(%rbp)
movq 0x38(%rbp), %rax
movl (%rax), %edi
subl -0x2c(%rbp), %edi
callq 0x37610
movl -0x1a4(%rbp), %ecx
movl %eax, %edx
movl -0x1a0(%rbp), %eax
addl %edx, %ecx
cmpl %ecx, %eax
jle 0x51363
jmp 0x51a94
movq -0x60(%rbp), %rax
movswq 0xe(%rax), %rcx
leaq 0x3eb1cd(%rip), %rax    # 0x43c540
movswl (%rax,%rcx,2), %eax
movq -0x60(%rbp), %rcx
movzbl 0x15(%rcx), %ecx
imull %ecx, %eax
shll $0x2, %eax
movl %eax, -0xc0(%rbp)
movl -0xb4(%rbp), %eax
andl $0x80, %eax
cmpl $0x0, %eax
je 0x513b4
movq -0x60(%rbp), %rax
movl 0x8(%rax), %eax
movl -0xc0(%rbp), %ecx
sarl %ecx
addl %ecx, %eax
movl %eax, -0xdc(%rbp)
jmp 0x513c1
movq -0x60(%rbp), %rax
movl 0x8(%rax), %eax
movl %eax, -0xdc(%rbp)
movq -0x60(%rbp), %rax
movswq 0xe(%rax), %rcx
leaq 0x2261ef(%rip), %rax    # 0x2775c0
movl (%rax,%rcx,4), %eax
andl $0xff0000, %eax         # imm = 0xFF0000
cmpl $0x0, %eax
je 0x51418
movq -0x60(%rbp), %rax
movswq 0xe(%rax), %rcx
leaq 0x2261d2(%rip), %rax    # 0x2775c0
movl (%rax,%rcx,4), %eax
sarl $0x10, %eax
andl $0xff, %eax
movsbl %al, %ecx
movq -0x60(%rbp), %rax
movzbl 0x15(%rax), %eax
imull %eax, %ecx
shll $0x2, %ecx
movl -0xdc(%rbp), %eax
subl %ecx, %eax
movl %eax, -0xdc(%rbp)
movl -0x98(%rbp), %eax
cmpl -0xdc(%rbp), %eax
jge 0x51484
movl -0x98(%rbp), %eax
movl -0xdc(%rbp), %ecx
subl -0xc0(%rbp), %ecx
cmpl %ecx, %eax
jle 0x51484
movw -0x10a(%rbp), %cx
movq 0x18(%rbp), %rax
movw %cx, (%rax)
movq 0x20(%rbp), %rax
movw $0xffff, (%rax)         # imm = 0xFFFF
movl -0x64(%rbp), %eax
movw %ax, %cx
movq 0x28(%rbp), %rax
movw %cx, (%rax)
movl -0x90(%rbp), %ecx
movq 0x30(%rbp), %rax
movl %ecx, (%rax)
movl -0x94(%rbp), %ecx
movq 0x38(%rbp), %rax
movl %ecx, (%rax)
movl -0x98(%rbp), %ecx
movq 0x40(%rbp), %rax
movl %ecx, (%rax)
jmp 0x51a92
cmpl $0x0, 0x10(%rbp)
jne 0x51494
jmp 0x51a94
movl -0x74(%rbp), %eax
movl %eax, -0x98(%rbp)
movl -0x98(%rbp), %eax
subl -0x30(%rbp), %eax
xorl 0x10(%rbp), %eax
cmpl $0x0, %eax
jge 0x514b3
jmp 0x51a94
movl -0xb4(%rbp), %eax
andl $0x40, %eax
cmpl $0x0, %eax
je 0x514f2
movl -0x30(%rbp), %eax
cmpl -0x98(%rbp), %eax
setg %al
andb $0x1, %al
movzbl %al, %eax
movl -0xb4(%rbp), %ecx
andl $0x8, %ecx
cmpl $0x0, %ecx
sete %cl
andb $0x1, %cl
movzbl %cl, %ecx
cmpl %ecx, %eax
jne 0x514f0
jmp 0x51a94
jmp 0x514f2
movl -0x28(%rbp), %eax
movl %eax, -0x1bc(%rbp)
movl -0x98(%rbp), %edi
subl -0x30(%rbp), %edi
movl -0x38(%rbp), %esi
movl 0x10(%rbp), %edx
callq 0x37720
movl %eax, %ecx
movl -0x1bc(%rbp), %eax
addl %ecx, %eax
movl %eax, -0x90(%rbp)
movl -0x2c(%rbp), %eax
movl %eax, -0x1b8(%rbp)
movl -0x98(%rbp), %edi
subl -0x30(%rbp), %edi
movl -0x3c(%rbp), %esi
movl 0x10(%rbp), %edx
callq 0x37720
movl %eax, %ecx
movl -0x1b8(%rbp), %eax
addl %ecx, %eax
movl %eax, -0x94(%rbp)
movl -0x90(%rbp), %edi
subl -0x28(%rbp), %edi
callq 0x37610
movl %eax, -0x1b4(%rbp)
movl -0x94(%rbp), %edi
subl -0x2c(%rbp), %edi
callq 0x37610
movl %eax, %ecx
movl -0x1b4(%rbp), %eax
addl %ecx, %eax
movl %eax, -0x1ac(%rbp)
movq 0x30(%rbp), %rax
movl (%rax), %edi
subl -0x28(%rbp), %edi
callq 0x37610
movl %eax, -0x1b0(%rbp)
movq 0x38(%rbp), %rax
movl (%rax), %edi
subl -0x2c(%rbp), %edi
callq 0x37610
movl -0x1b0(%rbp), %ecx
movl %eax, %edx
movl -0x1ac(%rbp), %eax
addl %edx, %ecx
cmpl %ecx, %eax
jle 0x515b9
jmp 0x51a94
movq -0x60(%rbp), %rax
movswl 0xe(%rax), %eax
movl %eax, -0xc8(%rbp)
movslq -0xc8(%rbp), %rcx
leaq 0x225feb(%rip), %rax    # 0x2775c0
movl (%rax,%rcx,4), %eax
sarl $0x8, %eax
andl $0xff, %eax
movsbl %al, %eax
movq -0x60(%rbp), %rcx
movsbl 0x16(%rcx), %ecx
addl %ecx, %eax
movl %eax, -0xcc(%rbp)
movslq -0xc8(%rbp), %rcx
leaq 0x225fbf(%rip), %rax    # 0x2775c0
movl (%rax,%rcx,4), %eax
sarl $0x10, %eax
andl $0xff, %eax
movsbl %al, %eax
movq -0x60(%rbp), %rcx
movsbl 0x17(%rcx), %ecx
addl %ecx, %eax
movl %eax, -0xd0(%rbp)
movl -0xb4(%rbp), %eax
andl $0x4, %eax
cmpl $0x0, %eax
jle 0x5163b
xorl %eax, %eax
subl -0xcc(%rbp), %eax
movl %eax, -0xcc(%rbp)
movl -0xb4(%rbp), %eax
andl $0x8, %eax
cmpl $0x0, %eax
jle 0x51657
xorl %eax, %eax
subl -0xd0(%rbp), %eax
movl %eax, -0xd0(%rbp)
movq -0x60(%rbp), %rax
movswl 0x1c(%rax), %eax
movl %eax, -0xe4(%rbp)
movl -0xe4(%rbp), %eax
addl $0x200, %eax            # imm = 0x200
andl $0x7ff, %eax            # imm = 0x7FF
movslq %eax, %rcx
leaq 0x3ba231(%rip), %rax    # 0x40b8b0
movswl (%rax,%rcx,2), %eax
movl %eax, -0xe8(%rbp)
movslq -0xe4(%rbp), %rcx
leaq 0x3ba219(%rip), %rax    # 0x40b8b0
movswl (%rax,%rcx,2), %eax
movl %eax, -0xec(%rbp)
movslq -0xc8(%rbp), %rcx
leaq 0x3f96d1(%rip), %rax    # 0x44ad80
movswl (%rax,%rcx,2), %eax
movl %eax, -0xf0(%rbp)
movq -0x60(%rbp), %rax
movzbl 0x14(%rax), %eax
movl %eax, -0xf8(%rbp)
movslq -0xc8(%rbp), %rcx
leaq 0x3eae6b(%rip), %rax    # 0x43c540
movswl (%rax,%rcx,2), %eax
movl %eax, -0xf4(%rbp)
movq -0x60(%rbp), %rax
movzbl 0x15(%rax), %eax
movl %eax, -0xfc(%rbp)
movl -0xf0(%rbp), %eax
sarl %eax
addl -0xcc(%rbp), %eax
imull -0xf8(%rbp), %eax
movl %eax, -0xd4(%rbp)
movl -0xf4(%rbp), %eax
sarl %eax
addl -0xd0(%rbp), %eax
imull -0xfc(%rbp), %eax
movl %eax, -0xd8(%rbp)
movl -0xec(%rbp), %edi
movl -0xd4(%rbp), %esi
movl -0xe8(%rbp), %edx
movl -0xd8(%rbp), %ecx
callq 0x43950
subl -0x90(%rbp), %eax
addl -0x6c(%rbp), %eax
movl %eax, -0x6c(%rbp)
movl -0xec(%rbp), %edi
movl -0xd8(%rbp), %esi
xorl %edx, %edx
subl -0xe8(%rbp), %edx
movl -0xd4(%rbp), %ecx
callq 0x43950
subl -0x94(%rbp), %eax
addl -0x70(%rbp), %eax
movl %eax, -0x70(%rbp)
movl -0xf0(%rbp), %eax
imull -0xf8(%rbp), %eax
movl %eax, -0xc4(%rbp)
movl -0x6c(%rbp), %eax
movl %eax, -0x1c4(%rbp)
movl -0xec(%rbp), %edi
movl -0xc4(%rbp), %esi
callq 0x39010
movl %eax, %ecx
movl -0x1c4(%rbp), %eax
subl %ecx, %eax
movl %eax, -0x78(%rbp)
movl -0x70(%rbp), %eax
movl %eax, -0x1c0(%rbp)
movl -0xe8(%rbp), %edi
movl -0xc4(%rbp), %esi
callq 0x39010
movl %eax, %ecx
movl -0x1c0(%rbp), %eax
addl %ecx, %eax
movl %eax, -0x7c(%rbp)
movl -0xf4(%rbp), %eax
imull -0xfc(%rbp), %eax
movl %eax, -0xc4(%rbp)
movl -0xe8(%rbp), %edi
movl -0xc4(%rbp), %esi
callq 0x39010
movl %eax, %ecx
xorl %eax, %eax
subl %ecx, %eax
movl %eax, -0xc0(%rbp)
movl -0x78(%rbp), %eax
addl -0xc0(%rbp), %eax
movl %eax, -0x80(%rbp)
movl -0x6c(%rbp), %eax
addl -0xc0(%rbp), %eax
movl %eax, -0x88(%rbp)
movl -0xec(%rbp), %edi
movl -0xc4(%rbp), %esi
callq 0x39010
movl %eax, %ecx
xorl %eax, %eax
subl %ecx, %eax
movl %eax, -0xc0(%rbp)
movl -0x7c(%rbp), %eax
addl -0xc0(%rbp), %eax
movl %eax, -0x84(%rbp)
movl -0x70(%rbp), %eax
addl -0xc0(%rbp), %eax
movl %eax, -0x8c(%rbp)
movb $0x0, -0x111(%rbp)
movl -0x70(%rbp), %eax
xorl -0x7c(%rbp), %eax
cmpl $0x0, %eax
jge 0x518ce
movl -0x6c(%rbp), %eax
xorl -0x78(%rbp), %eax
cmpl $0x0, %eax
jge 0x518b4
movl -0x6c(%rbp), %eax
imull -0x7c(%rbp), %eax
movl -0x78(%rbp), %ecx
imull -0x70(%rbp), %ecx
cmpl %ecx, %eax
setl %al
andb $0x1, %al
movzbl %al, %ecx
movl -0x70(%rbp), %eax
cmpl -0x7c(%rbp), %eax
setl %al
andb $0x1, %al
movzbl %al, %eax
xorl %eax, %ecx
movzbl -0x111(%rbp), %eax
xorl %ecx, %eax
movb %al, -0x111(%rbp)
jmp 0x518cc
cmpl $0x0, -0x6c(%rbp)
jl 0x518ca
movzbl -0x111(%rbp), %eax
xorl $0x1, %eax
movb %al, -0x111(%rbp)
jmp 0x518cc
jmp 0x518ce
movl -0x7c(%rbp), %eax
xorl -0x84(%rbp), %eax
cmpl $0x0, %eax
jge 0x51940
movl -0x78(%rbp), %eax
xorl -0x80(%rbp), %eax
cmpl $0x0, %eax
jge 0x51926
movl -0x78(%rbp), %eax
imull -0x84(%rbp), %eax
movl -0x80(%rbp), %ecx
imull -0x7c(%rbp), %ecx
cmpl %ecx, %eax
setl %al
andb $0x1, %al
movzbl %al, %ecx
movl -0x7c(%rbp), %eax
cmpl -0x84(%rbp), %eax
setl %al
andb $0x1, %al
movzbl %al, %eax
xorl %eax, %ecx
movzbl -0x111(%rbp), %eax
xorl %ecx, %eax
movb %al, -0x111(%rbp)
jmp 0x5193e
cmpl $0x0, -0x78(%rbp)
jl 0x5193c
movzbl -0x111(%rbp), %eax
xorl $0x1, %eax
movb %al, -0x111(%rbp)
jmp 0x5193e
jmp 0x51940
movl -0x84(%rbp), %eax
xorl -0x8c(%rbp), %eax
cmpl $0x0, %eax
jge 0x519c1
movl -0x80(%rbp), %eax
xorl -0x88(%rbp), %eax
cmpl $0x0, %eax
jge 0x519a7
movl -0x80(%rbp), %eax
imull -0x8c(%rbp), %eax
movl -0x88(%rbp), %ecx
imull -0x84(%rbp), %ecx
cmpl %ecx, %eax
setl %al
andb $0x1, %al
movzbl %al, %ecx
movl -0x84(%rbp), %eax
cmpl -0x8c(%rbp), %eax
setl %al
andb $0x1, %al
movzbl %al, %eax
xorl %eax, %ecx
movzbl -0x111(%rbp), %eax
xorl %ecx, %eax
movb %al, -0x111(%rbp)
jmp 0x519bf
cmpl $0x0, -0x80(%rbp)
jl 0x519bd
movzbl -0x111(%rbp), %eax
xorl $0x1, %eax
movb %al, -0x111(%rbp)
jmp 0x519bf
jmp 0x519c1
movl -0x8c(%rbp), %eax
xorl -0x70(%rbp), %eax
cmpl $0x0, %eax
jge 0x51a3c
movl -0x88(%rbp), %eax
xorl -0x6c(%rbp), %eax
cmpl $0x0, %eax
jge 0x51a1f
movl -0x88(%rbp), %eax
imull -0x70(%rbp), %eax
movl -0x6c(%rbp), %ecx
imull -0x8c(%rbp), %ecx
cmpl %ecx, %eax
setl %al
andb $0x1, %al
movzbl %al, %ecx
movl -0x8c(%rbp), %eax
cmpl -0x70(%rbp), %eax
setl %al
andb $0x1, %al
movzbl %al, %eax
xorl %eax, %ecx
movzbl -0x111(%rbp), %eax
xorl %ecx, %eax
movb %al, -0x111(%rbp)
jmp 0x51a3a
cmpl $0x0, -0x88(%rbp)
jl 0x51a38
movzbl -0x111(%rbp), %eax
xorl $0x1, %eax
movb %al, -0x111(%rbp)
jmp 0x51a3a
jmp 0x51a3c
movzbl -0x111(%rbp), %eax
cmpl $0x0, %eax
je 0x51a90
movw -0x10a(%rbp), %cx
movq 0x18(%rbp), %rax
movw %cx, (%rax)
movq 0x20(%rbp), %rax
movw $0xffff, (%rax)         # imm = 0xFFFF
movl -0x64(%rbp), %eax
movw %ax, %cx
movq 0x28(%rbp), %rax
movw %cx, (%rax)
movl -0x90(%rbp), %ecx
movq 0x30(%rbp), %rax
movl %ecx, (%rax)
movl -0x94(%rbp), %ecx
movq 0x38(%rbp), %rax
movl %ecx, (%rax)
movl -0x98(%rbp), %ecx
movq 0x40(%rbp), %rax
movl %ecx, (%rax)
jmp 0x51a92
jmp 0x51a94
movslq -0x64(%rbp), %rcx
leaq 0x3a15e1(%rip), %rax    # 0x3f3080
movswl (%rax,%rcx,2), %eax
movl %eax, -0x64(%rbp)
jmp 0x50d2d
movw -0x106(%rbp), %ax
addw $0x1, %ax
movw %ax, -0x106(%rbp)
movswl -0x106(%rbp), %eax
movswl -0x108(%rbp), %ecx
cmpl %ecx, %eax
jl 0x50265
movl $0x0, -0x24(%rbp)
movl -0x24(%rbp), %eax
addq $0x1e0, %rsp            # imm = 0x1E0
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
nopl (%rax)