// File: /workspace/github_c_makefile_star2_O0/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 %rbp
movq %rsp, %rbp
subq $0x10, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq -0x8(%rbp), %rdi
movl $0x9208, %esi           # imm = 0x9208
movl $0x9b28, %edx           # imm = 0x9B28
callq 0xd04e0
cmpl $0x0, %eax
je 0xd06ce
movq -0x10(%rbp), %rax
movl $0x1, (%rax)
movq -0x10(%rbp), %rax
movq $0x920, 0x8(%rax)       # imm = 0x920
movq -0x10(%rbp), %rax
movq $0x8, 0x18(%rax)
movq -0x10(%rbp), %rax
leaq 0xe9c0b(%rip), %rcx     # 0x1ba2d0
movq %rcx, 0x20(%rax)
jmp 0xd087e
movq -0x8(%rbp), %rdi
movl $0x9310, %esi           # imm = 0x9310
movl $0x9c40, %edx           # imm = 0x9C40
callq 0xd04e0
cmpl $0x0, %eax
je 0xd071c
movq -0x10(%rbp), %rax
movl $0x1, (%rax)
movq -0x10(%rbp), %rax
movq $0x930, 0x8(%rax)       # imm = 0x930
movq -0x10(%rbp), %rax
movq $0x10, 0x18(%rax)
movq -0x10(%rbp), %rax
leaq 0xe9bbd(%rip), %rcx     # 0x1ba2d0
movq %rcx, 0x20(%rax)
jmp 0xd087e
movq -0x8(%rbp), %rdi
movl $0x9318, %esi           # imm = 0x9318
movl $0x9c48, %edx           # imm = 0x9C48
callq 0xd04e0
cmpl $0x0, %eax
je 0xd076a
movq -0x10(%rbp), %rax
movl $0x1, (%rax)
movq -0x10(%rbp), %rax
movq $0x930, 0x8(%rax)       # imm = 0x930
movq -0x10(%rbp), %rax
movq $0x18, 0x18(%rax)
movq -0x10(%rbp), %rax
leaq 0xe9b6f(%rip), %rcx     # 0x1ba2d0
movq %rcx, 0x20(%rax)
jmp 0xd087e
movq -0x8(%rbp), %rdi
movl $0x9910, %esi           # imm = 0x9910
movl $0xa2a0, %edx           # imm = 0xA2A0
callq 0xd04e0
cmpl $0x0, %eax
je 0xd07b8
movq -0x10(%rbp), %rax
movl $0x1, (%rax)
movq -0x10(%rbp), %rax
movq $0x990, 0x8(%rax)       # imm = 0x990
movq -0x10(%rbp), %rax
movq $0x10, 0x18(%rax)
movq -0x10(%rbp), %rax
leaq 0xe9b21(%rip), %rcx     # 0x1ba2d0
movq %rcx, 0x20(%rax)
jmp 0xd087e
movq -0x8(%rbp), %rdi
movl $0x9918, %esi           # imm = 0x9918
movl $0xa2a8, %edx           # imm = 0xA2A8
callq 0xd04e0
cmpl $0x0, %eax
je 0xd0803
movq -0x10(%rbp), %rax
movl $0x1, (%rax)
movq -0x10(%rbp), %rax
movq $0x990, 0x8(%rax)       # imm = 0x990
movq -0x10(%rbp), %rax
movq $0x18, 0x18(%rax)
movq -0x10(%rbp), %rax
leaq 0xe9ad3(%rip), %rcx     # 0x1ba2d0
movq %rcx, 0x20(%rax)
jmp 0xd087e
movq -0x8(%rbp), %rdi
xorl %eax, %eax
movl %eax, %esi
callq 0xd0960
cmpl $0x0, %eax
je 0xd087e
movq -0x8(%rbp), %rdi
movl $0x930, %esi            # imm = 0x930
callq 0xd0960
cmpl $0x0, %eax
je 0xd087c
movq -0x8(%rbp), %rdi
movl $0x210, %esi            # imm = 0x210
leaq 0xec8a8(%rip), %rdx     # 0x1bd0e0
movl $0x2, %ecx
callq 0x166ab0
cmpl $0x0, %eax
jne 0xd087a
movq -0x10(%rbp), %rax
movl $0x1, (%rax)
movq -0x10(%rbp), %rax
movq $0x930, 0x8(%rax)       # imm = 0x930
movq -0x10(%rbp), %rax
movq $0x10, 0x18(%rax)
movq -0x10(%rbp), %rax
leaq 0xcf857(%rip), %rcx     # 0x1a00cb
movq %rcx, 0x20(%rax)
jmp 0xd087e
jmp 0xd087c
jmp 0xd087e
addq $0x10, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)