// File: /workspace/github_c_makefile_star2_O1/jsummers[P]deark/modules/unsupported.c
// Function: get_fmt
static void get_fmt(deark *c, struct fmtinfo_struct *fmti)
{
	u8 b[32];

	de_zeromem(fmti, sizeof(struct fmtinfo_struct));

	de_read(b, 0, sizeof(b));

	if(!de_memcmp(b, "\x42\x5a\x68", 3) &&
		!de_memcmp(&b[4], "\x31\x41\x59\x26\x53\x59", 6) )
	{
		fmti->confidence = 90;
		fmti->descr = "a bzip2-compressed file";
		return;
	}

	if(!de_memcmp(b, "7z\xbc\xaf\x27\x1c", 6)) {
		fmti->confidence = 90;
		fmti->descr = "a 7z file";
		return;
	}

	// Note - Make sure BSAVE has lower confidence.
	if(!de_memcmp(b, "\xfd\x37\x7a\x58\x5a\x00", 6)) {
		fmti->confidence = 90;
		fmti->descr = "an xz-compressed file";
		return;
	}

	if(!de_memcmp(b, "LZIP", 4)) {
		fmti->confidence = 50;
		fmti->descr = "an lzip-compressed file";
		return;
	}

	if(!de_memcmp(b, "<?xpacket", 9)) {
		fmti->confidence = 20;
		fmti->descr = "an XMP file";
		return;
	}

	if(!de_memcmp(b, "ISc(", 4)) {
		fmti->confidence = 40;
		fmti->descr = "an InstallShield CAB file";
		return;
	}

	if(b[0]=='H' && b[1]=='P' && b[2]=='H' && b[3]=='P' &&
		b[4]=='4' && (b[5]=='8' || b[5]=='9'))
	{
		fmti->confidence = 90;
		fmti->descr = "a non-GROB HP-48/49 file";
		return;
	}

	if(!de_memcmp(b, "%PDF-", 5)) {
		fmti->confidence = 90;
		fmti->descr = "a PDF file";
		return;
	}

	if(!de_memcmp(b, "\x7f" "ELF", 4)) {
		fmti->confidence = 40;
		fmti->descr = "an ELF binary";
		return;
	}

	if(!de_memcmp(b, "\xff" "WPC", 4)) {
		fmti->confidence = 40;
		fmti->descr = "a WordPerfect document";
		return;
	}

	if((!de_memcmp(b, "StuffIt", 7)) && (b[7]=='!' || b[7]=='?')) {
		fmti->confidence = 90;
		fmti->descr = "a StuffIt X archive";
		return;
	}

	if(!de_memcmp(b, "ICE!", 4) ||
		!de_memcmp(b, "Ice!", 4))
	{
		fmti->confidence = 75;
		fmti->descr = "a Pack-Ice compressed file";
		return;
	}

	// Note - Make sure Atari CAS has lower confidence.
	if(!de_memcmp(b, "FUJIFILMCCD-RAW", 15)) {
		fmti->confidence = 100;
		fmti->descr = "a Fujifilm RAF file";
		return;
	}

	if(!de_memcmp(b, "AutoCAD Slide\r\n\x1a", 16)) {
		fmti->confidence = 100;
		fmti->descr = "an AutoCAD Slide file";
		return;
	}

	if(!de_memcmp(b, "Top!", 4)) {
		// A format often found alongside RISC OS Draw files
		fmti->confidence = 9;
		fmti->descr = "an ArtWorks image";
		return;
	}

	if(!de_memcmp(b, "CPT", 3) &&
		(b[3]>='7' && b[3]<='9') &&
		!de_memcmp(&b[4], "FILE", 4))
	{
		fmti->confidence = 91;
		fmti->descr = "a Corel Photo-Paint image";
		return;
	}

	if(!de_memcmp(b, (const void*)"Creative Voice File\x1a", 20)) {
		fmti->confidence = 90;
		fmti->descr = "a Creative Voice audio file";
		return;
	}

	// We're not trying to detect every HTML file, but we want to make sure
	// we can detect the ones we generate.
	if(!de_memcmp(b, "<!DOCTYPE html", 14) ||
		!de_memcmp(b, "\xef\xbb\xbf<!DOCTYPE html", 17) ||
		!de_memcmp(b, "<html", 5))
	{
		fmti->confidence = 20;
		fmti->descr = "an HTML file";
		return;
	}
}

