// File: /workspace/github_c_makefile_star2_O2/jsummers[P]deark/src/fmtutil-exe.c
// Function: fmtutil_detect_specialexe
void fmtutil_detect_specialexe(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_TEXE) {
		detect_specialexe_texe(c, ei, edd);
		if(edd->detected_fmt!=0) goto done;
	}

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

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

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

	if(edd->restrict_to_fmt==0 || edd->restrict_to_fmt==DE_SPECIALEXEFMT_TEXTLIFE) {
		detect_specialexe_textlife(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 %r15
pushq %r14
pushq %rbx
subq $0x10, %rsp
movq %rdx, %rbx
andw $0x0, 0x1(%rdx)
movq %rsi, %r14
movzbl (%rdx), %eax
cmpl $0xcb, %eax
je 0xf90f5
testl %eax, %eax
jne 0xf915a
cmpq $0x2, 0x50(%r14)
jl 0xf914e
movq 0x38(%r14), %rsi
movq 0x48(%r14), %rax
subq %rsi, %rax
cmpq $0x398c, %rax           # imm = 0x398C
jne 0xf914e
movq (%r14), %rdi
addq $0x3479, %rsi           # imm = 0x3479
leaq 0x45afc(%rip), %rdx     # 0x13ec1c
pushq $0x9
popq %rcx
callq 0xe4d48
testl %eax, %eax
jne 0xf914e
movb $-0x35, 0x1(%rbx)
leaq 0x50(%rbx), %rdi
leaq 0x45aeb(%rip), %rsi     # 0x13ec26
pushq $0x28
popq %rdx
callq 0xde492
leaq 0x1d62a(%rip), %rax     # 0x116774
movq %rax, 0x48(%rbx)
cmpb $0x0, 0x1(%rbx)
jne 0xf9388
movb (%rbx), %al
cmpb $-0x37, %al
je 0xf9169
movzbl %al, %ecx
testl %ecx, %ecx
jne 0xf91f4
cmpq $0x0, 0x8(%r14)
jne 0xf91e8
cmpq $0x200, 0x18(%r14)      # imm = 0x200
jne 0xf91e8
cmpq $0x22, 0x30(%r14)
jne 0xf91e8
movq 0x40(%r14), %rax
cmpq 0x38(%r14), %rax
jne 0xf91e8
movq %r14, %rdi
callq 0xf9427
leaq 0x8d(%r14), %r15
leaq 0x45a8a(%rip), %rsi     # 0x13ec2b
pushq $0xf
popq %rdx
movq %r15, %rdi
callq 0x18230
testl %eax, %eax
je 0xf91c6
leaq 0x45a84(%rip), %rsi     # 0x13ec3b
pushq $0xb
popq %rdx
movq %r15, %rdi
callq 0x18230
testl %eax, %eax
jne 0xf91e8
movb $-0x37, 0x1(%rbx)
leaq 0x50(%rbx), %rdi
leaq 0x45a72(%rip), %rsi     # 0x13ec47
pushq $0x28
popq %rdx
callq 0xde492
leaq 0x1dc94(%rip), %rax     # 0x116e78
movq %rax, 0x48(%rbx)
cmpb $0x0, 0x1(%rbx)
jne 0xf9388
movb (%rbx), %al
cmpb $-0x36, %al
je 0xf91ff
movzbl %al, %ecx
testl %ecx, %ecx
jne 0xf9267
cmpq $0x4c, 0x50(%r14)
jl 0xf925b
movq %r14, %rdi
callq 0xf9427
leaq 0xb0(%r14), %rdi
callq 0xe409c
cmpl $0x3e, %eax
jne 0xf925b
movq (%r14), %rdi
movq 0x38(%r14), %rsi
leaq 0x45a26(%rip), %rdx     # 0x13ec53
pushq $0xa
popq %rcx
callq 0xe4d48
testl %eax, %eax
jne 0xf925b
movb $-0x36, 0x1(%rbx)
leaq 0x50(%rbx), %rdi
leaq 0x45a16(%rip), %rsi     # 0x13ec5e
pushq $0x28
popq %rdx
callq 0xde492
leaq 0x1d4fb(%rip), %rax     # 0x116752
movq %rax, 0x48(%rbx)
cmpb $0x0, 0x1(%rbx)
jne 0xf9388
movb (%rbx), %al
cmpb $-0x34, %al
je 0xf9272
movzbl %al, %ecx
testl %ecx, %ecx
jne 0xf92d4
cmpq $0xc, 0x50(%r14)
jl 0xf92c8
cmpq $-0x10, 0x20(%r14)
jne 0xf92c8
cmpq $0x1, 0x8(%r14)
jne 0xf92c8
movq (%r14), %rdi
movl $0x1d2, %esi            # imm = 0x1D2
addq 0x38(%r14), %rsi
leaq 0x459cd(%rip), %rdx     # 0x13ec67
pushq $0x9
popq %rcx
callq 0xe4d48
testl %eax, %eax
jne 0xf92c8
movb $-0x34, 0x1(%rbx)
leaq 0x50(%rbx), %rdi
leaq 0x459bc(%rip), %rsi     # 0x13ec71
pushq $0x28
popq %rdx
callq 0xde492
leaq 0x1d4ca(%rip), %rax     # 0x11678e
movq %rax, 0x48(%rbx)
cmpb $0x0, 0x1(%rbx)
jne 0xf9388
movb (%rbx), %al
cmpb $-0x33, %al
je 0xf92e3
movzbl %al, %eax
testl %eax, %eax
jne 0xf9388
cmpq $0xfff0, 0x18(%r14)     # imm = 0xFFF0
jne 0xf9388
movq $-0x2ee1, %rax          # imm = 0xD11F
addq 0x28(%r14), %rax
cmpq $-0x1389, %rax          # imm = 0xEC77
jb 0xf9388
movq $-0x137, %rax           # imm = 0xFEC9
addq 0x8(%r14), %rax
cmpq $-0x51, %rax
jb 0xf9388
movq (%r14), %rdi
movq 0x38(%r14), %rsi
leaq 0x45957(%rip), %rdx     # 0x13ec7e
pushq $0x7
popq %rcx
callq 0xe4d48
testl %eax, %eax
jne 0xf9388
movq (%r14), %rdi
movl $0x36b0, %ecx           # imm = 0x36B0
addq 0x38(%r14), %rcx
leaq 0x45940(%rip), %rsi     # 0x13ec86
pushq $0x6
popq %rdx
leaq 0x8(%rsp), %r9
movl $0xfa0, %r8d            # imm = 0xFA0
callq 0xe62f1
testl %eax, %eax
je 0xf9388
movq 0x8(%rsp), %rax
movq %rax, 0x20(%rbx)
movb $-0x33, 0x1(%rbx)
leaq 0x50(%rbx), %rdi
leaq 0x45918(%rip), %rsi     # 0x13ec8d
pushq $0x28
popq %rdx
callq 0xde492
leaq 0x1d43e(%rip), %rax     # 0x1167c2
movq %rax, 0x48(%rbx)
cmpb $0x0, 0x50(%rbx)
jne 0xf93a4
addq $0x50, %rbx
leaq 0xc0e3(%rip), %rsi      # 0x10547c
pushq $0x28
popq %rdx
movq %rbx, %rdi
callq 0xde492
addq $0x10, %rsp
popq %rbx
popq %r14
popq %r15
retq