LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_c_makefile_star2_O0/jonof[P]jftekwar/jfbuild/src/engine.c
// Function: inside
int inside(int x, int y, short sectnum)
{
	walltype *wal;
	int i, x1, y1, x2, y2;
	unsigned int cnt;

	if ((sectnum < 0) || (sectnum >= numsectors)) return(-1);

	cnt = 0;
	wal = &wall[sector[sectnum].wallptr];
	i = sector[sectnum].wallnum;
	do
	{
		y1 = wal->y-y; y2 = wall[wal->point2].y-y;
		if ((y1^y2) < 0)
		{
			x1 = wal->x-x; x2 = wall[wal->point2].x-x;
			if ((x1^x2) >= 0) cnt ^= x1; else cnt ^= (x1*y2-x2*y1)^y2;
		}
		wal++; i--;
	} while (i);
	return(cnt>>31);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movw %dx, %ax
movl %edi, -0x8(%rbp)
movl %esi, -0xc(%rbp)
movw %ax, -0xe(%rbp)
movswl -0xe(%rbp), %eax
cmpl $0x0, %eax
jl 0x4ee99
movswl -0xe(%rbp), %eax
movswl 0x3bdc2b(%rip), %ecx    # 0x40cac0
cmpl %ecx, %eax
jl 0x4eea5
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0x4efab
movl $0x0, -0x30(%rbp)
movswq -0xe(%rbp), %rcx
leaq 0x231708(%rip), %rax    # 0x2805c0
imulq $0x28, %rcx, %rcx
addq %rcx, %rax
movswq (%rax), %rcx
leaq 0x1a66e6(%rip), %rax    # 0x1f55b0
shlq $0x5, %rcx
addq %rcx, %rax
movq %rax, -0x18(%rbp)
movswq -0xe(%rbp), %rcx
leaq 0x2316df(%rip), %rax    # 0x2805c0
imulq $0x28, %rcx, %rcx
addq %rcx, %rax
movswl 0x2(%rax), %eax
movl %eax, -0x1c(%rbp)
movq -0x18(%rbp), %rax
movl 0x4(%rax), %eax
subl -0xc(%rbp), %eax
movl %eax, -0x24(%rbp)
movq -0x18(%rbp), %rax
movswq 0x8(%rax), %rcx
leaq 0x1a66a4(%rip), %rax    # 0x1f55b0
shlq $0x5, %rcx
addq %rcx, %rax
movl 0x4(%rax), %eax
subl -0xc(%rbp), %eax
movl %eax, -0x2c(%rbp)
movl -0x24(%rbp), %eax
xorl -0x2c(%rbp), %eax
cmpl $0x0, %eax
jge 0x4ef83
movq -0x18(%rbp), %rax
movl (%rax), %eax
subl -0x8(%rbp), %eax
movl %eax, -0x20(%rbp)
movq -0x18(%rbp), %rax
movswq 0x8(%rax), %rcx
leaq 0x1a666d(%rip), %rax    # 0x1f55b0
shlq $0x5, %rcx
addq %rcx, %rax
movl (%rax), %eax
subl -0x8(%rbp), %eax
movl %eax, -0x28(%rbp)
movl -0x20(%rbp), %eax
xorl -0x28(%rbp), %eax
cmpl $0x0, %eax
jl 0x4ef68
movl -0x20(%rbp), %eax
xorl -0x30(%rbp), %eax
movl %eax, -0x30(%rbp)
jmp 0x4ef81
movl -0x20(%rbp), %eax
imull -0x2c(%rbp), %eax
movl -0x28(%rbp), %ecx
imull -0x24(%rbp), %ecx
subl %ecx, %eax
xorl -0x2c(%rbp), %eax
xorl -0x30(%rbp), %eax
movl %eax, -0x30(%rbp)
jmp 0x4ef83
movq -0x18(%rbp), %rax
addq $0x20, %rax
movq %rax, -0x18(%rbp)
movl -0x1c(%rbp), %eax
addl $-0x1, %eax
movl %eax, -0x1c(%rbp)
cmpl $0x0, -0x1c(%rbp)
jne 0x4eeef
movl -0x30(%rbp), %eax
shrl $0x1f, %eax
movl %eax, -0x4(%rbp)
movl -0x4(%rbp), %eax
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O0/jonof[P]jftekwar/jfbuild/src/engine.c
// Function: getangle
int getangle(int xvect, int yvect)
{
	if ((xvect|yvect) == 0) return(0);
	if (xvect == 0) return(512+((yvect<0)<<10));
	if (yvect == 0) return(((xvect<0)<<10));
	if (xvect == yvect) return(256+((xvect<0)<<10));
	if (xvect == -yvect) return(768+((xvect>0)<<10));
	if (klabs(xvect) > klabs(yvect))
		return(((radarang[640+scale(160,yvect,xvect)]>>6)+((xvect<0)<<10))&2047);
	return(((radarang[640-scale(160,xvect,yvect)]>>6)+512+((yvect<0)<<10))&2047);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x10, %rsp
movl %edi, -0x8(%rbp)
movl %esi, -0xc(%rbp)
movl -0x8(%rbp), %eax
orl -0xc(%rbp), %eax
cmpl $0x0, %eax
jne 0x4efd5
movl $0x0, -0x4(%rbp)
jmp 0x4f107
cmpl $0x0, -0x8(%rbp)
jne 0x4eff7
cmpl $0x0, -0xc(%rbp)
setl %al
andb $0x1, %al
movzbl %al, %eax
shll $0xa, %eax
addl $0x200, %eax            # imm = 0x200
movl %eax, -0x4(%rbp)
jmp 0x4f107
cmpl $0x0, -0xc(%rbp)
jne 0x4f014
cmpl $0x0, -0x8(%rbp)
setl %al
andb $0x1, %al
movzbl %al, %eax
shll $0xa, %eax
movl %eax, -0x4(%rbp)
jmp 0x4f107
movl -0x8(%rbp), %eax
cmpl -0xc(%rbp), %eax
jne 0x4f038
cmpl $0x0, -0x8(%rbp)
setl %al
andb $0x1, %al
movzbl %al, %eax
shll $0xa, %eax
addl $0x100, %eax            # imm = 0x100
movl %eax, -0x4(%rbp)
jmp 0x4f107
movl -0x8(%rbp), %eax
xorl %ecx, %ecx
subl -0xc(%rbp), %ecx
cmpl %ecx, %eax
jne 0x4f060
cmpl $0x0, -0x8(%rbp)
setg %al
andb $0x1, %al
movzbl %al, %eax
shll $0xa, %eax
addl $0x300, %eax            # imm = 0x300
movl %eax, -0x4(%rbp)
jmp 0x4f107
movl -0x8(%rbp), %edi
callq 0x37610
movl %eax, -0x10(%rbp)
movl -0xc(%rbp), %edi
callq 0x37610
movl %eax, %ecx
movl -0x10(%rbp), %eax
cmpl %ecx, %eax
jle 0x4f0be
movl -0xc(%rbp), %esi
movl -0x8(%rbp), %edx
movl $0xa0, %edi
callq 0x37720
addl $0x280, %eax            # imm = 0x280
movslq %eax, %rcx
leaq 0x41c2e5(%rip), %rax    # 0x46b380
movswl (%rax,%rcx,2), %eax
sarl $0x6, %eax
cmpl $0x0, -0x8(%rbp)
setl %cl
andb $0x1, %cl
movzbl %cl, %ecx
shll $0xa, %ecx
addl %ecx, %eax
andl $0x7ff, %eax            # imm = 0x7FF
movl %eax, -0x4(%rbp)
jmp 0x4f107
movl -0x8(%rbp), %esi
movl -0xc(%rbp), %edx
movl $0xa0, %edi
callq 0x37720
movl %eax, %ecx
movl $0x280, %eax            # imm = 0x280
subl %ecx, %eax
movslq %eax, %rcx
leaq 0x41c29f(%rip), %rax    # 0x46b380
movswl (%rax,%rcx,2), %eax
sarl $0x6, %eax
addl $0x200, %eax            # imm = 0x200
cmpl $0x0, -0xc(%rbp)
setl %cl
andb $0x1, %cl
movzbl %cl, %ecx
shll $0xa, %ecx
addl %ecx, %eax
andl $0x7ff, %eax            # imm = 0x7FF
movl %eax, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x10, %rsp
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O0/jonof[P]jftekwar/jfbuild/src/engine.c
// Function: setsprite
int setsprite(short spritenum, int newx, int newy, int newz)
{
	short tempsectnum;

	sprite[spritenum].x = newx;
	sprite[spritenum].y = newy;
	sprite[spritenum].z = newz;

	tempsectnum = sprite[spritenum].sectnum;
	updatesector(newx,newy,&tempsectnum);
	if (tempsectnum < 0)
		return(-1);
	if (tempsectnum != sprite[spritenum].sectnum)
		changespritesect(spritenum,tempsectnum);

	return(0);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movw %di, %ax
movw %ax, -0x6(%rbp)
movl %esi, -0xc(%rbp)
movl %edx, -0x10(%rbp)
movl %ecx, -0x14(%rbp)
movl -0xc(%rbp), %ecx
movswq -0x6(%rbp), %rdx
leaq 0x26a699(%rip), %rax    # 0x2b9810
imulq $0x2c, %rdx, %rdx
addq %rdx, %rax
movl %ecx, (%rax)
movl -0x10(%rbp), %ecx
movswq -0x6(%rbp), %rdx
leaq 0x26a681(%rip), %rax    # 0x2b9810
imulq $0x2c, %rdx, %rdx
addq %rdx, %rax
movl %ecx, 0x4(%rax)
movl -0x14(%rbp), %ecx
movswq -0x6(%rbp), %rdx
leaq 0x26a668(%rip), %rax    # 0x2b9810
imulq $0x2c, %rdx, %rdx
addq %rdx, %rax
movl %ecx, 0x8(%rax)
movswq -0x6(%rbp), %rcx
leaq 0x26a652(%rip), %rax    # 0x2b9810
imulq $0x2c, %rcx, %rcx
addq %rcx, %rax
movw 0x18(%rax), %ax
movw %ax, -0x16(%rbp)
movl -0xc(%rbp), %edi
movl -0x10(%rbp), %esi
leaq -0x16(%rbp), %rdx
callq 0x392a0
movswl -0x16(%rbp), %eax
cmpl $0x0, %eax
jge 0x4f1ee
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0x4f224
movswl -0x16(%rbp), %eax
movswq -0x6(%rbp), %rdx
leaq 0x26a612(%rip), %rcx    # 0x2b9810
imulq $0x2c, %rdx, %rdx
addq %rdx, %rcx
movswl 0x18(%rcx), %ecx
cmpl %ecx, %eax
je 0x4f21d
movw -0x6(%rbp), %ax
movswl %ax, %edi
movswl -0x16(%rbp), %esi
callq 0x4f230
movl $0x0, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x20, %rsp
popq %rbp
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O0/jonof[P]jftekwar/jfbuild/src/engine.c
// Function: changespritesect
int changespritesect(short spritenum, short newsectnum)
{
	if ((newsectnum < 0) || (newsectnum > MAXSECTORS)) return(-1);
	if (sprite[spritenum].sectnum == newsectnum) return(0);
	if (sprite[spritenum].sectnum == MAXSECTORS) return(-1);
	if (deletespritesect(spritenum) < 0) return(-1);
	insertspritesect(newsectnum);
	return(0);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x10, %rsp
movw %si, %ax
movw %di, %cx
movw %cx, -0x6(%rbp)
movw %ax, -0x8(%rbp)
movswl -0x8(%rbp), %eax
cmpl $0x0, %eax
jl 0x4f25a
movswl -0x8(%rbp), %eax
cmpl $0x1000, %eax           # imm = 0x1000
jle 0x4f263
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0x4f2d9
movswq -0x6(%rbp), %rcx
leaq 0x26a5a1(%rip), %rax    # 0x2b9810
imulq $0x2c, %rcx, %rcx
addq %rcx, %rax
movswl 0x18(%rax), %eax
movswl -0x8(%rbp), %ecx
cmpl %ecx, %eax
jne 0x4f28b
movl $0x0, -0x4(%rbp)
jmp 0x4f2d9
movswq -0x6(%rbp), %rcx
leaq 0x26a579(%rip), %rax    # 0x2b9810
imulq $0x2c, %rcx, %rcx
addq %rcx, %rax
movswl 0x18(%rax), %eax
cmpl $0x1000, %eax           # imm = 0x1000
jne 0x4f2b2
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0x4f2d9
movswl -0x6(%rbp), %edi
callq 0x4f9c0
cmpl $0x0, %eax
jge 0x4f2c9
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0x4f2d9
movswl -0x8(%rbp), %edi
callq 0x4f6d0
movl $0x0, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x10, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/jonof[P]jftekwar/jfbuild/src/engine.c
// Function: setspritez
int setspritez(short spritenum, int newx, int newy, int newz)
{
	short tempsectnum;

	sprite[spritenum].x = newx;
	sprite[spritenum].y = newy;
	sprite[spritenum].z = newz;

	tempsectnum = sprite[spritenum].sectnum;
	updatesectorz(newx,newy,newz,&tempsectnum);
	if (tempsectnum < 0)
		return(-1);
	if (tempsectnum != sprite[spritenum].sectnum)
		changespritesect(spritenum,tempsectnum);

	return(0);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movw %di, %ax
movw %ax, -0x6(%rbp)
movl %esi, -0xc(%rbp)
movl %edx, -0x10(%rbp)
movl %ecx, -0x14(%rbp)
movl -0xc(%rbp), %ecx
movswq -0x6(%rbp), %rdx
leaq 0x26a4f9(%rip), %rax    # 0x2b9810
imulq $0x2c, %rdx, %rdx
addq %rdx, %rax
movl %ecx, (%rax)
movl -0x10(%rbp), %ecx
movswq -0x6(%rbp), %rdx
leaq 0x26a4e1(%rip), %rax    # 0x2b9810
imulq $0x2c, %rdx, %rdx
addq %rdx, %rax
movl %ecx, 0x4(%rax)
movl -0x14(%rbp), %ecx
movswq -0x6(%rbp), %rdx
leaq 0x26a4c8(%rip), %rax    # 0x2b9810
imulq $0x2c, %rdx, %rdx
addq %rdx, %rax
movl %ecx, 0x8(%rax)
movswq -0x6(%rbp), %rcx
leaq 0x26a4b2(%rip), %rax    # 0x2b9810
imulq $0x2c, %rcx, %rcx
addq %rcx, %rax
movw 0x18(%rax), %ax
movw %ax, -0x16(%rbp)
movl -0xc(%rbp), %edi
movl -0x10(%rbp), %esi
movl -0x14(%rbp), %edx
leaq -0x16(%rbp), %rcx
callq 0x4f3d0
movswl -0x16(%rbp), %eax
cmpl $0x0, %eax
jge 0x4f391
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0x4f3c7
movswl -0x16(%rbp), %eax
movswq -0x6(%rbp), %rdx
leaq 0x26a46f(%rip), %rcx    # 0x2b9810
imulq $0x2c, %rdx, %rdx
addq %rdx, %rcx
movswl 0x18(%rcx), %ecx
cmpl %ecx, %eax
je 0x4f3c0
movw -0x6(%rbp), %ax
movswl %ax, %edi
movswl -0x16(%rbp), %esi
callq 0x4f230
movl $0x0, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x20, %rsp
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O0/jonof[P]jftekwar/jfbuild/src/engine.c
// Function: insertspritestat
static int insertspritestat(short statnum)
{
	short blanktouse;

	if ((statnum >= MAXSTATUS) || (headspritestat[MAXSTATUS] == -1))
		return(-1);  //list full

	blanktouse = headspritestat[MAXSTATUS];

	headspritestat[MAXSTATUS] = nextspritestat[blanktouse];
	if (headspritestat[MAXSTATUS] >= 0)
		prevspritestat[headspritestat[MAXSTATUS]] = -1;

	prevspritestat[blanktouse] = -1;
	nextspritestat[blanktouse] = headspritestat[statnum];
	if (headspritestat[statnum] >= 0)
		prevspritestat[headspritestat[statnum]] = blanktouse;
	headspritestat[statnum] = blanktouse;

	sprite[blanktouse].statnum = statnum;

	return(blanktouse);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movw %di, %ax
movw %ax, -0x6(%rbp)
movswl -0x6(%rbp), %eax
cmpl $0x400, %eax            # imm = 0x400
jge 0x4f5d2
movswl 0x3ac2b3(%rip), %eax    # 0x3fb880
cmpl $-0x1, %eax
jne 0x4f5de
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0x4f6be
movw 0x3ac29b(%rip), %ax     # 0x3fb880
movw %ax, -0x8(%rbp)
movswq -0x8(%rbp), %rcx
leaq 0x3b429b(%rip), %rax    # 0x403890
movw (%rax,%rcx,2), %ax
movw %ax, 0x3ac280(%rip)     # 0x3fb880
movswl 0x3ac279(%rip), %eax    # 0x3fb880
cmpl $0x0, %eax
jl 0x4f621
movswq 0x3ac26c(%rip), %rcx    # 0x3fb880
leaq 0x3ac275(%rip), %rax    # 0x3fb890
movw $0xffff, (%rax,%rcx,2)  # imm = 0xFFFF
movswq -0x8(%rbp), %rcx
leaq 0x3ac263(%rip), %rax    # 0x3fb890
movw $0xffff, (%rax,%rcx,2)  # imm = 0xFFFF
movswq -0x6(%rbp), %rcx
leaq 0x3aba41(%rip), %rax    # 0x3fb080
movw (%rax,%rcx,2), %dx
movswq -0x8(%rbp), %rcx
leaq 0x3b4241(%rip), %rax    # 0x403890
movw %dx, (%rax,%rcx,2)
movswq -0x6(%rbp), %rcx
leaq 0x3aba21(%rip), %rax    # 0x3fb080
movswl (%rax,%rcx,2), %eax
cmpl $0x0, %eax
jl 0x4f688
movw -0x8(%rbp), %dx
movswq -0x6(%rbp), %rcx
leaq 0x3aba08(%rip), %rax    # 0x3fb080
movswq (%rax,%rcx,2), %rcx
leaq 0x3ac20c(%rip), %rax    # 0x3fb890
movw %dx, (%rax,%rcx,2)
movw -0x8(%rbp), %dx
movswq -0x6(%rbp), %rcx
leaq 0x3ab9e8(%rip), %rax    # 0x3fb080
movw %dx, (%rax,%rcx,2)
movw -0x6(%rbp), %cx
movswq -0x8(%rbp), %rdx
leaq 0x26a164(%rip), %rax    # 0x2b9810
imulq $0x2c, %rdx, %rdx
addq %rdx, %rax
movw %cx, 0x1a(%rax)
movswl -0x8(%rbp), %eax
movl %eax, -0x4(%rbp)
movl -0x4(%rbp), %eax
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/jonof[P]jftekwar/jfbuild/src/engine.c
// Function: insertspritesect
static int insertspritesect(short sectnum)
{
	short blanktouse;

	if ((sectnum >= MAXSECTORS) || (headspritesect[MAXSECTORS] == -1))
		return(-1);  //list full

	blanktouse = headspritesect[MAXSECTORS];

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

	prevspritesect[blanktouse] = -1;
	nextspritesect[blanktouse] = headspritesect[sectnum];
	if (headspritesect[sectnum] >= 0)
		prevspritesect[headspritesect[sectnum]] = blanktouse;
	headspritesect[sectnum] = blanktouse;

	sprite[blanktouse].sectnum = sectnum;

	return(blanktouse);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movw %di, %ax
movw %ax, -0x6(%rbp)
movswl -0x6(%rbp), %eax
cmpl $0x1000, %eax           # imm = 0x1000
jge 0x4f6f2
movswl 0x39b983(%rip), %eax    # 0x3eb070
cmpl $-0x1, %eax
jne 0x4f6fe
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0x4f7de
movw 0x39b96b(%rip), %ax     # 0x3eb070
movw %ax, -0x8(%rbp)
movswq -0x8(%rbp), %rcx
leaq 0x3a396b(%rip), %rax    # 0x3f3080
movw (%rax,%rcx,2), %ax
movw %ax, 0x39b950(%rip)     # 0x3eb070
movswl 0x39b949(%rip), %eax    # 0x3eb070
cmpl $0x0, %eax
jl 0x4f741
movswq 0x39b93c(%rip), %rcx    # 0x3eb070
leaq 0x39b945(%rip), %rax    # 0x3eb080
movw $0xffff, (%rax,%rcx,2)  # imm = 0xFFFF
movswq -0x8(%rbp), %rcx
leaq 0x39b933(%rip), %rax    # 0x3eb080
movw $0xffff, (%rax,%rcx,2)  # imm = 0xFFFF
movswq -0x6(%rbp), %rcx
leaq 0x399911(%rip), %rax    # 0x3e9070
movw (%rax,%rcx,2), %dx
movswq -0x8(%rbp), %rcx
leaq 0x3a3911(%rip), %rax    # 0x3f3080
movw %dx, (%rax,%rcx,2)
movswq -0x6(%rbp), %rcx
leaq 0x3998f1(%rip), %rax    # 0x3e9070
movswl (%rax,%rcx,2), %eax
cmpl $0x0, %eax
jl 0x4f7a8
movw -0x8(%rbp), %dx
movswq -0x6(%rbp), %rcx
leaq 0x3998d8(%rip), %rax    # 0x3e9070
movswq (%rax,%rcx,2), %rcx
leaq 0x39b8dc(%rip), %rax    # 0x3eb080
movw %dx, (%rax,%rcx,2)
movw -0x8(%rbp), %dx
movswq -0x6(%rbp), %rcx
leaq 0x3998b8(%rip), %rax    # 0x3e9070
movw %dx, (%rax,%rcx,2)
movw -0x6(%rbp), %cx
movswq -0x8(%rbp), %rdx
leaq 0x26a044(%rip), %rax    # 0x2b9810
imulq $0x2c, %rdx, %rdx
addq %rdx, %rax
movw %cx, 0x18(%rax)
movswl -0x8(%rbp), %eax
movl %eax, -0x4(%rbp)
movl -0x4(%rbp), %eax
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/jonof[P]jftekwar/jfbuild/src/engine.c
// Function: deletespritestat
static int deletespritestat(short deleteme)
{
	if (sprite[deleteme].statnum == MAXSTATUS)
		return(-1);

	if (headspritestat[sprite[deleteme].statnum] == deleteme)
		headspritestat[sprite[deleteme].statnum] = nextspritestat[deleteme];

	if (prevspritestat[deleteme] >= 0) nextspritestat[prevspritestat[deleteme]] = nextspritestat[deleteme];
	if (nextspritestat[deleteme] >= 0) prevspritestat[nextspritestat[deleteme]] = prevspritestat[deleteme];

	if (headspritestat[MAXSTATUS] >= 0) prevspritestat[headspritestat[MAXSTATUS]] = deleteme;
	prevspritestat[deleteme] = -1;
	nextspritestat[deleteme] = headspritestat[MAXSTATUS];
	headspritestat[MAXSTATUS] = deleteme;

	sprite[deleteme].statnum = MAXSTATUS;
	return(0);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movw %di, %ax
movw %ax, -0x6(%rbp)
movswq -0x6(%rbp), %rcx
leaq 0x269fd9(%rip), %rax    # 0x2b9810
imulq $0x2c, %rcx, %rcx
addq %rcx, %rax
movswl 0x1a(%rax), %eax
cmpl $0x400, %eax            # imm = 0x400
jne 0x4f855
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0x4f9ac
movswq -0x6(%rbp), %rcx
leaq 0x269faf(%rip), %rax    # 0x2b9810
imulq $0x2c, %rcx, %rcx
addq %rcx, %rax
movswq 0x1a(%rax), %rcx
leaq 0x3ab80c(%rip), %rax    # 0x3fb080
movswl (%rax,%rcx,2), %eax
movswl -0x6(%rbp), %ecx
cmpl %ecx, %eax
jne 0x4f8b3
movswq -0x6(%rbp), %rcx
leaq 0x3b4004(%rip), %rax    # 0x403890
movw (%rax,%rcx,2), %dx
movswq -0x6(%rbp), %rcx
leaq 0x269f74(%rip), %rax    # 0x2b9810
imulq $0x2c, %rcx, %rcx
addq %rcx, %rax
movswq 0x1a(%rax), %rcx
leaq 0x3ab7d1(%rip), %rax    # 0x3fb080
movw %dx, (%rax,%rcx,2)
movswq -0x6(%rbp), %rcx
leaq 0x3abfd1(%rip), %rax    # 0x3fb890
movswl (%rax,%rcx,2), %eax
cmpl $0x0, %eax
jl 0x4f8f4
movswq -0x6(%rbp), %rcx
leaq 0x3b3fbc(%rip), %rax    # 0x403890
movw (%rax,%rcx,2), %dx
movswq -0x6(%rbp), %rcx
leaq 0x3abfac(%rip), %rax    # 0x3fb890
movswq (%rax,%rcx,2), %rcx
leaq 0x3b3fa0(%rip), %rax    # 0x403890
movw %dx, (%rax,%rcx,2)
movswq -0x6(%rbp), %rcx
leaq 0x3b3f90(%rip), %rax    # 0x403890
movswl (%rax,%rcx,2), %eax
cmpl $0x0, %eax
jl 0x4f935
movswq -0x6(%rbp), %rcx
leaq 0x3abf7b(%rip), %rax    # 0x3fb890
movw (%rax,%rcx,2), %dx
movswq -0x6(%rbp), %rcx
leaq 0x3b3f6b(%rip), %rax    # 0x403890
movswq (%rax,%rcx,2), %rcx
leaq 0x3abf5f(%rip), %rax    # 0x3fb890
movw %dx, (%rax,%rcx,2)
movswl 0x3abf44(%rip), %eax    # 0x3fb880
cmpl $0x0, %eax
jl 0x4f958
movw -0x6(%rbp), %dx
movswq 0x3abf33(%rip), %rcx    # 0x3fb880
leaq 0x3abf3c(%rip), %rax    # 0x3fb890
movw %dx, (%rax,%rcx,2)
movswq -0x6(%rbp), %rcx
leaq 0x3abf2c(%rip), %rax    # 0x3fb890
movw $0xffff, (%rax,%rcx,2)  # imm = 0xFFFF
movw 0x3abf0f(%rip), %dx     # 0x3fb880
movswq -0x6(%rbp), %rcx
leaq 0x3b3f13(%rip), %rax    # 0x403890
movw %dx, (%rax,%rcx,2)
movw -0x6(%rbp), %ax
movw %ax, 0x3abef4(%rip)     # 0x3fb880
movswq -0x6(%rbp), %rcx
leaq 0x269e78(%rip), %rax    # 0x2b9810
imulq $0x2c, %rcx, %rcx
addq %rcx, %rax
movw $0x400, 0x1a(%rax)      # imm = 0x400
movl $0x0, -0x4(%rbp)
movl -0x4(%rbp), %eax
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/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:
pushq %rbp
movq %rsp, %rbp
movw %di, %ax
movw %ax, -0x6(%rbp)
movswq -0x6(%rbp), %rcx
leaq 0x269e39(%rip), %rax    # 0x2b9810
imulq $0x2c, %rcx, %rcx
addq %rcx, %rax
movswl 0x18(%rax), %eax
cmpl $0x1000, %eax           # imm = 0x1000
jne 0x4f9f5
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0x4fb4c
movswq -0x6(%rbp), %rcx
leaq 0x269e0f(%rip), %rax    # 0x2b9810
imulq $0x2c, %rcx, %rcx
addq %rcx, %rax
movswq 0x18(%rax), %rcx
leaq 0x39965c(%rip), %rax    # 0x3e9070
movswl (%rax,%rcx,2), %eax
movswl -0x6(%rbp), %ecx
cmpl %ecx, %eax
jne 0x4fa53
movswq -0x6(%rbp), %rcx
leaq 0x3a3654(%rip), %rax    # 0x3f3080
movw (%rax,%rcx,2), %dx
movswq -0x6(%rbp), %rcx
leaq 0x269dd4(%rip), %rax    # 0x2b9810
imulq $0x2c, %rcx, %rcx
addq %rcx, %rax
movswq 0x18(%rax), %rcx
leaq 0x399621(%rip), %rax    # 0x3e9070
movw %dx, (%rax,%rcx,2)
movswq -0x6(%rbp), %rcx
leaq 0x39b621(%rip), %rax    # 0x3eb080
movswl (%rax,%rcx,2), %eax
cmpl $0x0, %eax
jl 0x4fa94
movswq -0x6(%rbp), %rcx
leaq 0x3a360c(%rip), %rax    # 0x3f3080
movw (%rax,%rcx,2), %dx
movswq -0x6(%rbp), %rcx
leaq 0x39b5fc(%rip), %rax    # 0x3eb080
movswq (%rax,%rcx,2), %rcx
leaq 0x3a35f0(%rip), %rax    # 0x3f3080
movw %dx, (%rax,%rcx,2)
movswq -0x6(%rbp), %rcx
leaq 0x3a35e0(%rip), %rax    # 0x3f3080
movswl (%rax,%rcx,2), %eax
cmpl $0x0, %eax
jl 0x4fad5
movswq -0x6(%rbp), %rcx
leaq 0x39b5cb(%rip), %rax    # 0x3eb080
movw (%rax,%rcx,2), %dx
movswq -0x6(%rbp), %rcx
leaq 0x3a35bb(%rip), %rax    # 0x3f3080
movswq (%rax,%rcx,2), %rcx
leaq 0x39b5af(%rip), %rax    # 0x3eb080
movw %dx, (%rax,%rcx,2)
movswl 0x39b594(%rip), %eax    # 0x3eb070
cmpl $0x0, %eax
jl 0x4faf8
movw -0x6(%rbp), %dx
movswq 0x39b583(%rip), %rcx    # 0x3eb070
leaq 0x39b58c(%rip), %rax    # 0x3eb080
movw %dx, (%rax,%rcx,2)
movswq -0x6(%rbp), %rcx
leaq 0x39b57c(%rip), %rax    # 0x3eb080
movw $0xffff, (%rax,%rcx,2)  # imm = 0xFFFF
movw 0x39b55f(%rip), %dx     # 0x3eb070
movswq -0x6(%rbp), %rcx
leaq 0x3a3563(%rip), %rax    # 0x3f3080
movw %dx, (%rax,%rcx,2)
movw -0x6(%rbp), %ax
movw %ax, 0x39b544(%rip)     # 0x3eb070
movswq -0x6(%rbp), %rcx
leaq 0x269cd8(%rip), %rax    # 0x2b9810
imulq $0x2c, %rcx, %rcx
addq %rcx, %rax
movw $0x1000, 0x18(%rax)     # imm = 0x1000
movl $0x0, -0x4(%rbp)
movl -0x4(%rbp), %eax
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/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
movq %rsp, %rbp
subq $0x10, %rsp
movw %si, %ax
movw %di, %cx
movw %cx, -0x6(%rbp)
movw %ax, -0x8(%rbp)
movswl -0x8(%rbp), %eax
cmpl $0x0, %eax
jl 0x4fb8a
movswl -0x8(%rbp), %eax
cmpl $0x400, %eax            # imm = 0x400
jle 0x4fb93
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0x4fc09
movswq -0x6(%rbp), %rcx
leaq 0x269c71(%rip), %rax    # 0x2b9810
imulq $0x2c, %rcx, %rcx
addq %rcx, %rax
movswl 0x1a(%rax), %eax
movswl -0x8(%rbp), %ecx
cmpl %ecx, %eax
jne 0x4fbbb
movl $0x0, -0x4(%rbp)
jmp 0x4fc09
movswq -0x6(%rbp), %rcx
leaq 0x269c49(%rip), %rax    # 0x2b9810
imulq $0x2c, %rcx, %rcx
addq %rcx, %rax
movswl 0x1a(%rax), %eax
cmpl $0x400, %eax            # imm = 0x400
jne 0x4fbe2
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0x4fc09
movswl -0x6(%rbp), %edi
callq 0x4f820
cmpl $0x0, %eax
jge 0x4fbf9
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0x4fc09
movswl -0x8(%rbp), %edi
callq 0x4f5b0
movl $0x0, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x10, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/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:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movw %di, %ax
movw %ax, -0x6(%rbp)
movl %esi, -0xc(%rbp)
movl %edx, -0x10(%rbp)
movswq -0x6(%rbp), %rcx
leaq 0x22b53f(%rip), %rax    # 0x2805c0
imulq $0x28, %rcx, %rcx
addq %rcx, %rax
movswl 0xe(%rax), %eax
andl $0x2, %eax
cmpl $0x0, %eax
jne 0x550b2
movswq -0x6(%rbp), %rcx
leaq 0x22b520(%rip), %rax    # 0x2805c0
imulq $0x28, %rcx, %rcx
addq %rcx, %rax
movl 0x8(%rax), %eax
movl %eax, -0x4(%rbp)
jmp 0x551c5
movswq -0x6(%rbp), %rcx
leaq 0x22b502(%rip), %rax    # 0x2805c0
imulq $0x28, %rcx, %rcx
addq %rcx, %rax
movswq (%rax), %rcx
leaq 0x1a04e0(%rip), %rax    # 0x1f55b0
shlq $0x5, %rcx
addq %rcx, %rax
movq %rax, -0x28(%rbp)
movq -0x28(%rbp), %rax
movswq 0x8(%rax), %rcx
leaq 0x1a04c5(%rip), %rax    # 0x1f55b0
shlq $0x5, %rcx
addq %rcx, %rax
movl (%rax), %eax
movq -0x28(%rbp), %rcx
subl (%rcx), %eax
movl %eax, -0x14(%rbp)
movq -0x28(%rbp), %rax
movswq 0x8(%rax), %rcx
leaq 0x1a04a3(%rip), %rax    # 0x1f55b0
shlq $0x5, %rcx
addq %rcx, %rax
movl 0x4(%rax), %eax
movq -0x28(%rbp), %rcx
subl 0x4(%rcx), %eax
movl %eax, -0x18(%rbp)
movl -0x14(%rbp), %edi
imull -0x14(%rbp), %edi
movl -0x18(%rbp), %eax
imull -0x18(%rbp), %eax
addl %eax, %edi
callq 0x37570
shll $0x5, %eax
movl %eax, -0x1c(%rbp)
cmpl $0x0, -0x1c(%rbp)
jne 0x5515d
movswq -0x6(%rbp), %rcx
leaq 0x22b472(%rip), %rax    # 0x2805c0
imulq $0x28, %rcx, %rcx
addq %rcx, %rax
movl 0x8(%rax), %eax
movl %eax, -0x4(%rbp)
jmp 0x551c5
movl -0x14(%rbp), %edi
movl -0x10(%rbp), %esi
movq -0x28(%rbp), %rax
subl 0x4(%rax), %esi
xorl %edx, %edx
subl -0x18(%rbp), %edx
movl -0xc(%rbp), %ecx
movq -0x28(%rbp), %rax
subl (%rax), %ecx
callq 0x58ce0
movl %eax, -0x20(%rbp)
movswq -0x6(%rbp), %rcx
leaq 0x22b434(%rip), %rax    # 0x2805c0
imulq $0x28, %rcx, %rcx
addq %rcx, %rax
movl 0x8(%rax), %eax
movl %eax, -0x2c(%rbp)
movswq -0x6(%rbp), %rcx
leaq 0x22b41b(%rip), %rax    # 0x2805c0
imulq $0x28, %rcx, %rcx
addq %rcx, %rax
movswl 0x1a(%rax), %edi
movl -0x20(%rbp), %esi
movl -0x1c(%rbp), %edx
callq 0x37720
movl %eax, %ecx
movl -0x2c(%rbp), %eax
addl %ecx, %eax
movl %eax, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x30, %rsp
popq %rbp
retq
nop
// File: /workspace/github_c_makefile_star2_O0/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:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movw %di, %ax
movw %ax, -0x6(%rbp)
movl %esi, -0xc(%rbp)
movl %edx, -0x10(%rbp)
movswq -0x6(%rbp), %rcx
leaq 0x22b3cf(%rip), %rax    # 0x2805c0
imulq $0x28, %rcx, %rcx
addq %rcx, %rax
movswl 0xc(%rax), %eax
andl $0x2, %eax
cmpl $0x0, %eax
jne 0x55222
movswq -0x6(%rbp), %rcx
leaq 0x22b3b0(%rip), %rax    # 0x2805c0
imulq $0x28, %rcx, %rcx
addq %rcx, %rax
movl 0x4(%rax), %eax
movl %eax, -0x4(%rbp)
jmp 0x55335
movswq -0x6(%rbp), %rcx
leaq 0x22b392(%rip), %rax    # 0x2805c0
imulq $0x28, %rcx, %rcx
addq %rcx, %rax
movswq (%rax), %rcx
leaq 0x1a0370(%rip), %rax    # 0x1f55b0
shlq $0x5, %rcx
addq %rcx, %rax
movq %rax, -0x28(%rbp)
movq -0x28(%rbp), %rax
movswq 0x8(%rax), %rcx
leaq 0x1a0355(%rip), %rax    # 0x1f55b0
shlq $0x5, %rcx
addq %rcx, %rax
movl (%rax), %eax
movq -0x28(%rbp), %rcx
subl (%rcx), %eax
movl %eax, -0x14(%rbp)
movq -0x28(%rbp), %rax
movswq 0x8(%rax), %rcx
leaq 0x1a0333(%rip), %rax    # 0x1f55b0
shlq $0x5, %rcx
addq %rcx, %rax
movl 0x4(%rax), %eax
movq -0x28(%rbp), %rcx
subl 0x4(%rcx), %eax
movl %eax, -0x18(%rbp)
movl -0x14(%rbp), %edi
imull -0x14(%rbp), %edi
movl -0x18(%rbp), %eax
imull -0x18(%rbp), %eax
addl %eax, %edi
callq 0x37570
shll $0x5, %eax
movl %eax, -0x1c(%rbp)
cmpl $0x0, -0x1c(%rbp)
jne 0x552cd
movswq -0x6(%rbp), %rcx
leaq 0x22b302(%rip), %rax    # 0x2805c0
imulq $0x28, %rcx, %rcx
addq %rcx, %rax
movl 0x4(%rax), %eax
movl %eax, -0x4(%rbp)
jmp 0x55335
movl -0x14(%rbp), %edi
movl -0x10(%rbp), %esi
movq -0x28(%rbp), %rax
subl 0x4(%rax), %esi
xorl %edx, %edx
subl -0x18(%rbp), %edx
movl -0xc(%rbp), %ecx
movq -0x28(%rbp), %rax
subl (%rax), %ecx
callq 0x58ce0
movl %eax, -0x20(%rbp)
movswq -0x6(%rbp), %rcx
leaq 0x22b2c4(%rip), %rax    # 0x2805c0
imulq $0x28, %rcx, %rcx
addq %rcx, %rax
movl 0x4(%rax), %eax
movl %eax, -0x2c(%rbp)
movswq -0x6(%rbp), %rcx
leaq 0x22b2ab(%rip), %rax    # 0x2805c0
imulq $0x28, %rcx, %rcx
addq %rcx, %rax
movswl 0x12(%rax), %edi
movl -0x20(%rbp), %esi
movl -0x1c(%rbp), %edx
callq 0x37720
movl %eax, %ecx
movl -0x2c(%rbp), %eax
addl %ecx, %eax
movl %eax, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x30, %rsp
popq %rbp
retq
nop
// File: /workspace/github_c_makefile_star2_O0/jonof[P]jftekwar/jfbuild/src/engine.c
// Function: keepaway
static void keepaway (int *x, int *y, int w)
{
	int dx, dy, ox, oy, x1, y1;
	char first;

	x1 = clipit[w].x1; dx = clipit[w].x2-x1;
	y1 = clipit[w].y1; dy = clipit[w].y2-y1;
	ox = ksgn(-dy); oy = ksgn(dx);
	first = (klabs(dx) <= klabs(dy));
	while (1)
	{
		if (dx*(*y-y1) > (*x-x1)*dy) return;
		if (first == 0) *x += ox; else *y += oy;
		first ^= 1;
	}
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x40, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movl %edx, -0x14(%rbp)
movslq -0x14(%rbp), %rcx
leaq 0x416f82(%rip), %rax    # 0x46c590
shlq $0x4, %rcx
addq %rcx, %rax
movl (%rax), %eax
movl %eax, -0x28(%rbp)
movslq -0x14(%rbp), %rcx
leaq 0x416f6b(%rip), %rax    # 0x46c590
shlq $0x4, %rcx
addq %rcx, %rax
movl 0x8(%rax), %eax
subl -0x28(%rbp), %eax
movl %eax, -0x18(%rbp)
movslq -0x14(%rbp), %rcx
leaq 0x416f50(%rip), %rax    # 0x46c590
shlq $0x4, %rcx
addq %rcx, %rax
movl 0x4(%rax), %eax
movl %eax, -0x2c(%rbp)
movslq -0x14(%rbp), %rcx
leaq 0x416f38(%rip), %rax    # 0x46c590
shlq $0x4, %rcx
addq %rcx, %rax
movl 0xc(%rax), %eax
subl -0x2c(%rbp), %eax
movl %eax, -0x1c(%rbp)
xorl %edi, %edi
subl -0x1c(%rbp), %edi
callq 0x60ee0
movl %eax, -0x20(%rbp)
movl -0x18(%rbp), %edi
callq 0x60ee0
movl %eax, -0x24(%rbp)
movl -0x18(%rbp), %edi
callq 0x37610
movl %eax, -0x34(%rbp)
movl -0x1c(%rbp), %edi
callq 0x37610
movl %eax, %ecx
movl -0x34(%rbp), %eax
cmpl %ecx, %eax
setle %al
andb $0x1, %al
movzbl %al, %eax
movb %al, -0x2d(%rbp)
movl -0x18(%rbp), %eax
movq -0x10(%rbp), %rcx
movl (%rcx), %ecx
subl -0x2c(%rbp), %ecx
imull %ecx, %eax
movq -0x8(%rbp), %rcx
movl (%rcx), %ecx
subl -0x28(%rbp), %ecx
imull -0x1c(%rbp), %ecx
cmpl %ecx, %eax
jle 0x556cb
addq $0x40, %rsp
popq %rbp
retq
movsbl -0x2d(%rbp), %eax
cmpl $0x0, %eax
jne 0x556e1
movl -0x20(%rbp), %ecx
movq -0x8(%rbp), %rax
addl (%rax), %ecx
movl %ecx, (%rax)
jmp 0x556ec
movl -0x24(%rbp), %ecx
movq -0x10(%rbp), %rax
addl (%rax), %ecx
movl %ecx, (%rax)
movsbl -0x2d(%rbp), %eax
xorl $0x1, %eax
movb %al, -0x2d(%rbp)
jmp 0x556a5
nopl (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/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 %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movw %r8w, %ax
movq 0x10(%rbp), %r8
movl %edi, -0x4(%rbp)
movl %esi, -0x8(%rbp)
movl %edx, -0xc(%rbp)
movl %ecx, -0x10(%rbp)
movw %ax, -0x12(%rbp)
movq %r9, -0x20(%rbp)
movswl -0x12(%rbp), %eax
addl $0xa00, %eax            # imm = 0xA00
andl $0x7ff, %eax            # imm = 0x7FF
movslq %eax, %rcx
leaq 0x3b5bd4(%rip), %rax    # 0x40b8b0
movswl (%rax,%rcx,2), %eax
movl %eax, -0x24(%rbp)
movswl -0x12(%rbp), %eax
addl $0x800, %eax            # imm = 0x800
andl $0x7ff, %eax            # imm = 0x7FF
movslq %eax, %rcx
leaq 0x3b5bb5(%rip), %rax    # 0x40b8b0
movswl (%rax,%rcx,2), %eax
movl %eax, -0x28(%rbp)
movl -0x4(%rbp), %ecx
movl -0xc(%rbp), %eax
subl %ecx, %eax
movl %eax, -0xc(%rbp)
movl -0x8(%rbp), %ecx
movl -0x10(%rbp), %eax
subl %ecx, %eax
movl %eax, -0x10(%rbp)
movl -0xc(%rbp), %edi
movl -0x24(%rbp), %esi
xorl %edx, %edx
subl -0x10(%rbp), %edx
movl -0x28(%rbp), %ecx
callq 0x52880
movl %eax, %ecx
addl -0x4(%rbp), %ecx
movq -0x20(%rbp), %rax
movl %ecx, (%rax)
movl -0x10(%rbp), %edi
movl -0x24(%rbp), %esi
movl -0xc(%rbp), %edx
movl -0x28(%rbp), %ecx
callq 0x52880
movl %eax, %ecx
addl -0x8(%rbp), %ecx
movq 0x10(%rbp), %rax
movl %ecx, (%rax)
addq $0x30, %rsp
popq %rbp
retq
nopl (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/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:
pushq %rbp
movq %rsp, %rbp
subq $0x10, %rsp
movl %edi, -0x4(%rbp)
movl %esi, -0x8(%rbp)
movl 0x3fac24(%rip), %esi    # 0x451a58
movl $0xc8, %edi
callq 0x39010
movl %eax, -0xc(%rbp)
movl -0x4(%rbp), %eax
movl %eax, 0x3b5a66(%rip)    # 0x40c8b0
movl -0x4(%rbp), %esi
movl $0x1, %edi
callq 0x56e00
movl %eax, 0x3b4a3b(%rip)    # 0x40b898
movl -0x8(%rbp), %eax
movl %eax, 0x3ebee2(%rip)    # 0x442d48
movl 0x3ebedc(%rip), %esi    # 0x442d48
movl $0x1, %edi
callq 0x56e00
movl %eax, 0x34359c(%rip)    # 0x39a418
movl 0x89e9e(%rip), %edi     # 0xe0d20
movl 0x3ebec0(%rip), %esi    # 0x442d48
movl $0x140, %edx            # imm = 0x140
callq 0x37720
movl %eax, 0x261760(%rip)    # 0x2b85f8
movl 0x34357a(%rip), %esi    # 0x39a418
movl 0x89e7c(%rip), %edx     # 0xe0d20
movl $0x140, %edi            # imm = 0x140
callq 0x37720
movl %eax, 0x3b49e0(%rip)    # 0x40b894
movl 0x26173a(%rip), %edi    # 0x2b85f4
movl 0x3ebe88(%rip), %esi    # 0x442d48
movl -0xc(%rbp), %edx
callq 0x37720
movl %eax, 0x419f22(%rip)    # 0x470df0
addq $0x10, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/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:
pushq %rbp
movq %rsp, %rbp
subq $0x10, %rsp
movl $0x0, -0x4(%rbp)
cmpl $0x100, -0x4(%rbp)      # imm = 0x100
jge 0x57a63
movl -0x4(%rbp), %eax
shll $0x2, %eax
movslq %eax, %rcx
leaq 0x89374(%rip), %rax     # 0xe0d30
movzbl (%rax,%rcx), %eax
shll $0x2, %eax
movb %al, %dl
movslq -0x4(%rbp), %rcx
leaq 0x419830(%rip), %rax    # 0x471200
movb %dl, 0x2(%rax,%rcx,4)
movslq -0x4(%rbp), %rcx
leaq 0x419c21(%rip), %rax    # 0x471600
movb %dl, 0x2(%rax,%rcx,4)
movl -0x4(%rbp), %eax
shll $0x2, %eax
addl $0x1, %eax
movslq %eax, %rcx
leaq 0x8933a(%rip), %rax     # 0xe0d30
movzbl (%rax,%rcx), %eax
shll $0x2, %eax
movb %al, %dl
movslq -0x4(%rbp), %rcx
leaq 0x4197f6(%rip), %rax    # 0x471200
movb %dl, 0x1(%rax,%rcx,4)
movslq -0x4(%rbp), %rcx
leaq 0x419be7(%rip), %rax    # 0x471600
movb %dl, 0x1(%rax,%rcx,4)
movl -0x4(%rbp), %eax
shll $0x2, %eax
addl $0x2, %eax
movslq %eax, %rcx
leaq 0x89300(%rip), %rax     # 0xe0d30
movzbl (%rax,%rcx), %eax
shll $0x2, %eax
movb %al, %dl
movslq -0x4(%rbp), %rcx
leaq 0x4197bc(%rip), %rax    # 0x471200
movb %dl, (%rax,%rcx,4)
movslq -0x4(%rbp), %rcx
leaq 0x419bae(%rip), %rax    # 0x471600
movb %dl, (%rax,%rcx,4)
movl -0x4(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x4(%rbp)
jmp 0x5799f
xorl %edi, %edi
movl $0x100, %esi            # imm = 0x100
leaq 0x892bf(%rip), %rdx     # 0xe0d30
callq 0xa6950
addq $0x10, %rsp
popq %rbp
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O0/jonof[P]jftekwar/jfbuild/src/engine.c
// Function: setgamma
static int setgamma(float gamma)
{
	int ssgfailed = 0;
	const char *types[3] = { "palette", "shader", "system" };

	do {
		switch (usegammabrightness) {
			case 0:	// Palette.
				ssgfailed = setsysgamma(1.f, -1.f);
				break;
#if USE_OPENGL
			case 1:	// Shader.
				if (!glunavailable) {
					ssgfailed = setsysgamma(gamma, -1.f);
				} else {
					if (ssgfailed) usegammabrightness = 0;	// Fall back to palette.
					else usegammabrightness = 2;	// Fall back to system.
					debugprintf("setgamma: shader not available, trying %s\n", types[usegammabrightness]);
					continue;
				}
				break;
#endif
			default:	// System.
				usegammabrightness = 2;
				if ((ssgfailed = setsysgamma(1.f, gamma))) {
					usegammabrightness = 0;	// Fall back to palette.
#if USE_OPENGL
					if (!glunavailable) usegammabrightness = 1;	// Fall back to shader.
#endif
					debugprintf("setgamma: sys gamma failed, trying %s\n", types[usegammabrightness]);
					continue;
				}
				break;
		}
		break;
	} while(1);
	// debugprintf("setgamma: gamma set using %s\n", types[usegammabrightness]);

	curgamma = gamma;
	return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movss %xmm0, -0x4(%rbp)
movl $0x0, -0x8(%rbp)
movq 0x770f5(%rip), %rax     # 0xceb90
movq %rax, -0x20(%rbp)
movq 0x770f2(%rip), %rax     # 0xceb98
movq %rax, -0x18(%rbp)
movq 0x770ef(%rip), %rax     # 0xceba0
movq %rax, -0x10(%rbp)
movl 0x891c1(%rip), %eax     # 0xe0c7c
movl %eax, -0x24(%rbp)
testl %eax, %eax
je 0x57ace
jmp 0x57ac4
movl -0x24(%rbp), %eax
subl $0x1, %eax
je 0x57aeb
jmp 0x57b48
movss 0x5b32a(%rip), %xmm0    # 0xb2e00
movss 0x5a61a(%rip), %xmm1    # 0xb20f8
callq 0xa69e0
movl %eax, -0x8(%rbp)
jmp 0x57baa
leaq 0x163156(%rip), %rax    # 0x1bac48
cmpl $0x0, (%rax)
jne 0x57b0e
movss -0x4(%rbp), %xmm0
movss 0x5a5f4(%rip), %xmm1    # 0xb20f8
callq 0xa69e0
movl %eax, -0x8(%rbp)
jmp 0x57b46
cmpl $0x0, -0x8(%rbp)
je 0x57b20
movl $0x0, 0x8915e(%rip)     # 0xe0c7c
jmp 0x57b2a
movl $0x2, 0x89152(%rip)     # 0xe0c7c
movslq 0x8914b(%rip), %rax     # 0xe0c7c
movq -0x20(%rbp,%rax,8), %rsi
leaq 0x5bac3(%rip), %rdi     # 0xb3600
movb $0x0, %al
callq 0xa5110
jmp 0x57bac
jmp 0x57baa
movl $0x2, 0x8912a(%rip)     # 0xe0c7c
movss -0x4(%rbp), %xmm1
movss 0x5b2a1(%rip), %xmm0    # 0xb2e00
callq 0xa69e0
movl %eax, -0x8(%rbp)
cmpl $0x0, %eax
je 0x57ba8
movl $0x0, 0x89106(%rip)     # 0xe0c7c
leaq 0x1630cb(%rip), %rax    # 0x1bac48
cmpl $0x0, (%rax)
jne 0x57b8c
movl $0x1, 0x890f0(%rip)     # 0xe0c7c
movslq 0x890e9(%rip), %rax     # 0xe0c7c
movq -0x20(%rbp,%rax,8), %rsi
leaq 0x5ba8c(%rip), %rdi     # 0xb362b
movb $0x0, %al
callq 0xa5110
jmp 0x57bac
jmp 0x57baa
jmp 0x57bb8
movb $0x1, %al
testb $0x1, %al
jne 0x57ab5
jmp 0x57bb8
movss -0x4(%rbp), %xmm0
movss %xmm0, 0x890bf(%rip)    # 0xe0c84
xorl %eax, %eax
addq $0x30, %rsp
popq %rbp
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O0/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
movq %rsp, %rbp
subq $0x20, %rsp
movw %di, %ax
movw %ax, -0x2(%rbp)
movl %esi, -0x8(%rbp)
movl %edx, -0xc(%rbp)
leaq 0x5952e4(%rip), %rax    # 0x5ed920
cmpl $0x3, (%rax)
jge 0x58646
jmp 0x586d0
cmpl $0x0, -0x8(%rbp)
jge 0x5865c
movl $0x100, -0x10(%rbp)     # imm = 0x100
movl $0x0, -0x14(%rbp)
jmp 0x58671
movl $0x1, -0x10(%rbp)
movl -0x8(%rbp), %eax
movl $0x100, %ecx            # imm = 0x100
cltd
idivl %ecx
movl %edx, -0x14(%rbp)
movl $0x0, -0x1c(%rbp)
cmpl $0x8, -0x1c(%rbp)
jge 0x586d0
movl -0xc(%rbp), %eax
movslq -0x1c(%rbp), %rdx
leaq 0x88614(%rip), %rcx     # 0xe0ca0
andl (%rcx,%rdx,4), %eax
cmpl $0x0, %eax
jne 0x58696
jmp 0x586c5
movl -0x14(%rbp), %eax
movl %eax, -0x18(%rbp)
movl -0x18(%rbp), %eax
movl -0x14(%rbp), %ecx
addl -0x10(%rbp), %ecx
cmpl %ecx, %eax
jge 0x586c3
movswl -0x2(%rbp), %edi
movl -0x18(%rbp), %esi
movl -0x1c(%rbp), %edx
callq 0x723d0
movl -0x18(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x18(%rbp)
jmp 0x5869c
jmp 0x586c5
movl -0x1c(%rbp), %eax
addl $0x4, %eax
movl %eax, -0x1c(%rbp)
jmp 0x58678
addq $0x20, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/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:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movw %di, %ax
movw %ax, -0x2(%rbp)
movswq -0x2(%rbp), %rcx
leaq 0x3f2685(%rip), %rax    # 0x44ad80
movswl (%rax,%rcx,2), %eax
movl %eax, -0x14(%rbp)
movswq -0x2(%rbp), %rcx
leaq 0x3e3e32(%rip), %rax    # 0x43c540
movswl (%rax,%rcx,2), %eax
movl %eax, -0x18(%rbp)
movl -0x14(%rbp), %eax
cmpl -0x18(%rbp), %eax
jne 0x58804
movl -0x14(%rbp), %eax
shll %eax
movl %eax, -0x10(%rbp)
movl -0x14(%rbp), %eax
subl $0x1, %eax
movl %eax, -0x8(%rbp)
cmpl $0x0, -0x8(%rbp)
jl 0x58802
movswq -0x2(%rbp), %rcx
leaq 0x37d6f8(%rip), %rax    # 0x3d5e40
movq (%rax,%rcx,8), %rax
movl -0x8(%rbp), %ecx
movl -0x14(%rbp), %edx
addl $0x1, %edx
imull %edx, %ecx
movslq %ecx, %rcx
addq %rcx, %rax
movq %rax, -0x20(%rbp)
movq -0x20(%rbp), %rax
movq %rax, -0x28(%rbp)
movl -0x8(%rbp), %eax
andl $0x1, %eax
cmpl $0x0, %eax
je 0x587a4
movq -0x20(%rbp), %rax
addq $-0x1, %rax
movq %rax, -0x20(%rbp)
movl -0x14(%rbp), %ecx
movq -0x28(%rbp), %rax
movslq %ecx, %rdx
xorl %ecx, %ecx
subq %rdx, %rcx
addq %rcx, %rax
movq %rax, -0x28(%rbp)
movq -0x20(%rbp), %rdi
movq -0x28(%rbp), %rsi
callq 0x58810
movl -0x8(%rbp), %eax
sarl %eax
subl $0x1, %eax
movl %eax, -0xc(%rbp)
cmpl $0x0, -0xc(%rbp)
jl 0x587f2
movq -0x20(%rbp), %rax
addq $-0x2, %rax
movq %rax, -0x20(%rbp)
movl -0x10(%rbp), %ecx
movq -0x28(%rbp), %rax
movslq %ecx, %rdx
xorl %ecx, %ecx
subq %rdx, %rcx
addq %rcx, %rax
movq %rax, -0x28(%rbp)
movq -0x20(%rbp), %rdi
movq -0x28(%rbp), %rsi
movl -0x14(%rbp), %edx
callq 0x58840
movl -0xc(%rbp), %eax
addl $-0x1, %eax
movl %eax, -0xc(%rbp)
jmp 0x587af
jmp 0x587f4
movl -0x8(%rbp), %eax
addl $-0x1, %eax
movl %eax, -0x8(%rbp)
jmp 0x58732
jmp 0x58804
addq $0x30, %rsp
popq %rbp
retq
nopw (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/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
movq %rsp, %rbp
subq $0x40, %rsp
movw %r9w, %ax
movq 0x28(%rbp), %r9
movq 0x20(%rbp), %r9
movq 0x18(%rbp), %r9
movw 0x10(%rbp), %r9w
movl %edi, -0x4(%rbp)
movl %esi, -0x8(%rbp)
movl %edx, -0xc(%rbp)
movw %cx, -0xe(%rbp)
movl %r8d, -0x14(%rbp)
movw %ax, -0x16(%rbp)
movswq -0x16(%rbp), %rcx
leaq 0x19ccf2(%rip), %rax    # 0x1f55b0
shlq $0x5, %rcx
addq %rcx, %rax
movl (%rax), %eax
movl %eax, -0x24(%rbp)
movswq -0x16(%rbp), %rcx
leaq 0x19ccda(%rip), %rax    # 0x1f55b0
shlq $0x5, %rcx
addq %rcx, %rax
movswq 0x8(%rax), %rcx
leaq 0x19ccc7(%rip), %rax    # 0x1f55b0
shlq $0x5, %rcx
addq %rcx, %rax
movl (%rax), %eax
subl -0x24(%rbp), %eax
movl %eax, -0x2c(%rbp)
movswq -0x16(%rbp), %rcx
leaq 0x19ccac(%rip), %rax    # 0x1f55b0
shlq $0x5, %rcx
addq %rcx, %rax
movl 0x4(%rax), %eax
movl %eax, -0x28(%rbp)
movswq -0x16(%rbp), %rcx
leaq 0x19cc93(%rip), %rax    # 0x1f55b0
shlq $0x5, %rcx
addq %rcx, %rax
movswq 0x8(%rax), %rcx
leaq 0x19cc80(%rip), %rax    # 0x1f55b0
shlq $0x5, %rcx
addq %rcx, %rax
movl 0x4(%rax), %eax
subl -0x28(%rbp), %eax
movl %eax, -0x30(%rbp)
movl -0x2c(%rbp), %eax
imull -0x2c(%rbp), %eax
movl -0x30(%rbp), %ecx
imull -0x30(%rbp), %ecx
addl %ecx, %eax
movl %eax, -0x20(%rbp)
cmpl $0x0, -0x20(%rbp)
jne 0x5895e
jmp 0x589ea
movl -0x4(%rbp), %eax
subl -0x24(%rbp), %eax
imull -0x2c(%rbp), %eax
movl -0x8(%rbp), %ecx
subl -0x28(%rbp), %ecx
imull -0x30(%rbp), %ecx
addl %ecx, %eax
shll %eax
movl %eax, -0x1c(%rbp)
movl -0x24(%rbp), %eax
shll %eax
movl %eax, -0x38(%rbp)
movl -0x2c(%rbp), %edi
movl -0x1c(%rbp), %esi
movl -0x20(%rbp), %edx
callq 0x37720
movl -0x38(%rbp), %ecx
addl %eax, %ecx
subl -0x4(%rbp), %ecx
movq 0x18(%rbp), %rax
movl %ecx, (%rax)
movl -0x28(%rbp), %eax
shll %eax
movl %eax, -0x34(%rbp)
movl -0x30(%rbp), %edi
movl -0x1c(%rbp), %esi
movl -0x20(%rbp), %edx
callq 0x37720
movl -0x34(%rbp), %ecx
addl %eax, %ecx
subl -0x8(%rbp), %ecx
movq 0x20(%rbp), %rax
movl %ecx, (%rax)
movl -0x2c(%rbp), %edi
movl -0x30(%rbp), %esi
callq 0x4efb0
shll %eax
movswl -0xe(%rbp), %ecx
subl %ecx, %eax
andl $0x7ff, %eax            # imm = 0x7FF
movw %ax, %cx
movq 0x28(%rbp), %rax
movw %cx, (%rax)
movb $0x1, 0x19cbb4(%rip)    # 0x1f559e
addq $0x40, %rsp
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O0/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:
pushq %rbp
movq %rsp, %rbp
movw %di, %ax
movw %ax, -0x6(%rbp)
movswl -0x6(%rbp), %eax
cmpl $0x0, %eax
jl 0x58bc3
movswl -0x6(%rbp), %eax
movswl 0x3f8e09(%rip), %ecx    # 0x4519c8
cmpl %ecx, %eax
jl 0x58bcf
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0x58cd4
movswq -0x6(%rbp), %rcx
leaq 0x19c9d5(%rip), %rax    # 0x1f55b0
shlq $0x5, %rcx
addq %rcx, %rax
movswl 0xa(%rax), %eax
movl %eax, -0xc(%rbp)
cmpl $0x0, -0xc(%rbp)
jl 0x58c0d
movslq -0xc(%rbp), %rcx
leaq 0x19c9b6(%rip), %rax    # 0x1f55b0
shlq $0x5, %rcx
addq %rcx, %rax
movswl 0xc(%rax), %eax
movl %eax, -0x4(%rbp)
jmp 0x58cd4
movswl 0x3b3eac(%rip), %eax    # 0x40cac0
sarl %eax
movl %eax, -0x10(%rbp)
movl -0x10(%rbp), %eax
movl %eax, -0xc(%rbp)
cmpl $0x1, -0x10(%rbp)
jle 0x58c62
movl -0x10(%rbp), %eax
sarl %eax
movl %eax, -0x10(%rbp)
movslq -0xc(%rbp), %rcx
leaq 0x227988(%rip), %rax    # 0x2805c0
imulq $0x28, %rcx, %rcx
addq %rcx, %rax
movswl (%rax), %eax
movswl -0x6(%rbp), %ecx
cmpl %ecx, %eax
jge 0x58c55
movl -0x10(%rbp), %eax
addl -0xc(%rbp), %eax
movl %eax, -0xc(%rbp)
jmp 0x58c60
movl -0x10(%rbp), %ecx
movl -0xc(%rbp), %eax
subl %ecx, %eax
movl %eax, -0xc(%rbp)
jmp 0x58c1f
jmp 0x58c64
movslq -0xc(%rbp), %rcx
leaq 0x227951(%rip), %rax    # 0x2805c0
imulq $0x28, %rcx, %rcx
addq %rcx, %rax
movswl (%rax), %eax
movswl -0x6(%rbp), %ecx
cmpl %ecx, %eax
jle 0x58c8c
movl -0xc(%rbp), %eax
addl $-0x1, %eax
movl %eax, -0xc(%rbp)
jmp 0x58c64
jmp 0x58c8e
movslq -0xc(%rbp), %rcx
leaq 0x227927(%rip), %rax    # 0x2805c0
imulq $0x28, %rcx, %rcx
addq %rcx, %rax
movswl (%rax), %eax
movslq -0xc(%rbp), %rdx
leaq 0x227912(%rip), %rcx    # 0x2805c0
imulq $0x28, %rdx, %rdx
addq %rdx, %rcx
movswl 0x2(%rcx), %ecx
addl %ecx, %eax
movswl -0x6(%rbp), %ecx
cmpl %ecx, %eax
jg 0x58cce
movl -0xc(%rbp), %eax
addl $0x1, %eax
movl %eax, -0xc(%rbp)
jmp 0x58c8e
movl -0xc(%rbp), %eax
movl %eax, -0x4(%rbp)
movl -0x4(%rbp), %eax
popq %rbp
retq
nopl (%rax)