// Assembly:
pushq %r14
pushq %rbx
subq $0x28, %rsp
movq %rsi, %rbx
pxor %xmm0, %xmm0
movdqu %xmm0, (%rsi)
movq 0x18(%rdi), %rdi
movq %rsp, %r14
movl $0x20, %ecx
movq %r14, %rsi
xorl %edx, %edx
callq 0xeeee8
movl $0x5a42, %eax           # imm = 0x5A42
xorl (%r14), %eax
movzbl 0x2(%r14), %ecx
xorl $0x68, %ecx
orw %ax, %cx
jne 0xd214f
movl $0x26594131, %eax       # imm = 0x26594131
xorl 0x4(%rsp), %eax
movzwl 0x8(%rsp), %ecx
xorl $0x5953, %ecx           # imm = 0x5953
orl %eax, %ecx
je 0xd21d7
movl $0xafbc7a37, %eax       # imm = 0xAFBC7A37
xorl (%rsp), %eax
movzwl 0x4(%rsp), %ecx
xorl $0x1c27, %ecx           # imm = 0x1C27
orl %eax, %ecx
je 0xd2193
movl $0x587a37fd, %eax       # imm = 0x587A37FD
xorl (%rsp), %eax
movzwl 0x4(%rsp), %ecx
xorl $0x5a, %ecx
orl %eax, %ecx
je 0xd219c
movl (%rsp), %ecx
cmpl $0x50495a4c, %ecx       # imm = 0x50495A4C
jne 0xd21a5
leaq 0x6ddb4(%rip), %rcx     # 0x13ff40
movl $0x32, %eax
jmp 0xd21e3
leaq 0x6dd86(%rip), %rcx     # 0x13ff20
jmp 0xd21de
leaq 0x6dd87(%rip), %rcx     # 0x13ff2a
jmp 0xd21de
movabsq $0x656b636170783f3c, %rax # imm = 0x656B636170783F3C
xorq (%rsp), %rax
movzbl 0x8(%rsp), %edx
xorq $0x74, %rdx
orq %rax, %rdx
je 0xd21f1
movl $0x28, %eax
cmpl $0x28635349, %ecx       # imm = 0x28635349
jne 0xd21ff
leaq 0x6dd99(%rip), %rcx     # 0x13ff6e
jmp 0xd21e3
leaq 0x6dd23(%rip), %rcx     # 0x13ff01
movl $0x5a, %eax
movl %eax, (%rbx)
movq %rcx, 0x8(%rbx)
addq $0x28, %rsp
popq %rbx
popq %r14
retq
leaq 0x6dd6a(%rip), %rcx     # 0x13ff62
movl $0x14, %eax
jmp 0xd21e3
cmpb $0x48, (%rsp)
movb 0x3(%rsp), %dl
jne 0xd2238
cmpb $0x50, 0x1(%rsp)
jne 0xd2238
cmpb $0x48, 0x2(%rsp)
jne 0xd2238
cmpb $0x50, %dl
jne 0xd2238
cmpb $0x34, 0x4(%rsp)
jne 0xd2238
movb 0x5(%rsp), %cl
andb $-0x2, %cl
cmpb $0x38, %cl
jne 0xd2238
leaq 0x6dd52(%rip), %rcx     # 0x13ff88
jmp 0xd21de
movl $0x46445025, %ecx       # imm = 0x46445025
xorl (%rsp), %ecx
movzbl 0x4(%rsp), %esi
xorl $0x2d, %esi
orl %ecx, %esi
je 0xd226b
movl (%rsp), %esi
cmpl $0x464c457f, %esi       # imm = 0x464C457F
je 0xd2277
cmpl $0x435057ff, %esi       # imm = 0x435057FF
jne 0xd2283
leaq 0x6dd5a(%rip), %rcx     # 0x13ffc0
jmp 0xd21e3
leaq 0x6dd35(%rip), %rcx     # 0x13ffa7
jmp 0xd21de
leaq 0x6dd34(%rip), %rcx     # 0x13ffb2
jmp 0xd21e3
movl $0x66757453, %eax       # imm = 0x66757453
xorl (%rsp), %eax
movl $0x74496666, %ecx       # imm = 0x74496666
xorl 0x3(%rsp), %ecx
orl %eax, %ecx
je 0xd2315
leaq 0x6dd54(%rip), %rcx     # 0x13fff3
movl $0x4b, %eax
cmpl $0x21454349, %esi       # imm = 0x21454349
je 0xd21e3
cmpl $0x21656349, %esi       # imm = 0x21656349
je 0xd21e3
movabsq $0x4d4c4946494a5546, %rcx # imm = 0x4D4C4946494A5546
xorq (%rsp), %rcx
movabsq $0x5741522d4443434d, %rdi # imm = 0x5741522D4443434D
xorq 0x7(%rsp), %rdi
movl $0x64, %eax
orq %rcx, %rdi
je 0xd2338
movdqa (%rsp), %xmm0
pcmpeqb 0x6db40(%rip), %xmm0    # 0x13fe30
pmovmskb %xmm0, %ecx
cmpl $0xffff, %ecx           # imm = 0xFFFF
je 0xd2344
cmpl $0x21706f54, %esi       # imm = 0x21706F54
jne 0xd2350
leaq 0x6dd4e(%rip), %rcx     # 0x140059
movl $0x9, %eax
jmp 0xd21e3
movzbl 0x7(%rsp), %eax
leaq 0x6dcbe(%rip), %rcx     # 0x13ffdf
cmpl $0x21, %eax
je 0xd21de
cmpl $0x3f, %eax
je 0xd21de
jmp 0xd2298
leaq 0x6dcdf(%rip), %rcx     # 0x14001e
jmp 0xd21e3
leaq 0x6dcf8(%rip), %rcx     # 0x140043
jmp 0xd21e3
movl $0x5043, %eax           # imm = 0x5043
xorl (%rsp), %eax
movzbl 0x2(%rsp), %ecx
xorl $0x54, %ecx
orw %ax, %cx
jne 0xd2388
addb $-0x37, %dl
cmpb $0x2, %dl
ja 0xd2388
cmpl $0x454c4946, 0x4(%rsp)  # imm = 0x454C4946
jne 0xd2388
leaq 0x6dcf1(%rip), %rcx     # 0x14006f
movl $0x5b, %eax
jmp 0xd21e3
movdqa (%rsp), %xmm0
movd 0x10(%rsp), %xmm1
pcmpeqb 0x6daa5(%rip), %xmm1    # 0x13fe40
pcmpeqb 0x6daad(%rip), %xmm0    # 0x13fe50
pand %xmm1, %xmm0
pmovmskb %xmm0, %eax
cmpl $0xffff, %eax           # imm = 0xFFFF
je 0xd2436
movabsq $0x505954434f44213c, %rax # imm = 0x505954434F44213C
xorq (%rsp), %rax
movabsq $0x6c6d746820455059, %rdx # imm = 0x6C6D746820455059
xorq 0x6(%rsp), %rdx
leaq 0x6dce3(%rip), %rcx     # 0x1400bd
orq %rax, %rdx
je 0xd21f8
movdqa (%rsp), %xmm0
movzbl 0x10(%rsp), %eax
movd %eax, %xmm1
pcmpeqb 0x6da67(%rip), %xmm0    # 0x13fe60
pcmpeqb 0x6da6f(%rip), %xmm1    # 0x13fe70
pand %xmm0, %xmm1
pmovmskb %xmm1, %eax
cmpl $0xffff, %eax           # imm = 0xFFFF
je 0xd21f8
movl $0x6d74683c, %eax       # imm = 0x6D74683C
xorl (%rsp), %eax
movzbl 0x4(%rsp), %edx
xorl $0x6c, %edx
orl %eax, %edx
movl $0x14, %eax
jne 0xd21e9
jmp 0xd21e3
leaq 0x6dc4c(%rip), %rcx     # 0x140089
jmp 0xd21de
nop