// File: /workspace/github_c_makefile_star2_O1/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 0x8e774
testl %eax, %eax
je 0x8e828
movl $0x9b28, %esi           # imm = 0x9B28
movq %r14, %rdi
callq 0x8e774
testl %eax, %eax
je 0x8e828
leaq 0x9fca2(%rip), %rax     # 0x12e4ba
movl $0x8, %ecx
movl $0x920, %r15d           # imm = 0x920
jmp 0x8e8e6
movl $0x9310, %esi           # imm = 0x9310
movq %r14, %rdi
callq 0x8e774
testl %eax, %eax
je 0x8e858
movl $0x9c40, %esi           # imm = 0x9C40
movq %r14, %rdi
callq 0x8e774
testl %eax, %eax
je 0x8e858
leaq 0x9fc69(%rip), %rax     # 0x12e4ba
movl $0x10, %ecx
jmp 0x8e886
movl $0x9318, %esi           # imm = 0x9318
movq %r14, %rdi
callq 0x8e774
testl %eax, %eax
je 0x8e88e
movl $0x9c48, %esi           # imm = 0x9C48
movq %r14, %rdi
callq 0x8e774
testl %eax, %eax
je 0x8e88e
leaq 0x9fc39(%rip), %rax     # 0x12e4ba
movl $0x18, %ecx
movl $0x930, %r15d           # imm = 0x930
jmp 0x8e8e6
movl $0x9910, %esi           # imm = 0x9910
movq %r14, %rdi
callq 0x8e774
testl %eax, %eax
je 0x8e8be
movl $0xa2a0, %esi           # imm = 0xA2A0
movq %r14, %rdi
callq 0x8e774
testl %eax, %eax
je 0x8e8be
leaq 0x9fc03(%rip), %rax     # 0x12e4ba
movl $0x10, %ecx
jmp 0x8e8e0
movl $0x9918, %esi           # imm = 0x9918
movl $0xa2a8, %edx           # imm = 0xA2A8
movq %r14, %rdi
callq 0x8e748
testl %eax, %eax
je 0x8e8fe
leaq 0x9fbdf(%rip), %rax     # 0x12e4ba
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 0x9ee1b(%rip), %rdx     # 0x12d720
movl $0xc, %ecx
movq %r14, %rdi
xorl %esi, %esi
callq 0xf025e
testl %eax, %eax
jne 0x8e8f8
leaq 0x9ee01(%rip), %rdx     # 0x12d720
movl $0x930, %r15d           # imm = 0x930
movl $0x930, %esi            # imm = 0x930
movl $0xc, %ecx
movq %r14, %rdi
callq 0xf025e
testl %eax, %eax
jne 0x8e8f8
leaq 0xa2a0f(%rip), %rdx     # 0x131351
movl $0x210, %esi            # imm = 0x210
movl $0x2, %ecx
movq %r14, %rdi
callq 0xf025e
testl %eax, %eax
jne 0x8e8f8
leaq 0x858d7(%rip), %rax     # 0x114236
movl $0x10, %ecx
jmp 0x8e8e6