LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_c_makefile_star2_O2/jonof[P]jftekwar/jfbuild/src/osd.c
// Function: OSD_Draw
void OSD_Draw(void)
{
	unsigned topoffs;
	int row, lines, x, len;

	if (!osdvisible || !osdinited) return;

	topoffs = osdhead * osdcols;
	row = osdrows-1;
	lines = min( osdlines-osdhead, osdrows );

	clearbackground(osdcols,osdrows+1);

	for (; lines>0; lines--, row--) {
		drawosdstr(0,row,osdtext+topoffs,osdcols,osdtextshade,osdtextpal);
		topoffs+=osdcols;
	}

	drawosdchar(2,osdrows,'>',osdpromptshade,osdpromptpal);
	if (osdeditcaps) drawosdchar(0,osdrows,'C',osdpromptshade,osdpromptpal);

	len = min(osdcols-1-3, osdeditlen-osdeditwinstart);
	for (x=0; x<len; x++)
		drawosdchar(3+x,osdrows,osdeditbuf[osdeditwinstart+x],osdeditshade,osdeditpal);

	drawosdcursor(3+osdeditcursor-osdeditwinstart,osdrows,osdovertype,keytime);
}

// Assembly:
cmpb $0x0, 0x5ad44f(%rip)    # 0x5f12dc
je 0x43f0e
testb $0x1, 0x5a9432(%rip)    # 0x5ed2c8
je 0x43f0e
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movl 0x5ad45f(%rip), %eax    # 0x5f1304
movl 0x59e31(%rip), %edi     # 0x9dcdc
movl %edi, %ebp
imull %eax, %ebp
movl 0x59e2e(%rip), %ebx     # 0x9dce4
movl 0x59dc3(%rip), %r14d    # 0x9dc80
subl %eax, %r14d
cmpl %ebx, %r14d
cmovgel %ebx, %r14d
leal 0x1(%rbx), %esi
callq *0x59de0(%rip)          # 0x9dcb0
decl %ebx
leaq 0x5a93f7(%rip), %r15    # 0x5ed2d0
testl %r14d, %r14d
jle 0x43f0f
movl %ebp, %edx
addq %r15, %rdx
movl 0x59df3(%rip), %ecx     # 0x9dcdc
movl 0x5ad3e8(%rip), %r8d    # 0x5f12d8
movl 0x59dd9(%rip), %r9d     # 0x9dcd0
xorl %edi, %edi
movl %ebx, %esi
callq *0x59d8f(%rip)          # 0x9dc90
addl 0x59dd5(%rip), %ebp     # 0x9dcdc
decl %r14d
decl %ebx
jmp 0x43ed9
retq
movl 0x59dcf(%rip), %esi     # 0x9dce4
movl 0x5ad3b5(%rip), %ecx    # 0x5f12d0
movl 0x59da6(%rip), %r8d     # 0x9dcc8
pushq $0x2
popq %rdi
pushq $0x3e
popq %rdx
callq *0x59d5a(%rip)          # 0x9dc88
cmpl $0x0, 0x5ad3c7(%rip)    # 0x5f12fc
je 0x43f55
movl 0x59da7(%rip), %esi     # 0x9dce4
movl 0x5ad38d(%rip), %ecx    # 0x5f12d0
movl 0x59d7e(%rip), %r8d     # 0x9dcc8
pushq $0x43
popq %rdx
xorl %edi, %edi
callq *0x59d33(%rip)          # 0x9dc88
movl 0x59d81(%rip), %eax     # 0x9dcdc
addl $-0x4, %eax
movl 0x5ad3a8(%rip), %ebx    # 0x5f130c
subl 0x5ad39e(%rip), %ebx    # 0x5f1308
cmpl %ebx, %eax
cmovll %eax, %ebx
xorl %r14d, %r14d
testl %ebx, %ebx
cmovlel %r14d, %ebx
leaq 0x5ad391(%rip), %r15    # 0x5f1310
movl 0x5ad383(%rip), %eax    # 0x5f1308
cmpl %r14d, %ebx
je 0x43fb6
movl 0x59d54(%rip), %esi     # 0x9dce4
addl %r14d, %eax
cltq
movsbl (%rax,%r15), %edx
movl 0x5ad334(%rip), %ecx    # 0x5f12d4
movl 0x59d25(%rip), %r8d     # 0x9dccc
leal 0x3(%r14), %edi
callq *0x59cd7(%rip)          # 0x9dc88
incl %r14d
jmp 0x43f7f
movq 0x59cdb(%rip), %r8      # 0x9dc98
movl 0x5ad54d(%rip), %edi    # 0x5f1510
subl %eax, %edi
addl $0x3, %edi
movl 0x59d16(%rip), %esi     # 0x9dce4
movl 0x5ad324(%rip), %edx    # 0x5f12f8
movl 0x5ad30e(%rip), %ecx    # 0x5f12e8
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
jmpq *%r8
// File: /workspace/github_c_makefile_star2_O2/jonof[P]jftekwar/jfbuild/src/osd.c
// Function: OSD_Printf
void OSD_Printf(const char *fmt, ...)
{
	char tmpstr[1024];
	va_list va;

	if (!osdinited) return;

	va_start(va, fmt);
	vsnprintf(tmpstr, sizeof(tmpstr), fmt, va);
	va_end(va);

	OSD_Puts(tmpstr);
}

// Assembly:
pushq %rbx
subq $0x4d0, %rsp            # imm = 0x4D0
movq %rsi, 0x28(%rsp)
movq %rdx, 0x30(%rsp)
movq %rcx, 0x38(%rsp)
movq %r8, 0x40(%rsp)
movq %r9, 0x48(%rsp)
testb %al, %al
je 0x44043
movaps %xmm0, 0x50(%rsp)
movaps %xmm1, 0x60(%rsp)
movaps %xmm2, 0x70(%rsp)
movaps %xmm3, 0x80(%rsp)
movaps %xmm4, 0x90(%rsp)
movaps %xmm5, 0xa0(%rsp)
movaps %xmm6, 0xb0(%rsp)
movaps %xmm7, 0xc0(%rsp)
cmpb $0x1, 0x5a927e(%rip)    # 0x5ed2c8
jne 0x44094
movq %rdi, %r10
leaq 0x20(%rsp), %rax
movq %rsp, %rcx
movq %rax, 0x10(%rcx)
leaq 0x4e0(%rsp), %rax
movq %rax, 0x8(%rcx)
movabsq $0x3000000008, %rax     # imm = 0x3000000008
movq %rax, (%rcx)
leaq 0xd0(%rsp), %rbx
movl $0x400, %esi            # imm = 0x400
movq %rbx, %rdi
movq %r10, %rdx
callq 0x6740
movq %rbx, %rdi
callq 0x4409d
addq $0x4d0, %rsp            # imm = 0x4D0
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O2/jonof[P]jftekwar/jfbuild/src/osd.c
// Function: OSD_Puts
void OSD_Puts(const char *str)
{
    const char *chp;

	if (!osdinited) return;

	for (chp = str; *chp; chp++) {
		if (*chp == '\r') osdpos=0;
		else if (*chp == '\n') {
			osdpos=0;
			linefeed();
		} else {
			osdtext[osdpos++] = *chp;
			if (osdpos == osdcols) {
				osdpos = 0;
				linefeed();
			}
		}
	}
}

