LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_c_makefile_star2_O3/jonof[P]jftekwar/jfbuild/src/build.c
// Function: movewalls
int movewalls(int start, int offs)
{
	int i;

	if (offs < 0)  //Delete
	{
		for(i=start;i<numwalls+offs;i++)
			Bmemcpy(&wall[i],&wall[i-offs],sizeof(walltype));
	}
	else if (offs > 0)  //Insert
	{
		for(i=numwalls+offs-1;i>=start+offs;i--)
			Bmemcpy(&wall[i],&wall[i-offs],sizeof(walltype));
	}
	numwalls += offs;
	for(i=0;i<numwalls;i++)
	{
		if (wall[i].nextwall >= start) wall[i].nextwall += offs;
		if (wall[i].point2 >= start) wall[i].point2 += offs;
	}
	return(0);
}

// Assembly:
leaq 0x3f9576(%rip), %rax    # 0x416c68
testl %esi, %esi
js 0x1d756
movzwl (%rax), %eax
je 0x1d79c
movswl %ax, %ecx
cmpl %edi, %ecx
jle 0x1d79c
leal (%rsi,%rdi), %r8d
addl %esi, %ecx
movslq %ecx, %rcx
movl %esi, %edx
movslq %r8d, %r8
shlq $0x5, %rdx
negq %rdx
movq %rcx, %r9
shlq $0x5, %r9
leaq 0x19b323(%rip), %r10    # 0x1b8a50
addq %r10, %r9
addq $-0x20, %r9
decq %rcx
movaps (%r9,%rdx), %xmm0
movaps 0x10(%r9,%rdx), %xmm1
movaps %xmm1, 0x10(%r9)
movaps %xmm0, (%r9)
addq $-0x20, %r9
cmpq %r8, %rcx
jg 0x1d734
jmp 0x1d79c
movswl (%rax), %eax
leal (%rax,%rsi), %ecx
cmpl %edi, %ecx
jle 0x1d79c
movslq %eax, %rcx
movslq %edi, %rdx
movslq %esi, %r8
addq %r8, %rcx
shlq $0x5, %r8
negq %r8
subq %rdx, %rcx
shlq $0x5, %rdx
addq 0x75877(%rip), %rdx     # 0x92ff8
movaps (%rdx,%r8), %xmm0
movaps 0x10(%rdx,%r8), %xmm1
movaps %xmm1, 0x10(%rdx)
movaps %xmm0, (%rdx)
addq $0x20, %rdx
decq %rcx
jne 0x1d781
addl %esi, %eax
leaq 0x3f94c3(%rip), %rcx    # 0x416c68
movw %ax, (%rcx)
testw %ax, %ax
jle 0x1d7ed
movzwl %ax, %eax
shll $0x5, %eax
xorl %ecx, %ecx
leaq 0x19b294(%rip), %rdx    # 0x1b8a50
movswl 0xa(%rdx,%rcx), %r8d
cmpl %edi, %r8d
jl 0x1d7d0
addl %esi, %r8d
movw %r8w, 0xa(%rdx,%rcx)
movswl 0x8(%rdx,%rcx), %r8d
cmpl %edi, %r8d
jl 0x1d7e4
addl %esi, %r8d
movw %r8w, 0x8(%rdx,%rcx)
addq $0x20, %rcx
cmpq %rcx, %rax
jne 0x1d7bc
xorl %eax, %eax
retq
// File: /workspace/github_c_makefile_star2_O3/jonof[P]jftekwar/jfbuild/src/build.c
// Function: numloopsofsector
int numloopsofsector(short sectnum)
{
	int i, numloops, startwall, endwall;

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

// Assembly:
movslq %edi, %rax
leaq (%rax,%rax,4), %rax
leaq 0x226262(%rip), %rdx    # 0x243a60
movswq 0x2(%rdx,%rax,8), %rcx
testq %rcx, %rcx
jle 0x1d849
leaq (%rdx,%rax,8), %rax
movswq (%rax), %rdx
addq %rdx, %rcx
movq %rdx, %rax
shlq $0x5, %rax
leaq 0x19b22e(%rip), %rsi    # 0x1b8a50
addq %rax, %rsi
addq $0x8, %rsi
xorl %eax, %eax
movswq (%rsi), %rdi
xorl %r8d, %r8d
cmpq %rdi, %rdx
setg %r8b
addl %r8d, %eax
incq %rdx
addq $0x20, %rsi
cmpq %rcx, %rdx
jl 0x1d82b
retq
xorl %eax, %eax
retq
// File: /workspace/github_c_makefile_star2_O3/jonof[P]jftekwar/jfbuild/src/build.c
// Function: getfilenames
int getfilenames(char *path, char *kind)
{
	CACHE1D_FIND_REC *r;
	int type = 0;

	if (pathsearchmode == PATHSEARCH_GAME && grponlymode) {
		type = CACHE1D_OPT_NOSTACK;
	}

	clearfilenames();
	finddirs = klistpath(path,"*",CACHE1D_FIND_DIR|CACHE1D_FIND_DRIVE|type);
	findfiles = klistpath(path,kind,CACHE1D_FIND_FILE|type);
	for (r = finddirs; r; r=r->next) numdirs++;
	for (r = findfiles; r; r=r->next) numfiles++;

	finddirshigh = finddirs;
	findfileshigh = findfiles;
	currentlist = 0;
	if (findfileshigh) currentlist = 1;

	return(0);
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq %rsi, %rbx
movq %rdi, %r14
leaq 0x196e9f(%rip), %rax    # 0x1b4700
xorl %r12d, %r12d
cmpl %r12d, (%rax)
sete %al
cmpl $0x0, 0x1100a7(%rip)    # 0x12d918
setne %cl
andb %al, %cl
movzbl %cl, %r15d
shll $0x8, %r15d
movq 0x15cd4b(%rip), %rdi    # 0x17a5d0
callq 0x20b90
movq 0x15cd47(%rip), %rdi    # 0x17a5d8
callq 0x20b90
movq %r12, 0x15cd3b(%rip)    # 0x17a5d8
movq %r12, 0x15cd2c(%rip)    # 0x17a5d0
movl %r12d, 0x15cd35(%rip)   # 0x17a5e0
movl %r12d, 0x15cd32(%rip)   # 0x17a5e4
leal 0x6(%r15), %edx
leaq 0x55bf4(%rip), %rsi     # 0x734b1
movq %r14, %rdi
callq 0x20ba9
movq %rax, 0x15cd04(%rip)    # 0x17a5d0
incl %r15d
movq %r14, %rdi
movq %rbx, %rsi
movl %r15d, %edx
callq 0x20ba9
movq %rax, 0x15ccf4(%rip)    # 0x17a5d8
movq 0x15cce5(%rip), %rcx    # 0x17a5d0
testq %rcx, %rcx
je 0x1d90a
movl 0x15ccea(%rip), %edx    # 0x17a5e0
movq %rcx, %rsi
incl %edx
movq 0x10(%rsi), %rsi
testq %rsi, %rsi
jne 0x1d8f9
movl %edx, 0x15ccd6(%rip)    # 0x17a5e0
testq %rax, %rax
je 0x1d929
movl 0x15cccf(%rip), %edx    # 0x17a5e4
movq %rax, %rsi
incl %edx
movq 0x10(%rsi), %rsi
testq %rsi, %rsi
jne 0x1d918
movl %edx, 0x15ccbb(%rip)    # 0x17a5e4
movq %rcx, 0x15ccb8(%rip)    # 0x17a5e8
movq %rax, 0x15ccb9(%rip)    # 0x17a5f0
xorl %ecx, %ecx
testq %rax, %rax
setne %cl
movl %ecx, 0x15ccb3(%rip)    # 0x17a5f8
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O3/jonof[P]jftekwar/jfbuild/src/build.c
// Function: GetWallZPeg
int GetWallZPeg(int nWall)
{
	int z=0, nSector, nNextSector;

	nSector = sectorofwall((short)nWall);
	nNextSector = wall[nWall].nextsector;
	if (nNextSector == -1)
	{
			//1-sided wall
		if (wall[nWall].cstat&4) z = sector[nSector].floorz;
								  else z = sector[nSector].ceilingz;
	}
	else
	{
			//2-sided wall
		if (wall[nWall].cstat&4)
			z = sector[nSector].ceilingz;
		else
		{
			if (sector[nNextSector].ceilingz > sector[nSector].ceilingz)
				z = sector[nNextSector].ceilingz;   //top step
			if (sector[nNextSector].floorz < sector[nSector].floorz)
				z = sector[nNextSector].floorz;   //bottom step
		}
	}
	return(z);
}

// Assembly:
pushq %rbx
movl %edi, %ebx
movswl %bx, %edi
callq 0x3cfa6
movslq %ebx, %rdx
shlq $0x5, %rdx
leaq 0x19acfe(%rip), %rsi    # 0x1b8a50
movswq 0xc(%rsi,%rdx), %rcx
movzwl 0xe(%rsi,%rdx), %edx
cmpq $-0x1, %rcx
je 0x1dd93
testb $0x4, %dl
jne 0x1ddab
leaq (%rcx,%rcx,4), %rcx
leaq 0x225ced(%rip), %rdx    # 0x243a60
cltq
leaq (%rax,%rax,4), %rsi
movl 0x4(%rdx,%rcx,8), %edi
movl 0x8(%rdx,%rcx,8), %ecx
xorl %eax, %eax
cmpl 0x4(%rdx,%rsi,8), %edi
cmovgl %edi, %eax
cmpl 0x8(%rdx,%rsi,8), %ecx
cmovll %ecx, %eax
jmp 0x1ddbc
cltq
testb $0x4, %dl
je 0x1ddad
leaq (%rax,%rax,4), %rax
leaq 0x225cbb(%rip), %rcx    # 0x243a60
movl 0x8(%rcx,%rax,8), %eax
jmp 0x1ddbc
cltq
leaq (%rax,%rax,4), %rax
leaq 0x225ca8(%rip), %rcx    # 0x243a60
movl 0x4(%rcx,%rax,8), %eax
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O3/jonof[P]jftekwar/jfbuild/src/build.c
// Function: AlignWalls
void AlignWalls(int nWall0, int z0, int nWall1, int z1, int nTile)
{
	int n;

		//do the x alignment
	wall[nWall1].cstat &= ~0x0108;    //Set to non-flip
	wall[nWall1].xpanning = (unsigned char)((wall[nWall0].xpanning+(wall[nWall0].xrepeat<<3))%tilesizx[nTile]);

	z1 = GetWallZPeg(nWall1);

	for(n=(picsiz[nTile]>>4);((1<<n)<tilesizy[nTile]);n++);

	wall[nWall1].yrepeat = wall[nWall0].yrepeat;
	wall[nWall1].ypanning = (unsigned char)(wall[nWall0].ypanning+(((z1-z0)*wall[nWall0].yrepeat)>>(n+3)));
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movl %esi, %ebx
movslq %edx, %rcx
movq %rcx, %rsi
shlq $0x5, %rsi
leaq 0x19ac77(%rip), %r9     # 0x1b8a50
andw $0xfef7, 0xe(%r9,%rsi)  # imm = 0xFEF7
leaq (%r9,%rsi), %r14
movslq %edi, %rax
shlq $0x5, %rax
leaq (%r9,%rax), %r15
movzbl 0x18(%r9,%rax), %edx
movzbl 0x16(%r9,%rax), %eax
leal (%rdx,%rax,8), %eax
movslq %r8d, %r12
leaq 0x3f2217(%rip), %rdi    # 0x410020
xorl %edx, %edx
idivw (%rdi,%r12,2)
movb %dl, 0x18(%r9,%rsi)
movl %ecx, %edi
callq 0x1dd39
leaq 0x3f6a2d(%rip), %rcx    # 0x414850
movzbl (%rcx,%r12), %ecx
shrl $0x4, %ecx
leaq 0x3e39ae(%rip), %rdx    # 0x4017e0
movswl (%rdx,%r12,2), %edx
movl $0x1, %esi
shll %cl, %esi
incl %ecx
cmpl %edx, %esi
jl 0x1de37
movzbl 0x17(%r15), %edx
subl %ebx, %eax
imull %edx, %eax
addb $0x2, %cl
sarl %cl, %eax
movb %dl, 0x17(%r14)
addb 0x19(%r15), %al
movb %al, 0x19(%r14)
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
nop
// File: /workspace/github_c_makefile_star2_O3/jonof[P]jftekwar/jfbuild/src/config.c
// Function: writesetup
int writesetup(const char *fn)
{
	BFILE *fp;
	int item;

	fp = Bfopen(fn,"wt");
	if (!fp) return -1;

	tmpbrightness = brightness;
#if USE_POLYMOST
	tmprenderer = getrendermode();
#endif
#ifdef RENDERTYPEWIN
	tmpmaxrefreshfreq = win_getmaxrefreshfreq();
#endif

	for (item = 0; configspec[item].name; item++) {
		if (configspec[item].doc) {
			if (item > 0) fputs("\n", fp);
			fputs(configspec[item].doc, fp);
		}
		fputs(configspec[item].name, fp);
		fputs(" = ", fp);
		switch (configspec[item].type) {
			case type_bool: {
				fprintf(fp, "%d\n", (*(int*)configspec[item].store != 0));
				break;
			}
			case type_int: {
				fprintf(fp, "%d\n", *(int*)configspec[item].store);
				break;
			}
			case type_hex: {
				fprintf(fp, "%X\n", *(int*)configspec[item].store);
				break;
			}
			case type_fixed16: {
				fprintf(fp, "%g\n", (double)(*(int*)configspec[item].store) / 65536.0);
				break;
			}
			case type_double: {
				fprintf(fp, "%g\n", *(double*)configspec[item].store);
				break;
			}
			default: {
				fputs("?\n", fp);
				break;
			}
		}
	}

	Bfclose(fp);

	return 0;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
leaq 0x554a3(%rip), %rsi     # 0x7353c
callq 0x6ce0
testq %rax, %rax
je 0x1e1d3
movq %rax, %rbx
leaq 0x10f86b(%rip), %rax    # 0x12d91c
movswl (%rax), %eax
movl %eax, 0x85f66(%rip)     # 0xa4020
callq 0x3da64
movl %eax, 0x85f57(%rip)     # 0xa401c
leaq 0x5702d(%rip), %rbp     # 0x750f9
leaq 0x7451d(%rip), %r13     # 0x925f0
leaq 0x56fc2(%rip), %r15     # 0x7509c
xorl %r14d, %r14d
movq 0x18(%r14,%r13), %r12
testq %r12, %r12
je 0x1e106
testq %r14, %r14
je 0x1e0fb
leaq 0x59119(%rip), %rdi     # 0x7720c
movq %rbx, %rsi
callq 0x6320
movq %r12, %rdi
movq %rbx, %rsi
callq 0x6320
movq %rbp, %rdi
movq %rbx, %rsi
callq 0x6320
leaq 0x559a1(%rip), %rdi     # 0x73ab9
movq %rbx, %rsi
callq 0x6320
movl 0x8(%r14,%r13), %eax
cmpq $0x4, %rax
ja 0x1e1a2
movslq (%r15,%rax,4), %rax
addq %r15, %rax
jmpq *%rax
movq 0x10(%r14,%r13), %rax
xorl %edx, %edx
cmpl $0x0, (%rax)
setne %dl
jmp 0x1e160
movq 0x10(%r14,%r13), %rax
xorps %xmm0, %xmm0
cvtsi2sdl (%rax), %xmm0
mulsd 0x56f29(%rip), %xmm0    # 0x75080
jmp 0x1e18f
movq 0x10(%r14,%r13), %rax
movl (%rax), %edx
movq %rbx, %rdi
leaq 0x58009(%rip), %rsi     # 0x76173
jmp 0x1e17d
movq 0x10(%r14,%r13), %rax
movl (%rax), %edx
movq %rbx, %rdi
leaq 0x56f71(%rip), %rsi     # 0x750ee
xorl %eax, %eax
callq 0x61e0
jmp 0x1e1b1
movq 0x10(%r14,%r13), %rax
movsd (%rax), %xmm0
movq %rbx, %rdi
leaq 0x56f59(%rip), %rsi     # 0x750f2
movb $0x1, %al
callq 0x61e0
jmp 0x1e1b1
leaq 0x56f4d(%rip), %rdi     # 0x750f6
movq %rbx, %rsi
callq 0x6320
movq 0x20(%r14,%r13), %rbp
addq $0x20, %r14
cmpq $0x400, %r14            # imm = 0x400
jne 0x1e0dd
movq %rbx, %rdi
callq 0x6480
xorl %eax, %eax
jmp 0x1e1d8
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
nop
// File: /workspace/github_c_makefile_star2_O3/jonof[P]jftekwar/jfbuild/src/startgtk_editor.c
// Function: setup_messages_mode
static void setup_messages_mode(gboolean allowcancel)
{
    gtk_notebook_set_current_page(GTK_NOTEBOOK(controls.tabs), TAB_MESSAGES);

    // Disable all the controls on the Configuration page.
    gtk_container_foreach(GTK_CONTAINER(controls.configbox),
            foreach_gtk_widget_set_sensitive, (gpointer)FALSE);
    gtk_widget_set_sensitive(controls.alwaysshowcheck, FALSE);

    gtk_widget_set_sensitive(controls.cancelbutton, allowcancel);
    gtk_widget_set_sensitive(controls.startbutton, FALSE);
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movl %edi, %ebx
movq 0x15fb18(%rip), %r14    # 0x17e030
callq 0x6b80
movq %r14, %rdi
movq %rax, %rsi
callq 0x6140
movq %rax, %rdi
movl $0x1, %esi
callq 0x6d20
movq 0x15fafc(%rip), %r14    # 0x17e038
callq 0x6860
movq %r14, %rdi
movq %rax, %rsi
callq 0x6140
leaq 0x965(%rip), %rsi       # 0x1eeb8
movq %rax, %rdi
xorl %edx, %edx
callq 0x6870
movq 0x15fadc(%rip), %rdi    # 0x17e040
xorl %esi, %esi
callq 0x6cb0
movq 0x15fab6(%rip), %rdi    # 0x17e028
movl %ebx, %esi
callq 0x6cb0
movq 0x15faa0(%rip), %rdi    # 0x17e020
xorl %esi, %esi
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0x6cb0
// File: /workspace/github_c_makefile_star2_O3/jonof[P]jftekwar/jfbuild/src/startgtk_editor.c
// Function: startwin_close
int startwin_close(void)
{
    if (!gtkenabled) return 0;
    if (!startwin) return 1;

    quiteventonclose = FALSE;
    gtk_widget_destroy(GTK_WIDGET(startwin));
    startwin = NULL;

    while (gtk_events_pending()) {
        gtk_main_iteration();
    }

    return 0;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
leaq 0x6b0adb(%rip), %rax    # 0x6cf074
xorl %ebx, %ebx
cmpl $0x0, (%rax)
je 0x1e5eb
movq 0x15fa69(%rip), %r14    # 0x17e010
testq %r14, %r14
je 0x1e5e6
movb $0x0, 0x15fa65(%rip)    # 0x17e018
callq 0x6c90
movq %r14, %rdi
movq %rax, %rsi
callq 0x6140
movq %rax, %rdi
callq 0x6180
movq $0x0, 0x15fa3a(%rip) # 0x17e010
callq 0x6ac0
testl %eax, %eax
je 0x1e5eb
callq 0x6040
jmp 0x1e5d6
movl $0x1, %ebx
movl %ebx, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O3/jonof[P]jftekwar/jfbuild/src/startgtk_editor.c
// Function: startwin_puts
int startwin_puts(const char *str)
{
    GtkTextBuffer *textbuffer;
    GtkTextIter enditer;
    GtkTextMark *mark;
    const char *aptr, *bptr;

    if (!gtkenabled || !str) return 0;
    if (!startwin) return 1;

    textbuffer = gtk_text_view_get_buffer(GTK_TEXT_VIEW(controls.messagestext));

    gtk_text_buffer_get_end_iter(textbuffer, &enditer);
    for (aptr = bptr = str; *aptr != 0; ) {
        switch (*bptr) {
            case '\b':
                if (bptr > aptr) {
                    // Insert any normal characters seen so far.
                    gtk_text_buffer_insert(textbuffer, &enditer, (const gchar *)aptr, (gint)(bptr-aptr)-1);
                }
                gtk_text_buffer_backspace(textbuffer, &enditer, FALSE, TRUE);
                aptr = ++bptr;
                break;
            case 0:
                if (bptr > aptr) {
                    gtk_text_buffer_insert(textbuffer, &enditer, (const gchar *)aptr, (gint)(bptr-aptr));
                }
                aptr = bptr;
                break;
            default:
                bptr++;
                break;
        }
    }

    mark = gtk_text_buffer_create_mark(textbuffer, NULL, &enditer, 1);
    gtk_text_view_scroll_to_mark(GTK_TEXT_VIEW(controls.messagestext), mark, 0.0, FALSE, 0.0, 1.0);
    gtk_text_buffer_delete_mark(textbuffer, mark);

    return 0;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x58, %rsp
xorl %r12d, %r12d
testq %rdi, %rdi
je 0x1e726
leaq 0x6b0a61(%rip), %rax    # 0x6cf074
cmpl $0x0, (%rax)
je 0x1e726
cmpq $0x0, 0x15f9ec(%rip)    # 0x17e010
je 0x1e720
movq %rdi, %r14
movq 0x15fa14(%rip), %rbx    # 0x17e048
callq 0x66d0
movq %rax, %r15
movq %rbx, %rdi
movq %rax, %rsi
callq 0x6140
movq %rax, %rdi
callq 0x6260
movq %rax, %rbx
leaq 0x8(%rsp), %rsi
movq %rax, %rdi
callq 0x6ae0
movb (%r14), %al
testb %al, %al
je 0x1e6cf
leaq 0x8(%rsp), %r12
movq %r14, %rdx
testb %al, %al
je 0x1e6a8
movzbl %al, %eax
cmpl $0x8, %eax
jne 0x1e6c2
cmpq %rdx, %r14
jbe 0x1e691
movl %edx, %ecx
notl %ecx
addl %r14d, %ecx
movq %rbx, %rdi
movq %r12, %rsi
callq 0x68f0
movq %rbx, %rdi
movq %r12, %rsi
xorl %edx, %edx
movl $0x1, %ecx
callq 0x65a0
incq %r14
jmp 0x1e6bd
cmpq %rdx, %r14
jbe 0x1e6bd
movl %r14d, %ecx
subl %edx, %ecx
movq %rbx, %rdi
movq %r12, %rsi
callq 0x68f0
movq %r14, %rdx
jmp 0x1e6c5
incq %r14
cmpb $0x0, (%rdx)
je 0x1e6cf
movb (%r14), %al
jmp 0x1e66e
xorl %r12d, %r12d
leaq 0x8(%rsp), %rdx
movq %rbx, %rdi
xorl %esi, %esi
movl $0x1, %ecx
callq 0x6a50
movq %rax, %r14
movq 0x15f958(%rip), %rdi    # 0x17e048
movq %r15, %rsi
callq 0x6140
movsd 0x574c0(%rip), %xmm2    # 0x75bc0
xorps %xmm0, %xmm0
xorps %xmm1, %xmm1
movq %rax, %rdi
movq %r14, %rsi
xorl %edx, %edx
callq 0x6030
movq %rbx, %rdi
movq %r14, %rsi
callq 0x6050
jmp 0x1e726
movl $0x1, %r12d
movl %r12d, %eax
addq $0x58, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O3/jonof[P]jftekwar/jfbuild/src/startgtk_editor.c
// Function: startwin_run
int startwin_run(struct startwin_settings *settings)
{
    if (!gtkenabled || !startwin) return 0;

    set_settings(settings);
    setup_config_mode();
    startwinloop = TRUE;
    while (startwinloop) {
        gtk_main_iteration_do(TRUE);
    }
    setup_messages_mode(FALSE);
    set_settings(NULL);

    return retval;
}

// Assembly:
leaq 0x6b090d(%rip), %rcx    # 0x6cf074
xorl %eax, %eax
cmpl $0x0, (%rcx)
je 0x1e8cc
cmpq $0x0, 0x15f896(%rip)    # 0x17e010
je 0x1e8cc
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, 0x15f8f5(%rip)    # 0x17e080
movq 0x15f89e(%rip), %rbx    # 0x17e030
callq 0x6b80
movq %rbx, %rdi
movq %rax, %rsi
callq 0x6140
movq %rax, %rdi
xorl %esi, %esi
callq 0x6d20
movq 0x15f885(%rip), %rbx    # 0x17e038
callq 0x6860
movq %rbx, %rdi
movq %rax, %rsi
callq 0x6140
leaq 0x6ee(%rip), %rsi       # 0x1eeb8
movl $0x1, %edx
movq %rax, %rdi
callq 0x6870
movq 0x15f862(%rip), %rbx    # 0x17e040
callq 0x6c10
movq %rax, %r14
movq %rbx, %rdi
movq %rax, %rsi
callq 0x6140
movq 0x15f888(%rip), %rcx    # 0x17e080
movl 0x18(%rcx), %esi
movq %rax, %rdi
callq 0x6d30
movq 0x15f836(%rip), %rdi    # 0x17e040
movl $0x1, %esi
callq 0x6cb0
movq 0x15f855(%rip), %rdi    # 0x17e070
movq %r14, %rsi
callq 0x6140
movq 0x15f856(%rip), %rcx    # 0x17e080
movl (%rcx), %esi
movq %rax, %rdi
callq 0x6d30
movq 0x15f835(%rip), %rdi    # 0x17e070
movl $0x1, %esi
callq 0x6cb0
movl $0x1, %edi
callq 0x1eaea
movq 0x15f80a(%rip), %rdi    # 0x17e060
movl $0x1, %esi
callq 0x6cb0
movq 0x15f7e9(%rip), %rdi    # 0x17e050
movl $0x1, %esi
callq 0x6cb0
movq 0x15f7b0(%rip), %rdi    # 0x17e028
movl $0x1, %esi
callq 0x6cb0
movq 0x15f797(%rip), %rdi    # 0x17e020
movl $0x1, %esi
callq 0x6cb0
movb $0x1, 0x15f7de(%rip)    # 0x17e078
movl $0x1, %edi
callq 0x63f0
cmpb $0x0, 0x15f7cd(%rip)    # 0x17e078
jne 0x1e89a
xorl %edi, %edi
callq 0x1e50b
movq $0x0, 0x15f7c1(%rip) # 0x17e080
movl 0x8575f(%rip), %eax     # 0xa4024
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O3/jonof[P]jftekwar/jfbuild/src/startgtk_editor.c
// Function: get_and_connect_signal
static GObject * get_and_connect_signal(GtkBuilder *builder, const char *name, const char *signal_name, GCallback handler)
{
    GObject *object;

    object = gtk_builder_get_object(builder, name);
    if (!object) {
        buildprintf("gtk_builder_get_object: %s not found\n", name);
        return 0;
    }
    g_signal_connect(object, signal_name, handler, NULL);
    return object;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq %rcx, %r14
movq %rdx, %r12
movq %rsi, %r15
callq 0x6820
movq %rax, %rbx
testq %rax, %rax
je 0x1e903
movq %rbx, %rdi
movq %r12, %rsi
movq %r14, %rdx
xorl %ecx, %ecx
xorl %r8d, %r8d
xorl %r9d, %r9d
callq 0x6200
jmp 0x1e914
leaq 0x573b9(%rip), %rdi     # 0x75cc3
movq %r15, %rsi
xorl %eax, %eax
callq 0x25221
movq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O3/jonof[P]jftekwar/jfbuild/src/startgtk_editor.c
// Function: on_startgtk_delete_event
static gboolean on_startgtk_delete_event(GtkWidget *widget, GdkEvent *event, gpointer user_data)
{
    (void)widget; (void)event; (void)user_data;

    startwinloop = FALSE;   // Break the loop.
    retval = STARTWIN_CANCEL;
    quitevent = quitevent || quiteventonclose;
    return TRUE;    // FALSE would let the event go through. We want the game to decide when to close.
}

// Assembly:
leaq 0x15f776(%rip), %rax    # 0x17e0a0
cmpb $0x0, (%rax)
movb $0x0, 0x15f744(%rip)    # 0x17e078
setne %cl
orb 0x15f6db(%rip), %cl     # 0x17e018
movl $0x0, 0x856dd(%rip)     # 0xa4024
andb $0x1, %cl
movb %cl, (%rax)
movl $0x1, %eax
retq
// File: /workspace/github_c_makefile_star2_O3/jonof[P]jftekwar/jfbuild/src/startgtk_editor.c
// Function: on_startbutton_clicked
static void on_startbutton_clicked(GtkButton *button, gpointer user_data)
{
    int mode = -1;
    GtkTreeIter iter;

    (void)button; (void)user_data;

    if (gtk_combo_box_get_active_iter(GTK_COMBO_BOX(controls.vmode3dcombo), &iter)) {
        gtk_tree_model_get(GTK_TREE_MODEL(controls.vmode3dlist), &iter, 1 /*index*/, &mode, -1);
    }
    if (mode >= 0) {
        settings->xdim3d = validmode[mode].xdim;
        settings->ydim3d = validmode[mode].ydim;
        settings->bpp3d = validmode[mode].bpp;
        settings->fullscreen = validmode[mode].fs;
    }
    if (gtk_combo_box_get_active_iter(GTK_COMBO_BOX(controls.vmode2dcombo), &iter)) {
        gtk_tree_model_get(GTK_TREE_MODEL(controls.vmode2dlist), &iter, 1 /*index*/, &mode, -1);
    }
    if (mode >= 0) {
        settings->xdim2d = validmode[mode].xdim;
        settings->ydim2d = validmode[mode].ydim;
    }

    settings->forcesetup = gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(controls.alwaysshowcheck));

    startwinloop = FALSE;   // Break the loop.
    retval = STARTWIN_RUN;
}

// Assembly:
pushq %r14
pushq %rbx
subq $0x28, %rsp
movl $0xffffffff, 0x4(%rsp)  # imm = 0xFFFFFFFF
movq 0x15f6f8(%rip), %r14    # 0x17e060
callq 0x6640
movq %rax, %rbx
movq %r14, %rdi
movq %rax, %rsi
callq 0x6140
leaq 0x8(%rsp), %rsi
movq %rax, %rdi
callq 0x6cc0
testl %eax, %eax
je 0x1e9fb
movq 0x15f6d5(%rip), %r14    # 0x17e068
callq 0x6440
movq %r14, %rdi
movq %rax, %rsi
callq 0x6140
leaq 0x8(%rsp), %rsi
leaq 0x4(%rsp), %r14
movq %rax, %rdi
movl $0x1, %edx
movq %r14, %rcx
movl $0xffffffff, %r8d       # imm = 0xFFFFFFFF
xorl %eax, %eax
callq 0x66b0
movslq (%r14), %rax
testq %rax, %rax
js 0x1e9fb
shlq $0x4, %rax
leaq 0x41d478(%rip), %rcx    # 0x43be50
movl (%rcx,%rax), %edx
movq 0x15f69e(%rip), %rsi    # 0x17e080
movl %edx, 0xc(%rsi)
movl 0x4(%rcx,%rax), %edx
movl %edx, 0x10(%rsi)
movzbl 0x8(%rcx,%rax), %edx
movl %edx, 0x14(%rsi)
movzbl 0x9(%rcx,%rax), %eax
movl %eax, (%rsi)
movq 0x15f64e(%rip), %rdi    # 0x17e050
movq %rbx, %rsi
callq 0x6140
leaq 0x8(%rsp), %rsi
movq %rax, %rdi
callq 0x6cc0
testl %eax, %eax
je 0x1ea51
movq 0x15f636(%rip), %rbx    # 0x17e058
callq 0x6440
movq %rbx, %rdi
movq %rax, %rsi
callq 0x6140
leaq 0x8(%rsp), %rsi
leaq 0x4(%rsp), %rcx
movq %rax, %rdi
movl $0x1, %edx
movl $0xffffffff, %r8d       # imm = 0xFFFFFFFF
xorl %eax, %eax
callq 0x66b0
movslq 0x4(%rsp), %rax
testq %rax, %rax
js 0x1ea7a
shlq $0x4, %rax
leaq 0x41d3ea(%rip), %rcx    # 0x43be50
movl (%rcx,%rax), %edx
movq 0x15f610(%rip), %rsi    # 0x17e080
movl %edx, 0x4(%rsi)
movl 0x4(%rcx,%rax), %eax
movl %eax, 0x8(%rsi)
movq 0x15f5bf(%rip), %rbx    # 0x17e040
callq 0x6c10
movq %rbx, %rdi
movq %rax, %rsi
callq 0x6140
movq %rax, %rdi
callq 0x62d0
movq 0x15f5e0(%rip), %rcx    # 0x17e080
movl %eax, 0x18(%rcx)
movb $0x0, 0x15f5ce(%rip)    # 0x17e078
movl $0x1, 0x85570(%rip)     # 0xa4024
addq $0x28, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O3/jonof[P]jftekwar/jfbuild/src/baselayer.c
// Function: bgetkey
int bgetkey(void)
{
	int c;
	if (keyfifoplc == keyfifoend) return 0;
	c = keyfifo[keyfifoplc];
	if (!keyfifo[(keyfifoplc+1)&(KEYFIFOSIZ-1)]) c = -c;
	keyfifoplc = (keyfifoplc+2)&(KEYFIFOSIZ-1);
	return c;
}

// Assembly:
movslq 0x15f066(%rip), %rcx    # 0x17e140
xorl %eax, %eax
cmpl 0x15f062(%rip), %ecx    # 0x17e144
je 0x1f10b
leaq 0x15f065(%rip), %rdx    # 0x17e150
movl (%rdx,%rcx,4), %esi
leal 0x1(%rcx), %edi
andl $0x3f, %edi
movl %esi, %eax
negl %eax
cmpl $0x0, (%rdx,%rdi,4)
cmovnel %esi, %eax
addl $0x2, %ecx
andl $0x3f, %ecx
movl %ecx, 0x15f035(%rip)    # 0x17e140
retq
// File: /workspace/github_c_makefile_star2_O3/jonof[P]jftekwar/jfbuild/src/baselayer.c
// Function: baselayer_init
int baselayer_init(void)
{
    OSD_Init();

	OSD_RegisterFunction("screencaptureformat","screencaptureformat: sets the output format for screenshots (TGA, PCX, PNG)",osdcmd_vars);

	OSD_RegisterFunction("novoxmips","novoxmips: turn off/on the use of mipmaps when rendering 8-bit voxels",osdcmd_vars);
	OSD_RegisterFunction("usevoxels","usevoxels: enable/disable automatic sprite->voxel rendering",osdcmd_vars);
	OSD_RegisterFunction("usegammabrightness","usegammabrightness: set brightness using system gamma (2), shader (1), or palette (0)",osdcmd_vars);
	OSD_RegisterFunction("listvidmodes","listvidmodes [bpp|win|fs]: show all available video mode combinations",osdcmd_listvidmodes);

#if USE_POLYMOST
	OSD_RegisterFunction("setrendermode","setrendermode <number>: sets the engine's rendering mode.\n"
			"Mode numbers are:\n"
			"   0 - Classic Build software\n"
			"   1 - Polygonal flat-shaded software\n"
			"   2 - Polygonal textured software\n"
#if USE_OPENGL
			"   3 - Polygonal OpenGL\n"
#endif
			,
			osdfunc_setrendermode);
#endif //USE_POLYMOST

#if defined(DEBUGGINGAIDS) && USE_POLYMOST && USE_OPENGL
	OSD_RegisterFunction("hicsetpalettetint","hicsetpalettetint: sets palette tinting values",osdcmd_hicsetpalettetint);
#endif

	return 0;
}

// Assembly:
pushq %rbx
callq 0x4b41a
leaq 0x56bee(%rip), %rdi     # 0x75d28
leaq 0x56bfb(%rip), %rsi     # 0x75d3c
leaq 0x82(%rip), %rbx        # 0x1f1ca
movq %rbx, %rdx
callq 0x4b4d8
leaq 0x56c31(%rip), %rdi     # 0x75d88
leaq 0x56c34(%rip), %rsi     # 0x75d92
movq %rbx, %rdx
callq 0x4b4d8
leaq 0x56c6b(%rip), %rdi     # 0x75dd8
leaq 0x56c6e(%rip), %rsi     # 0x75de2
movq %rbx, %rdx
callq 0x4b4d8
leaq 0x560fd(%rip), %rdi     # 0x75280
leaq 0x56c94(%rip), %rsi     # 0x75e1e
movq %rbx, %rdx
callq 0x4b4d8
leaq 0x56cdb(%rip), %rdi     # 0x75e74
leaq 0x56ce1(%rip), %rsi     # 0x75e81
leaq 0x1ff(%rip), %rdx       # 0x1f3a6
callq 0x4b4d8
leaq 0x56d14(%rip), %rdi     # 0x75ec7
leaq 0x56d1b(%rip), %rsi     # 0x75ed5
leaq 0x340(%rip), %rdx       # 0x1f501
callq 0x4b4d8
xorl %eax, %eax
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O3/jonof[P]jftekwar/jfbuild/src/baselayer.c
// Function: osdcmd_listvidmodes
static int osdcmd_listvidmodes(const osdfuncparm_t *parm)
{
	int filterbpp = -1, filterfs = -1, found = 0;

	for (int i = 0; i < parm->numparms; i++) {
		if (strcasecmp(parm->parms[i], "win") == 0) {
			filterfs = 0;
		} else if (strcasecmp(parm->parms[i], "fs") == 0) {
			filterfs = 1;
		} else {
			char *e = NULL;
			long l = strtol(parm->parms[i], &e, 10);
			if (!e || *e != 0) return OSDCMD_SHOWHELP;
			filterbpp = (int)l;
		}
	}

	for (int i = 0; i < validmodecnt; i++) {
		if (filterbpp >= 0 && validmode[i].bpp != filterbpp) continue;
		if (filterfs >= 0 && (validmode[i].fs & 1) != filterfs) continue;
		buildprintf(" %4dx%-4d %d-bit %s\n", validmode[i].xdim, validmode[i].ydim,
			validmode[i].bpp, (validmode[i].fs & 1) ? "fullscreen" : "windowed");
		found++;
	}
	buildprintf("%d modes identified\n", found);
	return OSDCMD_OK;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movl (%rdi), %r15d
testl %r15d, %r15d
jle 0x1f44a
movq %rdi, %r14
movl $0xffffffff, %r13d      # imm = 0xFFFFFFFF
xorl %r12d, %r12d
movl $0xffffffff, %ebx       # imm = 0xFFFFFFFF
movq 0x10(%r14), %rax
movq (%rax,%r12,8), %rbp
movq %rbp, %rdi
leaq 0x56c30(%rip), %rsi     # 0x76010
callq 0x6880
testl %eax, %eax
je 0x1f432
movq %rbp, %rdi
leaq 0x56c21(%rip), %rsi     # 0x76014
callq 0x6880
testl %eax, %eax
je 0x1f437
movq $0x0, (%rsp)
movq %rbp, %rdi
movq %rsp, %rsi
movl $0xa, %edx
callq 0x6940
movq %rax, %rbx
movq (%rsp), %rax
testq %rax, %rax
je 0x1f4ed
cmpb $0x0, (%rax)
jne 0x1f4ed
movl (%r14), %r15d
jmp 0x1f43d
xorl %r13d, %r13d
jmp 0x1f43d
movl $0x1, %r13d
incq %r12
movslq %r15d, %rax
cmpq %rax, %r12
jl 0x1f3ce
jmp 0x1f455
movl $0xffffffff, %ebx       # imm = 0xFFFFFFFF
movl $0xffffffff, %r13d      # imm = 0xFFFFFFFF
leaq 0x33e454(%rip), %r12    # 0x35d8b0
movl (%r12), %eax
movl $0x0, %r14d
testl %eax, %eax
jle 0x1f4d8
leaq 0x41c9df(%rip), %rbp    # 0x43be50
addq $0x9, %rbp
xorl %r15d, %r15d
xorl %r14d, %r14d
testl %ebx, %ebx
js 0x1f487
movzbl -0x1(%rbp), %ecx
cmpl %ecx, %ebx
jne 0x1f4c9
movzbl (%rbp), %ecx
andl $0x1, %ecx
testl %r13d, %r13d
js 0x1f498
cmpl %ecx, %r13d
jne 0x1f4c9
leaq 0x56b8d(%rip), %r8      # 0x7602c
testb %cl, %cl
je 0x1f4aa
leaq 0x55ca1(%rip), %r8      # 0x7514b
movl -0x9(%rbp), %esi
movl -0x5(%rbp), %edx
movzbl -0x1(%rbp), %ecx
leaq 0x56b5c(%rip), %rdi     # 0x76017
xorl %eax, %eax
callq 0x25221
incl %r14d
movl (%r12), %eax
incq %r15
movslq %eax, %rcx
addq $0x10, %rbp
cmpq %rcx, %r15
jl 0x1f47b
leaq 0x56b56(%rip), %rdi     # 0x76035
movl %r14d, %esi
xorl %eax, %eax
callq 0x25221
xorl %eax, %eax
jmp 0x1f4f2
movl $0x1, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/jonof[P]jftekwar/jfbuild/src/baselayer.c
// Function: osdfunc_setrendermode
static int osdfunc_setrendermode(const osdfuncparm_t *parm)
{
	int m;
	char *p;

	char *modestrs[] = {
		"classic software", "polygonal flat-shaded software",
		"polygonal textured software", "polygonal OpenGL"
	};

	if (parm->numparms != 1) return OSDCMD_SHOWHELP;
	m = (int)strtol(parm->parms[0], &p, 10);

	if (m < 0 || m > 3 || *p) return OSDCMD_SHOWHELP;

	setrendermode(m);
	buildprintf("Rendering method changed to %s\n", modestrs[ getrendermode() ] );

	return OSDCMD_OK;
}

// Assembly:
pushq %rbx
subq $0x10, %rsp
movl $0x1, %ebx
cmpl $0x1, (%rdi)
jne 0x1f561
movq 0x10(%rdi), %rax
movq (%rax), %rdi
leaq 0x8(%rsp), %rsi
movl $0xa, %edx
callq 0x6940
cmpl $0x3, %eax
ja 0x1f561
movq 0x8(%rsp), %rcx
cmpb $0x0, (%rcx)
jne 0x1f561
movl %eax, %edi
callq 0x3da34
callq 0x3da64
cltq
leaq 0x56b8a(%rip), %rcx     # 0x760d4
movslq (%rcx,%rax,4), %rsi
addq %rcx, %rsi
leaq 0x56b4f(%rip), %rdi     # 0x760a7
xorl %ebx, %ebx
xorl %eax, %eax
callq 0x25221
movl %ebx, %eax
addq $0x10, %rsp
popq %rbx
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O3/jonof[P]jftekwar/jfbuild/src/cache1d.c
// Function: initcache
void initcache(void *dacachestart, size_t dacachesize)
{
	int i;

	for(i=1;i<200;i++) lockrecip[i] = (1<<28)/(200-i);

	cachestart = ((intptr_t)dacachestart + 15) & ~15;
	cachesize = (dacachesize - ((-(intptr_t)dacachestart) & 15)) & ~15;

	cac[0].leng = cachesize;
	cac[0].lock = &zerochar;
	cacnum = 1;

	buildprintf("initcache(): Initialised with %zu bytes\n", cachesize);
}

// Assembly:
movl $0xc6, %ecx
xorl %r8d, %r8d
movdqa 0x54b64(%rip), %xmm0    # 0x740e0
movdqa 0x54b6c(%rip), %xmm1    # 0x740f0
movdqa 0x56b64(%rip), %xmm2    # 0x760f0
pshufd $0xf5, %xmm2, %xmm3     # xmm3 = xmm2[1,1,3,3]
leaq 0x15ee38(%rip), %r9     # 0x17e3d0
movq %r8, %xmm4
pshufd $0x44, %xmm4, %xmm4     # xmm4 = xmm4[0,1,0,1]
por %xmm0, %xmm4
pxor %xmm1, %xmm4
movdqa %xmm2, %xmm5
pcmpgtd %xmm4, %xmm5
pshufd $0xf5, %xmm4, %xmm4     # xmm4 = xmm4[1,1,3,3]
pcmpeqd %xmm3, %xmm4
pand %xmm5, %xmm4
movd %xmm4, %eax
testb $0x1, %al
je 0x1f5da
leal 0x1(%rcx), %r10d
movl $0x10000000, %eax       # imm = 0x10000000
xorl %edx, %edx
divl %r10d
movl %eax, 0x4(%r9,%r8,4)
pextrw $0x4, %xmm4, %eax
testb $0x1, %al
je 0x1f5f1
movl $0x10000000, %eax       # imm = 0x10000000
xorl %edx, %edx
divl %ecx
movl %eax, 0x8(%r9,%r8,4)
addq $0x2, %r8
addl $-0x2, %ecx
cmpq $0xc8, %r8
jne 0x1f598
leaq 0xf(%rdi), %rax
andq $-0x10, %rax
movq %rax, 0x15eda8(%rip)    # 0x17e3b8
negl %edi
andl $0xf, %edi
subq %rdi, %rsi
andq $-0x10, %rsi
movq %rsi, 0x15f0cd(%rip)    # 0x17e6f0
movq %rsi, 0x15f0de(%rip)    # 0x17e708
leaq 0x15ed83(%rip), %rax    # 0x17e3b4
movq %rax, 0x15f0d8(%rip)    # 0x17e710
movl $0x1, 0x15ed7e(%rip)    # 0x17e3c0
leaq 0x56ac7(%rip), %rdi     # 0x76110
xorl %eax, %eax
jmp 0x25221
// File: /workspace/github_c_makefile_star2_O3/jonof[P]jftekwar/jfbuild/src/cache1d.c
// Function: reportandexit
static void reportandexit(char *errormessage)
{
    int i;
    size_t j;

    j = 0;
    for(i=0;i<cacnum;i++)
    {
        buildprintf("%d- ",i);
        if (cac[i].hand) {
            buildprintf("ptr: 0x%p, ",*cac[i].hand);
        } else {
            buildprintf("ptr: NULL, ");
        }
        buildprintf("leng: %zu, ",cac[i].leng);
        if (cac[i].lock) {
            buildprintf("lock: %d\n",*cac[i].lock);
        } else {
            buildprintf("lock: NULL\n");
        }
        j += cac[i].leng;
    }
	buildprintf("Cachesize = %zu\n",cachesize);
	buildprintf("Cacnum = %d\n",cacnum);
	buildprintf("Cache length sum = %zu\n",j);
	buildprintf("ERROR: %s\n",errormessage);
	exit(0);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdi, (%rsp)
cmpl $0x0, 0x15ea30(%rip)    # 0x17e3c0
jle 0x1fa39
leaq 0x15ed73(%rip), %rbx    # 0x17e710
leaq 0x568f5(%rip), %r15     # 0x76299
leaq 0x5690b(%rip), %r13     # 0x762b6
leaq 0x568ec(%rip), %r12     # 0x7629e
xorl %ebp, %ebp
xorl %r14d, %r14d
movq %r15, %rdi
movl %ebp, %esi
xorl %eax, %eax
callq 0x25221
movq -0x10(%rbx), %rax
testq %rax, %rax
je 0x1f9db
movq (%rax), %rsi
movq %r12, %rdi
xorl %eax, %eax
callq 0x25221
jmp 0x1f9e9
leaq 0x568c8(%rip), %rdi     # 0x762aa
xorl %eax, %eax
callq 0x25221
movq -0x8(%rbx), %rsi
movq %r13, %rdi
xorl %eax, %eax
callq 0x25221
movq (%rbx), %rax
testq %rax, %rax
je 0x1fa12
movzbl (%rax), %esi
leaq 0x56764(%rip), %rdi     # 0x7616d
xorl %eax, %eax
callq 0x25221
jmp 0x1fa20
leaq 0x568a9(%rip), %rdi     # 0x762c2
xorl %eax, %eax
callq 0x25221
addq -0x8(%rbx), %r14
incq %rbp
movslq 0x15e992(%rip), %rax    # 0x17e3c0
addq $0x18, %rbx
cmpq %rax, %rbp
jl 0x1f9b7
jmp 0x1fa3c
xorl %r14d, %r14d
movq 0x15ecad(%rip), %rsi    # 0x17e6f0
leaq 0x56884(%rip), %rdi     # 0x762ce
xorl %eax, %eax
callq 0x25221
movl 0x15e969(%rip), %esi    # 0x17e3c0
leaq 0x56881(%rip), %rdi     # 0x762df
xorl %eax, %eax
callq 0x25221
leaq 0x56880(%rip), %rdi     # 0x762ec
movq %r14, %rsi
xorl %eax, %eax
callq 0x25221
leaq 0x56887(%rip), %rdi     # 0x76304
movq (%rsp), %rsi
xorl %eax, %eax
callq 0x25221
xorl %edi, %edi
callq 0x66a0
// File: /workspace/github_c_makefile_star2_O3/jonof[P]jftekwar/jfbuild/src/cache1d.c
// Function: suckcache
void suckcache(void *suckptr)
{
	int i;

		//Can't exit early, because invalid pointer might be same even though lock = 0
	for(i=0;i<cacnum;i++)
		if (*cac[i].hand == suckptr)
		{
			if (*cac[i].lock) *cac[i].hand = 0;
			cac[i].lock = &zerochar;
			cac[i].hand = 0;

				//Combine empty blocks
			if ((i > 0) && (*cac[i-1].lock == 0))
			{
				cac[i-1].leng += cac[i].leng;
				cacnum--; copybuf(&cac[i+1],&cac[i],(cacnum-i)*sizeof(cactype));
			}
			else if ((i < cacnum-1) && (*cac[i+1].lock == 0))
			{
				cac[i+1].leng += cac[i].leng;
				cacnum--; copybuf(&cac[i+1],&cac[i],(cacnum-i)*sizeof(cactype));
			}
		}
}

// Assembly:
movl 0x15e92b(%rip), %eax    # 0x17e3c0
testl %eax, %eax
jle 0x1fb7b
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdi, %rbx
xorl %r15d, %r15d
leaq 0x15ec4b(%rip), %r12    # 0x17e700
leaq 0x15e8f8(%rip), %r13    # 0x17e3b4
movq %r12, %r14
xorl %ebp, %ebp
movq (%r14), %rcx
cmpq %rbx, (%rcx)
je 0x1fae4
incq %rbp
movslq 0x15e8ed(%rip), %rax    # 0x17e3c0
decl %r15d
addq $0x18, %r14
cmpq %rax, %rbp
jl 0x1fac1
jmp 0x1fb6d
movq 0x10(%r14), %rdx
cmpb $0x0, (%rdx)
je 0x1faf4
movq $0x0, (%rcx)
movq %r13, 0x10(%r14)
movq $0x0, (%r14)
testq %rbp, %rbp
je 0x1fb0d
movq -0x8(%r14), %rcx
cmpb $0x0, (%rcx)
je 0x1fb43
decl %eax
movslq %eax, %rcx
cmpq %rcx, %rbp
jge 0x1fac9
movq 0x28(%r14), %rcx
cmpb $0x0, (%rcx)
jne 0x1fac9
leaq (,%rbp,2), %rcx
addq %rbp, %rcx
leaq (%r12,%rcx,8), %rdi
addq $0x18, %rdi
movq 0x8(%r14), %rcx
addq %rcx, 0x20(%r14)
movl %eax, 0x15e87f(%rip)    # 0x17e3c0
jmp 0x1fb57
movq 0x8(%r14), %rcx
addq %rcx, -0x10(%r14)
decl %eax
movl %eax, 0x15e86d(%rip)    # 0x17e3c0
leaq 0x18(%r14), %rdi
addl %r15d, %eax
shll $0x3, %eax
leal (%rax,%rax,2), %edx
movq %r14, %rsi
callq 0x4d3c2
jmp 0x1fac9
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/jonof[P]jftekwar/jfbuild/src/cache1d.c
// Function: agecache
void agecache(void)
{
	int cnt;
	unsigned char ch;

	if (agecount >= cacnum) agecount = cacnum-1;
	if (agecount < 0) return;
	for(cnt=(cacnum>>4);cnt>=0;cnt--)
	{
		ch = (*cac[agecount].lock);
		if (((ch-2)&255) < 198)
			(*cac[agecount].lock) = ch-1;

		agecount--; if (agecount < 0) agecount = cacnum-1;
	}
}

// Assembly:
movl 0x15e842(%rip), %ecx    # 0x17e3c4
movl 0x15e838(%rip), %eax    # 0x17e3c0
cmpl %eax, %ecx
jl 0x1fb95
leal -0x1(%rax), %ecx
movl %ecx, 0x15e82f(%rip)    # 0x17e3c4
sarl $0x4, %eax
movl %ecx, %edx
orl %eax, %edx
js 0x1fbed
incl %eax
leaq 0x15eb59(%rip), %rdx    # 0x17e700
movslq %ecx, %rsi
leaq (%rsi,%rsi,2), %rsi
movq 0x10(%rdx,%rsi,8), %rsi
movb (%rsi), %dil
leal -0x2(%rdi), %r8d
cmpb $-0x3b, %r8b
ja 0x1fbcc
decb %dil
movb %dil, (%rsi)
movl 0x15e7f8(%rip), %ecx    # 0x17e3c4
leal -0x1(%rcx), %esi
movl %esi, 0x15e7ef(%rip)    # 0x17e3c4
testl %ecx, %ecx
jg 0x1fbe7
movl 0x15e7e1(%rip), %esi    # 0x17e3c0
decl %esi
movl %esi, 0x15e7dd(%rip)    # 0x17e3c4
movl %esi, %ecx
decl %eax
jg 0x1fba7
retq
// File: /workspace/github_c_makefile_star2_O3/jonof[P]jftekwar/jfbuild/src/cache1d.c
// Function: addsearchpath
int addsearchpath(const char *p)
{
	struct stat st;
	char *s;
	searchpath_t *srch;

	if (Bstat(p, &st) < 0) {
		if (errno == ENOENT) return -2;
		return -1;
	}
	if (!(st.st_mode & BS_IFDIR)) return -1;

	srch = (searchpath_t*)malloc(sizeof(searchpath_t));
	if (!srch) return -1;

	srch->next    = searchpathhead;
	srch->pathlen = strlen(p)+1;
	srch->path    = (char*)malloc(srch->pathlen + 1);
	if (!srch->path) {
		free(srch);
		return -1;
	}
	strcpy(srch->path, p);
	for (s=srch->path; *s; s++) ;
	s--;
	if (s<srch->path || toupperlookup[(int)(unsigned char)*s] != '/') strcat(srch->path, "/");

	searchpathhead = srch;
	if (srch->pathlen > maxsearchpathlen) maxsearchpathlen = srch->pathlen;
	buildprintf("Added %s to search path.\n", srch->path);

	return 0;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x90, %rsp
movq %rdi, %r12
movq %rsp, %rsi
callq 0x6110
testl %eax, %eax
js 0x1fcc8
movl $0xffffffff, %ebx       # imm = 0xFFFFFFFF
testb $0x40, 0x19(%rsp)
je 0x1fcd7
movl $0x18, %edi
callq 0x69a0
testq %rax, %rax
je 0x1fcd7
movq %rax, %r14
movq 0x194aca(%rip), %rax    # 0x1b4708
movq %rax, (%r14)
movq %r12, %rdi
callq 0x6420
leaq 0x1(%rax), %r13
movq %r13, 0x10(%r14)
leaq 0x2(%rax), %rdi
callq 0x69a0
movq %rax, 0x8(%r14)
testq %rax, %rax
je 0x1fcea
movq %rax, %r15
movq %rax, %rdi
movq %r12, %rsi
callq 0x6430
leaq -0x2(%r15), %rax
cmpb $0x0, 0x2(%rax)
leaq 0x1(%rax), %rax
jne 0x1fc79
cmpq %r15, %rax
jb 0x1fc8d
cmpb $0x2f, (%rax)
je 0x1fc9c
movq %r15, %rdi
callq 0x6420
movw $0x2f, (%r15,%rax)
movq %r14, 0x194a65(%rip)    # 0x1b4708
cmpq 0x194a66(%rip), %r13    # 0x1b4710
jbe 0x1fcb3
movq %r13, 0x194a5d(%rip)    # 0x1b4710
leaq 0x5654f(%rip), %rdi     # 0x76209
xorl %ebx, %ebx
movq %r15, %rsi
xorl %eax, %eax
callq 0x25221
jmp 0x1fcd7
callq 0x6a90
xorl %ebx, %ebx
cmpl $0x2, (%rax)
sete %bl
notl %ebx
movl %ebx, %eax
addq $0x90, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
movq %r14, %rdi
callq 0x61c0
jmp 0x1fcd7
// File: /workspace/github_c_makefile_star2_O3/jonof[P]jftekwar/jfbuild/src/cache1d.c
// Function: findfrompath
int findfrompath(const char *fn, char **where)
{
	searchpath_t *sp;
	char *pfn, *ffn;
	size_t allocsiz;

	// pathsearchmode == 0: tests current dir and then the dirs of the path stack
	// pathsearchmode == 1: tests fn without modification, then like for pathsearchmode == 0
	
	if (pathsearchmode) {
		// test unmolested filename first
		if (access(fn, F_OK) >= 0) {
			*where = strdup(fn);
			return 0;
		}
	}

	for (; toupperlookup[(int)(unsigned char)*fn] == '/'; fn++);
	ffn = strdup(fn);
	if (!ffn) return -1;
	Bcorrectfilename(ffn,0);	// compress relative paths
	
	allocsiz = max(maxsearchpathlen, 2u);	// "./" (aka. curdir)
	allocsiz += strlen(ffn);
	allocsiz += 1;	// a nul
	
	pfn = (char *)malloc(allocsiz);
	if (!pfn) { free(ffn); return -1; }

	strcpy(pfn, "./");
	strcat(pfn, ffn);
	if (access(pfn, F_OK) >= 0) {
		*where = pfn;
		free(ffn);
		return 0;
	}
	
	for (sp = searchpathhead; sp; sp = sp->next) {
		strcpy(pfn, sp->path);
		strcat(pfn, ffn);
		//buildprintf("Trying %s\n", pfn);
		if (access(pfn, F_OK) >= 0) {
			*where = pfn;
			free(ffn);
			return 0;
		}
	}
	free(pfn); free(ffn);
	return -1;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
movq %rsi, %r14
movq %rdi, %r15
cmpl $0x0, 0x1949f6(%rip)    # 0x1b4700
je 0x1fd2c
xorl %ebx, %ebx
movq %r15, %rdi
xorl %esi, %esi
callq 0x6160
testl %eax, %eax
js 0x1fd2c
movq %r15, %rdi
callq 0x6060
movq %rax, (%r14)
jmp 0x1fe04
decq %r15
cmpb $0x2f, 0x1(%r15)
leaq 0x1(%r15), %r15
je 0x1fd2f
movq %r15, %rdi
callq 0x6060
movl $0xffffffff, %ebx       # imm = 0xFFFFFFFF
testq %rax, %rax
je 0x1fe04
movq %rax, %r15
movq %rax, %rdi
xorl %esi, %esi
callq 0x21fdc
movq 0x1949ac(%rip), %rax    # 0x1b4710
cmpq $0x3, %rax
movl $0x2, %r12d
cmovaeq %rax, %r12
movq %r15, %rdi
callq 0x6420
leaq (%rax,%r12), %rdi
incq %rdi
callq 0x69a0
testq %rax, %rax
je 0x1fdfc
movq %rax, %r12
movb $0x0, 0x2(%rax)
movw $0x2f2e, (%rax)         # imm = 0x2F2E
movq %rax, %rdi
movq %r15, %rsi
callq 0x6710
movq %r12, %rdi
xorl %esi, %esi
callq 0x6160
testl %eax, %eax
jns 0x1fde5
leaq 0x194951(%rip), %r13    # 0x1b4708
movq (%r13), %r13
testq %r13, %r13
je 0x1fdf4
movq 0x8(%r13), %rsi
movq %r12, %rdi
callq 0x6430
movq %r12, %rdi
movq %r15, %rsi
callq 0x6710
movq %r12, %rdi
xorl %esi, %esi
callq 0x6160
testl %eax, %eax
js 0x1fdb7
movq %r12, (%r14)
movq %r15, %rdi
callq 0x61c0
xorl %ebx, %ebx
jmp 0x1fe04
movq %r12, %rdi
callq 0x61c0
movq %r15, %rdi
callq 0x61c0
movl %ebx, %eax
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O3/jonof[P]jftekwar/jfbuild/src/cache1d.c
// Function: fopenfrompath
BFILE* fopenfrompath(const char *fn, const char *mode)
{
	int fh;
	BFILE *h;
	int bmode = 0, smode = 0;
	const char *c;

	for (c=mode; c[0]; ) {
			 if (c[0] == 'r' && c[1] == '+') { bmode = BO_RDWR; smode = BS_IREAD|BS_IWRITE; c+=2; }
		else if (c[0] == 'r')                { bmode = BO_RDONLY; smode = BS_IREAD; c+=1; }
		else if (c[0] == 'w' && c[1] == '+') { bmode = BO_RDWR|BO_CREAT|BO_TRUNC; smode = BS_IREAD|BS_IWRITE; c+=2; }
		else if (c[0] == 'w')                { bmode = BO_WRONLY|BO_CREAT|BO_TRUNC; smode = BS_IREAD|BS_IWRITE; c+=2; }
		else if (c[0] == 'a' && c[1] == '+') { bmode = BO_RDWR|BO_CREAT; smode=BS_IREAD|BS_IWRITE; c+=2; }
		else if (c[0] == 'a')                { bmode = BO_WRONLY|BO_CREAT; smode=BS_IREAD|BS_IWRITE; c+=1; }
		else if (c[0] == 'b')                { bmode |= BO_BINARY; c+=1; }
		else if (c[1] == 't')                { bmode |= BO_TEXT; c+=1; }
		else c++;
	}
	fh = openfrompath(fn,bmode,smode);
	if (fh < 0) return NULL;
	
	h = fdopen(fh,mode);
	if (!h) close(fh);

	return h;
}

// Assembly:
pushq %rbp
pushq %rbx
pushq %rax
movq %rsi, %rbx
xorl %esi, %esi
xorl %edx, %edx
movq %rbx, %rax
incq %rax
movzbl -0x1(%rax), %ecx
cmpl $0x71, %ecx
jg 0x1fe96
testl %ecx, %ecx
je 0x1fed7
cmpl $0x61, %ecx
jne 0x1fe66
leaq 0x1(%rax), %rcx
xorl %esi, %esi
cmpb $0x2b, (%rax)
sete %sil
cmoveq %rcx, %rax
addl $0x41, %esi
movl $0x180, %edx            # imm = 0x180
jmp 0x1fe66
cmpl $0x77, %ecx
je 0x1febe
cmpl $0x72, %ecx
jne 0x1fe66
movl $0x100, %edx            # imm = 0x100
cmpb $0x2b, (%rax)
movl $0x0, %esi
jne 0x1fe66
incq %rax
movl $0x180, %edx            # imm = 0x180
movl $0x2, %esi
jmp 0x1fe66
xorl %esi, %esi
cmpb $0x2b, (%rax)
sete %sil
incq %rax
addl $0x241, %esi            # imm = 0x241
movl $0x180, %edx            # imm = 0x180
jmp 0x1fe66
callq 0x1fe10
testl %eax, %eax
js 0x1fef8
movl %eax, %ebp
movl %eax, %edi
movq %rbx, %rsi
callq 0x60b0
testq %rax, %rax
jne 0x1fefa
movl %ebp, %edi
callq 0x6220
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/jonof[P]jftekwar/jfbuild/src/cache1d.c
// Function: uninitgroupfile
void uninitgroupfile(void)
{
	int i;

	for(i=numgroupfiles-1;i>=0;i--)
		if (groupfil[i] != -1)
		{
			kfree(gfilelist[i]);
			kfree(gfileoffs[i]);
			Bclose(groupfil[i]);
			groupfil[i] = -1;
		}
	numgroupfiles = 0;

	// JBF 20040111: "close" any files open in groups
	for(i=0;i<MAXOPENFILES;i++) {
		if (filegrp[i] < 254)   // JBF 20040130: not external or ZIPped
			filehan[i] = -1;
	}
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movslq 0x1943ee(%rip), %rbx    # 0x1b4718
testq %rbx, %rbx
jle 0x2037f
incq %rbx
leaq 0x83d07(%rip), %r14     # 0xa4040
leaq 0x194400(%rip), %r15    # 0x1b4740
leaq 0x194419(%rip), %r12    # 0x1b4760
cmpl $-0x1, -0x8(%r14,%rbx,4)
je 0x20376
movq -0x10(%r15,%rbx,8), %rdi
callq 0x2413d
movq -0x10(%r12,%rbx,8), %rdi
callq 0x2413d
movl -0x8(%r14,%rbx,4), %edi
callq 0x6220
movl $0xffffffff, -0x8(%r14,%rbx,4) # imm = 0xFFFFFFFF
decq %rbx
cmpq $0x1, %rbx
ja 0x20347
movl $0x0, 0x19438f(%rip)    # 0x1b4718
xorl %eax, %eax
leaq 0x1943ee(%rip), %rcx    # 0x1b4780
movdqa 0x55d66(%rip), %xmm0    # 0x76100
leaq 0x83caf(%rip), %rdx     # 0xa4050
pcmpeqd %xmm1, %xmm1
movd (%rax,%rcx), %xmm3
movdqa %xmm3, %xmm2
pmaxub %xmm0, %xmm2
pcmpeqb %xmm3, %xmm2
movd %xmm2, %esi
notb %sil
testb $0x1, %sil
je 0x203ca
movl $0xffffffff, (%rdx,%rax,4) # imm = 0xFFFFFFFF
movdqa %xmm2, %xmm3
pslld $0x8, %xmm3
pxor %xmm1, %xmm3
pextrw $0x1, %xmm3, %esi
testb $0x1, %sil
je 0x203ea
movl $0xffffffff, 0x4(%rdx,%rax,4) # imm = 0xFFFFFFFF
pshuflw $0x55, %xmm2, %xmm3     # xmm3 = xmm2[1,1,1,1,4,5,6,7]
pxor %xmm1, %xmm3
pextrw $0x2, %xmm3, %esi
testb $0x1, %sil
je 0x20406
movl $0xffffffff, 0x8(%rdx,%rax,4) # imm = 0xFFFFFFFF
psllq $0x18, %xmm2
pxor %xmm1, %xmm2
pextrw $0x3, %xmm2, %esi
testb $0x1, %sil
je 0x20422
movl $0xffffffff, 0xc(%rdx,%rax,4) # imm = 0xFFFFFFFF
addq $0x4, %rax
cmpq $0x40, %rax
jne 0x203a5
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O3/jonof[P]jftekwar/jfbuild/src/cache1d.c
// Function: kzipopen
static int kzipopen(const char *filnam)
{
	unsigned int i;
	char newst[BMAX_PATH+4];

	newst[0] = '|';
	for(i=0;filnam[i] && (i < sizeof(newst)-2);i++) newst[i+1] = filnam[i];
	newst[i+1] = 0;
	return(kzopen(newst));
}

// Assembly:
subq $0x408, %rsp            # imm = 0x408
movb $0x7c, (%rsp)
movb (%rdi), %cl
testb %cl, %cl
je 0x2066b
movl $0x1, %edx
leaq -0x1(%rdx), %rsi
movb %cl, (%rsp,%rdx)
leaq 0x1(%rdx), %rax
cmpq $0x400, %rsi            # imm = 0x400
ja 0x20670
movb (%rdi,%rdx), %cl
movq %rax, %rdx
testb %cl, %cl
jne 0x2064b
jmp 0x20670
movl $0x1, %eax
movb $0x0, (%rsp,%rax)
movq %rsp, %rdi
callq 0x477e6
addq $0x408, %rsp            # imm = 0x408
retq