LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_c_makefile_star2_O1/jonof[P]jftekwar/jfbuild/src/engine.c
// Function: deletespritesect
static int deletespritesect(short deleteme)
{
	if (sprite[deleteme].sectnum == MAXSECTORS)
		return(-1);

	if (headspritesect[sprite[deleteme].sectnum] == deleteme)
		headspritesect[sprite[deleteme].sectnum] = nextspritesect[deleteme];

	if (prevspritesect[deleteme] >= 0) nextspritesect[prevspritesect[deleteme]] = nextspritesect[deleteme];
	if (nextspritesect[deleteme] >= 0) prevspritesect[nextspritesect[deleteme]] = prevspritesect[deleteme];

	if (headspritesect[MAXSECTORS] >= 0) prevspritesect[headspritesect[MAXSECTORS]] = deleteme;
	prevspritesect[deleteme] = -1;
	nextspritesect[deleteme] = headspritesect[MAXSECTORS];
	headspritesect[MAXSECTORS] = deleteme;

	sprite[deleteme].sectnum = MAXSECTORS;
	return(0);
}

// Assembly:
movslq %edi, %rcx
imulq $0x2c, %rcx, %rdx
leaq 0x2460a1(%rip), %rsi    # 0x27bcb0
movswq 0x18(%rdx,%rsi), %r8
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
cmpq $0x1000, %r8            # imm = 0x1000
je 0x35c9e
leaq 0x3758e6(%rip), %r9     # 0x3ab510
leaq 0x37f8ef(%rip), %rax    # 0x3b5520
cmpw %di, (%r9,%r8,2)
jne 0x35c42
movzwl (%rax,%rcx,2), %r10d
movw %r10w, (%r9,%r8,2)
leaq 0x3778d7(%rip), %r8     # 0x3ad520
movswq (%r8,%rcx,2), %r9
testq %r9, %r9
js 0x35c5d
movzwl (%rax,%rcx,2), %r10d
movw %r10w, (%rax,%r9,2)
movswq (%rax,%rcx,2), %r10
testq %r10, %r10
js 0x35c6c
movw %r9w, (%r8,%r10,2)
addq %rsi, %rdx
addq $0x18, %rdx
movswq 0x377895(%rip), %rsi    # 0x3ad510
testq %rsi, %rsi
js 0x35c85
movw %di, (%r8,%rsi,2)
movw $0xffff, (%r8,%rcx,2)   # imm = 0xFFFF
movw %si, (%rax,%rcx,2)
movw %di, 0x377879(%rip)     # 0x3ad510
movw $0x1000, (%rdx)         # imm = 0x1000
xorl %eax, %eax
retq
// File: /workspace/github_c_makefile_star2_O1/jonof[P]jftekwar/jfbuild/src/engine.c
// Function: changespritestat
int changespritestat(short spritenum, short newstatnum)
{
	if ((newstatnum < 0) || (newstatnum > MAXSTATUS)) return(-1);
	if (sprite[spritenum].statnum == newstatnum) return(0);
	if (sprite[spritenum].statnum == MAXSTATUS) return(-1);
	if (deletespritestat(spritenum) < 0) return(-1);
	insertspritestat(newstatnum);
	return(0);
}

