// File: /workspace/github_c_makefile_star2_O1/jsummers[P]deark/src/fmtutil-exe.c
// Function: fmtutil_detect_execomp
void fmtutil_detect_execomp(deark *c, struct fmtutil_exe_info *ei,
	struct fmtutil_specialexe_detection_data *edd)
{
	edd->detected_fmt = 0;
	edd->detected_subfmt = 0;

	if(edd->restrict_to_fmt==0 || edd->restrict_to_fmt==DE_SPECIALEXEFMT_PKLITE) {
		detect_execomp_pklite(c, ei, edd);
		if(edd->detected_fmt!=0) goto done;
	}

	if(edd->restrict_to_fmt==0 || edd->restrict_to_fmt==DE_SPECIALEXEFMT_TINYPROG) {
		detect_execomp_tinyprog(c, ei, edd);
		if(edd->detected_fmt!=0) goto done;
	}

	if(edd->restrict_to_fmt==0 || edd->restrict_to_fmt==DE_SPECIALEXEFMT_DIET) {
		detect_execomp_diet(c, ei, edd);
		if(edd->detected_fmt!=0) goto done;
	}

	if(edd->restrict_to_fmt==0) {
		detect_execomp_wwpack(c, ei, edd);
		if(edd->detected_fmt!=0) goto done;
	}

	if(edd->restrict_to_fmt==0) {
		detect_execomp_compack(c, ei, edd);
		if(edd->detected_fmt!=0) goto done;
	}

	if(edd->restrict_to_fmt==0) {
		detect_execomp_propack(c, ei, edd);
		if(edd->detected_fmt!=0) goto done;
	}

	if(edd->restrict_to_fmt==0) {
		detect_execomp_spacemaker(c, ei, edd);
		if(edd->detected_fmt!=0) goto done;
	}

	calc_entrypoint_crc(c, ei);

	if(edd->restrict_to_fmt==0 || edd->restrict_to_fmt==DE_SPECIALEXEFMT_LZEXE) {
		detect_execomp_lzexe(c, ei, edd);
		if(edd->detected_fmt!=0) goto done;
	}

