// File: /workspace/github_c_makefile_star2_O3/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 0x105272
movq 0x20(%r14), %rcx
movq 0x28(%r14), %rax
cmpq $0x100, %rax            # imm = 0x100
jne 0x1051fa
cmpq $-0x10, %rcx
jne 0x1051e2
movq $-0x10, %rcx
cmpq $0x2, 0x8(%r14)
jg 0x1051fa
movq 0x40(%r14), %rdx
movl $0x1, %ebp
cmpq 0x38(%r14), %rdx
jne 0x1051fa
jmp 0x10521c
jle 0x1051fa
cmpq $0x0, 0x8(%r14)
jne 0x1051fa
movq 0x40(%r14), %rdx
movl $0x2, %ebp
cmpq 0x38(%r14), %rdx
jg 0x10521c
orq %rax, %rcx
jne 0x105270
cmpq $0x1, 0x8(%r14)
jne 0x105270
cmpq $0x1c, 0x30(%r14)
jne 0x105270
movq 0x40(%r14), %rax
movl $0x4, %ebp
cmpq 0x38(%r14), %rax
jne 0x105270
movq %r14, %rdi
callq 0x105bf5
leaq 0x70(%r14), %rsi
movl $0x40, %edx
movl %ebp, %ecx
callq 0x104e38
testl %eax, %eax
je 0x10523e
movb $0x2, 0x1(%rbx)
jmp 0x105245
movb 0x1(%rbx), %al
cmpb $0x2, %al
jne 0x105268
leaq 0x50(%rbx), %rdi
leaq 0x46e3c(%rip), %rsi     # 0x14c08c
movl $0x28, %edx
callq 0xe8219
leaq 0x33348(%rip), %rax     # 0x1385a9
movq %rax, 0x48(%rbx)
movb 0x1(%rbx), %al
testb %al, %al
jne 0x105669
movb (%rbx), %al
cmpb $0x5, %al
je 0x105281
movzbl %al, %ecx
testl %ecx, %ecx
jne 0x105339
cmpq $0x0, 0x8(%r14)
jne 0x10532d
movq (%r14), %rdi
movq 0x40(%r14), %r12
movq %r12, %rsi
callq 0xeead3
cmpb $-0x17, %al
jne 0x10532d
movq (%r14), %rdi
leaq 0x1(%r12), %rsi
callq 0xeebc8
addq %rax, %r12
addq $0x3, %r12
movq (%r14), %rdi
movq %r12, %rsi
callq 0xeead3
cmpb $-0x15, %al
jne 0x10532d
movq (%r14), %rdi
leaq 0x1(%r12), %rsi
callq 0xeeb33
addq %rax, %r12
addq $0x2, %r12
movq (%r14), %rdi
leaq 0x46daf(%rip), %rdx     # 0x14c093
movl $0xe, %ecx
movq %r12, %rsi
callq 0xefc85
testl %eax, %eax
je 0x105314
movq (%r14), %rdi
addq $0x8, %r12
leaq 0x46d90(%rip), %rdx     # 0x14c093
movl $0xe, %ecx
movq %r12, %rsi
callq 0xefc85
testl %eax, %eax
jne 0x10532d
movb $0x5, 0x1(%rbx)
leaq 0x50(%rbx), %rdi
leaq 0x46d7f(%rip), %rsi     # 0x14c0a2
movl $0x28, %edx
callq 0xe8219
cmpb $0x0, 0x1(%rbx)
jne 0x105669
movb (%rbx), %al
testb $-0x5, %al
jne 0x10535a
movq %r15, 0x8(%rsp)
cmpq $0x0, 0x20(%r14)
je 0x1053bb
cmpb $0x0, 0x1(%rbx)
movq 0x8(%rsp), %r15
jne 0x105669
movb (%rbx), %al
testb %al, %al
je 0x105432
movq %r15, %rdi
movq %r14, %rsi
callq 0x1057dc
movb (%rbx), %al
cmpb $0x1, %al
ja 0x105586
movq 0x68(%r14), %rax
movabsq $-0x2759f0ec7097f0f4, %rcx # imm = 0xD8A60F138F680F0C
cmpq %rcx, %rax
je 0x10553a
movabsq $0x4b6802c9cf419437, %rcx # imm = 0x4B6802C9CF419437
cmpq %rcx, %rax
je 0x105536
movabsq $0x246655c50ae99574, %rcx # imm = 0x246655C50AE99574
cmpq %rcx, %rax
jne 0x10553e
movb $0x2, %cl
jmp 0x105553
movq 0x28(%r14), %rax
cmpq $0x3, %rax
je 0x1053ce
testq %rax, %rax
jne 0x105349
cmpq $0x1, 0x8(%r14)
jg 0x105349
xorl %r15d, %r15d
leaq 0x46e64(%rip), %r12     # 0x14c247
movq (%r14), %r13
leaq 0x46e57(%rip), %rax     # 0x14c244
movzbl (%r15,%rax), %ebp
addq 0x40(%r14), %rbp
movl $0x10, %ecx
movq %r13, %rdi
movq %rbp, %rsi
movq %r12, %rdx
callq 0xefc85
testl %eax, %eax
jne 0x105424
addq $0x1a, %rbp
movq %r13, %rdi
movq %rbp, %rsi
callq 0xeead3
cmpb $-0x75, %al
je 0x105696
incq %r15
cmpq $0x3, %r15
jne 0x1053e3
jmp 0x105349
cmpq $0x0, 0x8(%r14)
jne 0x105489
cmpq $0x20, 0x38(%r14)
jne 0x105489
cmpq $0x20, 0x40(%r14)
je 0x105489
movq %r14, %rdi
callq 0x105bf5
leaq 0x70(%r14), %rdi
leaq 0x46c51(%rip), %rsi     # 0x14c0ab
movl $0xb, %edx
movl $0x3f, %ecx
xorl %r8d, %r8d
callq 0xeba3e
testl %eax, %eax
je 0x105489
movb $0x63, 0x1(%rbx)
leaq 0x50(%rbx), %rdi
leaq 0x46c38(%rip), %rsi     # 0x14c0b7
movl $0x28, %edx
callq 0xe8219
cmpb $0x0, 0x1(%rbx)
jne 0x105669
cmpb $0x0, (%rbx)
jne 0x105362
cmpq $0x0, 0x8(%r14)
jne 0x1054f3
cmpq $0x20, 0x38(%r14)
jne 0x1054f3
cmpq $0x20, 0x40(%r14)
jne 0x1054f3
movq %r14, %rdi
callq 0x105bf5
leaq 0x70(%r14), %rdi
leaq 0x46bfa(%rip), %rsi     # 0x14c0be
movl $0xf, %edx
movl $0x3f, %ecx
xorl %r8d, %r8d
callq 0xeba3e
testl %eax, %eax
je 0x1054f3
movb $0x63, 0x1(%rbx)
leaq 0x50(%rbx), %rdi
leaq 0x46be5(%rip), %rsi     # 0x14c0ce
movl $0x28, %edx
callq 0xe8219
cmpb $0x0, 0x1(%rbx)
jne 0x105669
cmpb $0x0, (%rbx)
jne 0x105362
movq %r14, %rdi
callq 0x105bf5
leaq 0x70(%r14), %r12
movzbl 0x70(%r14), %eax
cmpl $0xe, %eax
je 0x105725
cmpl $0x8c, %eax
jne 0x105757
movdqu (%r12), %xmm0
jmp 0x10572b
movb $0x1, %cl
jmp 0x105553
movb $0x3, %cl
jmp 0x105553
movq %r14, %rdi
movq %rbx, %rsi
callq 0x105c32
movb $0x66, %cl
testl %eax, %eax
je 0x1056bf
movb %cl, 0x2(%rbx)
movb $0x1, 0x1(%rbx)
leaq 0x50(%rbx), %rdi
leaq 0x46b9b(%rip), %rsi     # 0x14c100
movl $0x28, %edx
callq 0xe8219
leaq 0x29b91(%rip), %rax     # 0x12f107
movq %rax, 0x48(%rbx)
cmpb $0x0, 0x1(%rbx)
jne 0x105669
movb (%rbx), %al
cmpb $0x3, %al
je 0x105595
movzbl %al, %eax
testl %eax, %eax
jne 0x105669
cmpq $0x0, 0x8(%r14)
je 0x1055ab
cmpb $0x3, 0x1(%rbx)
je 0x105649
jmp 0x105669
movq 0x28(%r14), %rax
orq $0x2, %rax
cmpq $0x12, %rax
jne 0x10559c
movq (%r14), %rdi
movq 0x40(%r14), %rsi
addq $-0x2, %rsi
callq 0xeeb67
movq 0x68(%r14), %rcx
movabsq $-0x5915deb193e9118e, %rdx # imm = 0xA6EA214E6C16EE72
cmpq %rdx, %rcx
je 0x10560c
movabsq $0x1f449ca73852e197, %rdx # imm = 0x1F449CA73852E197
cmpq %rdx, %rcx
je 0x10560c
movabsq $0x4e04abaac5d3b465, %rdx # imm = 0x4E04ABAAC5D3B465
cmpq %rdx, %rcx
je 0x10560c
cmpq $0x5242, %rax           # imm = 0x5242
jne 0x10559c
cmpq $0x80, 0x18(%r14)
jne 0x10559c
movq (%r14), %rdi
movl $0xc8, %ecx
addq 0x40(%r14), %rcx
leaq 0x46aed(%rip), %rsi     # 0x14c10c
leaq 0x10(%rsp), %r9
movl $0x7, %edx
movl $0x64, %r8d
callq 0xf149c
testl %eax, %eax
je 0x10559c
movq 0x10(%rsp), %rax
movq %rax, 0x20(%rbx)
movb $0x3, 0x1(%rbx)
leaq 0x50(%rbx), %rdi
leaq 0x46ac0(%rip), %rsi     # 0x14c114
movl $0x28, %edx
callq 0xe8219
leaq 0x1841f(%rip), %rax     # 0x11da84
movq %rax, 0x48(%rbx)
cmpb $0x0, 0x50(%rbx)
jne 0x105687
addq $0x50, %rbx
leaq 0xce22(%rip), %rsi      # 0x11249c
movl $0x28, %edx
movq %rbx, %rdi
callq 0xe8219
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 0x18f33(%rip), %rsi     # 0x11e5d8
movl $0x28, %edx
callq 0xe8219
leaq 0x18e0a(%rip), %rax     # 0x11e4c0
movq %rax, 0x48(%rbx)
jmp 0x105349
cmpl $0xf537be26, 0x6c(%r14) # imm = 0xF537BE26
jne 0x10557a
movq (%r14), %rdi
movq 0x40(%r14), %rsi
addq $0x35, %rsi
callq 0xeebc8
cmpq $0xe, %rax
jne 0x10557a
movq (%r14), %rdi
movq 0x40(%r14), %rsi
addq $0x37, %rsi
callq 0xeec55
movq %rax, %r15
movl $0xe, %edx
movq %r14, %rdi
movq %rax, %rsi
callq 0x105cce
testl %eax, %eax
je 0x10557a
movq %r15, 0x30(%rbx)
movq $0xe, 0x38(%rbx)
movb $-0x36, %cl
jmp 0x105553
movdqu 0x71(%r14), %xmm0
pcmpeqb 0x4693d(%rip), %xmm0    # 0x14c070
pmovmskb %xmm0, %eax
cmpl $0xffff, %eax           # imm = 0xFFFF
jne 0x105757
movb $0x63, 0x1(%rbx)
leaq 0x50(%rbx), %rdi
leaq 0x46989(%rip), %rsi     # 0x14c0d6
movl $0x28, %edx
callq 0xe8219
cmpb $0x0, 0x1(%rbx)
jne 0x105669
cmpb $0x0, (%rbx)
jne 0x105362
cmpq $0x0, 0x8(%r14)
jne 0x1057cd
cmpq $0x100, 0x18(%r14)      # imm = 0x100
jne 0x1057cd
cmpq $0x100, 0x28(%r14)      # imm = 0x100
jne 0x1057cd
cmpq $-0x10, 0x20(%r14)
jne 0x1057cd
movq %r14, %rdi
callq 0x105bf5
leaq 0x46947(%rip), %rsi     # 0x14c0e2
movl $0x12, %edx
movq %r12, %rdi
movl $0x3f, %ecx
xorl %r8d, %r8d
callq 0xeba3e
testl %eax, %eax
je 0x1057cd
movb $0x63, 0x1(%rbx)
leaq 0x50(%rbx), %rdi
leaq 0x46932(%rip), %rsi     # 0x14c0f5
movl $0x28, %edx
callq 0xe8219
cmpb $0x0, 0x1(%rbx)
jne 0x105669
jmp 0x105362