// Assembly:
cmpb $0x1, 0x5a9224(%rip)    # 0x5ed2c8
jne 0x44102
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
leaq 0x5a921c(%rip), %r14    # 0x5ed2d0
movzbl (%rbx), %eax
cmpl $0xa, %eax
je 0x440e1
cmpl $0xd, %eax
je 0x440ef
testl %eax, %eax
je 0x440fb
movslq 0x5ad234(%rip), %rcx    # 0x5f1300
leal 0x1(%rcx), %edx
movl %edx, 0x5ad22b(%rip)    # 0x5f1300
movb %al, (%rcx,%r14)
cmpl 0x59bfd(%rip), %edx     # 0x9dcdc
jne 0x440f6
andl $0x0, 0x5ad218(%rip)    # 0x5f1300
callq 0x44103
jmp 0x440f6
andl $0x0, 0x5ad20a(%rip)    # 0x5f1300
incq %rbx
jmp 0x440b4
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O2/jonof[P]jftekwar/jfbuild/src/osd.c
// Function: OSD_DispatchQueued
void OSD_DispatchQueued(void)
{
	int cmd;

	if (!osdexeccount) return;

	cmd=osdexeccount-1;
	osdexeccount=0;

	for (; cmd>=0; cmd--) {
		OSD_Dispatch((const char *)osdhistorybuf[cmd]);
	}
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movl 0x5ad3b5(%rip), %r14d   # 0x5f1514
testq %r14, %r14
je 0x4419d
andl $0x0, 0x5ad3a9(%rip)    # 0x5f1514
movq %r14, %rax
shlq $0x9, %rax
leaq 0x5ad3a7(%rip), %rcx    # 0x5f1520
leaq (%rax,%rcx), %rbx
addq $-0x200, %rbx           # imm = 0xFE00
testl %r14d, %r14d
jle 0x4419d
movq %rbx, %rdi
callq 0x441a5
decl %r14d
addq $-0x200, %rbx           # imm = 0xFE00
jmp 0x44184
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O2/jonof[P]jftekwar/jfbuild/src/osd.c
// Function: OSD_Dispatch
int OSD_Dispatch(const char *cmd)
{
	char *workbuf, *wp, *wtp, *state;
	char *parms[MAXPARMS];
	int  numparms, restart = 0;
	osdfuncparm_t ofp;
	symbol_t *symb;
	//int i;

	workbuf = state = Bstrdup(cmd);
	if (!workbuf) return -1;

	do {
		numparms = 0;
		Bmemset(parms, 0, sizeof(parms));
		wp = strtoken(state, &wtp, &restart);
		if (!wp) {
			state = wtp;
			continue;
		}

		symb = findexactsymbol(wp);
		if (!symb) {
			OSD_Printf("Error: \"%s\" is not defined\n", wp);
			free(workbuf);
			return -1;
		}

		ofp.name = wp;
		while (wtp && !restart) {
			wp = strtoken(NULL, &wtp, &restart);
			if (wp && numparms < MAXPARMS) parms[numparms++] = wp;
		}
		ofp.numparms = numparms;
		ofp.parms    = (const char **)parms;
		ofp.raw      = cmd;
		switch (symb->func(&ofp)) {
			case OSDCMD_OK: break;
			case OSDCMD_SHOWHELP: OSD_Printf("%s\n", symb->help); break;
		}

		state = wtp;
	} while (wtp && restart);

	free(workbuf);

	return 0;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x1048, %rsp           # imm = 0x1048
andl $0x0, 0x4(%rsp)
movq %rdi, 0x18(%rsp)
callq 0x6060
testq %rax, %rax
je 0x442bb
leaq 0x40(%rsp), %r15
leaq 0x8(%rsp), %r12
leaq 0x4(%rsp), %r13
movq %rax, 0x10(%rsp)
movq %rax, %rbp
movl $0x1000, %edx           # imm = 0x1000
movq %r15, %rdi
xorl %esi, %esi
callq 0x62f0
movq %rbp, %rdi
movq %r12, %rsi
movq %r13, %rdx
callq 0x442f2
testq %rax, %rax
je 0x4429f
movq %rax, %rbp
movq %rax, %rdi
callq 0x443e1
testq %rax, %rax
je 0x442c0
movq %rax, %rbx
movq %rbp, 0x28(%rsp)
xorl %ebp, %ebp
cmpq $0x0, 0x8(%rsp)
movl 0x4(%rsp), %r14d
je 0x4426b
testl %r14d, %r14d
jne 0x4426b
cmpl $0x200, %ebp            # imm = 0x200
setb %r14b
xorl %edi, %edi
movq %r12, %rsi
movq %r13, %rdx
callq 0x442f2
testq %rax, %rax
setne %cl
andb %r14b, %cl
cmpb $0x1, %cl
jne 0x44229
movl %ebp, %ecx
incl %ebp
movq %rax, 0x40(%rsp,%rcx,8)
jmp 0x44229
movl %ebp, 0x20(%rsp)
movq %r15, 0x30(%rsp)
movq 0x18(%rsp), %rax
movq %rax, 0x38(%rsp)
leaq 0x20(%rsp), %rdi
callq *0x18(%rbx)
cmpl $0x1, %eax
jne 0x442a4
movq 0x10(%rbx), %rsi
leaq 0x2abf6(%rip), %rdi     # 0x6ee8c
xorl %eax, %eax
callq 0x43fe7
jmp 0x442a4
movl 0x4(%rsp), %r14d
movq 0x8(%rsp), %rbp
xorl %ebx, %ebx
testq %rbp, %rbp
je 0x442d4
testl %r14d, %r14d
jne 0x441e5
jmp 0x442d4
pushq $-0x1
popq %rbx
jmp 0x442de
leaq 0x287bf(%rip), %rdi     # 0x6ca86
movq %rbp, %rsi
xorl %eax, %eax
callq 0x43fe7
pushq $-0x1
popq %rbx
movq 0x10(%rsp), %rdi
callq 0x61c0
movl %ebx, %eax
addq $0x1048, %rsp           # imm = 0x1048
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/osd.c
// Function: strtoken
static char *strtoken(char *s, char **ptrptr, int *restart)
{
	char *p, *p2, *start;

	*restart = 0;
	if (!ptrptr) return NULL;

	// if s != NULL, we process from the start of s, otherwise
	// we just continue with where ptrptr points to
	if (s) p = s;
	else p = *ptrptr;

	if (!p) return NULL;

	// eat up any leading whitespace
	while (*p != 0 && *p != ';' && *p == ' ') p++;

	// a semicolon is an end of statement delimiter like a \0 is, so we signal
	// the caller to 'restart' for the rest of the string pointed at by *ptrptr
	if (*p == ';') {
		*restart = 1;
		*ptrptr = p+1;
		return NULL;
	}
	// or if we hit the end of the input, signal all done by nulling *ptrptr
	else if (*p == 0) {
		*ptrptr = NULL;
		return NULL;
	}

	if (*p == '\"') {
		// quoted string
		start = ++p;
		p2 = p;
		while (*p != 0) {
			if (*p == '\"') {
				p++;
				break;
			} else if (*p == '\\') {
				switch (*(++p)) {
					case 'n': *p2 = '\n'; break;
					case 'r': *p2 = '\r'; break;
					default: *p2 = *p; break;
				}
			} else {
				*p2 = *p;
			}
			p2++, p++;
		}
		*p2 = 0;
	} else {
		start = p;
		while (*p != 0 && *p != ';' && *p != ' ') p++;
	}

	// if we hit the end of input, signal all done by nulling *ptrptr
	if (*p == 0) {
		*ptrptr = NULL;
	}
	// or if we came upon a semicolon, signal caller to restart with the
	// string at *ptrptr
	else if (*p == ';') {
		*p = 0;
		*ptrptr = p+1;
		*restart = 1;
	}
	// otherwise, clip off the token and carry on
	else {
		*(p++) = 0;
		*ptrptr = p;
	}

	return start;
}

// Assembly:
andl $0x0, (%rdx)
testq %rsi, %rsi
je 0x44382
movq %rdi, %rax
testq %rdi, %rdi
jne 0x44313
movq (%rsi), %rax
testq %rax, %rax
jne 0x44313
jmp 0x44382
incq %rax
movzbl (%rax), %edi
cmpl $0x20, %edi
je 0x44310
testl %edi, %edi
je 0x4437e
cmpl $0x22, %edi
je 0x44337
cmpl $0x3b, %edi
jne 0x44385
movl $0x1, (%rdx)
incq %rax
movq %rax, (%rsi)
jmp 0x44382
incq %rax
movq %rax, %rcx
movq %rax, %rdi
movzbl (%rcx), %r8d
cmpl $0x5c, %r8d
je 0x44357
testl %r8d, %r8d
je 0x443ae
cmpl $0x22, %r8d
jne 0x44373
jmp 0x443ab
movzbl 0x1(%rcx), %r8d
incq %rcx
cmpl $0x6e, %r8d
je 0x44370
cmpl $0x72, %r8d
jne 0x44373
movb $0xd, %r8b
jmp 0x44373
movb $0xa, %r8b
movb %r8b, (%rdi)
incq %rdi
incq %rcx
jmp 0x44340
andq $0x0, (%rsi)
xorl %eax, %eax
retq
movabsq $0x800000100000001, %r8 # imm = 0x800000100000001
movq %rax, %rcx
cmpb $0x3b, %dil
ja 0x443a2
movzbl %dil, %r9d
btq %r9, %r8
jb 0x443b4
movb 0x1(%rcx), %dil
incq %rcx
jmp 0x44392
incq %rcx
movb $0x0, (%rdi)
movb (%rcx), %dil
cmpb $0x3b, %dil
je 0x443c7
movzbl %dil, %edx
testl %edx, %edx
jne 0x443d7
andq $0x0, (%rsi)
retq
movb $0x0, (%rcx)
incq %rcx
movq %rcx, (%rsi)
movl $0x1, (%rdx)
retq
movb $0x0, (%rcx)
incq %rcx
movq %rcx, (%rsi)
retq
// File: /workspace/github_c_makefile_star2_O2/jonof[P]jftekwar/jfbuild/src/osd.c
// Function: findexactsymbol
static symbol_t *findexactsymbol(const char *name)
{
	symbol_t *startingat;
	if (!symbols) return NULL;

	startingat = symbols;

	for (; startingat; startingat=startingat->next)
		if (!Bstrcasecmp(name, startingat->name)) return startingat;

	return NULL;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq 0x5a8ed4(%rip), %rbx    # 0x5ed2c0
testq %rbx, %rbx
je 0x4440e
movq %rdi, %r14
testq %rbx, %rbx
je 0x4440e
movq (%rbx), %rsi
movq %r14, %rdi
callq 0x6880
testl %eax, %eax
je 0x44410
movq 0x8(%rbx), %rbx
jmp 0x443f4
xorl %ebx, %ebx
movq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O2/jonof[P]jftekwar/jfbuild/src/osd.c
// Function: findsymbol
static symbol_t *findsymbol(const char *name, symbol_t *startingat)
{
	if (!startingat) startingat = symbols;
	if (!startingat) return NULL;

	for (; startingat; startingat=startingat->next)
		if (!Bstrncasecmp(name, startingat->name, Bstrlen(name))) return startingat;

	return NULL;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rdi, %rbx
testq %rdi, %rdi
jne 0x4442f
movq 0x5a8e91(%rip), %rbx    # 0x5ed2c0
testq %rbx, %rbx
je 0x44463
leaq 0x5af0e5(%rip), %r14    # 0x5f3520
testq %rbx, %rbx
je 0x44463
movq (%rbx), %r15
movq %r14, %rdi
callq 0x6420
movq %r14, %rdi
movq %r15, %rsi
movq %rax, %rdx
callq 0x6a40
testl %eax, %eax
je 0x44465
movq 0x8(%rbx), %rbx
jmp 0x4443b
xorl %ebx, %ebx
movq %rbx, %rax
popq %rbx
popq %r14
popq %r15
retq
nop
// File: /workspace/github_c_makefile_star2_O2/jonof[P]jftekwar/jfbuild/src/pragmas.c
// Function: swapbuf4
void swapbuf4(void *a, void *b, int c)
{
	int *p = (int*)a, *q = (int*)b;
	int x, y;
	while ((c--) > 0) {
		x = *q;
		y = *p;
		*(q++) = y;
		*(p++) = x;
	}
}

// Assembly:
xorl %eax, %eax
testl %edx, %edx
jle 0x444ef
decl %edx
movl (%rsi,%rax), %ecx
movl (%rdi,%rax), %r8d
movl %r8d, (%rsi,%rax)
movl %ecx, (%rdi,%rax)
addq $0x4, %rax
jmp 0x444d5
retq
// File: /workspace/github_c_makefile_star2_O2/jonof[P]jftekwar/jfbuild/src/pragmas.c
// Function: clearbufbyte
void clearbufbyte(void *D, int c, int a)
{
	char *p = (char*)D;
	int m[4] = { 0xffl,0xff00l,0xff0000l,0xff000000l };
	int n[4] = { 0,8,16,24 };
	int z=0;
	while ((c--) > 0) {
		*(p++) = (char)((a & m[z])>>n[z]);
		z=(z+1)&3;
	}
}

// Assembly:
xorl %eax, %eax
leaq 0x28877(%rip), %r8      # 0x6cd70
leaq 0x28880(%rip), %r9      # 0x6cd80
testl %esi, %esi
jle 0x44523
decl %esi
movl %eax, %ecx
movl (%r8,%rcx,4), %r10d
andl %edx, %r10d
movb (%r9,%rcx,4), %cl
sarl %cl, %r10d
movb %r10b, (%rdi)
incq %rdi
incl %eax
andl $0x3, %eax
jmp 0x44500
retq
// File: /workspace/github_c_makefile_star2_O2/jonof[P]jftekwar/jfbuild/src/scriptfile.c
// Function: scriptfile_gettoken
char *scriptfile_gettoken(scriptfile *sf)
{
	char *start;

	skipoverws(sf);
	if (sf->textptr >= sf->eof) return NULL;

	start = sf->ltextptr = sf->textptr;
	skipovertoken(sf);
	return start;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %r14
callq 0x4457d
movq 0x18(%r14), %rbx
cmpq 0x20(%r14), %rbx
jae 0x44570
movq %rbx, 0x10(%r14)
movq %r14, %rdi
callq 0x44595
jmp 0x44572
xorl %ebx, %ebx
movq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O2/jonof[P]jftekwar/jfbuild/src/scriptfile.c
// Function: scriptfile_getlinum
int scriptfile_getlinum (scriptfile *sf, char *ptr)
{
	int i, stp;
	ptrdiff_t ind;

	//for(i=0;i<sf->linenum;i++) if (sf->lineoffs[i] >= ind) return(i+1); //brute force algo

	ind = ((intptr_t)ptr) - ((intptr_t)sf->textbuf);

	for(stp=1;stp+stp<sf->linenum;stp+=stp); //stp = highest power of 2 less than sf->linenum
	for(i=0;stp;stp>>=1)
		if ((i+stp < sf->linenum) && (sf->lineoffs[i+stp] < ind)) i += stp;
	return(i+1); //i = index to highest lineoffs which is less than ind; convert to 1-based line numbers
}

// Assembly:
movq (%rdi), %rax
movl 0x30(%rdi), %ecx
pushq $0x1
popq %r8
movl %r8d, %edx
leal (%rdx,%rdx), %r8d
cmpl %ecx, %r8d
jl 0x44623
subq %rax, %rsi
xorl %eax, %eax
testl %edx, %edx
je 0x4465b
leal (%rax,%rdx), %r8d
cmpl %ecx, %r8d
jge 0x44657
movq 0x38(%rdi), %r9
movslq %r8d, %r10
movslq (%r9,%r10,4), %r9
cmpq %r9, %rsi
jg 0x44654
movl %eax, %r8d
movl %r8d, %eax
sarl %edx
jmp 0x44634
incl %eax
retq
// File: /workspace/github_c_makefile_star2_O2/jonof[P]jftekwar/jfbuild/src/scriptfile.c
// Function: scriptfile_getnumber_radix
static int scriptfile_getnumber_radix(scriptfile *sf, int *num, int radix)
{
	skipoverws(sf);
	if (sf->textptr >= sf->eof)
	{
		buildprintf("Error on line %s:%d: unexpected eof\n",sf->filename,scriptfile_getlinum(sf,sf->textptr));
		return -1;
	}

	while ((sf->textptr[0] == '0') && (sf->textptr[1] >= '0') && (sf->textptr[1] <= '9'))
		sf->textptr++; //hack to treat octal numbers like decimal
	
	sf->ltextptr = sf->textptr;
	(*num) = (int)strtol((const char *)sf->textptr,&sf->textptr,radix);
	if (!ISWS(*sf->textptr) && *sf->textptr) {
		char *p = sf->textptr;
		skipovertoken(sf);
		buildprintf("Error on line %s:%d: expecting int, got \"%s\"\n",sf->filename,scriptfile_getlinum(sf,sf->ltextptr),p);
		return -2;
	}
	return 0;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movl %edx, %ebp
movq %rsi, %r14
movq %rdi, %rbx
callq 0x4457d
movq 0x18(%rbx), %rax
cmpq 0x20(%rbx), %rax
jae 0x44706
leaq 0x18(%rbx), %rsi
incq %rax
cmpb $0x30, -0x1(%rax)
jne 0x446a0
movb (%rax), %cl
addb $-0x30, %cl
cmpb $0x9, %cl
ja 0x446a0
movq %rax, (%rsi)
jmp 0x44688
decq %rax
movq %rax, 0x10(%rbx)
movq %rax, %rdi
movl %ebp, %edx
callq 0x6940
movl %eax, (%r14)
movq 0x18(%rbx), %r14
movzbl (%r14), %ecx
cmpq $0x20, %rcx
ja 0x446d4
xorl %eax, %eax
movabsq $0x100002601, %rdx      # imm = 0x100002601
btq %rcx, %rdx
jb 0x4472b
movq %rbx, %rdi
callq 0x44595
movq 0x10(%rbx), %rsi
movq 0x28(%rbx), %r15
movq %rbx, %rdi
callq 0x44619
leaq 0x28767(%rip), %rdi     # 0x6ce5a
movq %r15, %rsi
movl %eax, %edx
movq %r14, %rcx
xorl %eax, %eax
callq 0x22427
pushq $-0x2
jmp 0x4472a
movq 0x28(%rbx), %r14
movq %rbx, %rdi
movq %rax, %rsi
callq 0x44619
leaq 0x28694(%rip), %rdi     # 0x6cdb0
movq %r14, %rsi
movl %eax, %edx
xorl %eax, %eax
callq 0x22427
pushq $-0x1
popq %rax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/jonof[P]jftekwar/jfbuild/src/scriptfile.c
// Function: scriptfile_getdouble
int scriptfile_getdouble(scriptfile *sf, double *num)
{
	skipoverws(sf);
	if (sf->textptr >= sf->eof)
	{
		buildprintf("Error on line %s:%d: unexpected eof\n",sf->filename,scriptfile_getlinum(sf,sf->textptr));
		return -1;
	}
	
	sf->ltextptr = sf->textptr;

	// On Linux, locale settings interfere with interpreting x.y format numbers
	//(*num) = strtod((const char *)sf->textptr,&sf->textptr);
	(*num) = parsedouble(sf->textptr, &sf->textptr);
	
	if (!ISWS(*sf->textptr) && *sf->textptr) {
		char *p = sf->textptr;
		skipovertoken(sf);
		buildprintf("Error on line %s:%d: expecting float, got \"%s\"\n",sf->filename,scriptfile_getlinum(sf,sf->ltextptr),p);
		return -2;
	}
	return 0;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
subq $0x10, %rsp
movq %rsi, %r14
movq %rdi, %rbx
callq 0x4457d
movq 0x18(%rbx), %rsi
cmpq 0x20(%rbx), %rsi
jae 0x44828
movq %rsi, 0x10(%rbx)
movb (%rsi), %r15b
leal -0x2b(%r15), %eax
andb $-0x3, %al
cmpb $0x1, %al
adcq $0x0, %rsi
movsd 0x28615(%rip), %xmm0    # 0x6cd90
xorpd %xmm3, %xmm3
xorl %edi, %edi
pushq $0x1
popq %rcx
movsd 0x2860c(%rip), %xmm1    # 0x6cd98
pushq $-0x1
popq %rdx
movl %ecx, %r8d
xorl %eax, %eax
movzbl (%rsi), %r9d
leal -0x30(%r9), %r10d
cmpb $0x9, %r10b
ja 0x447bd
movsbl %r10b, %r9d
testl %r8d, %r8d
je 0x447ec
cvtsi2sd %r9d, %xmm2
mulsd %xmm1, %xmm3
addsd %xmm2, %xmm3
movl %ecx, %r8d
jmp 0x44820
cmpl $0x65, %r9d
je 0x447d6
cmpl $0x45, %r9d
je 0x447d6
cmpl $0x2e, %r9d
jne 0x4484c
testl %r8d, %r8d
jne 0x447fa
jmp 0x4484c
leaq 0x1(%rsi), %r9
movzbl 0x1(%rsi), %edi
cmpl $0x2d, %edi
je 0x447ff
cmpl $0x2b, %edi
jne 0x44806
movl %ecx, %edi
jmp 0x44801
testl %edi, %edi
je 0x4480a
movzbl %r10b, %r8d
imull $0xa, %eax, %eax
addl %r8d, %eax
xorl %r8d, %r8d
jmp 0x44820
movl %edx, %edi
movq %r9, %rsi
jmp 0x44820
movl %ecx, %edi
jmp 0x44820
cvtsi2sd %r9d, %xmm2
mulsd %xmm0, %xmm2
addsd %xmm2, %xmm3
divsd %xmm1, %xmm0
xorl %r8d, %r8d
xorl %edi, %edi
incq %rsi
jmp 0x44794
movq 0x28(%rbx), %r14
movq %rbx, %rdi
callq 0x44619
leaq 0x28575(%rip), %rdi     # 0x6cdb0
movq %r14, %rsi
movl %eax, %edx
xorl %eax, %eax
callq 0x22427
pushq $-0x1
popq %rax
jmp 0x448a9
movq %rsi, 0x18(%rbx)
testl %edi, %edi
je 0x44876
imull %edi, %eax
cvtsi2sd %eax, %xmm1
movsd 0x28535(%rip), %xmm0    # 0x6cd98
movapd %xmm3, (%rsp)
callq 0x6380
movapd (%rsp), %xmm3
mulsd %xmm0, %xmm3
cmpb $0x2d, %r15b
jne 0x44884
xorpd 0x2851c(%rip), %xmm3    # 0x6cda0
movsd %xmm3, (%r14)
movq 0x18(%rbx), %r14
movzbl (%r14), %ecx
cmpq $0x20, %rcx
ja 0x448b3
xorl %eax, %eax
movabsq $0x100002601, %rdx      # imm = 0x100002601
btq %rcx, %rdx
jae 0x448b3
addq $0x10, %rsp
popq %rbx
popq %r14
popq %r15
retq
movq %rbx, %rdi
callq 0x44595
movq 0x10(%rbx), %rsi
movq 0x28(%rbx), %r15
movq %rbx, %rdi
callq 0x44619
leaq 0x28503(%rip), %rdi     # 0x6cdd5
movq %r15, %rsi
movl %eax, %edx
movq %r14, %rcx
xorl %eax, %eax
callq 0x22427
pushq $-0x2
jmp 0x44849
// File: /workspace/github_c_makefile_star2_O2/jonof[P]jftekwar/jfbuild/src/scriptfile.c
// Function: scriptfile_getsymbol
int scriptfile_getsymbol(scriptfile *sf, int *num)
{
	char *t, *e;
	int v;

	t = scriptfile_gettoken(sf);
	if (!t) return -1;

	v = (int)strtol(t, &e, 10);
	if (*e) {
		// looks like a string, so find it in the symbol table
		if (scriptfile_getsymbolvalue(t, num)) return 0;
		buildprintf("Error on line %s:%d: expecting symbol, got \"%s\"\n",sf->filename,scriptfile_getlinum(sf,sf->ltextptr),t);
		return -2;   // not found
	}

	*num = v;
	return 0;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq %rsi, %r15
movq %rdi, %r14
callq 0x4454c
testq %rax, %rax
je 0x4495a
movq %rax, %rbx
movq %rsp, %r12
pushq $0xa
popq %rdx
movq %rax, %rdi
movq %r12, %rsi
callq 0x6940
movq (%r12), %rcx
cmpb $0x0, (%rcx)
je 0x4495f
movq %rbx, %rdi
movq %r15, %rsi
callq 0x44970
movl %eax, %ecx
xorl %eax, %eax
testl %ecx, %ecx
jne 0x44964
movq 0x10(%r14), %rsi
movq 0x28(%r14), %r15
movq %r14, %rdi
callq 0x44619
leaq 0x284be(%rip), %rdi     # 0x6ce05
movq %r15, %rsi
movl %eax, %edx
movq %rbx, %rcx
xorl %eax, %eax
callq 0x22427
pushq $-0x2
jmp 0x4495c
pushq $-0x1
popq %rax
jmp 0x44964
movl %eax, (%r15)
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O2/jonof[P]jftekwar/jfbuild/src/scriptfile.c
// Function: scriptfile_getsymbolvalue
int scriptfile_getsymbolvalue(const char *name, int *val)
{
	char *scanner = symbtab;

	if (!symbtab) return 0;
	while (scanner - symbtab < (ptrdiff_t)symbtablength) {
		if (!strcasecmp(name, scanner)) {
			*val = *(int*)(scanner + strlen(scanner) + 1);
			return 1;
		}

		scanner += strlen(scanner) + 1 + sizeof(int);
	}

	return 0;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq 0x5aeda6(%rip), %r13    # 0x5f3728
xorl %ebx, %ebx
testq %r13, %r13
je 0x449d5
movq %rdi, %r15
movq %rsi, (%rsp)
movq 0x5aed99(%rip), %r14    # 0x5f3730
movq %r13, %r12
movq %r12, %rax
subq %r13, %rax
cmpq %r14, %rax
jge 0x449d5
movq %r15, %rdi
movq %r12, %rsi
callq 0x6880
movl %eax, %ebp
movq %r12, %rdi
callq 0x6420
testl %ebp, %ebp
je 0x449c7
addq %rax, %r12
addq $0x5, %r12
jmp 0x4499a
movl 0x1(%r12,%rax), %eax
movq (%rsp), %rcx
movl %eax, (%rcx)
pushq $0x1
popq %rbx
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/scriptfile.c
// Function: scriptfile_getbraces
int scriptfile_getbraces(scriptfile *sf, char **braceend)
{
	int bracecnt;
	char *bracestart;

	skipoverws(sf);
	if (sf->textptr >= sf->eof)
	{
		buildprintf("Error on line %s:%d: unexpected eof\n",sf->filename,scriptfile_getlinum(sf,sf->textptr));
		return -1;
	}

	if (sf->textptr[0] != '{') {
		buildprintf("Error on line %s:%d: expecting '{'\n",sf->filename,scriptfile_getlinum(sf,sf->textptr));
		return -1;
	}
	bracestart = ++sf->textptr; bracecnt = 1;
	while (1)
	{
		if (sf->textptr >= sf->eof) return(0);
		if (sf->textptr[0] == '{') bracecnt++;
		if (sf->textptr[0] == '}') { bracecnt--; if (!bracecnt) break; }
		sf->textptr++;
	}
	(*braceend) = sf->textptr;
	sf->textptr = bracestart;
	return 0;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %r14
movq %rdi, %rbx
callq 0x4457d
movq 0x18(%rbx), %rsi
movq 0x20(%rbx), %rcx
cmpq %rcx, %rsi
jae 0x44a40
cmpb $0x7b, (%rsi)
jne 0x44a55
incq %rsi
pushq $0x1
popq %rdi
movq %rsi, %rdx
xorl %eax, %eax
movq %rdx, 0x18(%rbx)
cmpq %rcx, %rdx
jae 0x44a77
movb (%rdx), %r10b
xorl %r8d, %r8d
cmpb $0x7b, %r10b
sete %r9b
cmpb $0x7d, %r10b
jne 0x44a35
decl %edi
jne 0x44a3b
jmp 0x44a7f
movb %r9b, %r8b
addl %r8d, %edi
incq %rdx
jmp 0x44a12
movq 0x28(%rbx), %r14
movq %rbx, %rdi
callq 0x44619
leaq 0x2835d(%rip), %rdi     # 0x6cdb0
jmp 0x44a68
movq 0x28(%rbx), %r14
movq %rbx, %rdi
callq 0x44619
leaq 0x283ce(%rip), %rdi     # 0x6ce36
movq %r14, %rsi
movl %eax, %edx
xorl %eax, %eax
callq 0x22427
pushq $-0x1
popq %rax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
movq %rdx, (%r14)
movq %rsi, 0x18(%rbx)
jmp 0x44a77
// File: /workspace/github_c_makefile_star2_O2/jonof[P]jftekwar/jfbuild/src/scriptfile.c
// Function: scriptfile_fromfile
scriptfile *scriptfile_fromfile(const char *fn)
{
	int fp;
	scriptfile *sf;
	char *tx;
	unsigned int flen;

	fp = kopen4load(fn,0);
	if (fp<0) return NULL;

	flen = kfilelength(fp);
	tx = (char *) malloc(flen + 2);
	if (!tx) {
		kclose(fp);
		return NULL;
	}

	sf = (scriptfile*) malloc(sizeof(scriptfile));
	if (!sf) {
		kclose(fp);
		free(tx);
		return NULL;
	}

	kread(fp, tx, flen);
	tx[flen] = tx[flen+1] = 0;

	kclose(fp);

	scriptfile_preparse(sf,tx,flen);
	sf->filename = strdup(fn);

	return sf;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movq %rdi, %rbx
xorl %r14d, %r14d
xorl %esi, %esi
callq 0x1dc36
testl %eax, %eax
js 0x44d0a
movl %eax, %ebp
movl %eax, %edi
callq 0x1e14c
movl %eax, %r12d
leal 0x2(%r12), %edi
callq 0x69a0
testq %rax, %rax
je 0x44cef
movq %rax, %r15
pushq $0x40
popq %rdi
callq 0x69a0
testq %rax, %rax
je 0x44cf8
movq %rax, %r14
movl %ebp, %edi
movq %r15, %rsi
movl %r12d, %edx
callq 0x1de3f
leal 0x1(%r12), %eax
xorl %ecx, %ecx
movb %cl, (%r15,%rax)
movl %r12d, %r12d
movb %cl, (%r15,%r12)
movl %ebp, %edi
callq 0x1e2db
movq %r14, %rdi
movq %r15, %rsi
movq %r12, %rdx
callq 0x44a88
movq %rbx, %rdi
callq 0x6060
movq %rax, 0x28(%r14)
jmp 0x44d0a
movl %ebp, %edi
callq 0x1e2db
jmp 0x44d07
movl %ebp, %edi
callq 0x1e2db
movq %r15, %rdi
callq 0x61c0
xorl %r14d, %r14d
movq %r14, %rax
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/jonof[P]jftekwar/jfbuild/src/scriptfile.c
// Function: scriptfile_fromstring
scriptfile *scriptfile_fromstring(const char *string)
{
	scriptfile *sf;
	char *tx;
	size_t flen;

	if (!string) return NULL;

	flen = strlen(string);

	tx = (char *) malloc(flen + 2);
	if (!tx) return NULL;

	sf = (scriptfile*) malloc(sizeof(scriptfile));
	if (!sf) {
		free(tx);
		return NULL;
	}

	memcpy(tx, string, flen);
	tx[flen] = tx[flen+1] = 0;

	scriptfile_preparse(sf,tx,flen);
	sf->filename = NULL;

	return sf;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
testq %rdi, %rdi
je 0x44d80
movq %rdi, %r14
callq 0x6420
movq %rax, %r15
leaq 0x2(%rax), %rdi
callq 0x69a0
testq %rax, %rax
je 0x44d80
movq %rax, %r12
pushq $0x40
popq %rdi
callq 0x69a0
testq %rax, %rax
je 0x44d78
movq %rax, %rbx
movq %r12, %rdi
movq %r14, %rsi
movq %r15, %rdx
callq 0x60c0
andw $0x0, (%r12,%r15)
movq %rbx, %rdi
movq %r12, %rsi
movq %r15, %rdx
callq 0x44a88
andq $0x0, 0x28(%rbx)
jmp 0x44d82
movq %r12, %rdi
callq 0x61c0
xorl %ebx, %ebx
movq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O2/jonof[P]jftekwar/jfbuild/src/scriptfile.c
// Function: scriptfile_close
void scriptfile_close(scriptfile *sf)
{
	if (!sf) return;
	if (sf->lineoffs) free(sf->lineoffs);
	if (sf->textbuf) free(sf->textbuf);
	if (sf->filename) free(sf->filename);
	sf->textbuf = NULL;
	sf->filename = NULL;
	free(sf);
}

// Assembly:
testq %rdi, %rdi
je 0x44dbd
pushq %rbx
movq %rdi, %rbx
movq 0x38(%rdi), %rdi
callq 0x61c0
movq (%rbx), %rdi
callq 0x61c0
movq 0x28(%rbx), %rdi
callq 0x61c0
movq %rbx, %rdi
popq %rbx
jmp 0x61c0
retq
// File: /workspace/github_c_makefile_star2_O2/jonof[P]jftekwar/jfbuild/src/scriptfile.c
// Function: scriptfile_addsymbolvalue
int scriptfile_addsymbolvalue(const char *name, int val)
{
	//int x;
	char *sp;
	//if (scriptfile_getsymbolvalue(name, &x)) return -1;   // already exists

	if (symbtab) {
		char *scanner = symbtab;
		while (scanner - symbtab < (ptrdiff_t)symbtablength) {
			if (!strcasecmp(name, scanner)) {
				*(int*)(scanner + strlen(scanner) + 1) = val;
				return 1;
			}

			scanner += strlen(scanner) + 1 + sizeof(int);
		}
	}
	
	sp = getsymbtabspace(strlen(name) + 1 + sizeof(int));
	if (!sp) return 0;
	strcpy(sp, name);
	sp += strlen(name)+1;
	*(int*)sp = val;
	return 1;   // added
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movl %esi, %ebx
movq %rdi, %r14
movq 0x5ae93b(%rip), %r15    # 0x5f3728
movq 0x5ae93c(%rip), %r13    # 0x5f3730
testq %r15, %r15
je 0x44e2b
movq %r15, %r12
movq %r12, %rax
subq %r15, %rax
cmpq %r13, %rax
jge 0x44e2b
movq %r14, %rdi
movq %r12, %rsi
callq 0x6880
testl %eax, %eax
je 0x44eab
movq %r12, %rdi
callq 0x6420
addq %rax, %r12
addq $0x5, %r12
jmp 0x44dfc
movq %r14, %rdi
callq 0x6420
leaq (%rax,%r13), %rbp
addq $0x5, %rbp
movq 0x5ae8f6(%rip), %rcx    # 0x5f3738
cmpq %rcx, %rbp
jbe 0x44e8c
cmpq $0x101, %rcx            # imm = 0x101
movl $0x100, %eax            # imm = 0x100
cmovaeq %rcx, %rax
movq %rax, %r12
addq %rax, %rax
cmpq %r12, %rbp
ja 0x44e57
movq %r15, %rdi
movq %r12, %rsi
callq 0x6120
testq %rax, %rax
je 0x44ec0
movq %rax, %r15
movq %rax, 0x5ae8ac(%rip)    # 0x5f3728
movq %r12, 0x5ae8b5(%rip)    # 0x5f3738
movq %rbp, 0x5ae8a6(%rip)    # 0x5f3730
jmp 0x44e98
movq %rbp, 0x5ae89d(%rip)    # 0x5f3730
testq %r15, %r15
je 0x44ec0
addq %r13, %r15
movq %r15, %rdi
movq %r14, %rsi
callq 0x6430
movq %r15, %r12
jmp 0x44eae
movq %r12, %r14
movq %r14, %rdi
callq 0x6420
movl %ebx, 0x1(%r12,%rax)
pushq $0x1
popq %rax
jmp 0x44ec2
xorl %eax, %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/scriptfile.c
// Function: scriptfile_clearsymbols
void scriptfile_clearsymbols(void)
{
	if (symbtab) free(symbtab);
	symbtab = NULL;
	symbtablength = 0;
	symbtaballoclength = 0;
}

// Assembly:
pushq %rax
movq 0x5ae84f(%rip), %rdi    # 0x5f3728
callq 0x61c0
andq $0x0, 0x5ae842(%rip)    # 0x5f3728
andq $0x0, 0x5ae842(%rip)    # 0x5f3730
andq $0x0, 0x5ae842(%rip)    # 0x5f3738
popq %rax
retq
// File: /workspace/github_c_makefile_star2_O2/jonof[P]jftekwar/jfbuild/src/glbuild.c
// Function: osdcmd_glinfo
static int osdcmd_glinfo(const osdfuncparm_t *parm)
{
	if (parm->numparms == 0) {
		dumpglinfo();
		buildputs("Use \"glinfo exts\" to list extensions.\n");
	} else if (strcmp(parm->parms[0], "exts") == 0) {
		dumpglexts();
	}
	return OSDCMD_OK;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
cmpl $0x0, (%rdi)
je 0x459f5
movq 0x10(%rdi), %rax
movq (%rax), %rdi
leaq 0x22b33(%rip), %rsi     # 0x684eb
callq 0x68d0
testl %eax, %eax
jne 0x45b59
leaq 0x131884(%rip), %rax    # 0x177250
cmpl $0x0, (%rax)
je 0x45a3a
leaq 0x294b8(%rip), %rdi     # 0x6ee90
callq 0x30c8d
leaq 0xbad(%rip), %rdi       # 0x46591
callq 0x45678
leaq 0x266dc(%rip), %rdi     # 0x6c0cc
jmp 0x45b54
leaq 0x131854(%rip), %rbx    # 0x177250
cmpl $0x0, (%rbx)
je 0x45a18
movl 0xc(%rbx), %eax
cmpl $0x1, %eax
jne 0x45a29
cmpl $0x0, 0x10(%rbx)
jne 0x45a29
leaq 0x29303(%rip), %rax     # 0x6ed19
jmp 0x45a4d
leaq 0x292d7(%rip), %rdi     # 0x6ecf6
callq 0x30c8d
jmp 0x45b4d
testl %eax, %eax
jle 0x45a46
movl $0x8b8c, %edi           # imm = 0x8B8C
callq *0x5add68(%rip)         # 0x5f37a0
jmp 0x45a4d
leaq 0x292b5(%rip), %rdi     # 0x6ecf6
jmp 0x45b54
leaq 0x2929b(%rip), %rax     # 0x6ece8
movq %rax, 0x8(%rsp)
movl $0x1f02, %edi           # imm = 0x1F02
callq *0x5add43(%rip)         # 0x5f37a0
movq %rax, 0x20(%rsp)
movl $0x1f00, %edi           # imm = 0x1F00
callq *0x5add33(%rip)         # 0x5f37a0
movq %rax, 0x18(%rsp)
movl $0x1f01, %edi           # imm = 0x1F01
callq *0x5add23(%rip)         # 0x5f37a0
movss 0x14(%rbx), %xmm0
ucomiss 0x2654b(%rip), %xmm0    # 0x6bfd4
cvtss2sd %xmm0, %xmm0
leaq 0x29258(%rip), %r13     # 0x6ecec
leaq 0x2924d(%rip), %rcx     # 0x6ece8
movq %rcx, %r9
cmovaq %r13, %r9
movq 0x18(%rbx), %xmm1
pxor %xmm2, %xmm2
pcmpeqb %xmm1, %xmm2
pmovmskb %xmm2, %edx
testb $0x1, %dl
movq %r13, %rsi
cmovneq %rcx, %rsi
movq %rsi, 0x10(%rsp)
testb $0x20, %dl
movq %r13, %r11
cmovneq %rcx, %r11
testb $0x4, %dl
movq %r13, %rbp
cmovneq %rcx, %rbp
testb $0x8, %dl
movq %rbx, %rsi
movq %r13, %rbx
cmovneq %rcx, %rbx
testb $0x10, %dl
movq %r13, %r14
cmovneq %rcx, %r14
testb $0x2, %dl
movq %r13, %r15
cmovneq %rcx, %r15
testb $0x40, %dl
movq %r13, %r12
cmovneq %rcx, %r12
testb $-0x80, %dl
movq %r13, %r10
cmovneq %rcx, %r10
cmpb $0x0, 0x20(%rsi)
cmoveq %rcx, %r13
subq $0x8, %rsp
leaq 0x29200(%rip), %rdi     # 0x6ed1e
movq 0x28(%rsp), %rsi
movq 0x20(%rsp), %rdx
movq %rax, %rcx
movq 0x10(%rsp), %r8
movb $0x1, %al
pushq %r13
pushq %r10
pushq %r12
pushq %r15
pushq %r14
pushq %rbx
pushq %rbp
pushq %r11
pushq 0x58(%rsp)
callq 0x22427
addq $0x50, %rsp
leaq 0x2916d(%rip), %rdi     # 0x6ecc1
callq 0x30c8d
xorl %eax, %eax
addq $0x28, %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/glbuild.c
// Function: getproc_
static inline void * getproc_(const char *func, int *err, int fatal)
{
	void *proc = getglprocaddress(func, 1);
	if (!proc && fatal) {
		buildprintf("glbuild_loadfunctions: failed to find %s\n", func);
		*err = 1;
	}
	return proc;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movl %edx, %ebp
movq %rsi, %rbx
movq %rdi, %r14
pushq $0x1
popq %rsi
callq 0x63a6c
movq %rax, %r15
testq %rax, %rax
setne %al
testl %ebp, %ebp
sete %cl
orb %al, %cl
jne 0x45baa
leaq 0x290c3(%rip), %rdi     # 0x6ec5d
movq %r14, %rsi
xorl %eax, %eax
callq 0x22427
movl $0x1, (%rbx)
movq %r15, %rax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/jonof[P]jftekwar/jfbuild/src/glbuild.c
// Function: glbuild_check_errors
void glbuild_check_errors(const char *file, int line)
{
	GLenum err;
	const char *str;

	while ((err = glfunc.glGetError()) != GL_NO_ERROR) {
		switch (err) {
			case GL_INVALID_ENUM: str = "GL_INVALID_ENUM"; break;
			case GL_INVALID_VALUE: str = "GL_INVALID_VALUE"; break;
			case GL_INVALID_OPERATION: str = "GL_INVALID_OPERATION"; break;
			case GL_INVALID_FRAMEBUFFER_OPERATION: str = "GL_INVALID_FRAMEBUFFER_OPERATION"; break;
			case GL_OUT_OF_MEMORY: str = "GL_OUT_OF_MEMORY"; break;
#ifdef GL_STACK_UNDERFLOW
			case GL_STACK_UNDERFLOW: str = "GL_STACK_UNDERFLOW"; break;
#endif
#ifdef GL_STACK_OVERFLOW
			case GL_STACK_OVERFLOW: str = "GL_STACK_OVERFLOW"; break;
#endif
			default: str = "(unknown)"; break;
		}
		debugprintf("GL error [%s:%d]: (%d) %s\n", file, line, err, str);
	}
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movl %esi, %ebx
movq %rdi, %r14
leaq 0x28dba(%rip), %r12     # 0x6e99c
leaq 0x28e4a(%rip), %r15     # 0x6ea33
leaq 0x288a0(%rip), %rbp     # 0x6e490
leaq 0x28ddb(%rip), %r13     # 0x6e9d2
callq *0x5adbab(%rip)         # 0x5f37a8
leal -0x500(%rax), %ecx
cmpl $0x6, %ecx
ja 0x45c1e
movslq (%rbp,%rcx,4), %rcx
addq %rbp, %rcx
movq %r12, %r8
jmpq *%rcx
leaq 0x28d90(%rip), %r8      # 0x6e9ac
jmp 0x45c52
testl %eax, %eax
je 0x45c65
leaq 0x28e00(%rip), %r8      # 0x6ea29
jmp 0x45c52
leaq 0x28dd2(%rip), %r8      # 0x6ea04
jmp 0x45c52
leaq 0x28d82(%rip), %r8      # 0x6e9bd
jmp 0x45c52
leaq 0x28dd3(%rip), %r8      # 0x6ea17
jmp 0x45c52
leaq 0x28da6(%rip), %r8      # 0x6e9f3
jmp 0x45c52
movq %r13, %r8
movq %r15, %rdi
movq %r14, %rsi
movl %ebx, %edx
movl %eax, %ecx
xorl %eax, %eax
callq 0x62903
jmp 0x45bf7
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/glbuild.c
// Function: glbuild_link_program
GLuint glbuild_link_program(int shadercount, GLuint *shaders)
{
	GLuint program;
	GLint status;
	int i;

	program = glfunc.glCreateProgram();
	if (!program) {
		return 0;
	}

	for (i = 0; i < shadercount; i++) {
		glfunc.glAttachShader(program, shaders[i]);
	}

	glfunc.glLinkProgram(program);

	glfunc.glGetProgramiv(program, GL_LINK_STATUS, &status);
	if (status == GL_FALSE) {
		GLint loglen = 0;
		GLchar *logtext = NULL;

		glfunc.glGetProgramiv(program, GL_INFO_LOG_LENGTH, &loglen);

		logtext = (GLchar *)malloc(loglen);
		glfunc.glGetProgramInfoLog(program, loglen, &loglen, logtext);
		buildprintf("glbuild_link_program: link error: %s\n", logtext);
		free(logtext);

		glfunc.glDeleteProgram(program);
		return 0;
	}

	for (i = 0; i < shadercount; i++) {
		glfunc.glDetachShader(program, shaders[i]);
	}

	return program;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq %rsi, %r14
movl %edi, %r15d
callq *0x5ada7b(%rip)         # 0x5f3898
testl %eax, %eax
je 0x45ede
movl %eax, %ebx
xorl %r12d, %r12d
testl %r15d, %r15d
cmovlel %r12d, %r15d
cmpq %r12, %r15
je 0x45e47
movl (%r14,%r12,4), %esi
movl %ebx, %edi
callq *0x5ada46(%rip)         # 0x5f3888
incq %r12
jmp 0x45e31
movl %ebx, %edi
callq *0x5adaa1(%rip)         # 0x5f38f0
leaq 0x4(%rsp), %r12
movl %ebx, %edi
movl $0x8b82, %esi           # imm = 0x8B82
movq %r12, %rdx
callq *0x5ada64(%rip)         # 0x5f38c8
cmpl $0x0, (%r12)
je 0x45e84
xorl %r12d, %r12d
cmpq %r12, %r15
je 0x45ee0
movl (%r14,%r12,4), %esi
movl %ebx, %edi
callq *0x5ada39(%rip)         # 0x5f38b8
incq %r12
jmp 0x45e6e
movq %rsp, %r14
andl $0x0, (%r14)
movl %ebx, %edi
movl $0x8b84, %esi           # imm = 0x8B84
movq %r14, %rdx
callq *0x5ada2d(%rip)         # 0x5f38c8
movl (%r14), %eax
movslq %eax, %r15
movq %r15, %rdi
callq 0x69a0
movq %rax, %r12
movl %ebx, %edi
movl %r15d, %esi
movq %r14, %rdx
movq %rax, %rcx
callq *0x5ada13(%rip)         # 0x5f38d0
leaq 0x28ba7(%rip), %rdi     # 0x6ea6b
movq %r12, %rsi
xorl %eax, %eax
callq 0x22427
movq %r12, %rdi
callq 0x61c0
movl %ebx, %edi
callq *0x5ad9ca(%rip)         # 0x5f38a8
xorl %ebx, %ebx
movl %ebx, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O2/jonof[P]jftekwar/jfbuild/src/glbuild.c
// Function: glbuild_delete_8bit_shader
void glbuild_delete_8bit_shader(glbuild8bit *state)
{
	if (state->program) {
#if (USE_OPENGL != USE_GL3)
		glfunc.glDisableVertexAttribArray(state->attrib_vertex);
		glfunc.glDisableVertexAttribArray(state->attrib_texcoord);
#endif
		glfunc.glUseProgram(0);	// Disable shaders, go back to fixed-function.
		glfunc.glDeleteProgram(state->program);
		state->program = 0;
	}
	if (state->paltex) {
		glfunc.glDeleteTextures(1, &state->paltex);
		state->paltex = 0;
	}
	if (state->frametex) {
		glfunc.glDeleteTextures(1, &state->frametex);
		state->frametex = 0;
	}
#if (USE_OPENGL == USE_GL3)
	if (state->vao) {
		glfunc.glBindVertexArray(0);
		glfunc.glDeleteVertexArrays(1, &state->vao);
		state->vao = 0;
	}
#endif
	if (state->buffer_indexes) {
		glfunc.glDeleteBuffers(1, &state->buffer_indexes);
		state->buffer_indexes = 0;
	}
	if (state->buffer_elements) {
		glfunc.glDeleteBuffers(1, &state->buffer_elements);
		state->buffer_elements = 0;
	}
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
cmpl $0x0, (%rdi)
je 0x4644b
movl 0x10(%rbx), %edi
callq *0x5ad441(%rip)         # 0x5f3870
movl 0x14(%rbx), %edi
callq *0x5ad438(%rip)         # 0x5f3870
xorl %edi, %edi
callq *0x5ad4f0(%rip)         # 0x5f3930
movl (%rbx), %edi
callq *0x5ad460(%rip)         # 0x5f38a8
andl $0x0, (%rbx)
cmpl $0x0, 0x4(%rbx)
je 0x46465
leaq 0x4(%rbx), %r14
pushq $0x1
popq %rdi
movq %r14, %rsi
callq *0x5ad39f(%rip)         # 0x5f3800
andl $0x0, (%r14)
cmpl $0x0, 0x8(%rbx)
je 0x4647f
leaq 0x8(%rbx), %r14
pushq $0x1
popq %rdi
movq %r14, %rsi
callq *0x5ad385(%rip)         # 0x5f3800
andl $0x0, (%r14)
cmpl $0x0, 0x18(%rbx)
je 0x46499
leaq 0x18(%rbx), %r14
pushq $0x1
popq %rdi
movq %r14, %rsi
callq *0x5ad3bb(%rip)         # 0x5f3850
andl $0x0, (%r14)
cmpl $0x0, 0x1c(%rbx)
je 0x464b2
addq $0x1c, %rbx
pushq $0x1
popq %rdi
movq %rbx, %rsi
callq *0x5ad3a1(%rip)         # 0x5f3850
andl $0x0, (%rbx)
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O2/jonof[P]jftekwar/jfbuild/src/polymost.c
// Function: polymost_texmayhavealpha
int polymost_texmayhavealpha (int dapicnum, int dapalnum)
{
	PTHead * pth;

	pth = PT_GetHead(dapicnum, dapalnum, 0, 1);
	if (!pth) {
		return 1;
	}

	if (!pth->pic[PTHPIC_BASE]) {
		// we haven't got a PTMHead reference yet for the base layer, so we
		// don't know if the texture actually does have alpha, so err on
		// the side of caution
		return 1;
	}

	return ((pth->pic[PTHPIC_BASE]->flags & PTH_HASALPHA) == PTH_HASALPHA);
}

// Assembly:
pushq %rbx
pushq $0x1
popq %rbx
xorl %edx, %edx
movl %ebx, %ecx
callq 0x5c910
testq %rax, %rax
je 0x465cf
movq (%rax), %rax
testq %rax, %rax
je 0x465cf
movl 0x4(%rax), %ebx
shrl $0x3, %ebx
andl $0x1, %ebx
movl %ebx, %eax
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O2/jonof[P]jftekwar/jfbuild/src/polymost.c
// Function: polymost_texinvalidate
void polymost_texinvalidate (int dapicnum, int dapalnum, int dameth)
{
	PTIter iter;
	PTHead * pth;

	iter = PTIterNewMatch(
		PTITER_PICNUM | PTITER_PALNUM | PTITER_FLAGS,
		dapicnum, dapalnum, PTH_CLAMPED, (dameth & METH_CLAMPED) ? PTH_CLAMPED : 0
		);
	while ((pth = PTIterNext(iter)) != 0) {
		if (pth->pic[PTHPIC_BASE]) {
			pth->pic[PTHPIC_BASE]->flags |= PTH_DIRTY;
		}
		/*buildprintf("invalidating picnum:%d palnum:%d effects:%d skyface:%d flags:%04X repldef:%p\n",
			   pth->picnum, pth->palnum, pth->effects, pth->skyface,
			   pth->flags, pth->repldef);*/
	}
	//buildprintf("done\n");
	PTIterFree(iter);
}

// Assembly:
pushq %rbx
movl %edx, %r8d
movl %esi, %edx
movl %edi, %esi
shrl $0x2, %r8d
andl $0x1, %r8d
pushq $0x7
popq %rdi
pushq $0x1
popq %rcx
callq 0x5c949
movq %rax, %rbx
movq %rbx, %rdi
callq 0x5ca5e
testq %rax, %rax
je 0x4660c
movq (%rax), %rax
testq %rax, %rax
je 0x465f1
orb $-0x80, 0x4(%rax)
jmp 0x465f1
movq %rbx, %rdi
popq %rbx
jmp 0x5ca86
// File: /workspace/github_c_makefile_star2_O2/jonof[P]jftekwar/jfbuild/src/polymost.c
// Function: polymost_texinvalidateall
void polymost_texinvalidateall (void)
{
	PTIter iter;
	PTHead * pth;

	iter = PTIterNew();
	while ((pth = PTIterNext(iter)) != 0) {
		if (pth->pic[PTHPIC_BASE]) {
			pth->pic[PTHPIC_BASE]->flags |= PTH_DIRTY;
		}
	}
	PTIterFree(iter);
	clearskins();
	//buildprintf("gltexinvalidateall()\n");
}

// Assembly:
pushq %rbx
callq 0x5ca4e
movq %rax, %rbx
movq %rbx, %rdi
callq 0x5ca5e
testq %rax, %rax
je 0x46639
movq (%rax), %rax
testq %rax, %rax
je 0x4661e
orb $-0x80, 0x4(%rax)
jmp 0x4661e
movq %rbx, %rdi
callq 0x5ca86
popq %rbx
jmp 0x5595d
// File: /workspace/github_c_makefile_star2_O2/jonof[P]jftekwar/jfbuild/src/polymost.c
// Function: polymost_glinit
void polymost_glinit(void)
{
	glfunc.glClearColor(0,0,0,0.5); //Black Background
	glfunc.glDisable(GL_DITHER);

	glfunc.glBlendFunc(GL_SRC_ALPHA,GL_ONE_MINUS_SRC_ALPHA);

	glfunc.glPixelStorei(GL_UNPACK_ALIGNMENT, 1);

	if (glmultisample > 0 && glinfo.multisample) {
#if (USE_OPENGL != USE_GLES2)
#ifdef GL_NV_multisample_filter_hint
		if (glinfo.nvmultisamplehint)
			glfunc.glHint(GL_MULTISAMPLE_FILTER_HINT_NV, glnvmultisamplehint ? GL_NICEST:GL_FASTEST);
#endif

		glfunc.glEnable(GL_MULTISAMPLE);

		if (glsampleshading > 0 && glinfo.sampleshading) {
			glfunc.glMinSampleShadingARB(1.f);
			glfunc.glEnable(GL_SAMPLE_SHADING_ARB);
		}
#endif
	}

	polymost_loadshaders();
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
leaq 0x5acc99(%rip), %rbx    # 0x5f3740
movss 0x28859(%rip), %xmm3    # 0x6f308
xorps %xmm0, %xmm0
xorps %xmm1, %xmm1
xorps %xmm2, %xmm2
callq *(%rbx)
movl $0xbd0, %edi            # imm = 0xBD0
callq *0x48(%rbx)
movl $0x302, %edi            # imm = 0x302
movl $0x303, %esi            # imm = 0x303
callq *0x18(%rbx)
pushq $0x1
popq %rsi
movl $0xcf5, %edi            # imm = 0xCF5
callq *0x78(%rbx)
cmpl $0x0, 0x5aceab(%rip)    # 0x5f398c
jle 0x46b3d
leaq 0x130766(%rip), %r14    # 0x177250
cmpb $0x0, 0x1e(%r14)
je 0x46b3d
cmpb $0x0, 0x1f(%r14)
je 0x46b0f
cmpl $0x1, 0x5ace91(%rip)    # 0x5f3990
movl $0x1102, %esi           # imm = 0x1102
sbbl $0x0, %esi
movl $0x8534, %edi           # imm = 0x8534
callq *0x70(%rbx)
movl $0x809d, %edi           # imm = 0x809D
callq *0x40(%rbx)
cmpl $0x0, 0x5ace76(%rip)    # 0x5f3994
jle 0x46b3d
cmpb $0x0, 0x20(%r14)
je 0x46b3d
movss 0x254a5(%rip), %xmm0    # 0x6bfd4
callq *0x90(%rbx)
movl $0x8c36, %edi           # imm = 0x8C36
callq *0x40(%rbx)
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0x46b46
// File: /workspace/github_c_makefile_star2_O2/jonof[P]jftekwar/jfbuild/src/polymost.c
// Function: resizeglcheck
void resizeglcheck (void)
{
	if (glredbluemode < lastglredbluemode) {
		glox1 = -1;
		glfunc.glColorMask(1,1,1,1);
	} else if (glredbluemode != lastglredbluemode) {
		redblueclearcnt = 0;
	}
	lastglredbluemode = glredbluemode;

#if (USE_OPENGL != USE_GLES2)
	if (lastglpolygonmode != glpolygonmode)
	{
		lastglpolygonmode = glpolygonmode;
		switch(glpolygonmode)
		{
			default:
			case 0: glfunc.glPolygonMode(GL_FRONT_AND_BACK,GL_FILL); break;
			case 1: glfunc.glPolygonMode(GL_FRONT_AND_BACK,GL_LINE); break;
			case 2: glfunc.glPolygonMode(GL_FRONT_AND_BACK,GL_POINT); break;
		}
	}
#endif

	if ((glox1 != windowx1) || (gloy1 != windowy1) || (glox2 != windowx2) || (gloy2 != windowy2))
	{
		glox1 = windowx1; gloy1 = windowy1;
		glox2 = windowx2; gloy2 = windowy2;

		glfunc.glViewport(windowx1,yres-(windowy2+1),windowx2-windowx1+1,windowy2-windowy1+1);
	}
}

// Assembly:
pushq %rax
movl 0x5ac9b1(%rip), %eax    # 0x5f3980
cmpl 0x5ac9fb(%rip), %eax    # 0x5f39d0
jge 0x46ffc
movl $0xbf800000, 0x5ac9e7(%rip) # imm = 0xBF800000
leaq 0x5ac758(%rip), %rax    # 0x5f3740
pushq $0x1
popq %rcx
movl %ecx, %edi
movl %ecx, %esi
movl %ecx, %edx
callq *0x10(%rax)
movl 0x5ac986(%rip), %eax    # 0x5f3980
jmp 0x47005
je 0x47005
andl $0x0, 0x5aca47(%rip)    # 0x5f3a4c
movl %eax, 0x5ac9c5(%rip)    # 0x5f39d0
movl 0x5ac98f(%rip), %eax    # 0x5f39a0
cmpl %eax, 0x5ac9b5(%rip)    # 0x5f39cc
je 0x47047
movl %eax, 0x5ac9ad(%rip)    # 0x5f39cc
leaq 0x5ac71a(%rip), %rcx    # 0x5f3740
xorl %edx, %edx
cmpl $0x1, %eax
setne %dl
addl $0x1b01, %edx           # imm = 0x1B01
cmpl $0x2, %eax
movl $0x1b00, %esi           # imm = 0x1B00
cmovnel %edx, %esi
movl $0x408, %edi            # imm = 0x408
callq *0x38(%rcx)
leaq 0x383d22(%rip), %rax    # 0x3cad70
movl (%rax), %edi
cvtsi2ss %edi, %xmm0
movss 0x5ac96c(%rip), %xmm1   # 0x5f39c8
ucomiss %xmm0, %xmm1
leaq 0x385b1a(%rip), %rax    # 0x3ccb80
movl (%rax), %eax
cvtsi2ss %eax, %xmm1
jne 0x47070
jnp 0x4707b
leaq 0x3b9f69(%rip), %rcx    # 0x400fe0
movl (%rcx), %edx
jmp 0x470c0
movss 0x5ac9cd(%rip), %xmm2   # 0x5f3a50
ucomiss %xmm1, %xmm2
leaq 0x3b9f53(%rip), %rcx    # 0x400fe0
movl (%rcx), %edx
jne 0x470c0
jp 0x470c0
cvtsi2ss %edx, %xmm2
movss 0x5ac9b5(%rip), %xmm3   # 0x5f3a54
ucomiss %xmm2, %xmm3
jne 0x470c0
jp 0x470c0
leaq 0x3b9f37(%rip), %rcx    # 0x400fe4
cvtsi2ssl (%rcx), %xmm2
movss 0x5ac99f(%rip), %xmm3   # 0x5f3a58
ucomiss %xmm2, %xmm3
jne 0x470c0
jnp 0x47119
cvtsi2ss %edx, %xmm2
movss %xmm0, 0x5ac8fc(%rip)   # 0x5f39c8
movss %xmm1, 0x5ac97c(%rip)   # 0x5f3a50
movss %xmm2, 0x5ac978(%rip)   # 0x5f3a54
leaq 0x3b9f01(%rip), %rcx    # 0x400fe4
movl (%rcx), %ecx
cvtsi2ss %ecx, %xmm0
movss %xmm0, 0x5ac967(%rip)   # 0x5f3a58
leaq 0x5ac648(%rip), %rsi    # 0x5f3740
movq 0x80(%rsi), %r8
leaq 0x55f2e(%rip), %r9      # 0x9d034
movl %ecx, %esi
notl %esi
addl (%r9), %esi
subl %edi, %edx
incl %edx
subl %eax, %ecx
incl %ecx
popq %rax
jmpq *%r8
popq %rax
retq