// File: /workspace/github_c_makefile_star2_O0/jonof[P]jftekwar/jfbuild/src/engine.c
// Function: getzrange
void getzrange(int x, int y, int z, short sectnum,
		 int *ceilz, int *ceilhit, int *florz, int *florhit,
		 int walldist, unsigned int cliptype)
{
	sectortype *sec;
	walltype *wal, *wal2;
	spritetype *spr;
	int clipsectcnt, startwall, endwall, tilenum, xoff, yoff, dax, day;
	int xmin, ymin, xmax, ymax, i, j, k, l, daz, daz2, dx, dy;
	int x1, y1, x2, y2, x3, y3, x4, y4, ang, cosang, sinang;
	int xspan, yspan, xrepeat, yrepeat, dasprclipmask, dawalclipmask;
	short cstat;
	unsigned char clipyou;

	if (sectnum < 0)
	{
		*ceilz = 0x80000000; *ceilhit = -1;
		*florz = 0x7fffffff; *florhit = -1;
		return;
	}

		//Extra walldist for sprites on sector lines
	i = walldist+MAXCLIPDIST+1;
	xmin = x-i; ymin = y-i;
	xmax = x+i; ymax = y+i;

	getzsofslope(sectnum,x,y,ceilz,florz);
	*ceilhit = sectnum+16384; *florhit = sectnum+16384;

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

	clipsectorlist[0] = sectnum;
	clipsectcnt = 0; clipsectnum = 1;

	do  //Collect sectors inside your square first
	{
		sec = &sector[clipsectorlist[clipsectcnt]];
		startwall = sec->wallptr; endwall = startwall + sec->wallnum;
		for(j=startwall,wal=&wall[startwall];j<endwall;j++,wal++)
		{
			k = wal->nextsector;
			if (k >= 0)
			{
				wal2 = &wall[wal->point2];
				x1 = wal->x; x2 = wal2->x;
				if ((x1 < xmin) && (x2 < xmin)) continue;
				if ((x1 > xmax) && (x2 > xmax)) continue;
				y1 = wal->y; y2 = wal2->y;
				if ((y1 < ymin) && (y2 < ymin)) continue;
				if ((y1 > ymax) && (y2 > ymax)) continue;

				dx = x2-x1; dy = y2-y1;
				if (dx*(y-y1) < (x-x1)*dy) continue; //back
				if (dx > 0) dax = dx*(ymin-y1); else dax = dx*(ymax-y1);
				if (dy > 0) day = dy*(xmax-x1); else day = dy*(xmin-x1);
				if (dax >= day) continue;

				if (wal->cstat&dawalclipmask) continue;
				sec = &sector[k];
				if (editstatus == 0)
				{
					if (((sec->ceilingstat&1) == 0) && (z <= sec->ceilingz+(3<<8))) continue;
					if (((sec->floorstat&1) == 0) && (z >= sec->floorz-(3<<8))) continue;
				}

				for(i=clipsectnum-1;i>=0;i--) if (clipsectorlist[i] == k) break;
				if (i < 0) clipsectorlist[clipsectnum++] = k;

				if ((x1 < xmin+MAXCLIPDIST) && (x2 < xmin+MAXCLIPDIST)) continue;
				if ((x1 > xmax-MAXCLIPDIST) && (x2 > xmax-MAXCLIPDIST)) continue;
				if ((y1 < ymin+MAXCLIPDIST) && (y2 < ymin+MAXCLIPDIST)) continue;
				if ((y1 > ymax-MAXCLIPDIST) && (y2 > ymax-MAXCLIPDIST)) continue;
				if (dx > 0) dax += dx*MAXCLIPDIST; else dax -= dx*MAXCLIPDIST;
				if (dy > 0) day -= dy*MAXCLIPDIST; else day += dy*MAXCLIPDIST;
				if (dax >= day) continue;

					//It actually got here, through all the continue's!!!
				getzsofslope((short)k,x,y,&daz,&daz2);
				if (daz > *ceilz) { *ceilz = daz; *ceilhit = k+16384; }
				if (daz2 < *florz) { *florz = daz2; *florhit = k+16384; }
			}
		}
		clipsectcnt++;
	} while (clipsectcnt < clipsectnum);

	for(i=0;i<clipsectnum;i++)
	{
		for(j=headspritesect[clipsectorlist[i]];j>=0;j=nextspritesect[j])
		{
			spr = &sprite[j];
			cstat = spr->cstat;
			if (cstat&dasprclipmask)
			{
				x1 = spr->x; y1 = spr->y;

				clipyou = 0;
				switch(cstat&48)
				{
					case 0:
						k = walldist+(spr->clipdist<<2)+1;
						if ((klabs(x1-x) <= k) && (klabs(y1-y) <= k))
						{
							daz = spr->z;
							k = ((tilesizy[spr->picnum]*spr->yrepeat)<<1);
							if (cstat&128) daz += k;
							if (picanm[spr->picnum]&0x00ff0000) daz -= ((int)((signed char)((picanm[spr->picnum]>>16)&255))*spr->yrepeat<<2);
							daz2 = daz - (k<<1);
							clipyou = 1;
						}
						break;
					case 16:
						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 (clipinsideboxline(x,y,x1,y1,x2,y2,walldist+1) != 0)
						{
							daz = spr->z; k = ((tilesizy[spr->picnum]*spr->yrepeat)<<1);
							if (cstat&128) daz += k;
							if (picanm[spr->picnum]&0x00ff0000) daz -= ((int)((signed char)((picanm[spr->picnum]>>16)&255))*spr->yrepeat<<2);
							daz2 = daz-(k<<1);
							clipyou = 1;
						}
						break;
					case 32:
						daz = spr->z; daz2 = daz;

						if ((cstat&64) != 0)
							if ((z > daz) == ((cstat&8)==0)) 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)-x;
						y1 += dmulscale16(sinang,day,-cosang,dax)-y;
						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;

						dax = mulscale14(sintable[(spr->ang-256+512)&2047],walldist+4);
						day = mulscale14(sintable[(spr->ang-256)&2047],walldist+4);
						x1 += dax; x2 -= day; x3 -= dax; x4 += day;
						y1 += day; y2 += dax; y3 -= day; y4 -= dax;

						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;
						}
						break;
				}

				if (clipyou != 0)
				{
					if ((z > daz) && (daz > *ceilz)) { *ceilz = daz; *ceilhit = j+49152; }
					if ((z < daz2) && (daz2 < *florz)) { *florz = daz2; *florhit = j+49152; }
				}
			}
		}
	}
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x100, %rsp            # imm = 0x100
movw %cx, %ax
movl 0x28(%rbp), %ecx
movl 0x20(%rbp), %ecx
movq 0x18(%rbp), %rcx
movq 0x10(%rbp), %rcx
movl %edi, -0x4(%rbp)
movl %esi, -0x8(%rbp)
movl %edx, -0xc(%rbp)
movw %ax, -0xe(%rbp)
movq %r8, -0x18(%rbp)
movq %r9, -0x20(%rbp)
movswl -0xe(%rbp), %eax
cmpl $0x0, %eax
jge 0x55e27
movq -0x18(%rbp), %rax
movl $0x80000000, (%rax)     # imm = 0x80000000
movq -0x20(%rbp), %rax
movl $0xffffffff, (%rax)     # imm = 0xFFFFFFFF
movq 0x10(%rbp), %rax
movl $0x7fffffff, (%rax)     # imm = 0x7FFFFFFF
movq 0x18(%rbp), %rax
movl $0xffffffff, (%rax)     # imm = 0xFFFFFFFF
jmp 0x56df7
movl 0x20(%rbp), %eax
addl $0x400, %eax            # imm = 0x400
addl $0x1, %eax
movl %eax, -0x74(%rbp)
movl -0x4(%rbp), %eax
subl -0x74(%rbp), %eax
movl %eax, -0x64(%rbp)
movl -0x8(%rbp), %eax
subl -0x74(%rbp), %eax
movl %eax, -0x68(%rbp)
movl -0x4(%rbp), %eax
addl -0x74(%rbp), %eax
movl %eax, -0x6c(%rbp)
movl -0x8(%rbp), %eax
addl -0x74(%rbp), %eax
movl %eax, -0x70(%rbp)
movw -0xe(%rbp), %ax
movl -0x4(%rbp), %esi
movl -0x8(%rbp), %edx
movq -0x18(%rbp), %rcx
movq 0x10(%rbp), %r8
movswl %ax, %edi
callq 0x393f0
movswl -0xe(%rbp), %ecx
addl $0x4000, %ecx           # imm = 0x4000
movq -0x20(%rbp), %rax
movl %ecx, (%rax)
movswl -0xe(%rbp), %ecx
addl $0x4000, %ecx           # imm = 0x4000
movq 0x18(%rbp), %rax
movl %ecx, (%rax)
movl 0x28(%rbp), %eax
andl $0xffff, %eax           # imm = 0xFFFF
movl %eax, -0xd4(%rbp)
movl 0x28(%rbp), %eax
shrl $0x10, %eax
movl %eax, -0xd0(%rbp)
movw -0xe(%rbp), %ax
movw %ax, 0x415ec8(%rip)     # 0x46bd80
movl $0x0, -0x44(%rbp)
movw $0x1, 0x4166ba(%rip)    # 0x46c582
movslq -0x44(%rbp), %rcx
leaq 0x415ead(%rip), %rax    # 0x46bd80
movswq (%rax,%rcx,2), %rcx
leaq 0x22a6e1(%rip), %rax    # 0x2805c0
imulq $0x28, %rcx, %rcx
addq %rcx, %rax
movq %rax, -0x28(%rbp)
movq -0x28(%rbp), %rax
movswl (%rax), %eax
movl %eax, -0x48(%rbp)
movl -0x48(%rbp), %eax
movq -0x28(%rbp), %rcx
movswl 0x2(%rcx), %ecx
addl %ecx, %eax
movl %eax, -0x4c(%rbp)
movl -0x48(%rbp), %eax
movl %eax, -0x78(%rbp)
movslq -0x48(%rbp), %rcx
leaq 0x19f69b(%rip), %rax    # 0x1f55b0
shlq $0x5, %rcx
addq %rcx, %rax
movq %rax, -0x30(%rbp)
movl -0x78(%rbp), %eax
cmpl -0x4c(%rbp), %eax
jge 0x5634f
movq -0x30(%rbp), %rax
movswl 0xc(%rax), %eax
movl %eax, -0x7c(%rbp)
cmpl $0x0, -0x7c(%rbp)
jl 0x56333
movq -0x30(%rbp), %rax
movswq 0x8(%rax), %rcx
leaq 0x19f65f(%rip), %rax    # 0x1f55b0
shlq $0x5, %rcx
addq %rcx, %rax
movq %rax, -0x38(%rbp)
movq -0x30(%rbp), %rax
movl (%rax), %eax
movl %eax, -0x94(%rbp)
movq -0x38(%rbp), %rax
movl (%rax), %eax
movl %eax, -0x9c(%rbp)
movl -0x94(%rbp), %eax
cmpl -0x64(%rbp), %eax
jge 0x55f8f
movl -0x9c(%rbp), %eax
cmpl -0x64(%rbp), %eax
jge 0x55f8f
jmp 0x56335
movl -0x94(%rbp), %eax
cmpl -0x6c(%rbp), %eax
jle 0x55faa
movl -0x9c(%rbp), %eax
cmpl -0x6c(%rbp), %eax
jle 0x55faa
jmp 0x56335
movq -0x30(%rbp), %rax
movl 0x4(%rax), %eax
movl %eax, -0x98(%rbp)
movq -0x38(%rbp), %rax
movl 0x4(%rax), %eax
movl %eax, -0xa0(%rbp)
movl -0x98(%rbp), %eax
cmpl -0x68(%rbp), %eax
jge 0x55fdf
movl -0xa0(%rbp), %eax
cmpl -0x68(%rbp), %eax
jge 0x55fdf
jmp 0x56335
movl -0x98(%rbp), %eax
cmpl -0x70(%rbp), %eax
jle 0x55ffa
movl -0xa0(%rbp), %eax
cmpl -0x70(%rbp), %eax
jle 0x55ffa
jmp 0x56335
movl -0x9c(%rbp), %eax
subl -0x94(%rbp), %eax
movl %eax, -0x8c(%rbp)
movl -0xa0(%rbp), %eax
subl -0x98(%rbp), %eax
movl %eax, -0x90(%rbp)
movl -0x8c(%rbp), %eax
movl -0x8(%rbp), %ecx
subl -0x98(%rbp), %ecx
imull %ecx, %eax
movl -0x4(%rbp), %ecx
subl -0x94(%rbp), %ecx
imull -0x90(%rbp), %ecx
cmpl %ecx, %eax
jge 0x56049
jmp 0x56335
cmpl $0x0, -0x8c(%rbp)
jle 0x56069
movl -0x8c(%rbp), %eax
movl -0x68(%rbp), %ecx
subl -0x98(%rbp), %ecx
imull %ecx, %eax
movl %eax, -0x5c(%rbp)
jmp 0x5607e
movl -0x8c(%rbp), %eax
movl -0x70(%rbp), %ecx
subl -0x98(%rbp), %ecx
imull %ecx, %eax
movl %eax, -0x5c(%rbp)
cmpl $0x0, -0x90(%rbp)
jle 0x5609e
movl -0x90(%rbp), %eax
movl -0x6c(%rbp), %ecx
subl -0x94(%rbp), %ecx
imull %ecx, %eax
movl %eax, -0x60(%rbp)
jmp 0x560b3
movl -0x90(%rbp), %eax
movl -0x64(%rbp), %ecx
subl -0x94(%rbp), %ecx
imull %ecx, %eax
movl %eax, -0x60(%rbp)
movl -0x5c(%rbp), %eax
cmpl -0x60(%rbp), %eax
jl 0x560c0
jmp 0x56335
movq -0x30(%rbp), %rax
movswl 0xe(%rax), %eax
andl -0xd4(%rbp), %eax
cmpl $0x0, %eax
je 0x560d8
jmp 0x56335
movslq -0x7c(%rbp), %rcx
leaq 0x22a4dd(%rip), %rax    # 0x2805c0
imulq $0x28, %rcx, %rcx
addq %rcx, %rax
movq %rax, -0x28(%rbp)
movswl 0x19f4a7(%rip), %eax    # 0x1f559c
cmpl $0x0, %eax
jne 0x5614e
movq -0x28(%rbp), %rax
movswl 0xc(%rax), %eax
andl $0x1, %eax
cmpl $0x0, %eax
jne 0x56123
movl -0xc(%rbp), %eax
movq -0x28(%rbp), %rcx
movl 0x4(%rcx), %ecx
addl $0x300, %ecx            # imm = 0x300
cmpl %ecx, %eax
jg 0x56123
jmp 0x56335
movq -0x28(%rbp), %rax
movswl 0xe(%rax), %eax
andl $0x1, %eax
cmpl $0x0, %eax
jne 0x5614c
movl -0xc(%rbp), %eax
movq -0x28(%rbp), %rcx
movl 0x8(%rcx), %ecx
subl $0x300, %ecx            # imm = 0x300
cmpl %ecx, %eax
jl 0x5614c
jmp 0x56335
jmp 0x5614e
movswl 0x41642d(%rip), %eax    # 0x46c582
subl $0x1, %eax
movl %eax, -0x74(%rbp)
cmpl $0x0, -0x74(%rbp)
jl 0x56184
movslq -0x74(%rbp), %rcx
leaq 0x415c14(%rip), %rax    # 0x46bd80
movswl (%rax,%rcx,2), %eax
cmpl -0x7c(%rbp), %eax
jne 0x56177
jmp 0x56184
jmp 0x56179
movl -0x74(%rbp), %eax
addl $-0x1, %eax
movl %eax, -0x74(%rbp)
jmp 0x5615b
cmpl $0x0, -0x74(%rbp)
jge 0x561b4
movl -0x7c(%rbp), %eax
movw %ax, %dx
movw 0x4163eb(%rip), %ax     # 0x46c582
movw %ax, %cx
addw $0x1, %cx
movw %cx, 0x4163dd(%rip)     # 0x46c582
movswq %ax, %rcx
leaq 0x415bd0(%rip), %rax    # 0x46bd80
movw %dx, (%rax,%rcx,2)
movl -0x94(%rbp), %eax
movl -0x64(%rbp), %ecx
addl $0x400, %ecx            # imm = 0x400
cmpl %ecx, %eax
jge 0x561df
movl -0x9c(%rbp), %eax
movl -0x64(%rbp), %ecx
addl $0x400, %ecx            # imm = 0x400
cmpl %ecx, %eax
jge 0x561df
jmp 0x56335
movl -0x94(%rbp), %eax
movl -0x6c(%rbp), %ecx
subl $0x400, %ecx            # imm = 0x400
cmpl %ecx, %eax
jle 0x5620a
movl -0x9c(%rbp), %eax
movl -0x6c(%rbp), %ecx
subl $0x400, %ecx            # imm = 0x400
cmpl %ecx, %eax
jle 0x5620a
jmp 0x56335
movl -0x98(%rbp), %eax
movl -0x68(%rbp), %ecx
addl $0x400, %ecx            # imm = 0x400
cmpl %ecx, %eax
jge 0x56235
movl -0xa0(%rbp), %eax
movl -0x68(%rbp), %ecx
addl $0x400, %ecx            # imm = 0x400
cmpl %ecx, %eax
jge 0x56235
jmp 0x56335
movl -0x98(%rbp), %eax
movl -0x70(%rbp), %ecx
subl $0x400, %ecx            # imm = 0x400
cmpl %ecx, %eax
jle 0x56260
movl -0xa0(%rbp), %eax
movl -0x70(%rbp), %ecx
subl $0x400, %ecx            # imm = 0x400
cmpl %ecx, %eax
jle 0x56260
jmp 0x56335
cmpl $0x0, -0x8c(%rbp)
jle 0x5627a
movl -0x8c(%rbp), %eax
shll $0xa, %eax
addl -0x5c(%rbp), %eax
movl %eax, -0x5c(%rbp)
jmp 0x5628b
movl -0x8c(%rbp), %ecx
shll $0xa, %ecx
movl -0x5c(%rbp), %eax
subl %ecx, %eax
movl %eax, -0x5c(%rbp)
cmpl $0x0, -0x90(%rbp)
jle 0x562a7
movl -0x90(%rbp), %ecx
shll $0xa, %ecx
movl -0x60(%rbp), %eax
subl %ecx, %eax
movl %eax, -0x60(%rbp)
jmp 0x562b6
movl -0x90(%rbp), %eax
shll $0xa, %eax
addl -0x60(%rbp), %eax
movl %eax, -0x60(%rbp)
movl -0x5c(%rbp), %eax
cmpl -0x60(%rbp), %eax
jl 0x562c0
jmp 0x56335
movl -0x7c(%rbp), %eax
movl -0x4(%rbp), %esi
movl -0x8(%rbp), %edx
leaq -0x84(%rbp), %rcx
leaq -0x88(%rbp), %r8
movswl %ax, %edi
callq 0x393f0
movl -0x84(%rbp), %eax
movq -0x18(%rbp), %rcx
cmpl (%rcx), %eax
jle 0x56308
movl -0x84(%rbp), %ecx
movq -0x18(%rbp), %rax
movl %ecx, (%rax)
movl -0x7c(%rbp), %ecx
addl $0x4000, %ecx           # imm = 0x4000
movq -0x20(%rbp), %rax
movl %ecx, (%rax)
movl -0x88(%rbp), %eax
movq 0x10(%rbp), %rcx
cmpl (%rcx), %eax
jge 0x56331
movl -0x88(%rbp), %ecx
movq 0x10(%rbp), %rax
movl %ecx, (%rax)
movl -0x7c(%rbp), %ecx
addl $0x4000, %ecx           # imm = 0x4000
movq 0x18(%rbp), %rax
movl %ecx, (%rax)
jmp 0x56333
jmp 0x56335
movl -0x78(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x78(%rbp)
movq -0x30(%rbp), %rax
addq $0x20, %rax
movq %rax, -0x30(%rbp)
jmp 0x55f20
movl -0x44(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x44(%rbp)
movl -0x44(%rbp), %eax
movswl 0x416220(%rip), %ecx    # 0x46c582
cmpl %ecx, %eax
jl 0x55ec8
movl $0x0, -0x74(%rbp)
movl -0x74(%rbp), %eax
movswl 0x416207(%rip), %ecx    # 0x46c582
cmpl %ecx, %eax
jge 0x56df7
movslq -0x74(%rbp), %rcx
leaq 0x4159f2(%rip), %rax    # 0x46bd80
movswq (%rax,%rcx,2), %rcx
leaq 0x392cd6(%rip), %rax    # 0x3e9070
movswl (%rax,%rcx,2), %eax
movl %eax, -0x78(%rbp)
cmpl $0x0, -0x78(%rbp)
jl 0x56de7
movslq -0x78(%rbp), %rcx
leaq 0x26345a(%rip), %rax    # 0x2b9810
imulq $0x2c, %rcx, %rcx
addq %rcx, %rax
movq %rax, -0x40(%rbp)
movq -0x40(%rbp), %rax
movw 0xc(%rax), %ax
movw %ax, -0xd6(%rbp)
movswl -0xd6(%rbp), %eax
andl -0xd0(%rbp), %eax
cmpl $0x0, %eax
je 0x56dce
movq -0x40(%rbp), %rax
movl (%rax), %eax
movl %eax, -0x94(%rbp)
movq -0x40(%rbp), %rax
movl 0x4(%rax), %eax
movl %eax, -0x98(%rbp)
movb $0x0, -0xd7(%rbp)
movzwl -0xd6(%rbp), %eax
andl $0x30, %eax
movl %eax, -0xdc(%rbp)
je 0x5643f
jmp 0x5641a
movl -0xdc(%rbp), %eax
subl $0x10, %eax
je 0x5654a
jmp 0x5642b
movl -0xdc(%rbp), %eax
subl $0x20, %eax
je 0x56786
jmp 0x56d56
movl 0x20(%rbp), %eax
movq -0x40(%rbp), %rcx
movzbl 0x12(%rcx), %ecx
shll $0x2, %ecx
addl %ecx, %eax
addl $0x1, %eax
movl %eax, -0x7c(%rbp)
movl -0x94(%rbp), %edi
subl -0x4(%rbp), %edi
callq 0x37610
cmpl -0x7c(%rbp), %eax
jg 0x56545
movl -0x98(%rbp), %edi
subl -0x8(%rbp), %edi
callq 0x37610
cmpl -0x7c(%rbp), %eax
jg 0x56545
movq -0x40(%rbp), %rax
movl 0x8(%rax), %eax
movl %eax, -0x84(%rbp)
movq -0x40(%rbp), %rax
movswq 0xe(%rax), %rcx
leaq 0x3e60a0(%rip), %rax    # 0x43c540
movswl (%rax,%rcx,2), %eax
movq -0x40(%rbp), %rcx
movzbl 0x15(%rcx), %ecx
imull %ecx, %eax
shll %eax
movl %eax, -0x7c(%rbp)
movswl -0xd6(%rbp), %eax
andl $0x80, %eax
cmpl $0x0, %eax
je 0x564d4
movl -0x7c(%rbp), %eax
addl -0x84(%rbp), %eax
movl %eax, -0x84(%rbp)
movq -0x40(%rbp), %rax
movswq 0xe(%rax), %rcx
leaq 0x2210dc(%rip), %rax    # 0x2775c0
movl (%rax,%rcx,4), %eax
andl $0xff0000, %eax         # imm = 0xFF0000
cmpl $0x0, %eax
je 0x5652b
movq -0x40(%rbp), %rax
movswq 0xe(%rax), %rcx
leaq 0x2210bf(%rip), %rax    # 0x2775c0
movl (%rax,%rcx,4), %eax
sarl $0x10, %eax
andl $0xff, %eax
movsbl %al, %ecx
movq -0x40(%rbp), %rax
movzbl 0x15(%rax), %eax
imull %eax, %ecx
shll $0x2, %ecx
movl -0x84(%rbp), %eax
subl %ecx, %eax
movl %eax, -0x84(%rbp)
movl -0x84(%rbp), %eax
movl -0x7c(%rbp), %ecx
shll %ecx
subl %ecx, %eax
movl %eax, -0x88(%rbp)
movb $0x1, -0xd7(%rbp)
jmp 0x56d56
movq -0x40(%rbp), %rax
movswl 0xe(%rax), %eax
movl %eax, -0x50(%rbp)
movslq -0x50(%rbp), %rcx
leaq 0x221060(%rip), %rax    # 0x2775c0
movl (%rax,%rcx,4), %eax
sarl $0x8, %eax
andl $0xff, %eax
movsbl %al, %eax
movq -0x40(%rbp), %rcx
movsbl 0x16(%rcx), %ecx
addl %ecx, %eax
movl %eax, -0x54(%rbp)
movswl -0xd6(%rbp), %eax
andl $0x4, %eax
cmpl $0x0, %eax
jle 0x56592
xorl %eax, %eax
subl -0x54(%rbp), %eax
movl %eax, -0x54(%rbp)
movq -0x40(%rbp), %rax
movswl 0x1c(%rax), %eax
movl %eax, -0x7c(%rbp)
movq -0x40(%rbp), %rax
movzbl 0x14(%rax), %eax
movl %eax, -0x80(%rbp)
movl -0x7c(%rbp), %eax
andl $0x7ff, %eax            # imm = 0x7FF
movslq %eax, %rcx
leaq 0x3b52f6(%rip), %rax    # 0x40b8b0
movswl (%rax,%rcx,2), %eax
imull -0x80(%rbp), %eax
movl %eax, -0x5c(%rbp)
movl -0x7c(%rbp), %eax
addl $0x600, %eax            # imm = 0x600
andl $0x7ff, %eax            # imm = 0x7FF
movslq %eax, %rcx
leaq 0x3b52d4(%rip), %rax    # 0x40b8b0
movswl (%rax,%rcx,2), %eax
imull -0x80(%rbp), %eax
movl %eax, -0x60(%rbp)
movslq -0x50(%rbp), %rcx
leaq 0x3f478e(%rip), %rax    # 0x44ad80
movswl (%rax,%rcx,2), %eax
movl %eax, -0x80(%rbp)
movl -0x80(%rbp), %eax
sarl %eax
addl -0x54(%rbp), %eax
movl %eax, -0x7c(%rbp)
movl -0x5c(%rbp), %edi
movl -0x7c(%rbp), %esi
callq 0x39010
movl %eax, %ecx
movl -0x94(%rbp), %eax
subl %ecx, %eax
movl %eax, -0x94(%rbp)
movl -0x94(%rbp), %eax
movl %eax, -0xe4(%rbp)
movl -0x5c(%rbp), %edi
movl -0x80(%rbp), %esi
callq 0x39010
movl %eax, %ecx
movl -0xe4(%rbp), %eax
addl %ecx, %eax
movl %eax, -0x9c(%rbp)
movl -0x60(%rbp), %edi
movl -0x7c(%rbp), %esi
callq 0x39010
movl %eax, %ecx
movl -0x98(%rbp), %eax
subl %ecx, %eax
movl %eax, -0x98(%rbp)
movl -0x98(%rbp), %eax
movl %eax, -0xe0(%rbp)
movl -0x60(%rbp), %edi
movl -0x80(%rbp), %esi
callq 0x39010
movl %eax, %ecx
movl -0xe0(%rbp), %eax
addl %ecx, %eax
movl %eax, -0xa0(%rbp)
movl -0x4(%rbp), %edi
movl -0x8(%rbp), %esi
movl -0x94(%rbp), %edx
movl -0x98(%rbp), %ecx
movl -0x9c(%rbp), %r8d
movl -0xa0(%rbp), %r9d
movl 0x20(%rbp), %eax
addl $0x1, %eax
movl %eax, (%rsp)
callq 0x4ecd0
cmpl $0x0, %eax
je 0x56781
movq -0x40(%rbp), %rax
movl 0x8(%rax), %eax
movl %eax, -0x84(%rbp)
movq -0x40(%rbp), %rax
movswq 0xe(%rax), %rcx
leaq 0x3e5e64(%rip), %rax    # 0x43c540
movswl (%rax,%rcx,2), %eax
movq -0x40(%rbp), %rcx
movzbl 0x15(%rcx), %ecx
imull %ecx, %eax
shll %eax
movl %eax, -0x7c(%rbp)
movswl -0xd6(%rbp), %eax
andl $0x80, %eax
cmpl $0x0, %eax
je 0x56710
movl -0x7c(%rbp), %eax
addl -0x84(%rbp), %eax
movl %eax, -0x84(%rbp)
movq -0x40(%rbp), %rax
movswq 0xe(%rax), %rcx
leaq 0x220ea0(%rip), %rax    # 0x2775c0
movl (%rax,%rcx,4), %eax
andl $0xff0000, %eax         # imm = 0xFF0000
cmpl $0x0, %eax
je 0x56767
movq -0x40(%rbp), %rax
movswq 0xe(%rax), %rcx
leaq 0x220e83(%rip), %rax    # 0x2775c0
movl (%rax,%rcx,4), %eax
sarl $0x10, %eax
andl $0xff, %eax
movsbl %al, %ecx
movq -0x40(%rbp), %rax
movzbl 0x15(%rax), %eax
imull %eax, %ecx
shll $0x2, %ecx
movl -0x84(%rbp), %eax
subl %ecx, %eax
movl %eax, -0x84(%rbp)
movl -0x84(%rbp), %eax
movl -0x7c(%rbp), %ecx
shll %ecx
subl %ecx, %eax
movl %eax, -0x88(%rbp)
movb $0x1, -0xd7(%rbp)
jmp 0x56d56
movq -0x40(%rbp), %rax
movl 0x8(%rax), %eax
movl %eax, -0x84(%rbp)
movl -0x84(%rbp), %eax
movl %eax, -0x88(%rbp)
movswl -0xd6(%rbp), %eax
andl $0x40, %eax
cmpl $0x0, %eax
je 0x567e0
movl -0xc(%rbp), %eax
cmpl -0x84(%rbp), %eax
setg %al
andb $0x1, %al
movzbl %al, %eax
movswl -0xd6(%rbp), %ecx
andl $0x8, %ecx
cmpl $0x0, %ecx
sete %cl
andb $0x1, %cl
movzbl %cl, %ecx
cmpl %ecx, %eax
jne 0x567de
jmp 0x56dd0
jmp 0x567e0
movq -0x40(%rbp), %rax
movswl 0xe(%rax), %eax
movl %eax, -0x50(%rbp)
movslq -0x50(%rbp), %rcx
leaq 0x220dca(%rip), %rax    # 0x2775c0
movl (%rax,%rcx,4), %eax
sarl $0x8, %eax
andl $0xff, %eax
movsbl %al, %eax
movq -0x40(%rbp), %rcx
movsbl 0x16(%rcx), %ecx
addl %ecx, %eax
movl %eax, -0x54(%rbp)
movslq -0x50(%rbp), %rcx
leaq 0x220da4(%rip), %rax    # 0x2775c0
movl (%rax,%rcx,4), %eax
sarl $0x10, %eax
andl $0xff, %eax
movsbl %al, %eax
movq -0x40(%rbp), %rcx
movsbl 0x17(%rcx), %ecx
addl %ecx, %eax
movl %eax, -0x58(%rbp)
movswl -0xd6(%rbp), %eax
andl $0x4, %eax
cmpl $0x0, %eax
jle 0x5684e
xorl %eax, %eax
subl -0x54(%rbp), %eax
movl %eax, -0x54(%rbp)
movswl -0xd6(%rbp), %eax
andl $0x8, %eax
cmpl $0x0, %eax
jle 0x56865
xorl %eax, %eax
subl -0x58(%rbp), %eax
movl %eax, -0x58(%rbp)
movq -0x40(%rbp), %rax
movswl 0x1c(%rax), %eax
movl %eax, -0xb4(%rbp)
movl -0xb4(%rbp), %eax
addl $0x200, %eax            # imm = 0x200
andl $0x7ff, %eax            # imm = 0x7FF
movslq %eax, %rcx
leaq 0x3b5023(%rip), %rax    # 0x40b8b0
movswl (%rax,%rcx,2), %eax
movl %eax, -0xb8(%rbp)
movslq -0xb4(%rbp), %rcx
leaq 0x3b500b(%rip), %rax    # 0x40b8b0
movswl (%rax,%rcx,2), %eax
movl %eax, -0xbc(%rbp)
movslq -0x50(%rbp), %rcx
leaq 0x3f44c6(%rip), %rax    # 0x44ad80
movswl (%rax,%rcx,2), %eax
movl %eax, -0xc0(%rbp)
movq -0x40(%rbp), %rax
movzbl 0x14(%rax), %eax
movl %eax, -0xc8(%rbp)
movslq -0x50(%rbp), %rcx
leaq 0x3e5c63(%rip), %rax    # 0x43c540
movswl (%rax,%rcx,2), %eax
movl %eax, -0xc4(%rbp)
movq -0x40(%rbp), %rax
movzbl 0x15(%rax), %eax
movl %eax, -0xcc(%rbp)
movl -0xc0(%rbp), %eax
sarl %eax
addl -0x54(%rbp), %eax
imull -0xc8(%rbp), %eax
movl %eax, -0x5c(%rbp)
movl -0xc4(%rbp), %eax
sarl %eax
addl -0x58(%rbp), %eax
imull -0xcc(%rbp), %eax
movl %eax, -0x60(%rbp)
movl -0xbc(%rbp), %edi
movl -0x5c(%rbp), %esi
movl -0xb8(%rbp), %edx
movl -0x60(%rbp), %ecx
callq 0x43950
subl -0x4(%rbp), %eax
addl -0x94(%rbp), %eax
movl %eax, -0x94(%rbp)
movl -0xbc(%rbp), %edi
movl -0x60(%rbp), %esi
xorl %edx, %edx
subl -0xb8(%rbp), %edx
movl -0x5c(%rbp), %ecx
callq 0x43950
subl -0x8(%rbp), %eax
addl -0x98(%rbp), %eax
movl %eax, -0x98(%rbp)
movl -0xc0(%rbp), %eax
imull -0xc8(%rbp), %eax
movl %eax, -0x80(%rbp)
movl -0x94(%rbp), %eax
movl %eax, -0xec(%rbp)
movl -0xbc(%rbp), %edi
movl -0x80(%rbp), %esi
callq 0x39010
movl %eax, %ecx
movl -0xec(%rbp), %eax
subl %ecx, %eax
movl %eax, -0x9c(%rbp)
movl -0x98(%rbp), %eax
movl %eax, -0xe8(%rbp)
movl -0xb8(%rbp), %edi
movl -0x80(%rbp), %esi
callq 0x39010
movl %eax, %ecx
movl -0xe8(%rbp), %eax
addl %ecx, %eax
movl %eax, -0xa0(%rbp)
movl -0xc4(%rbp), %eax
imull -0xcc(%rbp), %eax
movl %eax, -0x80(%rbp)
movl -0xb8(%rbp), %edi
movl -0x80(%rbp), %esi
callq 0x39010
movl %eax, %ecx
xorl %eax, %eax
subl %ecx, %eax
movl %eax, -0x7c(%rbp)
movl -0x9c(%rbp), %eax
addl -0x7c(%rbp), %eax
movl %eax, -0xa4(%rbp)
movl -0x94(%rbp), %eax
addl -0x7c(%rbp), %eax
movl %eax, -0xac(%rbp)
movl -0xbc(%rbp), %edi
movl -0x80(%rbp), %esi
callq 0x39010
movl %eax, %ecx
xorl %eax, %eax
subl %ecx, %eax
movl %eax, -0x7c(%rbp)
movl -0xa0(%rbp), %eax
addl -0x7c(%rbp), %eax
movl %eax, -0xa8(%rbp)
movl -0x98(%rbp), %eax
addl -0x7c(%rbp), %eax
movl %eax, -0xb0(%rbp)
movq -0x40(%rbp), %rax
movswl 0x1c(%rax), %eax
subl $0x100, %eax            # imm = 0x100
addl $0x200, %eax            # imm = 0x200
andl $0x7ff, %eax            # imm = 0x7FF
movslq %eax, %rcx
leaq 0x3b4e44(%rip), %rax    # 0x40b8b0
movswl (%rax,%rcx,2), %edi
movl 0x20(%rbp), %esi
addl $0x4, %esi
callq 0x52680
movl %eax, -0x5c(%rbp)
movq -0x40(%rbp), %rax
movswl 0x1c(%rax), %eax
subl $0x100, %eax            # imm = 0x100
andl $0x7ff, %eax            # imm = 0x7FF
movslq %eax, %rcx
leaq 0x3b4e16(%rip), %rax    # 0x40b8b0
movswl (%rax,%rcx,2), %edi
movl 0x20(%rbp), %esi
addl $0x4, %esi
callq 0x52680
movl %eax, -0x60(%rbp)
movl -0x5c(%rbp), %eax
addl -0x94(%rbp), %eax
movl %eax, -0x94(%rbp)
movl -0x60(%rbp), %ecx
movl -0x9c(%rbp), %eax
subl %ecx, %eax
movl %eax, -0x9c(%rbp)
movl -0x5c(%rbp), %ecx
movl -0xa4(%rbp), %eax
subl %ecx, %eax
movl %eax, -0xa4(%rbp)
movl -0x60(%rbp), %eax
addl -0xac(%rbp), %eax
movl %eax, -0xac(%rbp)
movl -0x60(%rbp), %eax
addl -0x98(%rbp), %eax
movl %eax, -0x98(%rbp)
movl -0x5c(%rbp), %eax
addl -0xa0(%rbp), %eax
movl %eax, -0xa0(%rbp)
movl -0x60(%rbp), %ecx
movl -0xa8(%rbp), %eax
subl %ecx, %eax
movl %eax, -0xa8(%rbp)
movl -0x5c(%rbp), %ecx
movl -0xb0(%rbp), %eax
subl %ecx, %eax
movl %eax, -0xb0(%rbp)
movl -0x98(%rbp), %eax
xorl -0xa0(%rbp), %eax
cmpl $0x0, %eax
jge 0x56bb6
movl -0x94(%rbp), %eax
xorl -0x9c(%rbp), %eax
cmpl $0x0, %eax
jge 0x56b99
movl -0x94(%rbp), %eax
imull -0xa0(%rbp), %eax
movl -0x9c(%rbp), %ecx
imull -0x98(%rbp), %ecx
cmpl %ecx, %eax
setl %al
andb $0x1, %al
movzbl %al, %ecx
movl -0x98(%rbp), %eax
cmpl -0xa0(%rbp), %eax
setl %al
andb $0x1, %al
movzbl %al, %eax
xorl %eax, %ecx
movzbl -0xd7(%rbp), %eax
xorl %ecx, %eax
movb %al, -0xd7(%rbp)
jmp 0x56bb4
cmpl $0x0, -0x94(%rbp)
jl 0x56bb2
movzbl -0xd7(%rbp), %eax
xorl $0x1, %eax
movb %al, -0xd7(%rbp)
jmp 0x56bb4
jmp 0x56bb6
movl -0xa0(%rbp), %eax
xorl -0xa8(%rbp), %eax
cmpl $0x0, %eax
jge 0x56c40
movl -0x9c(%rbp), %eax
xorl -0xa4(%rbp), %eax
cmpl $0x0, %eax
jge 0x56c23
movl -0x9c(%rbp), %eax
imull -0xa8(%rbp), %eax
movl -0xa4(%rbp), %ecx
imull -0xa0(%rbp), %ecx
cmpl %ecx, %eax
setl %al
andb $0x1, %al
movzbl %al, %ecx
movl -0xa0(%rbp), %eax
cmpl -0xa8(%rbp), %eax
setl %al
andb $0x1, %al
movzbl %al, %eax
xorl %eax, %ecx
movzbl -0xd7(%rbp), %eax
xorl %ecx, %eax
movb %al, -0xd7(%rbp)
jmp 0x56c3e
cmpl $0x0, -0x9c(%rbp)
jl 0x56c3c
movzbl -0xd7(%rbp), %eax
xorl $0x1, %eax
movb %al, -0xd7(%rbp)
jmp 0x56c3e
jmp 0x56c40
movl -0xa8(%rbp), %eax
xorl -0xb0(%rbp), %eax
cmpl $0x0, %eax
jge 0x56cca
movl -0xa4(%rbp), %eax
xorl -0xac(%rbp), %eax
cmpl $0x0, %eax
jge 0x56cad
movl -0xa4(%rbp), %eax
imull -0xb0(%rbp), %eax
movl -0xac(%rbp), %ecx
imull -0xa8(%rbp), %ecx
cmpl %ecx, %eax
setl %al
andb $0x1, %al
movzbl %al, %ecx
movl -0xa8(%rbp), %eax
cmpl -0xb0(%rbp), %eax
setl %al
andb $0x1, %al
movzbl %al, %eax
xorl %eax, %ecx
movzbl -0xd7(%rbp), %eax
xorl %ecx, %eax
movb %al, -0xd7(%rbp)
jmp 0x56cc8
cmpl $0x0, -0xa4(%rbp)
jl 0x56cc6
movzbl -0xd7(%rbp), %eax
xorl $0x1, %eax
movb %al, -0xd7(%rbp)
jmp 0x56cc8
jmp 0x56cca
movl -0xb0(%rbp), %eax
xorl -0x98(%rbp), %eax
cmpl $0x0, %eax
jge 0x56d54
movl -0xac(%rbp), %eax
xorl -0x94(%rbp), %eax
cmpl $0x0, %eax
jge 0x56d37
movl -0xac(%rbp), %eax
imull -0x98(%rbp), %eax
movl -0x94(%rbp), %ecx
imull -0xb0(%rbp), %ecx
cmpl %ecx, %eax
setl %al
andb $0x1, %al
movzbl %al, %ecx
movl -0xb0(%rbp), %eax
cmpl -0x98(%rbp), %eax
setl %al
andb $0x1, %al
movzbl %al, %eax
xorl %eax, %ecx
movzbl -0xd7(%rbp), %eax
xorl %ecx, %eax
movb %al, -0xd7(%rbp)
jmp 0x56d52
cmpl $0x0, -0xac(%rbp)
jl 0x56d50
movzbl -0xd7(%rbp), %eax
xorl $0x1, %eax
movb %al, -0xd7(%rbp)
jmp 0x56d52
jmp 0x56d54
jmp 0x56d56
movzbl -0xd7(%rbp), %eax
cmpl $0x0, %eax
je 0x56dcc
movl -0xc(%rbp), %eax
cmpl -0x84(%rbp), %eax
jle 0x56d96
movl -0x84(%rbp), %eax
movq -0x18(%rbp), %rcx
cmpl (%rcx), %eax
jle 0x56d96
movl -0x84(%rbp), %ecx
movq -0x18(%rbp), %rax
movl %ecx, (%rax)
movl -0x78(%rbp), %ecx
addl $0xc000, %ecx           # imm = 0xC000
movq -0x20(%rbp), %rax
movl %ecx, (%rax)
movl -0xc(%rbp), %eax
cmpl -0x88(%rbp), %eax
jge 0x56dca
movl -0x88(%rbp), %eax
movq 0x10(%rbp), %rcx
cmpl (%rcx), %eax
jge 0x56dca
movl -0x88(%rbp), %ecx
movq 0x10(%rbp), %rax
movl %ecx, (%rax)
movl -0x78(%rbp), %ecx
addl $0xc000, %ecx           # imm = 0xC000
movq 0x18(%rbp), %rax
movl %ecx, (%rax)
jmp 0x56dcc
jmp 0x56dce
jmp 0x56dd0
movslq -0x78(%rbp), %rcx
leaq 0x39c2a5(%rip), %rax    # 0x3f3080
movswl (%rax,%rcx,2), %eax
movl %eax, -0x78(%rbp)
jmp 0x563a1
jmp 0x56de9
movl -0x74(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x74(%rbp)
jmp 0x56371
addq $0x100, %rsp            # imm = 0x100
popq %rbp
retq