LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_c_makefile_star2_O0/jsummers[P]deark/src/../foreign/dskdcmps.h
// Function: dd_ValidateLinkChains
static void dd_ValidateLinkChains (struct dd_Ctl *Ctl, struct dd_codet * ct, u16 tcode)
{
	u16 tnewer, tolder;
	UI errcode = 0;

	if(Ctl->c->debug_level<3) return;
	tnewer = ct->newer[tcode];
	tolder = ct->older[tcode];
	if (tcode == ct->newest) {
		if (tnewer != 0) {
			errcode += 1;
		}
	}
	else {
		if (ct->older[tnewer] != tcode) {
			errcode += 2;
		}
	}
	if (tcode == ct->oldest) {
		if (tolder != 0) {
			errcode += 4;
		}
	}
	else {
		if (ct->newer[tolder] != tcode) {
			errcode += 8;
		}
	}

	if(errcode) {
		dd_tmsg(Ctl, "Link validation error (%u). tcode: %4x, older: %4x, newer: %4x",
			errcode, tcode, tolder, ct->newer[tolder]);
	}
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movw %dx, %ax
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movw %ax, -0x12(%rbp)
movl $0x0, -0x1c(%rbp)
movq -0x8(%rbp), %rax
movq (%rax), %rax
cmpl $0x3, (%rax)
jge 0x1873ff
jmp 0x1874e4
movq -0x10(%rbp), %rax
movzwl -0x12(%rbp), %ecx
movw 0x200e(%rax,%rcx,2), %ax
movw %ax, -0x14(%rbp)
movq -0x10(%rbp), %rax
movzwl -0x12(%rbp), %ecx
movw 0xe(%rax,%rcx,2), %ax
movw %ax, -0x16(%rbp)
movzwl -0x12(%rbp), %eax
movq -0x10(%rbp), %rcx
movzwl 0xc(%rcx), %ecx
cmpl %ecx, %eax
jne 0x187448
movzwl -0x14(%rbp), %eax
cmpl $0x0, %eax
je 0x187446
movl -0x1c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x1c(%rbp)
jmp 0x187468
movq -0x10(%rbp), %rax
movzwl -0x14(%rbp), %ecx
movzwl 0xe(%rax,%rcx,2), %eax
movzwl -0x12(%rbp), %ecx
cmpl %ecx, %eax
je 0x187466
movl -0x1c(%rbp), %eax
addl $0x2, %eax
movl %eax, -0x1c(%rbp)
jmp 0x187468
movzwl -0x12(%rbp), %eax
movq -0x10(%rbp), %rcx
movzwl 0xa(%rcx), %ecx
cmpl %ecx, %eax
jne 0x18748c
movzwl -0x16(%rbp), %eax
cmpl $0x0, %eax
je 0x18748a
movl -0x1c(%rbp), %eax
addl $0x4, %eax
movl %eax, -0x1c(%rbp)
jmp 0x1874af
movq -0x10(%rbp), %rax
movzwl -0x16(%rbp), %ecx
movzwl 0x200e(%rax,%rcx,2), %eax
movzwl -0x12(%rbp), %ecx
cmpl %ecx, %eax
je 0x1874ad
movl -0x1c(%rbp), %eax
addl $0x8, %eax
movl %eax, -0x1c(%rbp)
jmp 0x1874af
cmpl $0x0, -0x1c(%rbp)
je 0x1874e4
movq -0x8(%rbp), %rdi
movl -0x1c(%rbp), %edx
movzwl -0x12(%rbp), %ecx
movzwl -0x16(%rbp), %r8d
movq -0x10(%rbp), %rax
movzwl -0x16(%rbp), %esi
movzwl 0x200e(%rax,%rsi,2), %r9d
leaq 0x50443(%rip), %rsi     # 0x1d7920
movb $0x0, %al
callq 0x1874f0
addq $0x20, %rsp
popq %rbp
retq
nopw (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/jsummers[P]deark/src/../foreign/dskdcmps.h
// Function: dd_tmsg
static void dd_tmsg(struct dd_Ctl *Ctl, const char *fmt, ...)
{
	va_list ap;

	if (Ctl->c->debug_level<3) return;

	va_start(ap, fmt);
	de_vsnprintf(Ctl->msg, sizeof(Ctl->msg), fmt, ap);
	va_end(ap);

	de_dbg(Ctl->c, "%s", Ctl->msg);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0xe0, %rsp
testb %al, %al
je 0x187528
movaps %xmm0, -0xb0(%rbp)
movaps %xmm1, -0xa0(%rbp)
movaps %xmm2, -0x90(%rbp)
movaps %xmm3, -0x80(%rbp)
movaps %xmm4, -0x70(%rbp)
movaps %xmm5, -0x60(%rbp)
movaps %xmm6, -0x50(%rbp)
movaps %xmm7, -0x40(%rbp)
movq %r9, -0xb8(%rbp)
movq %r8, -0xc0(%rbp)
movq %rcx, -0xc8(%rbp)
movq %rdx, -0xd0(%rbp)
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq -0x8(%rbp), %rax
movq (%rax), %rax
cmpl $0x3, (%rax)
jge 0x18755a
jmp 0x1875bf
leaq -0x30(%rbp), %rax
leaq -0xe0(%rbp), %rcx
movq %rcx, 0x10(%rax)
leaq 0x10(%rbp), %rcx
movq %rcx, 0x8(%rax)
movl $0x30, 0x4(%rax)
movl $0x10, (%rax)
movq -0x8(%rbp), %rdi
addq $0x1050, %rdi           # imm = 0x1050
movq -0x10(%rbp), %rdx
leaq -0x30(%rbp), %rcx
movl $0x1000, %esi           # imm = 0x1000
callq 0x18f9b0
leaq -0x30(%rbp), %rax
movq -0x8(%rbp), %rax
movq (%rax), %rdi
movq -0x8(%rbp), %rdx
addq $0x1050, %rdx           # imm = 0x1050
leaq 0x19577(%rip), %rsi     # 0x1a0b2f
movb $0x0, %al
callq 0x15b0d0
addq $0xe0, %rsp
popq %rbp
retq
nopl (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/jsummers[P]deark/src/../foreign/dskdcmps.h
// Function: dd_UnlinkCode
static void dd_UnlinkCode (struct dd_Ctl *Ctl, struct dd_codet * ct, u16 tcode)
{
	u16 tnewer, tolder;

	dd_ValidateLinkChains(Ctl, ct, ct->oldest);
	tnewer = ct->newer[tcode];
	tolder = ct->older[tcode];
	if (tcode == ct->newest)
		ct->newest = tolder;
	else
		ct->older[tnewer] = tolder;
	if (tcode == ct->oldest)
		ct->oldest = tnewer;
	else
		ct->newer[tolder] = tnewer;
	ct->older[tcode] = ct->newer[tcode] = 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movw %dx, %ax
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movw %ax, -0x12(%rbp)
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
movq -0x10(%rbp), %rax
movzwl 0xa(%rax), %edx
callq 0x1873d0
movq -0x10(%rbp), %rax
movzwl -0x12(%rbp), %ecx
movw 0x200e(%rax,%rcx,2), %ax
movw %ax, -0x14(%rbp)
movq -0x10(%rbp), %rax
movzwl -0x12(%rbp), %ecx
movw 0xe(%rax,%rcx,2), %ax
movw %ax, -0x16(%rbp)
movzwl -0x12(%rbp), %eax
movq -0x10(%rbp), %rcx
movzwl 0xc(%rcx), %ecx
cmpl %ecx, %eax
jne 0x18763f
movw -0x16(%rbp), %cx
movq -0x10(%rbp), %rax
movw %cx, 0xc(%rax)
jmp 0x187650
movw -0x16(%rbp), %dx
movq -0x10(%rbp), %rax
movzwl -0x14(%rbp), %ecx
movw %dx, 0xe(%rax,%rcx,2)
movzwl -0x12(%rbp), %eax
movq -0x10(%rbp), %rcx
movzwl 0xa(%rcx), %ecx
cmpl %ecx, %eax
jne 0x18766e
movw -0x14(%rbp), %cx
movq -0x10(%rbp), %rax
movw %cx, 0xa(%rax)
jmp 0x187682
movw -0x14(%rbp), %dx
movq -0x10(%rbp), %rax
movzwl -0x16(%rbp), %ecx
movw %dx, 0x200e(%rax,%rcx,2)
movq -0x10(%rbp), %rax
movzwl -0x12(%rbp), %ecx
movw $0x0, 0x200e(%rax,%rcx,2)
movq -0x10(%rbp), %rax
movzwl -0x12(%rbp), %ecx
movw $0x0, 0xe(%rax,%rcx,2)
addq $0x20, %rsp
popq %rbp
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O0/jsummers[P]deark/src/fmtutil-huffman.c
// Function: huffman_ensure_alloc
static int huffman_ensure_alloc(deark *c, struct fmtutil_huffman_codebook *bk, NODE_REF_TYPE n)
{
	i64 new_nodes_alloc;

	if(n <= bk->nodes_alloc) return 1;
	if((i64)n > bk->max_nodes) return 0;

	new_nodes_alloc = (i64)bk->nodes_alloc * 2;
	if(new_nodes_alloc > bk->max_nodes) new_nodes_alloc = bk->max_nodes;
	if(new_nodes_alloc < (i64)n) new_nodes_alloc = (i64)n;
	if(new_nodes_alloc < 16) new_nodes_alloc = 16;

	bk->nodes = de_reallocarray(c, bk->nodes, bk->nodes_alloc, sizeof(struct huffman_node),
		new_nodes_alloc);
	bk->nodes_alloc = (NODE_REF_TYPE)new_nodes_alloc;
	return 1;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movl %edx, -0x1c(%rbp)
movl -0x1c(%rbp), %eax
movq -0x18(%rbp), %rcx
cmpl 0xc(%rcx), %eax
ja 0x18794b
movl $0x1, -0x4(%rbp)
jmp 0x1879ed
movl -0x1c(%rbp), %eax
movq -0x18(%rbp), %rcx
cmpq (%rcx), %rax
jle 0x187963
movl $0x0, -0x4(%rbp)
jmp 0x1879ed
movq -0x18(%rbp), %rax
movl 0xc(%rax), %eax
shlq %rax
movq %rax, -0x28(%rbp)
movq -0x28(%rbp), %rax
movq -0x18(%rbp), %rcx
cmpq (%rcx), %rax
jle 0x187989
movq -0x18(%rbp), %rax
movq (%rax), %rax
movq %rax, -0x28(%rbp)
movq -0x28(%rbp), %rax
movl -0x1c(%rbp), %ecx
cmpq %rcx, %rax
jge 0x18799c
movl -0x1c(%rbp), %eax
movq %rax, -0x28(%rbp)
cmpq $0x10, -0x28(%rbp)
jge 0x1879ab
movq $0x10, -0x28(%rbp)
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rax
movq 0x10(%rax), %rsi
movq -0x18(%rbp), %rax
movl 0xc(%rax), %eax
movl %eax, %edx
movq -0x28(%rbp), %r8
movl $0xc, %ecx
callq 0x15c4d0
movq %rax, %rcx
movq -0x18(%rbp), %rax
movq %rcx, 0x10(%rax)
movq -0x28(%rbp), %rax
movl %eax, %ecx
movq -0x18(%rbp), %rax
movl %ecx, 0xc(%rax)
movl $0x1, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x30, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/jsummers[P]deark/src/fmtutil-huffman.c
// Function: huffman_setchildstatus
static void huffman_setchildstatus(struct fmtutil_huffman_codebook *bk, NODE_REF_TYPE n,
	u8 child_idx, u8 newstatus)
{
	if(n>=bk->nodes_alloc) return;
	if(child_idx>1) return;

	if(bk->nodes[n].child_status[child_idx]==newstatus) return;
	if(bk->nodes[n].child_status[child_idx]==CHILDSTATUS_VALUE) {
		bk->num_codes--;
	}
	if(newstatus==CHILDSTATUS_VALUE) {
		bk->num_codes++;
	}
	bk->nodes[n].child_status[child_idx] = newstatus;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movb %cl, %al
movb %dl, %cl
movq %rdi, -0x8(%rbp)
movl %esi, -0xc(%rbp)
movb %cl, -0xd(%rbp)
movb %al, -0xe(%rbp)
movl -0xc(%rbp), %eax
movq -0x8(%rbp), %rcx
cmpl 0xc(%rcx), %eax
jb 0x187a26
jmp 0x187abc
movzbl -0xd(%rbp), %eax
cmpl $0x1, %eax
jle 0x187a34
jmp 0x187abc
movq -0x8(%rbp), %rax
movq 0x10(%rax), %rax
movl -0xc(%rbp), %ecx
imulq $0xc, %rcx, %rcx
addq %rcx, %rax
movzbl -0xd(%rbp), %ecx
movzbl (%rax,%rcx), %eax
movzbl -0xe(%rbp), %ecx
cmpl %ecx, %eax
jne 0x187a58
jmp 0x187abc
movq -0x8(%rbp), %rax
movq 0x10(%rax), %rax
movl -0xc(%rbp), %ecx
imulq $0xc, %rcx, %rcx
addq %rcx, %rax
movzbl -0xd(%rbp), %ecx
movzbl (%rax,%rcx), %eax
cmpl $0x2, %eax
jne 0x187a87
movq -0x8(%rbp), %rax
movq 0x20(%rax), %rcx
addq $-0x1, %rcx
movq %rcx, 0x20(%rax)
movzbl -0xe(%rbp), %eax
cmpl $0x2, %eax
jne 0x187aa0
movq -0x8(%rbp), %rax
movq 0x20(%rax), %rcx
addq $0x1, %rcx
movq %rcx, 0x20(%rax)
movb -0xe(%rbp), %dl
movq -0x8(%rbp), %rax
movq 0x10(%rax), %rax
movl -0xc(%rbp), %ecx
imulq $0xc, %rcx, %rcx
addq %rcx, %rax
movzbl -0xd(%rbp), %ecx
movb %dl, (%rax,%rcx)
popq %rbp
retq
nop
// File: /workspace/github_c_makefile_star2_O0/jsummers[P]deark/src/fmtutil-huffman.c
// Function: fmtutil_huffman_decode_bit
int fmtutil_huffman_decode_bit(struct fmtutil_huffman_codebook *bk, struct fmtutil_huffman_cursor *cursor,
	u8 bitval, fmtutil_huffman_valtype *pval)
{
	UI child_idx;
	int retval = 0;
	NODE_REF_TYPE curr_noderef = cursor->curr_noderef;

	if(curr_noderef >= bk->nodes_alloc) goto done;
	if(curr_noderef >= bk->next_avail_node) goto done;
	child_idx = bitval & 0x01;

	if(bk->nodes[curr_noderef].child_status[child_idx]==CHILDSTATUS_VALUE) {
		*pval = bk->nodes[curr_noderef].child[child_idx].hnvd.value;
		retval = 1;
		goto done;
	}
	else if(bk->nodes[curr_noderef].child_status[child_idx]==CHILDSTATUS_POINTER) {
		cursor->curr_noderef = bk->nodes[curr_noderef].child[child_idx].hnpd.noderef;
		retval = 2;
		goto done;
	}

done:
	if(retval!=2) {
		fmtutil_huffman_reset_cursor(cursor);
	}
	return retval;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movb %dl, %al
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movb %al, -0x11(%rbp)
movq %rcx, -0x20(%rbp)
movl $0x0, -0x28(%rbp)
movq -0x10(%rbp), %rax
movl (%rax), %eax
movl %eax, -0x2c(%rbp)
movl -0x2c(%rbp), %eax
movq -0x8(%rbp), %rcx
cmpl 0xc(%rcx), %eax
jb 0x187afa
jmp 0x187ba5
movl -0x2c(%rbp), %eax
movq -0x8(%rbp), %rcx
cmpl 0x8(%rcx), %eax
jb 0x187b0b
jmp 0x187ba5
movzbl -0x11(%rbp), %eax
andl $0x1, %eax
movl %eax, -0x24(%rbp)
movq -0x8(%rbp), %rax
movq 0x10(%rax), %rax
movl -0x2c(%rbp), %ecx
imulq $0xc, %rcx, %rcx
addq %rcx, %rax
movl -0x24(%rbp), %ecx
movzbl (%rax,%rcx), %eax
cmpl $0x2, %eax
jne 0x187b5b
movq -0x8(%rbp), %rax
movq 0x10(%rax), %rax
movl -0x2c(%rbp), %ecx
imulq $0xc, %rcx, %rcx
addq %rcx, %rax
movl -0x24(%rbp), %ecx
movl 0x4(%rax,%rcx,4), %ecx
movq -0x20(%rbp), %rax
movl %ecx, (%rax)
movl $0x1, -0x28(%rbp)
jmp 0x187ba5
movq -0x8(%rbp), %rax
movq 0x10(%rax), %rax
movl -0x2c(%rbp), %ecx
imulq $0xc, %rcx, %rcx
addq %rcx, %rax
movl -0x24(%rbp), %ecx
movzbl (%rax,%rcx), %eax
cmpl $0x1, %eax
jne 0x187ba1
movq -0x8(%rbp), %rax
movq 0x10(%rax), %rax
movl -0x2c(%rbp), %ecx
imulq $0xc, %rcx, %rcx
addq %rcx, %rax
movl -0x24(%rbp), %ecx
movl 0x4(%rax,%rcx,4), %ecx
movq -0x10(%rbp), %rax
movl %ecx, (%rax)
movl $0x2, -0x28(%rbp)
jmp 0x187ba5
jmp 0x187ba3
jmp 0x187ba5
cmpl $0x2, -0x28(%rbp)
je 0x187bb4
movq -0x10(%rbp), %rdi
callq 0x187700
movl -0x28(%rbp), %eax
addq $0x30, %rsp
popq %rbp
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O0/jsummers[P]deark/src/fmtutil-huffman.c
// Function: fmtutil_huffman_read_next_value
int fmtutil_huffman_read_next_value(struct fmtutil_huffman_codebook *bk,
	struct de_bitreader *bitrd, fmtutil_huffman_valtype *pval, UI *pnbits)
{
	int bitcount = 0;
	int retval = 0;
	struct fmtutil_huffman_cursor tmpcursor;

	if(bitrd->eof_flag) goto done;
	tmpcursor.curr_noderef = 0;

	if(bk->has_null_code) {
		*pval = bk->value_of_null_code;
		retval = 1;
		goto done;
	}

	while(1) {
		int ret;
		u8 b;

		b = (u8)de_bitreader_getbits(bitrd, 1);
		if(bitrd->eof_flag) goto done;
		bitcount++;
		if(bitcount>FMTUTIL_HUFFMAN_MAX_CODE_LENGTH) goto done; // Should be impossible

		ret = fmtutil_huffman_decode_bit(bk, &tmpcursor, b, pval);
		if(ret==1) { // finished the code
			retval = 1;
			goto done;
		}
		else if(ret!=2) { // decoding error
			goto done;
		}
	}
done:
	if(!retval) {
		*pval = 0;
	}
	if(pnbits) {
		*pnbits = retval ? bitcount : 0;
	}
	return retval;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x40, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq %rcx, -0x20(%rbp)
movl $0x0, -0x24(%rbp)
movl $0x0, -0x28(%rbp)
movq -0x10(%rbp), %rax
cmpb $0x0, 0x18(%rax)
je 0x187bf5
jmp 0x187c81
movl $0x0, -0x2c(%rbp)
movq -0x8(%rbp), %rax
cmpb $0x0, 0x18(%rax)
je 0x187c1c
movq -0x8(%rbp), %rax
movl 0x1c(%rax), %ecx
movq -0x18(%rbp), %rax
movl %ecx, (%rax)
movl $0x1, -0x28(%rbp)
jmp 0x187c81
jmp 0x187c1e
movq -0x10(%rbp), %rdi
movl $0x1, %esi
callq 0x16a390
movb %al, -0x31(%rbp)
movq -0x10(%rbp), %rax
cmpb $0x0, 0x18(%rax)
je 0x187c3b
jmp 0x187c81
movl -0x24(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x24(%rbp)
cmpl $0x30, -0x24(%rbp)
jle 0x187c4c
jmp 0x187c81
movq -0x8(%rbp), %rdi
movb -0x31(%rbp), %al
movq -0x18(%rbp), %rcx
leaq -0x2c(%rbp), %rsi
movzbl %al, %edx
callq 0x187ac0
movl %eax, -0x30(%rbp)
cmpl $0x1, -0x30(%rbp)
jne 0x187c75
movl $0x1, -0x28(%rbp)
jmp 0x187c81
cmpl $0x2, -0x30(%rbp)
je 0x187c7d
jmp 0x187c81
jmp 0x187c7f
jmp 0x187c1e
cmpl $0x0, -0x28(%rbp)
jne 0x187c91
movq -0x18(%rbp), %rax
movl $0x0, (%rax)
cmpq $0x0, -0x20(%rbp)
je 0x187cb6
cmpl $0x0, -0x28(%rbp)
je 0x187ca6
movl -0x24(%rbp), %eax
movl %eax, -0x38(%rbp)
jmp 0x187cad
xorl %eax, %eax
movl %eax, -0x38(%rbp)
jmp 0x187cad
movl -0x38(%rbp), %ecx
movq -0x20(%rbp), %rax
movl %ecx, (%rax)
movl -0x28(%rbp), %eax
addq $0x40, %rsp
popq %rbp
retq
nop
// File: /workspace/github_c_makefile_star2_O0/jsummers[P]deark/src/fmtutil-huffman.c
// Function: fmtutil_huffman_record_a_code_length
int fmtutil_huffman_record_a_code_length(deark *c, struct fmtutil_huffman_code_builder *builder,
	fmtutil_huffman_valtype val, UI len)
{
	if(len==0) return 1;
	if(len > FMTUTIL_HUFFMAN_MAX_CODE_LENGTH) return 0;
	if(builder->lengths_arr_numused > MAX_MAX_NODES) return 0;

	if(builder->lengths_arr_numused >= builder->lengths_arr_numalloc) {
		i64 new_numalloc;

		new_numalloc = builder->lengths_arr_numused + 128;
		builder->lengths_arr = de_reallocarray(c, builder->lengths_arr, builder->lengths_arr_numalloc,
			sizeof(struct huffman_lengths_arr_item), new_numalloc);
		builder->lengths_arr_numalloc = new_numalloc;
	}
	builder->lengths_arr[builder->lengths_arr_numused].val = val;
	builder->lengths_arr[builder->lengths_arr_numused++].len = len;
	return 1;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movl %edx, -0x1c(%rbp)
movl %ecx, -0x20(%rbp)
cmpl $0x0, -0x20(%rbp)
jne 0x187f48
movl $0x1, -0x4(%rbp)
jmp 0x18800d
cmpl $0x30, -0x20(%rbp)
jbe 0x187f5a
movl $0x0, -0x4(%rbp)
jmp 0x18800d
movq -0x18(%rbp), %rax
cmpq $0x101d0, 0x8(%rax)     # imm = 0x101D0
jle 0x187f74
movl $0x0, -0x4(%rbp)
jmp 0x18800d
movq -0x18(%rbp), %rax
movq 0x8(%rax), %rax
movq -0x18(%rbp), %rcx
cmpq (%rcx), %rax
jl 0x187fce
movq -0x18(%rbp), %rax
movq 0x8(%rax), %rax
addq $0x80, %rax
movq %rax, -0x28(%rbp)
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rax
movq 0x10(%rax), %rsi
movq -0x18(%rbp), %rax
movq (%rax), %rdx
movq -0x28(%rbp), %r8
movl $0x8, %ecx
callq 0x15c4d0
movq %rax, %rcx
movq -0x18(%rbp), %rax
movq %rcx, 0x10(%rax)
movq -0x28(%rbp), %rcx
movq -0x18(%rbp), %rax
movq %rcx, (%rax)
movl -0x1c(%rbp), %edx
movq -0x18(%rbp), %rax
movq 0x10(%rax), %rax
movq -0x18(%rbp), %rcx
movq 0x8(%rcx), %rcx
movl %edx, (%rax,%rcx,8)
movl -0x20(%rbp), %edx
movq -0x18(%rbp), %rax
movq 0x10(%rax), %rax
movq -0x18(%rbp), %rsi
movq 0x8(%rsi), %rcx
movq %rcx, %rdi
addq $0x1, %rdi
movq %rdi, 0x8(%rsi)
movl %edx, 0x4(%rax,%rcx,8)
movl $0x1, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x30, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/jsummers[P]deark/src/fmtutil-huffman.c
// Function: reverse_lengths_array
static void reverse_lengths_array(struct fmtutil_huffman_code_builder *builder)
{
	i64 i;
	i64 num_swaps = builder->lengths_arr_numused / 2;
	struct huffman_lengths_arr_item tmpitem;

	for(i=0; i<num_swaps; i++) {
		tmpitem = builder->lengths_arr[i]; // struct copy
		builder->lengths_arr[i] = builder->lengths_arr[builder->lengths_arr_numused-1-i];
		builder->lengths_arr[builder->lengths_arr_numused-1-i] = tmpitem;
	}
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rax
movq 0x8(%rax), %rax
movl $0x2, %ecx
cqto
idivq %rcx
movq %rax, -0x18(%rbp)
movq $0x0, -0x10(%rbp)
movq -0x10(%rbp), %rax
cmpq -0x18(%rbp), %rax
jge 0x18820e
movq -0x8(%rbp), %rax
movq 0x10(%rax), %rax
movq -0x10(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movq %rax, -0x20(%rbp)
movq -0x8(%rbp), %rax
movq 0x10(%rax), %rax
movq -0x10(%rbp), %rcx
movq -0x8(%rbp), %rdx
movq 0x10(%rdx), %rdx
movq -0x8(%rbp), %rsi
movq 0x8(%rsi), %rsi
subq $0x1, %rsi
subq -0x10(%rbp), %rsi
movq (%rdx,%rsi,8), %rdx
movq %rdx, (%rax,%rcx,8)
movq -0x8(%rbp), %rax
movq 0x10(%rax), %rax
movq -0x8(%rbp), %rcx
movq 0x8(%rcx), %rcx
subq $0x1, %rcx
subq -0x10(%rbp), %rcx
movq -0x20(%rbp), %rdx
movq %rdx, (%rax,%rcx,8)
movq -0x10(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x10(%rbp)
jmp 0x188196
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O0/jsummers[P]deark/src/fmtutil-huffman.c
// Function: fmtutil_huffman_create_decoder
struct fmtutil_huffman_decoder *fmtutil_huffman_create_decoder(deark *c, i64 initial_codes, i64 max_codes)
{
	struct fmtutil_huffman_decoder *ht = NULL;

	ht = de_malloc(c, sizeof(struct fmtutil_huffman_decoder));
	ht->cursor = de_malloc(c, sizeof(struct fmtutil_huffman_cursor));
	ht->bk = huffman_create_codebook(c, initial_codes, max_codes);
	ht->builder = de_malloc(c, sizeof(struct fmtutil_huffman_code_builder));
	fmtutil_huffman_reset_cursor(ht->cursor);
	return ht;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq $0x0, -0x20(%rbp)
movq -0x8(%rbp), %rdi
movl $0x18, %esi
callq 0x15b780
movq %rax, -0x20(%rbp)
movq -0x8(%rbp), %rdi
movl $0x4, %esi
callq 0x15b780
movq %rax, %rcx
movq -0x20(%rbp), %rax
movq %rcx, (%rax)
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
movq -0x18(%rbp), %rdx
callq 0x188600
movq %rax, %rcx
movq -0x20(%rbp), %rax
movq %rcx, 0x8(%rax)
movq -0x8(%rbp), %rdi
movl $0x18, %esi
callq 0x15b780
movq %rax, %rcx
movq -0x20(%rbp), %rax
movq %rcx, 0x10(%rax)
movq -0x20(%rbp), %rax
movq (%rax), %rdi
callq 0x187700
movq -0x20(%rbp), %rax
addq $0x20, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/jsummers[P]deark/src/fmtutil-huffman.c
// Function: huffman_create_codebook
static struct fmtutil_huffman_codebook *huffman_create_codebook(deark *c,
	i64 initial_codes, i64 max_codes)
{
	struct fmtutil_huffman_codebook *bk;
	i64 initial_nodes;

	bk = de_malloc(c, sizeof(struct fmtutil_huffman_codebook));
	if(max_codes>0) {
		bk->max_nodes = max_codes;
	}
	else {
		bk->max_nodes = MAX_MAX_NODES;
	}
	if(bk->max_nodes > MAX_MAX_NODES) {
		bk->max_nodes = MAX_MAX_NODES;
	}

	if(initial_codes>0) {
		initial_nodes = initial_codes;
	}
	else {
		initial_nodes = 1;
	}
	if(initial_nodes > MAX_MAX_NODES) {
		initial_nodes = MAX_MAX_NODES;
	}

	huffman_ensure_alloc(c, bk, (NODE_REF_TYPE)initial_nodes);
	bk->next_avail_node = 0;
	bk->num_codes = 0;
	bk->max_bits = 0;
	return bk;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq -0x8(%rbp), %rdi
movl $0x30, %esi
callq 0x15b780
movq %rax, -0x20(%rbp)
cmpq $0x0, -0x18(%rbp)
jle 0x18863a
movq -0x18(%rbp), %rcx
movq -0x20(%rbp), %rax
movq %rcx, (%rax)
jmp 0x188645
movq -0x20(%rbp), %rax
movq $0x101d0, (%rax)        # imm = 0x101D0
movq -0x20(%rbp), %rax
cmpq $0x101d0, (%rax)        # imm = 0x101D0
jle 0x18865d
movq -0x20(%rbp), %rax
movq $0x101d0, (%rax)        # imm = 0x101D0
cmpq $0x0, -0x10(%rbp)
jle 0x18866e
movq -0x10(%rbp), %rax
movq %rax, -0x28(%rbp)
jmp 0x188676
movq $0x1, -0x28(%rbp)
cmpq $0x101d0, -0x28(%rbp)   # imm = 0x101D0
jle 0x188688
movq $0x101d0, -0x28(%rbp)   # imm = 0x101D0
movq -0x8(%rbp), %rdi
movq -0x20(%rbp), %rsi
movq -0x28(%rbp), %rax
movl %eax, %edx
callq 0x187920
movq -0x20(%rbp), %rax
movl $0x0, 0x8(%rax)
movq -0x20(%rbp), %rax
movq $0x0, 0x20(%rax)
movq -0x20(%rbp), %rax
movl $0x0, 0x28(%rax)
movq -0x20(%rbp), %rax
addq $0x30, %rsp
popq %rbp
retq
nopw (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/jsummers[P]deark/src/fmtutil-huffman.c
// Function: fmtutil_huffman_destroy_decoder
void fmtutil_huffman_destroy_decoder(deark *c, struct fmtutil_huffman_decoder *ht)
{
	if(!ht) return;
	huffman_destroy_codebook(c, ht->bk);
	ht->bk = NULL;
	de_free(c, ht->builder->lengths_arr);
	de_free(c, ht->builder);
	de_free(c, ht->cursor);
	de_free(c, ht);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x10, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
cmpq $0x0, -0x10(%rbp)
jne 0x1886e9
jmp 0x188749
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rax
movq 0x8(%rax), %rsi
callq 0x188750
movq -0x10(%rbp), %rax
movq $0x0, 0x8(%rax)
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rax
movq 0x10(%rax), %rax
movq 0x10(%rax), %rsi
callq 0x15b820
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rax
movq 0x10(%rax), %rsi
callq 0x15b820
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rax
movq (%rax), %rsi
callq 0x15b820
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
callq 0x15b820
addq $0x10, %rsp
popq %rbp
retq
nop
// File: /workspace/github_c_makefile_star2_O0/jsummers[P]deark/src/fmtutil-exe.c
// Function: fmtutil_detect_pklite_by_exe_ep
UI fmtutil_detect_pklite_by_exe_ep(deark *c, const u8 *mem, i64 mem_len, UI flags)
{
	if(mem_len<64) return 0;

	if(flags & 0x01) {
		if(de_memmatch(mem, (const u8*)"\xb8??\xba??\x8c\xdb\x03\xd8\x3b", 11, '?', 0)) {
			return 100; // v1.00-1.05, etc.
		}
		if(de_memmatch(mem, (const u8*)"\xb8??\xba??\x05\x00\x00\x3b\x06", 11, '?', 0)) {
			return 112; // v1.12-1.15, etc.
		}
		if(de_memmatch(mem, (const u8*)"\x50\xb8??\xba??\x05\x00\x00\x3b", 11, '?', 0)) {
			return 150; // v2.01, etc.
		}
		if(de_memmatch(mem, (const u8*)"\x9c\xba?\x00\x2d?\x00\x81\xe1?\x00\x81", 12, '?', 0)) {
			return 250; // Patched by UN^2PACK v2.0?
		}
	}

	if(flags & 0x02) {
		if(de_memmatch(mem, (const u8*)"\x2e\x8c\x1e??\x8b\x1e\x02\x00\x8c\xda\x81", 12, '?', 0)) {
			return 90; // Normal beta
		}
		if(de_memmatch(mem, (const u8*)"\x2e\x8c\x1e??\xfc\x8c\xc8\x2e\x2b\x06", 11, '?', 0)) {
			return 91; // beta/loadhigh
		}
	}

	if(flags & 0x04) {
		if(de_memmatch(mem, (const u8*)"\xb8??\xba??\x05\x00\x00\x3b\x2d", 11, '?', 0)) {
			return 251; // Megalite
		}
	}

	return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq %rdx, -0x20(%rbp)
movl %ecx, -0x24(%rbp)
cmpq $0x40, -0x20(%rbp)
jge 0x1887ba
movl $0x0, -0x4(%rbp)
jmp 0x188925
movl -0x24(%rbp), %eax
andl $0x1, %eax
cmpl $0x0, %eax
je 0x188883
movq -0x18(%rbp), %rdi
leaq 0x4f239(%rip), %rsi     # 0x1d7a0d
movl $0xb, %edx
movl $0x3f, %ecx
xorl %r8d, %r8d
callq 0x15f6b0
cmpl $0x0, %eax
je 0x1887f7
movl $0x64, -0x4(%rbp)
jmp 0x188925
movq -0x18(%rbp), %rdi
leaq 0x4f391(%rip), %rsi     # 0x1d7b93
movl $0xb, %edx
movl $0x3f, %ecx
xorl %r8d, %r8d
callq 0x15f6b0
cmpl $0x0, %eax
je 0x188825
movl $0x70, -0x4(%rbp)
jmp 0x188925
movq -0x18(%rbp), %rdi
leaq 0x4f36f(%rip), %rsi     # 0x1d7b9f
movl $0xb, %edx
movl $0x3f, %ecx
xorl %r8d, %r8d
callq 0x15f6b0
cmpl $0x0, %eax
je 0x188853
movl $0x96, -0x4(%rbp)
jmp 0x188925
movq -0x18(%rbp), %rdi
leaq 0x4f34d(%rip), %rsi     # 0x1d7bab
movl $0xc, %edx
movl $0x3f, %ecx
xorl %r8d, %r8d
callq 0x15f6b0
cmpl $0x0, %eax
je 0x188881
movl $0xfa, -0x4(%rbp)
jmp 0x188925
jmp 0x188883
movl -0x24(%rbp), %eax
andl $0x2, %eax
cmpl $0x0, %eax
je 0x1888e6
movq -0x18(%rbp), %rdi
leaq 0x4f31f(%rip), %rsi     # 0x1d7bb8
movl $0xc, %edx
movl $0x3f, %ecx
xorl %r8d, %r8d
callq 0x15f6b0
cmpl $0x0, %eax
je 0x1888b9
movl $0x5a, -0x4(%rbp)
jmp 0x188925
movq -0x18(%rbp), %rdi
leaq 0x3b9d8(%rip), %rsi     # 0x1c429c
movl $0xb, %edx
movl $0x3f, %ecx
xorl %r8d, %r8d
callq 0x15f6b0
cmpl $0x0, %eax
je 0x1888e4
movl $0x5b, -0x4(%rbp)
jmp 0x188925
jmp 0x1888e6
movl -0x24(%rbp), %eax
andl $0x4, %eax
cmpl $0x0, %eax
je 0x18891e
movq -0x18(%rbp), %rdi
leaq 0x4f2c9(%rip), %rsi     # 0x1d7bc5
movl $0xb, %edx
movl $0x3f, %ecx
xorl %r8d, %r8d
callq 0x15f6b0
cmpl $0x0, %eax
je 0x18891c
movl $0xfb, -0x4(%rbp)
jmp 0x188925
jmp 0x18891e
movl $0x0, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x30, %rsp
popq %rbp
retq
nop
// File: /workspace/github_c_makefile_star2_O0/jsummers[P]deark/src/fmtutil-exe.c
// Function: detect_execomp_pklite
static void detect_execomp_pklite(deark *c,
	struct fmtutil_exe_info *ei, struct fmtutil_specialexe_detection_data *edd)
{
	UI epflags = 0;
	UI intro_class;

	if(ei->regIP==256 && ei->regCS==(-16) && ei->num_relocs<=2 &&
		ei->entry_point==ei->start_of_dos_code)
	{
		epflags |= 1; // Maybe a typical PKLITE file
	}
	else if(ei->regIP==256 && ei->regCS>(-16) && ei->num_relocs==0 &&
		ei->entry_point>ei->start_of_dos_code)
	{
		epflags |= 2; // Maybe beta
	}
	else if(ei->regCS==0 && ei->regIP==0 && ei->num_relocs==1 && ei->reloc_table_pos==28 &&
		ei->entry_point==ei->start_of_dos_code)
	{
		epflags |= 4; // Maybe Megalite
	}

	if(epflags==0) {
		goto done;
	}

	read_exe_testbytes(ei);
	intro_class = fmtutil_detect_pklite_by_exe_ep(c, ei->ep64b, sizeof(ei->ep64b), epflags);
	if(intro_class) {
		edd->detected_fmt = DE_SPECIALEXEFMT_PKLITE;
	}

done:
	if(edd->detected_fmt==DE_SPECIALEXEFMT_PKLITE) {
		de_strlcpy(edd->detected_fmt_name, "PKLITE", sizeof(edd->detected_fmt_name));
		edd->modname = "pklite";
	}
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movl $0x0, -0x1c(%rbp)
movq -0x10(%rbp), %rax
cmpq $0x100, 0x28(%rax)      # imm = 0x100
jne 0x188f2f
movq -0x10(%rbp), %rax
cmpq $-0x10, 0x20(%rax)
jne 0x188f2f
movq -0x10(%rbp), %rax
cmpq $0x2, 0x8(%rax)
jg 0x188f2f
movq -0x10(%rbp), %rax
movq 0x40(%rax), %rax
movq -0x10(%rbp), %rcx
cmpq 0x38(%rcx), %rax
jne 0x188f2f
movl -0x1c(%rbp), %eax
orl $0x1, %eax
movl %eax, -0x1c(%rbp)
jmp 0x188fbb
movq -0x10(%rbp), %rax
cmpq $0x100, 0x28(%rax)      # imm = 0x100
jne 0x188f70
movq -0x10(%rbp), %rax
cmpq $-0x10, 0x20(%rax)
jle 0x188f70
movq -0x10(%rbp), %rax
cmpq $0x0, 0x8(%rax)
jne 0x188f70
movq -0x10(%rbp), %rax
movq 0x40(%rax), %rax
movq -0x10(%rbp), %rcx
cmpq 0x38(%rcx), %rax
jle 0x188f70
movl -0x1c(%rbp), %eax
orl $0x2, %eax
movl %eax, -0x1c(%rbp)
jmp 0x188fb9
movq -0x10(%rbp), %rax
cmpq $0x0, 0x20(%rax)
jne 0x188fb7
movq -0x10(%rbp), %rax
cmpq $0x0, 0x28(%rax)
jne 0x188fb7
movq -0x10(%rbp), %rax
cmpq $0x1, 0x8(%rax)
jne 0x188fb7
movq -0x10(%rbp), %rax
cmpq $0x1c, 0x30(%rax)
jne 0x188fb7
movq -0x10(%rbp), %rax
movq 0x40(%rax), %rax
movq -0x10(%rbp), %rcx
cmpq 0x38(%rcx), %rax
jne 0x188fb7
movl -0x1c(%rbp), %eax
orl $0x4, %eax
movl %eax, -0x1c(%rbp)
jmp 0x188fb9
jmp 0x188fbb
cmpl $0x0, -0x1c(%rbp)
jne 0x188fc3
jmp 0x188ff8
movq -0x10(%rbp), %rdi
callq 0x189f70
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
addq $0x70, %rsi
movl -0x1c(%rbp), %ecx
movl $0x40, %edx
callq 0x188790
movl %eax, -0x20(%rbp)
cmpl $0x0, -0x20(%rbp)
je 0x188ff6
movq -0x18(%rbp), %rax
movb $0x2, 0x1(%rax)
jmp 0x188ff8
movq -0x18(%rbp), %rax
movzbl 0x1(%rax), %eax
cmpl $0x2, %eax
jne 0x18902d
movq -0x18(%rbp), %rdi
addq $0x50, %rdi
leaq 0x4ea05(%rip), %rsi     # 0x1d7a19
movl $0x28, %edx
callq 0x15aa30
movq -0x18(%rbp), %rax
leaq 0x3ae34(%rip), %rcx     # 0x1c3e5d
movq %rcx, 0x48(%rax)
addq $0x20, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/jsummers[P]deark/src/fmtutil-exe.c
// Function: detect_execomp_tinyprog
static void detect_execomp_tinyprog(deark *c,
	struct fmtutil_exe_info *ei, struct fmtutil_specialexe_detection_data *edd)
{
	i64 pos;
	i64 j;
	u8 x;
	static const u8 *tpsig1 = (u8*)"\x50\xbe\x05\x01\x03\x36\x01\x01\x8c\xd2\x8c\xd8\x03\x44";

	if(ei->num_relocs!=0) goto done;
	pos = ei->entry_point;
	x = dbuf_getbyte(ei->f, pos);
	if(x!=0xe9) goto done;
	j = dbuf_getu16le(ei->f, pos+1);
	pos += 3+j; // Jump over user data

	x = dbuf_getbyte(ei->f, pos);
	if(x != 0xeb) goto done;
	j = dbuf_geti8(ei->f, pos+1);
	pos += 2+j; // Jump over (some sort of) data

	if(!dbuf_memcmp(ei->f, pos, (const void*)tpsig1, 14)) {
		; // Old version (e.g. "6/8/90")
	}
	else if(!dbuf_memcmp(ei->f, pos+8, (const void*)tpsig1, 14)) {
		; // Newer version (e.g. 3.0-3.9)
	}
	else {
		goto done;
	}

	edd->detected_fmt = DE_SPECIALEXEFMT_TINYPROG;
	de_strlcpy(edd->detected_fmt_name, "TINYPROG", sizeof(edd->detected_fmt_name));
done:
	;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq -0x10(%rbp), %rax
cmpq $0x0, 0x8(%rax)
je 0x189064
jmp 0x189175
movq -0x10(%rbp), %rax
movq 0x40(%rax), %rax
movq %rax, -0x20(%rbp)
movq -0x10(%rbp), %rax
movq (%rax), %rdi
movq -0x20(%rbp), %rsi
callq 0x165060
movb %al, -0x29(%rbp)
movzbl -0x29(%rbp), %eax
cmpl $0xe9, %eax
je 0x189093
jmp 0x189175
movq -0x10(%rbp), %rax
movq (%rax), %rdi
movq -0x20(%rbp), %rsi
addq $0x1, %rsi
callq 0x165280
movq %rax, -0x28(%rbp)
movq -0x28(%rbp), %rax
addq $0x3, %rax
addq -0x20(%rbp), %rax
movq %rax, -0x20(%rbp)
movq -0x10(%rbp), %rax
movq (%rax), %rdi
movq -0x20(%rbp), %rsi
callq 0x165060
movb %al, -0x29(%rbp)
movzbl -0x29(%rbp), %eax
cmpl $0xeb, %eax
je 0x1890de
jmp 0x189175
movq -0x10(%rbp), %rax
movq (%rax), %rdi
movq -0x20(%rbp), %rsi
addq $0x1, %rsi
callq 0x165140
movq %rax, -0x28(%rbp)
movq -0x28(%rbp), %rax
addq $0x2, %rax
addq -0x20(%rbp), %rax
movq %rax, -0x20(%rbp)
movq -0x10(%rbp), %rax
movq (%rax), %rdi
movq -0x20(%rbp), %rsi
movq 0x9ca48(%rip), %rdx     # 0x225b60
movl $0xe, %ecx
callq 0x166ab0
cmpl $0x0, %eax
jne 0x189129
jmp 0x189154
movq -0x10(%rbp), %rax
movq (%rax), %rdi
movq -0x20(%rbp), %rsi
addq $0x8, %rsi
movq 0x9ca21(%rip), %rdx     # 0x225b60
movl $0xe, %ecx
callq 0x166ab0
cmpl $0x0, %eax
jne 0x189150
jmp 0x189152
jmp 0x189175
jmp 0x189154
movq -0x18(%rbp), %rax
movb $0x5, 0x1(%rax)
movq -0x18(%rbp), %rdi
addq $0x50, %rdi
leaq 0x4e8c4(%rip), %rsi     # 0x1d7a2f
movl $0x28, %edx
callq 0x15aa30
addq $0x30, %rsp
popq %rbp
retq
nopl (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/jsummers[P]deark/src/fmtutil-exe.c
// Function: detect_execomp_diet
static void detect_execomp_diet(deark *c,
	struct fmtutil_exe_info *ei, struct fmtutil_specialexe_detection_data *edd)
{
	static const u8 offsets[] = {20, 40, 45};
	i64 foundpos = 0;
	size_t i;

	if(ei->regCS!=0) goto done;
	if(ei->regIP!=0 && ei->regIP!=3) goto done;
	if(ei->num_relocs>1) goto done;

	// Haven't figured out a good way to detect DIET. More research needed.
	for(i=0; i<DE_ARRAYCOUNT(offsets); i++) {
		if(execomp_diet_check_fingerprint(ei->f, ei->entry_point+(i64)offsets[i])) {
			foundpos = (i64)offsets[i];
			break;
		}
	}
	if(foundpos==0) goto done;

	edd->detected_fmt = DE_SPECIALEXEFMT_DIET;
	de_strlcpy(edd->detected_fmt_name, "DIET", sizeof(edd->detected_fmt_name));
	edd->modname = "diet";
done:
	;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq $0x0, -0x20(%rbp)
movq -0x10(%rbp), %rax
cmpq $0x0, 0x20(%rax)
je 0x1891ac
jmp 0x18926f
movq -0x10(%rbp), %rax
cmpq $0x0, 0x28(%rax)
je 0x1891c7
movq -0x10(%rbp), %rax
cmpq $0x3, 0x28(%rax)
je 0x1891c7
jmp 0x18926f
movq -0x10(%rbp), %rax
cmpq $0x1, 0x8(%rax)
jle 0x1891d7
jmp 0x18926f
movq $0x0, -0x28(%rbp)
cmpq $0x3, -0x28(%rbp)
jae 0x189236
movq -0x10(%rbp), %rax
movq (%rax), %rdi
movq -0x10(%rbp), %rax
movq 0x40(%rax), %rsi
movq -0x28(%rbp), %rcx
leaq 0x4e9d1(%rip), %rax     # 0x1d7bd1
movzbl (%rax,%rcx), %eax
addq %rax, %rsi
callq 0x189fe0
cmpl $0x0, %eax
je 0x189226
movq -0x28(%rbp), %rcx
leaq 0x4e9b5(%rip), %rax     # 0x1d7bd1
movzbl (%rax,%rcx), %eax
movq %rax, -0x20(%rbp)
jmp 0x189236
jmp 0x189228
movq -0x28(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x28(%rbp)
jmp 0x1891df
cmpq $0x0, -0x20(%rbp)
jne 0x18923f
jmp 0x18926f
movq -0x18(%rbp), %rax
movb $0x4, 0x1(%rax)
movq -0x18(%rbp), %rdi
addq $0x50, %rdi
leaq 0x20f1f(%rip), %rsi     # 0x1aa175
movl $0x28, %edx
callq 0x15aa30
movq -0x18(%rbp), %rax
leaq 0x20df2(%rip), %rcx     # 0x1aa05d
movq %rcx, 0x48(%rax)
addq $0x30, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/jsummers[P]deark/src/fmtutil-exe.c
// Function: detect_execomp_wwpack
static void detect_execomp_wwpack(deark *c,
	struct fmtutil_exe_info *ei, struct fmtutil_specialexe_detection_data *edd)
{
	if(ei->num_relocs!=0) goto done;
	if(ei->start_of_dos_code!=32) goto done;
	if(ei->entry_point==ei->start_of_dos_code) goto done;

	read_exe_testbytes(ei);
	if(!de_memmatch(ei->ep64b, (const u8*)"\xb8??\x8c\xca\x03\xd0\x8c\xc9\x81\xc1", 11, '?', 0)) {
		goto done;
	}

	edd->detected_fmt = DE_SPECIALEXEFMT_EXECOMP;
	de_strlcpy(edd->detected_fmt_name, "WWPACK", sizeof(edd->detected_fmt_name));
done:
	;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq -0x10(%rbp), %rax
cmpq $0x0, 0x8(%rax)
je 0x1892a1
jmp 0x189314
movq -0x10(%rbp), %rax
cmpq $0x20, 0x38(%rax)
je 0x1892ae
jmp 0x189314
movq -0x10(%rbp), %rax
movq 0x40(%rax), %rax
movq -0x10(%rbp), %rcx
cmpq 0x38(%rcx), %rax
jne 0x1892c2
jmp 0x189314
movq -0x10(%rbp), %rdi
callq 0x189f70
movq -0x10(%rbp), %rdi
addq $0x70, %rdi
leaq 0x4e75e(%rip), %rsi     # 0x1d7a38
movl $0xb, %edx
movl $0x3f, %ecx
xorl %r8d, %r8d
callq 0x15f6b0
cmpl $0x0, %eax
jne 0x1892f3
jmp 0x189314
movq -0x18(%rbp), %rax
movb $0x63, 0x1(%rax)
movq -0x18(%rbp), %rdi
addq $0x50, %rdi
leaq 0x4e73a(%rip), %rsi     # 0x1d7a44
movl $0x28, %edx
callq 0x15aa30
addq $0x20, %rsp
popq %rbp
retq
nopw (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/jsummers[P]deark/src/fmtutil-exe.c
// Function: detect_execomp_compack
static void detect_execomp_compack(deark *c,
	struct fmtutil_exe_info *ei, struct fmtutil_specialexe_detection_data *edd)
{
	if(ei->num_relocs!=0) goto done;
	if(ei->start_of_dos_code!=32) goto done;
	if(ei->entry_point!=ei->start_of_dos_code) goto done;

	read_exe_testbytes(ei);
	if(!de_memmatch(ei->ep64b,
		(const u8*)"\xbd??\x50\x06\x8c\xcb\x03\xdd\x8c\xd2\x4b\x8e\xdb\xbe", 15, '?', 0))
	{
		goto done;
	}

	edd->detected_fmt = DE_SPECIALEXEFMT_EXECOMP;
	de_strlcpy(edd->detected_fmt_name, "COMPACK", sizeof(edd->detected_fmt_name));
done:
	;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq -0x10(%rbp), %rax
cmpq $0x0, 0x8(%rax)
je 0x189341
jmp 0x1893b4
movq -0x10(%rbp), %rax
cmpq $0x20, 0x38(%rax)
je 0x18934e
jmp 0x1893b4
movq -0x10(%rbp), %rax
movq 0x40(%rax), %rax
movq -0x10(%rbp), %rcx
cmpq 0x38(%rcx), %rax
je 0x189362
jmp 0x1893b4
movq -0x10(%rbp), %rdi
callq 0x189f70
movq -0x10(%rbp), %rdi
addq $0x70, %rdi
leaq 0x4e6d1(%rip), %rsi     # 0x1d7a4b
movl $0xf, %edx
movl $0x3f, %ecx
xorl %r8d, %r8d
callq 0x15f6b0
cmpl $0x0, %eax
jne 0x189393
jmp 0x1893b4
movq -0x18(%rbp), %rax
movb $0x63, 0x1(%rax)
movq -0x18(%rbp), %rdi
addq $0x50, %rdi
leaq 0x4e6b1(%rip), %rsi     # 0x1d7a5b
movl $0x28, %edx
callq 0x15aa30
addq $0x20, %rsp
popq %rbp
retq
nopw (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/jsummers[P]deark/src/fmtutil-exe.c
// Function: detect_execomp_propack
static void detect_execomp_propack(deark *c,
	struct fmtutil_exe_info *ei, struct fmtutil_specialexe_detection_data *edd)
{
	static const u8 *sig = (const u8*)"\x8c\xd3\x8e\xc3\x8c\xca\x8e\xda\x8b\x0e\x08\x00\x8b\xf1\x83\xee";

	// TODO: Should we test some header fields here?

	read_exe_testbytes(ei);
	if(ei->ep64b[0]==0x8c) {
		if(de_memcmp(ei->ep64b, sig, 16)) {
			return;
		}
	}
	else if(ei->ep64b[0]==0x0e) {
		if(de_memcmp(&ei->ep64b[1], sig, 16)) {
			return;
		}
	}
	else {
		return;
	}

	edd->detected_fmt = DE_SPECIALEXEFMT_EXECOMP;
	de_strlcpy(edd->detected_fmt_name, "RNC PROPACK", sizeof(edd->detected_fmt_name));
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq -0x10(%rbp), %rdi
callq 0x189f70
movq -0x10(%rbp), %rax
movzbl 0x70(%rax), %eax
cmpl $0x8c, %eax
jne 0x18941d
movq -0x10(%rbp), %rax
addq $0x70, %rax
movq 0x9c76d(%rip), %rcx     # 0x225b68
movups (%rcx), %xmm1
movups (%rax), %xmm0
pcmpeqb %xmm1, %xmm0
pmovmskb %xmm0, %eax
subl $0xffff, %eax           # imm = 0xFFFF
setne %al
movzbl %al, %eax
cmpl $0x0, %eax
je 0x18941b
jmp 0x189484
jmp 0x189463
movq -0x10(%rbp), %rax
movzbl 0x70(%rax), %eax
cmpl $0xe, %eax
jne 0x18945f
movq -0x10(%rbp), %rax
addq $0x70, %rax
addq $0x1, %rax
movq 0x9c72b(%rip), %rcx     # 0x225b68
movups (%rcx), %xmm1
movups (%rax), %xmm0
pcmpeqb %xmm1, %xmm0
pmovmskb %xmm0, %eax
subl $0xffff, %eax           # imm = 0xFFFF
setne %al
movzbl %al, %eax
cmpl $0x0, %eax
je 0x18945d
jmp 0x189484
jmp 0x189461
jmp 0x189484
jmp 0x189463
movq -0x18(%rbp), %rax
movb $0x63, 0x1(%rax)
movq -0x18(%rbp), %rdi
addq $0x50, %rdi
leaq 0x4e5e9(%rip), %rsi     # 0x1d7a63
movl $0x28, %edx
callq 0x15aa30
addq $0x20, %rsp
popq %rbp
retq
nopw (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/jsummers[P]deark/src/fmtutil-exe.c
// Function: detect_execomp_spacemaker
static void detect_execomp_spacemaker(deark *c,
	struct fmtutil_exe_info *ei, struct fmtutil_specialexe_detection_data *edd)
{
	if(ei->num_relocs!=0) goto done;
	if(ei->regSP != 0x0100) goto done;
	if(ei->regIP != 0x0100) goto done;
	if(ei->regCS != -16) goto done;

	read_exe_testbytes(ei);

	if(!de_memmatch(ei->ep64b,
		(const u8*)"\x9c\x55\x56\x8c\xcd\x83\xc5\x10\x8d\xb6??\x56\xbe??\x56\xcb",
		18, '?', 0))
	{
		goto done;
	}

	edd->detected_fmt = DE_SPECIALEXEFMT_EXECOMP;
	de_strlcpy(edd->detected_fmt_name, "Spacemaker", sizeof(edd->detected_fmt_name));
done:
	;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq -0x10(%rbp), %rax
cmpq $0x0, 0x8(%rax)
je 0x1894b1
jmp 0x189530
movq -0x10(%rbp), %rax
cmpq $0x100, 0x18(%rax)      # imm = 0x100
je 0x1894c1
jmp 0x189530
movq -0x10(%rbp), %rax
cmpq $0x100, 0x28(%rax)      # imm = 0x100
je 0x1894d1
jmp 0x189530
movq -0x10(%rbp), %rax
cmpq $-0x10, 0x20(%rax)
je 0x1894de
jmp 0x189530
movq -0x10(%rbp), %rdi
callq 0x189f70
movq -0x10(%rbp), %rdi
addq $0x70, %rdi
leaq 0x4e579(%rip), %rsi     # 0x1d7a6f
movl $0x12, %edx
movl $0x3f, %ecx
xorl %r8d, %r8d
callq 0x15f6b0
cmpl $0x0, %eax
jne 0x18950f
jmp 0x189530
movq -0x18(%rbp), %rax
movb $0x63, 0x1(%rax)
movq -0x18(%rbp), %rdi
addq $0x50, %rdi
leaq 0x4e55c(%rip), %rsi     # 0x1d7a82
movl $0x28, %edx
callq 0x15aa30
addq $0x20, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/jsummers[P]deark/src/fmtutil-exe.c
// Function: calc_entrypoint_crc
static void calc_entrypoint_crc(deark *c, struct fmtutil_exe_info *ei)
{
	struct de_crcobj *crco = NULL;
	u32 crc1, crc2;

	if(ei->have_epcrcs) return;
	ei->have_epcrcs = 1;

	read_exe_testbytes(ei);

	// Sniff some bytes, starting at the code entry point.
	crco = de_crcobj_create(c, DE_CRCOBJ_CRC32_IEEE);
	de_crcobj_addbuf(crco, &ei->ep64b[0], 32);
	crc1 = de_crcobj_getval(crco);
	de_crcobj_reset(crco);
	de_crcobj_addbuf(crco, &ei->ep64b[32], 32);
	crc2 = de_crcobj_getval(crco);
	ei->entrypoint_crcs = ((u64)crc1 << 32) | crc2;
#ifdef DE_EXECOMP_DEVMODE
	de_dbg(c, "execomp crc: %016"U64_FMTx, ei->entrypoint_crcs);
#endif

	de_crcobj_destroy(crco);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq $0x0, -0x18(%rbp)
movq -0x10(%rbp), %rax
cmpb $0x0, 0x64(%rax)
je 0x189567
jmp 0x1895fb
movq -0x10(%rbp), %rax
movb $0x1, 0x64(%rax)
movq -0x10(%rbp), %rdi
callq 0x189f70
movq -0x8(%rbp), %rdi
movl $0x10, %esi
callq 0x15eac0
movq %rax, -0x18(%rbp)
movq -0x18(%rbp), %rdi
movq -0x10(%rbp), %rsi
addq $0x70, %rsi
movl $0x20, %edx
callq 0x15f430
movq -0x18(%rbp), %rdi
callq 0x15f340
movl %eax, -0x1c(%rbp)
movq -0x18(%rbp), %rdi
callq 0x15f250
movq -0x18(%rbp), %rdi
movq -0x10(%rbp), %rsi
addq $0x70, %rsi
addq $0x20, %rsi
movl $0x20, %edx
callq 0x15f430
movq -0x18(%rbp), %rdi
callq 0x15f340
movl %eax, -0x20(%rbp)
movl -0x1c(%rbp), %eax
movl %eax, %ecx
shlq $0x20, %rcx
movl -0x20(%rbp), %eax
orq %rax, %rcx
movq -0x10(%rbp), %rax
movq %rcx, 0x68(%rax)
movq -0x18(%rbp), %rdi
callq 0x15f2e0
addq $0x20, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/jsummers[P]deark/src/fmtutil-exe.c
// Function: detect_execomp_lzexe
static void detect_execomp_lzexe(deark *c,
	struct fmtutil_exe_info *ei, struct fmtutil_specialexe_detection_data *edd)
{
	u8 flag = 0;

	if(ei->entrypoint_crcs==0x4b6802c9cf419437LLU) {
		edd->detected_subfmt = 1;
		flag = 1;
	}
	else if(ei->entrypoint_crcs==0x246655c50ae99574LLU) {
		edd->detected_subfmt = 2;
		flag = 1;
	}
	else if(ei->entrypoint_crcs==0xd8a60f138f680f0cLLU) {
		edd->detected_subfmt = 3;
		flag = 1;
	}
	else if(detect_lhark_sfx(c, ei, edd)) {
		edd->detected_subfmt = 102;
		flag = 1;
	}
	else if(look_for_pcx2exe(c, ei, edd)) {
		edd->detected_subfmt = 202;
		flag = 1;
	}

	if(flag) {
		edd->detected_fmt = DE_SPECIALEXEFMT_LZEXE;
		de_strlcpy(edd->detected_fmt_name, "LZEXE", sizeof(edd->detected_fmt_name));
		edd->modname = "lzexe";
	}
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movb $0x0, -0x19(%rbp)
movq -0x10(%rbp), %rax
movabsq $0x4b6802c9cf419437, %rcx # imm = 0x4B6802C9CF419437
cmpq %rcx, 0x68(%rax)
jne 0x18964d
movq -0x18(%rbp), %rax
movb $0x1, 0x2(%rax)
movb $0x1, -0x19(%rbp)
jmp 0x1896df
movq -0x10(%rbp), %rax
movabsq $0x246655c50ae99574, %rcx # imm = 0x246655C50AE99574
cmpq %rcx, 0x68(%rax)
jne 0x18966f
movq -0x18(%rbp), %rax
movb $0x2, 0x2(%rax)
movb $0x1, -0x19(%rbp)
jmp 0x1896dd
movq -0x10(%rbp), %rax
movabsq $-0x2759f0ec7097f0f4, %rcx # imm = 0xD8A60F138F680F0C
cmpq %rcx, 0x68(%rax)
jne 0x189691
movq -0x18(%rbp), %rax
movb $0x3, 0x2(%rax)
movb $0x1, -0x19(%rbp)
jmp 0x1896db
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
movq -0x18(%rbp), %rdx
callq 0x18a050
cmpl $0x0, %eax
je 0x1896b5
movq -0x18(%rbp), %rax
movb $0x66, 0x2(%rax)
movb $0x1, -0x19(%rbp)
jmp 0x1896d9
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
movq -0x18(%rbp), %rdx
callq 0x18a160
cmpl $0x0, %eax
je 0x1896d7
movq -0x18(%rbp), %rax
movb $-0x36, 0x2(%rax)
movb $0x1, -0x19(%rbp)
jmp 0x1896d9
jmp 0x1896db
jmp 0x1896dd
jmp 0x1896df
cmpb $0x0, -0x19(%rbp)
je 0x189715
movq -0x18(%rbp), %rax
movb $0x1, 0x1(%rax)
movq -0x18(%rbp), %rdi
addq $0x50, %rdi
leaq 0x4e391(%rip), %rsi     # 0x1d7a8d
movl $0x28, %edx
callq 0x15aa30
movq -0x18(%rbp), %rax
leaq 0x314da(%rip), %rcx     # 0x1babeb
movq %rcx, 0x48(%rax)
addq $0x20, %rsp
popq %rbp
retq
nopl (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/jsummers[P]deark/src/fmtutil-exe.c
// Function: detect_specialexe_texe
static void detect_specialexe_texe(deark *c,
	struct fmtutil_exe_info *ei, struct fmtutil_specialexe_detection_data *edd)
{
	// We only detect v1.0 shareware. No other versions have been found.
	if(ei->overlay_len < 2) goto done;
	if(ei->end_of_dos_code - ei->start_of_dos_code != 14732) goto done;

	if(dbuf_memcmp(ei->f, ei->start_of_dos_code+13433, (const void*)"Raymond P", 9)) {
		goto done;
	}

	edd->detected_fmt = DE_SPECIALEXEFMT_TEXE;
	de_strlcpy(edd->detected_fmt_name, "TEXE", sizeof(edd->detected_fmt_name));
	edd->modname = "texe";
done:
	;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq -0x10(%rbp), %rax
cmpq $0x2, 0x50(%rax)
jge 0x189a41
jmp 0x189ab9
movq -0x10(%rbp), %rax
movq 0x48(%rax), %rax
movq -0x10(%rbp), %rcx
subq 0x38(%rcx), %rax
cmpq $0x398c, %rax           # imm = 0x398C
je 0x189a5b
jmp 0x189ab9
movq -0x10(%rbp), %rax
movq (%rax), %rdi
movq -0x10(%rbp), %rax
movq 0x38(%rax), %rsi
addq $0x3479, %rsi           # imm = 0x3479
leaq 0x4e031(%rip), %rdx     # 0x1d7aa9
movl $0x9, %ecx
callq 0x166ab0
cmpl $0x0, %eax
je 0x189a89
jmp 0x189ab9
movq -0x18(%rbp), %rax
movb $-0x35, 0x1(%rax)
movq -0x18(%rbp), %rdi
addq $0x50, %rdi
leaq 0x4e013(%rip), %rsi     # 0x1d7ab3
movl $0x28, %edx
callq 0x15aa30
movq -0x18(%rbp), %rax
leaq 0x257b0(%rip), %rcx     # 0x1af265
movq %rcx, 0x48(%rax)
addq $0x20, %rsp
popq %rbp
retq
nop
// File: /workspace/github_c_makefile_star2_O0/jsummers[P]deark/src/fmtutil-exe.c
// Function: detect_specialexe_gws_exepic
static void detect_specialexe_gws_exepic(deark *c,
	struct fmtutil_exe_info *ei, struct fmtutil_specialexe_detection_data *edd)
{
	u8 flag = 0;

	if(ei->num_relocs!=0) goto done;
	if(ei->regSP != 0x0200) goto done;
	if(ei->reloc_table_pos!=34) goto done;
	if(ei->entry_point!=ei->start_of_dos_code) goto done;

	read_exe_testbytes(ei);

	if(!de_memcmp(&ei->ep64b[29], (const void*)"GraphicWorkshop", 15)) {
		flag = 1;
	}
	else if(!de_memcmp(&ei->ep64b[29], (const void*)"GWS/Windows", 11)) {
		flag = 1;
	}

	if(!flag) goto done;
	edd->detected_fmt = DE_SPECIALEXEFMT_GWS_EXEPIC;
	de_strlcpy(edd->detected_fmt_name, "GWS picture", sizeof(edd->detected_fmt_name));
	edd->modname = "gws_exepic";

done:
	;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movb $0x0, -0x19(%rbp)
movq -0x10(%rbp), %rax
cmpq $0x0, 0x8(%rax)
je 0x189ae8
jmp 0x189bb3
movq -0x10(%rbp), %rax
cmpq $0x200, 0x18(%rax)      # imm = 0x200
je 0x189afb
jmp 0x189bb3
movq -0x10(%rbp), %rax
cmpq $0x22, 0x30(%rax)
je 0x189b0b
jmp 0x189bb3
movq -0x10(%rbp), %rax
movq 0x40(%rax), %rax
movq -0x10(%rbp), %rcx
cmpq 0x38(%rcx), %rax
je 0x189b22
jmp 0x189bb3
movq -0x10(%rbp), %rdi
callq 0x189f70
movq -0x10(%rbp), %rdi
addq $0x70, %rdi
addq $0x1d, %rdi
leaq 0x4df7a(%rip), %rsi     # 0x1d7ab8
movl $0xf, %edx
callq 0x19170
cmpl $0x0, %eax
jne 0x189b53
movb $0x1, -0x19(%rbp)
jmp 0x189b7b
movq -0x10(%rbp), %rdi
addq $0x70, %rdi
addq $0x1d, %rdi
leaq 0x4df62(%rip), %rsi     # 0x1d7ac8
movl $0xb, %edx
callq 0x19170
cmpl $0x0, %eax
jne 0x189b79
movb $0x1, -0x19(%rbp)
jmp 0x189b7b
cmpb $0x0, -0x19(%rbp)
jne 0x189b83
jmp 0x189bb3
movq -0x18(%rbp), %rax
movb $-0x37, 0x1(%rax)
movq -0x18(%rbp), %rdi
addq $0x50, %rdi
leaq 0x4df3a(%rip), %rsi     # 0x1d7ad4
movl $0x28, %edx
callq 0x15aa30
movq -0x18(%rbp), %rax
leaq 0x25db9(%rip), %rcx     # 0x1af968
movq %rcx, 0x48(%rax)
addq $0x20, %rsp
popq %rbp
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O0/jsummers[P]deark/src/fmtutil-exe.c
// Function: detect_specialexe_readmake
static void detect_specialexe_readmake(deark *c,
	struct fmtutil_exe_info *ei, struct fmtutil_specialexe_detection_data *edd)
{
	// Expected to be EXEPACK-compressed, but we might like it to be
	// detected even after decompression. So we won't look at the MZ header.
	if(ei->overlay_len < 76) goto done;

	read_exe_testbytes(ei);
	if((u32)de_getu32le_direct(&ei->ovl64b[0]) != (u32)0x3e) goto done;
	if(dbuf_memcmp(ei->f, ei->start_of_dos_code, (const void*)"blREADINCL", 10)) {
		goto done;
	}

	edd->detected_fmt = DE_SPECIALEXEFMT_READMAKE;
	de_strlcpy(edd->detected_fmt_name, "READMAKE", sizeof(edd->detected_fmt_name));
	edd->modname = "readmake";
done:
	;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq -0x10(%rbp), %rax
cmpq $0x4c, 0x50(%rax)
jge 0x189be1
jmp 0x189c58
movq -0x10(%rbp), %rdi
callq 0x189f70
movq -0x10(%rbp), %rdi
addq $0xb0, %rdi
callq 0x165500
cmpl $0x3e, %eax
je 0x189c01
jmp 0x189c58
movq -0x10(%rbp), %rax
movq (%rax), %rdi
movq -0x10(%rbp), %rax
movq 0x38(%rax), %rsi
leaq 0x4dec9(%rip), %rdx     # 0x1d7ae0
movl $0xa, %ecx
callq 0x166ab0
cmpl $0x0, %eax
je 0x189c28
jmp 0x189c58
movq -0x18(%rbp), %rax
movb $-0x36, 0x1(%rax)
movq -0x18(%rbp), %rdi
addq $0x50, %rdi
leaq 0x4deac(%rip), %rsi     # 0x1d7aeb
movl $0x28, %edx
callq 0x15aa30
movq -0x18(%rbp), %rax
leaq 0x255ef(%rip), %rcx     # 0x1af243
movq %rcx, 0x48(%rax)
addq $0x20, %rsp
popq %rbp
retq
nop