// File: /workspace/github_c_makefile_star2_O2/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
andw $0x0, 0x1(%rdx)
movq %rsi, %r14
movq %rdi, %r13
movzbl (%rdx), %eax
testb $-0x3, %al
jne 0xf8b02
movq 0x20(%r14), %rcx
movq 0x28(%r14), %rax
cmpq $0x100, %rax            # imm = 0x100
jne 0xf8a90
cmpq $-0x10, %rcx
jne 0xf8a79
pushq $-0x10
popq %rcx
cmpq $0x2, 0x8(%r14)
jg 0xf8a90
movq 0x40(%r14), %rdx
cmpq 0x38(%r14), %rdx
jne 0xf8a90
pushq $0x1
jmp 0xf8aaf
jle 0xf8a90
cmpq $0x0, 0x8(%r14)
jne 0xf8a90
movq 0x40(%r14), %rdx
cmpq 0x38(%r14), %rdx
jle 0xf8a90
pushq $0x2
jmp 0xf8aaf
orq %rax, %rcx
jne 0xf8b00
cmpq $0x1, 0x8(%r14)
jne 0xf8b00
cmpq $0x1c, 0x30(%r14)
jne 0xf8b00
movq 0x40(%r14), %rax
cmpq 0x38(%r14), %rax
jne 0xf8b00
pushq $0x4
popq %rbp
movq %r14, %rdi
callq 0xf9427
leaq 0x70(%r14), %rsi
pushq $0x40
popq %rdx
movl %ebp, %ecx
callq 0xf8720
testl %eax, %eax
je 0xf8ad0
movb $0x2, 0x1(%rbx)
jmp 0xf8ad7
movb 0x1(%rbx), %al
cmpb $0x2, %al
jne 0xf8af8
leaq 0x50(%rbx), %rdi
leaq 0x460aa(%rip), %rsi     # 0x13eb8c
pushq $0x28
popq %rdx
callq 0xde492
leaq 0x327b8(%rip), %rax     # 0x12b2a9
movq %rax, 0x48(%rbx)
movb 0x1(%rbx), %al
testb %al, %al
jne 0xf8edf
movb (%rbx), %al
cmpb $0x5, %al
je 0xf8b11
movzbl %al, %ecx
testl %ecx, %ecx
jne 0xf8bc3
cmpq $0x0, 0x8(%r14)
jne 0xf8bb7
movq (%r14), %rdi
movq 0x40(%r14), %r15
movq %r15, %rsi
callq 0xe3eb4
cmpb $-0x17, %al
jne 0xf8bb7
movq (%r14), %rdi
leaq 0x1(%r15), %rsi
callq 0xe3fa3
leaq (%r15,%rax), %r12
addq $0x3, %r12
movq (%r14), %rdi
movq %r12, %rsi
callq 0xe3eb4
cmpb $-0x15, %al
jne 0xf8bb7
movq (%r14), %rdi
leaq 0x1(%r12), %rsi
callq 0xe3f12
addq %rax, %r12
addq $0x2, %r12
movq (%r14), %rdi
leaq 0x4601f(%rip), %rdx     # 0x13eb93
pushq $0xe
popq %rcx
movq %r12, %rsi
callq 0xe4d48
testl %eax, %eax
je 0xf8ba0
movq (%r14), %rdi
addq $0x8, %r12
leaq 0x46002(%rip), %rdx     # 0x13eb93
pushq $0xe
popq %rcx
movq %r12, %rsi
callq 0xe4d48
testl %eax, %eax
jne 0xf8bb7
movb $0x5, 0x1(%rbx)
leaq 0x50(%rbx), %rdi
leaq 0x45ff3(%rip), %rsi     # 0x13eba2
pushq $0x28
popq %rdx
callq 0xde492
cmpb $0x0, 0x1(%rbx)
jne 0xf8edf
movb (%rbx), %al
testb $-0x5, %al
jne 0xf8be4
movq %r13, 0x8(%rsp)
cmpq $0x0, 0x20(%r14)
je 0xf8c45
cmpb $0x0, 0x1(%rbx)
movq 0x8(%rsp), %r13
jne 0xf8edf
movb (%rbx), %al
testb %al, %al
je 0xf8cbc
movq %r13, %rdi
movq %r14, %rsi
callq 0xf9044
movb (%rbx), %al
cmpb $0x1, %al
ja 0xf8e02
movq 0x68(%r14), %rax
movabsq $-0x2759f0ec7097f0f4, %rcx # imm = 0xD8A60F138F680F0C
cmpq %rcx, %rax
je 0xf8db8
movabsq $0x4b6802c9cf419437, %rcx # imm = 0x4B6802C9CF419437
cmpq %rcx, %rax
je 0xf8db4
movabsq $0x246655c50ae99574, %rcx # imm = 0x246655C50AE99574
cmpq %rcx, %rax
jne 0xf8dbc
movb $0x2, %cl
jmp 0xf8dd1
movq 0x28(%r14), %rax
cmpq $0x3, %rax
je 0xf8c58
testq %rax, %rax
jne 0xf8bd3
cmpq $0x1, 0x8(%r14)
jg 0xf8bd3
xorl %r12d, %r12d
pushq $0x10
popq %r13
cmpq $0x3, %r12
je 0xf8bd3
movq (%r14), %rbp
leaq 0x460c6(%rip), %rax     # 0x13ed44
movzbl (%r12,%rax), %r15d
addq 0x40(%r14), %r15
movq %rbp, %rdi
movq %r15, %rsi
leaq 0x460b3(%rip), %rdx     # 0x13ed47
movq %r13, %rcx
callq 0xe4d48
testl %eax, %eax
jne 0xf8cb7
addq $0x1a, %r15
movq %rbp, %rdi
movq %r15, %rsi
callq 0xe3eb4
cmpb $-0x75, %al
je 0xf8f0a
incq %r12
jmp 0xf8c6a
cmpq $0x0, 0x8(%r14)
jne 0xf8d0d
cmpq $0x20, 0x38(%r14)
jne 0xf8d0d
cmpq $0x20, 0x40(%r14)
je 0xf8d0d
movq %r14, %rdi
callq 0xf9427
leaq 0x70(%r14), %rdi
leaq 0x45ec7(%rip), %rsi     # 0x13ebab
pushq $0xb
popq %rdx
pushq $0x3f
popq %rcx
xorl %r8d, %r8d
callq 0xe0fff
testl %eax, %eax
je 0xf8d0d
movb $0x63, 0x1(%rbx)
leaq 0x50(%rbx), %rdi
leaq 0x45eb2(%rip), %rsi     # 0x13ebb7
pushq $0x28
popq %rdx
callq 0xde492
cmpb $0x0, 0x1(%rbx)
jne 0xf8edf
cmpb $0x0, (%rbx)
jne 0xf8bec
cmpq $0x0, 0x8(%r14)
jne 0xf8d71
cmpq $0x20, 0x38(%r14)
jne 0xf8d71
cmpq $0x20, 0x40(%r14)
jne 0xf8d71
movq %r14, %rdi
callq 0xf9427
leaq 0x70(%r14), %rdi
leaq 0x45e76(%rip), %rsi     # 0x13ebbe
pushq $0xf
popq %rdx
pushq $0x3f
popq %rcx
xorl %r8d, %r8d
callq 0xe0fff
testl %eax, %eax
je 0xf8d71
movb $0x63, 0x1(%rbx)
leaq 0x50(%rbx), %rdi
leaq 0x45e65(%rip), %rsi     # 0x13ebce
pushq $0x28
popq %rdx
callq 0xde492
cmpb $0x0, 0x1(%rbx)
jne 0xf8edf
cmpb $0x0, (%rbx)
jne 0xf8bec
movq %r14, %rdi
callq 0xf9427
leaq 0x70(%r14), %r12
movzbl 0x70(%r14), %eax
cmpl $0xe, %eax
je 0xf8f95
cmpl $0x8c, %eax
jne 0xf8fc5
movdqu (%r12), %xmm0
jmp 0xf8f9b
movb $0x1, %cl
jmp 0xf8dd1
movb $0x3, %cl
jmp 0xf8dd1
movq %r14, %rdi
movq %rbx, %rsi
callq 0xf946d
movb $0x66, %cl
testl %eax, %eax
je 0xf8f31
movb %cl, 0x2(%rbx)
movb $0x1, 0x1(%rbx)
leaq 0x50(%rbx), %rdi
leaq 0x45e1d(%rip), %rsi     # 0x13ec00
pushq $0x28
popq %rdx
callq 0xde492
leaq 0x2908d(%rip), %rax     # 0x121e7f
movq %rax, 0x48(%rbx)
cmpb $0x0, 0x1(%rbx)
jne 0xf8edf
movb (%rbx), %al
cmpb $0x3, %al
je 0xf8e11
movzbl %al, %eax
testl %eax, %eax
jne 0xf8edf
cmpq $0x0, 0x8(%r14)
je 0xf8e27
cmpb $0x3, 0x1(%rbx)
je 0xf8ec1
jmp 0xf8edf
movq 0x28(%r14), %rax
orq $0x2, %rax
cmpq $0x12, %rax
jne 0xf8e18
movq (%r14), %rdi
movq 0x40(%r14), %rsi
addq $-0x2, %rsi
callq 0xe3f46
movq 0x68(%r14), %rcx
movabsq $-0x5915deb193e9118e, %rdx # imm = 0xA6EA214E6C16EE72
cmpq %rdx, %rcx
je 0xf8e88
movabsq $0x1f449ca73852e197, %rdx # imm = 0x1F449CA73852E197
cmpq %rdx, %rcx
je 0xf8e88
movabsq $0x4e04abaac5d3b465, %rdx # imm = 0x4E04ABAAC5D3B465
cmpq %rdx, %rcx
je 0xf8e88
cmpq $0x5242, %rax           # imm = 0x5242
jne 0xf8e18
cmpq $0x80, 0x18(%r14)
jne 0xf8e18
movq (%r14), %rdi
movl $0xc8, %ecx
addq 0x40(%r14), %rcx
leaq 0x45d71(%rip), %rsi     # 0x13ec0c
pushq $0x7
popq %rdx
pushq $0x64
popq %r8
leaq 0x10(%rsp), %r9
callq 0xe62f1
testl %eax, %eax
je 0xf8e18
movq 0x10(%rsp), %rax
movq %rax, 0x20(%rbx)
movb $0x3, 0x1(%rbx)
leaq 0x50(%rbx), %rdi
leaq 0x45d48(%rip), %rsi     # 0x13ec14
pushq $0x28
popq %rdx
callq 0xde492
leaq 0x17ab9(%rip), %rax     # 0x110994
movq %rax, 0x48(%rbx)
cmpb $0x0, 0x50(%rbx)
jne 0xf8efb
addq $0x50, %rbx
leaq 0xc58c(%rip), %rsi      # 0x10547c
pushq $0x28
popq %rdx
movq %rbx, %rdi
callq 0xde492
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movb $0x4, 0x1(%rbx)
leaq 0x50(%rbx), %rdi
leaq 0x185ef(%rip), %rsi     # 0x111508
pushq $0x28
popq %rdx
callq 0xde492
leaq 0x184c8(%rip), %rax     # 0x1113f0
movq %rax, 0x48(%rbx)
jmp 0xf8bd3
cmpl $0xf537be26, 0x6c(%r14) # imm = 0xF537BE26
jne 0xf8df6
movq (%r14), %rdi
movq 0x40(%r14), %rsi
addq $0x35, %rsi
callq 0xe3fa3
cmpq $0xe, %rax
jne 0xf8df6
movq (%r14), %rdi
movq 0x40(%r14), %rsi
addq $0x37, %rsi
callq 0xe400a
movq %rax, %r15
pushq $0xe
popq %rdx
movq %r14, %rdi
movq %rax, %rsi
callq 0xf9505
testl %eax, %eax
je 0xf8df6
movq %r15, 0x30(%rbx)
movq $0xe, 0x38(%rbx)
movb $-0x36, %cl
jmp 0xf8dd1
movdqu 0x71(%r14), %xmm0
pcmpeqb 0x45bcd(%rip), %xmm0    # 0x13eb70
pmovmskb %xmm0, %eax
cmpl $0xffff, %eax           # imm = 0xFFFF
jne 0xf8fc5
movb $0x63, 0x1(%rbx)
leaq 0x50(%rbx), %rdi
leaq 0x45c19(%rip), %rsi     # 0x13ebd6
pushq $0x28
popq %rdx
callq 0xde492
cmpb $0x0, 0x1(%rbx)
jne 0xf8edf
cmpb $0x0, (%rbx)
jne 0xf8bec
cmpq $0x0, 0x8(%r14)
jne 0xf9035
cmpq $0x100, 0x18(%r14)      # imm = 0x100
jne 0xf9035
cmpq $0x100, 0x28(%r14)      # imm = 0x100
jne 0xf9035
cmpq $-0x10, 0x20(%r14)
jne 0xf9035
movq %r14, %rdi
callq 0xf9427
leaq 0x45bd9(%rip), %rsi     # 0x13ebe2
pushq $0x12
popq %rdx
pushq $0x3f
popq %rcx
movq %r12, %rdi
xorl %r8d, %r8d
callq 0xe0fff
testl %eax, %eax
je 0xf9035
movb $0x63, 0x1(%rbx)
leaq 0x50(%rbx), %rdi
leaq 0x45bc8(%rip), %rsi     # 0x13ebf5
pushq $0x28
popq %rdx
callq 0xde492
cmpb $0x0, 0x1(%rbx)
jne 0xf8edf
jmp 0xf8bec