// File: /workspace/github_c_makefile_star2_O2/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 $0x88, %rsp
movl %ecx, %ebp
movl %edx, %r14d
movl %esi, %r13d
movl %edi, 0x10(%rsp)
movl 0x22ad3c(%rip), %ebx    # 0x264a60
movl 0x1f9d26(%rip), %esi    # 0x233a50
movl 0x1f9d24(%rip), %edx    # 0x233a54
movswl %r14w, %edi
testl %ecx, %ecx
je 0x39d58
callq 0x370fb
cmpl %eax, %ebx
jge 0x3a6d6
pushq $0x8
popq %rax
pushq $0x1a
popq %rcx
pushq $0x1d
popq %rdx
pushq $0x1c
popq %rsi
pushq $0x18
popq %rdi
pushq $0xe
jmp 0x39d76
callq 0x371c4
cmpl %eax, %ebx
jle 0x3a6d6
pushq $0x4
popq %rax
pushq $0x12
popq %rcx
pushq $0x15
popq %rdx
pushq $0x14
popq %rsi
pushq $0x10
popq %rdi
pushq $0xc
popq %r8
movslq %r14d, %r9
imulq $0x28, %r9, %r9
leaq 0x202cda(%rip), %r12    # 0x23ca60
addq %r9, %r12
movswl (%r12,%r8), %r8d
movl %r8d, 0x3cf26b(%rip)    # 0x409000
movzwl (%r12,%rdi), %ebx
movswq %bx, %rdi
movw %di, 0x3cf26b(%rip)     # 0x409010
movsbl (%r12,%rsi), %esi
movl %esi, 0x3d3a7c(%rip)    # 0x40d82c
movzbl (%r12,%rdx), %edx
movl %edx, 0x3cf249(%rip)    # 0x409004
leaq 0x357d1e(%rip), %rsi    # 0x391ae0
cmpq $0x0, (%rsi,%rdx,8)
jne 0x39dd0
andl $0x0, 0x3cf234(%rip)    # 0x409004
movswl (%r12,%rcx), %r15d
movl (%r12,%rax), %r14d
leaq 0x1f9c80(%rip), %rax    # 0x233a60
testb $-0x40, (%rax,%rdi,4)
je 0x39df9
movswl %bx, %edi
xorl %esi, %esi
callq 0x2163b
addl %eax, %ebx
movw %bx, 0x3cf217(%rip)     # 0x409010
movswl %bx, %edi
callq 0x2cc16
movswq 0x3cf207(%rip), %rdi    # 0x409010
leaq 0x3cf210(%rip), %rax    # 0x409020
cmpw $0x0, (%rax,%rdi,2)
jle 0x3a6d6
leaq 0x3c09be(%rip), %rax    # 0x3fa7e0
cmpw $0x0, (%rax,%rdi,2)
jle 0x3a6d6
movl %r14d, 0x24(%rsp)
movl %r13d, 0x4(%rsp)
movl %ebp, (%rsp)
leaq 0x35849f(%rip), %rax    # 0x3922e0
cmpq $0x0, (%rax,%rdi,8)
jne 0x39e4d
callq 0x2cc4a
movswq (%r12), %rax
shlq $0x5, %rax
leaq 0x177bf3(%rip), %rcx    # 0x1b1a50
movswq 0x8(%rax,%rcx), %rdx
shlq $0x5, %rdx
movslq (%rdx,%rcx), %r14
movslq (%rax,%rcx), %rdi
movq %rdi, 0x8(%rsp)
subq %rdi, %r14
movslq 0x4(%rdx,%rcx), %r13
movslq 0x4(%rax,%rcx), %rcx
movq %rcx, 0x30(%rsp)
subq %rcx, %r13
movl %r14d, %eax
imull %r14d, %eax
movl %r13d, %edi
imull %r13d, %edi
addl %eax, %edi
callq 0x22169
movl %eax, %edi
callq 0x2213b
movl %r15d, 0x74(%rsp)
movslq %r15d, %rsi
cltq
movq %rax, 0x80(%rsp)
imulq %rax, %rsi
shrq $0x15, %rsi
movl %r14d, %edi
imull %esi, %edi
movslq 0x22ebac(%rip), %r8     # 0x268a78
movslq 0x3f56c9(%rip), %rdx    # 0x42f59c
movslq 0x22eb96(%rip), %rbp    # 0x268a70
movslq 0x3d7f83(%rip), %rcx    # 0x411e64
movslq 0x10(%rsp), %rax
movq %rax, 0x68(%rsp)
subq %rcx, %rax
imulq %rdx, %rax
movl %ebp, %ecx
movq %r8, %r9
imulq %rax, %r9
imulq %rbp, %rax
imulq %rdx, %rbp
imulq %r8, %rdx
shrq $0x13, %rdx
negl %edx
shrq $0x13, %rbp
shll $0x4, %ecx
movslq 0x38de1d(%rip), %r10    # 0x3c7d38
movslq %ecx, %rcx
imulq %r10, %rcx
shrq $0x10, %rcx
shrq $0x1b, %r9
subl %r9d, %ecx
shll $0x4, %r8d
movslq %r8d, %r8
imulq %r10, %r8
shrq $0x10, %r8
shrq $0x1b, %rax
addl %r8d, %eax
movslq 0x38ddea(%rip), %r8     # 0x3c7d34
movq %r8, 0x60(%rsp)
movl %r8d, %r9d
shll $0x9, %r9d
imull %r13d, %esi
negl %esi
movslq %edi, %r10
movslq %eax, %rdi
movq %rdi, 0x78(%rsp)
imulq %r10, %rdi
movslq %esi, %r11
movslq %ecx, %rsi
movq %rsi, 0x38(%rsp)
imulq %r11, %rsi
addq %rdi, %rsi
shrq $0x11, %rsi
movslq 0x23ab14(%rip), %rdi    # 0x274a9c
pushq $0x1
popq %r8
subq %rdi, %r8
movslq %r9d, %rdi
imulq %r8, %rdi
shrq $0xa, %rdi
subl %esi, %edi
movl %edi, 0x412b5a(%rip)    # 0x44cafc
movslq %ebp, %r15
movq %r15, %rsi
movq %r10, 0x50(%rsp)
imulq %r10, %rsi
movslq %edx, %rbx
movq %rbx, %rdi
movq %r11, 0x48(%rsp)
imulq %r11, %rdi
addq %rsi, %rdi
movl %edx, 0x412b37(%rip)    # 0x44cb00
movl %ebp, 0x412b35(%rip)    # 0x44cb04
shrq $0x19, %rdi
negl %edi
movl %edi, 0x412b2d(%rip)    # 0x44cb08
movl 0x1f9a6f(%rip), %esi    # 0x233a50
movl %esi, 0x28(%rsp)
movl %esi, %edi
shll $0x8, %edi
movl %edi, 0x3d3848(%rip)    # 0x40d838
movl 0x1f9a5e(%rip), %esi    # 0x233a54
movl %esi, 0x18(%rsp)
shll $0x8, %esi
negl %esi
movl %esi, 0x3d3837(%rip)    # 0x40d83c
movl %ecx, 0x3d3835(%rip)    # 0x40d840
movl %eax, 0x3d3833(%rip)    # 0x40d844
movl %r9d, 0x58(%rsp)
movl %r9d, 0x412acf(%rip)    # 0x44caec
movl 0x3cefdc(%rip), %r11d   # 0x409000
testb $0x40, %r11b
movl %r11d, 0x10(%rsp)
je 0x3a136
movl 0x74(%rsp), %edi
imull %edi, %edi
addl $0x1000000, %edi        # imm = 0x1000000
callq 0x22169
movq 0x80(%rsp), %rcx
imulq %rcx, %r14
shrq $0xe, %r14
movslq %r14d, %rsi
imulq %rcx, %r13
shrq $0xe, %r13
movslq %r13d, %rdx
negl %ebp
movslq %ebp, %r8
imulq %rsi, %r8
movq 0x8(%rsp), %rcx
subl 0x28(%rsp), %ecx
shll $0x8, %ecx
movl 0x18(%rsp), %edi
subl 0x30(%rsp), %edi
shll $0x8, %edi
movslq %ecx, %r9
negl %ecx
movslq %ecx, %r11
imulq %rsi, %r11
movslq %edi, %r10
movq %rdx, %rdi
imulq %r10, %rdi
imulq %rsi, %r10
movq %rsi, %r14
movq %rdx, %rcx
movq 0x78(%rsp), %r13
imulq %r13, %rcx
negl %r13d
movslq %r13d, %r13
imulq %rsi, %r13
imulq %rbx, %rsi
imulq %rdx, %r15
addq %rsi, %r15
imulq %rdx, %rbx
addq %r8, %rbx
addq %r11, %rdi
movl 0x10(%rsp), %r11d
shrq $0x10, %r15
movl %r15d, 0x412a25(%rip)   # 0x44cb00
shrq $0x10, %rbx
movslq %ebx, %rbp
movslq %eax, %r8
imulq %r8, %rbp
shrq $0xc, %rbp
movl %ebp, 0x412a11(%rip)    # 0x44cb04
shrq $0x10, %rdi
imulq %rdx, %r9
addq %r10, %r9
shrq $0x10, %r9
movslq %r9d, %rsi
imulq %r8, %rsi
shrq $0xc, %rsi
movq 0x38(%rsp), %rax
imulq %rax, %r14
addq %r14, %rcx
shrq $0x10, %rcx
imulq %rax, %rdx
addq %r13, %rdx
shrq $0x10, %rdx
movslq %edx, %rax
imulq %r8, %rax
shrq $0xc, %rax
movl %r15d, %edx
testb $0x4, %r11b
movl 0x24(%rsp), %ebx
jne 0x3a147
movl %esi, %r10d
movl %edi, %esi
jmp 0x3a16a
movl %ebp, %r8d
negl %r8d
negl %edx
movl %edi, 0x3d36e7(%rip)    # 0x40d83c
movl %eax, %r9d
negl %r9d
negl %ecx
movl %edx, %ebp
movl %ecx, %eax
movl %edi, %r10d
movl %r8d, %edx
movl %r9d, %ecx
movl (%rsp), %edi
testb $0x10, %r11b
movq %r12, 0x40(%rsp)
je 0x3a184
negl %esi
movl %esi, 0x3d36b8(%rip)    # 0x40d838
negl %ecx
negl %edx
xorl %r9d, %r9d
testb %dil, %dil
setne %r9b
movl %r10d, %r8d
negl %r8d
movl %eax, %r11d
negl %r11d
movl %ebp, %edi
negl %edi
movl 0x10(%rsp), %r12d
testb $0x20, %r12b
cmovel %r10d, %r8d
cmovel %ebp, %edi
cmovel %eax, %r11d
movl 0x18(%rsp), %eax
subl 0x30(%rsp), %eax
movl 0x28(%rsp), %r10d
subl 0x8(%rsp), %r10d
cltq
imulq 0x50(%rsp), %rax
movslq %r10d, %r10
imulq 0x48(%rsp), %r10
addq %rax, %r10
shrq $0x9, %r10
subl 0x22a87e(%rip), %ebx    # 0x264a60
shll $0x8, %ebx
addl %r10d, %ebx
movslq %ecx, %r15
movslq %ebx, %r10
imulq %r10, %r15
shrq $0x14, %r15
movslq %edx, %rbp
imulq %r10, %rbp
shrq $0x1c, %rbp
movl %r10d, %eax
negl %eax
movslq %r11d, %r14
cltq
imulq %rax, %r14
shrq $0x14, %r14
movslq %edi, %r13
imulq %rax, %r13
shrq $0x1c, %r13
movswq 0x3cedea(%rip), %rdx    # 0x409010
leaq 0x3d3623(%rip), %rax    # 0x40d850
movq %rdx, 0x8(%rsp)
movzbl (%rdx,%rax), %ebx
movl %ebx, %r11d
andl $0xf, %r11d
movl %ebx, %edi
shrl $0x4, %edi
andl $0x8, %r12d
cmpl $0x1, %r12d
pushq $0x9
popq %rax
sbbl $0x0, %eax
movl %eax, %edx
subl %r11d, %edx
leal 0xc(%rdx), %ecx
shll %cl, %esi
movl %edx, %ecx
shll %cl, %r15d
shll %cl, %ebp
subl %edi, %eax
movl %r15d, 0x3d35d6(%rip)   # 0x40d840
movl %ebp, 0x412890(%rip)    # 0x44cb00
leal 0xc(%rax), %ecx
shll %cl, %r8d
movl %eax, %ecx
shll %cl, %r14d
shll %cl, %r13d
movl %r14d, 0x3d35bf(%rip)   # 0x40d844
movl %r13d, 0x412878(%rip)   # 0x44cb04
movq 0x40(%rsp), %rcx
movzbl 0x16(%rcx,%r9,8), %eax
shll $0x18, %eax
addl %esi, %eax
movl %eax, 0x3d3596(%rip)    # 0x40d838
movzbl 0x17(%rcx,%r9,8), %eax
shll $0x18, %eax
addl %r8d, %eax
movl %eax, 0x3d3588(%rip)    # 0x40d83c
movl 0x58(%rsp), %eax
sarl $0xd, %eax
negl %eax
movl %eax, 0x3d5991(%rip)    # 0x40fc54
movb 0x20(%rcx), %cl
movl 0x38da74(%rip), %eax    # 0x3c7d40
testb %cl, %cl
je 0x3a2e1
movslq %eax, %rdx
addb $0x10, %cl
movzbl %cl, %eax
imulq %rdx, %rax
shrq $0x4, %rax
movl 0x4(%rsp), %r14d
cltq
imulq %rax, %r10
shrq $0xd, %r10
movslq %r10d, %rax
imulq 0x60(%rsp), %rax
shrq $0x10, %rax
movl %eax, 0x3d352d(%rip)    # 0x40d830
shll $0x4, %ebx
andl $0xf00, %ebx            # imm = 0xF00
orl %r11d, %ebx
leaq 0x357fca(%rip), %rax    # 0x3922e0
movq 0x8(%rsp), %rcx
movq (%rax,%rcx,8), %rsi
xorl %edx, %edx
subl 0x3d597d(%rip), %edx    # 0x40fca4
movl %ebx, %edi
callq 0x64280
movl 0x23a760(%rip), %eax    # 0x274a94
cmpl $0x1dfc, %eax           # imm = 0x1DFC
movl (%rsp), %r8d
jge 0x3a745
movslq 0x4127be(%rip), %rcx    # 0x44cb08
movslq 0x23a747(%rip), %r9     # 0x274a98
imulq %rcx, %r9
shrq $0x10, %r9
shll $0xf, %eax
movl $0xefe0000, %ecx        # imm = 0xEFE0000
subl %eax, %ecx
testl %r9d, %r9d
movl $0x20000, %r10d         # imm = 0x20000
cmovlel %ecx, %r10d
leaq 0x392819(%rip), %r11    # 0x3ccb90
movq 0x68(%rsp), %r13
movzwl (%r11,%r13,2), %eax
testb %r8b, %r8b
je 0x3a398
leaq 0x4108e3(%rip), %rcx    # 0x44ac70
movzwl (%rcx,%r13,2), %ecx
cmpw %cx, %ax
cmovlel %ecx, %eax
movswl %ax, %edx
movl %r10d, %ecx
sarl $0xf, %ecx
addl %edx, %ecx
js 0x3a764
cmpl $0x1dfe, %ecx           # imm = 0x1DFE
ja 0x3a783
movslq 0x412730(%rip), %rdx    # 0x44caec
movl %edx, %r15d
sarl $0x10, %r15d
movl %edx, %esi
shrl $0x10, %esi
movl %r15d, %edi
negl %edi
testl %edx, %edx
cmovgl %esi, %edi
movswq %ax, %rax
imulq %rdx, %rax
shrq $0x10, %rax
movl 0x412718(%rip), %ebp    # 0x44cafc
movl %ebp, %edx
sarl $0x6, %edx
addl %edi, %edx
addl %eax, %edx
movq %r15, 0x28(%rsp)
movq %rdx, 0x10(%rsp)
leal (%rdx,%r15), %eax
movl %eax, 0x8(%rsp)
movl %ecx, %eax
leaq 0x3fba58(%rip), %rcx    # 0x435e60
leaq (%rcx,%rax,8), %r12
leaq 0x8(%rcx,%rax,8), %rsi
movslq %r14d, %rdi
leaq 0x394575(%rip), %rbx    # 0x3ce990
movq %r9, 0x40(%rsp)
movq %rdi, 0x38(%rsp)
cmpq %rdi, %r13
jg 0x3a6d6
movzwl (%r11,%r13,2), %eax
testb %r8b, %r8b
je 0x3a451
leaq 0x410831(%rip), %rcx    # 0x44ac70
movzwl (%rcx,%r13,2), %ecx
cmpw %cx, %ax
cmovlel %ecx, %eax
movzwl (%rbx,%r13,2), %ecx
jmp 0x3a468
movzwl (%rbx,%r13,2), %edx
leaq 0x40ea13(%rip), %rcx    # 0x448e70
movzwl (%rcx,%r13,2), %ecx
cmpw %cx, %dx
cmovll %edx, %ecx
cmpw %ax, %cx
jle 0x3a6a1
movswl %ax, %r8d
movl %r10d, %eax
sarl $0xf, %eax
movl %eax, %edx
addl %r8d, %edx
js 0x3a707
cmpl $0x1e00, %edx           # imm = 0x1E00
jae 0x3a726
movl %r8d, 0x60(%rsp)
movl %ebp, 0x24(%rsp)
movl %r10d, 0x4(%rsp)
movq %r13, 0x68(%rsp)
movswl %cx, %ecx
movq %rcx, 0x58(%rsp)
decl %ecx
movl %ecx, 0x50(%rsp)
addl %ecx, %eax
cmpl $0x1e00, %eax           # imm = 0x1E00
jae 0x3a6e8
movl %edx, %ecx
leaq 0x3fb997(%rip), %rdx    # 0x435e60
leaq (%rdx,%rcx,8), %rcx
movq %rcx, 0x18(%rsp)
movl %eax, %eax
movq %rax, 0x48(%rsp)
movslq 0x3ceb24(%rip), %rax    # 0x409004
movq %rax, 0x30(%rsp)
movslq 0x3d3344(%rip), %r13    # 0x40d830
movl 0x3d3339(%rip), %r14d   # 0x40d82c
movswl 0x3d332d(%rip), %r15d   # 0x40d828
decl %r15d
cmpq %r12, 0x18(%rsp)
ja 0x3a569
movq %rsi, %rbx
movq %r12, %rbp
leaq 0x3575ce(%rip), %rax    # 0x391ae0
movq 0x30(%rsp), %rcx
movq (%rax,%rcx,8), %r12
movq 0x10(%rsp), %rdi
callq 0x2213b
cltq
imulq %r13, %rax
shrq $0x18, %rax
sarl $0x8, %eax
addl %r14d, %eax
testl %eax, %eax
jg 0x3a53b
xorl %eax, %eax
cmpl %r15d, %eax
jl 0x3a543
movl %r15d, %eax
shll $0x8, %eax
cltq
addq %r12, %rax
movq %rbp, %r12
movq %rax, (%rbp)
addq $-0x8, %r12
movq 0x10(%rsp), %rax
subl 0x28(%rsp), %eax
movq %rax, 0x10(%rsp)
movq %rbx, %rsi
jmp 0x3a4fe
leaq 0x3fb8f0(%rip), %rax    # 0x435e60
movq 0x48(%rsp), %rcx
leaq (%rax,%rcx,8), %rax
movq %rax, 0x18(%rsp)
movq %rsi, %rbx
cmpq %rsi, 0x18(%rsp)
jb 0x3a5e5
movq %r12, %rbp
leaq 0x35754e(%rip), %rax    # 0x391ae0
movq 0x30(%rsp), %rcx
movq (%rax,%rcx,8), %r12
movl 0x8(%rsp), %edi
callq 0x2213b
cltq
imulq %r13, %rax
shrq $0x18, %rax
sarl $0x8, %eax
addl %r14d, %eax
testl %eax, %eax
jg 0x3a5ba
xorl %eax, %eax
cmpl %r15d, %eax
movq %rbx, %rsi
jl 0x3a5c5
movl %r15d, %eax
shll $0x8, %eax
cltq
addq %r12, %rax
movq %rax, (%rsi)
addq $0x8, %rsi
movl 0x8(%rsp), %eax
addl 0x28(%rsp), %eax
movl %eax, 0x8(%rsp)
movq %rbp, %r12
jmp 0x3a57e
movl 0x3d3255(%rip), %eax    # 0x40d840
sarl $0xa, %eax
movl %eax, 0x412500(%rip)    # 0x44caf4
movl 0x3d324a(%rip), %eax    # 0x40d844
sarl $0xa, %eax
movl %eax, 0x4124f5(%rip)    # 0x44caf8
movslq 0x4124e2(%rip), %rax    # 0x44caec
movslq 0x50(%rsp), %rcx
imulq %rcx, %rax
shrq $0x10, %rax
movl 0x24(%rsp), %edx
sarl $0x6, %edx
addl %eax, %edx
movslq %edx, %rdi
movq %rdi, 0x3d5636(%rip)    # 0x40fc60
leaq 0x3d566f(%rip), %rax    # 0x40fca0
movslq (%rax,%rcx,4), %r14
movq 0x68(%rsp), %r13
addq %r13, %r14
addq 0x39614c(%rip), %r14    # 0x3d0790
sarl $0x3, %edi
callq 0x2213b
movq 0x58(%rsp), %rcx
subl 0x60(%rsp), %ecx
movl 0x3d31dc(%rip), %r8d    # 0x40d838
movl 0x3d31d9(%rip), %r9d    # 0x40d83c
movq %r14, %rdi
movl %eax, %esi
movq 0x18(%rsp), %rdx
callq 0x642a1
testb $0xf, %r13b
jne 0x3a67d
callq 0x9fd2
movl (%rsp), %r8d
movq 0x40(%rsp), %r9
movl 0x4(%rsp), %r10d
leaq 0x3924fe(%rip), %r11    # 0x3ccb90
movq %rbx, %rsi
movq 0x38(%rsp), %rdi
leaq 0x3942ef(%rip), %rbx    # 0x3ce990
movl 0x412459(%rip), %eax    # 0x44cb00
addl %eax, 0x3d3193(%rip)    # 0x40d840
movl 0x412451(%rip), %eax    # 0x44cb04
addl %eax, 0x3d318b(%rip)    # 0x40d844
movl 0x41243d(%rip), %ebp    # 0x44cafc
addl 0x412443(%rip), %ebp    # 0x44cb08
movl %ebp, 0x412431(%rip)    # 0x44cafc
addl %r9d, %r10d
incq %r13
jmp 0x3a425
addq $0x88, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x31f05(%rip), %rdi     # 0x6c5f4
leaq 0x319d8(%rip), %rsi     # 0x6c0ce
leaq 0x31e6e(%rip), %rcx     # 0x6c56b
movl $0x8a5, %edx            # imm = 0x8A5
callq 0x61b0
leaq 0x31e89(%rip), %rdi     # 0x6c597
leaq 0x319b9(%rip), %rsi     # 0x6c0ce
leaq 0x31e4f(%rip), %rcx     # 0x6c56b
movl $0x8a2, %edx            # imm = 0x8A2
callq 0x61b0
leaq 0x31ea3(%rip), %rdi     # 0x6c5d0
leaq 0x3199a(%rip), %rsi     # 0x6c0ce
leaq 0x31e30(%rip), %rcx     # 0x6c56b
movl $0x8a3, %edx            # imm = 0x8A3
callq 0x61b0
leaq 0x31dff(%rip), %rdi     # 0x6c54b
leaq 0x3197b(%rip), %rsi     # 0x6c0ce
leaq 0x31e11(%rip), %rcx     # 0x6c56b
movl $0x88e, %edx            # imm = 0x88E
callq 0x61b0
leaq 0x31e2c(%rip), %rdi     # 0x6c597
leaq 0x3195c(%rip), %rsi     # 0x6c0ce
leaq 0x31df2(%rip), %rcx     # 0x6c56b
movl $0x899, %edx            # imm = 0x899
callq 0x61b0
leaq 0x31e22(%rip), %rdi     # 0x6c5ac
leaq 0x3193d(%rip), %rsi     # 0x6c0ce
leaq 0x31dd3(%rip), %rcx     # 0x6c56b
movl $0x89a, %edx            # imm = 0x89A
callq 0x61b0