// File: /workspace/github_c_makefile_star2_O3/jsummers[P]deark/modules/iso9660.c
// Function: cdraw_detect_params
static void cdraw_detect_params(dbuf *f, struct cdraw_params *cdrp)
{
	if(cdsig_at2(f, 2336*16+8, 2336*17+8)) {
		cdrp->ok = 1;
		cdrp->sector_total_len = 2336;
		cdrp->sector_data_offset = 8;
		cdrp->ext = "iso";
		return;
	}
	if(cdsig_at2(f, 2352*16+16, 2352*17+16)) {
		cdrp->ok = 1;
		cdrp->sector_total_len = 2352;
		cdrp->sector_data_offset = 16;
		cdrp->ext = "iso";
		return;
	}
	if(cdsig_at2(f, 2352*16+24, 2352*17+24)) {
		cdrp->ok = 1;
		cdrp->sector_total_len = 2352;
		cdrp->sector_data_offset = 24;
		cdrp->ext = "iso";
		return;
	}
	if(cdsig_at2(f, 2448*16+16, 2448*17+16)) {
		cdrp->ok = 1;
		cdrp->sector_total_len = 2448;
		cdrp->sector_data_offset = 16;
		cdrp->ext = "iso";
		return;
	}
	if(cdsig_at2(f, 2448*16+24, 2448*17+24)) {
		cdrp->ok = 1;
		cdrp->sector_total_len = 2448;
		cdrp->sector_data_offset = 24;
		cdrp->ext = "iso";
		return;
	}
	if(syncbytes_at(f, 0)) {
		if(syncbytes_at(f, 2352)) {
			if(!dbuf_memcmp(f, 512+16, "PM", 2)) {
				cdrp->ok = 1;
				cdrp->sector_total_len = 2352;
				cdrp->sector_data_offset = 16;
				cdrp->ext = "apm";
				return;
			}
		}
	}
	// TODO: More formats?
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rsi, %rbx
movq %rdi, %r14
movl $0x9208, %esi           # imm = 0x9208
callq 0x8de77
testl %eax, %eax
je 0x8df2b
movl $0x9b28, %esi           # imm = 0x9B28
movq %r14, %rdi
callq 0x8de77
testl %eax, %eax
je 0x8df2b
leaq 0xa0897(%rip), %rax     # 0x12e7b2
movl $0x8, %ecx
movl $0x920, %r15d           # imm = 0x920
jmp 0x8dfe9
movl $0x9310, %esi           # imm = 0x9310
movq %r14, %rdi
callq 0x8de77
testl %eax, %eax
je 0x8df5b
movl $0x9c40, %esi           # imm = 0x9C40
movq %r14, %rdi
callq 0x8de77
testl %eax, %eax
je 0x8df5b
leaq 0xa085e(%rip), %rax     # 0x12e7b2
movl $0x10, %ecx
jmp 0x8df89
movl $0x9318, %esi           # imm = 0x9318
movq %r14, %rdi
callq 0x8de77
testl %eax, %eax
je 0x8df91
movl $0x9c48, %esi           # imm = 0x9C48
movq %r14, %rdi
callq 0x8de77
testl %eax, %eax
je 0x8df91
leaq 0xa082e(%rip), %rax     # 0x12e7b2
movl $0x18, %ecx
movl $0x930, %r15d           # imm = 0x930
jmp 0x8dfe9
movl $0x9910, %esi           # imm = 0x9910
movq %r14, %rdi
callq 0x8de77
testl %eax, %eax
je 0x8dfc1
movl $0xa2a0, %esi           # imm = 0xA2A0
movq %r14, %rdi
callq 0x8de77
testl %eax, %eax
je 0x8dfc1
leaq 0xa07f8(%rip), %rax     # 0x12e7b2
movl $0x10, %ecx
jmp 0x8dfe3
movl $0x9918, %esi           # imm = 0x9918
movl $0xa2a8, %edx           # imm = 0xA2A8
movq %r14, %rdi
callq 0x8de4b
testl %eax, %eax
je 0x8e001
leaq 0xa07d4(%rip), %rax     # 0x12e7b2
movl $0x18, %ecx
movl $0x990, %r15d           # imm = 0x990
movl $0x1, (%rbx)
movq %r15, 0x8(%rbx)
movq %rcx, 0x18(%rbx)
movq %rax, 0x20(%rbx)
popq %rbx
popq %r14
popq %r15
retq
leaq 0x9fa00(%rip), %rdx     # 0x12da08
movl $0xc, %ecx
movq %r14, %rdi
xorl %esi, %esi
callq 0xefc85
testl %eax, %eax
jne 0x8dffb
leaq 0x9f9e6(%rip), %rdx     # 0x12da08
movl $0x930, %r15d           # imm = 0x930
movl $0x930, %esi            # imm = 0x930
movl $0xc, %ecx
movq %r14, %rdi
callq 0xefc85
testl %eax, %eax
jne 0x8dffb
leaq 0xa3669(%rip), %rdx     # 0x1316ae
movl $0x210, %esi            # imm = 0x210
movl $0x2, %ecx
movq %r14, %rdi
callq 0xefc85
testl %eax, %eax
jne 0x8dffb
leaq 0x86284(%rip), %rax     # 0x1142e6
movl $0x10, %ecx
jmp 0x8dfe9