// Assembly:
pushq %rbp
pushq %rbx
pushq %rax
movl %esi, %ebp
movzwl %bp, %eax
movl $0xffffffff, %ebx       # imm = 0xFFFFFFFF
cmpl $0x400, %eax            # imm = 0x400
ja 0x35cec
movswq %di, %rax
imulq $0x2c, %rax, %rax
leaq 0x245fee(%rip), %rcx    # 0x27bcb0
movzwl 0x1a(%rax,%rcx), %eax
cmpw %bp, %ax
je 0x35cea
movzwl %ax, %eax
cmpl $0x400, %eax            # imm = 0x400
je 0x35cec
movswl %di, %edi
callq 0x35b63
testl %eax, %eax
js 0x35cec
movswl %bp, %edi
callq 0x35a4f
xorl %ebx, %ebx
movl %ebx, %eax
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/jonof[P]jftekwar/jfbuild/src/engine.c
// Function: rintersect
static int rintersect(int x1, int y1, int z1, int vx, int vy, int vz, int x3,
		  int y3, int x4, int y4, int *intx, int *inty, int *intz)
{     //p1 towards p2 is a ray
	int x34, y34, x31, y31, bot, topt, topu, t;

	x34 = x3-x4; y34 = y3-y4;
	bot = vx*y34 - vy*x34;
	if (bot >= 0)
	{
		if (bot == 0) return(0);
		x31 = x3-x1; y31 = y3-y1;
		topt = x31*y34 - y31*x34; if (topt < 0) return(0);
		topu = vx*y31 - vy*x31; if ((topu < 0) || (topu >= bot)) return(0);
	}
	else
	{
		x31 = x3-x1; y31 = y3-y1;
		topt = x31*y34 - y31*x34; if (topt > 0) return(0);
		topu = vx*y31 - vy*x31; if ((topu > 0) || (topu <= bot)) return(0);
	}
	t = divscale16(topt,bot);
	*intx = x1 + mulscale16(vx,t);
	*inty = y1 + mulscale16(vy,t);
	*intz = z1 + mulscale16(vz,t);
	return(1);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movl %edx, %r10d
movl 0x38(%rsp), %ebx
movl 0x30(%rsp), %ebp
movl %ebp, %r14d
subl 0x40(%rsp), %r14d
movl %ebx, %edx
subl 0x48(%rsp), %edx
movl %edx, %r15d
imull %ecx, %r15d
movl %r14d, %r12d
imull %r8d, %r12d
movl %r15d, %r11d
subl %r12d, %r11d
js 0x37384
xorl %eax, %eax
cmpl %r12d, %r15d
je 0x37403
subl %edi, %ebp
subl %esi, %ebx
imull %ebp, %edx
imull %ebx, %r14d
subl %r14d, %edx
js 0x37403
imull %ecx, %ebx
imull %r8d, %ebp
subl %ebp, %ebx
cmpl %r11d, %ebx
jb 0x373ae
jmp 0x37403
subl %edi, %ebp
subl %esi, %ebx
imull %ebp, %edx
imull %ebx, %r14d
xorl %eax, %eax
subl %r14d, %edx
jg 0x37403
imull %ecx, %ebx
imull %r8d, %ebp
subl %ebp, %ebx
setg %bpl
cmpl %r11d, %ebx
setle %bl
orb %bpl, %bl
jne 0x37403
movq 0x60(%rsp), %rbx
movq 0x58(%rsp), %r14
movq 0x50(%rsp), %r15
movslq %edx, %rax
shlq $0x10, %rax
movslq %r11d, %r11
cqto
idivq %r11
movslq %ecx, %rcx
cltq
imulq %rax, %rcx
shrq $0x10, %rcx
addl %edi, %ecx
movl %ecx, (%r15)
movslq %r8d, %rcx
imulq %rax, %rcx
shrq $0x10, %rcx
addl %esi, %ecx
movl %ecx, (%r14)
movslq %r9d, %rcx
imulq %rax, %rcx
shrq $0x10, %rcx
addl %r10d, %ecx
movl %ecx, (%rbx)
movl $0x1, %eax
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/jonof[P]jftekwar/jfbuild/src/engine.c
// Function: dragpoint
void dragpoint(short pointhighlight, int dax, int day)
{
	short cnt, tempshort;

	wall[pointhighlight].x = dax;
	wall[pointhighlight].y = day;

	cnt = MAXWALLS;
	tempshort = pointhighlight;    //search points CCW
	do
	{
		if (wall[tempshort].nextwall >= 0)
		{
			tempshort = wall[wall[tempshort].nextwall].point2;
			wall[tempshort].x = dax;
			wall[tempshort].y = day;
		}
		else
		{
			tempshort = pointhighlight;    //search points CW if not searched all the way around
			do
			{
				if (wall[lastwall(tempshort)].nextwall >= 0)
				{
					tempshort = wall[lastwall(tempshort)].nextwall;
					wall[tempshort].x = dax;
					wall[tempshort].y = day;
				}
				else
				{
					break;
				}
				cnt--;
			}
			while ((tempshort != pointhighlight) && (cnt > 0));
			break;
		}
		cnt--;
	}
	while ((tempshort != pointhighlight) && (cnt > 0));
}

// Assembly:
movslq %edi, %rcx
shlq $0x5, %rcx
leaq 0x17ff88(%rip), %rax    # 0x1b7a50
movl %esi, (%rcx,%rax)
movl %edx, 0x4(%rcx,%rax)
movw $0x4000, %cx            # imm = 0x4000
movl %edi, %r8d
movswq %r8w, %r8
shlq $0x5, %r8
movswq 0xa(%r8,%rax), %r8
testq %r8, %r8
js 0x37b17
shlq $0x5, %r8
movswq 0x8(%r8,%rax), %r8
movq %r8, %r9
shlq $0x5, %r9
movl %esi, (%r9,%rax)
movl %edx, 0x4(%r9,%rax)
cmpw %di, %r8w
je 0x37b16
leal -0x1(%rcx), %r9d
cmpw $0x1, %cx
movl %r9d, %ecx
jne 0x37ad6
retq
pushq %rbx
movl %edi, %r8d
movswl %r8w, %r9d
testw %r9w, %r9w
jle 0x37b38
leal -0x1(%r9), %r11d
movq %r11, %r10
shlq $0x5, %r10
cmpw %r8w, 0x8(%r10,%rax)
je 0x37b62
movl $0x4001, %r10d          # imm = 0x4001
movl %r9d, %ebx
movl %ebx, %r11d
movslq %ebx, %rbx
shlq $0x5, %rbx
movswl 0x8(%rbx,%rax), %ebx
cmpw %r8w, %bx
je 0x37b62
decl %r10d
cmpl $0x1, %r10d
ja 0x37b41
movl %r9d, %r11d
movslq %r11d, %r10
shlq $0x5, %r10
cmpw $0x0, 0xa(%r10,%rax)
js 0x37be9
testw %r8w, %r8w
jle 0x37b8b
leal -0x1(%r9), %r11d
movq %r11, %r10
shlq $0x5, %r10
cmpw %r8w, 0x8(%r10,%rax)
je 0x37bb5
movl $0x4001, %r10d          # imm = 0x4001
movl %r9d, %ebx
movl %ebx, %r11d
movslq %ebx, %rbx
shlq $0x5, %rbx
movswl 0x8(%rbx,%rax), %ebx
cmpw %r8w, %bx
je 0x37bb5
decl %r10d
cmpl $0x1, %r10d
ja 0x37b94
movl %r9d, %r11d
movslq %r11d, %r8
shlq $0x5, %r8
movswq 0xa(%r8,%rax), %r8
movq %r8, %r9
shlq $0x5, %r9
movl %esi, (%r9,%rax)
movl %edx, 0x4(%r9,%rax)
cmpw %di, %r8w
je 0x37be9
leal -0x1(%rcx), %r9d
cmpw $0x1, %cx
movl %r9d, %ecx
jg 0x37b1b
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O1/jonof[P]jftekwar/jfbuild/src/engine.c
// Function: getflorzofslope
int getflorzofslope(short sectnum, int dax, int day)
{
	int dx, dy, i, j;
	walltype *wal;

	if (!(sector[sectnum].floorstat&2)) return(sector[sectnum].floorz);
	wal = &wall[sector[sectnum].wallptr];
	dx = wall[wal->point2].x-wal->x; dy = wall[wal->point2].y-wal->y;
	i = (nsqrtasm(dx*dx+dy*dy)<<5); if (i == 0) return(sector[sectnum].floorz);
	j = dmulscale3(dx,day-wal->y,-dy,dax-wal->x);
	return(sector[sectnum].floorz+scale(sector[sectnum].floorheinum,j,i));
}

// Assembly:
movslq %edi, %rax
leaq (%rax,%rax,4), %rax
leaq 0x209288(%rip), %rcx    # 0x242a60
leaq (%rcx,%rax,8), %rdi
testb $0x2, 0xe(%rdi)
je 0x398a0
pushq %rbx
movswq (%rdi), %rcx
shlq $0x5, %rcx
leaq 0x17e25a(%rip), %r8     # 0x1b7a50
movswq 0x8(%rcx,%r8), %r10
shlq $0x5, %r10
movslq (%r10,%r8), %rax
movslq (%rcx,%r8), %r9
subq %r9, %rax
movslq 0x4(%r10,%r8), %r10
movslq 0x4(%rcx,%r8), %r11
subq %r11, %r10
movl %eax, %ecx
imull %eax, %ecx
movl %r10d, %r8d
imull %r8d, %r8d
addl %ecx, %r8d
movl %r8d, %ecx
shrl $0x18, %ecx
orl $0x1000, %ecx           # imm = 0x1000
movl %r8d, %ebx
shrl $0xc, %ebx
cmpl $0x1000000, %r8d        # imm = 0x1000000
cmovael %ecx, %ebx
leaq 0x41b6b6(%rip), %rcx    # 0x454f00
movzwl (%rcx,%rbx,2), %ecx
shrl %cl, %r8d
leaq 0x41d8a8(%rip), %rbx    # 0x457100
movzwl (%rbx,%r8,2), %r8d
shrl $0x8, %ecx
shrl %cl, %r8d
shll $0x5, %r8d
popq %rbx
je 0x398a0
movslq %edx, %rcx
subq %r11, %rcx
negq %r10
movslq %esi, %rdx
subq %r9, %rdx
imulq %r10, %rdx
imulq %rax, %rcx
addq %rdx, %rcx
movswq 0x1a(%rdi), %rdx
shrq $0x3, %rcx
movslq %ecx, %rax
imulq %rdx, %rax
movslq %r8d, %rcx
cqto
idivq %rcx
addl 0x8(%rdi), %eax
retq
movl 0x8(%rdi), %eax
retq
// File: /workspace/github_c_makefile_star2_O1/jonof[P]jftekwar/jfbuild/src/engine.c
// Function: getceilzofslope
int getceilzofslope(short sectnum, int dax, int day)
{
	int dx, dy, i, j;
	walltype *wal;

	if (!(sector[sectnum].ceilingstat&2)) return(sector[sectnum].ceilingz);
	wal = &wall[sector[sectnum].wallptr];
	dx = wall[wal->point2].x-wal->x; dy = wall[wal->point2].y-wal->y;
	i = (nsqrtasm(dx*dx+dy*dy)<<5); if (i == 0) return(sector[sectnum].ceilingz);
	j = dmulscale3(dx,day-wal->y,-dy,dax-wal->x);
	return(sector[sectnum].ceilingz+scale(sector[sectnum].ceilingheinum,j,i));
}

// Assembly:
movslq %edi, %rax
leaq (%rax,%rax,4), %rax
leaq 0x2091ae(%rip), %rcx    # 0x242a60
leaq (%rcx,%rax,8), %rdi
testb $0x2, 0xc(%rdi)
je 0x3997a
pushq %rbx
movswq (%rdi), %rcx
shlq $0x5, %rcx
leaq 0x17e180(%rip), %r8     # 0x1b7a50
movswq 0x8(%rcx,%r8), %r10
shlq $0x5, %r10
movslq (%r10,%r8), %rax
movslq (%rcx,%r8), %r9
subq %r9, %rax
movslq 0x4(%r10,%r8), %r10
movslq 0x4(%rcx,%r8), %r11
subq %r11, %r10
movl %eax, %ecx
imull %eax, %ecx
movl %r10d, %r8d
imull %r8d, %r8d
addl %ecx, %r8d
movl %r8d, %ecx
shrl $0x18, %ecx
orl $0x1000, %ecx           # imm = 0x1000
movl %r8d, %ebx
shrl $0xc, %ebx
cmpl $0x1000000, %r8d        # imm = 0x1000000
cmovael %ecx, %ebx
leaq 0x41b5dc(%rip), %rcx    # 0x454f00
movzwl (%rcx,%rbx,2), %ecx
shrl %cl, %r8d
leaq 0x41d7ce(%rip), %rbx    # 0x457100
movzwl (%rbx,%r8,2), %r8d
shrl $0x8, %ecx
shrl %cl, %r8d
shll $0x5, %r8d
popq %rbx
je 0x3997a
movslq %edx, %rcx
subq %r11, %rcx
negq %r10
movslq %esi, %rdx
subq %r9, %rdx
imulq %r10, %rdx
imulq %rax, %rcx
addq %rdx, %rcx
movswq 0x12(%rdi), %rdx
shrq $0x3, %rcx
movslq %ecx, %rax
imulq %rdx, %rax
movslq %r8d, %rcx
cqto
idivq %rcx
addl 0x4(%rdi), %eax
retq
movl 0x4(%rdi), %eax
retq
// File: /workspace/github_c_makefile_star2_O1/jonof[P]jftekwar/jfbuild/src/engine.c
// Function: rotatepoint
void rotatepoint(int xpivot, int ypivot, int x, int y, short daang, int *x2, int *y2)
{
	int dacos, dasin;

	dacos = sintable[(daang+2560)&2047];
	dasin = sintable[(daang+2048)&2047];
	x -= xpivot;
	y -= ypivot;
	*x2 = dmulscale14(x,dacos,-y,dasin) + xpivot;
	*y2 = dmulscale14(y,dacos,x,dasin) + ypivot;
}

// Assembly:
pushq %rbx
movq 0x10(%rsp), %rax
leal 0x200(%r8), %r10d
movl $0x7ff, %r11d           # imm = 0x7FF
andl %r11d, %r10d
leaq 0x393f89(%rip), %rbx    # 0x3cdd50
movswq (%rbx,%r10,2), %r10
andl %r11d, %r8d
movswq (%rbx,%r8,2), %r8
subl %edi, %edx
subl %esi, %ecx
movslq %ecx, %r11
negl %ecx
movslq %edx, %rdx
imulq %r10, %r11
imulq %rdx, %r10
movslq %ecx, %rcx
imulq %r8, %rcx
addq %r10, %rcx
shrq $0xe, %rcx
addl %edi, %ecx
movl %ecx, (%r9)
imulq %rdx, %r8
addq %r11, %r8
shrq $0xe, %r8
addl %esi, %r8d
movl %r8d, (%rax)
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O1/jonof[P]jftekwar/jfbuild/src/engine.c
// Function: setaspect
void setaspect(int daxrange, int daaspect)
{
    int ys = mulscale16(200, pixelaspect);

    viewingrange = daxrange;
    viewingrangerecip = divscale32(1L,daxrange);

    yxaspect = daaspect;
    xyaspect = divscale32(1,yxaspect);
    xdimenscale = scale(xdimen,yxaspect,320);
    xdimscale = scale(320,xyaspect,xdimen);

    ydimenscale = scale(ydimen, yxaspect, ys);
}

// Assembly:
movslq 0x3db421(%rip), %r8     # 0x415c78
movl %edi, 0x3944f3(%rip)    # 0x3ced50
movslq %edi, %rdi
movabsq $0x100000000, %rcx      # imm = 0x100000000
movq %rcx, %rax
xorl %edx, %edx
idivq %rdi
movl %eax, 0x3934c0(%rip)    # 0x3cdd38
movl %esi, 0x3cc76a(%rip)    # 0x406fe8
movslq %esi, %rsi
movq %rcx, %rax
xorl %edx, %edx
idivq %rsi
movq %rax, %rcx
movslq 0x68f9d(%rip), %rdi     # 0xa3830
movq %rdi, %rax
imulq %rsi, %rax
movabsq $0x6666666666666667, %rdx # imm = 0x6666666666666667
imulq %rdx
movl %ecx, 0x32200b(%rip)    # 0x35c8b8
movq %rdx, %rax
shrq $0x3f, %rax
shrq $0x7, %rdx
addl %eax, %edx
movl %edx, 0x2401d8(%rip)    # 0x27aa98
movslq %ecx, %rax
shlq $0x6, %rax
leaq (%rax,%rax,4), %rax
cqto
idivq %rdi
movl %eax, 0x39345e(%rip)    # 0x3cdd34
movslq 0x2401b7(%rip), %rax    # 0x27aa94
imulq %rsi, %rax
imulq $0xc80000, %r8, %rcx    # imm = 0xC80000
sarq $0x20, %rcx
cqto
idivq %rcx
movl %eax, 0x3faca9(%rip)    # 0x4355a0
retq
// File: /workspace/github_c_makefile_star2_O1/jonof[P]jftekwar/jfbuild/src/engine.c
// Function: setvgapalette
void setvgapalette(void)
{
	int i;

	for (i=0;i<256;i++) {
		curpalettefaded[i].b = curpalette[i].b = vgapal16[4*i] << 2;
		curpalettefaded[i].g = curpalette[i].g = vgapal16[4*i+1] << 2;
		curpalettefaded[i].r = curpalette[i].r = vgapal16[4*i+2] << 2;
	}
	setpalette(0,256,vgapal16);
}

// Assembly:
xorl %eax, %eax
leaq 0x687ce(%rip), %rcx     # 0xa3840
leaq 0x3fa937(%rip), %rdx    # 0x4359b0
leaq 0x3fad30(%rip), %rsi    # 0x435db0
movb (%rcx,%rax,4), %dil
movb 0x1(%rcx,%rax,4), %r8b
shlb $0x2, %dil
movb %dil, 0x2(%rdx,%rax,4)
movb %dil, 0x2(%rsi,%rax,4)
shlb $0x2, %r8b
movb %r8b, 0x1(%rdx,%rax,4)
movb %r8b, 0x1(%rsi,%rax,4)
movb 0x2(%rcx,%rax,4), %dil
shlb $0x2, %dil
movb %dil, (%rdx,%rax,4)
movb %dil, (%rsi,%rax,4)
incq %rax
cmpq $0x100, %rax            # imm = 0x100
jne 0x3b080
leaq 0x68778(%rip), %rdx     # 0xa3840
xorl %edi, %edi
movl $0x100, %esi            # imm = 0x100
jmp 0x6d4ca
// File: /workspace/github_c_makefile_star2_O1/jonof[P]jftekwar/jfbuild/src/engine.c
// Function: setpalettefade
void setpalettefade(unsigned char r, unsigned char g, unsigned char b, unsigned char offset)
{
	int i,k;
	palette_t p;

	palfadergb.r = min(63,r) << 2;
	palfadergb.g = min(63,g) << 2;
	palfadergb.b = min(63,b) << 2;
	palfadedelta = min(63,offset) << 2;

	k = 0;
	for (i=0;i<256;i++) {
		if (usegammabrightness) p = curpalette[i];
		else {
			p.b = britable[curbrightness][ curpalette[i].b ];
			p.g	= britable[curbrightness][ curpalette[i].g ];
			p.r = britable[curbrightness][ curpalette[i].r ];
		}

		tempbuf[k++] =
			(curpalettefaded[i].b =
				p.b + ( ( ( (int)palfadergb.b - (int)p.b ) * (int)offset ) >> 6 ) ) >> 2;
		tempbuf[k++] =
			(curpalettefaded[i].g =
				p.g + ( ( ( (int)palfadergb.g - (int)p.g ) * (int)offset ) >> 6 ) ) >> 2;
		tempbuf[k++] =
			(curpalettefaded[i].r =
				p.r + ( ( ( (int)palfadergb.r - (int)p.r ) * (int)offset ) >> 6 ) ) >> 2;
		tempbuf[k++] = curpalettefaded[i].f = 0;
	}

	setpalette(0,256,(unsigned char*)tempbuf);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
cmpb $0x3f, %dil
movl $0x3f, %eax
cmovael %eax, %edi
shlb $0x2, %dil
movb %dil, 0x17c94a(%rip)    # 0x1b7a3f
cmpb $0x3f, %sil
cmovael %eax, %esi
shlb $0x2, %sil
movb %sil, 0x17c939(%rip)    # 0x1b7a40
cmpb $0x3f, %dl
cmovael %eax, %edx
shlb $0x2, %dl
cmpl %eax, %ecx
cmovbl %ecx, %eax
movb %dl, 0x17c926(%rip)     # 0x1b7a41
shlb $0x2, %al
movb %al, 0x17c91f(%rip)     # 0x1b7a43
movl 0x68662(%rip), %eax     # 0xa378c
movzbl %dl, %edx
movzbl %sil, %esi
movzbl %dil, %edi
movslq 0x17c8c8(%rip), %r11    # 0x1b7a04
xorl %r8d, %r8d
leaq 0x3fa86a(%rip), %r9     # 0x4359b0
shlq $0x8, %r11
leaq 0x3fb05f(%rip), %r10    # 0x4361b0
addq %r11, %r10
leaq 0x3fac55(%rip), %r11    # 0x435db0
leaq 0x39f66e(%rip), %rbx    # 0x3da7d0
xorl %r14d, %r14d
testl %eax, %eax
je 0x3b17e
leaq (%r9,%r14), %r13
leaq (%r14,%r9), %r12
incq %r12
leaq (%r14,%r9), %r15
addq $0x2, %r15
jmp 0x3b198
movzbl 0x2(%r14,%r9), %r15d
addq %r10, %r15
movzbl 0x1(%r14,%r9), %r12d
addq %r10, %r12
movzbl (%r14,%r9), %r13d
addq %r10, %r13
movzbl (%r13), %ebp
movzbl (%r12), %r12d
movzbl (%r15), %r15d
movl %edx, %r13d
subl %r15d, %r13d
imull %ecx, %r13d
shrl $0x6, %r13d
addb %r15b, %r13b
movb %r13b, 0x2(%r14,%r11)
shrb $0x2, %r13b
movb %r13b, (%r14,%rbx)
movl %esi, %r15d
subl %r12d, %r15d
imull %ecx, %r15d
shrl $0x6, %r15d
addb %r12b, %r15b
movb %r15b, 0x1(%r14,%r11)
shrb $0x2, %r15b
movb %r15b, 0x1(%r14,%rbx)
movl %edi, %r15d
subl %ebp, %r15d
imull %ecx, %r15d
shrl $0x6, %r15d
addb %bpl, %r15b
movb %r15b, (%r14,%r11)
shrb $0x2, %r15b
movb %r15b, 0x2(%r14,%rbx)
movb %r8b, 0x3(%r14,%r11)
movb %r8b, 0x3(%r14,%rbx)
addq $0x4, %r14
cmpq $0x400, %r14            # imm = 0x400
jne 0x3b165
leaq 0x39f5ad(%rip), %rdx    # 0x3da7d0
xorl %edi, %edi
movl $0x100, %esi            # imm = 0x100
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x6d4ca
// File: /workspace/github_c_makefile_star2_O1/jonof[P]jftekwar/jfbuild/src/engine.c
// Function: setviewback
void setviewback(void)
{
	int i, j, k;

	if (setviewcnt <= 0) return;
	setviewcnt--;

	offscreenrendering = (setviewcnt>0);
#if USE_POLYMOST
	if (setviewcnt == 0) {
		rendmode = bakrendmode;
#if USE_OPENGL
		invalidatetile(baktile,-1,-1);
#endif
	}
#endif

	setview(bakwindowx1[setviewcnt],bakwindowy1[setviewcnt],
			  bakwindowx2[setviewcnt],bakwindowy2[setviewcnt]);
	copybufbyte(&bakumost[windowx1],&startumost[windowx1],(windowx2-windowx1+1)*sizeof(startumost[0]));
	copybufbyte(&bakdmost[windowx1],&startdmost[windowx1],(windowx2-windowx1+1)*sizeof(startdmost[0]));
	frameplace = bakframeplace[setviewcnt];
	if (setviewcnt == 0)
		k = bakxsiz[0];
	else
		k = max(bakxsiz[setviewcnt-1],bakxsiz[setviewcnt]);
	j = 0; for(i=0;i<=k;i++) ylookup[i] = j, j += bytesperline;
	setvlinebpl(bytesperline);
}

// Assembly:
movl 0x3fbb8a(%rip), %eax    # 0x4371d0
testl %eax, %eax
jle 0x3b757
pushq %rax
cmpl $0x1, %eax
leaq 0x141a5f(%rip), %rcx    # 0x17d0b8
setne (%rcx)
decl %eax
movl %eax, 0x3fbb6c(%rip)    # 0x4371d0
jne 0x3b68b
movl 0x3fbbd4(%rip), %eax    # 0x437240
leaq 0x5be2dd(%rip), %rcx    # 0x5f9950
movl %eax, (%rcx)
movswl 0x3fbbc8(%rip), %edi    # 0x437244
movl $0xffffffff, %esi       # imm = 0xFFFFFFFF
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
callq 0x3b79d
movslq 0x3fbb3e(%rip), %rax    # 0x4371d0
leaq 0x3fbb67(%rip), %rcx    # 0x437200
movl (%rcx,%rax,4), %edi
leaq 0x3fbb6d(%rip), %rcx    # 0x437210
movl (%rcx,%rax,4), %esi
leaq 0x3fbb73(%rip), %rcx    # 0x437220
movl (%rcx,%rax,4), %edx
leaq 0x3fbb79(%rip), %rcx    # 0x437230
movl (%rcx,%rax,4), %ecx
callq 0x33586
movslq 0x3956aa(%rip), %rax    # 0x3d0d70
leaq 0x3fbb83(%rip), %rcx    # 0x437250
leaq (%rcx,%rax,2), %rdi
leaq 0x393898(%rip), %rcx    # 0x3cef70
leaq (%rcx,%rax,2), %rsi
movl 0x3cb8fe(%rip), %ecx    # 0x406fe0
subl %eax, %ecx
leal 0x2(,%rcx,2), %edx
callq 0x4ac52
movslq 0x395679(%rip), %rax    # 0x3d0d70
leaq 0x3fd952(%rip), %rcx    # 0x439050
leaq (%rcx,%rax,2), %rdi
leaq 0x395677(%rip), %rcx    # 0x3d0d80
leaq (%rcx,%rax,2), %rsi
movl 0x3cb8cd(%rip), %ecx    # 0x406fe0
subl %eax, %ecx
leal 0x2(,%rcx,2), %edx
callq 0x4ac52
movslq 0x3fbaa8(%rip), %rax    # 0x4371d0
leaq 0x3fbab1(%rip), %rcx    # 0x4371e0
movq (%rcx,%rax,8), %rcx
leaq 0x141976(%rip), %rdx    # 0x17d0b0
movq %rcx, (%rdx)
testq %rax, %rax
je 0x3b758
leaq 0x3fba77(%rip), %rcx    # 0x4371c0
movl -0x4(%rcx,%rax,4), %edx
movl (%rcx,%rax,4), %ecx
cmpl %ecx, %edx
cmovgl %edx, %ecx
jmp 0x3b75e
retq
movl 0x3fba62(%rip), %ecx    # 0x4371c0
testl %ecx, %ecx
js 0x3b78e
leaq 0x141b1b(%rip), %rax    # 0x17d284
movl (%rax), %eax
movl %ecx, %ecx
leaq 0x4(,%rcx,4), %rcx
xorl %edx, %edx
leaq 0x3da522(%rip), %rsi    # 0x415ca0
xorl %edi, %edi
movl %edx, (%rdi,%rsi)
addq $0x4, %rdi
addl %eax, %edx
cmpq %rdi, %rcx
jne 0x3b780
leaq 0x141aef(%rip), %rax    # 0x17d284
movl (%rax), %edi
popq %rax
jmp 0x6dcbc
// File: /workspace/github_c_makefile_star2_O1/jonof[P]jftekwar/jfbuild/src/engine.c
// Function: invalidatetile
void invalidatetile(short tilenume, int pal, int how)
{
	int numpal, firstpal, np;
	int hp;

	if (rendmode < 3) return;

	if (pal < 0) {
		numpal = MAXPALOOKUPS;
		firstpal = 0;
	} else {
		numpal = 1;
		firstpal = pal % MAXPALOOKUPS;
	}

	for (hp = 0; hp < 8; hp+=4) {
		if (!(how & pow2long[hp])) continue;

		for (np = firstpal; np < firstpal+numpal; np++) {
			polymost_texinvalidate(tilenume, np, hp);
		}
	}
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
leaq 0x5be1a1(%rip), %rax    # 0x5f9950
cmpl $0x3, (%rax)
jl 0x3b80a
movl %edx, %ebx
xorl %r14d, %r14d
testl %esi, %esi
movzbl %sil, %r12d
cmovsl %r14d, %r12d
leal 0x1(%r12), %eax
leal 0x100(%r12), %r13d
testl %esi, %esi
cmovnsl %eax, %r13d
movswl %di, %ebp
leaq 0x67fd0(%rip), %rax     # 0xa37b0
testl %ebx, (%rax,%r14,4)
je 0x3b7fe
movl %r12d, %r15d
movl %ebp, %edi
movl %r15d, %esi
movl %r14d, %edx
callq 0x4d678
incl %r15d
cmpl %r13d, %r15d
jb 0x3b7e9
leaq 0x4(%r14), %rax
testq %r14, %r14
movq %rax, %r14
je 0x3b7d9
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/jonof[P]jftekwar/jfbuild/src/engine.c
// Function: squarerotatetile
void squarerotatetile(short tilenume)
{
	int i, j, k, xsiz, ysiz;
	unsigned char *ptr1, *ptr2;

	xsiz = tilesizx[tilenume]; ysiz = tilesizy[tilenume];

		//supports square tiles only for rotation part
	if (xsiz == ysiz)
	{
		k = (xsiz<<1);
		for(i=xsiz-1;i>=0;i--)
		{
			ptr1 = (unsigned char *)(waloff[tilenume]+i*(xsiz+1)); ptr2 = ptr1;
			if ((i&1) != 0) { ptr1--; ptr2 -= xsiz; swapchar(ptr1,ptr2); }
			for(j=(i>>1)-1;j>=0;j--)
				{ ptr1 -= 2; ptr2 -= k; swapchar2(ptr1,ptr2,xsiz); }
		}
	}
}

// Assembly:
movslq %edi, %rax
leaq 0x3d37fd(%rip), %rcx    # 0x40f020
movzwl (%rcx,%rax,2), %ecx
leaq 0x3c4fb2(%rip), %rdx    # 0x4007e0
cmpw (%rdx,%rax,2), %cx
setne %dl
testw %cx, %cx
setle %sil
orb %dl, %sil
jne 0x3b8eb
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
leal (%rcx,%rcx), %edi
negl %edi
leaq 0x1(%rcx), %rdx
movq %rcx, %rsi
negq %rsi
movslq %edi, %rdi
movl %ecx, %r8d
leal -0x1(%rcx), %r9d
leaq 0x35ca73(%rip), %r10    # 0x3982e0
movq %r8, %r11
decq %r8
movq %r8, %rbx
imulq %rdx, %rbx
addq (%r10,%rax,8), %rbx
movq %rbx, %r14
testb $0x1, %r8b
je 0x3b89d
movb (%rbx,%rsi), %bpl
movb -0x1(%rbx), %r15b
movb %r15b, (%rbx,%rsi)
movb %bpl, -0x1(%rbx)
decq %rbx
addq %rsi, %r14
cmpq $0x2, %r8
jb 0x3b8da
movl %r9d, %ebp
shrl %ebp
incl %ebp
addq %rdi, %r14
decq %rbx
movb (%r14), %r15b
movb -0x1(%rbx), %r12b
movb %r12b, (%r14)
movb %r15b, -0x1(%rbx)
movb (%r14,%rcx), %r15b
movb (%rbx), %r12b
movb %r12b, (%r14,%rcx)
movb %r15b, (%rbx)
addq %rdi, %r14
addq $-0x2, %rbx
decl %ebp
cmpl $0x1, %ebp
jg 0x3b8b0
decl %r9d
cmpq $0x2, %r11
jge 0x3b86d
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/jonof[P]jftekwar/jfbuild/src/engine.c
// Function: preparemirror
void preparemirror(int dax, int day, int daz, short daang, int dahoriz, short dawall, short dasector, int *tposx, int *tposy, short *tang)
{
	int i, j, x, y, dx, dy;

	(void)daz; (void)dahoriz; (void)dasector;

	x = wall[dawall].x; dx = wall[wall[dawall].point2].x-x;
	y = wall[dawall].y; dy = wall[wall[dawall].point2].y-y;
	j = dx*dx + dy*dy; if (j == 0) return;
	i = (((dax-x)*dx + (day-y)*dy)<<1);
	*tposx = (x<<1) + scale(dx,i,j) - dax;
	*tposy = (y<<1) + scale(dy,i,j) - day;
	*tang = (((getangle(dx,dy)<<1)-daang)&2047);

	inpreparemirror = 1;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movl %ecx, %ebx
movl %edi, %r8d
movslq %r9d, %rax
shlq $0x5, %rax
leaq 0x17c146(%rip), %rcx    # 0x1b7a50
movslq (%rax,%rcx), %r10
movswq 0x8(%rax,%rcx), %rdx
shlq $0x5, %rdx
movslq (%rdx,%rcx), %rdi
subq %r10, %rdi
movslq 0x4(%rax,%rcx), %r9
movslq 0x4(%rdx,%rcx), %rcx
subq %r9, %rcx
movl %edi, %eax
imull %edi, %eax
movl %ecx, %edx
imull %ecx, %edx
addl %eax, %edx
je 0x3b9af
movq 0x58(%rsp), %r14
movq 0x50(%rsp), %r11
movq 0x48(%rsp), %r15
movl %r8d, %eax
subl %r10d, %eax
imull %edi, %eax
movl %esi, %ebp
subl %r9d, %ebp
imull %ecx, %ebp
addl %eax, %ebp
addl %ebp, %ebp
addl %r10d, %r10d
movslq %ebp, %r12
movq %rdi, %rax
imulq %r12, %rax
movl %edx, %r13d
cqto
idivq %r13
subl %r8d, %r10d
addl %eax, %r10d
movl %r10d, (%r15)
addl %r9d, %r9d
movq %rcx, %rax
imulq %r12, %rax
cqto
idivq %r13
subl %esi, %r9d
addl %eax, %r9d
movl %r9d, (%r11)
movl %ecx, %esi
callq 0x35643
addl %eax, %eax
subl %ebx, %eax
andl $0x7ff, %eax            # imm = 0x7FF
movw %ax, (%r14)
movb $0x1, 0x17c08f(%rip)    # 0x1b7a3e
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/jonof[P]jftekwar/jfbuild/src/engine.c
// Function: completemirror
void completemirror(void)
{
	int i, dy;
	intptr_t p;

#if USE_POLYMOST
	if (rendmode) return;
#endif

		//Can't reverse with uninitialized data
	if (inpreparemirror) { inpreparemirror = 0; return; }
	if (mirrorsx1 > 0) mirrorsx1--;
	if (mirrorsx2 < windowx2-windowx1-1) mirrorsx2++;
	if (mirrorsx2 < mirrorsx1) return;

	p = frameplace+ylookup[windowy1+mirrorsy1]+windowx1+mirrorsx1;
	i = windowx2-windowx1-mirrorsx2-mirrorsx1; mirrorsx2 -= mirrorsx1;
	for(dy=mirrorsy2-mirrorsy1-1;dy>=0;dy--)
	{
		copybufbyte((void*)(p+1),tempbuf,mirrorsx2+1);
		tempbuf[mirrorsx2] = tempbuf[mirrorsx2-1];
		copybufreverse(&tempbuf[mirrorsx2],(void*)(p+i),mirrorsx2+1);
		p += ylookup[1];
		faketimerhandler();
	}
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
leaq 0x5bdf84(%rip), %rax    # 0x5f9950
cmpl $0x0, (%rax)
jne 0x3bade
cmpb $0x0, 0x17c062(%rip)    # 0x1b7a3e
je 0x3b9ea
movb $0x0, 0x17c059(%rip)    # 0x1b7a3e
jmp 0x3bade
movl 0x39adbc(%rip), %eax    # 0x3d67ac
testl %eax, %eax
jle 0x3b9fc
decl %eax
movl %eax, 0x39adb0(%rip)    # 0x3d67ac
movl 0x39adae(%rip), %edx    # 0x3d67b0
movl 0x3cb5d8(%rip), %eax    # 0x406fe0
movslq 0x395361(%rip), %rcx    # 0x3d0d70
movl %ecx, %esi
notl %esi
addl %eax, %esi
cmpl %esi, %edx
jge 0x3ba21
incl %edx
movl %edx, 0x39ad8f(%rip)    # 0x3d67b0
movl 0x39ad89(%rip), %edx    # 0x3d67b0
movslq 0x39ad7e(%rip), %r14    # 0x3d67ac
cmpl %r14d, %edx
jl 0x3bade
leaq 0x141672(%rip), %rsi    # 0x17d0b0
movq (%rsi), %rdi
movslq 0x397138(%rip), %r8     # 0x3d2b80
movslq 0x39ed71(%rip), %rsi    # 0x3da7c0
addq %rsi, %r8
leaq 0x3da247(%rip), %r9     # 0x415ca0
movslq (%r9,%r8,4), %r8
movl %edx, %r9d
subl %r14d, %r9d
movl %r9d, 0x39ad46(%rip)    # 0x3d67b0
movl 0x39ed54(%rip), %ebp    # 0x3da7c4
movl %esi, %r9d
notl %r9d
addl %ebp, %r9d
js 0x3bade
addl %ecx, %edx
addl %r14d, %edx
subl %edx, %eax
addq %rcx, %r14
addq %rdi, %r14
addq %r8, %r14
movslq %eax, %r15
subl %esi, %ebp
leaq 0x39ed39(%rip), %rbx    # 0x3da7d0
leaq 0x1(%r14), %rdi
movl 0x39ad0f(%rip), %edx    # 0x3d67b0
incl %edx
movq %rbx, %rsi
callq 0x4ac52
movslq 0x39acfe(%rip), %rax    # 0x3d67b0
movb -0x1(%rax,%rbx), %cl
leaq (%rbx,%rax), %rdi
movb %cl, (%rax,%rbx)
leaq (%r14,%r15), %rsi
leal 0x1(%rax), %edx
callq 0x4ac6b
movslq 0x3da1d4(%rip), %rax    # 0x415ca4
addq %rax, %r14
callq 0xab51
decl %ebp
testl %ebp, %ebp
jg 0x3ba97
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/jonof[P]jftekwar/jfbuild/src/engine.c
// Function: sectorofwall
int sectorofwall(short theline)
{
	int i, gap;

	if ((theline < 0) || (theline >= numwalls)) return(-1);
	i = wall[theline].nextwall; if (i >= 0) return(wall[i].nextsector);

	gap = (numsectors>>1); i = gap;
	while (gap > 1)
	{
		gap >>= 1;
		if (sector[i].wallptr < theline) i += gap; else i -= gap;
	}
	while (sector[i].wallptr > theline) i--;
	while (sector[i].wallptr+sector[i].wallnum <= theline) i++;
	return(i);
}

// Assembly:
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
testw %di, %di
js 0x3bba4
cmpw %di, 0x3da16a(%rip)     # 0x415c68
jle 0x3bba4
movzwl %di, %ecx
shll $0x5, %ecx
leaq 0x17bf3f(%rip), %rax    # 0x1b7a50
movswq 0xa(%rcx,%rax), %rcx
testq %rcx, %rcx
js 0x3bb26
shlq $0x5, %rcx
movswl 0xc(%rcx,%rax), %eax
retq
movswl 0x393433(%rip), %ecx    # 0x3cef60
movl %ecx, %eax
shrl %eax
sarl %ecx
cmpw $0x2, %ax
jl 0x3bb6a
leaq 0x206f20(%rip), %rdx    # 0x242a60
movl %ecx, %r8d
movl %ecx, %esi
shrl %esi
movslq %r8d, %rax
leaq (%rax,%rax,4), %r9
movl %esi, %eax
cmpw %di, (%rdx,%r9,8)
jl 0x3bb5b
movl %esi, %eax
negl %eax
addl %r8d, %eax
movl %eax, %r8d
cmpl $0x3, %ecx
movl %esi, %ecx
ja 0x3bb45
jmp 0x3bb6c
movl %ecx, %eax
movslq %eax, %rcx
leaq (%rcx,%rcx,4), %rcx
leaq 0x206ee6(%rip), %rdx    # 0x242a60
leaq (%rdx,%rcx,8), %rcx
addq $0x2a, %rcx
movq %rcx, %rdx
addq $-0x28, %rcx
decl %eax
cmpw %di, -0x2a(%rdx)
jg 0x3bb82
movswl -0x2(%rcx), %edx
movswl (%rcx), %esi
addl %edx, %esi
incl %eax
addq $0x28, %rcx
cmpl %edi, %esi
jle 0x3bb91
retq
// File: /workspace/github_c_makefile_star2_O1/jonof[P]jftekwar/jfbuild/src/engine.c
// Function: alignceilslope
void alignceilslope(short dasect, int x, int y, int z)
{
	int i, dax, day;
	walltype *wal;

	wal = &wall[sector[dasect].wallptr];
	dax = wall[wal->point2].x-wal->x;
	day = wall[wal->point2].y-wal->y;

	i = (y-wal->y)*dax - (x-wal->x)*day; if (i == 0) return;
	sector[dasect].ceilingheinum = scale((z-sector[dasect].ceilingz)<<8,
	  nsqrtasm(dax*dax+day*day),i);

	if (sector[dasect].ceilingheinum == 0) sector[dasect].ceilingstat &= ~2;
	else sector[dasect].ceilingstat |= 2;
}

// Assembly:
pushq %rbx
movl %ecx, %r8d
movslq %edi, %rax
leaq (%rax,%rax,4), %r9
leaq 0x206ea9(%rip), %r10    # 0x242a60
movswq (%r10,%r9,8), %r11
shlq $0x5, %r11
leaq 0x17be89(%rip), %rbx    # 0x1b7a50
movswq 0x8(%r11,%rbx), %rax
shlq $0x5, %rax
movl (%rax,%rbx), %ecx
movl 0x4(%rax,%rbx), %eax
movl (%r11,%rbx), %edi
movl 0x4(%r11,%rbx), %r11d
subl %edi, %ecx
subl %r11d, %eax
subl %r11d, %edx
imull %ecx, %edx
subl %esi, %edi
imull %eax, %edi
addl %edx, %edi
je 0x3bc66
leaq (%r10,%r9,8), %rsi
subl 0x4(%rsi), %r8d
shll $0x8, %r8d
imull %ecx, %ecx
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 0x4192d8(%rip), %rcx    # 0x454f00
movzwl (%rcx,%rdx,2), %ecx
shrl %cl, %eax
leaq 0x41b4cb(%rip), %rdx    # 0x457100
movzwl (%rdx,%rax,2), %eax
shrl $0x8, %ecx
shrl %cl, %eax
movslq %r8d, %rcx
imulq %rcx, %rax
movslq %edi, %rcx
cqto
idivq %rcx
movw %ax, 0x12(%rsi)
xorl %ecx, %ecx
testw %ax, %ax
setne %cl
movl 0xc(%rsi), %eax
andl $-0x3, %eax
leal (%rax,%rcx,2), %eax
movw %ax, 0xc(%rsi)
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O1/jonof[P]jftekwar/jfbuild/src/engine.c
// Function: alignflorslope
void alignflorslope(short dasect, int x, int y, int z)
{
	int i, dax, day;
	walltype *wal;

	wal = &wall[sector[dasect].wallptr];
	dax = wall[wal->point2].x-wal->x;
	day = wall[wal->point2].y-wal->y;

	i = (y-wal->y)*dax - (x-wal->x)*day; if (i == 0) return;
	sector[dasect].floorheinum = scale((z-sector[dasect].floorz)<<8,
	  nsqrtasm(dax*dax+day*day),i);

	if (sector[dasect].floorheinum == 0) sector[dasect].floorstat &= ~2;
	else sector[dasect].floorstat |= 2;
}

// Assembly:
pushq %rbx
movl %ecx, %r8d
movslq %edi, %rax
leaq (%rax,%rax,4), %r9
leaq 0x206de6(%rip), %r10    # 0x242a60
movswq (%r10,%r9,8), %r11
shlq $0x5, %r11
leaq 0x17bdc6(%rip), %rbx    # 0x1b7a50
movswq 0x8(%r11,%rbx), %rax
shlq $0x5, %rax
movl (%rax,%rbx), %ecx
movl 0x4(%rax,%rbx), %eax
movl (%r11,%rbx), %edi
movl 0x4(%r11,%rbx), %r11d
subl %edi, %ecx
subl %r11d, %eax
subl %r11d, %edx
imull %ecx, %edx
subl %esi, %edi
imull %eax, %edi
addl %edx, %edi
je 0x3bd2a
leaq (%r10,%r9,8), %rsi
subl 0x8(%rsi), %r8d
shll $0x8, %r8d
imull %ecx, %ecx
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 0x419215(%rip), %rcx    # 0x454f00
movzwl (%rcx,%rdx,2), %ecx
shrl %cl, %eax
leaq 0x41b408(%rip), %rdx    # 0x457100
movzwl (%rdx,%rax,2), %eax
shrl $0x8, %ecx
shrl %cl, %eax
movslq %r8d, %rcx
imulq %rcx, %rax
movslq %edi, %rcx
cqto
idivq %rcx
movw %ax, 0x1a(%rsi)
xorl %ecx, %ecx
testw %ax, %ax
setne %cl
movzwl 0xe(%rsi), %eax
andl $-0x3, %eax
leal (%rax,%rcx,2), %eax
movw %ax, 0xe(%rsi)
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O1/jonof[P]jftekwar/jfbuild/src/engine.c
// Function: loopnumofsector
int loopnumofsector(short sectnum, short wallnum)
{
	int i, numloops, startwall, endwall;

	numloops = 0;
	startwall = sector[sectnum].wallptr;
	endwall = startwall + sector[sectnum].wallnum;
	for(i=startwall;i<endwall;i++)
	{
		if (i == wallnum) return(numloops);
		if (wall[i].point2 < i) numloops++;
	}
	return(-1);
}

// Assembly:
movslq %edi, %rax
leaq (%rax,%rax,4), %rdx
leaq 0x206d26(%rip), %rdi    # 0x242a60
movswq 0x2(%rdi,%rdx,8), %rcx
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
testq %rcx, %rcx
jle 0x3bd92
leaq (%rdi,%rdx,8), %rdx
movswq (%rdx), %rdx
addq %rdx, %rcx
movswq %si, %rsi
movq %rdx, %rdi
shlq $0x5, %rdi
leaq 0x17bce9(%rip), %r8     # 0x1b7a50
addq %rdi, %r8
addq $0x8, %r8
xorl %edi, %edi
cmpq %rdx, %rsi
je 0x3bd93
movswq (%r8), %r9
xorl %r10d, %r10d
cmpq %r9, %rdx
setg %r10b
addl %r10d, %edi
incq %rdx
addq $0x20, %r8
cmpq %rcx, %rdx
jl 0x3bd70
retq
movl %edi, %eax
retq
// File: /workspace/github_c_makefile_star2_O1/jonof[P]jftekwar/jfbuild/src/engine.c
// Function: printext256
void printext256(int xpos, int ypos, short col, short backcol, const char *name, char fontsize)
{
	int stx, i, x, y;
	const unsigned char *letptr;
	unsigned char *ptr;
	const struct textfontspec *f;

#if USE_POLYMOST && USE_OPENGL
	if (!polymost_printext256(xpos,ypos,col,backcol,name,fontsize)) return;
#endif

	f = &textfonts[min((unsigned)fontsize, 2)];
	stx = xpos;

	for(i=0;name[i];i++)
	{
		letptr = &f->font[((int)(unsigned char)name[i])*f->cellh + f->cellyoff];
		ptr = (unsigned char *)(ylookup[ypos+f->charysiz-1]+stx+frameplace);
		for(y=f->charysiz-1;y>=0;y--)
		{
			for(x=f->charxsiz-1;x>=0;x--)
			{
				if (letptr[y]&pow2char[7-x-f->cellxoff])
					ptr[x] = (unsigned char)col;
				else if (backcol >= 0)
					ptr[x] = (unsigned char)backcol;
			}
			ptr -= bytesperline;
		}
		stx += f->charxsiz;
	}
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x48, %rsp
movl %r9d, %r13d
movl %ecx, %ebp
movl %edx, %r14d
movl %esi, %r12d
movl %edi, 0x8(%rsp)
movq %r8, 0x10(%rsp)
callq 0x5b939
testl %eax, %eax
je 0x3c5af
movq 0x10(%rsp), %rax
movb (%rax), %cl
testb %cl, %cl
je 0x3c5af
movzbl %r13b, %eax
cmpb $0x2, %al
movl $0x2, %edx
cmovbl %eax, %edx
movzbl %dl, %edx
shll $0x5, %edx
leaq 0x55564(%rip), %rsi     # 0x919f0
leaq (%rsi,%rdx), %rax
movq (%rdx,%rsi), %rdi
movq %rdi, 0x38(%rsp)
movslq 0x10(%rdx,%rsi), %rdi
movq %rdi, 0x30(%rsp)
movslq 0x18(%rdx,%rsi), %rdi
movq %rdi, 0x28(%rsp)
movl 0xc(%rdx,%rsi), %edi
movq %rdi, 0x18(%rsp)
leal -0x1(%r12,%rdi), %edi
movslq %edi, %rdi
movq %rdi, 0x20(%rsp)
movl 0x8(%rdx,%rsi), %edx
movl %edx, 0xc(%rsp)
xorl %edx, %edx
leaq 0x672cc(%rip), %r13     # 0xa37a0
movq %rdx, 0x40(%rsp)
cmpl $0x0, 0x18(%rsp)
jle 0x3c58e
movzbl %cl, %r12d
imulq 0x30(%rsp), %r12
addq 0x28(%rsp), %r12
addq 0x38(%rsp), %r12
movq 0x20(%rsp), %rcx
leaq 0x3d979c(%rip), %rdx    # 0x415ca0
movslq (%rdx,%rcx,4), %rdx
movslq 0x8(%rsp), %rcx
addq %rdx, %rcx
leaq 0x140b99(%rip), %rdx    # 0x17d0b0
addq (%rdx), %rcx
movslq 0x8(%rax), %rdx
movq %rdx, %rbx
incq %rbx
movq 0x18(%rsp), %r8
leaq -0x1(%r8), %rdi
testl %edx, %edx
jle 0x3c578
movl 0x14(%rax), %esi
addl %edx, %esi
movl $0x8, %r9d
subl %esi, %r9d
movq %rbx, %rsi
testw %bp, %bp
sets %r10b
movslq %r9d, %r15
movb (%r15,%r13), %r15b
andb (%r12,%rdi), %r15b
sete %r11b
testb %r10b, %r11b
jne 0x3c56c
testb %r15b, %r15b
movl %ebp, %r10d
cmovnel %r14d, %r10d
movb %r10b, -0x2(%rcx,%rsi)
decq %rsi
incl %r9d
cmpq $0x1, %rsi
jg 0x3c542
leaq 0x140d05(%rip), %rsi    # 0x17d284
movslq (%rsi), %rsi
subq %rsi, %rcx
cmpq $0x1, %r8
movq %rdi, %r8
jg 0x3c529
movl 0xc(%rsp), %ecx
addl %ecx, 0x8(%rsp)
movq 0x10(%rsp), %rcx
movq 0x40(%rsp), %rdx
movb 0x1(%rcx,%rdx), %cl
incq %rdx
testb %cl, %cl
jne 0x3c4d4
addq $0x48, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/jonof[P]jftekwar/jfbuild/src/engine.c
// Function: setrendermode
int setrendermode(int renderer)
{
	if (bpp == 8) {
		if (renderer < 0) renderer = 0;
		else if (renderer > 2) renderer = 2;
	} else {
		renderer = 3;
	}

	rendmode = renderer;

	return 0;
}

// Assembly:
leaq 0x140adf(%rip), %rcx    # 0x17d0a4
movl $0x3, %eax
cmpl $0x8, (%rcx)
jne 0x3c5e2
testl %edi, %edi
js 0x3c5e0
cmpl $0x2, %edi
movl $0x2, %eax
cmovll %edi, %eax
jmp 0x3c5e2
xorl %eax, %eax
leaq 0x5bd367(%rip), %rcx    # 0x5f9950
movl %eax, (%rcx)
xorl %eax, %eax
retq
// File: /workspace/github_c_makefile_star2_O1/jonof[P]jftekwar/jfbuild/src/engine.c
// Function: setpolymost2dview
void setpolymost2dview(void)
{
	if (rendmode < 3) return;

	if (gloy1 != -1) {
		glfunc.glViewport(0,0,xres,yres);
	}

	gloy1 = -1;

	glfunc.glDisable(GL_DEPTH_TEST);
	glfunc.glDisable(GL_BLEND);
}

// Assembly:
pushq %rbx
leaq 0x5bd322(%rip), %rax    # 0x5f9950
cmpl $0x3, (%rax)
jge 0x3c635
popq %rbx
retq
leaq 0x5bd414(%rip), %rbx    # 0x5f9a50
movss (%rbx), %xmm0
ucomiss 0x38cd9(%rip), %xmm0    # 0x75320
jne 0x3c64b
jnp 0x3c66e
leaq 0x5bd0ee(%rip), %rax    # 0x5f9740
leaq 0x669d7(%rip), %rcx     # 0xa3030
movl (%rcx), %edx
leaq 0x669d2(%rip), %rcx     # 0xa3034
movl (%rcx), %ecx
xorl %edi, %edi
xorl %esi, %esi
callq *0x80(%rax)
movl $0xbf800000, (%rbx)     # imm = 0xBF800000
leaq 0x5bd0c5(%rip), %rbx    # 0x5f9740
movl $0xb71, %edi            # imm = 0xB71
callq *0x48(%rbx)
movl $0xbe2, %edi            # imm = 0xBE2
movq %rbx, %rax
popq %rbx
jmpq *0x48(%rax)
// File: /workspace/github_c_makefile_star2_O1/jonof[P]jftekwar/jfbuild/src/engine.c
// Function: buildsetlogfile
void buildsetlogfile(const char *fn)
{
	if (logfile) Bfclose(logfile);
	logfile = NULL;
	if (fn) logfile = Bfopen(fn,"w");
	if (logfile) setvbuf(logfile, (char*)NULL, _IONBF, 0);
}

// Assembly:
pushq %rbx
movq %rdi, %rbx
movq 0x36ee5e(%rip), %rdi    # 0x3ab4f8
testq %rdi, %rdi
je 0x3c6a4
callq 0x6480
movq $0x0, 0x36ee49(%rip) # 0x3ab4f8
testq %rbx, %rbx
je 0x3c6ca
leaq 0x3d56e(%rip), %rsi     # 0x79c29
movq %rbx, %rdi
callq 0x6ce0
movq %rax, 0x36ee2e(%rip)    # 0x3ab4f8
movq 0x36ee27(%rip), %rdi    # 0x3ab4f8
testq %rdi, %rdi
je 0x3c6e5
xorl %esi, %esi
movl $0x2, %edx
xorl %ecx, %ecx
popq %rbx
jmp 0x64a0
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O1/jonof[P]jftekwar/jfbuild/src/engine.c
// Function: hline
static void hline(int xr, int yp)
{
	int xl, r, s;

	xl = lastx[yp]; if (xl > xr) return;
	r = horizlookup2[yp-globalhoriz+horizycent];
	asm1 = globalx1*r;
	asm2 = globaly2*r;
	s = ((int)getpalookup((int)mulscale16(r,globvis),globalshade)<<8);

	hlineasm4(xr-xl,0L,s,globalx2*r+globalypanning,globaly1*r+globalxpanning,
		(void *)(ylookup[yp]+xr+frameoffset));
}

// Assembly:
movl %edi, %eax
movslq %esi, %rsi
leaq 0x414b62(%rip), %rcx    # 0x452d30
subl (%rcx,%rsi,4), %edi
jge 0x3e1d4
retq
movq 0x3d7aad(%rip), %rcx    # 0x415c88
movl 0x23c8bb(%rip), %edx    # 0x27aa9c
movl %esi, %r8d
subl %edx, %r8d
movslq 0x3d7aa2(%rip), %rdx    # 0x415c90
movslq %r8d, %r8
addq %rdx, %r8
movslq (%rcx,%r8,4), %r9
movl 0x3d563a(%rip), %ecx    # 0x413838
imull %r9d, %ecx
movl %ecx, 0x3d7a4c(%rip)    # 0x415c54
movl 0x3d5636(%rip), %ecx    # 0x413844
imull %r9d, %ecx
movl %ecx, 0x3d7a40(%rip)    # 0x415c58
movslq 0x3d5611(%rip), %rcx    # 0x413830
imulq %r9, %rcx
shrq $0x10, %rcx
sarl $0x8, %ecx
addl 0x3d55fc(%rip), %ecx    # 0x41382c
xorl %edx, %edx
testl %ecx, %ecx
cmovlel %edx, %ecx
movswl 0x3d55ea(%rip), %edx    # 0x413828
decl %edx
cmpl %edx, %ecx
cmovll %ecx, %edx
shll $0x8, %edx
movl 0x3d55f2(%rip), %ecx    # 0x413840
imull %r9d, %ecx
addl 0x41488c(%rip), %ecx    # 0x452ae4
movl 0x3d55dd(%rip), %r8d    # 0x41383c
imull %r9d, %r8d
addl 0x414876(%rip), %r8d    # 0x452ae0
leaq 0x3d7a2f(%rip), %r9     # 0x415ca0
movslq (%r9,%rsi,4), %rsi
movslq %eax, %r9
addq %rsi, %r9
addq 0x39850e(%rip), %r9     # 0x3d6790
xorl %esi, %esi
jmp 0x6dd04
// File: /workspace/github_c_makefile_star2_O1/jonof[P]jftekwar/jfbuild/src/engine.c
// Function: slowhline
static void slowhline(int xr, int yp)
{
	int xl, r;

	xl = lastx[yp]; if (xl > xr) return;
	r = horizlookup2[yp-globalhoriz+horizycent];
	asm1 = globalx1*r;
	asm2 = globaly2*r;

	asm3 = (intptr_t)globalpalwritten + ((int)getpalookup((int)mulscale16(r,globvis),globalshade)<<8);
	if (!(globalorientation&256))
	{
		mhline((void *)globalbufplc,globaly1*r+globalxpanning-asm1*(xr-xl),(xr-xl)<<16,0L,
			globalx2*r+globalypanning-asm2*(xr-xl),(void *)(ylookup[yp]+xl+frameoffset));
		return;
	}
	thline((void *)globalbufplc,globaly1*r+globalxpanning-asm1*(xr-xl),(xr-xl)<<16,0L,
		globalx2*r+globalypanning-asm2*(xr-xl),(void *)(ylookup[yp]+xl+frameoffset));
}

// Assembly:
movslq %esi, %rax
leaq 0x414a9d(%rip), %rcx    # 0x452d30
movslq (%rcx,%rax,4), %rcx
cmpl %ecx, %edi
jge 0x3e29c
retq
movl %edi, %edx
movq 0x3d79e3(%rip), %rsi    # 0x415c88
movl 0x23c7f1(%rip), %edi    # 0x27aa9c
movl %eax, %r8d
subl %edi, %r8d
movslq 0x3d79d8(%rip), %rdi    # 0x415c90
movslq %r8d, %r8
addq %rdi, %r8
movslq (%rsi,%r8,4), %r8
movl 0x3d556f(%rip), %r10d   # 0x413838
imull %r8d, %r10d
movl %r10d, 0x3d7980(%rip)   # 0x415c54
movl 0x3d5569(%rip), %r9d    # 0x413844
imull %r8d, %r9d
movslq 0x3d554a(%rip), %rsi    # 0x413830
imulq %r8, %rsi
shrq $0x10, %rsi
sarl $0x8, %esi
addl 0x3d5535(%rip), %esi    # 0x41382c
xorl %edi, %edi
testl %esi, %esi
cmovgl %esi, %edi
movswl 0x3d5523(%rip), %esi    # 0x413828
decl %esi
cmpl %esi, %edi
cmovll %edi, %esi
shll $0x8, %esi
movslq %esi, %rsi
addq 0x3d0cef(%rip), %rsi    # 0x40f008
movl %r9d, 0x3d7938(%rip)    # 0x415c58
movq %rsi, 0x3d7939(%rip)    # 0x415c60
movq 0x3d54f2(%rip), %rdi    # 0x413820
movl 0x3d5507(%rip), %r11d   # 0x41383c
imull %r8d, %r11d
movl 0x4147a1(%rip), %esi    # 0x452ae0
subl %ecx, %edx
imull %edx, %r10d
subl %r10d, %esi
addl %r11d, %esi
movl 0x3d54ee(%rip), %r10d   # 0x413840
imull %r8d, %r10d
movl 0x414787(%rip), %r8d    # 0x452ae4
imull %edx, %r9d
shll $0x10, %edx
subl %r9d, %r8d
addl %r10d, %r8d
leaq 0x3d792f(%rip), %r9     # 0x415ca0
movslq (%r9,%rax,4), %r9
addq %rcx, %r9
addq 0x398411(%rip), %r9     # 0x3d6790
testb $0x1, 0x3d0c7b(%rip)    # 0x40f001
jne 0x3e38f
xorl %ecx, %ecx
jmp 0x6dff4
xorl %ecx, %ecx
jmp 0x6e098
// File: /workspace/github_c_makefile_star2_O1/jonof[P]jftekwar/jfbuild/src/engine.c
// Function: ceilspritescan
static void ceilspritescan(int x1, int x2)
{
	int x, y1, y2, twall, bwall;

	y1 = uwall[x1]; y2 = y1;
	for(x=x1;x<=x2;x++)
	{
		twall = uwall[x]-1; bwall = dwall[x];
		if (twall < bwall-1)
		{
			if (twall >= y2)
			{
				while (y1 < y2-1) ceilspritehline(x-1,++y1);
				y1 = twall;
			}
			else
			{
				while (y1 < twall) ceilspritehline(x-1,++y1);
				while (y1 > twall) lastx[y1--] = x;
			}
			while (y2 > bwall) ceilspritehline(x-1,--y2);
			while (y2 < bwall) lastx[y2++] = x;
		}
		else
		{
			while (y1 < y2-1) ceilspritehline(x-1,++y1);
			if (x == x2) break;
			y1 = uwall[x+1]; y2 = y1;
		}
	}
	while (y1 < y2-1) ceilspritehline(x2,++y1);
	faketimerhandler();
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
movslq %edi, %r12
leaq 0x564bbe(%rip), %rax    # 0x5a3520
movswl (%rax,%r12,2), %ebp
cmpl %esi, %r12d
movq %rsi, 0x18(%rsp)
jle 0x3e979
movl %ebp, %r14d
jmp 0x3eadd
movslq %esi, %rax
movq %rax, 0x20(%rsp)
leal 0x1(%rsi), %eax
movl %eax, 0x14(%rsp)
movl %ebp, %r14d
leaq 0x564b8e(%rip), %rax    # 0x5a3520
movswl (%rax,%r12,2), %ecx
leaq 0x469572(%rip), %rax    # 0x4a7f10
movswl (%rax,%r12,2), %ebx
cmpw %bx, %cx
jge 0x3e9e8
leal -0x1(%rcx), %esi
cmpl %ecx, %r14d
jge 0x3ea25
leal -0x1(%r14), %eax
cmpl %eax, %ebp
jge 0x3ea81
movl %esi, 0x8(%rsp)
leal -0x1(%r12), %r15d
incl %ebp
leaq 0x414362(%rip), %r13    # 0x452d30
movl %r15d, %edi
movl %ebp, %esi
callq 0x3f930
incl %ebp
cmpl %ebp, %r14d
jne 0x3e9ce
movl 0x8(%rsp), %ebp
jmp 0x3ea8a
leal -0x1(%r14), %ebx
cmpl %ebx, %ebp
jge 0x3ea05
leal -0x1(%r12), %r15d
incl %ebp
movl %r15d, %edi
movl %ebp, %esi
callq 0x3f930
cmpl %ebp, %ebx
jne 0x3e9f5
cmpq 0x20(%rsp), %r12
je 0x3eadd
leaq 0x564b09(%rip), %rax    # 0x5a3520
movswl 0x2(%rax,%r12,2), %r14d
movl %r14d, %ebp
jmp 0x3eacf
movq %rcx, 0x8(%rsp)
cmpl %esi, %ebp
jge 0x3ea4a
leal -0x1(%r12), %r15d
incl %ebp
movl %r15d, %edi
movl %esi, %r13d
movl %ebp, %esi
callq 0x3f930
movl %r13d, %esi
cmpl %ebp, %r13d
jne 0x3ea33
movq 0x8(%rsp), %rcx
cmpl %ecx, %ebp
jl 0x3ea83
movslq %ebp, %rax
movslq %ecx, %rcx
leaq 0x4142d0(%rip), %r13    # 0x452d30
leaq (,%rax,4), %rdx
addq %r13, %rdx
incq %rax
movl %r12d, (%rdx)
decq %rax
addq $-0x4, %rdx
cmpq %rcx, %rax
jg 0x3ea6e
movl %esi, %ebp
jmp 0x3ea8a
movl %esi, %ebp
leaq 0x4142a6(%rip), %r13    # 0x452d30
cmpl %ebx, %r14d
jle 0x3eaa7
leal -0x1(%r12), %r15d
decl %r14d
movl %r15d, %edi
movl %r14d, %esi
callq 0x3f930
cmpl %ebx, %r14d
jg 0x3ea94
cmpl %ebx, %r14d
jge 0x3eacf
movslq %r14d, %rax
movslq %ebx, %rcx
subq %rax, %rcx
shlq $0x2, %rax
xorl %edx, %edx
leaq (%rax,%rdx,4), %rsi
movl %r12d, (%r13,%rsi)
incq %rdx
cmpq %rdx, %rcx
jne 0x3eabb
addl %edx, %r14d
incq %r12
cmpl %r12d, 0x14(%rsp)
jne 0x3e98b
leal -0x1(%r14), %eax
cmpl %eax, %ebp
movq 0x18(%rsp), %rbx
jge 0x3eafc
incl %ebp
movl %ebx, %edi
movl %ebp, %esi
callq 0x3f930
incl %ebp
cmpl %ebp, %r14d
jne 0x3eaec
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0xab51
// File: /workspace/github_c_makefile_star2_O1/jonof[P]jftekwar/jfbuild/src/engine.c
// Function: ceilspritehline
static void ceilspritehline(int x2, int y)
{
	int x1, v, bx, by;

	//x = x1 + (x2-x1)t + (y1-y2)u  ~  x = 160v
	//y = y1 + (y2-y1)t + (x2-x1)u  ~  y = (scrx-160)v
	//z = z1 = z2                   ~  z = posz + (scry-horiz)v

	x1 = lastx[y]; if (x2 < x1) return;

	v = mulscale20(globalzd,horizlookup[y-globalhoriz+horizycent]);
	bx = mulscale14(globalx2*x1+globalx1,v) + globalxpanning;
	by = mulscale14(globaly2*x1+globaly1,v) + globalypanning;
	asm1 = mulscale14(globalx2,v);
	asm2 = mulscale14(globaly2,v);

	asm3 = (intptr_t)palookup[globalpal] + (getpalookup((int)mulscale28(klabs(v),globvis),globalshade)<<8);

	if ((globalorientation&2) == 0)
		mhline((void *)globalbufplc,bx,(x2-x1)<<16,0L,by,(void *)(ylookup[y]+x1+frameoffset));
	else
	{
		thline((void *)globalbufplc,bx,(x2-x1)<<16,0L,by,(void *)(ylookup[y]+x1+frameoffset));
	}
}

// Assembly:
movslq %esi, %rax
leaq 0x4133f6(%rip), %rcx    # 0x452d30
movslq (%rcx,%rax,4), %rcx
cmpl %ecx, %edi
jge 0x3f943
retq
movl %edi, %edx
movslq 0x4131a0(%rip), %rsi    # 0x452aec
movq 0x3d632d(%rip), %rdi    # 0x415c80
movl 0x23b142(%rip), %r8d    # 0x27aa9c
movl %eax, %r9d
subl %r8d, %r9d
movslq 0x3d6329(%rip), %r8     # 0x415c90
movslq %r9d, %r9
addq %r8, %r9
movslq (%rdi,%r9,4), %rdi
imulq %rsi, %rdi
shrq $0x14, %rdi
movslq 0x3d3ec0(%rip), %r10    # 0x413840
movq %r10, %r8
imulq %rcx, %r8
movslq 0x3d3eaa(%rip), %rsi    # 0x413838
addq %r8, %rsi
movslq %edi, %r9
imulq %r9, %rsi
shrq $0xe, %rsi
addl 0x41313e(%rip), %esi    # 0x452ae0
movslq 0x3d3e9b(%rip), %rdi    # 0x413844
movq %rdi, %r11
imulq %rcx, %r11
movslq 0x3d3e85(%rip), %r8     # 0x41383c
addq %r11, %r8
imulq %r9, %r8
shrq $0xe, %r8
addl 0x41311b(%rip), %r8d    # 0x452ae4
imulq %r9, %r10
shrq $0xe, %r10
movl %r10d, 0x3d627c(%rip)   # 0x415c54
imulq %r9, %rdi
shrq $0xe, %rdi
movslq 0x3cf61d(%rip), %r10    # 0x40f004
movl %r9d, %r11d
negl %r11d
cmovsl %r9d, %r11d
movslq 0x3d3e38(%rip), %r9     # 0x413830
imulq %r9, %r11
shrq $0x1c, %r11
sarl $0x8, %r11d
addl 0x3d3e21(%rip), %r11d   # 0x41382c
xorl %r9d, %r9d
testl %r11d, %r11d
cmovgl %r11d, %r9d
movswl 0x3d3e0b(%rip), %r11d   # 0x413828
decl %r11d
cmpl %r11d, %r9d
cmovll %r9d, %r11d
leaq 0x3580b2(%rip), %r9     # 0x397ae0
shll $0x8, %r11d
movslq %r11d, %r11
addq (%r9,%r10,8), %r11
movl %edi, 0x3d6219(%rip)    # 0x415c58
movq %r11, 0x3d621a(%rip)    # 0x415c60
subl %ecx, %edx
shll $0x10, %edx
leaq 0x3d624e(%rip), %rdi    # 0x415ca0
movslq (%rdi,%rax,4), %r9
addq %rcx, %r9
movq 0x3d3dc0(%rip), %rdi    # 0x413820
addq 0x396d29(%rip), %r9     # 0x3d6790
testb $0x2, 0x3cf592(%rip)    # 0x40f000
jne 0x3fa77
xorl %ecx, %ecx
jmp 0x6dff4
xorl %ecx, %ecx
jmp 0x6e098