LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_c_makefile_star2_O2/jonof[P]jftekwar/jfbuild/src/polymost.c
// Function: polymost_setview
void polymost_setview(void)
{
	memset(gdrawroomsprojmat,0,sizeof(gdrawroomsprojmat));
	gdrawroomsprojmat[0][0] = (float)ydimen; gdrawroomsprojmat[0][2] = 1.0;
	gdrawroomsprojmat[1][1] = (float)xdimen; gdrawroomsprojmat[1][2] = 1.0;
	gdrawroomsprojmat[2][2] = 1.0; gdrawroomsprojmat[2][3] = (float)ydimen;
	gdrawroomsprojmat[3][2] =-1.0;

	memset(grotatespriteprojmat,0,sizeof(grotatespriteprojmat));
	grotatespriteprojmat[0][0] = grotatespriteprojmat[2][3] = 1.0;
	grotatespriteprojmat[1][1] = ((float)xdim)/((float)ydim);
	grotatespriteprojmat[2][2] = 1.0001;
	grotatespriteprojmat[3][2] = 1-grotatespriteprojmat[2][2];

	memset(gorthoprojmat,0,sizeof(gorthoprojmat));
	gorthoprojmat[0][0] = 2/(float)xdim;
	gorthoprojmat[1][1] = -2/(float)ydim;
	gorthoprojmat[2][2] = -1.0;
	gorthoprojmat[3][3] = 1.0;
	gorthoprojmat[3][0] = -1.0;
	gorthoprojmat[3][1] = 1.0;
}

// Assembly:
xorps %xmm0, %xmm0
movaps %xmm0, 0x5ac909(%rip)   # 0x5f3a60
movaps %xmm0, 0x5ac912(%rip)   # 0x5f3a70
leaq 0x22d92f(%rip), %rax    # 0x274a94
cvtsi2ssl (%rax), %xmm1
movaps %xmm0, 0x5ac910(%rip)   # 0x5f3a80
movaps %xmm0, 0x5ac919(%rip)   # 0x5f3a90
movss %xmm1, 0x5ac8e1(%rip)   # 0x5f3a60
movl $0x3f800000, %eax       # imm = 0x3F800000
leaq 0x566a5(%rip), %rcx     # 0x9d830
cvtsi2ssl (%rcx), %xmm2
movl %eax, 0x5ac8d3(%rip)    # 0x5f3a68
movss %xmm2, 0x5ac8d7(%rip)   # 0x5f3a74
movl %eax, 0x5ac8d5(%rip)    # 0x5f3a78
movl %eax, 0x5ac8df(%rip)    # 0x5f3a88
movss %xmm1, 0x5ac8db(%rip)   # 0x5f3a8c
movl $0xbf800000, %ecx       # imm = 0xBF800000
movl %ecx, 0x5ac8dc(%rip)    # 0x5f3a98
movaps %xmm0, 0x5ac8dd(%rip)   # 0x5f3aa0
movaps %xmm0, 0x5ac8e6(%rip)   # 0x5f3ab0
movaps %xmm0, 0x5ac8ef(%rip)   # 0x5f3ac0
movaps %xmm0, 0x5ac8f8(%rip)   # 0x5f3ad0
movl %eax, 0x5ac8c2(%rip)    # 0x5f3aa0
leaq 0x3b9e07(%rip), %rdx    # 0x400fec
cvtsi2ssl (%rdx), %xmm1
leaq 0x3b9e00(%rip), %rdx    # 0x400ff0
cvtsi2ssl (%rdx), %xmm2
movss 0x28110(%rip), %xmm3    # 0x6f30c
divss %xmm1, %xmm3
divss %xmm2, %xmm1
movss %xmm1, 0x5ac8a8(%rip)   # 0x5f3ab4
movsd 0x2813c(%rip), %xmm1    # 0x6f350
movsd %xmm1, 0x5ac8ac(%rip)   # 0x5f3ac8
movl $0xb8d1c000, 0x5ac8b2(%rip) # imm = 0xB8D1C000
movaps %xmm0, 0x5ac8b3(%rip)   # 0x5f3ae0
movaps %xmm0, 0x5ac8bc(%rip)   # 0x5f3af0
movaps %xmm0, 0x5ac8c5(%rip)   # 0x5f3b00
movaps %xmm0, 0x5ac8ce(%rip)   # 0x5f3b10
movss %xmm3, 0x5ac896(%rip)   # 0x5f3ae0
movss 0x280be(%rip), %xmm0    # 0x6f310
divss %xmm2, %xmm0
movss %xmm0, 0x5ac896(%rip)   # 0x5f3af4
movl %ecx, 0x5ac8a4(%rip)    # 0x5f3b08
movl %eax, 0x5ac8b2(%rip)    # 0x5f3b1c
movsd 0x280ee(%rip), %xmm0    # 0x6f360
movsd %xmm0, 0x5ac896(%rip)   # 0x5f3b10
retq
// File: /workspace/github_c_makefile_star2_O2/jonof[P]jftekwar/jfbuild/src/polymost.c
// Function: checkindexbuffer
static void checkindexbuffer(unsigned int size)
{
	GLushort *indexes, i;

	if (size <= elementindexbuffersize) return;

	indexes = (GLushort *) malloc(sizeof(GLushort)*size);
	for (i = 0; i < size; i++) indexes[i] = i;
	glfunc.glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, elementindexbuffer);
	glfunc.glBufferData(GL_ELEMENT_ARRAY_BUFFER, sizeof(GLushort)*size, indexes, GL_STATIC_DRAW);
	free(indexes);

	elementindexbuffersize = size;
}

// Assembly:
cmpl %edi, 0x5ac521(%rip)    # 0x5f39d8
jae 0x47531
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movl %edi, %ebx
movl %edi, %r14d
addq %r14, %r14
movq %r14, %rdi
callq 0x69a0
movq %rax, %r15
xorl %eax, %eax
movzwl %ax, %eax
cmpl %ebx, %eax
jae 0x474e6
movw %ax, (%r15,%rax,2)
incl %eax
jmp 0x474d6
leaq 0x5ac253(%rip), %r12    # 0x5f3740
movl 0x5ac4e1(%rip), %esi    # 0x5f39d4
movl $0x8893, %edi           # imm = 0x8893
callq *0xf8(%r12)
movl $0x8893, %edi           # imm = 0x8893
movq %r14, %rsi
movq %r15, %rdx
movl $0x88e4, %ecx           # imm = 0x88E4
callq *0x100(%r12)
movq %r15, %rdi
callq 0x61c0
movl %ebx, 0x5ac4b2(%rip)    # 0x5f39d8
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O2/jonof[P]jftekwar/jfbuild/src/polymost.c
// Function: polymost_nextpage
static void polymost_palfade(void)
{
	struct polymostdrawauxcall draw;
	struct polymostvboitem vboitem[4];

	if ((rendmode != 3) || (qsetmode != 200)) return;
	if (palfadedelta == 0) return;

	draw.mode = 2;	// Solid colour.

	draw.colour.r = palfadergb.r / 255.f;
	draw.colour.g = palfadergb.g / 255.f;
	draw.colour.b = palfadergb.b / 255.f;
	draw.colour.a = palfadedelta / 255.f;

	vboitem[0].v.x = 0.f;
	vboitem[0].v.y = 0.f;
	vboitem[0].v.z = 0.f;

	vboitem[1].v.x = (float)xdim;
	vboitem[1].v.y = 0.f;
	vboitem[1].v.z = 0.f;

	vboitem[2].v.x = (float)xdim;
	vboitem[2].v.y = (float)ydim;
	vboitem[2].v.z = 0.f;

	vboitem[3].v.x = 0.f;
	vboitem[3].v.y = (float)ydim;
	vboitem[3].v.z = 0.f;

	draw.indexcount = 4;
	draw.indexes = NULL;
	draw.elementcount = 4;
	draw.elementvbo = vboitem;

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

	polymost_drawaux_glcall(GL_TRIANGLE_FAN, &draw);
}

// Assembly:
movl 0x5ac418(%rip), %eax    # 0x5f3950
xorl $0x3, %eax
leaq 0x16a4e6(%rip), %rcx    # 0x1b1a28
movl (%rcx), %ecx
xorl $0xc8, %ecx
orl %eax, %ecx
setne %al
leaq 0x16a4ed(%rip), %rcx    # 0x1b1a43
movb (%rcx), %cl
testb %cl, %cl
sete %dl
orb %al, %dl
jne 0x47665
pushq %r14
pushq %rbx
subq $0xa8, %rsp
movabsq $0x400000002, %rax      # imm = 0x400000002
leaq 0x16a4bf(%rip), %rdx    # 0x1b1a3f
movzwl 0x1(%rdx), %esi
movd %esi, %xmm0
leaq 0x8(%rsp), %rbx
movzbl (%rdx), %edx
movd %edx, %xmm1
movdqa 0x27dd4(%rip), %xmm2    # 0x6f370
pandn %xmm1, %xmm2
pslld $0x8, %xmm0
por %xmm2, %xmm0
pand 0x27dcf(%rip), %xmm0    # 0x6f380
movzbl %cl, %ecx
movd %ecx, %xmm1
pslld $0x18, %xmm1
por %xmm0, %xmm1
pxor %xmm0, %xmm0
punpcklbw %xmm0, %xmm1    # xmm1 = xmm1[0],xmm0[0],xmm1[1],xmm0[1],xmm1[2],xmm0[2],xmm1[3],xmm0[3],xmm1[4],xmm0[4],xmm1[5],xmm0[5],xmm1[6],xmm0[6],xmm1[7],xmm0[7]
punpcklwd %xmm0, %xmm1    # xmm1 = xmm1[0],xmm0[0],xmm1[1],xmm0[1],xmm1[2],xmm0[2],xmm1[3],xmm0[3]
cvtdq2ps %xmm1, %xmm0
divps 0x27db9(%rip), %xmm0    # 0x6f390
leaq 0x3b9a0e(%rip), %rcx    # 0x400fec
cvtsi2ssl (%rcx), %xmm1
leaq 0x3b9a07(%rip), %rcx    # 0x400ff0
cvtsi2ssl (%rcx), %xmm2
leaq 0x50(%rsp), %rcx
andq $0x0, (%rcx)
andl $0x0, 0x8(%rcx)
movss %xmm1, 0x14(%rcx)
andq $0x0, 0x18(%rcx)
movss %xmm1, 0x28(%rcx)
movss %xmm2, 0x2c(%rcx)
andl $0x0, 0x30(%rcx)
movq %rax, 0x24(%rbx)
andl $0x0, 0x3c(%rcx)
movss %xmm2, 0x40(%rcx)
andl $0x0, 0x44(%rcx)
movups %xmm0, 0x4(%rbx)
andq $0x0, 0x30(%rbx)
movl $0x4, 0x38(%rbx)
movq %rcx, 0x40(%rbx)
leaq 0x5ac102(%rip), %r14    # 0x5f3740
movl $0xb71, %edi            # imm = 0xB71
callq *0x48(%r14)
movl $0xbe2, %edi            # imm = 0xBE2
callq *0x40(%r14)
pushq $0x6
popq %rdi
movq %rbx, %rsi
callq 0x534cc
addq $0xa8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O2/jonof[P]jftekwar/jfbuild/src/polymost.c
// Function: polymost_bunchfront
static int polymost_bunchfront (int b1, int b2)
{
	double x1b1, x1b2, x2b1, x2b2;
	int b1f, b2f, i;

	b1f = bunchfirst[b1]; x1b1 = dxb1[b1f]; x2b2 = dxb2[bunchlast[b2]]; if (x1b1 >= x2b2) return(-1);
	b2f = bunchfirst[b2]; x1b2 = dxb1[b2f]; x2b1 = dxb2[bunchlast[b1]]; if (x1b2 >= x2b1) return(-1);

	if (x1b1 >= x1b2)
	{
		for(i=b2f;dxb2[i]<=x1b1;i=p2[i]);
		return(wallfront(b1f,i));
	}
	for(i=b1f;dxb2[i]<=x1b2;i=p2[i]);
	return(wallfront(i,b2f));
}

// Assembly:
movslq %edi, %rcx
leaq 0x380f70(%rip), %rdx    # 0x3d07c0
movswq (%rdx,%rcx,2), %rdi
leaq 0x5a8384(%rip), %r8     # 0x5f7be0
movsd (%r8,%rdi,8), %xmm0
movslq %esi, %rsi
leaq 0x382f54(%rip), %r9     # 0x3d27c0
movswq (%r9,%rsi,2), %r10
leaq 0x5b0368(%rip), %rax    # 0x5ffbe0
ucomisd (%rax,%r10,8), %xmm0
jae 0x4f8c4
movswq (%rdx,%rsi,2), %rsi
movsd (%r8,%rsi,8), %xmm1
movswq (%r9,%rcx,2), %rcx
ucomisd (%rax,%rcx,8), %xmm1
jae 0x4f8c4
leaq 0x388f32(%rip), %rcx    # 0x3d87d0
ucomisd %xmm1, %xmm0
jae 0x4f8b4
movslq %edi, %rdx
ucomisd (%rax,%rdx,8), %xmm1
jb 0x4f8c8
movswl (%rcx,%rdx,2), %edi
jmp 0x4f8a4
movslq %esi, %rdx
ucomisd (%rax,%rdx,8), %xmm0
jb 0x4f8c8
movswl (%rcx,%rdx,2), %esi
jmp 0x4f8b4
pushq $-0x1
popq %rax
retq
jmp 0x214a3
// File: /workspace/github_c_makefile_star2_O2/jonof[P]jftekwar/jfbuild/src/polymost.c
// Function: polymost_plotpixel
int polymost_plotpixel(int x, int y, unsigned char col)
{
	palette_t colour;
	struct polymostdrawauxcall draw;
	struct polymostvboitem vboitem[1];

	if ((rendmode != 3) || (qsetmode != 200)) return(-1);

	setpolymost2dview();	// disables blending, texturing, and depth testing
	glfunc.glDepthMask(GL_FALSE);	// disable writing to the z-buffer
	glfunc.glEnable(GL_BLEND);

	draw.mode = 2;	// Solid colour.

	colour = curpalette[col];
	if (!usegammabrightness) {
		colour.r = britable[curbrightness][ colour.r ];
		colour.g = britable[curbrightness][ colour.g ];
		colour.b = britable[curbrightness][ colour.b ];
	}
	draw.colour.r = colour.r / 255.f;
	draw.colour.g = colour.g / 255.f;
	draw.colour.b = colour.b / 255.f;
	draw.colour.a = 1.f;

	vboitem[0].v.x = (GLfloat)x;
	vboitem[0].v.y = (GLfloat)y;
	vboitem[0].v.z = 0.f;

	draw.indexcount = 1;
	draw.indexes = NULL;
	draw.elementcount = 1;
	draw.elementvbo = vboitem;

	polymost_drawaux_glcall(GL_POINTS, &draw);

	glfunc.glDepthMask(GL_TRUE);	// re-enable writing to the z-buffer

	return 0;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x60, %rsp
cmpl $0x3, 0x59faac(%rip)    # 0x5f3950
pushq $-0x1
popq %rbx
jne 0x53fc7
leaq 0x15db74(%rip), %rax    # 0x1b1a28
cmpl $0xc8, (%rax)
jne 0x53fc7
movl %edx, %r15d
movl %esi, %r14d
movl %edi, %ebp
callq 0x39c49
leaq 0x59f86c(%rip), %r12    # 0x5f3740
xorl %ebx, %ebx
xorl %edi, %edi
callq *0xa0(%r12)
movl $0xbe2, %edi            # imm = 0xBE2
callq *0x40(%r12)
movl $0x2, 0x3c(%rsp)
movzbl %r15b, %eax
leaq 0x3dbab3(%rip), %rcx    # 0x42f9b0
movd (%rcx,%rax,4), %xmm0
movb 0x2(%rcx,%rax,4), %al
leaq 0x4987f(%rip), %rcx     # 0x9d78c
cmpl $0x0, (%rcx)
jne 0x53f50
movzbl %al, %eax
leaq 0x15dae8(%rip), %rcx    # 0x1b1a04
movslq (%rcx), %rcx
movd %xmm0, %edx
movl $0xff, %esi
movl %edx, %edi
andl %esi, %edi
shlq $0x8, %rcx
addq 0x38099(%rip), %rcx     # 0x8bfd0
movzbl (%rdi,%rcx), %edi
shrl $0x8, %edx
andl %esi, %edx
movb (%rax,%rcx), %al
movzbl (%rdx,%rcx), %ecx
shll $0x8, %ecx
orl %edi, %ecx
movd %ecx, %xmm0
pxor %xmm1, %xmm1
punpcklbw %xmm1, %xmm0    # xmm0 = xmm0[0],xmm1[0],xmm0[1],xmm1[1],xmm0[2],xmm1[2],xmm0[3],xmm1[3],xmm0[4],xmm1[4],xmm0[5],xmm1[5],xmm0[6],xmm1[6],xmm0[7],xmm1[7]
punpcklwd %xmm1, %xmm0    # xmm0 = xmm0[0],xmm1[0],xmm0[1],xmm1[1],xmm0[2],xmm1[2],xmm0[3],xmm1[3]
cvtdq2ps %xmm0, %xmm0
divps 0x1b57a(%rip), %xmm0    # 0x6f4e0
movzbl %al, %eax
cvtsi2ss %eax, %xmm1
leaq 0x18(%rsp), %rsi
movlps %xmm0, 0x4(%rsi)
divss 0x1b3a2(%rip), %xmm1    # 0x6f320
movss %xmm1, 0xc(%rsi)
movl $0x3f800000, 0x10(%rsi) # imm = 0x3F800000
movd %r14d, %xmm0
movd %ebp, %xmm1
punpckldq %xmm0, %xmm1    # xmm1 = xmm1[0],xmm0[0],xmm1[1],xmm0[1]
cvtdq2ps %xmm1, %xmm0
movq %rsp, %rax
movlps %xmm0, (%rax)
andl $0x0, 0x8(%rax)
pushq $0x1
popq %rbp
movl %ebp, 0x28(%rsi)
andq $0x0, 0x30(%rsi)
movl %ebp, 0x38(%rsi)
movq %rax, 0x40(%rsi)
xorl %edi, %edi
callq 0x534cc
movl %ebp, %edi
callq *0xa0(%r12)
movl %ebx, %eax
addq $0x60, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/jonof[P]jftekwar/jfbuild/src/polymost.c
// Function: polymost_precache
void polymost_precache(int dapicnum, int dapalnum, int datype)
{
	// dapicnum and dapalnum are like you'd expect
	// datype is 0 for a wall/floor/ceiling and 1 for a sprite
	//    basically this just means walls are repeating
	//    while sprites are clamped
	int mid;
	unsigned short flags;

	if (rendmode < 3) return;

	if (!palookup[dapalnum]) return;//dapalnum = 0;

		//FIXME
	//buildprintf("precached %d %d type %d\n", dapicnum, dapalnum, datype);
	flags = (datype & 1) ? PTH_CLAMPED :0;
	if (usehightile) flags |= PTH_HIGHTILE;
	PTMarkPrime(dapicnum, dapalnum, flags);

	if (datype == 0) return;

	mid = md_tilehasmodel(dapicnum);
	if (mid < 0 || models[mid]->mdnum < 2) return;

	{
		int i,j=0;

		if (models[mid]->mdnum == 3)
			j = ((md3model *)models[mid])->head.numsurfs;

		for (i=0;i<=j;i++)
			mdloadskin((md2model*)models[mid], 0, dapalnum, i);
	}
}

// Assembly:
cmpl $0x3, 0x59f96e(%rip)    # 0x5f3950
jl 0x54080
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movl %esi, %ebx
movslq %esi, %rax
leaq 0x33dae4(%rip), %rcx    # 0x391ae0
cmpq $0x0, (%rcx,%rax,8)
je 0x54078
movl %edx, %r14d
movl %edi, %ebp
movl %edx, %eax
andl $0x1, %eax
leal 0x2(%rax), %edx
cmpl $0x0, 0x4a4fd(%rip)     # 0x9e514
cmovel %eax, %edx
movl %ebx, %esi
callq 0x5c585
testl %r14d, %r14d
je 0x54078
movl %ebp, %edi
callq 0x56327
testl %eax, %eax
js 0x54078
leaq 0x5edff0(%rip), %r14    # 0x642028
movq (%r14), %rcx
movl %eax, %r15d
movq (%rcx,%r15,8), %rax
movl (%rax), %ecx
cmpl $0x2, %ecx
jl 0x54078
xorl %ebp, %ebp
movl $0x0, %r12d
cmpl $0x3, %ecx
jne 0x54073
movl 0xac(%rax), %r12d
jmp 0x54073
movq (%r14), %rax
movq (%rax,%r15,8), %rdi
xorl %esi, %esi
movl %ebx, %edx
movl %ebp, %ecx
callq 0x567d6
incl %ebp
cmpl %r12d, %ebp
jle 0x5405f
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/jonof[P]jftekwar/jfbuild/src/polymost.c
// Function: osdcmd_gltexturemode
static int osdcmd_gltexturemode(const osdfuncparm_t *parm)
{
	int m;
	const char *p;

	if (parm->numparms != 1) {
		buildprintf("Current texturing mode is %s\n", glfiltermodes[gltexfiltermode].name);
		buildprintf("  Vaild modes are:\n");
		for (m = 0; m < (int)numglfiltermodes; m++)
			buildprintf("     %d - %s\n",m,glfiltermodes[m].name);

		return OSDCMD_OK;
	}

	m = (int)strtol(parm->parms[0], (char **)&p, 10);
	if (p == parm->parms[0]) {
		// string
		for (m = 0; m < (int)numglfiltermodes; m++) {
			if (!Bstrcasecmp(parm->parms[0], glfiltermodes[m].name)) break;
		}
		if (m == numglfiltermodes) m = gltexfiltermode;   // no change
	} else {
		if (m < 0) m = 0;
		else if (m >= (int)numglfiltermodes) m = numglfiltermodes - 1;
	}

	if (m != gltexfiltermode) {
		gltexfiltermode = m;
		gltexapplyprops();
	}

	buildprintf("Texture filtering mode changed to %s\n", glfiltermodes[gltexfiltermode].name );

	return OSDCMD_OK;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
subq $0x10, %rsp
cmpl $0x1, (%rdi)
jne 0x5462d
movq %rdi, %rbx
movq 0x10(%rdi), %rax
movq (%rax), %rdi
leaq 0x8(%rsp), %r14
pushq $0xa
popq %rdx
movq %r14, %rsi
callq 0x6940
movq 0x10(%rbx), %rcx
movq (%rcx), %rbx
cmpq %rbx, (%r14)
je 0x5468c
testl %eax, %eax
js 0x546b4
cmpl $0x5, %eax
pushq $0x5
popq %r14
cmovbl %eax, %r14d
jmp 0x546c0
movslq 0x49f50(%rip), %rax     # 0x9e584
shlq $0x4, %rax
leaq 0x49ee1(%rip), %r15     # 0x9e520
movq (%rax,%r15), %rsi
leaq 0x1ba31(%rip), %rdi     # 0x7007b
xorl %eax, %eax
callq 0x22427
leaq 0x1ba41(%rip), %rdi     # 0x70099
xorl %eax, %eax
callq 0x22427
leaq 0x1ba47(%rip), %rbx     # 0x700ad
xorl %r14d, %r14d
cmpq $0x6, %r14
je 0x546fc
movq (%r15), %rdx
movq %rbx, %rdi
movl %r14d, %esi
xorl %eax, %eax
callq 0x22427
incq %r14
addq $0x10, %r15
jmp 0x54669
leaq 0x49e8d(%rip), %r15     # 0x9e520
xorl %r14d, %r14d
cmpq $0x6, %r14
je 0x546b9
movq (%r15), %rsi
movq %rbx, %rdi
callq 0x6880
testl %eax, %eax
je 0x546c0
incq %r14
addq $0x10, %r15
jmp 0x54696
xorl %r14d, %r14d
jmp 0x546c0
movl 0x49ec4(%rip), %r14d    # 0x9e584
cmpl 0x49ebd(%rip), %r14d    # 0x9e584
je 0x546dc
movl %r14d, 0x49eb4(%rip)    # 0x9e584
callq 0x46647
movl 0x49ea8(%rip), %r14d    # 0x9e584
movslq %r14d, %rax
shlq $0x4, %rax
leaq 0x49e36(%rip), %rcx     # 0x9e520
movq (%rax,%rcx), %rsi
leaq 0x1b9c6(%rip), %rdi     # 0x700bb
xorl %eax, %eax
callq 0x22427
xorl %eax, %eax
addq $0x10, %rsp
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O2/jonof[P]jftekwar/jfbuild/src/polymost.c
// Function: osdcmd_gltextureanisotropy
static int osdcmd_gltextureanisotropy(const osdfuncparm_t *parm)
{
	int l;
	const char *p;

	if (parm->numparms != 1) {
		buildprintf("Current texture anisotropy is %d\n", glanisotropy);
		buildprintf("  Maximum is %f\n", glinfo.maxanisotropy);

		return OSDCMD_OK;
	}

	l = (int)strtol(parm->parms[0], (char **)&p, 10);
	if (l < 0 || l > glinfo.maxanisotropy) l = 0;

	if (l != gltexfiltermode) {
		glanisotropy = l;
		gltexapplyprops();
	}

	buildprintf("Texture anisotropy changed to %d\n", glanisotropy );

	return OSDCMD_OK;
}

// Assembly:
pushq %rax
cmpl $0x1, (%rdi)
jne 0x54760
movq 0x10(%rdi), %rax
movq (%rax), %rdi
movq %rsp, %rsi
pushq $0xa
popq %rdx
callq 0x6940
testl %eax, %eax
js 0x54735
cvtsi2ss %eax, %xmm0
leaq 0x122b21(%rip), %rcx    # 0x177250
ucomiss 0x14(%rcx), %xmm0
jbe 0x54737
xorl %eax, %eax
cmpl 0x49e47(%rip), %eax     # 0x9e584
je 0x5474a
movl %eax, 0x59f23f(%rip)    # 0x5f3984
callq 0x46647
movl 0x59f234(%rip), %esi    # 0x5f3984
leaq 0x1b9bd(%rip), %rdi     # 0x70114
xorl %eax, %eax
callq 0x22427
jmp 0x5478e
movl 0x59f21e(%rip), %esi    # 0x5f3984
leaq 0x1b974(%rip), %rdi     # 0x700e1
xorl %eax, %eax
callq 0x22427
leaq 0x122ad5(%rip), %rax    # 0x177250
cvtss2sd 0x14(%rax), %xmm0
leaq 0x1b97c(%rip), %rdi     # 0x70103
movb $0x1, %al
callq 0x22427
xorl %eax, %eax
popq %rcx
retq
// File: /workspace/github_c_makefile_star2_O2/jonof[P]jftekwar/jfbuild/src/polymost.c
// Function: polymost_load_shader
static GLuint polymost_load_shader(GLuint shadertype, const char *defaultsrc, const char *filename)
{
	const GLchar *shadersrc = defaultsrc;
	GLuint shader = 0;

#ifdef SHADERDEV
	GLchar *fileshadersrc = NULL;
	long shadersrclen = 0;
	BFILE *shaderfh = NULL;

	shaderfh = fopen(filename, "rb");
	if (shaderfh) {
		fseek(shaderfh, 0, SEEK_END);
		shadersrclen = ftell(shaderfh);
		fseek(shaderfh, 0, SEEK_SET);

		fileshadersrc = (GLchar *)malloc(shadersrclen + 1);
		shadersrclen = fread(fileshadersrc, 1, shadersrclen, shaderfh);
		fileshadersrc[shadersrclen] = 0;

		fclose(shaderfh);
		shaderfh = NULL;

		buildprintf("polymost_load_shader: loaded %s (%ld bytes)\n", filename, shadersrclen);
		shadersrc = fileshadersrc;
	}
#endif

	shader = glbuild_compile_shader(shadertype, shadersrc);

#ifdef SHADERDEV
	if (fileshadersrc) {
		free(fileshadersrc);
		fileshadersrc = NULL;
	}
#endif

	return shader;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
movq %rdx, %r14
movq %rsi, %r15
movl %edi, %ebx
leaq 0x17e9e(%rip), %rsi     # 0x6c66a
movq %rdx, %rdi
callq 0x6ce0
testq %rax, %rax
je 0x54846
movq %rax, %r12
pushq $0x2
popq %rdx
movq %rax, %rdi
xorl %esi, %esi
callq 0x6c70
movq %r12, %rdi
callq 0x6280
movq %rax, %r13
movq %r12, %rdi
xorl %esi, %esi
xorl %edx, %edx
callq 0x6c70
leaq 0x1(%r13), %rdi
callq 0x69a0
movq %rax, %r15
pushq $0x1
popq %rsi
movq %rax, %rdi
movq %r13, %rdx
movq %r12, %rcx
callq 0x6550
movq %rax, %r13
movb $0x0, (%r15,%rax)
movq %r12, %rdi
callq 0x6480
leaq 0x1b643(%rip), %rdi     # 0x6fe77
movq %r14, %rsi
movq %r13, %rdx
xorl %eax, %eax
callq 0x22427
movq %r15, %r14
jmp 0x54849
xorl %r14d, %r14d
movl %ebx, %edi
movq %r15, %rsi
callq 0x45c74
movl %eax, %ebx
movq %r14, %rdi
callq 0x61c0
movl %ebx, %eax
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O2/jonof[P]jftekwar/jfbuild/src/polymost.c
// Function: polymost_get_attrib
static GLint polymost_get_attrib(GLuint program, const GLchar *name)
{
	GLint attribloc = glfunc.glGetAttribLocation(program, name);
	if (attribloc < 0) {
		buildprintf("polymost_get_attrib: could not get location of attribute \"%s\"\n", name);
	}
	return attribloc;
}

// Assembly:
pushq %rbp
pushq %rbx
pushq %rax
movq %rsi, %rbx
leaq 0x59eeca(%rip), %rax    # 0x5f3740
callq *0x180(%rax)
movl %eax, %ebp
testl %eax, %eax
jns 0x54893
leaq 0x1b61b(%rip), %rdi     # 0x6fea4
movq %rbx, %rsi
xorl %eax, %eax
callq 0x22427
movl %ebp, %eax
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/jonof[P]jftekwar/jfbuild/src/polymost.c
// Function: polymost_get_uniform
static GLint polymost_get_uniform(GLuint program, const GLchar *name)
{
	GLint uniformloc = glfunc.glGetUniformLocation(program, name);
	if (uniformloc < 0) {
		buildprintf("polymost_get_uniform: could not get location of uniform \"%s\"\n", name);
	}
	return uniformloc;
}

// Assembly:
pushq %rbp
pushq %rbx
pushq %rax
movq %rsi, %rbx
leaq 0x59ee97(%rip), %rax    # 0x5f3740
callq *0x1a8(%rax)
movl %eax, %ebp
testl %eax, %eax
jns 0x548c6
leaq 0x1b627(%rip), %rdi     # 0x6fee3
movq %rbx, %rsi
xorl %eax, %eax
callq 0x22427
movl %ebp, %eax
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/jonof[P]jftekwar/jfbuild/src/polymost.c
// Function: drawtrap
static void drawtrap (float x0, float x1, float y0, float x2, float x3, float y1,
	struct polymostdrawpolycall *draw)
{
	float px[4], py[4];
	int i, n;
	struct polymostvboitem vboitem[4];

	if (y0 == y1) return;
	px[0] = x0; py[0] = y0;  py[2] = y1;
		  if (x0 == x1) { px[1] = x3; py[1] = y1; px[2] = x2; n = 3; }
	else if (x2 == x3) { px[1] = x1; py[1] = y0; px[2] = x3; n = 3; }
	else               { px[1] = x1; py[1] = y0; px[2] = x3; px[3] = x2; py[3] = y1; n = 4; }

	for(i=0;i<n;i++)
	{
		px[i] = min(max(px[i],trapextx[0]),trapextx[1]);
		vboitem[i].t.s = px[i]*gux + py[i]*guy + guo;
		vboitem[i].t.t = px[i]*gvx + py[i]*gvy + gvo;
		vboitem[i].v.x = px[i];
		vboitem[i].v.y = py[i];
		vboitem[i].v.z = 0.f;
	}
	draw->indexcount = n;
	draw->elementcount = n;
	draw->elementvbo = vboitem;
	polymost_drawpoly_glcall(GL_TRIANGLE_FAN, draw);
	draw->elementvbo = NULL;
}

// Assembly:
ucomiss %xmm5, %xmm2
jne 0x552e2
jp 0x552e2
retq
pushq %rbx
subq $0x70, %rsp
movq %rdi, %rbx
movss %xmm0, (%rsp)
movss %xmm2, 0x10(%rsp)
movss %xmm5, 0x18(%rsp)
ucomiss %xmm1, %xmm0
jne 0x55316
jp 0x55316
movss %xmm4, 0x4(%rsp)
movss %xmm5, 0x14(%rsp)
movss %xmm3, 0x8(%rsp)
jmp 0x55337
ucomiss %xmm4, %xmm3
movss %xmm1, 0x4(%rsp)
movss %xmm2, 0x14(%rsp)
movss %xmm4, 0x8(%rsp)
jne 0x55406
jp 0x55406
pushq $0x3
popq %rax
movss 0x5da8c6(%rip), %xmm0   # 0x62fc08
movss 0x5da8c2(%rip), %xmm1   # 0x62fc0c
movl %eax, %ecx
movsd 0x59e824(%rip), %xmm2   # 0x5f3b78
movhpd 0x59e834(%rip), %xmm2   # xmm2 = xmm2[0],mem[0]
movsd 0x59e804(%rip), %xmm3   # 0x5f3b68
movhpd 0x59e814(%rip), %xmm3   # xmm3 = xmm3[0],mem[0]
movsd 0x59e7fc(%rip), %xmm4   # 0x5f3b70
movhpd 0x59e80c(%rip), %xmm4   # xmm4 = xmm4[0],mem[0]
leaq 0x2c(%rsp), %rdx
xorl %esi, %esi
cmpq %rsi, %rcx
je 0x553e1
movss (%rsp,%rsi,4), %xmm5
maxss %xmm0, %xmm5
minss %xmm1, %xmm5
cvtss2sd %xmm5, %xmm6
movss 0x10(%rsp,%rsi,4), %xmm7
cvtss2sd %xmm7, %xmm8
movlhps %xmm8, %xmm8            # xmm8 = xmm8[0,0]
mulpd %xmm4, %xmm8
movlhps %xmm6, %xmm6            # xmm6 = xmm6[0,0]
mulpd %xmm3, %xmm6
addpd %xmm8, %xmm6
addpd %xmm2, %xmm6
cvtpd2ps %xmm6, %xmm6
movlpd %xmm6, (%rdx)
movss %xmm5, -0xc(%rdx)
movss %xmm7, -0x8(%rdx)
andl $0x0, -0x4(%rdx)
movss %xmm5, (%rsp,%rsi,4)
incq %rsi
addq $0x14, %rdx
jmp 0x55383
movl %eax, 0x44(%rbx)
movl %eax, 0x4c(%rbx)
leaq 0x20(%rsp), %rax
movq %rax, 0x50(%rbx)
pushq $0x6
popq %rdi
movq %rbx, %rsi
callq 0x4727b
andq $0x0, 0x50(%rbx)
addq $0x70, %rsp
popq %rbx
retq
movss %xmm3, 0xc(%rsp)
movss %xmm5, 0x1c(%rsp)
pushq $0x4
jmp 0x55339
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O2/jonof[P]jftekwar/jfbuild/src/hightile.c
// Function: hicfindsubst
hicreplctyp * hicfindsubst(int picnum, int palnum, int skybox)
{
	hicreplctyp *hr;

	if (!hicfirstinit) return NULL;
	if ((unsigned int)picnum >= (unsigned int)MAXTILES) return NULL;

	do {
		for (hr = hicreplc[picnum]; hr; hr = hr->next) {
			if (hr->palnum == palnum) {
				if (skybox) {
					if (hr->skybox && !hr->skybox->ignore) return hr;
				} else {
					if (!hr->ignore) return hr;
				}
			}
		}

		if (palnum == 0) break;
		palnum = 0;
	} while (1);

	return NULL;	// no replacement found
}

// Assembly:
xorl %eax, %eax
cmpl $0x23ff, %edi           # imm = 0x23FF
ja 0x55477
cmpl $0x0, 0x5da7e3(%rip)    # 0x62fc10
je 0x55477
movl %edi, %eax
leaq 0x5da7e8(%rip), %rcx    # 0x62fc20
leaq (%rcx,%rax,8), %rcx
movq %rcx, %rax
movq (%rax), %rax
testq %rax, %rax
je 0x5546c
movzbl 0x8(%rax), %edi
cmpl %edi, %esi
jne 0x5543f
testl %edx, %edx
je 0x55464
movq 0x20(%rax), %rdi
testq %rdi, %rdi
je 0x5543f
cmpq $0x0, (%rdi)
jne 0x5543f
jmp 0x55477
cmpb $0x0, 0x9(%rax)
jne 0x5543f
jmp 0x55477
xorl %eax, %eax
testl %esi, %esi
movl $0x0, %esi
jne 0x5543c
retq
// File: /workspace/github_c_makefile_star2_O2/jonof[P]jftekwar/jfbuild/src/hightile.c
// Function: hicinit
void hicinit(void)
{
	int i,j;
	hicreplctyp *hr, *next;

	for (i=0;i<MAXPALOOKUPS;i++) {	// all tints should be 100%
		hictinting[i].r = hictinting[i].g = hictinting[i].b = 0xff;
		hictinting[i].f = 0;
	}

	if (hicfirstinit) {
		for (i=MAXTILES-1;i>=0;i--) {
			for (hr=hicreplc[i]; hr; ) {
				next = hr->next;

				if (hr->skybox) {
					for (j=5;j>=0;j--) {
						if (hr->skybox->face[j]) {
							free(hr->skybox->face[j]);
						}
					}
					free(hr->skybox);
				}
				if (hr->filename) free(hr->filename);
				free(hr);

				hr = next;
			}
		}
	}
	memset(hicreplc,0,sizeof(hicreplc));

	hicfirstinit = 1;
}

// Assembly:
xorl %eax, %eax
leaq 0x5ec79f(%rip), %rcx    # 0x641c20
cmpq $0x400, %rax            # imm = 0x400
je 0x55496
movl $0xffffff, (%rax,%rcx)  # imm = 0xFFFFFF
addq $0x4, %rax
jmp 0x55481
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
cmpl $0x0, 0x5da768(%rip)    # 0x62fc10
je 0x55510
movl $0x23ff, %ebp           # imm = 0x23FF
leaq 0x5da76a(%rip), %r14    # 0x62fc20
pushq $0x5
popq %r15
testl %ebp, %ebp
js 0x55510
movl %ebp, %eax
movq (%r14,%rax,8), %rbx
testq %rbx, %rbx
je 0x5550c
movq (%rbx), %r12
cmpq $0x0, 0x20(%rbx)
je 0x554f6
movl %r15d, %r13d
movq 0x20(%rbx), %rdi
testl %r13d, %r13d
js 0x554f1
movl %r13d, %eax
movq 0x8(%rdi,%rax,8), %rdi
callq 0x61c0
decl %r13d
jmp 0x554d6
callq 0x61c0
movq 0x10(%rbx), %rdi
callq 0x61c0
movq %rbx, %rdi
callq 0x61c0
movq %r12, %rbx
jmp 0x554c4
decl %ebp
jmp 0x554ba
leaq 0x5da709(%rip), %rdi    # 0x62fc20
movl $0x12000, %edx          # imm = 0x12000
xorl %esi, %esi
callq 0x62f0
movl $0x1, 0x5da6e3(%rip)    # 0x62fc10
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/jonof[P]jftekwar/jfbuild/src/hightile.c
// Function: hicsetpalettetint
void hicsetpalettetint(int palnum, unsigned char r, unsigned char g, unsigned char b, unsigned char effect)
{
	if ((unsigned int)palnum >= (unsigned int)MAXPALOOKUPS) return;
	if (!hicfirstinit) hicinit();

	hictinting[palnum].r = r;
	hictinting[palnum].g = g;
	hictinting[palnum].b = b;
	hictinting[palnum].f = effect & HICEFFECTMASK;
}

// Assembly:
cmpl $0xff, %edi
ja 0x5558f
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movl %r8d, %ebx
movl %ecx, %ebp
movl %edx, %r14d
movl %esi, %r15d
movl %edi, %r12d
cmpl $0x0, 0x5da6af(%rip)    # 0x62fc10
jne 0x55568
callq 0x55478
movl %r12d, %eax
leaq 0x5ec6ae(%rip), %rcx    # 0x641c20
movb %r15b, (%rcx,%rax,4)
movb %r14b, 0x1(%rcx,%rax,4)
movb %bpl, 0x2(%rcx,%rax,4)
andb $0x3, %bl
movb %bl, 0x3(%rcx,%rax,4)
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/jonof[P]jftekwar/jfbuild/src/hightile.c
// Function: hicsetsubsttex
int hicsetsubsttex(int picnum, int palnum, char *filen, float alphacut, unsigned char flags)
{
	hicreplctyp *hr, *hrn;

	if ((unsigned int)picnum >= (unsigned int)MAXTILES) return -1;
	if ((unsigned int)palnum >= (unsigned int)MAXPALOOKUPS) return -1;
	if (!hicfirstinit) hicinit();

	for (hr = hicreplc[picnum]; hr; hr = hr->next) {
		if (hr->palnum == palnum)
			break;
	}

	if (!hr) {
		// no replacement yet defined
		hrn = (hicreplctyp *)calloc(1,sizeof(hicreplctyp));
		if (!hrn) return -1;
		hrn->palnum = palnum;
	} else hrn = hr;

	// store into hicreplc the details for this replacement
	if (hrn->filename) free(hrn->filename);

	hrn->filename = strdup(filen);
	if (!hrn->filename) {
		if (hrn->skybox) return -1;	// don't free the base structure if there's a skybox defined
		if (hr == NULL) free(hrn);	// not yet a link in the chain
		return -1;
	}
	hrn->ignore = 0;
	hrn->alphacut = min(alphacut,1.0);
	hrn->flags = flags;
	if (hr == NULL) {
		hrn->next = hicreplc[picnum];
		hicreplc[picnum] = hrn;
	}

	//printf("Replacement [%d,%d]: %s\n", picnum, palnum, hicreplc[i]->filename);

	return 0;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdx, %r14
cmpl $0x2400, %edi           # imm = 0x2400
setae %al
cmpl $0x100, %esi            # imm = 0x100
setae %dl
orb %al, %dl
pushq $-0x1
popq %rbx
jne 0x5567b
movl %esi, %r15d
movl %edi, %r12d
movl %ecx, 0x4(%rsp)
cmpl $0x0, 0x5da644(%rip)    # 0x62fc10
movss %xmm0, (%rsp)
jne 0x555d8
callq 0x55478
movl %r12d, %eax
leaq 0x5da63e(%rip), %rcx    # 0x62fc20
leaq (%rcx,%rax,8), %rbp
movq %rbp, %r13
movq (%r13), %r13
testq %r13, %r13
je 0x55601
movzbl 0x8(%r13), %eax
cmpl %r15d, %eax
jne 0x555e9
movq %r13, %r12
jmp 0x55618
pushq $0x1
popq %rdi
pushq $0x28
popq %rsi
callq 0x6930
testq %rax, %rax
je 0x5567b
movq %rax, %r12
movb %r15b, 0x8(%rax)
movq 0x10(%r12), %rdi
callq 0x61c0
movq %r14, %rdi
callq 0x6060
movq %rax, 0x10(%r12)
testq %rax, %rax
je 0x5566c
xorl %ebx, %ebx
movss (%rsp), %xmm0
minss 0x16991(%rip), %xmm0    # 0x6bfd4
movb $0x0, 0x9(%r12)
movss %xmm0, 0x18(%r12)
movl 0x4(%rsp), %eax
movb %al, 0xa(%r12)
testq %r13, %r13
jne 0x5567b
movq (%rbp), %rax
movq %rax, (%r12)
movq %r12, (%rbp)
jmp 0x5567b
orq 0x20(%r12), %r13
jne 0x5567b
movq %r12, %rdi
callq 0x61c0
movl %ebx, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/jonof[P]jftekwar/jfbuild/src/hightile.c
// Function: hicsetskybox
int hicsetskybox(int picnum, int palnum, char *faces[6])
{
	hicreplctyp *hr, *hrn;
	int j;

	if ((unsigned int)picnum >= (unsigned int)MAXTILES) return -1;
	if ((unsigned int)palnum >= (unsigned int)MAXPALOOKUPS) return -1;
	for (j=5;j>=0;j--) if (!faces[j]) return -1;
	if (!hicfirstinit) hicinit();

	for (hr = hicreplc[picnum]; hr; hr = hr->next) {
		if (hr->palnum == palnum)
			break;
	}

	if (!hr) {
		// no replacement yet defined
		hrn = (hicreplctyp *)calloc(1,sizeof(hicreplctyp));
		if (!hrn) return -1;

		hrn->palnum = palnum;
	} else hrn = hr;

	if (!hrn->skybox) {
		hrn->skybox = (struct hicskybox_t *)calloc(1,sizeof(struct hicskybox_t));
		if (!hrn->skybox) {
			if (hr == NULL) free(hrn);	// not yet a link in the chain
			return -1;
		}
	} else {
		for (j=5;j>=0;j--) {
			if (hrn->skybox->face[j])
				free(hrn->skybox->face[j]);
		}
	}

	// store each face's filename
	for (j=0;j<6;j++) {
		hrn->skybox->face[j] = strdup(faces[j]);
		if (!hrn->skybox->face[j]) {
			for (--j; j>=0; --j)	// free any previous faces
				free(hrn->skybox->face[j]);
			free(hrn->skybox);
			hrn->skybox = NULL;
			if (hr == NULL) free(hrn);
			return -1;
		}
	}
	hrn->skybox->ignore = 0;
	if (hr == NULL) {
		hrn->next = hicreplc[picnum];
		hicreplc[picnum] = hrn;
	}

	return 0;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
cmpl $0x2400, %edi           # imm = 0x2400
setae %al
cmpl $0x100, %esi            # imm = 0x100
setae %cl
orb %al, %cl
pushq $-0x1
popq %rbx
jne 0x557d2
movq %rdx, %r14
movl %esi, %ebp
movl %edi, %r15d
pushq $0x5
popq %rax
testl %eax, %eax
js 0x556d3
movl %eax, %ecx
decl %eax
cmpq $0x0, (%r14,%rcx,8)
jne 0x556bf
jmp 0x557d2
cmpl $0x0, 0x5da536(%rip)    # 0x62fc10
jne 0x556e1
callq 0x55478
movl %r15d, %eax
leaq 0x5da535(%rip), %rcx    # 0x62fc20
leaq (%rcx,%rax,8), %r13
movq %r13, %r12
movq (%r12), %r12
testq %r12, %r12
je 0x5570a
movzbl 0x8(%r12), %eax
cmpl %ebp, %eax
jne 0x556f2
movq %r12, %r15
jmp 0x55725
pushq $0x1
popq %rdi
pushq $0x28
popq %rsi
callq 0x6930
testq %rax, %rax
je 0x557d2
movq %rax, %r15
movb %bpl, 0x8(%rax)
cmpq $0x0, 0x20(%r15)
je 0x55747
pushq $0x5
popq %rbp
testl %ebp, %ebp
js 0x5575b
movq 0x20(%r15), %rax
movl %ebp, %ecx
movq 0x8(%rax,%rcx,8), %rdi
callq 0x61c0
decl %ebp
jmp 0x5572f
pushq $0x1
popq %rdi
pushq $0x38
popq %rsi
callq 0x6930
movq %rax, 0x20(%r15)
testq %rax, %rax
je 0x557a9
xorl %ebp, %ebp
cmpq $0x6, %rbp
je 0x557b8
movq (%r14,%rbp,8), %rdi
callq 0x6060
movq 0x20(%r15), %rcx
movq %rax, 0x8(%rcx,%rbp,8)
movq 0x20(%r15), %rax
cmpq $0x0, 0x8(%rax,%rbp,8)
je 0x55796
incq %rbp
jmp 0x5575d
movq 0x20(%r15), %rax
movq (%rax,%rbp,8), %rdi
decq %rbp
callq 0x61c0
testq %rbp, %rbp
jg 0x55786
movq 0x20(%r15), %rdi
callq 0x61c0
andq $0x0, 0x20(%r15)
testq %r12, %r12
jne 0x557d2
movq %r15, %rdi
callq 0x61c0
jmp 0x557d2
movq 0x20(%r15), %rax
andq $0x0, (%rax)
xorl %ebx, %ebx
testq %r12, %r12
jne 0x557d2
movq (%r13), %rax
movq %rax, (%r15)
movq %r15, (%r13)
movl %ebx, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/jonof[P]jftekwar/jfbuild/src/hightile.c
// Function: hicclearsubst
int hicclearsubst(int picnum, int palnum)
{
	hicreplctyp *hr, *hrn = NULL;

	if ((unsigned int)picnum >= (unsigned int)MAXTILES) return -1;
	if ((unsigned int)palnum >= (unsigned int)MAXPALOOKUPS) return -1;
	if (!hicfirstinit) return 0;

	for (hr = hicreplc[picnum]; hr; hrn = hr, hr = hr->next) {
		if (hr->palnum == palnum)
			break;
	}

	if (!hr) return 0;

	if (hr->filename) free(hr->filename);
	if (hr->skybox) {
		int i;
		for (i=5;i>=0;i--)
			if (hr->skybox->face[i])
				free(hr->skybox->face[i]);
		free(hr->skybox);
	}

	if (hrn) hrn->next = hr->next;
	else hicreplc[picnum] = hr->next;
	free(hr);

	return 0;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
cmpl $0x2400, %edi           # imm = 0x2400
setae %al
cmpl $0x100, %esi            # imm = 0x100
setae %cl
orb %al, %cl
je 0x55806
pushq $-0x1
popq %rbx
jmp 0x55883
cmpl $0x0, 0x5da403(%rip)    # 0x62fc10
je 0x55865
movl %edi, %eax
leaq 0x5da408(%rip), %rcx    # 0x62fc20
leaq (%rcx,%rax,8), %r15
xorl %ebx, %ebx
movq %r15, %r14
xorl %eax, %eax
movq (%r14), %r14
testq %r14, %r14
je 0x55883
movq %rax, %r12
movzbl 0x8(%r14), %ecx
movq %r14, %rax
cmpl %esi, %ecx
jne 0x55823
movq 0x10(%r14), %rdi
callq 0x61c0
cmpq $0x0, 0x20(%r14)
je 0x5586e
pushq $0x5
popq %rbp
movq 0x20(%r14), %rdi
testl %ebp, %ebp
js 0x55869
movl %ebp, %eax
movq 0x8(%rdi,%rax,8), %rdi
callq 0x61c0
decl %ebp
jmp 0x5584d
xorl %ebx, %ebx
jmp 0x55883
callq 0x61c0
testq %r12, %r12
movq (%r14), %rax
cmovneq %r12, %r15
movq %rax, (%r15)
movq %r14, %rdi
callq 0x61c0
movl %ebx, %eax
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
nop
// File: /workspace/github_c_makefile_star2_O2/jonof[P]jftekwar/jfbuild/src/mdsprite.c
// Function: freeallmodels
void freeallmodels (void)
{
	int i;

	if (models)
	{
		for(i=0;i<nextmodelid;i++) mdfree(models[i]);
		free(models); models = NULL;
		nummodelsalloced = 0;
		nextmodelid = 0;
	}

	memset(tile2model,-1,sizeof(tile2model));

	if (vertlist)
	{
		free(vertlist);
		vertlist = NULL;
		allocmodelverts = maxmodelverts = 0;
	}
	if (elementvbo) {
		free(elementvbo);
		elementvbo = NULL;
		allocelementvbo = maxelementvbo = 0;
	}

}

// Assembly:
pushq %rbx
cmpq $0x0, 0x5ec78f(%rip)    # 0x642028
je 0x558d9
xorl %ebx, %ebx
movslq 0x5ec780(%rip), %rax    # 0x642024
movq 0x5ec77d(%rip), %rdi    # 0x642028
cmpq %rax, %rbx
jge 0x558be
movq (%rdi,%rbx,8), %rdi
callq 0x5593f
incq %rbx
jmp 0x5589d
callq 0x61c0
andq $0x0, 0x5ec75d(%rip)    # 0x642028
andl $0x0, 0x5ec75e(%rip)    # 0x642030
andl $0x0, 0x5ec74b(%rip)    # 0x642024
leaq 0x5ec760(%rip), %rdi    # 0x642040
movl $0x1b000, %edx          # imm = 0x1B000
movl $0xff, %esi
callq 0x62f0
movq 0x60774a(%rip), %rdi    # 0x65d040
testq %rdi, %rdi
je 0x55916
callq 0x61c0
andq $0x0, 0x607738(%rip)    # 0x65d040
andl $0x0, 0x607739(%rip)    # 0x65d048
andl $0x0, 0x607736(%rip)    # 0x65d04c
movq 0x607733(%rip), %rdi    # 0x65d050
testq %rdi, %rdi
je 0x5593d
callq 0x61c0
andq $0x0, 0x607721(%rip)    # 0x65d050
andl $0x0, 0x607722(%rip)    # 0x65d058
andl $0x0, 0x60771f(%rip)    # 0x65d05c
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O2/jonof[P]jftekwar/jfbuild/src/mdsprite.c
// Function: md_loadmodel
int md_loadmodel (const char *fn)
{
	mdmodel *vm, **ml;

	if (!mdinited) mdinit();

	if (nextmodelid >= nummodelsalloced)
	{
		ml = (mdmodel **)realloc(models,(nummodelsalloced+MODELALLOCGROUP)*sizeof(mdmodel*)); if (!ml) return(-1);
		models = ml; nummodelsalloced += MODELALLOCGROUP;
	}

	vm = mdload(fn); if (!vm) return(-1);
	models[nextmodelid++] = vm;
	return(nextmodelid-1);
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rdi, %r14
cmpb $0x0, 0x5ec4b9(%rip)    # 0x642020
jne 0x55b6e
callq 0x55b36
movslq 0x5ec4bb(%rip), %r15    # 0x642030
pushq $-0x1
popq %rbx
cmpl %r15d, 0x5ec4a5(%rip)   # 0x642024
jl 0x55baf
movq 0x5ec4a0(%rip), %rdi    # 0x642028
leaq 0x800(,%r15,8), %rsi
callq 0x6120
testq %rax, %rax
je 0x55bd7
addq $0x100, %r15            # imm = 0x100
movq %rax, 0x5ec480(%rip)    # 0x642028
movl %r15d, 0x5ec481(%rip)   # 0x642030
movq %r14, %rdi
callq 0x55bdf
testq %rax, %rax
je 0x55bd7
movq 0x5ec465(%rip), %rcx    # 0x642028
movslq 0x5ec45a(%rip), %rbx    # 0x642024
leal 0x1(%rbx), %edx
movl %edx, 0x5ec451(%rip)    # 0x642024
movq %rax, (%rcx,%rbx,8)
movl %ebx, %eax
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O2/jonof[P]jftekwar/jfbuild/src/mdsprite.c
// Function: md_setmisc
int md_setmisc (int modelid, float scale, int shadeoff, float zadd)
{
	mdmodel *m;

	if (!mdinited) mdinit();

	if ((unsigned int)modelid >= (unsigned int)nextmodelid) return -1;
	m = models[modelid];
	m->bscale = scale;
	m->shadeoff = shadeoff;
	m->zadd = zadd;

	return 0;
}

// Assembly:
pushq %rbp
pushq %rbx
pushq %rax
movl %esi, %ebx
movl %edi, %ebp
cmpb $0x0, 0x5ebd47(%rip)    # 0x642020
jne 0x562f6
movss %xmm1, 0x4(%rsp)
movss %xmm0, (%rsp)
callq 0x55b36
movss (%rsp), %xmm0
movss 0x4(%rsp), %xmm1
cmpl %ebp, 0x5ebd28(%rip)    # 0x642024
jbe 0x5631d
movq 0x5ebd23(%rip), %rax    # 0x642028
movslq %ebp, %rcx
movq (%rax,%rcx,8), %rax
movss %xmm0, 0xc(%rax)
movl %ebx, 0x4(%rax)
movss %xmm1, 0x10(%rax)
xorl %eax, %eax
jmp 0x56320
pushq $-0x1
popq %rax
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/jonof[P]jftekwar/jfbuild/src/mdsprite.c
// Function: md_defineframe
int md_defineframe (int modelid, const char *framename, int tilenume, int skinnum)
{
	md2model *m;
	int i;

	if (!mdinited) mdinit();

	if ((unsigned int)modelid >= (unsigned int)nextmodelid) return(-1);
	if ((unsigned int)tilenume >= (unsigned int)MAXTILES) return(-2);
	if (!framename) return(-3);

	m = (md2model *)models[modelid];
	if (m->mdnum == 1) {
		tile2model[tilenume].modelid = modelid;
		tile2model[tilenume].framenum = tile2model[tilenume].skinnum = 0;
		return 0;
	}

	i = framename2index((mdmodel*)m,framename);
	if (i == m->numframes) return(-3);   // frame name invalid

	tile2model[tilenume].modelid = modelid;
	tile2model[tilenume].framenum = i;
	tile2model[tilenume].skinnum = skinnum;

	return 0;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movl %ecx, %ebp
movl %edx, %r14d
movq %rsi, %r12
movl %edi, %ebx
cmpb $0x0, 0x5ebcbe(%rip)    # 0x642020
jne 0x56369
callq 0x55b36
cmpl %ebx, 0x5ebcb5(%rip)    # 0x642024
jbe 0x5637e
cmpl $0x23ff, %r14d          # imm = 0x23FF
jbe 0x56394
pushq $-0x2
jmp 0x56380
pushq $-0x1
popq %r15
movl %r15d, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
pushq $-0x3
popq %r15
testq %r12, %r12
je 0x56382
movq 0x5ebc84(%rip), %rax    # 0x642028
movslq %ebx, %rcx
movq (%rax,%rcx,8), %r13
xorl %eax, %eax
cmpl $0x1, (%r13)
jne 0x563be
pushq $0x8
popq %rcx
pushq $0x4
popq %rdx
xorl %ebp, %ebp
jmp 0x563d5
movq %r13, %rdi
movq %r12, %rsi
callq 0x563f7
cmpl 0x20(%r13), %eax
je 0x56382
pushq $0x4
popq %rcx
pushq $0x8
popq %rdx
movl %r14d, %esi
imulq $0xc, %rsi, %rsi
leaq 0x5ebc5d(%rip), %rdi    # 0x642040
leaq (%rdi,%rsi), %r8
movl %ebx, (%rsi,%rdi)
movl %eax, (%rdx,%r8)
movl %ebp, (%rcx,%r8)
xorl %r15d, %r15d
jmp 0x56382
// File: /workspace/github_c_makefile_star2_O2/jonof[P]jftekwar/jfbuild/src/mdsprite.c
// Function: framename2index
static int framename2index (mdmodel *vm, const char *nam)
{
	int i = 0;

	switch(vm->mdnum)
	{
		case 2:
			{
			md2model *m = (md2model *)vm;
			md2frame_t *fr;
			for(i=0;i<m->numframes;i++)
			{
				fr = (md2frame_t *)&m->frames[i*m->framebytes];
				if (!Bstrcmp(fr->name, nam)) break;
			}
			}
			break;
		case 3:
			{
			md3model *m = (md3model *)vm;
			for(i=0;i<m->numframes;i++)
				if (!Bstrcmp(m->head.frames[i].nam,nam)) break;
			}
			break;
	}
	return(i);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rsi, %r14
movq %rdi, %r15
movl (%rdi), %eax
cmpl $0x2, %eax
je 0x5644b
xorl %ebx, %ebx
cmpl $0x3, %eax
jne 0x56488
movl 0x20(%r15), %ebx
xorl %r12d, %r12d
testl %ebx, %ebx
cmovlel %r12d, %ebx
pushq $0x28
popq %r13
cmpq %r12, %rbx
je 0x56488
movq 0xb8(%r15), %rdi
addq %r13, %rdi
movq %r14, %rsi
callq 0x68d0
testl %eax, %eax
je 0x56481
incq %r12
addq $0x38, %r13
jmp 0x56427
movl 0x20(%r15), %ebx
xorl %ebp, %ebp
testl %ebx, %ebx
cmovlel %ebp, %ebx
cmpl %ebp, %ebx
je 0x56488
movq 0x70(%r15), %rax
movslq 0x64(%r15), %rcx
movslq %ebp, %rdx
imulq %rcx, %rdx
leaq (%rax,%rdx), %rdi
addq $0x18, %rdi
movq %r14, %rsi
callq 0x68d0
testl %eax, %eax
je 0x56486
incl %ebp
jmp 0x56456
movl %r12d, %ebx
jmp 0x56488
movl %ebp, %ebx
movl %ebx, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/jonof[P]jftekwar/jfbuild/src/mdsprite.c
// Function: md_defineanimation
int md_defineanimation (int modelid, const char *framestart, const char *frameend, int fpssc, int flags)
{
	md2model *m;
	mdanim_t ma, *map;
	int i;

	if (!mdinited) mdinit();

	if ((unsigned int)modelid >= (unsigned int)nextmodelid) return(-1);

	memset(&ma, 0, sizeof(ma));
	m = (md2model *)models[modelid];
	if (m->mdnum < 2) return 0;

		//find index of start frame
	i = framename2index((mdmodel*)m,framestart);
	if (i == m->numframes) return -2;
	ma.startframe = i;

		//find index of finish frame which must trail start frame
	i = framename2index((mdmodel*)m,frameend);
	if (i == m->numframes) return -3;
	ma.endframe = i;

	ma.fpssc = fpssc;
	ma.flags = flags;

	map = (mdanim_t*)calloc(1,sizeof(mdanim_t));
	if (!map) return(-4);
	memcpy(map, &ma, sizeof(ma));

	map->next = m->animations;
	m->animations = map;

	return(0);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movl %r8d, %ebp
movl %ecx, %r14d
movq %rdx, %r12
movq %rsi, %r13
movl %edi, %ebx
cmpb $0x0, 0x5ebb67(%rip)    # 0x642020
jne 0x564c0
callq 0x55b36
cmpl %ebx, 0x5ebb5e(%rip)    # 0x642024
jbe 0x564f6
movq 0x5ebb59(%rip), %rax    # 0x642028
movslq %ebx, %rcx
movq (%rax,%rcx,8), %r15
xorl %ebx, %ebx
cmpl $0x2, (%r15)
jl 0x564f9
movq %r15, %rdi
movq %r13, %rsi
callq 0x563f7
movl 0x20(%r15), %r13d
cmpl %r13d, %eax
jne 0x5650a
pushq $-0x2
jmp 0x564f8
pushq $-0x1
popq %rbx
movl %ebx, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movl %eax, 0x4(%rsp)
movq %r15, %rdi
movq %r12, %rsi
callq 0x563f7
cmpl %r13d, %eax
jne 0x56522
pushq $-0x3
jmp 0x564f8
movl %eax, %r12d
pushq $0x1
popq %rdi
pushq $0x18
popq %rsi
callq 0x6930
testq %rax, %rax
je 0x56554
movl 0x4(%rsp), %ecx
movl %ecx, (%rax)
movl %r12d, 0x4(%rax)
movl %r14d, 0x8(%rax)
movl %ebp, 0xc(%rax)
movq 0x40(%r15), %rcx
movq %rcx, 0x10(%rax)
movq %rax, 0x40(%r15)
jmp 0x564f9
pushq $-0x4
jmp 0x564f8
// File: /workspace/github_c_makefile_star2_O2/jonof[P]jftekwar/jfbuild/src/mdsprite.c
// Function: md_defineskin
int md_defineskin (int modelid, const char *skinfn, int palnum, int skinnum, int surfnum)
{
	mdskinmap_t *sk, *skl;
	md2model *m;

	if (!mdinited) mdinit();

	if ((unsigned int)modelid >= (unsigned int)nextmodelid) return -1;
	if (!skinfn) return -2;
	if ((unsigned)palnum >= (unsigned)MAXPALOOKUPS) return -3;

	m = (md2model *)models[modelid];
	if (m->mdnum < 2) return 0;
	if (m->mdnum == 2) surfnum = 0;

	skl = NULL;
	for (sk = m->skinmap; sk; skl = sk, sk = sk->next)
		if (sk->palette == (unsigned char)palnum && skinnum == sk->skinnum && surfnum == sk->surfnum) break;
	if (!sk) {
		sk = (mdskinmap_t *)calloc(1,sizeof(mdskinmap_t));
		if (!sk) return -4;

		if (!skl) m->skinmap = sk;
		else skl->next = sk;
	} else if (sk->fn) free(sk->fn);

	sk->palette = (unsigned char)palnum;
	sk->skinnum = skinnum;
	sk->surfnum = surfnum;
	sk->fn = (char *)malloc(strlen(skinfn)+1);
	if (!sk->fn) return(-4);
	strcpy(sk->fn, skinfn);

	return 0;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movl %r8d, %ebp
movl %ecx, %r14d
movl %edx, %r15d
movq %rsi, %rbx
movl %edi, %r12d
cmpb $0x0, 0x5ebaa4(%rip)    # 0x642020
jne 0x56583
callq 0x55b36
cmpl %r12d, 0x5eba9a(%rip)   # 0x642024
jbe 0x5659e
testq %rbx, %rbx
je 0x565a2
cmpl $0xff, %r15d
jbe 0x565b8
pushq $-0x3
jmp 0x565a4
pushq $-0x1
jmp 0x565a4
pushq $-0x2
popq %r12
movl %r12d, %eax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq 0x5eba69(%rip), %rax    # 0x642028
movslq %r12d, %rcx
movq (%rax,%rcx,8), %rcx
movl (%rcx), %eax
xorl %r12d, %r12d
cmpl $0x2, %eax
jl 0x565a6
movq %rbx, 0x10(%rsp)
xorl %ebx, %ebx
cmpl $0x2, %eax
cmovel %ebx, %ebp
addq $0x48, %rcx
movq %rcx, %rax
pushq $-0x4
popq %r12
movq (%rax), %r13
testq %r13, %r13
je 0x5660f
movzbl (%r13), %eax
cmpl %r15d, %eax
jne 0x56606
cmpl %r14d, 0x4(%r13)
jne 0x56606
cmpl 0x8(%r13), %ebp
je 0x56632
leaq 0x38(%r13), %rax
movq %r13, %rbx
jmp 0x565e8
movq %rcx, 0x8(%rsp)
pushq $0x1
popq %rdi
pushq $0x40
popq %rsi
callq 0x6930
testq %rax, %rax
je 0x565a6
movq %rax, %r13
testq %rbx, %rbx
je 0x5663d
movq %r13, 0x38(%rbx)
jmp 0x56645
movq 0x10(%r13), %rdi
callq 0x61c0
jmp 0x56645
movq 0x8(%rsp), %rax
movq %r13, (%rax)
movb %r15b, (%r13)
movl %r14d, 0x4(%r13)
movl %ebp, 0x8(%r13)
movq 0x10(%rsp), %rbx
movq %rbx, %rdi
callq 0x6420
leaq 0x1(%rax), %rdi
callq 0x69a0
movq %rax, 0x10(%r13)
testq %rax, %rax
je 0x565a6
movq %rax, %rdi
movq %rbx, %rsi
callq 0x6430
xorl %r12d, %r12d
jmp 0x565a6
// File: /workspace/github_c_makefile_star2_O2/jonof[P]jftekwar/jfbuild/src/mdsprite.c
// Function: md_definehud
int md_definehud (int modelid, int tilex, double xadd, double yadd, double zadd, double angadd, int flags)
{
	if (!mdinited) mdinit();

	if ((unsigned int)modelid >= (unsigned int)nextmodelid) return -1;
	if ((unsigned int)tilex >= (unsigned int)MAXTILES) return -2;

	hudmem[(flags>>2)&1][tilex].xadd = xadd;
	hudmem[(flags>>2)&1][tilex].yadd = yadd;
	hudmem[(flags>>2)&1][tilex].zadd = zadd;
	hudmem[(flags>>2)&1][tilex].angadd = ((short)angadd)|2048;
	hudmem[(flags>>2)&1][tilex].flags = (short)flags;

	return 0;
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
subq $0x30, %rsp
movl %edx, %ebx
movl %esi, %ebp
movl %edi, %r14d
cmpb $0x0, 0x5eb983(%rip)    # 0x642020
jne 0x566d0
movsd %xmm3, 0x8(%rsp)
movsd %xmm2, (%rsp)
movaps %xmm0, 0x20(%rsp)
movaps %xmm1, 0x10(%rsp)
callq 0x55b36
movapd 0x10(%rsp), %xmm1
movapd 0x20(%rsp), %xmm0
movsd (%rsp), %xmm2
movsd 0x8(%rsp), %xmm3
cmpl %r14d, 0x5eb94d(%rip)   # 0x642024
jbe 0x566e5
cmpl $0x23ff, %ebp           # imm = 0x23FF
jbe 0x566ea
pushq $-0x2
jmp 0x566e7
pushq $-0x1
popq %rax
jmp 0x56735
unpcklpd %xmm1, %xmm0            # xmm0 = xmm0[0],xmm1[0]
cvtpd2ps %xmm0, %xmm0
movl %ebx, %eax
shrl $0x2, %eax
andl $0x1, %eax
movl %ebp, %ecx
imulq $0x24000, %rax, %rax    # imm = 0x24000
leaq 0x60e956(%rip), %rdx    # 0x665060
addq %rax, %rdx
shlq $0x4, %rcx
cvtsd2ss %xmm2, %xmm1
movlpd %xmm0, (%rcx,%rdx)
movss %xmm1, 0x8(%rcx,%rdx)
cvttsd2si %xmm3, %eax
orl $0x800, %eax            # imm = 0x800
movw %ax, 0xc(%rcx,%rdx)
movw %bx, 0xe(%rcx,%rdx)
xorl %eax, %eax
addq $0x30, %rsp
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/jonof[P]jftekwar/jfbuild/src/mdsprite.c
// Function: md_undefinemodel
int md_undefinemodel(int modelid)
{
	int i;
	if (!mdinited) return 0;
	if ((unsigned int)modelid >= (unsigned int)nextmodelid) return -1;

	for (i=MAXTILES-1; i>=0; i--)
		if (tile2model[i].modelid == modelid)
			tile2model[i].modelid = -1;

	if (models) {
		mdfree(models[modelid]);
		models[modelid] = NULL;
	}

	return 0;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
xorl %ebx, %ebx
cmpb $0x0, 0x5eb8ac(%rip)    # 0x642020
je 0x567cc
cmpl %edi, 0x5eb8a8(%rip)    # 0x642024
jbe 0x567c9
movl $0x23ff, %eax           # imm = 0x23FF
leaq 0x5eb8b6(%rip), %rcx    # 0x642040
testl %eax, %eax
js 0x567a3
movl %eax, %edx
imulq $0xc, %rdx, %rdx
cmpl %edi, (%rdx,%rcx)
jne 0x5679f
addq %rcx, %rdx
orl $-0x1, (%rdx)
decl %eax
jmp 0x5678a
movq 0x5eb87e(%rip), %rax    # 0x642028
testq %rax, %rax
je 0x567cc
movslq %edi, %r14
movq (%rax,%r14,8), %rdi
callq 0x5593f
movq 0x5eb866(%rip), %rax    # 0x642028
andq $0x0, (%rax,%r14,8)
jmp 0x567cc
pushq $-0x1
popq %rbx
movl %ebx, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
retq