// File: /workspace/github_c_makefile_star2_O1/jonof[P]jftekwar/jfbuild/src/engine.c
// Function: drawmasks
void drawmasks(void)
{
	int i, j, k, l, gap, xs, ys, xp, yp, yoff, yspan;

	for(i=spritesortcnt-1;i>=0;i--) tspriteptr[i] = &tsprite[i];
	for(i=spritesortcnt-1;i>=0;i--)
	{
		xs = tspriteptr[i]->x-globalposx; ys = tspriteptr[i]->y-globalposy;
		yp = dmulscale6(xs,cosviewingrangeglobalang,ys,sinviewingrangeglobalang);
		if (yp > (4<<8))
		{
			xp = dmulscale6(ys,cosglobalang,-xs,singlobalang);
			if (mulscale24(abs(xp+yp),xdimen) >= yp) goto killsprite;
			spritesx[i] = scale(xp+yp,xdimen<<7,yp);
		}
		else if ((tspriteptr[i]->cstat&48) == 0)
		{
killsprite:
			spritesortcnt--;  //Delete face sprite if on wrong side!
			if (i != spritesortcnt)
			{
				tspriteptr[i] = tspriteptr[spritesortcnt];
				spritesx[i] = spritesx[spritesortcnt];
				spritesy[i] = spritesy[spritesortcnt];
			}
			continue;
		}
		spritesy[i] = yp;
	}

	gap = 1; while (gap < spritesortcnt) gap = (gap<<1)+1;
	for(gap>>=1;gap>0;gap>>=1)      //Sort sprite list
		for(i=0;i<spritesortcnt-gap;i++)
			for(l=i;l>=0;l-=gap)
			{
				if (spritesy[l] <= spritesy[l+gap]) break;
				swaplong(&tspriteptr[l],&tspriteptr[l+gap]);
				swaplong(&spritesx[l],&spritesx[l+gap]);
				swaplong(&spritesy[l],&spritesy[l+gap]);
			}

	if (spritesortcnt > 0)
		spritesy[spritesortcnt] = (spritesy[spritesortcnt-1]^1);

	ys = spritesy[0]; i = 0;
	for(j=1;j<=spritesortcnt;j++)
	{
		if (spritesy[j] == ys) continue;
		ys = spritesy[j];
		if (j > i+1)
		{
			for(k=i;k<j;k++)
			{
				spritesz[k] = tspriteptr[k]->z;
				if ((tspriteptr[k]->cstat&48) != 32)
				{
					yoff = (int)((signed char)((picanm[tspriteptr[k]->picnum]>>16)&255))+((int)tspriteptr[k]->yoffset);
					spritesz[k] -= ((yoff*tspriteptr[k]->yrepeat)<<2);
					yspan = (tilesizy[tspriteptr[k]->picnum]*tspriteptr[k]->yrepeat<<2);
					if (!(tspriteptr[k]->cstat&128)) spritesz[k] -= (yspan>>1);
					if (klabs(spritesz[k]-globalposz) < (yspan>>1)) spritesz[k] = globalposz;
				}
			}
			for(k=i+1;k<j;k++)
				for(l=i;l<k;l++)
					if (klabs(spritesz[k]-globalposz) < klabs(spritesz[l]-globalposz))
					{
						swaplong(&tspriteptr[k],&tspriteptr[l]);
						swaplong(&spritesx[k],&spritesx[l]);
						swaplong(&spritesy[k],&spritesy[l]);
						swaplong(&spritesz[k],&spritesz[l]);
					}
			for(k=i+1;k<j;k++)
				for(l=i;l<k;l++)
					if (tspriteptr[k]->statnum < tspriteptr[l]->statnum)
					{
						swaplong(&tspriteptr[k],&tspriteptr[l]);
						swaplong(&spritesx[k],&spritesx[l]);
						swaplong(&spritesy[k],&spritesy[l]);
					}
		}
		i = j;
	}

	/*for(i=spritesortcnt-1;i>=0;i--)
	{
		xs = tspriteptr[i].x-globalposx;
		ys = tspriteptr[i].y-globalposy;
		zs = tspriteptr[i].z-globalposz;

		xp = ys*cosglobalang-xs*singlobalang;
		yp = (zs<<1);
		zp = xs*cosglobalang+ys*singlobalang;

		xs = scale(xp,halfxdimen<<12,zp)+((halfxdimen+windowx1)<<12);
		ys = scale(yp,xdimenscale<<12,zp)+((globalhoriz+windowy1)<<12);

		drawline256(xs-65536,ys-65536,xs+65536,ys+65536,31);
		drawline256(xs+65536,ys-65536,xs-65536,ys+65536,31);
	}*/

#if USE_POLYMOST
		//Hack to make it draw all opaque quads first. This should reduce the chances of
		//bad sorting causing transparent quads knocking out opaque quads behind it.
		//
		//Need to store alpha flag with all textures before this works right!
	if (rendmode > 0)
	{
		for(i=spritesortcnt-1;i>=0;i--)
			if ((!(tspriteptr[i]->cstat&2))
#if USE_OPENGL
			    && (!polymost_texmayhavealpha(tspriteptr[i]->picnum,tspriteptr[i]->pal))
#endif
			   )
				{ drawsprite(i); tspriteptr[i] = 0; } //draw only if it is fully opaque
		for(i=j=0;i<spritesortcnt;i++)
		{
			if (!tspriteptr[i]) continue;
			tspriteptr[j] = tspriteptr[i];
			spritesx[j] = spritesx[i];
			spritesy[j] = spritesy[i]; j++;
		}
		spritesortcnt = j;


		for(i=maskwallcnt-1;i>=0;i--)
		{
			k = thewall[maskwall[i]];
			if ((!(wall[k].cstat&128))
#if USE_OPENGL
			    && (!polymost_texmayhavealpha(wall[k].overpicnum,wall[k].pal))
#endif
			   )
				{ drawmaskwall(i); maskwall[i] = -1; } //draw only if it is fully opaque
		}
		for(i=j=0;i<maskwallcnt;i++)
		{
			if (maskwall[i] < 0) continue;
			maskwall[j++] = maskwall[i];
		}
		maskwallcnt = j;
	}
#endif

	while ((spritesortcnt > 0) && (maskwallcnt > 0))  //While BOTH > 0
	{
		j = maskwall[maskwallcnt-1];
		if (spritewallfront(tspriteptr[spritesortcnt-1],(int)thewall[j]) == 0)
			drawsprite(--spritesortcnt);
		else
		{
				//Check to see if any sprites behind the masked wall...
			k = -1;
			gap = 0;
			for(i=spritesortcnt-2;i>=0;i--)
			{
#if USE_POLYMOST
				if (rendmode > 0)
					l = dxb1[j] <= (double)spritesx[i]/256.0 && (double)spritesx[i]/256.0 <= dxb2[j];
				else
#endif
					l = xb1[j] <= (spritesx[i]>>8) && (spritesx[i]>>8) <= xb2[j];
				if (l && spritewallfront(tspriteptr[i],(int)thewall[j]) == 0)
				{
					drawsprite(i);
					tspriteptr[i]->owner = -1;
					k = i;
					gap++;
				}
			}
			if (k >= 0)       //remove holes in sprite list
			{
				for(i=k;i<spritesortcnt;i++)
					if (tspriteptr[i]->owner >= 0)
					{
						if (i > k)
						{
							tspriteptr[k] = tspriteptr[i];
							spritesx[k] = spritesx[i];
							spritesy[k] = spritesy[i];
						}
						k++;
					}
				spritesortcnt -= gap;
			}

				//finally safe to draw the masked wall
			drawmaskwall(--maskwallcnt);
		}
	}
	while (spritesortcnt > 0) drawsprite(--spritesortcnt);
	while (maskwallcnt > 0) drawmaskwall(--maskwallcnt);
}

