// File: /workspace/github_c_makefile_star2_O1/jonof[P]jftekwar/jfbuild/src/engine.c
// Function: grouscan
static void grouscan(int dax1, int dax2, int sectnum, unsigned char dastat)
{
	int i, j, l, x, y, dx, dy, wx, wy, y1, y2, daz;
	int daslope, dasqr;
	int shoffs, shinc, m1, m2;
	intptr_t *mptr1, *mptr2, *nptr1, *nptr2;
	walltype *wal;
	sectortype *sec;

	sec = &sector[sectnum];

	if (dastat == 0)
	{
		if (globalposz <= getceilzofslope(sectnum,globalposx,globalposy))
			return;  //Back-face culling
		globalorientation = sec->ceilingstat;
		globalpicnum = sec->ceilingpicnum;
		globalshade = sec->ceilingshade;
		globalpal = sec->ceilingpal;
		daslope = sec->ceilingheinum;
		daz = sec->ceilingz;
	}
	else
	{
		if (globalposz >= getflorzofslope(sectnum,globalposx,globalposy))
			return;  //Back-face culling
		globalorientation = sec->floorstat;
		globalpicnum = sec->floorpicnum;
		globalshade = sec->floorshade;
		globalpal = sec->floorpal;
		daslope = sec->floorheinum;
		daz = sec->floorz;
	}

	if (palookup[globalpal] == 0) globalpal = 0;
	if ((picanm[globalpicnum]&192) != 0) globalpicnum += animateoffs(globalpicnum,sectnum);
	setgotpic(globalpicnum);
	if ((tilesizx[globalpicnum] <= 0) || (tilesizy[globalpicnum] <= 0)) return;
	if (waloff[globalpicnum] == 0) loadtile(globalpicnum);

	wal = &wall[sec->wallptr];
	wx = wall[wal->point2].x - wal->x;
	wy = wall[wal->point2].y - wal->y;
	dasqr = krecipasm(nsqrtasm(wx*wx+wy*wy));
	i = mulscale21(daslope,dasqr);
	wx *= i; wy *= i;

	globalx = -mulscale19(singlobalang,xdimenrecip);
	globaly = mulscale19(cosglobalang,xdimenrecip);
	globalx1 = (globalposx<<8);
	globaly1 = -(globalposy<<8);
	i = (dax1-halfxdimen)*xdimenrecip;
	globalx2 = mulscale16(cosglobalang<<4,viewingrangerecip) - mulscale27(singlobalang,i);
	globaly2 = mulscale16(singlobalang<<4,viewingrangerecip) + mulscale27(cosglobalang,i);
	globalzd = (xdimscale<<9);
	globalzx = -dmulscale17(wx,globaly2,-wy,globalx2) + mulscale10(1-globalhoriz,globalzd);
	globalz = -dmulscale25(wx,globaly,-wy,globalx);

	if (globalorientation&64)  //Relative alignment
	{
		dx = mulscale14(wall[wal->point2].x-wal->x,dasqr);
		dy = mulscale14(wall[wal->point2].y-wal->y,dasqr);

		i = nsqrtasm(daslope*daslope+16777216);

		x = globalx; y = globaly;
		globalx = dmulscale16(x,dx,y,dy);
		globaly = mulscale12(dmulscale16(-y,dx,x,dy),i);

		x = ((wal->x-globalposx)<<8); y = ((wal->y-globalposy)<<8);
		globalx1 = dmulscale16(-x,dx,-y,dy);
		globaly1 = mulscale12(dmulscale16(-y,dx,x,dy),i);

		x = globalx2; y = globaly2;
		globalx2 = dmulscale16(x,dx,y,dy);
		globaly2 = mulscale12(dmulscale16(-y,dx,x,dy),i);
	}
	if (globalorientation&0x4)
	{
		i = globalx; globalx = -globaly; globaly = -i;
		i = globalx1; globalx1 = globaly1; globaly1 = i;
		i = globalx2; globalx2 = -globaly2; globaly2 = -i;
	}
	if (globalorientation&0x10) { globalx1 = -globalx1, globalx2 = -globalx2, globalx = -globalx; }
	if (globalorientation&0x20) { globaly1 = -globaly1, globaly2 = -globaly2, globaly = -globaly; }

	daz = dmulscale9(wx,globalposy-wal->y,-wy,globalposx-wal->x) + ((daz-globalposz)<<8);
	globalx2 = mulscale20(globalx2,daz); globalx = mulscale28(globalx,daz);
	globaly2 = mulscale20(globaly2,-daz); globaly = mulscale28(globaly,-daz);

	i = 8-(picsiz[globalpicnum]&15); j = 8-(picsiz[globalpicnum]>>4);
	if (globalorientation&8) { i++; j++; }
	globalx1 <<= (i+12); globalx2 <<= i; globalx <<= i;
	globaly1 <<= (j+12); globaly2 <<= j; globaly <<= j;

	if (dastat == 0)
	{
		globalx1 += (((int)sec->ceilingxpanning)<<24);
		globaly1 += (((int)sec->ceilingypanning)<<24);
	}
	else
	{
		globalx1 += (((int)sec->floorxpanning)<<24);
		globaly1 += (((int)sec->floorypanning)<<24);
	}

	asm1 = -(globalzd>>(16-BITSOFPRECISION));

	globvis = globalvisibility;
	if (sec->visibility != 0) globvis = mulscale4(globvis,(int)((unsigned char)(sec->visibility+16)));
	globvis = mulscale13(globvis,daz);
	globvis = mulscale16(globvis,xdimscale);

	setupslopevlin(((int)(picsiz[globalpicnum]&15))+(((int)(picsiz[globalpicnum]>>4))<<8),(void *)waloff[globalpicnum],-ylookup[1]);

	l = (globalzd>>16);

	assert(SLOPALOOKUPSIZ - 4 - ydimen > 0);

	shinc = mulscale16(globalz,xdimenscale);
	if (shinc > 0) shoffs = (4<<15); else shoffs = ((SLOPALOOKUPSIZ-4-ydimen)<<15);
	if (dastat == 0) y1 = umost[dax1]; else y1 = max(umost[dax1],dplc[dax1]);
	m1 = mulscale16(y1,globalzd) + (globalzx>>6);
		//Avoid visibility overflow by crossing horizon
	if (globalzd > 0) m1 += (globalzd>>16); else m1 -= (globalzd>>16);
	m2 = m1+l;
	mptr1 = &slopalookup[y1+(shoffs>>15)]; mptr2 = mptr1+1;

	assert(y1+(shoffs>>15) >= 0);
	assert(y1+(shoffs>>15) <= SLOPALOOKUPSIZ-2);

	for(x=dax1;x<=dax2;x++)
	{
		if (dastat == 0) { y1 = umost[x]; y2 = min(dmost[x],uplc[x])-1; }
		else { y1 = max(umost[x],dplc[x]); y2 = dmost[x]-1; }
		if (y1 <= y2)
		{
			assert(y1+(shoffs>>15) >= 0);
			assert(y1+(shoffs>>15) <= SLOPALOOKUPSIZ-1);
			assert(y2+(shoffs>>15) >= 0);
			assert(y2+(shoffs>>15) <= SLOPALOOKUPSIZ-1);

			nptr1 = &slopalookup[y1+(shoffs>>15)];
			nptr2 = &slopalookup[y2+(shoffs>>15)];
			while (nptr1 <= mptr1)
			{
				*mptr1-- = (intptr_t)palookup[globalpal] + (getpalookup((int)mulscale24(krecipasm(m1),globvis),globalshade)<<8);
				m1 -= l;
			}
			while (nptr2 >= mptr2)
			{
				*mptr2++ = (intptr_t)palookup[globalpal] + (getpalookup((int)mulscale24(krecipasm(m2),globvis),globalshade)<<8);
				m2 += l;
			}

			globalx3 = (globalx2>>10);
			globaly3 = (globaly2>>10);
			asm3 = mulscale16(y2,globalzd) + (globalzx>>6);
			slopevlin((void *)(ylookup[y2]+x+frameoffset),krecipasm((int)asm3>>3),nptr2,y2-y1+1,globalx1,globaly1);

			if ((x&15) == 0) faketimerhandler();
		}
		globalx2 += globalx;
		globaly2 += globaly;
		globalzx += globalz;
		shoffs += shinc;
	}
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x58, %rsp
movl %esi, 0x18(%rsp)
movl %edi, %r12d
movslq %edx, %rax
leaq (%rax,%rax,4), %rsi
leaq 0x206356(%rip), %rdx    # 0x242a60
leaq (%rdx,%rsi,8), %r14
movl 0x22e34c(%rip), %ebx    # 0x26aa60
movl 0x1fd336(%rip), %esi    # 0x239a50
movl 0x1fd334(%rip), %edx    # 0x239a54
movl %ecx, 0x1c(%rsp)
movswl %ax, %edi
testl %ecx, %ecx
je 0x3c758
callq 0x397ca
cmpl %eax, %ebx
jge 0x3d1d3
leaq 0xe(%r14), %rdx
movl $0x8, %eax
movl $0x1a, %ecx
movl $0x1d, %esi
movl $0x1c, %edi
movl $0x18, %r8d
jmp 0x3c783
callq 0x398a4
cmpl %eax, %ebx
jle 0x3d1d3
leaq 0xc(%r14), %rdx
movl $0x4, %eax
movl $0x12, %ecx
movl $0x15, %esi
movl $0x14, %edi
movl $0x10, %r8d
movswl (%rdx), %edx
movl %edx, 0x3d2874(%rip)    # 0x40f000
movzwl (%r14,%r8), %edx
movw %dx, 0x3d2878(%rip)     # 0x40f010
movsbl (%r14,%rdi), %edx
movl %edx, 0x3d7089(%rip)    # 0x41382c
movzbl (%r14,%rsi), %edx
movl %edx, 0x3d2856(%rip)    # 0x40f004
leaq 0x35b32b(%rip), %rsi    # 0x397ae0
cmpq $0x0, (%rsi,%rdx,8)
jne 0x3c7c6
movl $0x0, 0x3d283e(%rip)    # 0x40f004
movswl (%r14,%rcx), %ebp
movl (%r14,%rax), %ebx
movswq 0x3d2839(%rip), %rax    # 0x40f010
leaq 0x1fd282(%rip), %rcx    # 0x239a60
testb $-0x40, (%rcx,%rax,4)
je 0x3c7fd
movswl %ax, %r15d
movl %r15d, %edi
xorl %esi, %esi
callq 0x23d49
addl %eax, %r15d
movw %r15w, 0x3d2813(%rip)   # 0x40f010
movswq 0x3d280b(%rip), %rdi    # 0x40f010
leaq 0x3f0f34(%rip), %rax    # 0x42d740
cmpb $-0x39, (%rdi,%rax)
ja 0x3c816
movb $-0x39, (%rdi,%rax)
movl %edi, %eax
andl $0x7, %eax
leaq 0x66f7e(%rip), %rcx     # 0xa37a0
movb (%rax,%rcx), %al
movl %edi, %ecx
sarl $0x3, %ecx
movslq %ecx, %rcx
leaq 0x3f0a7c(%rip), %rdx    # 0x42d2b0
orb %al, (%rcx,%rdx)
movslq %edi, %rax
leaq 0x3d27df(%rip), %rcx    # 0x40f020
cmpw $0x0, (%rcx,%rax,2)
jle 0x3d1d3
leaq 0x3c3f8d(%rip), %rcx    # 0x4007e0
cmpw $0x0, (%rcx,%rax,2)
jle 0x3d1d3
movl %ebx, 0x20(%rsp)
leaq 0x35ba77(%rip), %rcx    # 0x3982e0
cmpq $0x0, (%rcx,%rax,8)
jne 0x3c875
callq 0x2f106
movswq (%r14), %rax
shlq $0x5, %rax
leaq 0x17b1cc(%rip), %rdi    # 0x1b7a50
movswq 0x8(%rax,%rdi), %r13
shlq $0x5, %r13
movslq (%r13,%rdi), %r15
movslq (%rax,%rdi), %rdx
movq %rdx, 0x30(%rsp)
subq %rdx, %r15
movl 0x4(%r13,%rdi), %esi
movslq 0x4(%rax,%rdi), %rax
movq %rax, 0x10(%rsp)
subl %eax, %esi
movl %r15d, %ecx
imull %r15d, %ecx
movl %esi, %eax
imull %eax, %eax
addl %ecx, %eax
movl %eax, %ecx
shrl $0x18, %ecx
orl $0x1000, %ecx           # imm = 0x1000
movl %eax, %edx
shrl $0xc, %edx
cmpl $0x1000000, %eax        # imm = 0x1000000
cmovael %ecx, %edx
leaq 0x418623(%rip), %rcx    # 0x454f00
movzwl (%rcx,%rdx,2), %ecx
shrl %cl, %eax
leaq 0x41a816(%rip), %rdx    # 0x457100
movzwl (%rdx,%rax,2), %eax
shrl $0x8, %ecx
shrl %cl, %eax
cvtsi2ss %eax, %xmm0
movslq 0x3f8c9e(%rip), %rbx    # 0x43559c
movslq 0x23216b(%rip), %rdx    # 0x26ea70
movl 0x1fd145(%rip), %eax    # 0x239a50
movl %eax, 0x28(%rsp)
shll $0x8, %eax
movl %eax, 0x3d6f20(%rip)    # 0x413838
movl 0x1fd136(%rip), %eax    # 0x239a54
movl %eax, 0xc(%rsp)
shll $0x8, %eax
negl %eax
movl %eax, 0x3d6f0f(%rip)    # 0x41383c
movslq 0x3db530(%rip), %rcx    # 0x417e64
movl %r12d, 0x44(%rsp)
movslq %r12d, %rax
movq %rax, 0x38(%rsp)
subq %rcx, %rax
imulq %rbx, %rax
movl %edx, %ecx
shll $0x4, %ecx
movslq %ecx, %r8
movslq 0x3913e1(%rip), %rcx    # 0x3cdd38
imulq %rcx, %r8
shrq $0x10, %r8
movslq 0x232112(%rip), %rdi    # 0x26ea78
movq %rdi, %r10
imulq %rax, %r10
shrq $0x1b, %r10
subl %r10d, %r8d
imulq %rdx, %rax
imulq %rbx, %rdx
imulq %rdi, %rbx
shll $0x4, %edi
movslq %edi, %rdi
imulq %rcx, %rdi
shrq $0x10, %rdi
shrq $0x1b, %rax
addl %edi, %eax
movd %xmm0, %ecx
movl %ecx, %edi
shrl $0xa, %edi
andl $0x1ffc, %edi           # imm = 0x1FFC
leaq 0x40e4b6(%rip), %r9     # 0x44ae60
movl (%rdi,%r9), %edi
addl $0x800000, %ecx         # imm = 0x800000
shrl $0x17, %ecx
sarl %cl, %edi
movslq %edi, %rdi
movslq %ebp, %rcx
imulq %rdi, %rcx
shrq $0x15, %rcx
movl %r15d, %r10d
imull %ecx, %r10d
imull %ecx, %esi
movl %r8d, 0x3d6e68(%rip)    # 0x413840
movl %eax, 0x3d6e66(%rip)    # 0x413844
negl %esi
movslq %r10d, %r11
cltq
movq %rax, %rcx
imulq %r11, %rcx
movslq %esi, %r10
movslq %r8d, %r9
movq %r9, %rsi
imulq %r10, %rsi
addq %rcx, %rsi
movslq 0x23e099(%rip), %rcx    # 0x27aa9c
movl $0x1, %r12d
subq %rcx, %r12
movslq 0x391321(%rip), %rcx    # 0x3cdd34
movq %rcx, 0x50(%rsp)
movl %ecx, %r8d
shll $0x9, %r8d
movslq %r8d, %rcx
imulq %r12, %rcx
shrq $0x11, %rsi
shrq $0xa, %rcx
subl %esi, %ecx
movl %ecx, 0x4160c6(%rip)    # 0x452afc
shrq $0x13, %rbx
negl %ebx
movl %ebx, 0x4160be(%rip)    # 0x452b00
shrq $0x13, %rdx
movslq %edx, %rsi
movq %rsi, %rcx
imulq %r11, %rcx
movslq %ebx, %r12
movq %r10, %rbx
imulq %r12, %rbx
addq %rcx, %rbx
shrq $0x19, %rbx
negl %ebx
movl %ebx, 0x41609f(%rip)    # 0x452b08
movl %edx, 0x416095(%rip)    # 0x452b04
movl %r8d, 0x416076(%rip)    # 0x452aec
movl 0x3d2584(%rip), %ebx    # 0x40f000
testb $0x40, %bl
je 0x3cbc3
imull %ebp, %ebp
addl $0x1000000, %ebp        # imm = 0x1000000
movl %ebp, %ecx
shrl $0x17, %ecx
andl $-0x2, %ecx
movq %r9, 0x48(%rsp)
leaq 0x41845e(%rip), %r9     # 0x454f00
movzwl 0x2000(%r9,%rcx), %ecx
shrl %cl, %ebp
leaq 0x17af9c(%rip), %r9     # 0x1b7a50
movslq 0x4(%r13,%r9), %r13
leaq 0x41a640(%rip), %r9     # 0x457100
movzwl (%r9,%rbp,2), %ebp
subq 0x10(%rsp), %r13
imulq %rdi, %r15
shrq $0xe, %r15
movslq %r15d, %r9
imulq %rdi, %r13
negl %edx
movslq %edx, %rdi
imulq %r9, %rdi
movq %r9, %r15
imulq %r12, %r15
shrq $0xe, %r13
movslq %r13d, %rdx
imulq %rdx, %rsi
addq %r15, %rsi
shrq $0x10, %rsi
movl %esi, 0x415fff(%rip)    # 0x452b00
movq 0x30(%rsp), %rsi
movl %esi, %r15d
subl 0x28(%rsp), %r15d
shll $0x8, %r15d
movslq %r15d, %rsi
negl %r15d
movslq %r15d, %r15
imulq %r9, %r15
shrl $0x8, %ecx
shrl %cl, %ebp
imulq %rdx, %r12
addq %rdi, %r12
shrq $0x10, %r12
movslq %r12d, %rcx
imulq %rbp, %rcx
shrq $0xc, %rcx
movl %ecx, 0x415fc4(%rip)    # 0x452b04
movl 0xc(%rsp), %ecx
subl 0x10(%rsp), %ecx
shll $0x8, %ecx
movslq %ecx, %rcx
movq %rdx, %rdi
imulq %rcx, %rdi
addq %r15, %rdi
shrq $0x10, %rdi
movl %edi, 0x3d6cd6(%rip)    # 0x413838
imulq %r9, %rcx
imulq %rdx, %rsi
addq %rcx, %rsi
shrq $0x10, %rsi
movslq %esi, %rcx
imulq %rbp, %rcx
shrq $0xc, %rcx
movl %ecx, 0x3d6cba(%rip)    # 0x41383c
movq %rdx, %rcx
imulq %rax, %rcx
negl %eax
cltq
imulq %r9, %rax
movq 0x48(%rsp), %rsi
imulq %rsi, %r9
addq %r9, %rcx
shrq $0x10, %rcx
movl %ecx, 0x3d6c99(%rip)    # 0x413840
imulq %rsi, %rdx
addq %rax, %rdx
shrq $0x10, %rdx
movslq %edx, %rax
imulq %rbp, %rax
shrq $0xc, %rax
movl %eax, 0x3d6c81(%rip)    # 0x413844
testb $0x4, %bl
je 0x3cc18
xorl %eax, %eax
xorl %ecx, %ecx
subl 0x415f32(%rip), %ecx    # 0x452b04
xorl %edx, %edx
subl 0x415f26(%rip), %edx    # 0x452b00
movl %ecx, 0x415f20(%rip)    # 0x452b00
movl %edx, 0x415f1e(%rip)    # 0x452b04
movl 0x3d6c4c(%rip), %ecx    # 0x413838
movl 0x3d6c4a(%rip), %edx    # 0x41383c
movl %edx, 0x3d6c40(%rip)    # 0x413838
movl %ecx, 0x3d6c3e(%rip)    # 0x41383c
xorl %ecx, %ecx
subl 0x3d6c3e(%rip), %ecx    # 0x413844
subl 0x3d6c34(%rip), %eax    # 0x413840
movl %ecx, 0x3d6c2e(%rip)    # 0x413840
movl %eax, 0x3d6c2c(%rip)    # 0x413844
testb $0x10, %bl
je 0x3cc2f
negl 0x3d6c15(%rip)          # 0x413838
negl 0x3d6c17(%rip)          # 0x413840
negl 0x415ed1(%rip)          # 0x452b00
testb $0x20, %bl
je 0x3cc46
negl 0x3d6c02(%rip)          # 0x41383c
negl 0x3d6c04(%rip)          # 0x413844
negl 0x415ebe(%rip)          # 0x452b04
xorl %r15d, %r15d
cmpb $0x0, 0x1c(%rsp)
setne %r15b
movl 0xc(%rsp), %eax
subl 0x10(%rsp), %eax
movl 0x28(%rsp), %ecx
subl 0x30(%rsp), %ecx
cltq
imulq %rax, %r11
movslq %ecx, %rax
imulq %rax, %r10
addq %r11, %r10
shrq $0x9, %r10
movl 0x20(%rsp), %eax
subl 0x22dde0(%rip), %eax    # 0x26aa60
shll $0x8, %eax
addl %r10d, %eax
movslq 0x3d6bb3(%rip), %r13    # 0x413840
movslq %eax, %rsi
imulq %rsi, %r13
shrq $0x14, %r13
movslq 0x415e61(%rip), %r11    # 0x452b00
imulq %rsi, %r11
shrq $0x1c, %r11
movslq 0x3d6b96(%rip), %r12    # 0x413844
movl %esi, %eax
negl %eax
cltq
imulq %rax, %r12
shrq $0x14, %r12
movslq 0x415e41(%rip), %rbp    # 0x452b04
imulq %rax, %rbp
shrq $0x1c, %rbp
movswq 0x3d233d(%rip), %rdx    # 0x40f010
leaq 0x3d6b76(%rip), %rax    # 0x413850
movq %rdx, 0x10(%rsp)
movzbl (%rdx,%rax), %r10d
movl %r10d, %r9d
andl $0xf, %r9d
movl %r10d, %edi
shrl $0x4, %edi
andl $0x8, %ebx
cmpl $0x1, %ebx
movl $0x9, %eax
sbbl $0x0, %eax
movl %eax, %edx
subl %r9d, %edx
movl 0x3d6b2e(%rip), %ebx    # 0x413838
leal 0xc(%rdx), %ecx
shll %cl, %ebx
movl %edx, %ecx
shll %cl, %r13d
shll %cl, %r11d
subl %edi, %eax
movl %r13d, 0x3d6b20(%rip)   # 0x413840
movl 0x3d6b16(%rip), %edx    # 0x41383c
leal 0xc(%rax), %ecx
shll %cl, %edx
movl %eax, %ecx
shll %cl, %r12d
movl %r11d, 0x415dc9(%rip)   # 0x452b00
movl %r12d, 0x3d6b06(%rip)   # 0x413844
movl %ebx, 0x3d6af4(%rip)    # 0x413838
shll %cl, %ebp
movl %ebp, 0x415db8(%rip)    # 0x452b04
movzbl 0x16(%r14,%r15,8), %eax
shll $0x18, %eax
addl %ebx, %eax
movl %eax, 0x3d6adb(%rip)    # 0x413838
movl %edx, 0x3d6ad9(%rip)    # 0x41383c
movzbl 0x17(%r14,%r15,8), %eax
shll $0x18, %eax
addl %edx, %eax
movl %eax, 0x3d6ac8(%rip)    # 0x41383c
sarl $0xd, %r8d
negl %r8d
movl %r8d, 0x3d8ed2(%rip)    # 0x415c54
movb 0x20(%r14), %cl
movslq 0x390fb3(%rip), %rax    # 0x3cdd40
movl %eax, 0x3d6a9d(%rip)    # 0x413830
testb %cl, %cl
je 0x3cdab
addb $0x10, %cl
movzbl %cl, %ecx
imulq %rax, %rcx
shrq $0x4, %rcx
movl %ecx, 0x3d6a85(%rip)    # 0x413830
movslq 0x3d6a7e(%rip), %rax    # 0x413830
imulq %rax, %rsi
shrq $0xd, %rsi
movslq %esi, %rax
imulq 0x50(%rsp), %rax
shrq $0x10, %rax
movl %eax, 0x3d6a63(%rip)    # 0x413830
shll $0x4, %r10d
andl $0xf00, %r10d           # imm = 0xF00
orl %r9d, %r10d
leaq 0x35b4fe(%rip), %rax    # 0x3982e0
movq 0x10(%rsp), %rcx
movq (%rax,%rcx,8), %rsi
xorl %edx, %edx
subl 0x3d8eb1(%rip), %edx    # 0x415ca4
movl %r10d, %edi
callq 0x6ddab
movl 0x23dc93(%rip), %eax    # 0x27aa94
cmpl $0x1dfc, %eax           # imm = 0x1DFC
leaq 0x40e053(%rip), %rbp    # 0x44ae60
movl 0x44(%rsp), %esi
jge 0x3d25e
movslq 0x415cea(%rip), %rcx    # 0x452b08
movslq 0x23dc73(%rip), %r8     # 0x27aa98
imulq %rcx, %r8
shrq $0x10, %r8
shll $0xf, %eax
movl $0xefe0000, %ecx        # imm = 0xEFE0000
subl %eax, %ecx
testl %r8d, %r8d
movl $0x20000, %r9d          # imm = 0x20000
cmovlel %ecx, %r9d
leaq 0x395d45(%rip), %r10    # 0x3d2b90
movq 0x38(%rsp), %rdi
movzwl (%r10,%rdi,2), %eax
cmpb $0x0, 0x1c(%rsp)
je 0x3ce6d
leaq 0x413e0d(%rip), %rcx    # 0x450c70
movzwl (%rcx,%rdi,2), %ecx
cmpw %cx, %ax
cmovlel %ecx, %eax
movswl %ax, %edx
movl %r9d, %ecx
sarl $0xf, %ecx
addl %edx, %ecx
js 0x3d27d
cmpl $0x1dfe, %ecx           # imm = 0x1DFE
jg 0x3d29c
cmpl 0x18(%rsp), %esi
jg 0x3d1d3
movslq 0x415c51(%rip), %rdx    # 0x452aec
movl %edx, %ebx
sarl $0x10, %ebx
movl %ecx, %ecx
leaq 0x3fefb7(%rip), %rsi    # 0x43be60
leaq (%rsi,%rcx,8), %r14
leaq (%rsi,%rcx,8), %r12
addq $0x8, %r12
movl %edx, %ecx
shrl $0x10, %ecx
movl %ebx, %esi
negl %esi
testl %edx, %edx
cmovgl %ecx, %esi
movswq %ax, %rax
imulq %rdx, %rax
shrq $0x10, %rax
movl 0x415c26(%rip), %r13d   # 0x452afc
sarl $0x6, %r13d
addl %esi, %r13d
addl %eax, %r13d
leal (%rbx,%r13), %r15d
incl 0x18(%rsp)
leaq 0x397aa1(%rip), %rsi    # 0x3d4990
movq %r8, 0x20(%rsp)
movzwl (%r10,%rdi,2), %eax
cmpb $0x0, 0x1c(%rsp)
je 0x3cf17
leaq 0x413d69(%rip), %rcx    # 0x450c70
movzwl (%rcx,%rdi,2), %ecx
cmpw %cx, %ax
cmovlel %ecx, %eax
movzwl (%rsi,%rdi,2), %ecx
jmp 0x3cf2c
movzwl (%rsi,%rdi,2), %edx
leaq 0x411f4e(%rip), %rcx    # 0x44ee70
movzwl (%rcx,%rdi,2), %ecx
cmpw %cx, %dx
cmovll %edx, %ecx
cmpw %ax, %cx
jle 0x3d19f
movq %rdi, 0x38(%rsp)
cwtl
movl %r9d, %edx
sarl $0xf, %edx
movl %edx, %edi
addl %eax, %edi
js 0x3d23f
cmpl $0x1e00, %edi           # imm = 0x1E00
jge 0x3d201
movswl %cx, %ecx
leal -0x1(%rcx), %esi
addl %esi, %edx
js 0x3d220
cmpl $0x1e00, %edx           # imm = 0x1E00
jge 0x3d1e2
movq %rcx, 0x28(%rsp)
movl %eax, 0x30(%rsp)
movl %r9d, 0x10(%rsp)
movl %edi, %ecx
leaq 0x3feed8(%rip), %rax    # 0x43be60
leaq (%rax,%rcx,8), %rdi
cmpq %r14, %rdi
movl %esi, 0xc(%rsp)
ja 0x3d022
movslq 0x3d2064(%rip), %r9     # 0x40f004
movslq 0x3d6889(%rip), %r10    # 0x413830
movl 0x3d687e(%rip), %r11d   # 0x41382c
movswl 0x3d6872(%rip), %r8d    # 0x413828
decl %r8d
xorps %xmm0, %xmm0
cvtsi2ss %r13d, %xmm0
movd %xmm0, %esi
movl %esi, %ecx
shrl $0xa, %ecx
andl $0x1ffc, %ecx           # imm = 0x1FFC
movl (%rcx,%rbp), %eax
leal 0x800000(%rsi), %ecx
shrl $0x17, %ecx
sarl %cl, %eax
sarl $0x1f, %esi
xorl %eax, %esi
movslq %esi, %rcx
imulq %r10, %rcx
shrq $0x18, %rcx
sarl $0x8, %ecx
addl %r11d, %ecx
testl %ecx, %ecx
jg 0x3cffa
xorl %ecx, %ecx
cmpl %r8d, %ecx
jl 0x3d002
movl %r8d, %ecx
shll $0x8, %ecx
movslq %ecx, %rax
leaq 0x35aad1(%rip), %rcx    # 0x397ae0
addq (%rcx,%r9,8), %rax
movq %rax, (%r14)
addq $-0x8, %r14
subl %ebx, %r13d
cmpq %r14, %rdi
jbe 0x3cfb9
movl %edx, %ecx
leaq 0x3fee35(%rip), %rax    # 0x43be60
leaq (%rax,%rcx,8), %rdx
cmpq %r12, %rdx
jb 0x3d0c2
movslq 0x3d1fc5(%rip), %rdi    # 0x40f004
movslq 0x3d67ea(%rip), %r9     # 0x413830
movl 0x3d67df(%rip), %r10d   # 0x41382c
movswl 0x3d67d3(%rip), %r8d    # 0x413828
decl %r8d
xorps %xmm0, %xmm0
cvtsi2ss %r15d, %xmm0
movd %xmm0, %eax
movl %eax, %ecx
shrl $0xa, %ecx
andl $0x1ffc, %ecx           # imm = 0x1FFC
movl (%rcx,%rbp), %esi
leal 0x800000(%rax), %ecx
shrl $0x17, %ecx
sarl %cl, %esi
sarl $0x1f, %eax
xorl %esi, %eax
movslq %eax, %rcx
imulq %r9, %rcx
shrq $0x18, %rcx
sarl $0x8, %ecx
addl %r10d, %ecx
testl %ecx, %ecx
jg 0x3d099
xorl %ecx, %ecx
cmpl %r8d, %ecx
jl 0x3d0a1
movl %r8d, %ecx
shll $0x8, %ecx
movslq %ecx, %rax
leaq 0x35aa32(%rip), %rcx    # 0x397ae0
addq (%rcx,%rdi,8), %rax
movq %rax, (%r12)
addq $0x8, %r12
addl %ebx, %r15d
cmpq %r12, %rdx
jae 0x3d058
movl 0x3d6778(%rip), %eax    # 0x413840
sarl $0xa, %eax
movl %eax, 0x415a23(%rip)    # 0x452af4
movl 0x3d676d(%rip), %eax    # 0x413844
sarl $0xa, %eax
movl %eax, 0x415a18(%rip)    # 0x452af8
movslq 0x415a05(%rip), %rax    # 0x452aec
movslq 0xc(%rsp), %rcx
imulq %rcx, %rax
shrq $0x10, %rax
movl 0x415a02(%rip), %esi    # 0x452afc
sarl $0x6, %esi
addl %eax, %esi
movslq %esi, %rax
movq %rax, 0x3d8b57(%rip)    # 0x415c60
leaq 0x3d8b90(%rip), %rsi    # 0x415ca0
movslq (%rsi,%rcx,4), %rdi
movq %rbp, %rcx
movq 0x38(%rsp), %rbp
addq %rbp, %rdi
addq 0x39966a(%rip), %rdi    # 0x3d6790
sarl $0x3, %eax
xorps %xmm0, %xmm0
cvtsi2ss %eax, %xmm0
movd %xmm0, %esi
movl %esi, %eax
shrl $0xa, %eax
andl $0x1ffc, %eax           # imm = 0x1FFC
movl (%rax,%rcx), %eax
leal 0x800000(%rsi), %ecx
shrl $0x17, %ecx
sarl %cl, %eax
sarl $0x1f, %esi
xorl %eax, %esi
movq 0x28(%rsp), %rcx
subl 0x30(%rsp), %ecx
movl 0x3d66d7(%rip), %r8d    # 0x413838
movl 0x3d66d4(%rip), %r9d    # 0x41383c
callq 0x6ddcc
movq %rbp, %rdi
testb $0xf, %dil
jne 0x3d180
callq 0xab51
movq 0x38(%rsp), %rdi
leaq 0x40dcd9(%rip), %rbp    # 0x44ae60
movq 0x20(%rsp), %r8
movl 0x10(%rsp), %r9d
leaq 0x3959f8(%rip), %r10    # 0x3d2b90
leaq 0x3977f1(%rip), %rsi    # 0x3d4990
movl 0x41595b(%rip), %eax    # 0x452b00
addl %eax, 0x3d6695(%rip)    # 0x413840
movl 0x415953(%rip), %eax    # 0x452b04
addl %eax, 0x3d668d(%rip)    # 0x413844
movl 0x41594b(%rip), %eax    # 0x452b08
addl %eax, 0x415939(%rip)    # 0x452afc
addl %r8d, %r9d
incq %rdi
cmpl %edi, 0x18(%rsp)
jne 0x3cef4
addq $0x58, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x393e0(%rip), %rdi     # 0x765c9
leaq 0x38e9e(%rip), %rsi     # 0x7608e
leaq 0x39334(%rip), %rcx     # 0x7652b
movl $0x8a5, %edx            # imm = 0x8A5
callq 0x61b0
leaq 0x39388(%rip), %rdi     # 0x76590
leaq 0x38e7f(%rip), %rsi     # 0x7608e
leaq 0x39315(%rip), %rcx     # 0x7652b
movl $0x8a3, %edx            # imm = 0x8A3
callq 0x61b0
leaq 0x3938d(%rip), %rdi     # 0x765b4
leaq 0x38e60(%rip), %rsi     # 0x7608e
leaq 0x392f6(%rip), %rcx     # 0x7652b
movl $0x8a4, %edx            # imm = 0x8A4
callq 0x61b0
leaq 0x39311(%rip), %rdi     # 0x76557
leaq 0x38e41(%rip), %rsi     # 0x7608e
leaq 0x392d7(%rip), %rcx     # 0x7652b
movl $0x8a2, %edx            # imm = 0x8A2
callq 0x61b0
leaq 0x392a6(%rip), %rdi     # 0x7650b
leaq 0x38e22(%rip), %rsi     # 0x7608e
leaq 0x392b8(%rip), %rcx     # 0x7652b
movl $0x88e, %edx            # imm = 0x88E
callq 0x61b0
leaq 0x392d3(%rip), %rdi     # 0x76557
leaq 0x38e03(%rip), %rsi     # 0x7608e
leaq 0x39299(%rip), %rcx     # 0x7652b
movl $0x899, %edx            # imm = 0x899
callq 0x61b0
leaq 0x392c9(%rip), %rdi     # 0x7656c
leaq 0x38de4(%rip), %rsi     # 0x7608e
leaq 0x3927a(%rip), %rcx     # 0x7652b
movl $0x89a, %edx            # imm = 0x89A
callq 0x61b0