// File: /workspace/github_c_makefile_star2_O2/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 %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
movq %rsi, %rbx
pxor %xmm0, %xmm0
movdqu %xmm0, (%rsi)
movq 0x18(%rdi), %rdi
movq %rsp, %r14
pushq $0x20
popq %rcx
movq %r14, %rsi
xorl %edx, %edx
callq 0xe3cb7
leaq 0x6a650(%rip), %rsi     # 0x132f86
pushq $0x3
popq %rdx
movq %r14, %rdi
callq 0x18230
pushq $0x5a
popq %rbp
testl %eax, %eax
jne 0xc8964
leaq 0x4(%rsp), %rdi
leaq 0x6a636(%rip), %rsi     # 0x132f8a
pushq $0x6
popq %rdx
callq 0x18230
testl %eax, %eax
je 0xc89ec
leaq 0x6a63e(%rip), %rsi     # 0x132fa9
movq %rsp, %rdi
pushq $0x6
popq %rdx
callq 0x18230
testl %eax, %eax
je 0xc89aa
leaq 0x6a7d9(%rip), %rsi     # 0x13315a
movq %rsp, %rdi
pushq $0x6
popq %rdx
callq 0x18230
testl %eax, %eax
je 0xc89b3
movl (%rsp), %r13d
cmpl $0x50495a4c, %r13d      # imm = 0x50495A4C
jne 0xc89bc
leaq 0x6a62c(%rip), %r12     # 0x132fd0
pushq $0x32
popq %r15
jmp 0xc89f6
leaq 0x6a5ff(%rip), %r12     # 0x132fb0
jmp 0xc89f3
leaq 0x6a600(%rip), %r12     # 0x132fba
jmp 0xc89f3
leaq 0x6a625(%rip), %rsi     # 0x132fe8
movq %rsp, %rdi
pushq $0x9
popq %rdx
callq 0x18230
pushq $0x14
popq %r15
testl %eax, %eax
je 0xc8a0c
pushq $0x28
popq %r15
cmpl $0x28635349, %r13d      # imm = 0x28635349
jne 0xc8a15
leaq 0x6a614(%rip), %r12     # 0x132ffe
jmp 0xc89f6
leaq 0x6a59e(%rip), %r12     # 0x132f91
movl %ebp, %r15d
movl %r15d, (%rbx)
movq %r12, 0x8(%rbx)
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x6a5df(%rip), %r12     # 0x132ff2
jmp 0xc89f6
movl %r13d, %r14d
shrl $0x18, %r14d
movl %r13d, %eax
andl $0xffffff, %eax         # imm = 0xFFFFFF
cmpl $0x485048, %eax         # imm = 0x485048
jne 0xc8a4b
cmpl $0x50, %r14d
jne 0xc8a4b
cmpb $0x34, 0x4(%rsp)
jne 0xc8a4b
movb 0x5(%rsp), %al
andb $-0x2, %al
cmpb $0x38, %al
jne 0xc8a4b
leaq 0x6a5cf(%rip), %r12     # 0x133018
jmp 0xc89f3
leaq 0x6a5df(%rip), %rsi     # 0x133031
movq %rsp, %rdi
pushq $0x5
popq %rdx
callq 0x18230
testl %eax, %eax
je 0xc8a7f
cmpl $0x464c457f, %r13d      # imm = 0x464C457F
je 0xc8a8b
cmpl $0x435057ff, %r13d      # imm = 0x435057FF
jne 0xc8a97
leaq 0x6a5d6(%rip), %r12     # 0x133050
jmp 0xc89f6
leaq 0x6a5b1(%rip), %r12     # 0x133037
jmp 0xc89f3
leaq 0x6a5b0(%rip), %r12     # 0x133042
jmp 0xc89f6
leaq 0x6a5c9(%rip), %rsi     # 0x133067
movq %rsp, %rdi
pushq $0x7
popq %rdx
callq 0x18230
testl %eax, %eax
je 0xc8b1b
leaq 0x6a5cf(%rip), %r12     # 0x133083
pushq $0x4b
popq %r15
cmpl $0x21454349, %r13d      # imm = 0x21454349
je 0xc89f6
cmpl $0x21656349, %r13d      # imm = 0x21656349
je 0xc89f6
leaq 0x6a5c5(%rip), %rsi     # 0x13309e
movq %rsp, %rdi
pushq $0xf
popq %rdx
callq 0x18230
pushq $0x64
popq %r15
testl %eax, %eax
je 0xc8b3e
movdqa (%rsp), %xmm0
pcmpeqb 0x6a407(%rip), %xmm0    # 0x132f00
pmovmskb %xmm0, %eax
cmpl $0xffff, %eax           # imm = 0xFFFF
je 0xc8b4a
cmpl $0x21706f54, %r13d      # imm = 0x21706F54
jne 0xc8b56
leaq 0x6a5d5(%rip), %r12     # 0x1330e9
pushq $0x9
jmp 0xc89a6
movzbl 0x7(%rsp), %eax
leaq 0x6a548(%rip), %r12     # 0x13306f
cmpl $0x21, %eax
je 0xc89f3
cmpl $0x3f, %eax
je 0xc89f3
jmp 0xc8aad
leaq 0x6a569(%rip), %r12     # 0x1330ae
jmp 0xc89f6
leaq 0x6a582(%rip), %r12     # 0x1330d3
jmp 0xc89f6
leaq 0x6a59e(%rip), %rsi     # 0x1330fb
movq %rsp, %rdi
pushq $0x3
popq %rdx
callq 0x18230
testl %eax, %eax
jne 0xc8b8e
addb $-0x37, %r14b
cmpb $0x2, %r14b
ja 0xc8b8e
cmpl $0x454c4946, 0x4(%rsp)  # imm = 0x454C4946
jne 0xc8b8e
leaq 0x6a578(%rip), %r12     # 0x1330ff
pushq $0x5b
jmp 0xc89a6
leaq 0x4d23a(%rip), %rsi     # 0x115dcf
movq %rsp, %rdi
pushq $0x14
popq %rdx
callq 0x18230
testl %eax, %eax
je 0xc8c01
leaq 0x6a58d(%rip), %rsi     # 0x133138
movq %rsp, %rdi
pushq $0xe
popq %rdx
callq 0x18230
leaq 0x6a590(%rip), %r12     # 0x13314d
testl %eax, %eax
je 0xc8bfa
leaq 0x6a56d(%rip), %rsi     # 0x133135
movq %rsp, %rdi
pushq $0x11
popq %rdx
callq 0x18230
testl %eax, %eax
je 0xc8bfa
leaq 0x6a569(%rip), %rsi     # 0x133147
movq %rsp, %rdi
pushq $0x5
popq %rdx
callq 0x18230
pushq $0x14
popq %r15
testl %eax, %eax
jne 0xc89fd
jmp 0xc89f6
pushq $0x14
jmp 0xc89a6
leaq 0x6a511(%rip), %r12     # 0x133119
jmp 0xc89f3
nopl (%rax)