// File: /workspace/github_c_makefile_star2_O0/jsummers[P]deark/modules/pklite.c
// Function: do_analyze_pklite_exe
static void do_analyze_pklite_exe(deark *c, lctx *d)
{
	int saved_indent_level;

	de_dbg_indent_save(c, &saved_indent_level);

	de_dbg(c, "code start: %"I64_FMT, d->host_ei->start_of_dos_code);
	de_dbg(c, "entry point: %"I64_FMT, d->host_ei->entry_point);

	de_dbg(c, "[analyzing file]");
	de_dbg_indent(c, 1);

	analyze_intro(c, d);
	if(d->errflag) goto done;

	analyze_descrambler(c, d);
	if(d->errflag) goto done;

	if(d->scrambled_decompressor) {
		descramble_decompressor(c, d);
		if(d->errflag) goto done;
	}

	analyze_copier(c, d);
	if(d->errflag) goto done;

	analyze_decompressor(c, d);
	if(d->errflag) goto done;

	if(!d->dparams.cmpr_data_pos) {
		d->errflag = 1;
		goto done;
	}

	if(d->data_before_decoder) {
		d->approx_end_of_decompressor = d->host_ei->end_of_dos_code - d->host_ei->entry_point;
		d->cmpr_data_area_endpos = d->host_ei->entry_point;
	}
	else {
		d->approx_end_of_decompressor = d->dparams.cmpr_data_pos - d->host_ei->entry_point;
		d->cmpr_data_area_endpos = d->host_ei->end_of_dos_code;
	}
	de_dbg(c, "approx end of decompressor: ep+%"I64_FMT, d->approx_end_of_decompressor);

	analyze_detect_extra_cmpr(c, d);
	if(d->errflag) goto done;
	analyze_detect_large_and_v120_cmpr(c, d);
	if(d->errflag) goto done;
	analyze_detect_obf_offsets(c, d);
	if(d->errflag) goto done;
	analyze_detect_psp_sig(c, d);

done:
	de_dbg_indent_restore(c, saved_indent_level);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq -0x8(%rbp), %rdi
leaq -0x14(%rbp), %rsi
callq 0x15b580
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rax
movq 0x20(%rax), %rax
movq 0x38(%rax), %rdx
leaq 0xb071c(%rip), %rsi     # 0x1c4010
movb $0x0, %al
callq 0x15b0d0
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rax
movq 0x20(%rax), %rax
movq 0x40(%rax), %rdx
leaq 0x94bcf(%rip), %rsi     # 0x1a84e1
movb $0x0, %al
callq 0x15b0d0
movq -0x8(%rbp), %rdi
leaq 0xb06fc(%rip), %rsi     # 0x1c4020
movb $0x0, %al
callq 0x15b0d0
movq -0x8(%rbp), %rdi
movl $0x1, %esi
callq 0x15b560
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
callq 0x1145b0
movq -0x10(%rbp), %rax
cmpb $0x0, (%rax)
je 0x113954
jmp 0x113ac8
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
callq 0x114890
movq -0x10(%rbp), %rax
cmpb $0x0, (%rax)
je 0x11396f
jmp 0x113ac8
movq -0x10(%rbp), %rax
cmpb $0x0, 0x49(%rax)
je 0x113996
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
callq 0x114ec0
movq -0x10(%rbp), %rax
cmpb $0x0, (%rax)
je 0x113994
jmp 0x113ac8
jmp 0x113996
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
callq 0x115020
movq -0x10(%rbp), %rax
cmpb $0x0, (%rax)
je 0x1139b1
jmp 0x113ac8
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
callq 0x115390
movq -0x10(%rbp), %rax
cmpb $0x0, (%rax)
je 0x1139cc
jmp 0x113ac8
movq -0x10(%rbp), %rax
cmpq $0x0, 0x10(%rax)
jne 0x1139e3
movq -0x10(%rbp), %rax
movb $0x1, (%rax)
jmp 0x113ac8
movq -0x10(%rbp), %rax
cmpb $0x0, 0x6(%rax)
je 0x113a26
movq -0x10(%rbp), %rax
movq 0x20(%rax), %rax
movq 0x48(%rax), %rcx
movq -0x10(%rbp), %rax
movq 0x20(%rax), %rax
subq 0x40(%rax), %rcx
movq -0x10(%rbp), %rax
movq %rcx, 0x78(%rax)
movq -0x10(%rbp), %rax
movq 0x20(%rax), %rax
movq 0x40(%rax), %rcx
movq -0x10(%rbp), %rax
movq %rcx, 0x98(%rax)
jmp 0x113a59
movq -0x10(%rbp), %rax
movq 0x10(%rax), %rcx
movq -0x10(%rbp), %rax
movq 0x20(%rax), %rax
subq 0x40(%rax), %rcx
movq -0x10(%rbp), %rax
movq %rcx, 0x78(%rax)
movq -0x10(%rbp), %rax
movq 0x20(%rax), %rax
movq 0x48(%rax), %rcx
movq -0x10(%rbp), %rax
movq %rcx, 0x98(%rax)
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rax
movq 0x78(%rax), %rdx
leaq 0xb05c5(%rip), %rsi     # 0x1c4031
movb $0x0, %al
callq 0x15b0d0
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
callq 0x115720
movq -0x10(%rbp), %rax
cmpb $0x0, (%rax)
je 0x113a8b
jmp 0x113ac8
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
callq 0x1158b0
movq -0x10(%rbp), %rax
cmpb $0x0, (%rax)
je 0x113aa3
jmp 0x113ac8
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
callq 0x115a70
movq -0x10(%rbp), %rax
cmpb $0x0, (%rax)
je 0x113abb
jmp 0x113ac8
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
callq 0x115b80
movq -0x8(%rbp), %rdi
movl -0x14(%rbp), %esi
callq 0x15b5a0
addq $0x20, %rsp
popq %rbp
retq
nopw (%rax,%rax)