	if(edd->restrict_to_fmt==0 || edd->restrict_to_fmt==DE_SPECIALEXEFMT_EXEPACK) {
		detect_execomp_exepack(c, ei, edd);
		if(edd->detected_fmt!=0) goto done;
	}

done:
	if(!edd->detected_fmt_name[0]) {
		de_strlcpy(edd->detected_fmt_name, "unknown", sizeof(edd->detected_fmt_name));
	}
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %rdx, %rbx
movq %rsi, %r14
movq %rdi, %r15
movw $0x0, 0x1(%rdx)
movzbl (%rdx), %eax
testb $-0x3, %al
jne 0x1056d2
movq 0x28(%r14), %rcx
cmpq $0x100, %rcx            # imm = 0x100
jne 0x105652
movq 0x20(%r14), %rax
cmpq $-0x10, %rax
jne 0x105632
cmpq $0x2, 0x8(%r14)
jg 0x105632
movq 0x40(%r14), %rdx
cmpq 0x38(%r14), %rdx
jne 0x105632
movl $0x1, %ebp
jmp 0x10564e
cmpq $-0xf, %rax
jl 0x105652
cmpq $0x0, 0x8(%r14)
jne 0x105652
movq 0x40(%r14), %rax
cmpq 0x38(%r14), %rax
jle 0x105652
movl $0x2, %ebp
xorl %eax, %eax
jmp 0x10567e
xorl %ebp, %ebp
movb $0x1, %al
orq 0x20(%r14), %rcx
jne 0x10567e
cmpq $0x1, 0x8(%r14)
jne 0x10567e
cmpq $0x1c, 0x30(%r14)
jne 0x10567e
movq 0x40(%r14), %rax
xorl %ebp, %ebp
cmpq 0x38(%r14), %rax
sete %bpl
setne %al
shll $0x2, %ebp
testb %al, %al
jne 0x1056a2
movq %r14, %rdi
callq 0x106061
leaq 0x70(%r14), %rsi
movl $0x40, %edx
movl %ebp, %ecx
callq 0x105290
testl %eax, %eax
je 0x1056a2
movb $0x2, 0x1(%rbx)
cmpb $0x2, 0x1(%rbx)
jne 0x1056c8
leaq 0x50(%rbx), %rdi
leaq 0x463b9(%rip), %rsi     # 0x14ba6c
movl $0x28, %edx
callq 0xe8ded
leaq 0x32db0(%rip), %rax     # 0x138474
movq %rax, 0x48(%rbx)
cmpb $0x0, 0x1(%rbx)
jne 0x105add
movzbl (%rbx), %eax
cmpl $0x5, %eax
je 0x1056e2
testl %eax, %eax
jne 0x105798
cmpq $0x0, 0x8(%r14)
jne 0x10578e
movq (%r14), %rdi
movq 0x40(%r14), %r12
movq %r12, %rsi
callq 0xef0d5
cmpb $-0x17, %al
jne 0x10578e
movq (%r14), %rdi
leaq 0x1(%r12), %rsi
callq 0xef1ca
addq %rax, %r12
addq $0x3, %r12
movq (%r14), %rdi
movq %r12, %rsi
callq 0xef0d5
cmpb $-0x15, %al
jne 0x10578e
movq (%r14), %rdi
leaq 0x1(%r12), %rsi
callq 0xef135
addq %rax, %r12
addq $0x2, %r12
movq (%r14), %rdi
leaq 0x4632e(%rip), %rdx     # 0x14ba73
movl $0xe, %ecx
movq %r12, %rsi
callq 0xf025e
testl %eax, %eax
je 0x105775
movq (%r14), %rdi
addq $0x8, %r12
leaq 0x4630f(%rip), %rdx     # 0x14ba73
movl $0xe, %ecx
movq %r12, %rsi
callq 0xf025e
testl %eax, %eax
jne 0x10578e
movb $0x5, 0x1(%rbx)
leaq 0x50(%rbx), %rdi
leaq 0x462fe(%rip), %rsi     # 0x14ba82
movl $0x28, %edx
callq 0xe8ded
cmpb $0x0, 0x1(%rbx)
jne 0x105add
movzbl (%rbx), %eax
testb $-0x5, %al
jne 0x1057be
movq %r15, 0x8(%rsp)
cmpq $0x0, 0x20(%r14)
je 0x10583a
cmpb $0x0, 0x1(%rbx)
movq 0x8(%rsp), %r15
jne 0x105add
cmpb $0x0, (%rbx)
je 0x1058b1
cmpb $0x0, (%rbx)
je 0x105917
cmpb $0x0, (%rbx)
je 0x10597d
cmpb $0x0, (%rbx)
je 0x1059a6
movq %r15, %rdi
movq %r14, %rsi
callq 0x105c44
cmpb $0x1, (%rbx)
ja 0x105aa4
movq 0x68(%r14), %rax
movabsq $-0x2759f0ec7097f0f4, %rcx # imm = 0xD8A60F138F680F0C
cmpq %rcx, %rax
je 0x105a5e
movabsq $0x4b6802c9cf419437, %rcx # imm = 0x4B6802C9CF419437
cmpq %rcx, %rax
je 0x105a5a
movabsq $0x246655c50ae99574, %rcx # imm = 0x246655C50AE99574
cmpq %rcx, %rax
jne 0x105a62
movb $0x2, %cl
jmp 0x105a77
movq 0x28(%r14), %rax
cmpq $0x3, %rax
je 0x10584d
testq %rax, %rax
jne 0x1057af
cmpq $0x1, 0x8(%r14)
jg 0x1057af
xorl %r15d, %r15d
leaq 0x463c5(%rip), %r12     # 0x14bc27
movq (%r14), %r13
leaq 0x463b8(%rip), %rax     # 0x14bc24
movzbl (%r15,%rax), %ebp
addq 0x40(%r14), %rbp
movl $0x10, %ecx
movq %r13, %rdi
movq %rbp, %rsi
movq %r12, %rdx
callq 0xf025e
testl %eax, %eax
jne 0x1058a3
addq $0x1a, %rbp
movq %r13, %rdi
movq %rbp, %rsi
callq 0xef0d5
cmpb $-0x75, %al
je 0x105bb5
incq %r15
cmpq $0x3, %r15
jne 0x105862
jmp 0x1057af
cmpq $0x0, 0x8(%r14)
jne 0x105908
cmpq $0x20, 0x38(%r14)
jne 0x105908
cmpq $0x20, 0x40(%r14)
je 0x105908
movq %r14, %rdi
callq 0x106061
leaq 0x70(%r14), %rdi
leaq 0x461b2(%rip), %rsi     # 0x14ba8b
movl $0xb, %edx
movl $0x3f, %ecx
xorl %r8d, %r8d
callq 0xec00b
testl %eax, %eax
je 0x105908
movb $0x63, 0x1(%rbx)
leaq 0x50(%rbx), %rdi
leaq 0x46199(%rip), %rsi     # 0x14ba97
movl $0x28, %edx
callq 0xe8ded
cmpb $0x0, 0x1(%rbx)
jne 0x105add
jmp 0x1057c7
cmpq $0x0, 0x8(%r14)
jne 0x10596e
cmpq $0x20, 0x38(%r14)
jne 0x10596e
cmpq $0x20, 0x40(%r14)
jne 0x10596e
movq %r14, %rdi
callq 0x106061
leaq 0x70(%r14), %rdi
leaq 0x4615f(%rip), %rsi     # 0x14ba9e
movl $0xf, %edx
movl $0x3f, %ecx
xorl %r8d, %r8d
callq 0xec00b
testl %eax, %eax
je 0x10596e
movb $0x63, 0x1(%rbx)
leaq 0x50(%rbx), %rdi
leaq 0x4614a(%rip), %rsi     # 0x14baae
movl $0x28, %edx
callq 0xe8ded
cmpb $0x0, 0x1(%rbx)
jne 0x105add
jmp 0x1057d0
movq %r14, %rdi
callq 0x106061
movzbl 0x70(%r14), %eax
cmpl $0xe, %eax
je 0x105a19
cmpl $0x8c, %eax
jne 0x105a4b
movdqu 0x70(%r14), %xmm0
jmp 0x105a1f
cmpq $0x0, 0x8(%r14)
jne 0x105a0a
cmpq $0x100, 0x18(%r14)      # imm = 0x100
jne 0x105a0a
cmpq $0x100, 0x28(%r14)      # imm = 0x100
jne 0x105a0a
cmpq $-0x10, 0x20(%r14)
jne 0x105a0a
movq %r14, %rdi
callq 0x106061
leaq 0x70(%r14), %rdi
leaq 0x460e7(%rip), %rsi     # 0x14bac2
movl $0x12, %edx
movl $0x3f, %ecx
xorl %r8d, %r8d
callq 0xec00b
testl %eax, %eax
je 0x105a0a
movb $0x63, 0x1(%rbx)
leaq 0x50(%rbx), %rdi
leaq 0x460d5(%rip), %rsi     # 0x14bad5
movl $0x28, %edx
callq 0xe8ded
cmpb $0x0, 0x1(%rbx)
jne 0x105add
jmp 0x1057e2
movdqu 0x71(%r14), %xmm0
pcmpeqb 0x46029(%rip), %xmm0    # 0x14ba50
pmovmskb %xmm0, %eax
cmpl $0xffff, %eax           # imm = 0xFFFF
jne 0x105a4b
movb $0x63, 0x1(%rbx)
leaq 0x50(%rbx), %rdi
leaq 0x46075(%rip), %rsi     # 0x14bab6
movl $0x28, %edx
callq 0xe8ded
cmpb $0x0, 0x1(%rbx)
jne 0x105add
jmp 0x1057d9
movb $0x1, %cl
jmp 0x105a77
movb $0x3, %cl
jmp 0x105a77
movq %r14, %rdi
movq %rbx, %rsi
callq 0x10609e
movb $0x66, %cl
testl %eax, %eax
je 0x105bde
movb %cl, 0x2(%rbx)
movb $0x1, 0x1(%rbx)
leaq 0x50(%rbx), %rdi
leaq 0x46057(%rip), %rsi     # 0x14bae0
movl $0x28, %edx
callq 0xe8ded
leaq 0x2938a(%rip), %rax     # 0x12ee24
movq %rax, 0x48(%rbx)
cmpb $0x0, 0x1(%rbx)
jne 0x105add
movzbl (%rbx), %eax
cmpl $0x3, %eax
je 0x105ab0
testl %eax, %eax
jne 0x105add
cmpq $0x0, 0x8(%r14)
je 0x105b0a
cmpb $0x3, 0x1(%rbx)
jne 0x105add
leaq 0x50(%rbx), %rdi
leaq 0x4602c(%rip), %rsi     # 0x14baf4
movl $0x28, %edx
callq 0xe8ded
leaq 0x17e9b(%rip), %rax     # 0x11d974
movq %rax, 0x48(%rbx)
cmpb $0x0, 0x50(%rbx)
jne 0x105afb
addq $0x50, %rbx
leaq 0xc99e(%rip), %rsi      # 0x11248c
movl $0x28, %edx
movq %rbx, %rdi
callq 0xe8ded
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq 0x28(%r14), %rax
orq $0x2, %rax
cmpq $0x12, %rax
jne 0x105ab7
movq (%r14), %rdi
movq 0x40(%r14), %rsi
addq $-0x2, %rsi
callq 0xef169
movq 0x68(%r14), %rcx
movabsq $-0x5915deb193e9118e, %rdx # imm = 0xA6EA214E6C16EE72
cmpq %rdx, %rcx
je 0x105b73
movabsq $0x1f449ca73852e197, %rdx # imm = 0x1F449CA73852E197
cmpq %rdx, %rcx
je 0x105b73
movabsq $0x4e04abaac5d3b465, %rdx # imm = 0x4E04ABAAC5D3B465
cmpq %rdx, %rcx
je 0x105b73
cmpq $0x5242, %rax           # imm = 0x5242
jne 0x105ab7
cmpq $0x80, 0x18(%r14)
jne 0x105ab7
movq (%r14), %rdi
movl $0xc8, %ecx
addq 0x40(%r14), %rcx
leaq 0x45f66(%rip), %rsi     # 0x14baec
leaq 0x10(%rsp), %r9
movl $0x7, %edx
movl $0x64, %r8d
callq 0xf1a9c
testl %eax, %eax
je 0x105ab7
movq 0x10(%rsp), %rax
movq %rax, 0x20(%rbx)
movb $0x3, 0x1(%rbx)
jmp 0x105ab7
movb $0x4, 0x1(%rbx)
leaq 0x50(%rbx), %rdi
leaq 0x1890d(%rip), %rsi     # 0x11e4d1
movl $0x28, %edx
callq 0xe8ded
leaq 0x187e4(%rip), %rax     # 0x11e3b9
movq %rax, 0x48(%rbx)
jmp 0x1057af
cmpl $0xf537be26, 0x6c(%r14) # imm = 0xF537BE26
jne 0x105a9e
movq (%r14), %rdi
movq 0x40(%r14), %rsi
addq $0x35, %rsi
callq 0xef1ca
cmpq $0xe, %rax
jne 0x105a9e
movq (%r14), %rdi
movq 0x40(%r14), %rsi
addq $0x37, %rsi
callq 0xef257
movq %rax, %r15
movl $0xe, %edx
movq %r14, %rdi
movq %rax, %rsi
callq 0x106143
testl %eax, %eax
je 0x105a9e
movq %r15, 0x30(%rbx)
movq $0xe, 0x38(%rbx)
movb $-0x36, %cl
jmp 0x105a77