// File: /workspace/github_c_makefile_star2_O2/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, %r12d
movl %edx, 0x30(%rsp)
movq 0xd8(%rsp), %rax
movq 0xd0(%rsp), %r9
testw %r12w, %r12w
js 0x380f0
movl %esi, %ecx
movl %edi, %esi
movl 0xe0(%rsp), %edx
leal 0x401(%rdx), %eax
movl %edi, %ebx
subl %eax, %ebx
movl %ecx, %ebp
subl %eax, %ebp
leal (%rdx,%rsi), %r14d
addl $0x401, %r14d           # imm = 0x401
leal 0x401(%rdx,%rcx), %r13d
movswl %r12w, %edi
movq %rcx, 0x40(%rsp)
movl %ecx, %edx
movq %r8, 0x58(%rsp)
movq %r8, %rcx
movq %r9, %r8
movq %rsi, 0x28(%rsp)
callq 0x2373c
movq %r13, %rdx
movl %ebp, %r8d
movq 0x28(%rsp), %r11
leal 0x4000(%r12), %eax
movzwl %ax, %eax
movq %r15, 0x90(%rsp)
movl %eax, (%r15)
movq 0xd8(%rsp), %rcx
movl %eax, (%rcx)
movw %r12w, 0x3f2d72(%rip)   # 0x42a540
movzwl 0x17a267(%rip), %eax    # 0x1b1a3c
movw %ax, 0x68(%rsp)
movl $0x400, %r10d           # imm = 0x400
leal (%rbx,%r10), %edi
movl $0xfffffc00, %eax       # imm = 0xFFFFFC00
leal (%r14,%rax), %r9d
addl %ebp, %r10d
addl %r13d, %eax
movl %eax, 0x7c(%rsp)
movw $0x1, %ax
movl %eax, 0x24(%rsp)
xorl %ecx, %ecx
movl %ebp, 0x14(%rsp)
movq %r13, 0x18(%rsp)
movq %r10, 0x88(%rsp)
movl %edi, 0x50(%rsp)
movl %r9d, 0x4c(%rsp)
leaq 0x3f2d1e(%rip), %rax    # 0x42a540
movq %rcx, 0x60(%rsp)
movswq (%rax,%rcx,2), %rax
imulq $0x28, %rax, %rax
leaq 0x205229(%rip), %rcx    # 0x23ca60
movswq (%rax,%rcx), %r12
movswl 0x2(%rax,%rcx), %ebp
addl %r12d, %ebp
movq %r12, %r13
shlq $0x5, %r13
leaq 0x17a1fe(%rip), %rax    # 0x1b1a50
addq %rax, %r13
cmpl %ebp, %r12d
jge 0x37b1d
movswl 0xc(%r13), %r15d
testl %r15d, %r15d
js 0x37b11
movswq 0x8(%r13), %rax
shlq $0x5, %rax
movl (%r13), %esi
leaq 0x17a1d0(%rip), %rcx    # 0x1b1a50
movl (%rax,%rcx), %ecx
cmpl %ebx, %esi
jge 0x3788f
cmpl %ebx, %ecx
jl 0x37b11
cmpl %r14d, %esi
jle 0x3789d
cmpl %r14d, %ecx
jg 0x37b11
leaq 0x17a1ac(%rip), %rdi    # 0x1b1a50
addq %rdi, %rax
movl 0x4(%r13), %r9d
movl 0x4(%rax), %edi
cmpl %r8d, %r9d
jge 0x378bc
cmpl %r8d, %edi
jl 0x37b11
cmpl %edx, %r9d
jle 0x378c9
cmpl %edx, %edi
jg 0x37b11
movl %ecx, %edx
subl %esi, %edx
movl %edi, %eax
subl %r9d, %eax
movq 0x40(%rsp), %r8
subl %r9d, %r8d
imull %edx, %r8d
movl %r11d, %r10d
subl %esi, %r10d
imull %eax, %r10d
cmpl %r10d, %r8d
jge 0x378f7
movl 0x14(%rsp), %r8d
jmp 0x37b0c
testl %edx, %edx
movq 0x18(%rsp), %r8
movl %r8d, %r11d
movl 0x14(%rsp), %r8d
cmovgl %r8d, %r11d
subl %r9d, %r11d
movl %r11d, 0x70(%rsp)
imull %edx, %r11d
testl %eax, %eax
movl %ebx, %r10d
cmovgl %r14d, %r10d
subl %esi, %r10d
movl %r10d, 0x34(%rsp)
imull %eax, %r10d
cmpl %r10d, %r11d
jge 0x37b07
movzwl 0xe(%r13), %r10d
testl %r10d, 0xe8(%rsp)
movq 0x28(%rsp), %r11
jne 0x37b0c
cmpw $0x0, 0x68(%rsp)
je 0x37aae
movswq 0x24(%rsp), %r8
movq %r8, 0x38(%rsp)
movl %r8d, %r11d
testl %r11d, %r11d
jle 0x37983
leaq -0x1(%r11), %r10
leaq 0x3f2bca(%rip), %r8     # 0x42a540
cmpw %r15w, -0x2(%r8,%r11,2)
movq %r10, %r11
jne 0x37966
jmp 0x3799d
movq 0x38(%rsp), %r11
leal 0x1(%r11), %r8d
movl %r8d, 0x24(%rsp)
leaq 0x3f2ba8(%rip), %r10    # 0x42a540
movw %r15w, (%r10,%r11,2)
movl 0x14(%rsp), %r8d
movq 0x88(%rsp), %r10
cmpl 0x50(%rsp), %esi
movq 0x28(%rsp), %r11
jge 0x379bf
cmpl 0x50(%rsp), %ecx
jl 0x37b0c
cmpl 0x4c(%rsp), %esi
movl 0x4c(%rsp), %esi
jle 0x379d1
cmpl %esi, %ecx
jg 0x37b0c
cmpl %r10d, %r9d
jge 0x379df
cmpl %r10d, %edi
jl 0x37b0c
movl 0x7c(%rsp), %ecx
cmpl %ecx, %r9d
jle 0x379f0
cmpl %ecx, %edi
jg 0x37b0c
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 0x70(%rsp), %r9d
addl %edi, %r9d
addl %esi, %r9d
imull %edx, %r9d
shll $0xb, %ecx
movl 0x34(%rsp), %edx
addl %edi, %edx
addl %ecx, %edx
imull %eax, %edx
cmpl %edx, %r9d
jge 0x37b0c
movswl %r15w, %edi
movl %r11d, %esi
movq 0x40(%rsp), %rdx
leaq 0x84(%rsp), %rcx
leaq 0x80(%rsp), %r8
callq 0x2373c
movl 0x84(%rsp), %eax
movq 0x58(%rsp), %rcx
cmpl (%rcx), %eax
jle 0x37a76
movq 0x58(%rsp), %rcx
movl %eax, (%rcx)
leal 0x4000(%r15), %eax
movq 0x90(%rsp), %rcx
movl %eax, (%rcx)
movl 0x80(%rsp), %eax
movq 0xd0(%rsp), %rcx
cmpl (%rcx), %eax
movl 0x14(%rsp), %r8d
movq 0x18(%rsp), %rdx
jge 0x37aa7
movl %eax, (%rcx)
addl $0x4000, %r15d          # imm = 0x4000
movq 0xd8(%rsp), %rax
movl %r15d, (%rax)
movq 0x28(%rsp), %r11
jmp 0x37b11
movl %r15d, %r10d
imulq $0x28, %r10, %r11
leaq 0x204fa4(%rip), %r10    # 0x23ca60
addq %r10, %r11
testb $0x1, 0xc(%r11)
jne 0x37ae4
movl 0x4(%r11), %r10d
movq %r11, 0x38(%rsp)
movl $0x300, %r11d           # imm = 0x300
addl %r11d, %r10d
movq 0x38(%rsp), %r11
cmpl 0x30(%rsp), %r10d
jge 0x37b07
testb $0x1, 0xe(%r11)
jne 0x37958
movl 0x8(%r11), %r10d
movl $0xfffffd00, %r11d      # imm = 0xFFFFFD00
addl %r11d, %r10d
cmpl 0x30(%rsp), %r10d
jg 0x37958
movq 0x28(%rsp), %r11
movq 0x18(%rsp), %rdx
incl %r12d
addq $0x20, %r13
jmp 0x37855
movq 0x60(%rsp), %rcx
incq %rcx
movswq 0x24(%rsp), %rax
cmpq %rax, %rcx
jl 0x3781b
movl 0xe8(%rsp), %r9d
shrl $0x10, %r9d
movl 0xe0(%rsp), %eax
movq %rax, %rcx
addl $0x4, %eax
cltq
movq %rax, 0x50(%rsp)
incl %ecx
movq %rcx, 0x60(%rsp)
xorl %ecx, %ecx
movl 0x24(%rsp), %edx
testw %dx, %dx
movl $0x0, %eax
cmovgl %edx, %eax
movzwl %ax, %eax
movq %rax, 0x38(%rsp)
leaq 0x23e135(%rip), %r10    # 0x275cb0
leaq 0x37799e(%rip), %r8     # 0x3af520
movl %r9d, 0x18(%rsp)
cmpq 0x38(%rsp), %rcx
je 0x38105
leaq 0x3f29a7(%rip), %rax    # 0x42a540
movq %rcx, 0x68(%rsp)
movswq (%rax,%rcx,2), %rax
leaq 0x36d966(%rip), %rcx    # 0x3a5510
leaq (%rcx,%rax,2), %rax
movswl (%rax), %ebp
testl %ebp, %ebp
js 0x380e3
movl %ebp, %r13d
imulq $0x2c, %r13, %r12
movzwl 0xc(%r12,%r10), %r14d
testl %r14d, %r9d
je 0x380da
addq %r10, %r12
movl (%r12), %edx
movl 0x4(%r12), %ecx
movl %r14d, %eax
shrl $0x4, %eax
andl $0x3, %eax
leaq 0x34311(%rip), %rsi     # 0x6befc
movslq (%rsi,%rax,4), %rax
addq %rsi, %rax
jmpq *%rax
movzbl 0x12(%r12), %eax
movq 0x60(%rsp), %rsi
leal (%rsi,%rax,4), %eax
subl %r11d, %edx
movl %edx, %esi
negl %esi
cmovsl %edx, %esi
cmpl %eax, %esi
jg 0x380da
subl 0x40(%rsp), %ecx
movl %ecx, %edx
negl %edx
cmovsl %ecx, %edx
cmpl %eax, %edx
ja 0x380da
movswq 0xe(%r12), %rsi
leaq 0x3c2bac(%rip), %rax    # 0x3fa7e0
movswl (%rax,%rsi,2), %edx
movzbl 0x15(%r12), %eax
imull %eax, %edx
movsbl %r14b, %edi
sarl $0x7, %edi
leal (%rdx,%rdx), %ecx
andl %edi, %ecx
addl 0x8(%r12), %ecx
leaq 0x1fbe07(%rip), %rdi    # 0x233a60
movl (%rdi,%rsi,4), %esi
testl $0xff0000, %esi         # imm = 0xFF0000
je 0x37d95
shrl $0x10, %esi
movsbl %sil, %esi
imull %esi, %eax
shll $0x2, %eax
subl %eax, %ecx
jmp 0x37d95
movswq 0xe(%r12), %r15
leaq 0x1fbdd7(%rip), %rax    # 0x233a60
movl (%rax,%r15,4), %ebx
movl %ebx, %eax
shrl $0x8, %eax
movsbl %al, %eax
movsbl 0x16(%r12), %esi
addl %eax, %esi
movl %esi, %eax
negl %eax
testb $0x4, %r14b
cmovel %esi, %eax
movzwl 0x1c(%r12), %esi
movzbl 0x14(%r12), %edi
movl %esi, %r8d
movl $0x7ff, %r9d            # imm = 0x7FF
andl %r9d, %r8d
leaq 0x390089(%rip), %r10    # 0x3c7d50
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 0x3d1337(%rip), %rsi    # 0x409020
movswq (%rsi,%r15,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 0x60(%rsp), %rax
movl %eax, (%rsp)
movl %r11d, %edi
movq 0x40(%rsp), %rsi
callq 0x32fef
leaq 0x3777e0(%rip), %r8     # 0x3af520
leaq 0x23df69(%rip), %r10    # 0x275cb0
movl 0x18(%rsp), %r9d
movq 0x28(%rsp), %r11
testl %eax, %eax
je 0x380da
leaq 0x3c2a80(%rip), %rax    # 0x3fa7e0
movswl (%rax,%r15,2), %edx
movzbl 0x15(%r12), %eax
imull %eax, %edx
movsbl %r14b, %esi
sarl $0x7, %esi
leal (%rdx,%rdx), %ecx
andl %esi, %ecx
addl 0x8(%r12), %ecx
testl $0xff0000, %ebx         # imm = 0xFF0000
je 0x37d95
shll $0x8, %ebx
sarl $0x16, %ebx
andl $-0x4, %ebx
imull %eax, %ebx
subl %ebx, %ecx
shll $0x2, %edx
movl %ecx, %ebx
subl %edx, %ebx
jmp 0x38090
movl 0x8(%r12), %eax
testb $0x40, %r14b
jne 0x37db4
movl %r14d, %edi
andl $0x8, %edi
jmp 0x37dd6
cmpl 0x30(%rsp), %eax
setl %sil
movl %r14d, %edi
andl $0x8, %edi
sete %r8b
cmpb %sil, %r8b
leaq 0x377750(%rip), %r8     # 0x3af520
je 0x380da
movl %eax, 0x24(%rsp)
movswq 0xe(%r12), %rsi
leaq 0x1fbc79(%rip), %rax    # 0x233a60
movl (%rax,%rsi,4), %r8d
movl %r8d, %r9d
shrl $0x8, %r9d
movsbl %r9b, %r9d
movsbl 0x16(%r12), %r10d
addl %r9d, %r10d
shrl $0x10, %r8d
movsbl %r8b, %r8d
movsbl 0x17(%r12), %r9d
addl %r8d, %r9d
movl %r10d, %eax
negl %eax
testb $0x4, %r14b
cmovel %r10d, %eax
movl %r9d, %r15d
negl %r15d
testl %edi, %edi
cmovel %r9d, %r15d
movswq 0x1c(%r12), %r11
leal 0x200(%r11), %edi
movl $0x7ff, %r8d            # imm = 0x7FF
andl %r8d, %edi
leaq 0x38ff0a(%rip), %r8     # 0x3c7d50
movswq (%r8,%rdi,2), %r9
movswq (%r8,%r11,2), %r14
leaq 0x3d11c9(%rip), %rdi    # 0x409020
movswq (%rdi,%rsi,2), %rbx
movzbl 0x14(%r12), %r8d
leaq 0x3c2977(%rip), %rdi    # 0x3fa7e0
movswq (%rdi,%rsi,2), %rdi
movzbl 0x15(%r12), %r10d
movl %ebx, %esi
sarl %esi
addl %eax, %esi
movslq %esi, %rax
imulq %r8, %rax
movq %rdi, 0x70(%rsp)
movl %edi, %esi
sarl %esi
addl %r15d, %esi
movslq %esi, %rsi
imulq %r10, %rsi
movq %rax, %r15
imulq %r14, %r15
movq %rsi, %rdi
imulq %r9, %rdi
addq %r15, %rdi
shrq $0x10, %rdi
subl 0x28(%rsp), %edi
addl %edx, %edi
imulq %r14, %rsi
imulq %r9, %rax
subq %rax, %rsi
shrq $0x10, %rsi
subl 0x40(%rsp), %esi
addl %ecx, %esi
imulq %rbx, %r8
movq %r8, %rax
imulq %r14, %rax
shrq $0x10, %rax
movl %edi, %r15d
subl %eax, %r15d
imulq %r9, %r8
shrq $0x10, %r8
addl %esi, %r8d
leal 0x100(%r11), %eax
movl $0x7ff, %edx            # imm = 0x7FF
andl %edx, %eax
leaq 0x38fe57(%rip), %r12    # 0x3c7d50
movswq (%r12,%rax,2), %rbx
movq 0x50(%rsp), %rcx
imulq %rcx, %rbx
shrq $0xe, %rbx
leal 0x700(%r11), %eax
andl %edx, %eax
movswq (%r12,%rax,2), %r11
imulq %rcx, %r11
shrq $0xe, %r11
movl %r15d, %ecx
subl %r11d, %ecx
leal (%rsi,%r11), %r12d
leal (%r8,%rbx), %edx
movl %edx, %eax
movl %r12d, 0x14(%rsp)
xorl %r12d, %eax
leal (%rdi,%rbx), %r12d
movl %r12d, 0x34(%rsp)
js 0x37f49
xorl %r12d, %r12d
jmp 0x37f79
movl %ecx, %eax
xorl %r12d, %eax
js 0x37f59
testl %r12d, %r12d
setns %r12b
jmp 0x37f79
movl %edx, %eax
imull %r12d, %eax
movl %ecx, %r12d
imull 0x14(%rsp), %r12d
cmpl %r12d, %eax
setl %al
cmpl %edx, 0x14(%rsp)
setl %r12b
xorb %al, %r12b
imulq 0x70(%rsp), %r10
imulq %r10, %r9
shrq $0x10, %r9
imulq %r14, %r10
shrq $0x10, %r10
subl %r9d, %r15d
subl %ebx, %r15d
subl %r10d, %r8d
subl %r11d, %r8d
movl %edx, %eax
xorl %r8d, %eax
jns 0x37fd3
movl %ecx, %eax
xorl %r15d, %eax
js 0x37fb6
testl %ecx, %ecx
setns %al
xorb %r12b, %al
movl %eax, %r12d
jmp 0x37fd3
imull %r8d, %ecx
movl %r15d, %eax
imull %edx, %eax
cmpl %eax, %ecx
setl %al
cmpl %r8d, %edx
setl %cl
xorb %r12b, %cl
xorb %al, %cl
movl %ecx, %r12d
subl %r9d, %edi
addl %r11d, %edi
addl %ebx, %r10d
subl %r10d, %esi
movl %r8d, %eax
xorl %esi, %eax
movl 0x14(%rsp), %edx
js 0x38001
movq 0x28(%rsp), %r11
movl 0x18(%rsp), %r9d
leaq 0x23dcb5(%rip), %r10    # 0x275cb0
movl 0x24(%rsp), %ebx
jmp 0x38049
movl %r15d, %eax
xorl %edi, %eax
movq 0x28(%rsp), %r11
movl 0x18(%rsp), %r9d
leaq 0x23dc99(%rip), %r10    # 0x275cb0
movl 0x24(%rsp), %ebx
js 0x3802b
testl %r15d, %r15d
setns %al
xorb %r12b, %al
movl %eax, %r12d
jmp 0x38049
imull %esi, %r15d
movl %edi, %eax
imull %r8d, %eax
cmpl %eax, %r15d
setl %al
cmpl %esi, %r8d
setl %cl
xorb %r12b, %cl
xorb %al, %cl
movl %ecx, %r12d
movl %esi, %eax
xorl %edx, %eax
leaq 0x3774cc(%rip), %r8     # 0x3af520
js 0x3805f
movl %ebx, %ecx
testb %r12b, %r12b
jne 0x38090
jmp 0x380da
movl %edi, %eax
movl 0x34(%rsp), %ecx
xorl %ecx, %eax
js 0x38077
testl %edi, %edi
setns %al
xorb %r12b, %al
movl %ebx, %ecx
jne 0x38090
jmp 0x380da
imull %edx, %edi
imull %esi, %ecx
cmpl %ecx, %edi
setl %al
cmpl %edx, %esi
setl %dl
xorb %al, %dl
movl %ebx, %ecx
cmpb %r12b, %dl
je 0x380da
cmpl 0x30(%rsp), %ecx
jge 0x380b6
movq 0x58(%rsp), %rax
cmpl (%rax), %ecx
jle 0x380b6
movq 0x58(%rsp), %rax
movl %ecx, (%rax)
leal 0xc000(%rbp), %eax
movq 0x90(%rsp), %rcx
movl %eax, (%rcx)
cmpl 0x30(%rsp), %ebx
jle 0x380da
movq 0xd0(%rsp), %rax
cmpl (%rax), %ebx
jge 0x380da
movl %ebx, (%rax)
addl $0xc000, %ebp           # imm = 0xC000
movq 0xd8(%rsp), %rax
movl %ebp, (%rax)
leaq (%r8,%r13,2), %rax
jmp 0x37bae
movq 0x68(%rsp), %rcx
incq %rcx
jmp 0x37b87
movl $0x80000000, (%r8)      # imm = 0x80000000
orl $-0x1, (%r15)
movl $0x7fffffff, (%r9)      # imm = 0x7FFFFFFF
orl $-0x1, (%rax)
addq $0x98, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq