LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_c_makefile_star2_O2/jonof[P]jftekwar/src/datascan.c
// Function: ImportDataFromPath
int ImportDataFromPath(const char *path, struct importdatameta *cbs)
{
    struct stat st;
    int found = 0, errors = 0;

    if (stat(path, &st) < 0) return IMPORTDATA_OK;

    if (st.st_mode & S_IFDIR) {
        switch (ImportFilesFromDir(path, cbs)) {
            case IMPORTDATA_COPIED: found = 1; break;
            case IMPORTDATA_ERROR: errors = 1; break;
        }
    }

    if (found) {
        if (WritePaletteFile() == COPYFILE_OK) {
            buildprintf("Wrote PALETTE.DAT\n");
        }
        return IMPORTDATA_COPIED;         // Finding anything is considered fine.
    }
    else if (errors) return IMPORTDATA_ERROR; // Finding nothing but errors reports back errors.
    return IMPORTDATA_OK;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x98, %rsp
movq %rsi, %r14
movq %rdi, %r15
leaq 0x8(%rsp), %rsi
callq 0x8140
xorl %ebx, %ebx
testl %eax, %eax
js 0x2ae6c
testb $0x40, 0x21(%rsp)
je 0x2ae6c
movq %r15, %rdi
movq %r14, %rsi
callq 0x2ae80
cmpl $-0x1, %eax
je 0x2ae40
cmpl $0x2, %eax
jne 0x2ae6c
leaq 0x57ee5(%rip), %rdi     # 0x82cbf
xorl %r14d, %r14d
movl $0xc1, %esi
movl $0x180, %edx            # imm = 0x180
xorl %eax, %eax
callq 0x8670
pushq $0x2
popq %rbx
testl %eax, %eax
js 0x2ae6c
movl %eax, %ebp
leaq 0x6a1d6(%rip), %rax     # 0x94fd4
movslq (%rax), %r15
movl $0x4000, %r12d          # imm = 0x4000
xorl %r13d, %r13d
testl %r14d, %r14d
jne 0x2ae44
movq %r15, %rdx
subq %r13, %rdx
jle 0x2ae44
cmpq %r12, %rdx
cmovgeq %r12, %rdx
leaq 0x57eab(%rip), %rax     # 0x82cd0
leaq (%rax,%r13), %rsi
movl %ebp, %edi
callq 0x8f10
addq %rax, %r13
movq %rax, %r14
sarq $0x3f, %r14
andl $-0x3, %r14d
jmp 0x2ae0a
movl %eax, %ebx
jmp 0x2ae6c
movl %ebp, %edi
callq 0x8310
testl %r14d, %r14d
je 0x2ae5e
leaq 0x57e68(%rip), %rdi     # 0x82cbf
callq 0x82a0
jmp 0x2ae6c
leaq 0x57d8b(%rip), %rdi     # 0x82bf0
xorl %eax, %eax
callq 0x33127
movl %ebx, %eax
addq $0x98, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/jonof[P]jftekwar/src/datascan.c
// Function: ImportDataFromFile
static int ImportDataFromFile(const char *path, int size, struct importdatameta *cbs)
{
    char *fn;
    int fh, rv;

    fn = strrchr(path, '/');
#ifdef _WIN32
    fn = max(fn, strrchr(path, '\\'));
#endif
    if (!fn) fn = strdup(path);
    else fn = strdup(fn+1);
    strlwr(fn);

    fh = open(path, O_RDONLY|O_BINARY, S_IREAD);
    if (fh < 0) return IMPORTDATA_OK;  // Maybe no permission. Whatever.

    switch (CopyFile(fh, size, fn, cbs)) {
        case COPYFILE_ERR_CANCELLED:
            rv = IMPORTDATA_OK;
            break;
        case COPYFILE_ERR_EXISTS:
            rv = IMPORTDATA_SKIPPED;
            break;
        case COPYFILE_OK: // Copied.
            rv = IMPORTDATA_COPIED;
            break;
        default:
            rv = IMPORTDATA_ERROR;
            break;
    }
    close(fh);
    free(fn);
    return rv;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x4018, %rsp           # imm = 0x4018
movq %rdx, %r15
movl %esi, %r14d
movq %rdi, %r13
pushq $0x2f
popq %rsi
callq 0x8dd0
testq %rax, %rax
je 0x2b06d
incq %rax
movq %rax, %rdi
jmp 0x2b070
movq %r13, %rdi
callq 0x8070
movq %rax, %rbx
movq %rax, %rdi
callq 0x31b5c
xorl %r12d, %r12d
movq %r13, %rdi
xorl %esi, %esi
movl $0x100, %edx            # imm = 0x100
xorl %eax, %eax
callq 0x8670
testl %eax, %eax
js 0x2b195
movl %eax, %ebp
movq %rbx, %rdi
movl $0xc1, %esi
movl $0x180, %edx            # imm = 0x180
xorl %eax, %eax
callq 0x8670
testl %eax, %eax
js 0x2b120
movl %eax, %r12d
movl %r14d, 0xc(%rsp)
movl %ebp, %edi
xorl %esi, %esi
xorl %edx, %edx
callq 0x83b0
leaq 0x10(%rsp), %r13
movq (%r15), %rdi
callq *0x10(%r15)
testl %eax, %eax
jne 0x2b12e
movl $0x4000, %edx           # imm = 0x4000
movl %ebp, %edi
movq %r13, %rsi
callq 0x8b20
testq %rax, %rax
js 0x2b138
je 0x2b141
movq %rax, %r14
movl %r12d, %edi
movq %r13, %rsi
movq %rax, %rdx
callq 0x8f10
cmpq $0x4000, %r14           # imm = 0x4000
jne 0x2b10e
cmpq %r14, %rax
je 0x2b0ce
xorl %ecx, %ecx
cmpq %r14, %rax
sete %cl
leal (%rcx,%rcx,2), %r13d
addl $-0x3, %r13d
jmp 0x2b144
callq 0x8ea0
cmpl $0x11, (%rax)
jne 0x2b17e
pushq $0x1
jmp 0x2b184
pushq $-0x3
popq %r15
pushq $-0x4
popq %r13
jmp 0x2b148
pushq $-0x3
popq %r15
movl %r15d, %r13d
jmp 0x2b148
xorl %r13d, %r13d
pushq $-0x3
popq %r15
movl %r12d, %edi
callq 0x8310
movslq 0xc(%rsp), %r14
xorl %r12d, %r12d
pushq $0x1
popq %rdx
movl %ebp, %edi
xorl %esi, %esi
callq 0x83b0
cmpq %r14, %rax
cmovel %r13d, %r15d
testl %r15d, %r15d
je 0x2b182
movq %rbx, %rdi
callq 0x82a0
cmpl $-0x4, %r15d
je 0x2b186
pushq $-0x1
jmp 0x2b184
pushq $0x2
popq %r12
movl %ebp, %edi
callq 0x8310
movq %rbx, %rdi
callq 0x8270
movl %r12d, %eax
addq $0x4018, %rsp           # imm = 0x4018
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
nop
// File: /workspace/github_c_makefile_star2_O2/jonof[P]jftekwar/libsmacker/smacker.c
// Function: smk_open_memory
smk smk_open_memory(const unsigned char * buffer, const unsigned long size)
{
	smk s = NULL;
	union smk_read_t fp;

	if (buffer == NULL) {
		fputs("libsmacker::smk_open_memory() - ERROR: buffer pointer is NULL\n", stderr);
		return NULL;
	}

	/* set up the read union for Memory mode */
	fp.ram = (unsigned char *)buffer;

	if (!(s = smk_open_generic(0, fp, size, SMK_MODE_MEMORY)))
		fprintf(stderr, "libsmacker::smk_open_memory(buffer,%lu) - ERROR: Fatal error in smk_open_generic, returning NULL.\n", size);

	return s;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
testq %rdi, %rdi
je 0x2b1db
movq %rsi, %rbx
movq %rdi, %rsi
pushq $0x1
popq %rcx
xorl %edi, %edi
movq %rbx, %rdx
callq 0x2b216
movq %rax, %r14
testq %rax, %rax
je 0x2b1f6
movq %r14, %rax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
movq 0x9bdb6(%rip), %rax     # 0xc6f98
movq (%rax), %rsi
leaq 0x69ed4(%rip), %rdi     # 0x950c0
callq 0x8470
xorl %r14d, %r14d
jmp 0x2b1d0
movq 0x9bd9b(%rip), %rax     # 0xc6f98
movq (%rax), %rdi
leaq 0x69ef8(%rip), %rsi     # 0x950ff
xorl %r14d, %r14d
movq %rbx, %rdx
xorl %eax, %eax
callq 0x8290
jmp 0x2b1d0
// File: /workspace/github_c_makefile_star2_O2/jonof[P]jftekwar/libsmacker/smacker.c
// Function: smk_open_filepointer
smk smk_open_filepointer(FILE * file, const unsigned char mode)
{
	smk s = NULL;
	union smk_read_t fp;

	if (file == NULL) {
		fputs("libsmacker::smk_open_filepointer() - ERROR: file pointer is NULL\n", stderr);
		return NULL;
	}

	/* Copy file ptr to internal union */
	fp.file = file;

	if (!(s = smk_open_generic(1, fp, 0, mode))) {
		fprintf(stderr, "libsmacker::smk_open_filepointer(file,%u) - ERROR: Fatal error in smk_open_generic, returning NULL.\n", mode);
		fclose(fp.file);
		goto error;
	}

	if (mode == SMK_MODE_MEMORY)
		fclose(fp.file);
	else
		s->source.file.fp = fp.file;

	/* fall through, return s or null */
error:
	return s;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
testq %rdi, %rdi
je 0x2c366
movl %esi, %ebp
movq %rdi, %rbx
movzbl %bpl, %r15d
pushq $0x1
popq %rdi
movq %rbx, %rsi
xorl %edx, %edx
movl %r15d, %ecx
callq 0x2b216
testq %rax, %rax
je 0x2c381
movq %rax, %r14
cmpb $0x1, %bpl
jne 0x2c354
movq %rbx, %rdi
callq 0x8640
jmp 0x2c358
movq %rbx, 0x28(%r14)
movq %r14, %rax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
movq 0x9ac2b(%rip), %rax     # 0xc6f98
movq (%rax), %rsi
leaq 0x68deb(%rip), %rdi     # 0x95162
callq 0x8470
xorl %r14d, %r14d
jmp 0x2c358
movq 0x9ac10(%rip), %rax     # 0xc6f98
movq (%rax), %rdi
leaq 0x68e12(%rip), %rsi     # 0x951a4
xorl %r14d, %r14d
movl %r15d, %edx
xorl %eax, %eax
callq 0x8290
jmp 0x2c34a
// File: /workspace/github_c_makefile_star2_O2/jonof[P]jftekwar/libsmacker/smacker.c
// Function: smk_open_file
smk smk_open_file(const char * filename, const unsigned char mode)
{
	FILE * fp;

	if (filename == NULL) {
		fputs("libsmacker::smk_open_file() - ERROR: filename is NULL\n", stderr);
		return NULL;
	}

	if (!(fp = fopen(filename, "rb"))) {
		fprintf(stderr, "libsmacker::smk_open_file(%s,%u) - ERROR: could not open file\n", filename, mode);
		perror("\tError reported was");
		goto error;
	}

	/* kick processing to smk_open_filepointer */
	return smk_open_filepointer(fp, mode);
	/* fall through, return s or null */
error:
	return NULL;
}

// Assembly:
pushq %rbp
pushq %rbx
pushq %rax
testq %rdi, %rdi
je 0x2c3d1
movl %esi, %ebp
movq %rdi, %rbx
leaq 0x68e8b(%rip), %rsi     # 0x95240
callq 0x91d0
testq %rax, %rax
je 0x2c3e9
movzbl %bpl, %esi
movq %rax, %rdi
addq $0x8, %rsp
popq %rbx
popq %rbp
jmp 0x2c317
movq 0x9abc0(%rip), %rax     # 0xc6f98
movq (%rax), %rsi
leaq 0x68e27(%rip), %rdi     # 0x95209
callq 0x8470
jmp 0x2c414
movq 0x9aba8(%rip), %rax     # 0xc6f98
movq (%rax), %rdi
movzbl %bpl, %ecx
leaq 0x68e45(%rip), %rsi     # 0x95243
movq %rbx, %rdx
xorl %eax, %eax
callq 0x8290
leaq 0x68e73(%rip), %rdi     # 0x95282
callq 0x83f0
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/jonof[P]jftekwar/libsmacker/smacker.c
// Function: smk_info_all
char smk_info_all(const smk object, unsigned long * frame, unsigned long * frame_count, double * usf)
{
	/* null check */
	if (object == NULL) {
		fputs("libsmacker::smk_info_all() - ERROR: smk is NULL\n", stderr);
		return -1;
	}

	if (!frame && !frame_count && !usf) {
		fputs("libsmacker::smk_info_all(object,frame,frame_count,usf) - ERROR: Request for info with all-NULL return references\n", stderr);
		goto error;
	}

	if (frame)
		*frame = (object->cur_frame % object->f);

	if (frame_count)
		*frame_count = object->f;

	if (usf)
		*usf = object->usf;

	return 0;
error:
	return -1;
}

// Assembly:
pushq %rax
testq %rdi, %rdi
je 0x2c684
movq %rdx, %r8
movq %rsi, %rax
orq %rdx, %rax
orq %rcx, %rax
je 0x2c697
testq %rsi, %rsi
je 0x2c666
movq 0x20(%rdi), %rax
xorl %edx, %edx
divq 0x10(%rdi)
movq %rdx, (%rsi)
testq %r8, %r8
je 0x2c672
movq 0x10(%rdi), %rax
movq %rax, (%r8)
testq %rcx, %rcx
je 0x2c680
movsd 0x8(%rdi), %xmm0
movsd %xmm0, (%rcx)
xorl %eax, %eax
popq %rcx
retq
movq 0x9a90d(%rip), %rax     # 0xc6f98
movq (%rax), %rsi
leaq 0x68cd8(%rip), %rdi     # 0x9536d
jmp 0x2c6a8
movq 0x9a8fa(%rip), %rax     # 0xc6f98
movq (%rax), %rsi
leaq 0x68cf6(%rip), %rdi     # 0x9539e
callq 0x8470
movb $-0x1, %al
jmp 0x2c682
// File: /workspace/github_c_makefile_star2_O2/jonof[P]jftekwar/libsmacker/smacker.c
// Function: smk_info_video
char smk_info_video(const smk object, unsigned long * w, unsigned long * h, unsigned char * y_scale_mode)
{
	/* null check */
	if (object == NULL) {
		fputs("libsmacker::smk_info_video() - ERROR: smk is NULL\n", stderr);
		return -1;
	}

	if (!w && !h && !y_scale_mode) {
		fputs("libsmacker::smk_info_all(object,w,h,y_scale_mode) - ERROR: Request for info with all-NULL return references\n", stderr);
		return -1;
	}

	if (w)
		*w = object->video.w;

	if (h)
		*h = object->video.h;

	if (y_scale_mode)
		*y_scale_mode = object->video.y_scale_mode;

	return 0;
}

// Assembly:
pushq %rax
testq %rdi, %rdi
je 0x2c6e8
movq %rsi, %rax
orq %rdx, %rax
orq %rcx, %rax
je 0x2c6fb
testq %rsi, %rsi
je 0x2c6ce
movq 0x58(%rdi), %rax
movq %rax, (%rsi)
testq %rdx, %rdx
je 0x2c6da
movq 0x60(%rdi), %rax
movq %rax, (%rdx)
testq %rcx, %rcx
je 0x2c6e4
movb 0x68(%rdi), %al
movb %al, (%rcx)
xorl %eax, %eax
popq %rcx
retq
movq 0x9a8a9(%rip), %rax     # 0xc6f98
movq (%rax), %rsi
leaq 0x68d17(%rip), %rdi     # 0x95410
jmp 0x2c70c
movq 0x9a896(%rip), %rax     # 0xc6f98
movq (%rax), %rsi
leaq 0x68d37(%rip), %rdi     # 0x95443
callq 0x8470
movb $-0x1, %al
jmp 0x2c6e6
// File: /workspace/github_c_makefile_star2_O2/jonof[P]jftekwar/libsmacker/smacker.c
// Function: smk_info_audio
char smk_info_audio(const smk object, unsigned char * track_mask, unsigned char channels[7], unsigned char bitdepth[7], unsigned long audio_rate[7])
{
	unsigned char i;

	/* null check */
	if (object == NULL) {
		fputs("libsmacker::smk_info_audio() - ERROR: smk is NULL\n", stderr);
		return -1;
	}

	if (!track_mask && !channels && !bitdepth && !audio_rate) {
		fputs("libsmacker::smk_info_audio(object,track_mask,channels,bitdepth,audio_rate) - ERROR: Request for info with all-NULL return references\n", stderr);
		return -1;
	}

	if (track_mask) {
		*track_mask = ((object->audio[0].exists) |
				((object->audio[1].exists) << 1) |
				((object->audio[2].exists) << 2) |
				((object->audio[3].exists) << 3) |
				((object->audio[4].exists) << 4) |
				((object->audio[5].exists) << 5) |
				((object->audio[6].exists) << 6));
	}

	if (channels) {
		for (i = 0; i < 7; i ++)
			channels[i] = object->audio[i].channels;
	}

	if (bitdepth) {
		for (i = 0; i < 7; i ++)
			bitdepth[i] = object->audio[i].bitdepth;
	}

	if (audio_rate) {
		for (i = 0; i < 7; i ++)
			audio_rate[i] = object->audio[i].rate;
	}

	return 0;
}

// Assembly:
pushq %rax
testq %rdi, %rdi
je 0x2c7fd
movq %rsi, %rax
orq %rdx, %rax
orq %rcx, %rax
orq %r8, %rax
je 0x2c806
testq %rsi, %rsi
je 0x2c78d
movb 0x428(%rdi), %al
addb %al, %al
orb 0x3f8(%rdi), %al
movb 0x458(%rdi), %r9b
shlb $0x2, %r9b
movb 0x488(%rdi), %r10b
shlb $0x3, %r10b
orb %r9b, %r10b
movb 0x4b8(%rdi), %r9b
shlb $0x4, %r9b
orb %r10b, %r9b
movb 0x4e8(%rdi), %r10b
shlb $0x5, %r10b
orb %r9b, %r10b
movb 0x518(%rdi), %r9b
shlb $0x6, %r9b
orb %r10b, %r9b
orb %al, %r9b
movb %r9b, (%rsi)
testq %rdx, %rdx
je 0x2c7b1
leaq 0x3fa(%rdi), %rax
xorl %esi, %esi
cmpq $0x7, %rsi
je 0x2c7b1
movb (%rax), %r9b
movb %r9b, (%rdx,%rsi)
incq %rsi
addq $0x30, %rax
jmp 0x2c79b
testq %rcx, %rcx
je 0x2c7d5
leaq 0x3fb(%rdi), %rax
xorl %edx, %edx
cmpq $0x7, %rdx
je 0x2c7d5
movb (%rax), %sil
movb %sil, (%rcx,%rdx)
incq %rdx
addq $0x30, %rax
jmp 0x2c7bf
testq %r8, %r8
je 0x2c7f9
addq $0x400, %rdi            # imm = 0x400
xorl %eax, %eax
cmpq $0x7, %rax
je 0x2c7f9
movq (%rdi), %rcx
movq %rcx, (%r8,%rax,8)
incq %rax
addq $0x30, %rdi
jmp 0x2c7e3
xorl %eax, %eax
popq %rcx
retq
leaq 0x68cac(%rip), %rdi     # 0x954b0
jmp 0x2c80d
leaq 0x68cd6(%rip), %rdi     # 0x954e3
movq 0x9a784(%rip), %rax     # 0xc6f98
movq (%rax), %rsi
callq 0x8470
movb $-0x1, %al
jmp 0x2c7fb
// File: /workspace/github_c_makefile_star2_O2/jonof[P]jftekwar/libsmacker/smacker.c
// Function: smk_enable_all
char smk_enable_all(smk object, const unsigned char mask)
{
	unsigned char i;

	/* null check */
	if (object == NULL) {
		fputs("libsmacker::smk_enable_all() - ERROR: smk is NULL\n", stderr);
		return -1;
	}

	/* set video-enable */
	object->video.enable = (mask & 0x80);

	for (i = 0; i < 7; i ++) {
		if (object->audio[i].exists)
			object->audio[i].enable = (mask & (1 << i));
	}

	return 0;
}

// Assembly:
pushq %rax
testq %rdi, %rdi
je 0x2c85b
movl %esi, %eax
andb $-0x80, %al
movb %al, 0x50(%rdi)
addq $0x3f9, %rdi            # imm = 0x3F9
xorl %ecx, %ecx
pushq $0x1
popq %rax
cmpq $0x7, %rcx
je 0x2c857
cmpb $0x0, -0x1(%rdi)
je 0x2c84e
movl %eax, %edx
shll %cl, %edx
andb %sil, %dl
movb %dl, (%rdi)
incq %rcx
addq $0x30, %rdi
jmp 0x2c839
xorl %eax, %eax
popq %rcx
retq
movq 0x9a736(%rip), %rax     # 0xc6f98
movq (%rax), %rsi
leaq 0x68cfd(%rip), %rdi     # 0x95569
callq 0x8470
movb $-0x1, %al
jmp 0x2c859
// File: /workspace/github_c_makefile_star2_O2/jonof[P]jftekwar/libsmacker/smacker.c
// Function: smk_enable_video
char smk_enable_video(smk object, const unsigned char enable)
{
	/* null check */
	if (object == NULL) {
		fputs("libsmacker::smk_enable_video() - ERROR: smk is NULL\n", stderr);
		return -1;
	}

	object->video.enable = enable;
	return 0;
}

// Assembly:
testq %rdi, %rdi
je 0x2c881
movb %sil, 0x50(%rdi)
xorl %eax, %eax
retq
pushq %rax
movq 0x9a70f(%rip), %rax     # 0xc6f98
movq (%rax), %rsi
leaq 0x68d09(%rip), %rdi     # 0x9559c
callq 0x8470
movb $-0x1, %al
addq $0x8, %rsp
retq
// File: /workspace/github_c_makefile_star2_O2/jonof[P]jftekwar/libsmacker/smacker.c
// Function: smk_enable_audio
char smk_enable_audio(smk object, const unsigned char track, const unsigned char enable)
{
	/* null check */
	if (object == NULL) {
		fputs("libsmacker::smk_enable_audio() - ERROR: smk is NULL\n", stderr);
		return -1;
	}

	object->audio[track].enable = enable;
	return 0;
}

// Assembly:
testq %rdi, %rdi
je 0x2c8b6
movzbl %sil, %eax
imulq $0x30, %rax, %rax
movb %dl, 0x3f9(%rdi,%rax)
xorl %eax, %eax
retq
pushq %rax
movq 0x9a6da(%rip), %rax     # 0xc6f98
movq (%rax), %rsi
leaq 0x68d09(%rip), %rdi     # 0x955d1
callq 0x8470
movb $-0x1, %al
addq $0x8, %rsp
retq
// File: /workspace/github_c_makefile_star2_O2/jonof[P]jftekwar/libsmacker/smacker.c
// Function: smk_get_palette
const unsigned char * smk_get_palette(const smk object)
{
	/* null check */
	if (object == NULL) {
		fputs("libsmacker::smk_get_palette() - ERROR: smk is NULL\n", stderr);
		return NULL;
	}

	return (unsigned char *)object->video.palette;
}

// Assembly:
testq %rdi, %rdi
je 0x2c8e3
movq %rdi, %rax
addq $0xf0, %rax
retq
pushq %rax
movq 0x9a6ad(%rip), %rax     # 0xc6f98
movq (%rax), %rsi
leaq 0x68d11(%rip), %rdi     # 0x95606
callq 0x8470
xorl %eax, %eax
addq $0x8, %rsp
retq
// File: /workspace/github_c_makefile_star2_O2/jonof[P]jftekwar/libsmacker/smacker.c
// Function: smk_get_video
const unsigned char * smk_get_video(const smk object)
{
	/* null check */
	if (object == NULL) {
		fputs("libsmacker::smk_get_video() - ERROR: smk is NULL\n", stderr);
		return NULL;
	}

	return object->video.frame;
}

// Assembly:
testq %rdi, %rdi
je 0x2c90e
movq 0x3f0(%rdi), %rax
retq
pushq %rax
movq 0x9a682(%rip), %rax     # 0xc6f98
movq (%rax), %rsi
leaq 0x68d1a(%rip), %rdi     # 0x9563a
callq 0x8470
xorl %eax, %eax
addq $0x8, %rsp
retq
// File: /workspace/github_c_makefile_star2_O2/jonof[P]jftekwar/libsmacker/smacker.c
// Function: smk_get_audio
const unsigned char * smk_get_audio(const smk object, const unsigned char t)
{
	/* null check */
	if (object == NULL) {
		fputs("libsmacker::smk_get_audio() - ERROR: smk is NULL\n", stderr);
		return NULL;
	}

	return object->audio[t].buffer;
}

// Assembly:
testq %rdi, %rdi
je 0x2c942
movzbl %sil, %eax
imulq $0x30, %rax, %rax
movq 0x418(%rdi,%rax), %rax
retq
pushq %rax
movq 0x9a64e(%rip), %rax     # 0xc6f98
movq (%rax), %rsi
leaq 0x68d18(%rip), %rdi     # 0x9566c
callq 0x8470
xorl %eax, %eax
addq $0x8, %rsp
retq
// File: /workspace/github_c_makefile_star2_O2/jonof[P]jftekwar/libsmacker/smacker.c
// Function: smk_get_audio_size
unsigned long smk_get_audio_size(const smk object, const unsigned char t)
{
	/* null check */
	if (object == NULL) {
		fputs("libsmacker::smk_get_audio_size() - ERROR: smk is NULL\n", stderr);
		return 0;
	}

	return object->audio[t].buffer_size;
}

// Assembly:
testq %rdi, %rdi
je 0x2c976
movzbl %sil, %eax
imulq $0x30, %rax, %rax
movq 0x420(%rdi,%rax), %rax
retq
pushq %rax
movq 0x9a61a(%rip), %rax     # 0xc6f98
movq (%rax), %rsi
leaq 0x68d16(%rip), %rdi     # 0x9569e
callq 0x8470
xorl %eax, %eax
addq $0x8, %rsp
retq
// File: /workspace/github_c_makefile_star2_O2/jonof[P]jftekwar/libsmacker/smacker.c
// Function: smk_first
char smk_first(smk s)
{
	/* null check */
	if (s == NULL) {
		fputs("libsmacker::smk_first() - ERROR: smk is NULL\n", stderr);
		return -1;
	}

	s->cur_frame = 0;

	if (smk_render(s) < 0) {
		fprintf(stderr, "libsmacker::smk_first(s) - Warning: frame %lu: smk_render returned errors.\n", s->cur_frame);
		return -1;
	}

	if (s->f == 1) return SMK_LAST;

	return SMK_MORE;
}

// Assembly:
pushq %rbx
testq %rdi, %rdi
je 0x2c9b7
movq %rdi, %rbx
andq $0x0, 0x20(%rdi)
callq 0x2c9ef
testb %al, %al
js 0x2c9cf
cmpq $0x1, 0x10(%rbx)
sete %al
incb %al
popq %rbx
retq
movq 0x9a5da(%rip), %rax     # 0xc6f98
movq (%rax), %rsi
leaq 0x68d0d(%rip), %rdi     # 0x956d5
callq 0x8470
jmp 0x2c9eb
movq 0x9a5c2(%rip), %rax     # 0xc6f98
movq (%rax), %rdi
movq 0x20(%rbx), %rdx
leaq 0x68d1f(%rip), %rsi     # 0x95703
xorl %eax, %eax
callq 0x8290
movb $-0x1, %al
jmp 0x2c9b5
// File: /workspace/github_c_makefile_star2_O2/jonof[P]jftekwar/libsmacker/smacker.c
// Function: smk_next
char smk_next(smk s)
{
	/* null check */
	if (s == NULL) {
		fputs("libsmacker::smk_next() - ERROR: smk is NULL\n", stderr);
		return -1;
	}

	if (s->cur_frame + 1 < (s->f + s->ring_frame)) {
		s->cur_frame ++;

		if (smk_render(s) < 0) {
			fprintf(stderr, "libsmacker::smk_next(s) - Warning: frame %lu: smk_render returned errors.\n", s->cur_frame);
			return -1;
		}

		if (s->cur_frame + 1 == (s->f + s->ring_frame))
			return SMK_LAST;

		return SMK_MORE;
	} else if (s->ring_frame) {
		s->cur_frame = 1;

		if (smk_render(s) < 0) {
			fprintf(stderr, "libsmacker::smk_next(s) - Warning: frame %lu: smk_render returned errors.\n", s->cur_frame);
			return -1;
		}

		if (s->cur_frame + 1 == (s->f + s->ring_frame))
			return SMK_LAST;

		return SMK_MORE;
	}

	return SMK_DONE;
}

// Assembly:
pushq %rbx
testq %rdi, %rdi
je 0x2d62f
movq %rdi, %rbx
movq 0x20(%rdi), %rax
incq %rax
movzbl 0x18(%rdi), %ecx
movq 0x10(%rdi), %rdx
addq %rcx, %rdx
cmpq %rdx, %rax
jae 0x2d5fa
movq %rax, 0x20(%rbx)
jmp 0x2d606
testb %cl, %cl
je 0x2d62b
movq $0x1, 0x20(%rbx)
movq %rbx, %rdi
callq 0x2c9ef
testb %al, %al
js 0x2d647
movq 0x20(%rbx), %rax
movzbl 0x18(%rbx), %ecx
addq 0x10(%rbx), %rcx
incq %rax
cmpq %rcx, %rax
sete %al
incb %al
popq %rbx
retq
xorl %eax, %eax
jmp 0x2d629
movq 0x99962(%rip), %rax     # 0xc6f98
movq (%rax), %rsi
leaq 0x6810f(%rip), %rdi     # 0x9574f
callq 0x8470
jmp 0x2d663
movq 0x9994a(%rip), %rax     # 0xc6f98
movq (%rax), %rdi
movq 0x20(%rbx), %rdx
leaq 0x68120(%rip), %rsi     # 0x9577c
xorl %eax, %eax
callq 0x8290
movb $-0x1, %al
jmp 0x2d629
// File: /workspace/github_c_makefile_star2_O2/jonof[P]jftekwar/libsmacker/smacker.c
// Function: smk_seek_keyframe
char smk_seek_keyframe(smk s, unsigned long f)
{
	/* null check */
	if (s == NULL) {
		fputs("libsmacker::smk_seek_keyframe() - ERROR: smk is NULL\n", stderr);
		return -1;
	}

	/* rewind (or fast forward!) exactly to f */
	s->cur_frame = f;

	/* roll back to previous keyframe in stream, or 0 if no keyframes exist */
	while (s->cur_frame > 0 && !(s->keyframe[s->cur_frame]))
		s->cur_frame --;

	/* render the frame: we're ready */
	if (smk_render(s) < 0) {
		fprintf(stderr, "libsmacker::smk_seek_keyframe(s,%lu) - Warning: frame %lu: smk_render returned errors.\n", f, s->cur_frame);
		return -1;
	}

	return 0;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
testq %rdi, %rdi
je 0x2d6a9
movq %rsi, %rbx
movq %rdi, %r14
movq %rsi, %rcx
movq %rbx, %rax
movq %rcx, 0x20(%r14)
subq $0x1, %rax
jb 0x2d693
movq 0x40(%r14), %rdx
cmpb $0x0, (%rdx,%rcx)
movq %rax, %rcx
je 0x2d67c
movq %r14, %rdi
callq 0x2c9ef
testb %al, %al
js 0x2d6c1
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
movq 0x998e8(%rip), %rax     # 0xc6f98
movq (%rax), %rsi
leaq 0x6810d(%rip), %rdi     # 0x957c7
callq 0x8470
jmp 0x2d6e0
movq 0x998d0(%rip), %rax     # 0xc6f98
movq (%rax), %rdi
movq 0x20(%r14), %rcx
leaq 0x68127(%rip), %rsi     # 0x957fd
movq %rbx, %rdx
xorl %eax, %eax
callq 0x8290
movb $-0x1, %al
jmp 0x2d6a1
// File: /workspace/github_c_makefile_star2_O2/jonof[P]jftekwar/libsmacker/smacker_jftekwar.c
// Function: smk_render_frame
char smk_render_frame(smk s, unsigned long f)
{
    /* null check */
    if (s == NULL) {
        fputs("libsmacker::smk_render_frame() - ERROR: smk is NULL\n", stderr);
        return -1;
    }
    
    /* rewind (or fast forward!) exactly to f */
    s->cur_frame = f;
    
    /* render the frame: we're ready */
    if ( smk_render(s) < 0) {
        fprintf(stderr, "libsmacker::smk_render_frame(s,%lu) - Warning: frame %lu: smk_render returned errors.\n", f, s->cur_frame);
        goto error;
    }
    
    return 0;
    
error:
    return -1;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
testq %rdi, %rdi
je 0x2d70a
movq %rsi, %rbx
movq %rdi, %r14
movq %rsi, 0x20(%rdi)
callq 0x2c9ef
testb %al, %al
js 0x2d722
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
movq 0x99887(%rip), %rax     # 0xc6f98
movq (%rax), %rsi
leaq 0x6813a(%rip), %rdi     # 0x95855
callq 0x8470
jmp 0x2d741
movq 0x9986f(%rip), %rax     # 0xc6f98
movq (%rax), %rdi
movq 0x20(%r14), %rcx
leaq 0x68153(%rip), %rsi     # 0x9588a
movq %rbx, %rdx
xorl %eax, %eax
callq 0x8290
movb $-0x1, %al
jmp 0x2d702
// File: /workspace/github_c_makefile_star2_O2/jonof[P]jftekwar/libsmacker/smacker.c
// Function: smk_read_file
static char smk_read_file(void * buf, const size_t size, FILE * fp)
{
	/* don't bother checking buf or fp, fread does it for us */
	size_t bytesRead = fread(buf, 1, size, fp);

	if (bytesRead != size) {
		fprintf(stderr, "libsmacker::smk_read_file(buf,%lu,fp) - ERROR: Short read, %lu bytes returned\n", (unsigned long)size, (unsigned long)bytesRead);
		perror("\tReason");
		return -1;
	}

	return 0;
}

// Assembly:
pushq %rbx
movq %rdx, %rcx
movq %rsi, %rbx
pushq $0x1
popq %rsi
movq %rbx, %rdx
callq 0x87a0
cmpq %rbx, %rax
jne 0x2d760
xorl %eax, %eax
popq %rbx
retq
movq 0x99831(%rip), %rcx     # 0xc6f98
movq (%rcx), %rdi
leaq 0x689ce(%rip), %rsi     # 0x9613f
movq %rbx, %rdx
movq %rax, %rcx
xorl %eax, %eax
callq 0x8290
leaq 0x68a09(%rip), %rdi     # 0x9618e
callq 0x83f0
movb $-0x1, %al
jmp 0x2d75e
// File: /workspace/github_c_makefile_star2_O2/jonof[P]jftekwar/libsmacker/smacker.c
// Function: smk_read_memory
static char smk_read_memory(void * buf, const unsigned long size, unsigned char ** p, unsigned long * p_size)
{
	if (size > *p_size) {
		fprintf(stderr, "libsmacker::smk_read_memory(buf,%lu,p,%lu) - ERROR: Short read\n", (unsigned long)size, (unsigned long)*p_size);
		return -1;
	}

	memcpy(buf, *p, size);
	*p += size;
	*p_size -= size;
	return 0;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rcx, %r14
movq %rsi, %rbx
movq (%rcx), %rcx
cmpq %rsi, %rcx
jb 0x2d7bd
movq %rdx, %r15
movq (%rdx), %rsi
movq %rbx, %rdx
callq 0x80e0
addq %rbx, (%r15)
subq %rbx, (%r14)
xorl %eax, %eax
popq %rbx
popq %r14
popq %r15
retq
movq 0x997d4(%rip), %rax     # 0xc6f98
movq (%rax), %rdi
leaq 0x689c8(%rip), %rsi     # 0x96196
movq %rbx, %rdx
xorl %eax, %eax
callq 0x8290
movb $-0x1, %al
jmp 0x2d7b7
// File: /workspace/github_c_makefile_star2_O2/jonof[P]jftekwar/libsmacker/smacker.c
// Function: smk_bs_read_1
static int smk_bs_read_1(struct smk_bit_t * const bs)
{
	int ret;
	/* null check */
	assert(bs);

	/* don't die when running out of bits, but signal */
	if (bs->buffer >= bs->end) {
		fputs("libsmacker::smk_bs_read_1(): ERROR: bitstream exhausted.\n", stderr);
		return -1;
	}

	/* get next bit and store for return */
	ret = (*bs->buffer >> bs->bit_num) & 1;

	/* advance to next bit */
	if (bs->bit_num >= 7) {
		/* Out of bits in this byte: next! */
		bs->buffer ++;
		bs->bit_num = 0;
	} else
		bs->bit_num ++;

	return ret;
}

// Assembly:
pushq %rax
testq %rdi, %rdi
je 0x2d82c
movq (%rdi), %rsi
cmpq 0x8(%rdi), %rsi
jae 0x2d811
movzbl (%rsi), %ecx
movl 0x10(%rdi), %edx
xorl %eax, %eax
btl %edx, %ecx
setb %cl
cmpl $0x7, %edx
jb 0x2d808
incq %rsi
movq %rsi, (%rdi)
xorl %edx, %edx
jmp 0x2d80a
incl %edx
movb %cl, %al
movl %edx, 0x10(%rdi)
popq %rcx
retq
movq 0x99780(%rip), %rax     # 0xc6f98
movq (%rax), %rsi
leaq 0x68cf5(%rip), %rdi     # 0x96517
callq 0x8470
pushq $-0x1
popq %rax
jmp 0x2d80f
leaq 0x69a9f(%rip), %rdi     # 0x972d2
leaq 0x67a99(%rip), %rsi     # 0x952d3
leaq 0x68cab(%rip), %rcx     # 0x964ec
pushq $0x33
popq %rdx
callq 0x8240
// File: /workspace/github_c_makefile_star2_O2/jonof[P]jftekwar/libsmacker/smacker.c
// Function: smk_huff8_build
static int smk_huff8_build(struct smk_huff8_t * const t, struct smk_bit_t * const bs)
{
	int bit;
	/* null check */
	assert(t);
	assert(bs);

	/* Smacker huff trees begin with a set-bit. */
	if ((bit = smk_bs_read_1(bs)) < 0) {
		fputs("libsmacker::smk_huff8_build() - ERROR: initial get_bit returned -1\n", stderr);
		return 0;
	}

	/* OK to fill out the struct now */
	t->size = 0;

	/* First bit indicates whether a tree is present or not. */
	/*  Very small or audio-only files may have no tree. */
	if (bit) {
		if (! _smk_huff8_build_rec(t, bs)) {
			fputs("libsmacker::smk_huff8_build() - ERROR: tree build failed\n", stderr);
			return 0;
		}
	} else
		t->tree[0] = 0;

	/* huff trees end with an unset-bit */
	if ((bit = smk_bs_read_1(bs)) < 0) {
		fputs("libsmacker::smk_huff8_build() - ERROR: final get_bit returned -1\n", stderr);
		return 0;
	}

	/* a 0 is expected here, a 1 generally indicates a problem! */
	if (bit) {
		fputs("libsmacker::smk_huff8_build() - ERROR: final get_bit returned 1\n", stderr);
		return 0;
	}

	return 1;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
testq %rdi, %rdi
je 0x2d8dc
movq %rsi, %rbx
testq %rsi, %rsi
je 0x2d8fb
movq %rdi, %r14
movq %rbx, %rdi
callq 0x2d7dc
testl %eax, %eax
js 0x2d8b0
andq $0x0, (%r14)
testl %eax, %eax
je 0x2d891
movq %r14, %rdi
movq %rbx, %rsi
callq 0x2db7c
testl %eax, %eax
jne 0x2d897
leaq 0x68d4e(%rip), %rdi     # 0x965dd
jmp 0x2d8c9
andw $0x0, 0x8(%r14)
movq %rbx, %rdi
callq 0x2d7dc
testl %eax, %eax
js 0x2d8b9
jne 0x2d8c2
pushq $0x1
popq %rax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
leaq 0x68ce2(%rip), %rdi     # 0x96599
jmp 0x2d8c9
leaq 0x68d57(%rip), %rdi     # 0x96617
jmp 0x2d8c9
leaq 0x68d90(%rip), %rdi     # 0x96659
movq 0x996c8(%rip), %rax     # 0xc6f98
movq (%rax), %rsi
callq 0x8470
xorl %eax, %eax
jmp 0x2d8a8
leaq 0x553e6(%rip), %rdi     # 0x82cc9
leaq 0x679e9(%rip), %rsi     # 0x952d3
leaq 0x68c60(%rip), %rcx     # 0x96551
movl $0xb3, %edx
callq 0x8240
leaq 0x699d0(%rip), %rdi     # 0x972d2
leaq 0x679ca(%rip), %rsi     # 0x952d3
leaq 0x68c41(%rip), %rcx     # 0x96551
movl $0xb4, %edx
callq 0x8240
// File: /workspace/github_c_makefile_star2_O2/jonof[P]jftekwar/libsmacker/smacker.c
// Function: smk_bs_read_8
static int smk_bs_read_8(struct smk_bit_t * const bs)
{
	/* null check */
	assert(bs);

	/* don't die when running out of bits, but signal */
	if (bs->buffer + (bs->bit_num > 0) >= bs->end) {
		fputs("libsmacker::smk_bs_read_8(): ERROR: bitstream exhausted.\n", stderr);
		return -1;
	}

	if (bs->bit_num) {
		/* unaligned read */
		int ret = *bs->buffer >> bs->bit_num;
		bs->buffer ++;
		return ret | (*bs->buffer << (8 - bs->bit_num) & 0xFF);
	}

	/* aligned read */
	return *bs->buffer++;
}

// Assembly:
pushq %rax
testq %rdi, %rdi
je 0x2d981
movq (%rdi), %rax
movl 0x10(%rdi), %ecx
cmpl $0x1, %ecx
movq %rax, %rdx
sbbq $-0x1, %rdx
cmpq 0x8(%rdi), %rdx
jae 0x2d966
testl %ecx, %ecx
je 0x2d95a
movzbl (%rax), %edx
shrl %cl, %edx
leaq 0x1(%rax), %rsi
movq %rsi, (%rdi)
movzbl 0x1(%rax), %esi
movb $0x8, %al
subb %cl, %al
movl %eax, %ecx
shll %cl, %esi
movzbl %sil, %eax
orl %edx, %eax
jmp 0x2d964
leaq 0x1(%rax), %rcx
movq %rcx, (%rdi)
movzbl (%rax), %eax
popq %rcx
retq
movq 0x9962b(%rip), %rax     # 0xc6f98
movq (%rax), %rsi
leaq 0x68ea3(%rip), %rdi     # 0x9681a
callq 0x8470
pushq $-0x1
popq %rax
jmp 0x2d964
leaq 0x6994a(%rip), %rdi     # 0x972d2
leaq 0x67944(%rip), %rsi     # 0x952d3
leaq 0x68e59(%rip), %rcx     # 0x967ef
pushq $0x4e
popq %rdx
callq 0x8240
// File: /workspace/github_c_makefile_star2_O2/jonof[P]jftekwar/libsmacker/smacker.c
// Function: smk_huff8_build_rec
static int _smk_huff8_build_rec(struct smk_huff8_t * const t, struct smk_bit_t * const bs)
{
	int bit, value;
	assert(t);
	assert(bs);

	/* Make sure we aren't running out of bounds */
	if (t->size >= 511) {
		fputs("libsmacker::_smk_huff8_build_rec() - ERROR: size exceeded\n", stderr);
		return 0;
	}

	/* Read the next bit */
	if ((bit = smk_bs_read_1(bs)) < 0) {
		fputs("libsmacker::_smk_huff8_build_rec() - ERROR: get_bit returned -1\n", stderr);
		return 0;
	}

	if (bit) {
		/* Bit set: this forms a Branch node.
			what we have to do is build the left-hand branch,
			assign the "jump" address,
			then build the right hand branch from there.
		*/
		/* track the current index */
		value = t->size ++;

		/* go build the left branch */
		if (! _smk_huff8_build_rec(t, bs)) {
			fputs("libsmacker::_smk_huff8_build_rec() - ERROR: failed to build left sub-tree\n", stderr);
			return 0;
		}

		/* now go back to our current location, and
			mark our location as a "jump" */
		t->tree[value] = SMK_HUFF8_BRANCH | t->size;

		/* continue building the right side */
		if (! _smk_huff8_build_rec(t, bs)) {
			fputs("libsmacker::_smk_huff8_build_rec() - ERROR: failed to build right sub-tree\n", stderr);
			return 0;
		}
	} else {
		/* Bit unset signifies a Leaf node. */
		/* Attempt to read value */
		if ((value = smk_bs_read_8(bs)) < 0) {
			fputs("libsmacker::_smk_huff8_build_rec() - ERROR: get_byte returned -1\n", stderr);
			return 0;
		}

		/* store to tree */
		t->tree[t->size ++] = value;
	}

	return 1;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
cmpq $0x1ff, (%rdi)          # imm = 0x1FF
jae 0x2dc14
movq %rsi, %r14
movq %rdi, %rbx
movq %rsi, %rdi
callq 0x2d7dc
testl %eax, %eax
js 0x2dc27
je 0x2dbf0
movq (%rbx), %r15
leaq 0x1(%r15), %rax
movq %rax, (%rbx)
movq %rbx, %rdi
movq %r14, %rsi
callq 0x2db7c
testl %eax, %eax
je 0x2dc3a
movl $0x8000, %eax           # imm = 0x8000
orl (%rbx), %eax
movslq %r15d, %rcx
movw %ax, 0x8(%rbx,%rcx,2)
movq %rbx, %rdi
movq %r14, %rsi
callq 0x2db7c
testl %eax, %eax
jne 0x2dc0b
movq 0x993b4(%rip), %rax     # 0xc6f98
movq (%rax), %rsi
leaq 0x68b73(%rip), %rdi     # 0x96761
jmp 0x2dc5e
movq %r14, %rdi
callq 0x2d91a
testl %eax, %eax
js 0x2dc4d
movq (%rbx), %rcx
leaq 0x1(%rcx), %rdx
movq %rdx, (%rbx)
movw %ax, 0x8(%rbx,%rcx,2)
pushq $0x1
popq %rax
popq %rbx
popq %r14
popq %r15
retq
movq 0x9937d(%rip), %rax     # 0xc6f98
movq (%rax), %rsi
leaq 0x68a75(%rip), %rdi     # 0x9669a
jmp 0x2dc5e
movq 0x9936a(%rip), %rax     # 0xc6f98
movq (%rax), %rsi
leaq 0x68a9d(%rip), %rdi     # 0x966d5
jmp 0x2dc5e
movq 0x99357(%rip), %rax     # 0xc6f98
movq (%rax), %rsi
leaq 0x68acb(%rip), %rdi     # 0x96716
jmp 0x2dc5e
movq 0x99344(%rip), %rax     # 0xc6f98
movq (%rax), %rsi
leaq 0x68b4f(%rip), %rdi     # 0x967ad
callq 0x8470
xorl %eax, %eax
jmp 0x2dc0e
// File: /workspace/github_c_makefile_star2_O2/jonof[P]jftekwar/libsmacker/smacker.c
// Function: smk_huff8_lookup
static int smk_huff8_lookup(const struct smk_huff8_t * const t, struct smk_bit_t * const bs)
{
	int bit, index = 0;
	/* null check */
	assert(t);
	assert(bs);

	while (t->tree[index] & SMK_HUFF8_BRANCH) {
		if ((bit = smk_bs_read_1(bs)) < 0) {
			fputs("libsmacker::smk_huff8_lookup() - ERROR: get_bit returned -1\n", stderr);
			return -1;
		}

		if (bit) {
			/* take the right branch */
			index = t->tree[index] & SMK_HUFF8_LEAF_MASK;
		} else {
			/* take the left branch */
			index ++;
		}
	}

	/* at leaf node.  return the value at this point. */
	return t->tree[index];
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
testq %rdi, %rdi
je 0x2dcd1
movq %rsi, %rbx
testq %rsi, %rsi
je 0x2dcf0
movq %rdi, %r14
xorl %ebp, %ebp
movslq %ebp, %r15
movswl 0x8(%r14,%r15,2), %eax
testl %eax, %eax
jns 0x2dcc6
movq %rbx, %rdi
callq 0x2d7dc
testl %eax, %eax
js 0x2dcad
je 0x2dca9
movzwl 0x8(%r14,%r15,2), %ebp
andl $0x7fff, %ebp           # imm = 0x7FFF
jmp 0x2dc80
incl %ebp
jmp 0x2dc80
movq 0x992e4(%rip), %rax     # 0xc6f98
movq (%rax), %rsi
leaq 0x68e35(%rip), %rdi     # 0x96af3
callq 0x8470
pushq $-0x1
popq %rax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
leaq 0x54ff1(%rip), %rdi     # 0x82cc9
leaq 0x675f4(%rip), %rsi     # 0x952d3
leaq 0x68dbe(%rip), %rcx     # 0x96aa4
movl $0xde, %edx
callq 0x8240
leaq 0x695db(%rip), %rdi     # 0x972d2
leaq 0x675d5(%rip), %rsi     # 0x952d3
leaq 0x68d9f(%rip), %rcx     # 0x96aa4
movl $0xdf, %edx
callq 0x8240
// File: /workspace/github_c_makefile_star2_O2/jonof[P]jftekwar/libsmacker/smacker.c
// Function: smk_huff16_lookup
static int smk_huff16_lookup(struct smk_huff16_t * const t, struct smk_bit_t * const bs)
{
	int bit, value, index = 0;
	/* null check */
	assert(t);
	assert(bs);

	while (t->tree[index] & SMK_HUFF16_BRANCH) {
		if ((bit = smk_bs_read_1(bs)) < 0) {
			fputs("libsmacker::smk_huff16_lookup() - ERROR: get_bit returned -1\n", stderr);
			return -1;
		}

		if (bit) {
			/* take the right branch */
			index = t->tree[index] & SMK_HUFF16_LEAF_MASK;
		} else {
			/* take the left branch */
			index ++;
		}
	}

	/* Get the value at this point */
	value = t->tree[index];

	if (value & SMK_HUFF16_CACHE) {
		/* uses cached value instead of actual value */
		value = t->cache[value & SMK_HUFF16_LEAF_MASK];
	}

	if (t->cache[0] != value) {
		/* Update the cache, by moving val to the front of the queue,
			if it isn't already there. */
		t->cache[2] = t->cache[1];
		t->cache[1] = t->cache[0];
		t->cache[0] = value;
	}

	return value;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
testq %rdi, %rdi
je 0x2ddb1
movq %rsi, %r14
testq %rsi, %rsi
je 0x2ddd0
movq %rdi, %rbx
xorl %r15d, %r15d
movl $0x3fffffff, %ebp       # imm = 0x3FFFFFFF
movq (%rbx), %rax
movslq %r15d, %r12
movl (%rax,%r12,4), %eax
testl %eax, %eax
jns 0x2dd64
movq %r14, %rdi
callq 0x2d7dc
testl %eax, %eax
js 0x2dd96
je 0x2dd5f
movq (%rbx), %rax
movl (%rax,%r12,4), %r15d
andl %ebp, %r15d
jmp 0x2dd37
incl %r15d
jmp 0x2dd37
cmpl $0x40000000, %eax       # imm = 0x40000000
jb 0x2dd75
andl $0x3fffffff, %eax       # imm = 0x3FFFFFFF
movzwl 0x10(%rbx,%rax,2), %eax
movzwl 0x10(%rbx), %ecx
cmpl %ecx, %eax
je 0x2dd8d
movzwl 0x12(%rbx), %edx
movw %dx, 0x14(%rbx)
movw %cx, 0x12(%rbx)
movw %ax, 0x10(%rbx)
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
movq 0x991fb(%rip), %rax     # 0xc6f98
movq (%rax), %rsi
leaq 0x6946a(%rip), %rdi     # 0x97211
callq 0x8470
pushq $-0x1
popq %rax
jmp 0x2dd8d
leaq 0x54f11(%rip), %rdi     # 0x82cc9
leaq 0x67514(%rip), %rsi     # 0x952d3
leaq 0x69400(%rip), %rcx     # 0x971c6
movl $0x1c4, %edx            # imm = 0x1C4
callq 0x8240
leaq 0x694fb(%rip), %rdi     # 0x972d2
leaq 0x674f5(%rip), %rsi     # 0x952d3
leaq 0x693e1(%rip), %rcx     # 0x971c6
movl $0x1c5, %edx            # imm = 0x1C5
callq 0x8240
nop
// File: /workspace/github_c_makefile_star2_O2/jonof[P]jftekwar/src/startgtk_game.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.chooseimportbutton, FALSE);
    gtk_widget_set_sensitive(controls.importinfobutton, 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 0x2f6c7d(%rip), %r14    # 0x324e90
callq 0x8fd0
movq %r14, %rdi
movq %rax, %rsi
callq 0x8160
pushq $0x1
popq %rsi
movq %rax, %rdi
callq 0x9230
movq 0x2f6c63(%rip), %r14    # 0x324e98
callq 0x8b90
movq %r14, %rdi
movq %rax, %rsi
callq 0x8160
leaq 0xd0d(%rip), %rsi       # 0x2ef59
movq %rax, %rdi
xorl %edx, %edx
callq 0x8bb0
movq 0x2f6c43(%rip), %rdi    # 0x324ea0
xorl %esi, %esi
callq 0x91a0
movq 0x2f6c7d(%rip), %rdi    # 0x324ee8
xorl %esi, %esi
callq 0x91a0
movq 0x2f6c77(%rip), %rdi    # 0x324ef0
xorl %esi, %esi
callq 0x91a0
movq 0x2f6c01(%rip), %rdi    # 0x324e88
movl %ebx, %esi
callq 0x91a0
movq 0x2f6beb(%rip), %rdi    # 0x324e80
xorl %esi, %esi
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0x91a0
// File: /workspace/github_c_makefile_star2_O2/jonof[P]jftekwar/src/startgtk_game.c
// Function: startwin_puts_inner
static gboolean startwin_puts_inner(gpointer str)
{
    GtkTextBuffer *textbuffer;
    GtkTextIter enditer;
    GtkTextMark *mark;
    const char *aptr, *bptr;

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

    gtk_text_buffer_get_end_iter(textbuffer, &enditer);
    for (aptr = bptr = (const char *)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);

    free(str);
    return FALSE;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x58, %rsp
movq %rdi, %rbx
movq 0x2f6b4c(%rip), %r14    # 0x324ea8
callq 0x8990
movq %rax, %r15
movq %r14, %rdi
movq %rax, %rsi
callq 0x8160
movq %rax, %rdi
callq 0x8350
movq %rax, %r14
leaq 0x8(%rsp), %r12
movq %rax, %rdi
movq %r12, %rsi
callq 0x8f00
pushq $0x1
popq %rbp
movq %rbx, %r13
movq %r13, %rdx
movb (%r13), %al
xorl %ecx, %ecx
testb %al, %al
je 0x2e3ea
movzbl (%r13), %esi
testl %esi, %esi
je 0x2e3d8
cmpl $0x8, %esi
je 0x2e3b2
incq %r13
incl %ecx
jmp 0x2e399
cmpq %rdx, %r13
jbe 0x2e3c4
decl %ecx
movq %r14, %rdi
movq %r12, %rsi
callq 0x8c60
movq %r14, %rdi
movq %r12, %rsi
xorl %edx, %edx
movl %ebp, %ecx
callq 0x87f0
incq %r13
jmp 0x2e390
cmpq %rdx, %r13
jbe 0x2e390
movq %r14, %rdi
movq %r12, %rsi
callq 0x8c60
jmp 0x2e390
leaq 0x8(%rsp), %rdx
pushq $0x1
popq %rcx
movq %r14, %rdi
xorl %esi, %esi
callq 0x8e50
movq %rax, %r12
movq 0x2f6aa2(%rip), %rdi    # 0x324ea8
movq %r15, %rsi
callq 0x8160
movsd 0x68e3a(%rip), %xmm2    # 0x97250
xorps %xmm0, %xmm0
xorps %xmm1, %xmm1
movq %rax, %rdi
movq %r12, %rsi
xorl %edx, %edx
callq 0x8030
movq %r14, %rdi
movq %r12, %rsi
callq 0x8050
movq %rbx, %rdi
callq 0x8270
xorl %eax, %eax
addq $0x58, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/jonof[P]jftekwar/src/startgtk_game.c
// Function: on_importinfobutton_clicked
static void on_importinfobutton_clicked(GtkButton *button, gpointer user_data)
{
    GtkWidget *dialog;

    (void)button; (void)user_data;

    dialog = gtk_message_dialog_new(startwin, GTK_DIALOG_DESTROY_WITH_PARENT,
        GTK_MESSAGE_INFO, GTK_BUTTONS_CLOSE,
        "JFTekWar can scan locations of your choosing for TekWar game data");
    gtk_message_dialog_format_secondary_markup(GTK_MESSAGE_DIALOG(dialog),
        "Click the 'Choose a location...' button, then locate a folder to scan.\n\n"
        "Common locations to check include:\n"
        " • CD/DVD drives\n"
        " • Unzipped data from copies of the full DOS game");
    gtk_dialog_run(GTK_DIALOG(dialog));
    gtk_widget_destroy(dialog);
}

// Assembly:
pushq %rbx
movq 0x2f626c(%rip), %rdi    # 0x324e70
leaq 0x68837(%rip), %r8      # 0x97442
pushq $0x2
popq %rcx
movl %ecx, %esi
xorl %edx, %edx
xorl %eax, %eax
callq 0x8d30
movq %rax, %rbx
callq 0x8d80
movq %rbx, %rdi
movq %rax, %rsi
callq 0x8160
leaq 0x68851(%rip), %rsi     # 0x97484
movq %rax, %rdi
xorl %eax, %eax
callq 0x8ec0
callq 0x8980
movq %rbx, %rdi
movq %rax, %rsi
callq 0x8160
movq %rax, %rdi
callq 0x8360
movq %rbx, %rdi
popq %rbx
jmp 0x81e0
// File: /workspace/github_c_makefile_star2_O2/jonof[P]jftekwar/jfbuild/src/mmulti.c
// Function: initmultiplayers_reset
static void initmultiplayers_reset(void)
{
	int i;

	initcrc16();
	memset(icnt0,0,sizeof(icnt0));
	memset(ocnt0,0,sizeof(ocnt0));
	memset(ocnt1,0,sizeof(ocnt1));
	memset(ipak,0,sizeof(ipak));
	//memset(opak,0,sizeof(opak)); //Don't need to init opak
	//memset(pakmem,0,sizeof(pakmem)); //Don't need to init pakmem
#if (SIMLAG > 1)
	memset(simlagcnt,0,sizeof(simlagcnt));
#endif

	lastsendtims[0] = GetTickCount();
	for(i=0;i<MAXPLAYERS;i++) {
		lastsendtims[i] = lastsendtims[0];
		lastrecvtims[i] = prevlastrecvtims[i] = 0;
		connectpoint2[i] = -1;
		playerslive[i] = 0;
	}
	connecthead = 0;
	numplayers = 1; myconnectindex = 0;

	memset(otherhost,0,sizeof(otherhost));
}

// Assembly:
xorl %eax, %eax
pushq $0x7
popq %rcx
leaq 0xb5806c(%rip), %rdx    # 0xbabe30
cmpq $0x100, %rax            # imm = 0x100
je 0x53e11
movl %eax, %esi
shll $0x8, %esi
xorl %r8d, %r8d
movl %ecx, %edi
testl %edi, %edi
js 0x53e05
movl %r8d, %r9d
addl %r8d, %r9d
movzwl %r9w, %r9d
movl %r9d, %r10d
xorl $0x1021, %r10d          # imm = 0x1021
xorw %si, %r8w
cmovnsl %r9d, %r10d
decl %edi
addl %esi, %esi
andl $0xfe00, %esi           # imm = 0xFE00
movl %r10d, %r8d
jmp 0x53dd6
movzwl %r8w, %esi
movl %esi, (%rdx,%rax,4)
incq %rax
jmp 0x53dc4
pushq %rbx
xorps %xmm0, %xmm0
movaps %xmm0, 0x747f74(%rip)   # 0x79bd90
movaps %xmm0, 0x747f5d(%rip)   # 0x79bd80
movaps %xmm0, 0x747f46(%rip)   # 0x79bd70
movaps %xmm0, 0x747f2f(%rip)   # 0x79bd60
movaps %xmm0, 0x74ff68(%rip)   # 0x7a3da0
movaps %xmm0, 0x74ff71(%rip)   # 0x7a3db0
movaps %xmm0, 0x74ff7a(%rip)   # 0x7a3dc0
movaps %xmm0, 0x74ff83(%rip)   # 0x7a3dd0
movaps %xmm0, 0x74ff8c(%rip)   # 0x7a3de0
movaps %xmm0, 0x74ff95(%rip)   # 0x7a3df0
movaps %xmm0, 0x74ff9e(%rip)   # 0x7a3e00
movaps %xmm0, 0x74ffa7(%rip)   # 0x7a3e10
leaq 0x747f30(%rip), %rdi    # 0x79bda0
xorl %ebx, %ebx
movl $0x8000, %edx           # imm = 0x8000
xorl %esi, %esi
callq 0x8440
callq 0x54db7
movl %eax, 0x747d97(%rip)    # 0x79bc20
leaq 0x747d80(%rip), %rcx    # 0x79bc10
leaq 0x747d89(%rip), %rdx    # 0x79bc20
leaq 0x747d32(%rip), %rsi    # 0x79bbd0
leaq 0x747ceb(%rip), %rdi    # 0x79bb90
leaq 0x747c94(%rip), %r8     # 0x79bb40
cmpq $0x40, %rbx
je 0x53ece
andl $0x0, (%rbx,%rsi)
andl $0x0, (%rbx,%rdi)
orl $-0x1, (%rbx,%r8)
movl %eax, (%rbx,%rdx)
movb $0x0, (%rcx)
addq $0x4, %rbx
incq %rcx
jmp 0x53eac
andl $0x0, 0x747c5b(%rip)    # 0x79bb30
movl $0x1, 0x747c4d(%rip)    # 0x79bb2c
andl $0x0, 0x747c3e(%rip)    # 0x79bb24
leaq 0x747263(%rip), %rdi    # 0x79b150
movl $0x800, %edx            # imm = 0x800
xorl %esi, %esi
popq %rbx
jmp 0x8440
// File: /workspace/github_c_makefile_star2_O2/jonof[P]jftekwar/jfbuild/src/mmulti.c
// Function: presentaddress
static const char *presentaddress(struct sockaddr *a) {
	static char str[128+32];
	char addr[128];
	int port;

	if (a->sa_family == AF_INET) {
		struct sockaddr_in *s = (struct sockaddr_in *)a;
		inet_ntop(AF_INET, &s->sin_addr, addr, sizeof(addr));
		port = ntohs(s->sin_port);
	} else if (a->sa_family == AF_INET6) {
		struct sockaddr_in6 *s = (struct sockaddr_in6 *)a;
		strcpy(addr, "[");
		inet_ntop(AF_INET6, &s->sin6_addr, addr+1, sizeof(addr)-2);
		strcat(addr, "]");
		port = ntohs(s->sin6_port);
	} else {
		return NULL;
	}

	strcpy(str, addr);
	sprintf(addr, ":%d", port);
	strcat(str, addr);

	return str;
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
subq $0x80, %rsp
movq %rdi, %rbx
movzwl (%rdi), %eax
cmpl $0xa, %eax
je 0x5451e
cmpl $0x2, %eax
jne 0x54586
leaq 0x4(%rbx), %rsi
pushq $0x2
popq %rdi
movq %rsp, %rdx
movl $0x80, %ecx
callq 0x82c0
jmp 0x54546
leaq 0x1(%rsp), %rdx
movw $0x5b, -0x1(%rdx)
leaq 0x8(%rbx), %rsi
pushq $0xa
popq %rdi
pushq $0x7e
popq %rcx
callq 0x82c0
movq %rsp, %rdi
callq 0x85a0
movw $0x5d, (%rsp,%rax)
movzwl 0x2(%rbx), %eax
rolw $0x8, %ax
movzwl %ax, %ebp
leaq 0xb57cd8(%rip), %rbx    # 0xbac230
movq %rsp, %r14
movq %rbx, %rdi
movq %r14, %rsi
callq 0x85b0
leaq 0x4465c(%rip), %rsi     # 0x98bc9
movq %r14, %rdi
movl %ebp, %edx
xorl %eax, %eax
callq 0x8f20
movq %rbx, %rdi
movq %r14, %rsi
callq 0x89e0
jmp 0x54588
xorl %ebx, %ebx
movq %rbx, %rax
addq $0x80, %rsp
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/jonof[P]jftekwar/jfbuild/src/mmulti.c
// Function: sendpacket
void sendpacket (int other, unsigned char *bufptr, int messleng)
{
	if (numplayers < 2) return;

	if (pakmemi+messleng+2 > (int)sizeof(pakmem)) pakmemi = 1;
	opak[other][ocnt1[other]&(FIFSIZ-1)] = pakmemi;
	*(short *)&pakmem[pakmemi] = messleng;
	memcpy(&pakmem[pakmemi+2],bufptr,messleng); pakmemi += messleng+2;
	ocnt1[other]++;

	dosendpackets(other);
}

// Assembly:
cmpl $0x2, 0x746b28(%rip)    # 0x79bb2c
jge 0x55007
retq
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movl 0x8485b(%rip), %eax     # 0xd9870
leal (%rax,%rdx), %ecx
cmpl $0x3fffff, %ecx         # imm = 0x3FFFFF
pushq $0x1
popq %rcx
cmovll %eax, %ecx
movslq %edi, %rbx
leaq 0x74edb2(%rip), %r15    # 0x7a3de0
movl (%r15,%rbx,4), %ebp
movl %ebp, %eax
andl $0x1ff, %eax            # imm = 0x1FF
movq %rbx, %rdi
shlq $0xb, %rdi
leaq 0x74edd9(%rip), %r8     # 0x7a3e20
addq %rdi, %r8
movl %ecx, (%r8,%rax,4)
movslq %ecx, %r12
leaq 0x756dc8(%rip), %rax    # 0x7abe20
leaq (%r12,%rax), %rdi
addq $0x2, %rdi
movw %dx, -0x2(%rdi)
movslq %edx, %r14
movq %r14, %rdx
callq 0x80e0
leal (%r14,%r12), %eax
addl $0x2, %eax
movl %eax, 0x847f4(%rip)     # 0xd9870
incl %ebp
movl %ebp, (%r15,%rbx,4)
movl %ebx, %edi
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
jmp 0x54e34