LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_c_makefile_star2_O3/jonof[P]jftekwar/jfbuild/src/cache1d.c
// Function: klseek
int klseek(int handle, int offset, int whence)
{
	int i, groupnum;

	groupnum = filegrp[handle];

	if (groupnum == 255) return((int)lseek(filehan[handle],offset,whence));
#ifdef WITHKPLIB
	else if (groupnum == 254)
	{
		if (kzcurhand != handle)
		{
			if (kztell() >= 0) { filepos[kzcurhand] = kztell(); kzclose(); }
			kzcurhand = handle;
			kzipopen(filenamsav[handle]);
			kzseek(filepos[handle],SEEK_SET);
		}
		return(kzseek(offset,whence));
	}
#endif

	if (groupfil[groupnum] != -1)
	{
		switch(whence)
		{
			case BSEEK_SET: filepos[handle] = offset; break;
			case BSEEK_END: i = filehan[handle];
				filepos[handle] = (gfileoffs[groupnum][i+1]-gfileoffs[groupnum][i])+offset;
				break;
			case BSEEK_CUR: filepos[handle] += offset; break;
		}
		return(filepos[handle]);
	}
	return(-1);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movl %edx, %ebp
movl %esi, %ebx
movslq %edi, %r15
leaq 0x193ef9(%rip), %rax    # 0x1b4780
movzbl (%r15,%rax), %eax
cmpl $0xfe, %eax
je 0x208bb
cmpl $0xff, %eax
jne 0x20930
leaq 0x837ab(%rip), %rax     # 0xa4050
movl (%rax,%r15,4), %edi
movslq %ebx, %rsi
movl %ebp, %edx
callq 0x62b0
movq %rax, %rbx
jmp 0x20994
movl %edi, %r14d
cmpl %edi, 0x8388c(%rip)     # 0xa4150
je 0x2091d
callq 0x49f1b
testl %eax, %eax
js 0x208ea
callq 0x49f1b
movslq 0x83875(%rip), %rcx     # 0xa4150
leaq 0x193ede(%rip), %rdx    # 0x1b47c0
movl %eax, (%rdx,%rcx,4)
callq 0x49f79
movl %r14d, 0x8385f(%rip)    # 0xa4150
movq %r15, %rax
shlq $0x8, %rax
leaq (%rax,%r15,4), %rax
leaq 0x193fbd(%rip), %rdi    # 0x1b48c0
addq %rax, %rdi
callq 0x20635
leaq 0x193eae(%rip), %rax    # 0x1b47c0
movl (%rax,%r15,4), %edi
xorl %esi, %esi
callq 0x49ed5
movl %ebx, %edi
movl %ebp, %esi
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
jmp 0x49ed5
leaq 0x83709(%rip), %rcx     # 0xa4040
cmpl $-0x1, (%rcx,%rax,4)
je 0x20971
testl %ebp, %ebp
je 0x20968
cmpl $0x1, %ebp
je 0x20978
cmpl $0x2, %ebp
jne 0x20989
leaq 0x836fe(%rip), %rcx     # 0xa4050
movslq (%rcx,%r15,4), %rcx
leaq 0x193e03(%rip), %rdx    # 0x1b4760
movq (%rdx,%rax,8), %rax
addl 0x4(%rax,%rcx,4), %ebx
subl (%rax,%rcx,4), %ebx
leaq 0x193e51(%rip), %rax    # 0x1b47c0
jmp 0x20983
movl $0xffffffff, %ebx       # imm = 0xFFFFFFFF
jmp 0x20994
leaq 0x193e41(%rip), %rax    # 0x1b47c0
addl (%rax,%r15,4), %ebx
movl %ebx, (%rax,%r15,4)
jmp 0x20994
leaq 0x193e30(%rip), %rax    # 0x1b47c0
movl (%rax,%r15,4), %ebx
movl %ebx, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/jonof[P]jftekwar/jfbuild/src/cache1d.c
// Function: kfilelength
int kfilelength(int handle)
{
	int i, groupnum;

	groupnum = filegrp[handle];
	if (groupnum == 255) {
		return (int)Bfilelength(filehan[handle]);
	}
#ifdef WITHKPLIB
	else if (groupnum == 254)
	{
		if (kzcurhand != handle)
		{
			if (kztell() >= 0) { filepos[kzcurhand] = kztell(); kzclose(); }
			kzcurhand = handle;
			kzipopen(filenamsav[handle]);
			kzseek(filepos[handle],SEEK_SET);
		}
		return kzfilelength();
	}
#endif
	i = filehan[handle];
	return(gfileoffs[groupnum][i+1]-gfileoffs[groupnum][i]);
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movslq %edi, %r14
leaq 0x193dd1(%rip), %rax    # 0x1b4780
movzbl (%r14,%rax), %eax
cmpl $0xfe, %eax
je 0x209db
cmpl $0xff, %eax
jne 0x20a47
leaq 0x83683(%rip), %rax     # 0xa4050
movl (%rax,%r14,4), %edi
callq 0x222ae
jmp 0x20a64
movl %edi, %ebx
cmpl %edi, 0x8376d(%rip)     # 0xa4150
je 0x20a3b
callq 0x49f1b
testl %eax, %eax
js 0x20a09
callq 0x49f1b
movslq 0x83756(%rip), %rcx     # 0xa4150
leaq 0x193dbf(%rip), %rdx    # 0x1b47c0
movl %eax, (%rdx,%rcx,4)
callq 0x49f79
movl %ebx, 0x83741(%rip)     # 0xa4150
movq %r14, %rax
shlq $0x8, %rax
leaq (%rax,%r14,4), %rax
leaq 0x193e9f(%rip), %rdi    # 0x1b48c0
addq %rax, %rdi
callq 0x20635
leaq 0x193d90(%rip), %rax    # 0x1b47c0
movl (%rax,%r14,4), %edi
xorl %esi, %esi
callq 0x49ed5
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0x49ec2
leaq 0x83602(%rip), %rcx     # 0xa4050
movslq (%rcx,%r14,4), %rcx
leaq 0x193d07(%rip), %rdx    # 0x1b4760
movq (%rdx,%rax,8), %rdx
movl 0x4(%rdx,%rcx,4), %eax
subl (%rdx,%rcx,4), %eax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O3/jonof[P]jftekwar/jfbuild/src/cache1d.c
// Function: ktell
int ktell(int handle)
{
	int groupnum;

	groupnum = filegrp[handle];

	if (groupnum == 255) return((int)lseek(filehan[handle],0,SEEK_CUR));
#ifdef WITHKPLIB
	else if (groupnum == 254)
	{
		if (kzcurhand != handle)
		{
			if (kztell() >= 0) { filepos[kzcurhand] = kztell(); kzclose(); }
			kzcurhand = handle;
			kzipopen(filenamsav[handle]);
			kzseek(filepos[handle],SEEK_SET);
		}
		return kztell();
	}
#endif
	if (groupfil[groupnum] != -1)
		return filepos[handle];
	return(-1);
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movslq %edi, %r14
leaq 0x193d06(%rip), %rax    # 0x1b4780
movzbl (%r14,%rax), %eax
cmpl $0xfe, %eax
je 0x20aad
cmpl $0xff, %eax
jne 0x20b19
leaq 0x835b8(%rip), %rax     # 0xa4050
movl (%rax,%r14,4), %edi
xorl %esi, %esi
movl $0x1, %edx
callq 0x62b0
jmp 0x20b38
movl %edi, %ebx
cmpl %edi, 0x8369b(%rip)     # 0xa4150
je 0x20b0d
callq 0x49f1b
testl %eax, %eax
js 0x20adb
callq 0x49f1b
movslq 0x83684(%rip), %rcx     # 0xa4150
leaq 0x193ced(%rip), %rdx    # 0x1b47c0
movl %eax, (%rdx,%rcx,4)
callq 0x49f79
movl %ebx, 0x8366f(%rip)     # 0xa4150
movq %r14, %rax
shlq $0x8, %rax
leaq (%rax,%r14,4), %rax
leaq 0x193dcd(%rip), %rdi    # 0x1b48c0
addq %rax, %rdi
callq 0x20635
leaq 0x193cbe(%rip), %rax    # 0x1b47c0
movl (%rax,%r14,4), %edi
xorl %esi, %esi
callq 0x49ed5
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0x49f1b
leaq 0x83520(%rip), %rcx     # 0xa4040
cmpl $-0x1, (%rcx,%rax,4)
je 0x20b33
leaq 0x193c93(%rip), %rax    # 0x1b47c0
movl (%rax,%r14,4), %eax
jmp 0x20b38
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O3/jonof[P]jftekwar/jfbuild/src/cache1d.c
// Function: kclose
void kclose(int handle)
{
	if (handle < 0) return;
	if (filegrp[handle] == 255) Bclose(filehan[handle]);
#ifdef WITHKPLIB
	else if (filegrp[handle] == 254)
	{
		kzclose();
		kzcurhand = -1;
	}
#endif
	filehan[handle] = -1;
}

// Assembly:
testl %edi, %edi
js 0x20b8f
pushq %rbx
movl %edi, %ebx
leaq 0x193c32(%rip), %rax    # 0x1b4780
movzbl (%rbx,%rax), %eax
cmpl $0xfe, %eax
je 0x20b71
cmpl $0xff, %eax
jne 0x20b80
leaq 0x834e9(%rip), %rax     # 0xa4050
movl (%rax,%rbx,4), %edi
callq 0x6220
jmp 0x20b80
callq 0x49f79
movl $0xffffffff, 0x835d0(%rip) # imm = 0xFFFFFFFF
leaq 0x834c9(%rip), %rax     # 0xa4050
movl $0xffffffff, (%rax,%rbx,4) # imm = 0xFFFFFFFF
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O3/jonof[P]jftekwar/jfbuild/src/cache1d.c
// Function: klistfree
void klistfree(CACHE1D_FIND_REC *rec)
{
	CACHE1D_FIND_REC *n;
	
	while (rec) {
		n = rec->next;
		free(rec);
		rec = n;
	}
}

// Assembly:
testq %rdi, %rdi
je 0x20ba8
pushq %rbx
movq 0x10(%rdi), %rbx
callq 0x61c0
movq %rbx, %rdi
testq %rbx, %rbx
jne 0x20b96
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O3/jonof[P]jftekwar/jfbuild/src/cache1d.c
// Function: lzwallocate
static void lzwallocate(void)
{
	lzwbuflock[0] = lzwbuflock[1] = lzwbuflock[2] = lzwbuflock[3] = lzwbuflock[4] = 200;
	if (lzwbuf1 == NULL) allocache((void **)&lzwbuf1,LZWSIZE+(LZWSIZE>>4),&lzwbuflock[0]);
	if (lzwbuf2 == NULL) allocache((void **)&lzwbuf2,(LZWSIZE+(LZWSIZE>>4))*2,&lzwbuflock[1]);
	if (lzwbuf3 == NULL) allocache((void **)&lzwbuf3,(LZWSIZE+(LZWSIZE>>4))*2,&lzwbuflock[2]);
	if (lzwbuf4 == NULL) allocache((void **)&lzwbuf4,LZWSIZE,&lzwbuflock[3]);
	if (lzwbuf5 == NULL) allocache((void **)&lzwbuf5,LZWSIZE+(LZWSIZE>>4),&lzwbuflock[4]);
}

// Assembly:
pushq %rax
movb $-0x38, 0x197626(%rip)  # 0x1b89d4
movl $0xc8c8c8c8, 0x197618(%rip) # imm = 0xC8C8C8C8
cmpq $0x0, 0x197618(%rip)    # 0x1b89d8
jne 0x213da
leaq 0x19760f(%rip), %rdi    # 0x1b89d8
leaq 0x197600(%rip), %rdx    # 0x1b89d0
movl $0x4400, %esi           # imm = 0x4400
callq 0x1f650
cmpq $0x0, 0x1975fe(%rip)    # 0x1b89e0
jne 0x213fc
leaq 0x1975f5(%rip), %rdi    # 0x1b89e0
leaq 0x1975df(%rip), %rdx    # 0x1b89d1
movl $0x8800, %esi           # imm = 0x8800
callq 0x1f650
cmpq $0x0, 0x1975e4(%rip)    # 0x1b89e8
jne 0x2141e
leaq 0x1975db(%rip), %rdi    # 0x1b89e8
leaq 0x1975be(%rip), %rdx    # 0x1b89d2
movl $0x8800, %esi           # imm = 0x8800
callq 0x1f650
cmpq $0x0, 0x1975a2(%rip)    # 0x1b89c8
jne 0x21440
leaq 0x197599(%rip), %rdi    # 0x1b89c8
leaq 0x19759d(%rip), %rdx    # 0x1b89d3
movl $0x4000, %esi           # imm = 0x4000
callq 0x1f650
cmpq $0x0, 0x197578(%rip)    # 0x1b89c0
je 0x2144c
popq %rax
retq
leaq 0x19756d(%rip), %rdi    # 0x1b89c0
leaq 0x19757a(%rip), %rdx    # 0x1b89d4
movl $0x4400, %esi           # imm = 0x4400
popq %rax
jmp 0x1f650
// File: /workspace/github_c_makefile_star2_O3/jonof[P]jftekwar/jfbuild/src/compat.c
// Function: Bstrtoken
char *Bstrtoken(char *s, char *delim, char **ptrptr, int chop)
{
	char *p, *start;

	if (!ptrptr) return NULL;
	
	if (s) p = s;
	else p = *ptrptr;

	if (!p) return NULL;

	while (*p != 0 && strchr(delim, *p)) p++;
	if (*p == 0) {
		*ptrptr = NULL;
		return NULL;
	}
	start = p;
	while (*p != 0 && !strchr(delim, *p)) p++;
	if (*p == 0) *ptrptr = NULL;
	else {
		if (chop) *(p++) = 0;
		*ptrptr = p;
	}

	return start;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
testq %rdx, %rdx
je 0x221b3
movl %ecx, %ebp
movq %rdx, %rbx
movq %rsi, %r12
movq %rdi, %r14
testq %rdi, %rdi
jne 0x22187
movq (%rbx), %r14
testq %r14, %r14
je 0x221b3
movb (%r14), %r13b
testb %r13b, %r13b
je 0x221b8
incq %r14
xorl %r15d, %r15d
movsbl %r13b, %esi
movq %r12, %rdi
callq 0x6530
testq %rax, %rax
je 0x221c0
movb (%r14), %r13b
incq %r14
testb %r13b, %r13b
jne 0x22195
jmp 0x221e0
xorl %r15d, %r15d
jmp 0x221e6
xorl %r14d, %r14d
xorl %r15d, %r15d
jmp 0x221e3
leaq -0x1(%r14), %r15
movsbl %r13b, %esi
movq %r12, %rdi
callq 0x6530
testq %rax, %rax
jne 0x221f8
movb (%r14), %r13b
incq %r14
testb %r13b, %r13b
jne 0x221c4
xorl %r14d, %r14d
movq %r14, (%rbx)
movq %r15, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq -0x1(%r14), %rax
testl %ebp, %ebp
je 0x22205
movb $0x0, (%rax)
jmp 0x221e3
movq %rax, %r14
jmp 0x221e3
// File: /workspace/github_c_makefile_star2_O3/jonof[P]jftekwar/jfbuild/src/compat.c
// Function: Bwildmatch
int Bwildmatch (const char *i, const char *j)
{
	const char *k;
	char c0, c1;

	if (!*j) return(1);
	do
	{
		if (*j == '*')
		{
			for(k=i,j++;*k;k++) if (Bwildmatch(k,j)) return(1);
			continue;
		}
		if (!*i) return(0);
		if (*j == '?') { i++; j++; continue; }
		c0 = *i; if ((c0 >= 'a') && (c0 <= 'z')) c0 -= 32;
		c1 = *j; if ((c1 >= 'a') && (c1 <= 'z')) c1 -= 32;
#ifdef _WIN32
		if (c0 == '/') c0 = '\\';
		if (c1 == '/') c1 = '\\';
#endif
		if (c0 != c1) return(0);
		i++; j++;
	} while (*j);
	return(!*i);
}

// Assembly:
movb (%rsi), %cl
testb %cl, %cl
je 0x22471
pushq %r15
pushq %r14
pushq %rbx
movq %rsi, %r14
movq %rdi, %rbx
cmpb $0x2a, %cl
jne 0x22416
incq %r14
cmpb $0x0, (%rbx)
movq %rbx, %r15
je 0x22455
movq %r15, %rdi
movq %r14, %rsi
callq 0x223d5
testl %eax, %eax
jne 0x22466
cmpb $0x0, 0x1(%r15)
leaq 0x1(%r15), %r15
jne 0x223fa
jmp 0x22455
movb (%rbx), %dl
xorl %eax, %eax
testb %dl, %dl
je 0x2246b
cmpb $0x3f, %cl
je 0x2244f
leal -0x61(%rdx), %esi
leal -0x20(%rdx), %edi
cmpb $0x1a, %sil
movzbl %dl, %edx
movzbl %dil, %esi
cmovael %edx, %esi
leal -0x61(%rcx), %edx
leal -0x20(%rcx), %edi
cmpb $0x1a, %dl
movzbl %cl, %ecx
movzbl %dil, %edx
cmovael %ecx, %edx
cmpb %dl, %sil
jne 0x2246b
incq %rbx
incq %r14
movb (%r14), %cl
testb %cl, %cl
jne 0x223ea
xorl %eax, %eax
cmpb $0x0, (%rbx)
sete %al
jmp 0x2246b
movl $0x1, %eax
popq %rbx
popq %r14
popq %r15
retq
movl $0x1, %eax
retq
// File: /workspace/github_c_makefile_star2_O3/jonof[P]jftekwar/jfbuild/src/defs.c
// Function: loaddefinitionsfile
int loaddefinitionsfile(const char *fn)
{
	scriptfile *script;

	script = scriptfile_fromfile(fn);
	if (!script) return -1;

	defsparser(script);

	scriptfile_close(script);
	scriptfile_clearsymbols();

	return 0;
}

// Assembly:
pushq %rbx
callq 0x4dbed
testq %rax, %rax
je 0x224d7
movq %rax, %rbx
movq %rax, %rdi
callq 0x224de
movq %rbx, %rdi
callq 0x4dd24
callq 0x4de82
xorl %eax, %eax
jmp 0x224dc
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O3/jonof[P]jftekwar/jfbuild/src/defs.c
// Function: getatoken
static int getatoken(scriptfile *sf, tokenlist *tl, int ntokens)
{
	char *tok;
	int i;

	if (!sf) return T_ERROR;
	tok = scriptfile_gettoken(sf);
	if (!tok) return T_EOF;

	for(i=0;i<ntokens;i++) {
		if (!Bstrcasecmp(tok, tl[i].text))
			return tl[i].tokenid;
	}

	return T_ERROR;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movl %edx, %ebp
movq %rsi, %r14
callq 0x4d468
testq %rax, %rax
je 0x24118
movl $0xffffffff, %ebx       # imm = 0xFFFFFFFF
testl %ebp, %ebp
jle 0x24124
movq %rax, %r15
movl %ebp, %r12d
shlq $0x4, %r12
xorl %r13d, %r13d
movq (%r14,%r13), %rsi
movq %r15, %rdi
callq 0x6880
testl %eax, %eax
je 0x2411f
addq $0x10, %r13
cmpq %r13, %r12
jne 0x240fd
jmp 0x24124
movl $0xfffffffe, %ebx       # imm = 0xFFFFFFFE
jmp 0x24124
movl 0x8(%r14,%r13), %ebx
movl %ebx, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O3/jonof[P]jftekwar/jfbuild/src/engine.c
// Function: animateoffs
int animateoffs(short tilenum, short fakevar)
{
	int i, k, offs;

	(void)fakevar;

	offs = 0;
	i = (totalclocklock>>((picanm[tilenum]>>24)&15));
	if ((picanm[tilenum]&63) > 0)
	{
		switch(picanm[tilenum]&192)
		{
			case 64:
				k = (i%((picanm[tilenum]&63)<<1));
				if (k < (picanm[tilenum]&63))
					offs = k;
				else
					offs = (((picanm[tilenum]&63)<<1)-k);
				break;
			case 128:
				offs = (i%((picanm[tilenum]&63)+1));
					break;
			case 192:
				offs = -(i%((picanm[tilenum]&63)+1));
		}
	}
	return(offs);
}

// Assembly:
movl 0x216785(%rip), %eax    # 0x23aa58
movslq %edi, %rcx
leaq 0x216783(%rip), %rdx    # 0x23aa60
movl (%rdx,%rcx,4), %esi
movl %esi, %ecx
shrl $0x18, %ecx
andb $0xf, %cl
sarl %cl, %eax
movl %esi, %ecx
andl $0x3f, %ecx
je 0x24316
shrl $0x6, %esi
andl $0x3, %esi
leaq 0x52c02(%rip), %rdx     # 0x76f00
movslq (%rdx,%rsi,4), %rdi
addq %rdx, %rdi
jmpq *%rdi
leal (%rcx,%rcx), %esi
cltd
idivl %esi
subl %edx, %esi
cmpl %ecx, %edx
cmovll %edx, %esi
jmp 0x2432c
xorl %esi, %esi
jmp 0x2432c
incl %ecx
cltd
idivl %ecx
movl %edx, %esi
jmp 0x2432c
incl %ecx
cltd
idivl %ecx
movl %edx, %esi
negl %esi
movl %esi, %eax
retq
// File: /workspace/github_c_makefile_star2_O3/jonof[P]jftekwar/jfbuild/src/engine.c
// Function: buildprintf
void buildprintf(const char *fmt, ...)
{
	char tmpstr[1024];
	va_list va, vac;

	va_start(va, fmt);

	va_copy(vac, va);
	vfprintf(stdout, fmt, vac);
	va_end(vac);

	if (logfile) {
		va_copy(vac, va);
		vfprintf(logfile, fmt, vac);
		va_end(vac);
	}

	va_copy(vac, va);
	vsnprintf(tmpstr, sizeof(tmpstr), fmt, vac);
	va_end(vac);

	initputs(tmpstr);
	OSD_Puts(tmpstr);

	va_end(va);
}

// Assembly:
pushq %r14
pushq %rbx
subq $0x4f8, %rsp            # imm = 0x4F8
movq %rdi, %rbx
leaq 0x40(%rsp), %rdi
movq %rsi, 0x8(%rdi)
movq %rdx, 0x10(%rdi)
movq %rcx, 0x18(%rdi)
movq %r8, 0x20(%rdi)
movq %r9, 0x28(%rdi)
testb %al, %al
je 0x25288
movaps %xmm0, 0x70(%rsp)
movaps %xmm1, 0x80(%rsp)
movaps %xmm2, 0x90(%rsp)
movaps %xmm3, 0xa0(%rsp)
movaps %xmm4, 0xb0(%rsp)
movaps %xmm5, 0xc0(%rsp)
movaps %xmm6, 0xd0(%rsp)
movaps %xmm7, 0xe0(%rsp)
movabsq $0x3000000008, %rax     # imm = 0x3000000008
movq %rax, (%rsp)
leaq 0x510(%rsp), %rax
movq %rax, 0x8(%rsp)
movq %rdi, 0x10(%rsp)
leaq 0x20(%rsp), %rdx
movq %rdi, 0x10(%rdx)
movq (%rsp), %rax
movq %rax, (%rdx)
movq 0x8(%rsp), %rax
movq %rax, 0x8(%rdx)
movq 0x6dcf8(%rip), %rax     # 0x92fc0
movq (%rax), %rdi
movq %rbx, %rsi
callq 0x6b60
movq 0x38721e(%rip), %rdi    # 0x3ac4f8
testq %rdi, %rdi
je 0x252fc
movq 0x10(%rsp), %rax
leaq 0x20(%rsp), %rdx
movq %rax, 0x10(%rdx)
movaps (%rsp), %xmm0
movaps %xmm0, (%rdx)
movq %rbx, %rsi
callq 0x6b60
movq 0x10(%rsp), %rax
leaq 0x20(%rsp), %rcx
movq %rax, 0x10(%rcx)
movaps (%rsp), %xmm0
movaps %xmm0, (%rcx)
leaq 0xf0(%rsp), %r14
movl $0x400, %esi            # imm = 0x400
movq %r14, %rdi
movq %rbx, %rdx
callq 0x6740
movq %r14, %rdi
callq 0x6e046
movq %r14, %rdi
callq 0x4cbd3
addq $0x4f8, %rsp            # imm = 0x4F8
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O3/jonof[P]jftekwar/jfbuild/src/engine.c
// Function: uninitengine
void uninitengine(void)
{
	int i;

	//buildprintf("cacheresets = %d, cacheinvalidates = %d\n", cacheresets, cacheinvalidates);

#if USE_POLYMOST && USE_OPENGL
	polymost_glreset();
	PTClear();
	PTCacheUnloadIndex();
	hicinit();
	freeallmodels();
#endif

	uninitsystem();

	if (logfile) Bfclose(logfile);
	logfile = NULL;

	if (artfil != -1) kclose(artfil);

	if (transluc != NULL) { kfree(transluc); transluc = NULL; }
	if (pic != NULL) { kfree(pic); pic = NULL; }
	if (lookups != NULL) { kfree(lookups); lookups = NULL; }
	for(i=0;i<MAXPALOOKUPS;i++)
		if (palookup[i] != NULL) { kfree(palookup[i]); palookup[i] = NULL; }
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
callq 0x50163
callq 0x6741a
callq 0x68627
callq 0x5f9e3
callq 0x5fe3c
callq 0x6de16
movq 0x386985(%rip), %rdi    # 0x3ac4f8
testq %rdi, %rdi
je 0x25b7d
callq 0x6480
movq $0x0, 0x386970(%rip) # 0x3ac4f8
movl 0x7f0b6(%rip), %edi     # 0xa4c44
cmpl $-0x1, %edi
je 0x25b98
callq 0x20b40
movq 0x192e91(%rip), %rdi    # 0x1b8a30
testq %rdi, %rdi
je 0x25bb4
callq 0x61c0
movq $0x0, 0x192e7c(%rip) # 0x1b8a30
movq 0x192e4d(%rip), %rdi    # 0x1b8a08
testq %rdi, %rdi
je 0x25bd0
callq 0x61c0
movq $0x0, 0x192e38(%rip) # 0x1b8a08
movq 0x386929(%rip), %rdi    # 0x3ac500
testq %rdi, %rdi
je 0x25bec
callq 0x61c0
movq $0x0, 0x386914(%rip) # 0x3ac500
xorl %ebx, %ebx
leaq 0x372eeb(%rip), %r14    # 0x398ae0
movq (%rbx,%r14), %rdi
testq %rdi, %rdi
je 0x25c0b
callq 0x61c0
movq $0x0, (%rbx,%r14)
addq $0x8, %rbx
cmpq $0x800, %rbx            # imm = 0x800
jne 0x25bf5
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O3/jonof[P]jftekwar/jfbuild/src/engine.c
// Function: updatesector
void updatesector(int x, int y, short *sectnum)
{
	walltype *wal;
	int i, j;

	if (inside(x,y,*sectnum) == 1) return;

	if ((*sectnum >= 0) && (*sectnum < numsectors))
	{
		wal = &wall[sector[*sectnum].wallptr];
		j = sector[*sectnum].wallnum;
		do
		{
			i = wal->nextsector;
			if (i >= 0)
				if (inside(x,y,(short)i) == 1)
				{
					*sectnum = i;
					return;
				}
			wal++;
			j--;
		} while (j != 0);
	}

	for(i=numsectors-1;i>=0;i--)
		if (inside(x,y,(short)i) == 1)
		{
			*sectnum = i;
			return;
		}

	*sectnum = -1;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdx, %rbx
movl %esi, %ebp
movl %edi, %r14d
movswl (%rdx), %r15d
movl %r15d, %edx
callq 0x367f7
cmpl $0x1, %eax
je 0x26757
movslq %r15d, %rax
testw %ax, %ax
setns %cl
movzwl 0x3a989b(%rip), %edx    # 0x3cff60
movw %dx, 0x6(%rsp)
cmpw %dx, %ax
setl %dl
andb %cl, %dl
cmpb $0x1, %dl
jne 0x26727
leaq (%rax,%rax,4), %rax
leaq 0x21d37e(%rip), %rcx    # 0x243a60
movswq (%rcx,%rax,8), %rdx
movswl 0x2(%rcx,%rax,8), %r13d
shlq $0x5, %rdx
leaq 0x192358(%rip), %rax    # 0x1b8a50
leaq (%rdx,%rax), %r12
addq $0xc, %r12
movzwl (%r12), %r15d
testw %r15w, %r15w
js 0x2671e
movswl %r15w, %edx
movl %r14d, %edi
movl %ebp, %esi
callq 0x367f7
cmpl $0x1, %eax
je 0x26753
addq $0x20, %r12
decl %r13d
jne 0x26700
movswl 0x6(%rsp), %r15d
testl %r15d, %r15d
jle 0x2674e
movl %r15d, %eax
decl %r15d
decl %eax
movswl %ax, %edx
movl %r14d, %edi
movl %ebp, %esi
callq 0x367f7
cmpl $0x1, %eax
jne 0x2672d
jmp 0x26753
movw $0xffff, %r15w          # imm = 0xFFFF
movw %r15w, (%rbx)
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/engine.c
// Function: getzsofslope
void getzsofslope(short sectnum, int dax, int day, int *ceilz, int *florz)
{
	int dx, dy, i, j;
	walltype *wal, *wal2;
	sectortype *sec;

	sec = &sector[sectnum];
	*ceilz = sec->ceilingz; *florz = sec->floorz;
	if ((sec->ceilingstat|sec->floorstat)&2)
	{
		wal = &wall[sec->wallptr]; wal2 = &wall[wal->point2];
		dx = wal2->x-wal->x; dy = wal2->y-wal->y;
		i = (nsqrtasm(dx*dx+dy*dy)<<5); if (i == 0) return;
		j = dmulscale3(dx,day-wal->y,-dy,dax-wal->x);
		if (sec->ceilingstat&2) *ceilz = (*ceilz)+scale(sec->ceilingheinum,j,i);
		if (sec->floorstat&2) *florz = (*florz)+scale(sec->floorheinum,j,i);
	}
}

// Assembly:
movq %rcx, %r9
movslq %edi, %rax
leaq (%rax,%rax,4), %rcx
leaq 0x21d2e9(%rip), %rdi    # 0x243a60
movl 0x4(%rdi,%rcx,8), %eax
movl %eax, (%r9)
movl 0x8(%rdi,%rcx,8), %eax
movl %eax, (%r8)
movl 0xc(%rdi,%rcx,8), %r10d
movzwl 0xe(%rdi,%rcx,8), %eax
movl %eax, %r11d
orl %r10d, %r11d
testb $0x2, %r11b
je 0x2688d
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
leaq (%rdi,%rcx,8), %rdi
movswq (%rdi), %rcx
shlq $0x5, %rcx
leaq 0x192295(%rip), %rbx    # 0x1b8a50
movswq 0x8(%rcx,%rbx), %r15
shlq $0x5, %r15
movslq (%r15,%rbx), %r11
movslq (%rcx,%rbx), %r14
subq %r14, %r11
movslq 0x4(%r15,%rbx), %r15
movslq 0x4(%rcx,%rbx), %r12
subq %r12, %r15
movl %r11d, %ecx
imull %r11d, %ecx
movl %r15d, %ebx
imull %ebx, %ebx
addl %ecx, %ebx
movl %ebx, %ecx
shrl $0x18, %ecx
orl $0x1000, %ecx           # imm = 0x1000
movl %ebx, %r13d
shrl $0xc, %r13d
cmpl $0x1000000, %ebx        # imm = 0x1000000
cmovael %ecx, %r13d
leaq 0x42f6f1(%rip), %rcx    # 0x455f00
movzwl (%rcx,%r13,2), %ecx
shrl %cl, %ebx
leaq 0x4318e3(%rip), %r13    # 0x458100
movzwl (%r13,%rbx,2), %ebx
shrl $0x8, %ecx
shrl %cl, %ebx
shll $0x5, %ebx
je 0x26884
movslq %edx, %rcx
subq %r12, %rcx
negq %r15
movslq %esi, %rdx
subq %r14, %rdx
imulq %r15, %rdx
imulq %r11, %rcx
addq %rdx, %rcx
shrq $0x3, %rcx
movslq %ebx, %rsi
testb $0x2, %r10b
je 0x2686c
movswq 0x12(%rdi), %rdx
movslq %ecx, %rax
imulq %rdx, %rax
cqto
idivq %rsi
addl %eax, (%r9)
movzwl 0xe(%rdi), %eax
testb $0x2, %al
je 0x26884
movswq 0x1a(%rdi), %rdx
movslq %ecx, %rax
imulq %rdx, %rax
cqto
idivq %rsi
addl %eax, (%r8)
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O3/jonof[P]jftekwar/jfbuild/src/engine.c
// Function: bunchfront
static int bunchfront(int b1, int b2)
{
	int x1b1, x2b1, x1b2, x2b2, b1f, b2f, i;

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

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

// Assembly:
movslq %edi, %r8
leaq 0x3adc65(%rip), %rdx    # 0x3d77c0
movswq (%rdx,%r8,2), %rdi
leaq 0x241f09(%rip), %r9     # 0x26ba70
movl (%r9,%rdi,4), %ecx
movslq %esi, %rsi
leaq 0x3afc4b(%rip), %r10    # 0x3d97c0
movswq (%r10,%rsi,2), %r11
leaq 0x245eff(%rip), %rax    # 0x26fa80
cmpl (%rax,%r11,4), %ecx
jg 0x29b9b
movswq (%rdx,%rsi,2), %rsi
movl (%r9,%rsi,4), %edx
movswq (%r10,%r8,2), %r8
cmpl (%rax,%r8,4), %edx
jle 0x29ba1
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
retq
cmpl %edx, %ecx
jge 0x29bbd
cmpl %edx, (%rax,%rdi,4)
jge 0x29bd3
leaq 0x3b5c1f(%rip), %rcx    # 0x3df7d0
movswq (%rcx,%rdi,2), %rdi
cmpl %edx, (%rax,%rdi,4)
jl 0x29bb1
jmp 0x29bd3
cmpl %ecx, (%rax,%rsi,4)
jge 0x29bd3
leaq 0x3b5c07(%rip), %rdx    # 0x3df7d0
movswq (%rdx,%rsi,2), %rsi
cmpl %ecx, (%rax,%rsi,4)
jl 0x29bc9
jmp 0x24143
// File: /workspace/github_c_makefile_star2_O3/jonof[P]jftekwar/jfbuild/src/engine.c
// Function: spritewallfront
static int spritewallfront(spritetype *s, int w)
{
	walltype *wal;
	int x1, y1;

	wal = &wall[w]; x1 = wal->x; y1 = wal->y;
	wal = &wall[wal->point2];
	return (dmulscale32(wal->x-x1,s->y-y1,-(s->x-x1),wal->y-y1) >= 0);
}

// Assembly:
movslq %edx, %rax
shlq $0x5, %rax
leaq 0x18af0c(%rip), %rcx    # 0x1b8a50
movslq (%rax,%rcx), %rdx
movslq 0x4(%rax,%rcx), %r8
movswq 0x8(%rax,%rcx), %rax
shlq $0x5, %rax
movslq (%rax,%rcx), %r9
subq %rdx, %r9
movslq %esi, %rsi
subq %r8, %rsi
imulq %r9, %rsi
movslq %edi, %rdi
subq %rdi, %rdx
movslq 0x4(%rax,%rcx), %rcx
subq %r8, %rcx
imulq %rdx, %rcx
xorl %eax, %eax
addq %rsi, %rcx
setns %al
retq
// File: /workspace/github_c_makefile_star2_O3/jonof[P]jftekwar/jfbuild/src/engine.c
// Function: lastwall
int lastwall(short point)
{
	int i, j, cnt;

	if ((point > 0) && (wall[point-1].point2 == point)) return(point-1);
	i = point;
	cnt = MAXWALLS;
	do
	{
		j = wall[i].point2;
		if (j == point) return(i);
		i = j;
		cnt--;
	} while (cnt > 0);
	return(point);
}

// Assembly:
leaq 0x189a5b(%rip), %rcx    # 0x1b8a50
testw %di, %di
jle 0x2f00b
leal -0x1(%rdi), %eax
movq %rax, %rdx
shlq $0x5, %rdx
cmpw %di, 0x8(%rdx,%rcx)
je 0x2f02e
movl $0x4001, %edx           # imm = 0x4001
movl %edi, %esi
movl %esi, %eax
movslq %esi, %rsi
shlq $0x5, %rsi
movswl 0x8(%rsi,%rcx), %esi
cmpw %di, %si
je 0x2f02e
decl %edx
cmpl $0x1, %edx
ja 0x2f012
movl %edi, %eax
retq
// File: /workspace/github_c_makefile_star2_O3/jonof[P]jftekwar/jfbuild/src/engine.c
// Function: loadtile
void loadtile(short tilenume)
{
	char *ptr;
	int i, dasiz;

	if ((unsigned)tilenume >= (unsigned)MAXTILES) return;
	dasiz = tilesizx[tilenume]*tilesizy[tilenume];
	if (dasiz <= 0) return;

	i = tilefilenum[tilenume];
	if (i != artfilnum)
	{
		if (artfil != -1) kclose(artfil);
		artfilnum = i;
		artfilplc = 0L;

		artfilename[7] = (i%10)+48;
		artfilename[6] = ((i/10)%10)+48;
		artfilename[5] = ((i/100)%10)+48;
		artfil = kopen4load(artfilename,0);
		faketimerhandler();
	}

	if (cachedebug) buildprintf("Tile:%d\n",tilenume);

	if (waloff[tilenume] == 0)
	{
		walock[tilenume] = 199;
		allocache((void **)&waloff[tilenume],dasiz,&walock[tilenume]);
	}

	if (artfilplc != tilefileoffs[tilenume])
	{
		klseek(artfil,tilefileoffs[tilenume]-artfilplc,BSEEK_CUR);
		faketimerhandler();
	}
	ptr = (char *)waloff[tilenume];
	kread(artfil,ptr,dasiz);
	faketimerhandler();
	artfilplc = tilefileoffs[tilenume]+dasiz;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movl %edi, %ebp
movzwl %bp, %r14d
cmpl $0x23ff, %r14d          # imm = 0x23FF
ja 0x2fde6
leal (%r14,%r14), %eax
leaq 0x3e037c(%rip), %rcx    # 0x410020
movswl (%rax,%rcx), %ecx
leaq 0x3d1b31(%rip), %rdx    # 0x4017e0
movswl (%rax,%rdx), %ebx
imull %ecx, %ebx
testl %ebx, %ebx
jle 0x2fde6
leaq 0x3f31eb(%rip), %rax    # 0x422eb0
movzbl (%r14,%rax), %r15d
cmpl %r15d, 0x3fea5f(%rip)   # 0x42e730
je 0x2fd5d
movl 0x74f67(%rip), %edi     # 0xa4c44
cmpl $-0x1, %edi
je 0x2fce7
callq 0x20b40
movl %r15d, 0x3fea42(%rip)   # 0x42e730
movl $0x0, 0x3fea3c(%rip)    # 0x42e734
imull $0xcd, %r15d, %eax
shrl $0xb, %eax
leal (%rax,%rax), %ecx
leal (%rcx,%rcx,4), %ecx
movl %r15d, %edx
subb %cl, %dl
orb $0x30, %dl
movb %dl, 0x3f3181(%rip)     # 0x422e97
leaq 0x3f3173(%rip), %rdi    # 0x422e90
leal (%rax,%rax,4), %ecx
leal (%rcx,%rcx,4), %ecx
addl %eax, %ecx
shrl $0x7, %ecx
andl $0x6, %ecx
leal (%rcx,%rcx,4), %ecx
subb %cl, %al
orb $0x30, %al
movb %al, 0x3f315e(%rip)     # 0x422e96
leal (%r15,%r15,4), %eax
leal (%r15,%rax,8), %eax
shrl $0xc, %eax
orb $0x30, %al
movb %al, 0x3f314a(%rip)     # 0x422e95
xorl %esi, %esi
callq 0x2043c
movl %eax, 0x74eec(%rip)     # 0xa4c44
callq 0xacd7
cmpb $0x0, 0x3fe9d4(%rip)    # 0x42e738
je 0x2fd76
leaq 0x47777(%rip), %rdi     # 0x774e4
movl %ebp, %esi
xorl %eax, %eax
callq 0x25221
leaq 0x369563(%rip), %r15    # 0x3992e0
cmpq $0x0, (%r15,%r14,8)
jne 0x2fd9e
leaq (%r15,%r14,8), %rdi
leaq 0x3fe9b1(%rip), %rdx    # 0x42e740
movb $-0x39, (%r14,%rdx)
addq %r14, %rdx
movl %ebx, %esi
callq 0x1f650
leaq 0x3f550b(%rip), %r12    # 0x4252b0
movl (%r12,%r14,4), %esi
subl 0x3fe985(%rip), %esi    # 0x42e734
je 0x2fdc6
movl 0x74e8d(%rip), %edi     # 0xa4c44
movl $0x1, %edx
callq 0x20872
callq 0xacd7
movq (%r15,%r14,8), %rsi
movl 0x74e74(%rip), %edi     # 0xa4c44
movl %ebx, %edx
callq 0x20684
callq 0xacd7
addl (%r12,%r14,4), %ebx
movl %ebx, 0x3fe94e(%rip)    # 0x42e734
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/jonof[P]jftekwar/jfbuild/src/engine.c
// Function: readv4wall
static int readv4wall(int fil, struct walltypev4 *wall)
{
	if (kread(fil, &wall->x, 4) != 4) return -1;
	if (kread(fil, &wall->y, 4) != 4) return -1;
	if (kread(fil, &wall->point2, 2) != 2) return -1;
	if (kread(fil, &wall->cstat, 1) != 1) return -1;
	if (kread(fil, &wall->shade, 1) != 1) return -1;
	if (kread(fil, &wall->xrepeat, 1) != 1) return -1;
	if (kread(fil, &wall->yrepeat, 1) != 1) return -1;
	if (kread(fil, &wall->xpanning, 1) != 1) return -1;
	if (kread(fil, &wall->ypanning, 1) != 1) return -1;
	if (kread(fil, &wall->picnum, 2) != 2) return -1;
	if (kread(fil, &wall->overpicnum, 2) != 2) return -1;
	if (kread(fil, &wall->nextsector1, 2) != 2) return -1;
	if (kread(fil, &wall->nextwall1, 2) != 2) return -1;
	if (kread(fil, &wall->nextsector2, 2) != 2) return -1;
	if (kread(fil, &wall->nextwall2, 2) != 2) return -1;
	if (kread(fil, &wall->tag, 4) != 4) return -1;

	wall->x = B_LITTLE32(wall->x);
	wall->y = B_LITTLE32(wall->y);
	wall->point2 = B_LITTLE16(wall->point2);
	wall->picnum = B_LITTLE16(wall->picnum);
	wall->overpicnum = B_LITTLE16(wall->overpicnum);
	wall->nextsector1 = B_LITTLE16(wall->nextsector1);
	wall->nextwall1 = B_LITTLE16(wall->nextwall1);
	wall->nextsector2 = B_LITTLE16(wall->nextsector2);
	wall->nextwall2 = B_LITTLE16(wall->nextwall2);
	wall->tag = B_LITTLE32(wall->tag);

	return 0;
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
movq %rsi, %r14
movl %edi, %ebp
movl $0x4, %edx
callq 0x20684
movl $0xffffffff, %ebx       # imm = 0xFFFFFFFF
cmpl $0x4, %eax
jne 0x316dd
leaq 0x4(%r14), %rsi
movl %ebp, %edi
movl $0x4, %edx
callq 0x20684
cmpl $0x4, %eax
jne 0x316dd
leaq 0x8(%r14), %rsi
movl %ebp, %edi
movl $0x2, %edx
callq 0x20684
cmpl $0x2, %eax
jne 0x316dd
leaq 0xa(%r14), %rsi
movl %ebp, %edi
movl $0x1, %edx
callq 0x20684
cmpl $0x1, %eax
jne 0x316dd
leaq 0xb(%r14), %rsi
movl %ebp, %edi
movl $0x1, %edx
callq 0x20684
cmpl $0x1, %eax
jne 0x316dd
leaq 0xc(%r14), %rsi
movl %ebp, %edi
movl $0x1, %edx
callq 0x20684
cmpl $0x1, %eax
jne 0x316dd
leaq 0xd(%r14), %rsi
movl %ebp, %edi
movl $0x1, %edx
callq 0x20684
cmpl $0x1, %eax
jne 0x316dd
leaq 0xe(%r14), %rsi
movl %ebp, %edi
movl $0x1, %edx
callq 0x20684
cmpl $0x1, %eax
jne 0x316dd
leaq 0xf(%r14), %rsi
movl %ebp, %edi
movl $0x1, %edx
callq 0x20684
cmpl $0x1, %eax
jne 0x316dd
leaq 0x10(%r14), %rsi
movl %ebp, %edi
movl $0x2, %edx
callq 0x20684
cmpl $0x2, %eax
jne 0x316dd
leaq 0x12(%r14), %rsi
movl %ebp, %edi
movl $0x2, %edx
callq 0x20684
cmpl $0x2, %eax
jne 0x316dd
leaq 0x14(%r14), %rsi
movl %ebp, %edi
movl $0x2, %edx
callq 0x20684
cmpl $0x2, %eax
jne 0x316dd
leaq 0x16(%r14), %rsi
movl %ebp, %edi
movl $0x2, %edx
callq 0x20684
cmpl $0x2, %eax
jne 0x316dd
leaq 0x18(%r14), %rsi
movl %ebp, %edi
movl $0x2, %edx
callq 0x20684
cmpl $0x2, %eax
jne 0x316dd
leaq 0x1a(%r14), %rsi
movl %ebp, %edi
movl $0x2, %edx
callq 0x20684
cmpl $0x2, %eax
jne 0x316dd
addq $0x1c, %r14
movl %ebp, %edi
movq %r14, %rsi
movl $0x4, %edx
callq 0x20684
xorl %ebx, %ebx
cmpl $0x4, %eax
setne %bl
negl %ebx
movl %ebx, %eax
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/jonof[P]jftekwar/jfbuild/src/engine.c
// Function: convertv5wallv6
static void convertv5wallv6(struct walltypev5 *from, struct walltypev6 *to, int i)
{
	to->x = from->x;
	to->y = from->y;
	to->point2 = from->point2;
	to->nextsector = from->nextsector1;
	to->nextwall = from->nextwall1;
	to->picnum = from->picnum;
	to->overpicnum = from->overpicnum;
	to->shade = from->shade;
	to->pal = sector[sectorofwallv5((short)i)].floorpal;
	to->cstat = from->cstat;
	to->xrepeat = from->xrepeat;
	to->yrepeat = from->yrepeat;
	to->xpanning = from->xpanning;
	to->ypanning = from->ypanning;
	to->lotag = from->lotag;
	to->hitag = from->hitag;
	to->extra = from->extra;
}

// Assembly:
movl (%rdi), %eax
movl %eax, (%rsi)
movl 0x4(%rdi), %eax
movl %eax, 0x4(%rsi)
movzwl 0x8(%rdi), %eax
movw %ax, 0x8(%rsi)
movzwl 0x16(%rdi), %eax
movw %ax, 0xa(%rsi)
movzwl 0x18(%rdi), %eax
movw %ax, 0xc(%rsi)
movzwl 0xa(%rdi), %eax
movw %ax, 0xe(%rsi)
movzwl 0xc(%rdi), %eax
movw %ax, 0x10(%rsi)
movb 0xe(%rdi), %al
movb %al, 0x12(%rsi)
movswq 0x39e83c(%rip), %rcx    # 0x3cff60
movq $-0x1, %rax
testq %rcx, %rcx
jle 0x31763
leaq 0x21232b(%rip), %r9     # 0x243a62
xorl %r8d, %r8d
movzwl -0x2(%r9), %r10d
cmpw %dx, %r10w
jg 0x31752
addw (%r9), %r10w
decl %r10d
cmpw %dx, %r10w
jge 0x31760
incq %r8
addq $0x28, %r9
cmpq %r8, %rcx
jne 0x3173a
jmp 0x31763
movq %r8, %rax
leaq (%rax,%rax,4), %rax
leaq 0x2122f2(%rip), %rcx    # 0x243a60
movb 0x1d(%rcx,%rax,8), %al
movb %al, 0x13(%rsi)
movzwl 0x10(%rdi), %eax
movw %ax, 0x14(%rsi)
movb 0x12(%rdi), %al
movb %al, 0x16(%rsi)
movb 0x13(%rdi), %al
movb %al, 0x17(%rsi)
movb 0x14(%rdi), %al
movb %al, 0x18(%rsi)
movb 0x15(%rdi), %al
movb %al, 0x19(%rsi)
movzwl 0x1e(%rdi), %eax
movw %ax, 0x1a(%rsi)
movzwl 0x20(%rdi), %eax
movw %ax, 0x1c(%rsi)
movzwl 0x22(%rdi), %eax
movw %ax, 0x1e(%rsi)
retq
// File: /workspace/github_c_makefile_star2_O3/jonof[P]jftekwar/jfbuild/src/engine.c
// Function: buildputs
void buildputs(const char *str)
{
    fputs(str, stdout);
    if (logfile) fputs(str, logfile);
    initputs(str);  // the startup window
    OSD_Puts(str);  // the onscreen-display
}

// Assembly:
pushq %rbx
movq %rdi, %rbx
movq 0x6029d(%rip), %rax     # 0x92fc0
movq (%rax), %rsi
callq 0x6320
movq 0x3797c6(%rip), %rsi    # 0x3ac4f8
testq %rsi, %rsi
je 0x32d3f
movq %rbx, %rdi
callq 0x6320
movq %rbx, %rdi
callq 0x6e046
movq %rbx, %rdi
popq %rbx
jmp 0x4cbd3
// File: /workspace/github_c_makefile_star2_O3/jonof[P]jftekwar/jfbuild/src/engine.c
// Function: clearallviews
void clearallviews(int dacol)
{
	if (qsetmode != 200) return;

#if USE_POLYMOST && USE_OPENGL
	if (rendmode == 3) {
		palette_t p;
		if (usegammabrightness) p = curpalette[dacol];
		else {
			p.r = britable[curbrightness][ curpalette[dacol].r ];
			p.g = britable[curbrightness][ curpalette[dacol].g ];
			p.b = britable[curbrightness][ curpalette[dacol].b ];
		}
		glfunc.glViewport(0,0,xdim,ydim); glox1 = -1;
		glfunc.glClearColor(((float)p.r)/255.0,
					  ((float)p.g)/255.0,
					  ((float)p.b)/255.0,
					  0);
		glfunc.glClear(GL_COLOR_BUFFER_BIT);
		return;
	}
#endif

	dacol += (dacol<<8); dacol += (dacol<<16);
	clearbuf((void*)frameplace,imageSize>>2,dacol);

	faketimerhandler();
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
cmpl $0xc8, 0x183f24(%rip)   # 0x1b8a28
jne 0x34b3a
leaq 0x5c5e43(%rip), %rax    # 0x5fa950
cmpl $0x3, (%rax)
jne 0x34b45
cmpl $0x0, 0x6fc73(%rip)     # 0xa478c
je 0x34b75
movslq %edi, %rdx
leaq 0x401e8b(%rip), %rsi    # 0x4369b0
leaq (%rsi,%rdx,4), %rax
leaq (%rsi,%rdx,4), %rcx
incq %rcx
leaq (%rsi,%rdx,4), %rdx
addq $0x2, %rdx
jmp 0x34bab
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
imull $0x1010101, %edi, %edx  # imm = 0x1010101
leaq 0x14955e(%rip), %rax    # 0x17e0b0
movq (%rax), %rdi
leaq 0x14972c(%rip), %rax    # 0x17e288
movl (%rax), %esi
sarl $0x2, %esi
callq 0x4d2d8
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
jmp 0xacd7
movslq 0x183e88(%rip), %rcx    # 0x1b8a04
movslq %edi, %rdx
leaq 0x401e2a(%rip), %rsi    # 0x4369b0
movzbl (%rsi,%rdx,4), %eax
shlq $0x8, %rcx
leaq 0x40261b(%rip), %rdi    # 0x4371b0
addq %rcx, %rdi
addq %rdi, %rax
movzbl 0x1(%rsi,%rdx,4), %ecx
addq %rdi, %rcx
movzbl 0x2(%rsi,%rdx,4), %edx
addq %rdi, %rdx
movzbl (%rax), %ebx
movzbl (%rcx), %ebp
movzbl (%rdx), %r14d
leaq 0x5c5b84(%rip), %r15    # 0x5fa740
movl 0x3d342a(%rip), %edx    # 0x407fec
movl 0x3d3428(%rip), %ecx    # 0x407ff0
xorl %edi, %edi
xorl %esi, %esi
callq *0x80(%r15)
cvtsi2sd %ebx, %xmm0
movsd 0x42511(%rip), %xmm2    # 0x770f0
divsd %xmm2, %xmm0
cvtsd2ss %xmm0, %xmm0
leaq 0x5c5dda(%rip), %rax    # 0x5fa9c8
cvtsi2sd %ebp, %xmm1
divsd %xmm2, %xmm1
cvtsd2ss %xmm1, %xmm1
cvtsi2sd %r14d, %xmm3
movl $0xbf800000, (%rax)     # imm = 0xBF800000
divsd %xmm2, %xmm3
xorps %xmm2, %xmm2
cvtsd2ss %xmm3, %xmm2
xorps %xmm3, %xmm3
callq *(%r15)
movl $0x4000, %edi           # imm = 0x4000
movq %r15, %rax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
jmpq *0x8(%rax)
// File: /workspace/github_c_makefile_star2_O3/jonof[P]jftekwar/jfbuild/src/engine.c
// Function: allocatepermanenttile
intptr_t allocatepermanenttile(short tilenume, int xsiz, int ysiz)
{
	int j, dasiz;

	if ((xsiz <= 0) || (ysiz <= 0) || ((unsigned)tilenume >= (unsigned)MAXTILES))
		return(0);

	dasiz = xsiz*ysiz;

	walock[tilenume] = 255;
	allocache((void **)&waloff[tilenume],dasiz,&walock[tilenume]);

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

	j = 15; while ((j > 1) && (pow2long[j] > xsiz)) j--;
	picsiz[tilenume] = ((unsigned char)j);
	j = 15; while ((j > 1) && (pow2long[j] > ysiz)) j--;
	picsiz[tilenume] += ((unsigned char)(j<<4));

	return(waloff[tilenume]);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movzwl %di, %r14d
xorl %eax, %eax
cmpl $0x23ff, %r14d          # imm = 0x23FF
ja 0x36366
movl %esi, %ebp
testl %esi, %esi
jle 0x36366
movl %edx, %ebx
testl %edx, %edx
jle 0x36366
movl %ebx, %esi
imull %ebp, %esi
leaq 0x3f8469(%rip), %rdx    # 0x42e740
movb $-0x1, (%r14,%rdx)
addq %r14, %rdx
leaq 0x362ffa(%rip), %r15    # 0x3992e0
leaq (%r15,%r14,8), %rdi
callq 0x1f650
movl %r14d, %eax
addl %eax, %eax
leaq 0x3d9d25(%rip), %rcx    # 0x410020
movw %bp, (%rax,%rcx)
leaq 0x3cb4da(%rip), %rcx    # 0x4017e0
movw %bx, (%rax,%rcx)
leaq 0x20474f(%rip), %rax    # 0x23aa60
movl $0x0, (%rax,%r14,4)
movl $0x10, %edx
leaq 0x6e48b(%rip), %rcx     # 0xa47b0
leal -0x1(%rdx), %eax
cmpl %ebp, (%rcx,%rax,4)
jle 0x36339
decl %edx
cmpl $0x2, %edx
ja 0x36325
movl $0x1, %eax
movl $0x10, %esi
leal -0x1(%rsi), %edx
cmpl %ebx, (%rcx,%rdx,4)
jle 0x36352
decl %esi
cmpl $0x2, %esi
ja 0x3633e
movl $0x1, %edx
shlb $0x4, %dl
addb %al, %dl
leaq 0x3de4f2(%rip), %rax    # 0x414850
movb %dl, (%r14,%rax)
movq (%r15,%r14,8), %rax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/jonof[P]jftekwar/jfbuild/src/engine.c
// Function: qloadkvx
int qloadkvx(int voxindex, char *filename)
{
	int i, fil, dasiz, lengcnt, lengtot;
	unsigned char *ptr;

	if ((fil = kopen4load(filename,0)) == -1) return -1;

	lengcnt = 0;
	lengtot = kfilelength(fil);

	for(i=0;i<MAXVOXMIPS;i++)
	{
		kread(fil,&dasiz,4); dasiz = B_LITTLE32(dasiz);
			//Must store filenames to use cacheing system :(
		voxlock[voxindex][i] = 200;
		allocache((void **)&voxoff[voxindex][i],dasiz,&voxlock[voxindex][i]);
		ptr = (unsigned char *)voxoff[voxindex][i];
		kread(fil,ptr,dasiz);

		lengcnt += dasiz+4;
		if (lengcnt >= lengtot-768) break;
	}
	kclose(fil);

#if USE_POLYMOST && USE_OPENGL
	if (voxmodels[voxindex]) {
		voxfree(voxmodels[voxindex]);
		voxmodels[voxindex] = NULL;
	}
	voxmodels[voxindex] = voxload(filename);
#endif
	return 0;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %rsi, %r14
movl %edi, %r15d
xorl %ebx, %ebx
movq %rsi, %rdi
xorl %esi, %esi
callq 0x2043c
cmpl $-0x1, %eax
je 0x36639
movl %eax, %ebp
movq %r14, 0x10(%rsp)
movl %eax, %edi
callq 0x209a1
movl %eax, %r14d
movslq %r15d, %rax
addl $0xfffffd00, %r14d      # imm = 0xFFFFFD00
movq %rax, 0x8(%rsp)
leaq (%rax,%rax,4), %rax
leaq 0x350539(%rip), %r13    # 0x386ad0
addq %rax, %r13
leaq 0x32852f(%rip), %rcx    # 0x35ead0
leaq (%rcx,%rax,8), %r15
xorl %r12d, %r12d
movl %ebp, %edi
leaq 0x4(%rsp), %rsi
movl $0x4, %edx
callq 0x20684
leaq (%r12,%r13), %rdx
movb $-0x38, (%r13,%r12)
movslq 0x4(%rsp), %rsi
movq %r15, %rdi
callq 0x1f650
movq (%r15), %rsi
movl 0x4(%rsp), %edx
movl %ebp, %edi
callq 0x20684
movl 0x4(%rsp), %eax
addl %eax, %ebx
addl $0x4, %ebx
cmpl %r14d, %ebx
jge 0x365fe
leaq 0x1(%r12), %rax
addq $0x8, %r15
cmpq $0x4, %r12
movq %rax, %r12
jne 0x365a8
movl %ebp, %edi
callq 0x20b40
leaq 0x62da54(%rip), %rbx    # 0x664060
movq 0x8(%rsp), %r14
movq (%rbx,%r14,8), %rdi
testq %rdi, %rdi
je 0x36627
callq 0x6148d
movq $0x0, (%rbx,%r14,8)
movq 0x10(%rsp), %rdi
callq 0x614ca
movq %rax, (%rbx,%r14,8)
xorl %eax, %eax
jmp 0x3663e
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
addq $0x18, %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/engine.c
// Function: clipinsidebox
int clipinsidebox(int x, int y, short wallnum, int walldist)
{
	walltype *wal;
	int x1, y1, x2, y2, r;

	r = (walldist<<1);
	wal = &wall[wallnum];     x1 = wal->x+walldist-x; y1 = wal->y+walldist-y;
	wal = &wall[wal->point2]; x2 = wal->x+walldist-x; y2 = wal->y+walldist-y;

	if ((x1 < 0) && (x2 < 0)) return(0);
	if ((y1 < 0) && (y2 < 0)) return(0);
	if ((x1 >= r) && (x2 >= r)) return(0);
	if ((y1 >= r) && (y2 >= r)) return(0);

	x2 -= x1; y2 -= y1;
	if (x2*(walldist-y1) >= y2*(walldist-x1))  //Front
	{
		if (x2 > 0) x2 *= (0-y1); else x2 *= (r-y1);
		if (y2 > 0) y2 *= (r-x1); else y2 *= (0-x1);
		return(x2 < y2);
	}
	if (x2 > 0) x2 *= (r-y1); else x2 *= (0-y1);
	if (y2 > 0) y2 *= (0-x1); else y2 *= (r-x1);
	return((x2 >= y2)<<1);
}

// Assembly:
movslq %edx, %r9
shlq $0x5, %r9
leaq 0x1823f5(%rip), %r10    # 0x1b8a50
movl %ecx, %edx
subl %edi, %edx
movl %ecx, %edi
subl %esi, %edi
movl 0x4(%r9,%r10), %esi
addl %edi, %esi
movswq 0x8(%r9,%r10), %rax
shlq $0x5, %rax
movl (%rax,%r10), %r8d
addl 0x4(%rax,%r10), %edi
addl %edx, %r8d
xorl %eax, %eax
addl (%r9,%r10), %edx
jns 0x3668e
testl %r8d, %r8d
jns 0x3668e
retq
testl %esi, %esi
jns 0x36696
testl %edi, %edi
js 0x3668d
leal (%rcx,%rcx), %r11d
movl %r11d, %r9d
subl %edx, %r9d
jg 0x366a7
cmpl %r11d, %r8d
jge 0x3668d
movl %r11d, %r10d
subl %esi, %r10d
jg 0x366b4
cmpl %r11d, %edi
jge 0x3668d
subl %edx, %r8d
subl %esi, %edi
movl %ecx, %eax
subl %esi, %eax
imull %r8d, %eax
subl %edx, %ecx
imull %edi, %ecx
cmpl %ecx, %eax
jge 0x366f5
imull %r8d, %r10d
imull %r8d, %esi
negl %esi
testl %r8d, %r8d
cmovgl %r10d, %esi
imull %edi, %edx
negl %edx
imull %edi, %r9d
testl %edi, %edi
cmovgl %edx, %r9d
xorl %eax, %eax
cmpl %r9d, %esi
setge %al
addl %eax, %eax
retq
imull %r8d, %esi
negl %esi
imull %r8d, %r10d
testl %r8d, %r8d
cmovgl %esi, %r10d
imull %edi, %r9d
imull %edi, %edx
negl %edx
testl %edi, %edi
cmovgl %r9d, %edx
xorl %eax, %eax
cmpl %edx, %r10d
setl %al
retq
// File: /workspace/github_c_makefile_star2_O3/jonof[P]jftekwar/jfbuild/src/engine.c
// Function: clipinsideboxline
int clipinsideboxline(int x, int y, int x1, int y1, int x2, int y2, int walldist)
{
	int r;

	r = (walldist<<1);

	x1 += walldist-x; x2 += walldist-x;
	if ((x1 < 0) && (x2 < 0)) return(0);
	if ((x1 >= r) && (x2 >= r)) return(0);

	y1 += walldist-y; y2 += walldist-y;
	if ((y1 < 0) && (y2 < 0)) return(0);
	if ((y1 >= r) && (y2 >= r)) return(0);

	x2 -= x1; y2 -= y1;
	if (x2*(walldist-y1) >= y2*(walldist-x1))  //Front
	{
		if (x2 > 0) x2 *= (0-y1); else x2 *= (r-y1);
		if (y2 > 0) y2 *= (r-x1); else y2 *= (0-x1);
		return(x2 < y2);
	}
	if (x2 > 0) x2 *= (r-y1); else x2 *= (0-y1);
	if (y2 > 0) y2 *= (0-x1); else y2 *= (r-x1);
	return((x2 >= y2)<<1);
}

// Assembly:
pushq %rbp
pushq %rbx
movl 0x18(%rsp), %r11d
movl %r11d, %r10d
subl %edi, %r10d
addl %r10d, %edx
addl %r8d, %r10d
xorl %eax, %eax
testl %r10d, %edx
js 0x367f4
leal (%r11,%r11), %ebx
movl %ebx, %edi
subl %edx, %edi
setg %r8b
cmpl %ebx, %r10d
setl %bpl
orb %r8b, %bpl
cmpb $0x1, %bpl
jne 0x367f4
movl %r11d, %r8d
subl %esi, %r8d
addl %r8d, %ecx
addl %r9d, %r8d
testl %r8d, %ecx
js 0x367f4
movl %ebx, %esi
subl %ecx, %esi
setg %r9b
cmpl %ebx, %r8d
setl %bl
orb %r9b, %bl
cmpb $0x1, %bl
jne 0x367f4
subl %edx, %r10d
subl %ecx, %r8d
movl %r11d, %eax
subl %ecx, %eax
imull %r10d, %eax
subl %edx, %r11d
imull %r8d, %r11d
cmpl %r11d, %eax
jge 0x367cd
imull %r10d, %esi
imull %r10d, %ecx
negl %ecx
testl %r10d, %r10d
cmovgl %esi, %ecx
imull %r8d, %edx
negl %edx
imull %r8d, %edi
testl %r8d, %r8d
cmovgl %edx, %edi
xorl %eax, %eax
cmpl %edi, %ecx
setge %al
addl %eax, %eax
jmp 0x367f4
imull %r10d, %ecx
negl %ecx
imull %r10d, %esi
testl %r10d, %r10d
cmovgl %ecx, %esi
imull %r8d, %edi
imull %r8d, %edx
negl %edx
testl %r8d, %r8d
cmovgl %edi, %edx
xorl %eax, %eax
cmpl %edx, %esi
setl %al
popq %rbx
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/jonof[P]jftekwar/jfbuild/src/engine.c
// Function: inside
int inside(int x, int y, short sectnum)
{
	walltype *wal;
	int i, x1, y1, x2, y2;
	unsigned int cnt;

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

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

// Assembly:
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
testw %dx, %dx
js 0x36892
cmpw %dx, 0x399754(%rip)     # 0x3cff60
jle 0x36892
pushq %rbp
pushq %rbx
movzwl %dx, %eax
leaq (%rax,%rax,4), %rax
leaq 0x20d23e(%rip), %rcx    # 0x243a60
movswq (%rcx,%rax,8), %r8
movswl 0x2(%rcx,%rax,8), %ecx
shlq $0x5, %r8
leaq 0x182219(%rip), %rdx    # 0x1b8a50
addq %rdx, %r8
addq $0x8, %r8
xorl %eax, %eax
movl -0x4(%r8), %r9d
subl %esi, %r9d
movswq (%r8), %rbx
shlq $0x5, %rbx
movl 0x4(%rbx,%rdx), %r10d
subl %esi, %r10d
movl %r10d, %r11d
xorl %r9d, %r11d
jns 0x36885
addq %rdx, %rbx
movl -0x8(%r8), %r11d
subl %edi, %r11d
movl (%rbx), %ebx
subl %edi, %ebx
movl %ebx, %ebp
xorl %r11d, %ebp
jns 0x36882
imull %r10d, %r11d
imull %r9d, %ebx
subl %ebx, %r11d
xorl %r10d, %eax
xorl %r11d, %eax
addq $0x20, %r8
decl %ecx
jne 0x36840
shrl $0x1f, %eax
popq %rbx
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/jonof[P]jftekwar/jfbuild/src/engine.c
// Function: getangle
int getangle(int xvect, int yvect)
{
	if ((xvect|yvect) == 0) return(0);
	if (xvect == 0) return(512+((yvect<0)<<10));
	if (yvect == 0) return(((xvect<0)<<10));
	if (xvect == yvect) return(256+((xvect<0)<<10));
	if (xvect == -yvect) return(768+((xvect>0)<<10));
	if (klabs(xvect) > klabs(yvect))
		return(((radarang[640+scale(160,yvect,xvect)]>>6)+((xvect<0)<<10))&2047);
	return(((radarang[640-scale(160,xvect,yvect)]>>6)+512+((yvect<0)<<10))&2047);
}

// Assembly:
movl %esi, %eax
orl %edi, %eax
je 0x368b9
testl %edi, %edi
je 0x368c0
testl %esi, %esi
je 0x368d4
cmpl %esi, %edi
jne 0x368e4
shrl $0x15, %esi
andl $0x400, %esi            # imm = 0x400
orl $0x100, %esi            # imm = 0x100
jmp 0x3699a
xorl %esi, %esi
jmp 0x3699a
shrl $0x15, %esi
andl $0x400, %esi            # imm = 0x400
orl $0x200, %esi            # imm = 0x200
jmp 0x3699a
shrl $0x15, %edi
andl $0x400, %edi            # imm = 0x400
movl %edi, %esi
jmp 0x3699a
movl %esi, %eax
addl %edi, %eax
jne 0x36900
xorl %esi, %esi
testl %edi, %edi
setg %sil
shll $0xa, %esi
orl $0x300, %esi            # imm = 0x300
jmp 0x3699a
movabsq $0x28000000000, %rcx    # imm = 0x28000000000
movl %edi, %eax
negl %eax
cmovsl %edi, %eax
movl %esi, %edx
negl %edx
cmovsl %esi, %edx
cmpl %edx, %eax
jbe 0x3695b
movslq %esi, %rax
shlq $0x5, %rax
leaq (%rax,%rax,4), %rax
movslq %edi, %rsi
cqto
idivq %rsi
shlq $0x20, %rax
addq %rcx, %rax
sarq $0x1f, %rax
leaq 0x3fa1ff(%rip), %rcx    # 0x430b40
movswl (%rax,%rcx), %eax
sarl $0x6, %eax
shrl $0x15, %edi
andl $0x400, %edi            # imm = 0x400
addl %eax, %edi
andl $0x7ff, %edi            # imm = 0x7FF
jmp 0x368dd
movslq %edi, %rax
shlq $0x5, %rax
leaq (%rax,%rax,4), %rax
movslq %esi, %rdi
cqto
idivq %rdi
shlq $0x20, %rax
subq %rax, %rcx
sarq $0x1f, %rcx
leaq 0x3fa1c0(%rip), %rax    # 0x430b40
movswl (%rcx,%rax), %eax
sarl $0x6, %eax
addl $0x200, %eax            # imm = 0x200
movzwl %ax, %eax
shrl $0x15, %esi
andl $0x400, %esi            # imm = 0x400
addl %eax, %esi
movl %esi, %eax
retq