// Assembly:
movslq 0x3ad53f(%rip), %rcx    # 0x3d67a4
testq %rcx, %rcx
jle 0x29299
leaq 0x1(%rcx), %rax
imulq $0x2c, %rcx, %rdx
leaq 0x3b7557(%rip), %rsi    # 0x3e07d0
addq %rsi, %rdx
addq $-0x2c, %rdx
leaq 0x3cd549(%rip), %rsi    # 0x3f67d0
movq %rdx, -0x10(%rsi,%rax,8)
decq %rax
addq $-0x2c, %rdx
cmpq $0x1, %rax
jg 0x29287
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x48, %rsp
testl %ecx, %ecx
jle 0x293e5
movl 0x3ad4ef(%rip), %ebp    # 0x3d67a4
movslq 0x210794(%rip), %rsi    # 0x239a50
movslq 0x210791(%rip), %rdi    # 0x239a54
movslq 0x2457b2(%rip), %r11    # 0x26ea7c
movslq 0x2457a3(%rip), %r12    # 0x26ea74
movslq 0x245798(%rip), %rax    # 0x26ea70
movq %rax, 0x8(%rsp)
movslq 0x245794(%rip), %rax    # 0x26ea78
movq %rax, 0x18(%rsp)
movslq 0x7a540(%rip), %rbx     # 0xa3830
movl %ebx, %eax
shll $0x7, %eax
cltq
movq %rax, 0x10(%rsp)
incq %rcx
leaq 0x3cd4ca(%rip), %r15    # 0x3f67d0
leaq 0x3d34c3(%rip), %r13    # 0x3fc7d0
leaq -0x1(%rcx), %r14
movq -0x10(%r15,%rcx,8), %r10
movslq (%r10), %rdx
subq %rsi, %rdx
movslq 0x4(%r10), %rax
subq %rdi, %rax
movq %r11, %r8
imulq %rdx, %r8
movq %r12, %r9
imulq %rax, %r9
addq %r8, %r9
shrq $0x6, %r9
cmpl $0x401, %r9d            # imm = 0x401
jl 0x29395
negl %edx
imulq 0x8(%rsp), %rax
movslq %edx, %rdx
imulq 0x18(%rsp), %rdx
addq %rax, %rdx
shrq $0x6, %rdx
addl %r9d, %edx
movl %edx, %eax
negl %eax
cmovsl %edx, %eax
imulq %rbx, %rax
shrq $0x18, %rax
cmpl %r9d, %eax
jge 0x2939c
movslq %edx, %rax
imulq 0x10(%rsp), %rax
movl %r9d, %r8d
andl $0x7fffffff, %r8d       # imm = 0x7FFFFFFF
cqto
idivq %r8
leaq 0x3d1441(%rip), %rdx    # 0x3fa7d0
movl %eax, -0x8(%rdx,%rcx,4)
jmp 0x293cf
testb $0x30, 0xc(%r10)
jne 0x293cf
leal -0x1(%rbp), %eax
movl %eax, 0x3ad3ff(%rip)    # 0x3d67a4
movl %ebp, %edx
cmpq %rdx, %r14
je 0x293d6
movslq %eax, %rdx
movq (%r15,%rdx,8), %r8
movq %r8, -0x10(%r15,%rcx,8)
leaq 0x3d1411(%rip), %r9     # 0x3fa7d0
movl (%r9,%rdx,4), %r8d
movl %r8d, -0x8(%r9,%rcx,4)
movl (%r13,%rdx,4), %r9d
movl %eax, %ebp
movl %r9d, -0x8(%r13,%rcx,4)
movl %ebp, %eax
movq %r14, %rcx
movl %eax, %ebp
cmpq $0x1, %r14
jg 0x2930d
movl 0x3ad3b9(%rip), %ebp    # 0x3d67a4
xorl %eax, %eax
cmpl $0x2, %ebp
jl 0x29408
movl $0x1, %ecx
movl %ecx, %eax
leal 0x1(,%rax,2), %ecx
cmpl %ebp, %ecx
jl 0x293f7
addl %eax, %eax
sarl %eax
leaq 0x3d33c1(%rip), %r15    # 0x3fc7d0
leaq 0x3d13ba(%rip), %r12    # 0x3fa7d0
testl %eax, %eax
jle 0x2947d
leaq 0x3cd3af(%rip), %rcx    # 0x3f67d0
movl %ebp, %edx
subl %eax, %edx
jle 0x29472
xorl %esi, %esi
movl %esi, %edi
movl %edi, %r8d
movl (%r15,%r8,4), %r9d
addl %eax, %edi
movl (%r15,%rdi,4), %r10d
cmpl %r10d, %r9d
jle 0x2946c
movl (%rcx,%rdi,8), %r11d
movl (%rcx,%r8,8), %ebx
movl %ebx, (%rcx,%rdi,8)
movl %r11d, (%rcx,%r8,8)
movl (%r12,%rdi,4), %r11d
movl (%r12,%r8,4), %ebx
movl %ebx, (%r12,%rdi,4)
movl %r11d, (%r12,%r8,4)
movl %r9d, (%r15,%rdi,4)
movl %r10d, (%r15,%r8,4)
subl %eax, %r8d
movl %r8d, %edi
jns 0x2942b
incl %esi
cmpl %edx, %esi
jne 0x29429
movl %eax, %edx
shrl %edx
cmpl $0x1, %eax
movl %edx, %eax
ja 0x29421
testl %ebp, %ebp
jle 0x2948f
leal -0x1(%rbp), %eax
movl (%r15,%rax,4), %eax
xorl $0x1, %eax
movl %eax, (%r15,%rbp,4)
leaq 0x3cd33a(%rip), %rbx    # 0x3f67d0
testl %ebp, %ebp
jle 0x297af
movl 0x3d332c(%rip), %edx    # 0x3fc7d0
movl 0x2415b6(%rip), %eax    # 0x26aa60
movq %rbp, %rsi
incq %rsi
xorl %ecx, %ecx
movl $0x1, %r14d
leaq 0x2105a1(%rip), %r13    # 0x239a60
movq %rbp, 0x30(%rsp)
movq %rsi, 0x28(%rsp)
movl (%r15,%r14,4), %r9d
cmpl %edx, %r9d
jne 0x294da
movl %edx, %r9d
jmp 0x297a0
leal 0x1(%rcx), %edx
movslq %edx, %rdi
cmpq %rdi, %r14
jle 0x2977b
movl %r9d, 0x24(%rsp)
movslq %ecx, %rcx
leaq (,%rcx,8), %r11
movq %rcx, 0x10(%rsp)
leaq (,%rcx,4), %rcx
movq %rcx, 0x8(%rsp)
xorl %ecx, %ecx
leaq 0x3d52cc(%rip), %rbp    # 0x3fe7e0
movq %r11, 0x18(%rsp)
leaq (%r11,%rcx,8), %rdx
movq (%rbx,%rdx), %r10
movl 0x8(%r10), %r9d
movq 0x8(%rsp), %rdx
leaq (%rdx,%rcx,4), %rdx
movl %r9d, (%rbp,%rdx)
movzwl 0xc(%r10), %edx
andl $0x30, %edx
cmpw $0x20, %dx
je 0x295c8
leaq (,%rcx,4), %r8
movswq 0xe(%r10), %rdx
movsbl 0x2(%r13,%rdx,4), %edx
movsbl 0x17(%r10), %r11d
addl %edx, %r11d
movzbl 0x15(%r10), %edx
imull %r11d, %edx
shll $0x2, %edx
subl %edx, %r9d
addq 0x8(%rsp), %r8
movl %r9d, (%rbp,%r8)
movswq 0xe(%r10), %rdx
leaq 0x3d725b(%rip), %r11    # 0x4007e0
movswl (%r11,%rdx,2), %r11d
movzbl 0x15(%r10), %edx
imull %r11d, %edx
testb $-0x80, 0xc(%r10)
jne 0x295a5
subl %edx, %r9d
subl %edx, %r9d
movl %r9d, (%rbp,%r8)
movl (%rbp,%r8), %r9d
subl %eax, %r9d
movl %r9d, %r10d
negl %r10d
cmovsl %r9d, %r10d
addl %edx, %edx
cmpl %edx, %r10d
movq 0x18(%rsp), %r11
jge 0x295c8
movl %eax, (%rbp,%r8)
movq 0x10(%rsp), %rdx
addq %rcx, %rdx
incq %rdx
incq %rcx
cmpq %r14, %rdx
jl 0x29519
movq %rdi, %rcx
subq 0x10(%rsp), %rcx
movq %rcx, 0x38(%rsp)
movq %rdi, %r10
movq %r14, 0x40(%rsp)
cmpq 0x10(%rsp), %r10
movq 0x8(%rsp), %r14
jle 0x296b9
xorl %r9d, %r9d
movl (%rbp,%r10,4), %ebx
movl %ebx, %edx
subl %eax, %edx
movl %edx, %r13d
negl %r13d
cmovsl %edx, %r13d
leaq (%r14,%r9,4), %rdx
movl (%rbp,%rdx), %esi
movl %esi, %r8d
subl %eax, %r8d
movl %r8d, %r11d
negl %r11d
cmovsl %r8d, %r11d
cmpl %r11d, %r13d
jae 0x296ad
leaq (,%r9,4), %r8
movq 0x18(%rsp), %r11
leaq (%r11,%r9,8), %r11
leaq 0x3cd181(%rip), %r14    # 0x3f67d0
movq %r15, %rbp
movq %r12, %r15
movl %eax, %r12d
movq %r14, %rax
movl (%r14,%r11), %r13d
movl (%r14,%r10,8), %r14d
movl %r14d, (%rax,%r11)
movl %r13d, (%rax,%r10,8)
movl %r12d, %eax
movq %r15, %r12
movq %rbp, %r15
leaq 0x3d5165(%rip), %rbp    # 0x3fe7e0
movl (%r12,%rdx), %r11d
movl (%r12,%r10,4), %r14d
movl %r14d, (%r12,%rdx)
movl %r11d, (%r12,%r10,4)
movl (%r15,%rdx), %r11d
movl (%r15,%r10,4), %r14d
movl %r14d, (%r15,%rdx)
movq 0x8(%rsp), %r14
movl %r11d, (%r15,%r10,4)
addq %r14, %r8
movl %ebx, (%rbp,%r8)
movl %esi, (%rbp,%r10,4)
incq %r9
cmpq %r9, %rcx
jne 0x29607
incq %r10
movl %r10d, %edx
incq %rcx
movq 0x40(%rsp), %r14
cmpq %r14, %rdx
jne 0x295f4
cmpq %rdi, %r14
jle 0x29780
leaq 0x3cd0f0(%rip), %rbx    # 0x3f67d0
leaq 0x210379(%rip), %r13    # 0x239a60
movl 0x24(%rsp), %r9d
movq 0x18(%rsp), %r10
movq 0x38(%rsp), %r11
cmpq 0x10(%rsp), %rdi
jle 0x2975f
xorl %ecx, %ecx
movq (%rbx,%rdi,8), %rdx
movzwl 0x1a(%rdx), %edx
leaq (%r10,%rcx,8), %rsi
movq (%rbx,%rsi), %rsi
cmpw 0x1a(%rsi), %dx
jge 0x29757
leaq (,%rcx,8), %rdx
addq %r10, %rdx
movl (%rbx,%rdx), %esi
movl (%rbx,%rdi,8), %r8d
movl %r8d, (%rbx,%rdx)
movl %esi, (%rbx,%rdi,8)
movq 0x8(%rsp), %rdx
leaq (%rdx,%rcx,4), %rdx
movl (%r12,%rdx), %esi
movl (%r12,%rdi,4), %r8d
movl %r8d, (%r12,%rdx)
movl %esi, (%r12,%rdi,4)
movl (%r15,%rdx), %esi
movl (%r15,%rdi,4), %r8d
movl %r8d, (%r15,%rdx)
movl %esi, (%r15,%rdi,4)
incq %rcx
cmpq %rcx, %r11
jne 0x296ff
incq %rdi
movl %edi, %ecx
incq %r11
cmpq %r14, %rcx
jne 0x296f6
movl %r14d, %ecx
movq 0x30(%rsp), %rbp
movq 0x28(%rsp), %rsi
jmp 0x297a0
movl %r14d, %ecx
jmp 0x297a0
movl %r14d, %ecx
leaq 0x3cd046(%rip), %rbx    # 0x3f67d0
movq 0x30(%rsp), %rbp
movq 0x28(%rsp), %rsi
leaq 0x2102c5(%rip), %r13    # 0x239a60
movl 0x24(%rsp), %r9d
incq %r14
movl %r9d, %edx
cmpq %rsi, %r14
jne 0x294c9
leaq 0x5d019a(%rip), %rax    # 0x5f9950
cmpl $0x0, (%rax)
jle 0x298ff
testl %ebp, %ebp
jle 0x29804
leaq 0x3cd006(%rip), %r14    # 0x3f67d0
movq -0x8(%r14,%rbp,8), %rax
testb $0x2, 0xc(%rax)
jne 0x297f7
movswl 0xe(%rax), %edi
movzbl 0x11(%rax), %esi
callq 0x4d64c
testl %eax, %eax
jne 0x297f7
leal -0x1(%rbp), %edi
callq 0x29b84
movq $0x0, -0x8(%r14,%rbp,8)
decq %rbp
leaq 0x1(%rbp), %rax
cmpq $0x1, %rax
jg 0x297ca
movslq 0x3acf99(%rip), %rax    # 0x3d67a4
testq %rax, %rax
jle 0x2984b
shlq $0x2, %rax
xorl %edx, %edx
movq %rbx, %rsi
xorl %ecx, %ecx
movq (%rsi), %rdi
testq %rdi, %rdi
je 0x2983c
movslq %ecx, %rcx
movq %rdi, (%rbx,%rcx,8)
movl (%rdx,%r12), %edi
movl %edi, (%r12,%rcx,4)
movl (%rdx,%r15), %edi
movl %edi, (%r15,%rcx,4)
incl %ecx
addq $0x4, %rdx
addq $0x8, %rsi
cmpq %rdx, %rax
jne 0x2981b
jmp 0x2984d
xorl %ecx, %ecx
movl %ecx, 0x3acf51(%rip)    # 0x3d67a4
movswq 0x3acf43(%rip), %rbx    # 0x3d679e
testq %rbx, %rbx
jle 0x298c1
incq %rbx
leaq 0x3db776(%rip), %r14    # 0x404fe0
leaq 0x18e1df(%rip), %rbp    # 0x1b7a50
movswq -0x4(%r14,%rbx,2), %rax
leaq 0x20e1d2(%rip), %rcx    # 0x237a50
movswq (%rcx,%rax,2), %rax
shlq $0x5, %rax
testb $-0x80, 0xe(%rax,%rbp)
jne 0x298b8
addq %rbp, %rax
movswl 0x12(%rax), %edi
movzbl 0x15(%rax), %esi
callq 0x4d64c
testl %eax, %eax
jne 0x298b8
leal 0xfffe(%rbx), %eax
movswl %ax, %edi
callq 0x2ca9c
movw $0xffff, -0x4(%r14,%rbx,2) # imm = 0xFFFF
decq %rbx
cmpq $0x1, %rbx
jg 0x29871
movswq 0x3aced5(%rip), %rcx    # 0x3d679e
xorl %eax, %eax
testq %rcx, %rcx
jle 0x298f8
addq %rcx, %rcx
leaq 0x3db706(%rip), %rdx    # 0x404fe0
xorl %esi, %esi
movzwl (%rsi,%rdx), %edi
testw %di, %di
js 0x298ef
movslq %eax, %r8
incl %eax
movw %di, (%rdx,%r8,2)
addq $0x2, %rsi
cmpq %rsi, %rcx
jne 0x298dc
movw %ax, 0x3ace9f(%rip)     # 0x3d679e
movl 0x3ace9f(%rip), %ebx    # 0x3d67a4
testl %ebx, %ebx
setg %cl
movzwl 0x3ace8d(%rip), %eax    # 0x3d679e
testw %ax, %ax
setg %dl
andb %cl, %dl
cmpb $0x1, %dl
jne 0x29b4c
movzwl %ax, %eax
decl %eax
leaq 0x3db6b2(%rip), %rcx    # 0x404fe0
movswq (%rcx,%rax,2), %rcx
leal -0x1(%rbx), %ebp
leaq 0x3cce93(%rip), %rax    # 0x3f67d0
movq (%rax,%rbp,8), %rdi
leaq 0x20e108(%rip), %rax    # 0x237a50
movq %rcx, 0x8(%rsp)
movswl (%rax,%rcx,2), %esi
callq 0x2d05f
testl %eax, %eax
je 0x29a80
cmpl $0x2, %ebx
jl 0x29a92
addl $-0x2, %ebx
leaq (,%rbx,8), %r13
leaq (,%rbx,4), %r8
xorl %r14d, %r14d
movl $0xffffffff, %ebp       # imm = 0xFFFFFFFF
movl $0x0, 0x10(%rsp)
leaq 0x5d424f(%rip), %rcx    # 0x5fdbe0
movsd 0x4c5c7(%rip), %xmm2    # 0x75f60
movq 0x8(%rsp), %rsi
movq %r8, 0x18(%rsp)
leaq (%r8,%r14), %rax
leaq 0x5cffa2(%rip), %rdx    # 0x5f9950
cmpl $0x0, (%rdx)
movl (%r12,%rax), %eax
jle 0x299e2
xorps %xmm0, %xmm0
cvtsi2sd %eax, %xmm0
mulsd %xmm2, %xmm0
ucomisd (%rcx,%rsi,8), %xmm0
jb 0x29a6a
leaq 0x5dc20c(%rip), %rax    # 0x605be0
movsd (%rax,%rsi,8), %xmm1
ucomisd %xmm0, %xmm1
setae %al
jmp 0x299fe
sarl $0x8, %eax
leaq 0x241084(%rip), %rdx    # 0x26aa70
cmpl %eax, (%rdx,%rsi,4)
jg 0x29a6a
leaq 0x245088(%rip), %rdx    # 0x26ea80
cmpl (%rdx,%rsi,4), %eax
setle %al
testb %al, %al
je 0x29a6a
leaq (,%r14,2), %rax
addq %r13, %rax
leaq 0x3ccdbc(%rip), %rcx    # 0x3f67d0
movq (%rcx,%rax), %rdi
leaq 0x20e031(%rip), %rax    # 0x237a50
movswl (%rax,%rsi,2), %esi
callq 0x2d05f
testl %eax, %eax
jne 0x29a51
leaq (%r14,%r14), %rbp
movl %ebx, %edi
callq 0x29b84
addq %r13, %rbp
leaq 0x3ccd8f(%rip), %rax    # 0x3f67d0
movq (%rax,%rbp), %rax
movw $0xffff, 0x1e(%rax)     # imm = 0xFFFF
incl 0x10(%rsp)
movl %ebx, %ebp
leaq 0x5d4188(%rip), %rcx    # 0x5fdbe0
movsd 0x4c500(%rip), %xmm2    # 0x75f60
movq 0x8(%rsp), %rsi
movq 0x18(%rsp), %r8
leaq -0x1(%rbx), %rax
addq $-0x4, %r14
testq %rbx, %rbx
movq %rax, %rbx
jg 0x299a3
jmp 0x29a9f
movl %ebp, 0x3acd1e(%rip)    # 0x3d67a4
movl %ebp, %edi
callq 0x29b84
jmp 0x29b23
movl $0xffffffff, %ebp       # imm = 0xFFFFFFFF
movl $0x0, 0x10(%rsp)
testl %ebp, %ebp
js 0x29b0b
movl 0x3accfb(%rip), %eax    # 0x3d67a4
cmpl %eax, %ebp
leaq 0x3ccd1e(%rip), %r11    # 0x3f67d0
jge 0x29b01
movl %ebp, %ecx
leaq (,%rcx,4), %rdx
shlq $0x3, %rcx
xorl %esi, %esi
movl %ebp, %edi
leaq (%rcx,%rsi,2), %r8
movq (%r11,%r8), %r8
cmpw $0x0, 0x1e(%r8)
js 0x29af7
cmpl %ebp, %edi
jge 0x29af5
movslq %edi, %r9
movq %r8, (%r11,%r9,8)
leaq (%rdx,%rsi), %r8
movl (%r12,%r8), %r10d
movl %r10d, (%r12,%r9,4)
movl (%r15,%r8), %r8d
movl %r8d, (%r15,%r9,4)
incl %edi
addq $0x4, %rsi
incl %ebp
cmpl %ebp, %eax
jg 0x29ac6
subl 0x10(%rsp), %eax
movl %eax, 0x3acc99(%rip)    # 0x3d67a4
movzwl 0x3acc8c(%rip), %eax    # 0x3d679e
decl %eax
movw %ax, 0x3acc83(%rip)     # 0x3d679e
movswl %ax, %edi
callq 0x2ca9c
movl 0x3acc7b(%rip), %ebx    # 0x3d67a4
testl %ebx, %ebx
jle 0x29b4c
movzwl 0x3acc6a(%rip), %eax    # 0x3d679e
testw %ax, %ax
jg 0x29922
jmp 0x29b4c
decl %edi
movl %edi, 0x3acc5d(%rip)    # 0x3d67a4
callq 0x29b84
movl 0x3acc52(%rip), %edi    # 0x3d67a4
testl %edi, %edi
jg 0x29b3f
jmp 0x29b69
decl %eax
movw %ax, 0x3acc3d(%rip)     # 0x3d679e
movswl %ax, %edi
callq 0x2ca9c
movzwl 0x3acc2e(%rip), %eax    # 0x3d679e
testw %ax, %ax
jg 0x29b58
addq $0x48, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq