// File: /workspace/github_c_makefile_star2_O1/jonof[P]jftekwar/jfbuild/src/engine.c
// Function: wallmost
int wallmost(short *mostbuf, int w, int sectnum, unsigned char dastat)
{
	int bad, i, j, t, y, z, inty, intz, xcross, yinc, fw;
	int x1, y1, z1, x2, y2, z2, xv, yv, dx, dy, dasqr, oz1, oz2;
	int s1, s2, s3, s4, ix1, ix2, iy1, iy2;

	if (dastat == 0)
	{
		z = sector[sectnum].ceilingz-globalposz;
		if ((sector[sectnum].ceilingstat&2) == 0) return(owallmost(mostbuf,w,z));
	}
	else
	{
		z = sector[sectnum].floorz-globalposz;
		if ((sector[sectnum].floorstat&2) == 0) return(owallmost(mostbuf,w,z));
	}

	i = thewall[w];
	if (i == sector[sectnum].wallptr) return(owallmost(mostbuf,w,z));

	x1 = wall[i].x; x2 = wall[wall[i].point2].x-x1;
	y1 = wall[i].y; y2 = wall[wall[i].point2].y-y1;

	fw = sector[sectnum].wallptr; i = wall[fw].point2;
	dx = wall[i].x-wall[fw].x; dy = wall[i].y-wall[fw].y;
	dasqr = krecipasm(nsqrtasm(dx*dx+dy*dy));

	if (xb1[w] == 0)
		{ xv = cosglobalang+sinviewingrangeglobalang; yv = singlobalang-cosviewingrangeglobalang; }
	else
		{ xv = x1-globalposx; yv = y1-globalposy; }
	i = xv*(y1-globalposy)-yv*(x1-globalposx); j = yv*x2-xv*y2;
	if (klabs(j) > klabs(i>>3)) i = divscale28(i,j);
	if (dastat == 0)
	{
		t = mulscale15(sector[sectnum].ceilingheinum,dasqr);
		z1 = sector[sectnum].ceilingz;
	}
	else
	{
		t = mulscale15(sector[sectnum].floorheinum,dasqr);
		z1 = sector[sectnum].floorz;
	}
	z1 = dmulscale24(dx*t,mulscale20(y2,i)+((y1-wall[fw].y)<<8),
						 -dy*t,mulscale20(x2,i)+((x1-wall[fw].x)<<8))+((z1-globalposz)<<7);


	if (xb2[w] == xdimen-1)
		{ xv = cosglobalang-sinviewingrangeglobalang; yv = singlobalang+cosviewingrangeglobalang; }
	else
		{ xv = (x2+x1)-globalposx; yv = (y2+y1)-globalposy; }
	i = xv*(y1-globalposy)-yv*(x1-globalposx); j = yv*x2-xv*y2;
	if (klabs(j) > klabs(i>>3)) i = divscale28(i,j);
	if (dastat == 0)
	{
		t = mulscale15(sector[sectnum].ceilingheinum,dasqr);
		z2 = sector[sectnum].ceilingz;
	}
	else
	{
		t = mulscale15(sector[sectnum].floorheinum,dasqr);
		z2 = sector[sectnum].floorz;
	}
	z2 = dmulscale24(dx*t,mulscale20(y2,i)+((y1-wall[fw].y)<<8),
						 -dy*t,mulscale20(x2,i)+((x1-wall[fw].x)<<8))+((z2-globalposz)<<7);


	s1 = mulscale20(globaluclip,yb1[w]); s2 = mulscale20(globaluclip,yb2[w]);
	s3 = mulscale20(globaldclip,yb1[w]); s4 = mulscale20(globaldclip,yb2[w]);
	bad = (z1<s1)+((z2<s2)<<1)+((z1>s3)<<2)+((z2>s4)<<3);

	ix1 = xb1[w]; ix2 = xb2[w];
	iy1 = yb1[w]; iy2 = yb2[w];
	oz1 = z1; oz2 = z2;

	if ((bad&3) == 3)
	{
		//clearbufbyte(&mostbuf[ix1],(ix2-ix1+1)*sizeof(mostbuf[0]),0L);
		for (i=ix1; i<=ix2; i++) mostbuf[i] = 0;
		return(bad);
	}

	if ((bad&12) == 12)
	{
		//clearbufbyte(&mostbuf[ix1],(ix2-ix1+1)*sizeof(mostbuf[0]),ydimen+(ydimen<<16));
		for (i=ix1; i<=ix2; i++) mostbuf[i] = ydimen;
		return(bad);
	}

	if (bad&3)
	{
			//inty = intz / (globaluclip>>16)
		t = divscale30(oz1-s1,s2-s1+oz1-oz2);
		inty = yb1[w] + mulscale30(yb2[w]-yb1[w],t);
		intz = oz1 + mulscale30(oz2-oz1,t);
		xcross = xb1[w] + scale(mulscale30(yb2[w],t),xb2[w]-xb1[w],inty);

		//t = divscale30((x1<<4)-xcross*yb1[w],xcross*(yb2[w]-yb1[w])-((x2-x1)<<4));
		//inty = yb1[w] + mulscale30(yb2[w]-yb1[w],t);
		//intz = z1 + mulscale30(z2-z1,t);

		if ((bad&3) == 2)
		{
			if (xb1[w] <= xcross) { z2 = intz; iy2 = inty; ix2 = xcross; }
			//clearbufbyte(&mostbuf[xcross+1],(xb2[w]-xcross)*sizeof(mostbuf[0]),0L);
			for (i=xcross+1; i<=xb2[w]; i++) mostbuf[i] = 0;
		}
		else
		{
			if (xcross <= xb2[w]) { z1 = intz; iy1 = inty; ix1 = xcross; }
			//clearbufbyte(&mostbuf[xb1[w]],(xcross-xb1[w]+1)*sizeof(mostbuf[0]),0L);
			for (i=xb1[w]; i<=xcross; i++) mostbuf[i] = 0;
		}
	}

	if (bad&12)
	{
			//inty = intz / (globaldclip>>16)
		t = divscale30(oz1-s3,s4-s3+oz1-oz2);
		inty = yb1[w] + mulscale30(yb2[w]-yb1[w],t);
		intz = oz1 + mulscale30(oz2-oz1,t);
		xcross = xb1[w] + scale(mulscale30(yb2[w],t),xb2[w]-xb1[w],inty);

		//t = divscale30((x1<<4)-xcross*yb1[w],xcross*(yb2[w]-yb1[w])-((x2-x1)<<4));
		//inty = yb1[w] + mulscale30(yb2[w]-yb1[w],t);
		//intz = z1 + mulscale30(z2-z1,t);

		if ((bad&12) == 8)
		{
			if (xb1[w] <= xcross) { z2 = intz; iy2 = inty; ix2 = xcross; }
			//clearbufbyte(&mostbuf[xcross+1],(xb2[w]-xcross)*sizeof(mostbuf[0]),ydimen+(ydimen<<16));
			for (i=xcross+1; i<=xb2[w]; i++) mostbuf[i] = ydimen;
		}
		else
		{
			if (xcross <= xb2[w]) { z1 = intz; iy1 = inty; ix1 = xcross; }
			//clearbufbyte(&mostbuf[xb1[w]],(xcross-xb1[w]+1)*sizeof(mostbuf[0]),ydimen+(ydimen<<16));
			for (i=xb1[w]; i<=xcross; i++) mostbuf[i] = ydimen;
		}
	}

	y = (scale(z1,xdimenscale,iy1)<<4);
	yinc = ((scale(z2,xdimenscale,iy2)<<4)-y) / (ix2-ix1+1);
	qinterpolatedown16short(&mostbuf[ix1],ix2-ix1+1,y+(globalhoriz<<16),yinc);

	if (mostbuf[ix1] < 0) mostbuf[ix1] = 0;
	if (mostbuf[ix1] > ydimen) mostbuf[ix1] = ydimen;
	if (mostbuf[ix2] < 0) mostbuf[ix2] = 0;
	if (mostbuf[ix2] > ydimen) mostbuf[ix2] = ydimen;

	return(bad);
}

// Assembly:
movslq %edx, %rax
leaq (%rax,%rax,4), %rax
leaq 0x21eca7(%rip), %r10    # 0x242a60
leaq (%r10,%rax,8), %r8
movl 0x246c9c(%rip), %r9d    # 0x26aa60
testl %ecx, %ecx
je 0x23f0e
movl 0x8(%r8), %edx
subl %r9d, %edx
testb $0x2, 0xe(%r8)
je 0x245f8
movslq %esi, %r11
leaq 0x213c68(%rip), %r9     # 0x237a50
movswq (%r9,%r11,2), %r9
movswq (%r10,%rax,8), %rax
cmpw %ax, %r9w
je 0x245f8
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x68, %rsp
movl %ecx, 0x48(%rsp)
movq %rdi, 0x40(%rsp)
shlq $0x5, %r9
leaq 0x193c32(%rip), %rcx    # 0x1b7a50
movl (%r9,%rcx), %esi
movl 0x4(%r9,%rcx), %r13d
movswq 0x8(%r9,%rcx), %rdx
shlq $0x5, %rdx
movl (%rdx,%rcx), %ebx
movl 0x4(%rdx,%rcx), %edi
movl %ebx, 0x14(%rsp)
subl %esi, %ebx
movl %edi, %r14d
subl %r13d, %r14d
shlq $0x5, %rax
movswq 0x8(%rax,%rcx), %rdx
shlq $0x5, %rdx
movl (%rax,%rcx), %r9d
movl 0x4(%rax,%rcx), %ebp
movl (%rdx,%rcx), %eax
movl 0x4(%rdx,%rcx), %r10d
movl %r9d, 0x20(%rsp)
subl %r9d, %eax
movl %ebp, 0x38(%rsp)
subl %ebp, %r10d
movl %eax, 0x24(%rsp)
movl %eax, %ecx
imull %eax, %ecx
movl %r10d, %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 0x43105f(%rip), %rcx    # 0x454f00
movzwl (%rcx,%rdx,2), %ecx
shrl %cl, %eax
leaq 0x433252(%rip), %rdx    # 0x457100
movzwl (%rdx,%rax,2), %eax
shrl $0x8, %ecx
shrl %cl, %eax
cvtsi2ss %eax, %xmm0
movd %xmm0, %ecx
movl %ecx, %eax
shrl $0xa, %eax
andl $0x1ffc, %eax           # imm = 0x1FFC
leaq 0x426f90(%rip), %rdx    # 0x44ae60
movl (%rax,%rdx), %ebp
addl $0x800000, %ecx         # imm = 0x800000
shrl $0x17, %ecx
sarl %cl, %ebp
leaq 0x246b8b(%rip), %rax    # 0x26aa70
movslq (%rax,%r11,4), %rax
movq %rax, 0x18(%rsp)
testq %rax, %rax
movq %r11, 0x60(%rsp)
je 0x23f25
movl %esi, %r12d
subl 0x215b4e(%rip), %r12d   # 0x239a50
leaq 0x215b4b(%rip), %rax    # 0x239a54
movl %r13d, %edx
jmp 0x23f40
movl 0x4(%r8), %edx
subl %r9d, %edx
testb $0x2, 0xc(%r8)
jne 0x23dde
jmp 0x245f8
movl 0x24ab48(%rip), %r12d   # 0x26ea74
addl 0x24ab3d(%rip), %r12d   # 0x26ea70
leaq 0x24ab42(%rip), %rax    # 0x26ea7c
movl 0x24ab38(%rip), %edx    # 0x26ea78
subl (%rax), %edx
movl 0x215b0c(%rip), %eax    # 0x239a54
movl %r13d, %r9d
movl %eax, 0x10(%rsp)
subl %eax, %r9d
movl %r9d, %r11d
imull %r12d, %r11d
movl 0x215af1(%rip), %eax    # 0x239a50
movl %eax, 0xc(%rsp)
movl %eax, %ecx
subl %esi, %ecx
movl %ecx, %eax
imull %edx, %eax
addl %r11d, %eax
imull %ebx, %edx
imull %r14d, %r12d
subl %r12d, %edx
movl %edx, %r11d
negl %r11d
cmovsl %edx, %r11d
movl %eax, %r15d
sarl $0x3, %r15d
movl %r15d, %r12d
negl %r12d
cmovsl %r15d, %r12d
cmpl %r12d, %r11d
movl %edi, 0x28(%rsp)
jbe 0x23fab
cltq
shlq $0x1c, %rax
movslq %edx, %r11
cqto
idivq %r11
xorl %r11d, %r11d
cmpb $0x0, 0x48(%rsp)
setne %r11b
movslq %ebp, %rdi
movswq 0x12(%r8,%r11,8), %rdx
movq %rdi, 0x58(%rsp)
imulq %rdi, %rdx
shrq $0xf, %rdx
movl 0x4(%r8,%r11,4), %edi
movl 0x24(%rsp), %r11d
imull %edx, %r11d
movslq %r14d, %r12
cltq
subl 0x38(%rsp), %r13d
movq %rax, %r15
imulq %r12, %r15
shrq $0x14, %r15
shll $0x8, %r13d
addl %r13d, %r15d
negl %r10d
imull %r10d, %edx
subl 0x20(%rsp), %esi
movslq %ebx, %rbp
imulq %rbp, %rax
shrq $0x14, %rax
shll $0x8, %esi
addl %esi, %eax
movslq %r11d, %r11
movslq %r15d, %r15
imulq %r11, %r15
movslq %edx, %rdx
cltq
imulq %rdx, %rax
addq %r15, %rax
shrq $0x18, %rax
movl 0x246a2d(%rip), %r15d   # 0x26aa60
subl %r15d, %edi
shll $0x7, %edi
movl %edi, 0x20(%rsp)
leaq 0x24aa3c(%rip), %rdx    # 0x26ea80
movq 0x60(%rsp), %r11
movl (%rdx,%r11,4), %edi
movl 0x7f7dd(%rip), %edx     # 0xa3830
decl %edx
movq %rdi, 0x38(%rsp)
cmpl %edx, %edi
jne 0x24078
movl 0x24aa0c(%rip), %edx    # 0x26ea70
subl 0x24aa0a(%rip), %edx    # 0x26ea74
movl 0x24aa0c(%rip), %edi    # 0x26ea7c
addl 0x24aa02(%rip), %edi    # 0x26ea78
jmp 0x24088
movl 0x14(%rsp), %edx
subl 0xc(%rsp), %edx
movl 0x28(%rsp), %edi
subl 0x10(%rsp), %edi
addl %eax, 0x20(%rsp)
imull %edx, %r9d
imull %edi, %ecx
addl %r9d, %ecx
imull %edi, %ebx
imull %edx, %r14d
subl %r14d, %ebx
movl %ebx, %eax
negl %eax
cmovsl %ebx, %eax
movl %ecx, %edx
sarl $0x3, %edx
movl %edx, %r9d
negl %r9d
cmovsl %edx, %r9d
cmpl %r9d, %eax
jbe 0x240cd
movslq %ecx, %rax
shlq $0x1c, %rax
movslq %ebx, %rcx
cqto
idivq %rcx
movq %rax, %rcx
xorl %eax, %eax
cmpb $0x0, 0x48(%rsp)
setne %al
movswq 0x12(%r8,%rax,8), %rdx
imulq 0x58(%rsp), %rdx
shrq $0xf, %rdx
movl 0x4(%r8,%rax,4), %r14d
movl 0x24(%rsp), %edi
imull %edx, %edi
movslq %ecx, %rax
imulq %rax, %r12
shrq $0x14, %r12
addl %r12d, %r13d
imull %edx, %r10d
imulq %rax, %rbp
shrq $0x14, %rbp
addl %ebp, %esi
movslq %edi, %rax
movslq %r13d, %rcx
imulq %rax, %rcx
movslq %r10d, %rax
movslq %esi, %rdx
imulq %rax, %rdx
addq %rcx, %rdx
shrq $0x18, %rdx
subl %r15d, %r14d
shll $0x7, %r14d
addl %edx, %r14d
movslq 0x24e945(%rip), %rdx    # 0x272a80
leaq 0x24e94e(%rip), %rax    # 0x272a90
movslq (%rax,%r11,4), %r12
movq %r12, %rax
imulq %rdx, %rax
shrq $0x14, %rax
leaq 0x252938(%rip), %rcx    # 0x276a90
movl (%rcx,%r11,4), %ecx
movslq %ecx, %rbp
imulq %rbp, %rdx
shrq $0x14, %rdx
movslq 0x256922(%rip), %r15    # 0x27aa90
movq %r15, %rbx
imulq %r12, %rbx
shrq $0x14, %rbx
imulq %rbp, %r15
shrq $0x14, %r15
xorl %esi, %esi
movl 0x20(%rsp), %r10d
movl %r10d, %edi
subl %eax, %edi
setl %sil
xorl %r8d, %r8d
cmpl %edx, %r14d
setl %r8b
leal (%rsi,%r8,2), %esi
xorl %r8d, %r8d
movl %r10d, %r13d
subl %ebx, %r13d
setg %r8b
xorl %r9d, %r9d
cmpl %r15d, %r14d
setg %r9b
shll $0x3, %r9d
leal (%r9,%r8,4), %r9d
leal (%r9,%rsi), %r8d
cmpl $0x3, %esi
jne 0x241fc
movq 0x18(%rsp), %rcx
movq 0x38(%rsp), %rdx
subl %ecx, %edx
movq 0x40(%rsp), %rax
jl 0x245e6
leaq (%rax,%rcx,2), %rdi
leaq 0x2(,%rdx,2), %rdx
xorl %esi, %esi
movl %r8d, %ebx
callq 0x62f0
movl %ebx, %r8d
jmp 0x245e6
movl %r13d, 0x24(%rsp)
movq %r9, 0x48(%rsp)
cmpl $0xc, %r9d
movq 0x40(%rsp), %r13
movq 0x38(%rsp), %r9
jne 0x2424e
subl 0x18(%rsp), %r9d
jl 0x245e6
movq 0x18(%rsp), %rax
leaq (,%rax,2), %rax
addq %r13, %rax
incl %r9d
xorl %ecx, %ecx
movzwl 0x256857(%rip), %edx    # 0x27aa94
movw %dx, (%rax,%rcx,2)
incq %rcx
cmpl %ecx, %r9d
jne 0x24236
jmp 0x245e6
testl %esi, %esi
movl %r8d, 0x58(%rsp)
je 0x24328
addl %r10d, %edx
addl %r14d, %eax
subl %eax, %edx
movslq %edi, %rax
shlq $0x1e, %rax
movslq %edx, %rdi
cqto
idivq %rdi
movl %ebp, %edx
subl %r12d, %edx
movslq %edx, %rdi
cltq
imulq %rax, %rdi
shrq $0x1e, %rdi
addl %r12d, %edi
movl %r14d, %edx
subl %r10d, %edx
movq %r12, 0x50(%rsp)
movslq %edx, %r12
imulq %rax, %r12
shrq $0x1e, %r12
addl %r10d, %r12d
movl %r9d, %edx
subl 0x18(%rsp), %edx
imulq %rbp, %rax
shrq $0x1e, %rax
movslq %eax, %r13
movslq %edx, %rax
imulq %r13, %rax
movslq %edi, %r13
cqto
idivq %r13
movq 0x18(%rsp), %rdx
addl %eax, %edx
cmpl $0x2, %esi
jne 0x24344
testl %eax, %eax
cmovsl %r14d, %r12d
movl %edx, %esi
cmovsl %r9d, %esi
movl %esi, 0x14(%rsp)
cmovsl %ecx, %edi
cmpl %r9d, %edx
movq 0x40(%rsp), %r13
jge 0x243c7
movq %rdi, 0x30(%rsp)
movslq %edx, %rcx
leaq 0x2(,%rcx,2), %rdi
addq %r13, %rdi
movq 0x18(%rsp), %rcx
movl %ecx, %edx
notl %edx
addl %r9d, %edx
subl %eax, %edx
movl %r12d, 0x10(%rsp)
movl %r10d, %eax
movq %rax, 0x28(%rsp)
movq 0x50(%rsp), %r12
movl %r12d, 0xc(%rsp)
jmp 0x243a0
movl %r14d, 0x10(%rsp)
movl %r10d, %eax
movq %rax, 0x28(%rsp)
movl %r9d, 0x14(%rsp)
movl %r12d, 0xc(%rsp)
jmp 0x243f5
cmpl %r9d, %edx
cmovgl %r10d, %r12d
movq %r12, 0x28(%rsp)
movl %edx, %esi
cmovgl 0x18(%rsp), %esi
movq 0x50(%rsp), %r12
cmovgl %r12d, %edi
testl %eax, %eax
movq 0x40(%rsp), %r13
js 0x243e0
movq %rdi, %rax
movq 0x18(%rsp), %r8
leaq (,%r8,2), %rdi
addq %r13, %rdi
cmpl %edx, %r8d
cmovgl %r8d, %edx
subl %r8d, %edx
movl %r14d, 0x10(%rsp)
movq %rsi, 0x18(%rsp)
movl %r9d, 0x14(%rsp)
movl %eax, 0xc(%rsp)
movl %ecx, %eax
movq %rax, 0x30(%rsp)
movl %edx, %eax
leaq 0x2(,%rax,2), %rdx
xorl %esi, %esi
callq 0x62f0
movq 0x60(%rsp), %r11
movq 0x38(%rsp), %r9
movl 0x20(%rsp), %r10d
movq 0x30(%rsp), %rdi
jmp 0x243f7
movl %r12d, 0x10(%rsp)
movl %r10d, %eax
movq %rax, 0x28(%rsp)
movq 0x50(%rsp), %r12
movl %r12d, 0xc(%rsp)
jmp 0x243f7
movl %r14d, 0x10(%rsp)
movl %esi, %eax
movq %rax, 0x18(%rsp)
movl %r9d, 0x14(%rsp)
movl %edi, 0xc(%rsp)
movl %ecx, %edi
movq 0x48(%rsp), %rax
testl %eax, %eax
je 0x244bf
movq %rdi, 0x30(%rsp)
addl %r10d, %r15d
addl %r14d, %ebx
subl %ebx, %r15d
movq %rax, %rbx
movslq 0x24(%rsp), %rax
shlq $0x1e, %rax
movslq %r15d, %rcx
cqto
idivq %rcx
movl %ebp, %ecx
subl %r12d, %ecx
movslq %ecx, %rcx
cltq
imulq %rax, %rcx
shrq $0x1e, %rcx
addl %r12d, %ecx
subl %r10d, %r14d
movslq %r14d, %rdi
imulq %rax, %rdi
shrq $0x1e, %rdi
addl %r10d, %edi
leaq 0x24661d(%rip), %rdx    # 0x26aa70
movslq (%rdx,%r11,4), %rsi
movl %r9d, %edx
subl %esi, %edx
imulq %rax, %rbp
shrq $0x1e, %rbp
movslq %ebp, %r8
movslq %edx, %rax
imulq %r8, %rax
movslq %ecx, %r8
cqto
idivq %r8
leal (%rsi,%rax), %edx
cmpl $0x8, %ebx
jne 0x244d4
testl %eax, %eax
movl 0x10(%rsp), %r10d
cmovnsl %edi, %r10d
movl 0x14(%rsp), %ebx
cmovnsl %edx, %ebx
movq 0x30(%rsp), %rdi
cmovnsl %ecx, %edi
cmpl %r9d, %edx
movq 0x28(%rsp), %r8
jge 0x244cd
movslq %r9d, %rax
movslq %edx, %rcx
movzwl 0x2565e5(%rip), %edx    # 0x27aa94
movw %dx, 0x2(%r13,%rcx,2)
incq %rcx
cmpq %rax, %rcx
jl 0x244a8
jmp 0x244cd
movl 0x14(%rsp), %ebx
movq 0x28(%rsp), %r8
movl 0x10(%rsp), %r10d
movl 0xc(%rsp), %r9d
jmp 0x24537
cmpl %r9d, %edx
movq 0x28(%rsp), %r8
cmovlel %edi, %r8d
movq 0x18(%rsp), %rdi
cmovlel %edx, %edi
movq %rdi, 0x18(%rsp)
movl 0xc(%rsp), %r9d
cmovlel %ecx, %r9d
testl %eax, %eax
movl 0x14(%rsp), %ebx
movl 0x10(%rsp), %r10d
js 0x24532
cmpl %edx, %esi
cmovgl %esi, %edx
leaq (,%rsi,2), %rax
addq %r13, %rax
subl %esi, %edx
incl %edx
xorl %ecx, %ecx
movq 0x30(%rsp), %rdi
movzwl 0x25656f(%rip), %esi    # 0x27aa94
movw %si, (%rax,%rcx,2)
incq %rcx
cmpl %ecx, %edx
jne 0x2451e
jmp 0x24537
movq 0x30(%rsp), %rdi
movslq 0x25655a(%rip), %rsi    # 0x27aa98
movslq %r8d, %rax
imulq %rsi, %rax
movslq %r9d, %rcx
cqto
idivq %rcx
movq %rax, %rcx
movslq %r10d, %rax
imulq %rsi, %rax
movslq %edi, %rsi
cqto
idivq %rsi
subl %ecx, %eax
shll $0x4, %ecx
shll $0x4, %eax
movl %ebx, %esi
movq 0x18(%rsp), %rdi
subl %edi, %esi
incl %esi
cltd
idivl %esi
movslq %edi, %rdx
leaq (,%rdx,2), %r14
addq %r13, %r14
movl 0x256513(%rip), %edx    # 0x27aa9c
shll $0x10, %edx
addl %ecx, %edx
movq %r14, %rdi
movl %eax, %ecx
callq 0x4abaa
cmpw $0x0, (%r14)
jns 0x245a5
movw $0x0, (%r14)
movswl (%r14), %ecx
movl 0x2564e5(%rip), %eax    # 0x27aa94
cmpl %ecx, %eax
movl 0x58(%rsp), %r8d
jge 0x245bc
movw %ax, (%r14)
movslq %ebx, %rax
cmpw $0x0, (%r13,%rax,2)
jns 0x245d0
movw $0x0, (%r13,%rax,2)
movswl (%r13,%rax,2), %edx
movl 0x2564b8(%rip), %ecx    # 0x27aa94
cmpl %edx, %ecx
jge 0x245e6
movw %cx, (%r13,%rax,2)
movl %r8d, %eax
addq $0x68, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq