// File: /workspace/github_c_makefile_star2_O3/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
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x98, %rsp
movq %r9, %r15
movl %ecx, %ebx
movl %edx, 0x2c(%rsp)
movq 0xd8(%rsp), %rdx
movq 0xd0(%rsp), %r9
testw %bx, %bx
js 0x3bb2c
movl %esi, %ecx
movl %edi, %esi
movl 0xe0(%rsp), %edx
leal 0x401(%rdx), %eax
movl %edi, %r14d
subl %eax, %r14d
movl %ecx, %ebp
subl %eax, %ebp
leal (%rdx,%rsi), %r12d
addl $0x401, %r12d           # imm = 0x401
leal 0x401(%rdx,%rcx), %r13d
movswl %bx, %edi
movq %rcx, 0x58(%rsp)
movl %ecx, %edx
movq %r8, 0x50(%rsp)
movq %r8, %rcx
movq %r9, %r8
movq %rsi, 0x30(%rsp)
callq 0x26766
movq %r13, %r10
movl %ebp, %r8d
movq 0x30(%rsp), %r11
leal 0x4000(%rbx), %eax
movzwl %ax, %eax
movq %r15, 0x88(%rsp)
movl %eax, (%r15)
movq 0xd8(%rsp), %rcx
movl %eax, (%rcx)
movw %bx, 0x3f6342(%rip)     # 0x431540
movzwl 0x17d837(%rip), %eax    # 0x1b8a3c
movw %ax, 0x4e(%rsp)
movl $0x400, %edi            # imm = 0x400
leal (%r14,%rdi), %r9d
movl $0xfffffc00, %eax       # imm = 0xFFFFFC00
movq %r12, 0x10(%rsp)
leal (%r12,%rax), %esi
addl %ebp, %edi
addl %r13d, %eax
movl %eax, 0x7c(%rsp)
movw $0x1, %ax
movl %eax, 0x1c(%rsp)
xorl %ecx, %ecx
leaq 0x208825(%rip), %rbx    # 0x243a60
movl %ebp, 0x40(%rsp)
movq %r13, 0x20(%rsp)
movq %rdi, 0x90(%rsp)
movl %r9d, 0x60(%rsp)
leaq 0x3f62e8(%rip), %rax    # 0x431540
movq %rcx, 0x68(%rsp)
movswq (%rax,%rcx,2), %rax
leaq (%rax,%rax,4), %rax
movswl 0x2(%rbx,%rax,8), %r15d
testl %r15d, %r15d
jle 0x3b56f
movswl (%rbx,%rax,8), %ebp
addl %ebp, %r15d
movslq %ebp, %rbx
shlq $0x5, %rbx
leaq 0x17d7c6(%rip), %rax    # 0x1b8a50
addq %rax, %rbx
movq 0x10(%rsp), %rdx
movswl 0xc(%rbx), %r13d
testl %r13d, %r13d
js 0x3b2ee
movl %esi, %r12d
movswq 0x8(%rbx), %rax
shlq $0x5, %rax
movl (%rbx), %esi
leaq 0x17d79f(%rip), %rcx    # 0x1b8a50
movl (%rax,%rcx), %ecx
cmpl %r14d, %esi
jge 0x3b2be
cmpl %r14d, %ecx
jl 0x3b2eb
cmpl %edx, %esi
jle 0x3b2c6
cmpl %edx, %ecx
jg 0x3b2eb
leaq 0x17d783(%rip), %rdi    # 0x1b8a50
addq %rdi, %rax
movl 0x4(%rbx), %r9d
movl 0x4(%rax), %edi
cmpl %r8d, %r9d
jge 0x3b2e1
cmpl %r8d, %edi
jl 0x3b2eb
cmpl %r10d, %r9d
jle 0x3b2fe
cmpl %r10d, %edi
jle 0x3b2fe
movl %r12d, %esi
incl %ebp
addq $0x20, %rbx
cmpl %r15d, %ebp
jl 0x3b292
jmp 0x3b56f
movl %ecx, %edx
subl %esi, %edx
movl %edi, %eax
subl %r9d, %eax
movq 0x58(%rsp), %r8
subl %r9d, %r8d
imull %edx, %r8d
movl %r11d, %r10d
subl %esi, %r10d
imull %eax, %r10d
cmpl %r10d, %r8d
jge 0x3b32c
movl 0x40(%rsp), %r8d
jmp 0x3b55d
testl %edx, %edx
movq 0x20(%rsp), %r8
movl %r8d, %r11d
movl 0x40(%rsp), %r8d
cmovgl %r8d, %r11d
subl %r9d, %r11d
movl %r11d, 0x48(%rsp)
imull %edx, %r11d
testl %eax, %eax
movl %r14d, %r10d
cmovgl 0x10(%rsp), %r10d
subl %esi, %r10d
movl %r10d, 0x70(%rsp)
imull %eax, %r10d
cmpl %r10d, %r11d
jge 0x3b558
movzwl 0xe(%rbx), %r10d
testl %r10d, 0xe8(%rsp)
movq 0x30(%rsp), %r11
jne 0x3b55d
cmpw $0x0, 0x4e(%rsp)
je 0x3b4f9
movswq 0x1c(%rsp), %r8
movq %r8, 0x38(%rsp)
movl %r8d, %r11d
testl %r11d, %r11d
jle 0x3b3ba
leaq -0x1(%r11), %r10
leaq 0x3f6193(%rip), %r8     # 0x431540
cmpw %r13w, -0x2(%r8,%r11,2)
movq %r10, %r11
jne 0x3b39d
jmp 0x3b3d4
movq 0x38(%rsp), %r11
leal 0x1(%r11), %r8d
movl %r8d, 0x1c(%rsp)
leaq 0x3f6171(%rip), %r10    # 0x431540
movw %r13w, (%r10,%r11,2)
movl 0x40(%rsp), %r8d
cmpl 0x60(%rsp), %esi
movq 0x30(%rsp), %r11
movq 0x20(%rsp), %r10
jge 0x3b3f3
cmpl 0x60(%rsp), %ecx
jl 0x3b562
movl %r12d, 0x38(%rsp)
cmpl 0x38(%rsp), %esi
movl 0x38(%rsp), %esi
jle 0x3b40a
cmpl %esi, %ecx
jg 0x3b565
movq 0x90(%rsp), %rcx
cmpl %ecx, %r9d
jge 0x3b41f
cmpl %ecx, %edi
jl 0x3b565
movl 0x7c(%rsp), %ecx
cmpl %ecx, %r9d
jle 0x3b430
cmpl %ecx, %edi
jg 0x3b565
xorl %ecx, %ecx
testl %eax, %eax
setle %cl
xorl %esi, %esi
testl %edx, %edx
setg %sil
shll $0xb, %esi
movl $0xfffffc00, %edi       # imm = 0xFFFFFC00
movl 0x48(%rsp), %r9d
addl %edi, %r9d
addl %esi, %r9d
imull %edx, %r9d
shll $0xb, %ecx
movl 0x70(%rsp), %edx
addl %edi, %edx
addl %ecx, %edx
imull %eax, %edx
cmpl %edx, %r9d
jge 0x3b562
movswl %r13w, %edi
movl %r11d, %esi
movq 0x58(%rsp), %rdx
leaq 0x84(%rsp), %rcx
leaq 0x80(%rsp), %r8
callq 0x26766
movl 0x84(%rsp), %eax
movq 0x50(%rsp), %rcx
cmpl (%rcx), %eax
jle 0x3b4b6
movq 0x50(%rsp), %rcx
movl %eax, (%rcx)
leal 0x4000(%r13), %eax
movq 0x88(%rsp), %rcx
movl %eax, (%rcx)
movl 0x80(%rsp), %eax
movq 0xd0(%rsp), %rcx
cmpl (%rcx), %eax
movl 0x40(%rsp), %r8d
movq 0x20(%rsp), %r10
movl %r12d, %esi
movq 0x10(%rsp), %rdx
jge 0x3b4ef
movl %eax, (%rcx)
addl $0x4000, %r13d          # imm = 0x4000
movq 0xd8(%rsp), %rax
movl %r13d, (%rax)
movq 0x30(%rsp), %r11
jmp 0x3b2ee
movl %r13d, %r10d
leaq (%r10,%r10,4), %r10
leaq 0x208559(%rip), %r11    # 0x243a60
leaq (%r11,%r10,8), %r10
testb $0x1, 0xc(%r10)
jne 0x3b535
movq %r10, 0x38(%rsp)
movq 0x38(%rsp), %r10
movl 0x4(%r10), %r10d
movl $0x300, %r11d           # imm = 0x300
addl %r11d, %r10d
cmpl 0x2c(%rsp), %r10d
movq 0x38(%rsp), %r10
jge 0x3b558
testb $0x1, 0xe(%r10)
jne 0x3b38f
movl 0x8(%r10), %r10d
movl $0xfffffd00, %r11d      # imm = 0xFFFFFD00
addl %r11d, %r10d
cmpl 0x2c(%rsp), %r10d
jg 0x3b38f
movq 0x30(%rsp), %r11
movq 0x20(%rsp), %r10
movl %r12d, %esi
movq 0x10(%rsp), %rdx
jmp 0x3b2ee
movq 0x68(%rsp), %rcx
incq %rcx
movswq 0x1c(%rsp), %rdx
cmpq %rdx, %rcx
leaq 0x2084d9(%rip), %rbx    # 0x243a60
jl 0x3b251
cmpw $0x0, 0x1c(%rsp)
movq 0x50(%rsp), %r13
movl 0xe8(%rsp), %r9d
jle 0x3bb44
shrl $0x10, %r9d
movl 0xe0(%rsp), %eax
movq %rax, %rcx
addl $0x4, %eax
cltq
movq %rax, 0x70(%rsp)
incl %ecx
movq %rcx, 0x68(%rsp)
xorl %ecx, %ecx
leaq 0x2416e2(%rip), %r10    # 0x27ccb0
leaq 0x37af4b(%rip), %r8     # 0x3b6520
movl %r9d, 0x10(%rsp)
movq %rdx, 0x38(%rsp)
leaq 0x3f5f5a(%rip), %rax    # 0x431540
movq %rcx, 0x60(%rsp)
movswq (%rax,%rcx,2), %rax
leaq 0x370f19(%rip), %rcx    # 0x3ac510
movzwl (%rcx,%rax,2), %eax
testw %ax, %ax
js 0x3bb14
movzwl %ax, %ebx
imulq $0x2c, %rbx, %r15
movzwl 0xc(%r15,%r10), %r14d
testl %r14d, %r9d
je 0x3bb0a
addq %r10, %r15
movl (%r15), %edx
movl 0x4(%r15), %ecx
movl %r14d, %eax
shrl $0x4, %eax
andl $0x3, %eax
leaq 0x3b93c(%rip), %rsi     # 0x76f70
movslq (%rsi,%rax,4), %rax
addq %rsi, %rax
jmpq *%rax
movzbl 0x12(%r15), %eax
movq 0x68(%rsp), %rsi
leal (%rsi,%rax,4), %eax
subl %r11d, %edx
movl %edx, %esi
negl %esi
cmovsl %edx, %esi
cmpl %eax, %esi
jg 0x3bb0a
subl 0x58(%rsp), %ecx
movl %ecx, %edx
negl %edx
cmovsl %ecx, %edx
cmpl %eax, %edx
ja 0x3bb0a
movswq 0xe(%r15), %rsi
leaq 0x3c6165(%rip), %rax    # 0x4017e0
movswl (%rax,%rsi,2), %edx
movzbl 0x15(%r15), %eax
imull %eax, %edx
movsbl %r14b, %edi
sarl $0x7, %edi
leal (%rdx,%rdx), %ecx
andl %edi, %ecx
addl 0x8(%r15), %ecx
leaq 0x1ff3c2(%rip), %rdi    # 0x23aa60
movl (%rdi,%rsi,4), %esi
testl $0xff0000, %esi         # imm = 0xFF0000
je 0x3b7d4
shrl $0x10, %esi
movsbl %sil, %esi
imull %esi, %eax
shll $0x2, %eax
subl %eax, %ecx
jmp 0x3b7d4
movswq 0xe(%r15), %r12
leaq 0x1ff393(%rip), %rax    # 0x23aa60
movl (%rax,%r12,4), %ebp
movl %ebp, %eax
shrl $0x8, %eax
movsbl %al, %eax
movsbl 0x16(%r15), %esi
addl %eax, %esi
movl %esi, %eax
negl %eax
testb $0x4, %r14b
cmovel %esi, %eax
movzwl 0x1c(%r15), %esi
movzbl 0x14(%r15), %edi
movl %esi, %r8d
movl $0x7ff, %r9d            # imm = 0x7FF
andl %r9d, %r8d
leaq 0x393648(%rip), %r10    # 0x3ced50
movswq (%r10,%r8,2), %r8
imulq %rdi, %r8
addl $0x600, %esi            # imm = 0x600
andl %r9d, %esi
movswq (%r10,%rsi,2), %r9
imulq %rdi, %r9
leaq 0x3d48f6(%rip), %rsi    # 0x410020
movswq (%rsi,%r12,2), %rsi
movl %esi, %edi
sarl %edi
addl %eax, %edi
movslq %edi, %rax
movq %rax, %rdi
imulq %r8, %rdi
shrq $0x10, %rdi
subl %edi, %edx
imulq %rsi, %r8
shrq $0x10, %r8
addl %edx, %r8d
imulq %r9, %rax
shrq $0x10, %rax
subl %eax, %ecx
imulq %rsi, %r9
shrq $0x10, %r9
addl %ecx, %r9d
movq 0x68(%rsp), %rax
movl %eax, (%rsp)
movl %r11d, %edi
movq 0x58(%rsp), %rsi
callq 0x3671e
leaq 0x37ad9f(%rip), %r8     # 0x3b6520
leaq 0x241528(%rip), %r10    # 0x27ccb0
movl 0x10(%rsp), %r9d
movq 0x30(%rsp), %r11
testl %eax, %eax
je 0x3bb0a
leaq 0x3c603f(%rip), %rax    # 0x4017e0
movswl (%rax,%r12,2), %edx
movzbl 0x15(%r15), %eax
imull %eax, %edx
movsbl %r14b, %esi
sarl $0x7, %esi
leal (%rdx,%rdx), %ecx
andl %esi, %ecx
addl 0x8(%r15), %ecx
testl $0xff0000, %ebp         # imm = 0xFF0000
je 0x3b7d4
shll $0x8, %ebp
sarl $0x16, %ebp
andl $-0x4, %ebp
imull %eax, %ebp
subl %ebp, %ecx
shll $0x2, %edx
movl %ecx, %eax
subl %edx, %eax
jmp 0x3bac5
movl 0x8(%r15), %eax
testb $0x40, %r14b
jne 0x3b7f2
movl %r14d, %edi
andl $0x8, %edi
jmp 0x3b814
cmpl 0x2c(%rsp), %eax
setl %sil
movl %r14d, %edi
andl $0x8, %edi
sete %r8b
cmpb %sil, %r8b
leaq 0x37ad12(%rip), %r8     # 0x3b6520
je 0x3bb0a
movl %eax, 0x1c(%rsp)
movswq 0xe(%r15), %rsi
leaq 0x1ff23c(%rip), %rax    # 0x23aa60
movl (%rax,%rsi,4), %r8d
movl %r8d, %r9d
shrl $0x8, %r9d
movsbl %r9b, %r9d
movsbl 0x16(%r15), %r10d
addl %r9d, %r10d
shrl $0x10, %r8d
movsbl %r8b, %r8d
movsbl 0x17(%r15), %r9d
addl %r8d, %r9d
movl %r10d, %r13d
negl %r13d
testb $0x4, %r14b
cmovel %r10d, %r13d
movl %r9d, %ebp
negl %ebp
testl %edi, %edi
cmovel %r9d, %ebp
movq %r11, %rax
movswq 0x1c(%r15), %r11
leal 0x200(%r11), %edi
movl $0x7ff, %r8d            # imm = 0x7FF
andl %r8d, %edi
leaq 0x3934cd(%rip), %r8     # 0x3ced50
movswq (%r8,%rdi,2), %r9
movswq (%r8,%r11,2), %r14
leaq 0x3d478c(%rip), %rdi    # 0x410020
movswq (%rdi,%rsi,2), %r12
movzbl 0x14(%r15), %r8d
leaq 0x3c5f3b(%rip), %rdi    # 0x4017e0
movswq (%rdi,%rsi,2), %rdi
movzbl 0x15(%r15), %r10d
movl %r12d, %esi
sarl %esi
addl %r13d, %esi
movslq %esi, %r15
imulq %r8, %r15
movq %rdi, 0x40(%rsp)
movl %edi, %esi
sarl %esi
addl %ebp, %esi
movslq %esi, %rsi
imulq %r10, %rsi
movq %r15, %r13
imulq %r14, %r13
movq %rsi, %rdi
imulq %r9, %rdi
addq %r13, %rdi
shrq $0x10, %rdi
subl %eax, %edi
addl %edx, %edi
imulq %r14, %rsi
imulq %r9, %r15
subq %r15, %rsi
shrq $0x10, %rsi
subl 0x58(%rsp), %esi
addl %ecx, %esi
imulq %r12, %r8
movq %r8, %rcx
imulq %r14, %rcx
shrq $0x10, %rcx
movl %edi, %edx
subl %ecx, %edx
imulq %r9, %r8
shrq $0x10, %r8
addl %esi, %r8d
leal 0x100(%r11), %ecx
movl $0x7ff, %ebp            # imm = 0x7FF
andl %ebp, %ecx
leaq 0x39341f(%rip), %r15    # 0x3ced50
movswq (%r15,%rcx,2), %r13
movq 0x70(%rsp), %rax
imulq %rax, %r13
shrq $0xe, %r13
leal 0x700(%r11), %ecx
andl %ebp, %ecx
movswq (%r15,%rcx,2), %r12
imulq %rax, %r12
shrq $0xe, %r12
movl %edx, %ebp
subl %r12d, %ebp
leal (%rsi,%r12), %eax
leal (%r8,%r13), %r11d
movl %r11d, %r15d
movl %eax, 0x20(%rsp)
xorl %eax, %r15d
leal (%rdi,%r13), %eax
movl %eax, 0x48(%rsp)
js 0x3b97f
xorl %r15d, %r15d
jmp 0x3b9af
movl %ebp, %r15d
xorl %eax, %r15d
js 0x3b98f
testl %eax, %eax
setns %r15b
jmp 0x3b9af
movl %r11d, %r15d
imull %eax, %r15d
movl %ebp, %ecx
movl 0x20(%rsp), %eax
imull %eax, %ecx
cmpl %ecx, %r15d
setl %cl
cmpl %r11d, %eax
setl %r15b
xorb %cl, %r15b
movl 0x1c(%rsp), %eax
imulq 0x40(%rsp), %r10
imulq %r10, %r9
shrq $0x10, %r9
imulq %r14, %r10
shrq $0x10, %r10
subl %r9d, %edx
subl %r13d, %edx
subl %r10d, %r8d
subl %r12d, %r8d
movl %r11d, %ecx
xorl %r8d, %ecx
jns 0x3ba0f
movl %ebp, %ecx
xorl %edx, %ecx
js 0x3b9f0
testl %ebp, %ebp
setns %cl
xorb %r15b, %cl
movl %ecx, %r15d
jmp 0x3ba0f
imull %r8d, %ebp
movl %edx, %ecx
imull %r11d, %ecx
cmpl %ecx, %ebp
setl %cl
cmpl %r8d, %r11d
setl %r11b
xorb %r15b, %r11b
xorb %cl, %r11b
movl %r11d, %r15d
subl %r9d, %edi
addl %r12d, %edi
addl %r13d, %r10d
subl %r10d, %esi
movl %r8d, %ecx
xorl %esi, %ecx
movq 0x30(%rsp), %r11
js 0x3ba3a
movq 0x50(%rsp), %r13
movl 0x10(%rsp), %r9d
leaq 0x241278(%rip), %r10    # 0x27ccb0
jmp 0x3ba7a
movl %edx, %ecx
xorl %edi, %ecx
movq 0x50(%rsp), %r13
movl 0x10(%rsp), %r9d
leaq 0x241261(%rip), %r10    # 0x27ccb0
js 0x3ba5e
testl %edx, %edx
setns %cl
xorb %r15b, %cl
movl %ecx, %r15d
jmp 0x3ba7a
imull %esi, %edx
movl %edi, %ecx
imull %r8d, %ecx
cmpl %ecx, %edx
setl %cl
cmpl %esi, %r8d
setl %dl
xorb %r15b, %dl
xorb %cl, %dl
movl %edx, %r15d
movl %esi, %ecx
movl 0x20(%rsp), %edx
xorl %edx, %ecx
leaq 0x37aa97(%rip), %r8     # 0x3b6520
js 0x3ba94
movl %eax, %ecx
testb %r15b, %r15b
jne 0x3bac5
jmp 0x3bb0a
movl %edi, %ecx
movl 0x48(%rsp), %ebp
xorl %ebp, %ecx
js 0x3baac
testl %edi, %edi
setns %cl
xorb %r15b, %cl
movl %eax, %ecx
jne 0x3bac5
jmp 0x3bb0a
imull %edx, %edi
imull %esi, %ebp
cmpl %ebp, %edi
setl %cl
cmpl %edx, %esi
setl %dl
xorb %cl, %dl
movl %eax, %ecx
cmpb %r15b, %dl
je 0x3bb0a
cmpl 0x2c(%rsp), %ecx
jge 0x3bae5
cmpl (%r13), %ecx
jle 0x3bae5
movl %ecx, (%r13)
leal 0xc000(%rbx), %ecx
movq 0x88(%rsp), %rdx
movl %ecx, (%rdx)
cmpl 0x2c(%rsp), %eax
jle 0x3bb0a
movq 0xd0(%rsp), %rcx
cmpl (%rcx), %eax
jge 0x3bb0a
movl %eax, (%rcx)
movl %ebx, %eax
addl $0xc000, %eax           # imm = 0xC000
movq 0xd8(%rsp), %rcx
movl %eax, (%rcx)
movzwl (%r8,%rbx,2), %eax
jmp 0x3b5fb
movq 0x60(%rsp), %rcx
incq %rcx
movq 0x38(%rsp), %rdx
cmpq %rdx, %rcx
jne 0x3b5df
jmp 0x3bb44
movl $0x80000000, (%r8)      # imm = 0x80000000
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
movl %eax, (%r15)
movl $0x7fffffff, (%r9)      # imm = 0x7FFFFFFF
movl %eax, (%rdx)
addq $0x98, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq