	.file	"extr_opl3_lib.c_snd_opl3_detect.c"
	.intel_syntax noprefix
	.text
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"OPL3: stat1 = 0x%x\n"
.LC1:
	.string	"OPL3: stat2 = 0x%x\n"
	.text
	.p2align 4
	.type	snd_opl3_detect, @function
snd_opl3_detect:
.LFB0:
	.cfi_startproc
	endbr64
	mov	edx, DWORD PTR OPL3_TIMER1_MASK[rip]
	mov	esi, DWORD PTR OPL3_LEFT[rip]
	push	r12
	.cfi_def_cfa_offset 16
	.cfi_offset 12, -16
	or	edx, DWORD PTR OPL3_TIMER2_MASK[rip]
	or	esi, DWORD PTR OPL3_REG_TIMER_CONTROL[rip]
	push	rbp
	.cfi_def_cfa_offset 24
	.cfi_offset 6, -24
	push	rbx
	.cfi_def_cfa_offset 32
	.cfi_offset 3, -32
	mov	rbx, rdi
	call	[QWORD PTR 16[rdi]]
	mov	esi, DWORD PTR OPL3_LEFT[rip]
	mov	edx, DWORD PTR OPL3_IRQ_RESET[rip]
	mov	rdi, rbx
	or	esi, DWORD PTR OPL3_REG_TIMER_CONTROL[rip]
	call	[QWORD PTR 16[rbx]]
	mov	edi, DWORD PTR 24[rbx]
	call	inb@PLT
	mov	ebp, eax
	test	al, -32
	jne	.L10
	mov	esi, DWORD PTR OPL3_LEFT[rip]
	mov	edx, 255
	mov	rdi, rbx
	or	esi, DWORD PTR OPL3_REG_TIMER1[rip]
	call	[QWORD PTR 16[rbx]]
	mov	edx, DWORD PTR OPL3_TIMER2_MASK[rip]
	mov	esi, DWORD PTR OPL3_LEFT[rip]
	mov	rdi, rbx
	or	edx, DWORD PTR OPL3_TIMER1_START[rip]
	or	esi, DWORD PTR OPL3_REG_TIMER_CONTROL[rip]
	call	[QWORD PTR 16[rbx]]
	mov	edi, 200
	call	udelay@PLT
	mov	edi, DWORD PTR 24[rbx]
	call	inb@PLT
	mov	edx, DWORD PTR OPL3_TIMER1_MASK[rip]
	mov	esi, DWORD PTR OPL3_LEFT[rip]
	mov	rdi, rbx
	mov	r12d, eax
	or	edx, DWORD PTR OPL3_TIMER2_MASK[rip]
	or	esi, DWORD PTR OPL3_REG_TIMER_CONTROL[rip]
	call	[QWORD PTR 16[rbx]]
	mov	esi, DWORD PTR OPL3_LEFT[rip]
	mov	edx, DWORD PTR OPL3_IRQ_RESET[rip]
	mov	rdi, rbx
	or	esi, DWORD PTR OPL3_REG_TIMER_CONTROL[rip]
	call	[QWORD PTR 16[rbx]]
	mov	eax, r12d
	and	eax, -32
	cmp	al, -64
	jne	.L11
	mov	rax, QWORD PTR OPL3_HW_AUTO[rip]
	xor	r12d, r12d
	cmp	QWORD PTR [rbx], rax
	je	.L12
.L1:
	mov	eax, r12d
	pop	rbx
	.cfi_remember_state
	.cfi_def_cfa_offset 24
	pop	rbp
	.cfi_def_cfa_offset 16
	pop	r12
	.cfi_def_cfa_offset 8
	ret
	.p2align 4,,10
	.p2align 3
.L12:
	.cfi_restore_state
	cmp	bpl, 6
	jne	.L5
	mov	rax, QWORD PTR OPL3_HW_OPL2[rip]
	mov	QWORD PTR [rbx], rax
	mov	eax, r12d
	pop	rbx
	.cfi_remember_state
	.cfi_def_cfa_offset 24
	pop	rbp
	.cfi_def_cfa_offset 16
	pop	r12
	.cfi_def_cfa_offset 8
	ret
	.p2align 4,,10
	.p2align 3
.L11:
	.cfi_restore_state
	movzx	esi, r12b
	lea	rdi, .LC1[rip]
	call	snd_printd@PLT
	mov	r12d, DWORD PTR ENODEV[rip]
	pop	rbx
	.cfi_remember_state
	.cfi_def_cfa_offset 24
	pop	rbp
	.cfi_def_cfa_offset 16
	neg	r12d
	mov	eax, r12d
	pop	r12
	.cfi_def_cfa_offset 8
	ret
	.p2align 4,,10
	.p2align 3
.L10:
	.cfi_restore_state
	movzx	esi, al
	lea	rdi, .LC0[rip]
	call	snd_printd@PLT
	mov	r12d, DWORD PTR ENODEV[rip]
	pop	rbx
	.cfi_remember_state
	.cfi_def_cfa_offset 24
	pop	rbp
	.cfi_def_cfa_offset 16
	neg	r12d
	mov	eax, r12d
	pop	r12
	.cfi_def_cfa_offset 8
	ret
	.p2align 4,,10
	.p2align 3
.L5:
	.cfi_restore_state
	mov	eax, DWORD PTR 8[rbx]
	xor	edi, edi
	test	eax, eax
	sete	dil
	call	snd_BUG_ON@PLT
	test	rax, rax
	jne	.L13
	mov	rax, QWORD PTR OPL3_HW_OPL3[rip]
	mov	QWORD PTR [rbx], rax
	jmp	.L1
	.p2align 4,,10
	.p2align 3
.L13:
	mov	r12d, DWORD PTR ENODEV[rip]
	neg	r12d
	jmp	.L1
	.cfi_endproc
.LFE0:
	.size	snd_opl3_detect, .-snd_opl3_detect
	.comm	OPL3_TIMER2_MASK,4,4
	.comm	OPL3_TIMER1_START,4,4
	.comm	OPL3_TIMER1_MASK,4,4
	.comm	OPL3_REG_TIMER_CONTROL,4,4
	.comm	OPL3_REG_TIMER1,4,4
	.comm	OPL3_LEFT,4,4
	.comm	OPL3_IRQ_RESET,4,4
	.comm	OPL3_HW_OPL3,8,8
	.comm	OPL3_HW_OPL2,8,8
	.comm	OPL3_HW_AUTO,8,8
	.comm	ENODEV,4,4
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",@progbits
	.section	.note.gnu.property,"a"
	.align 8
	.long	 1f - 0f
	.long	 4f - 1f
	.long	 5
0:
	.string	 "GNU"
1:
	.align 8
	.long	 0xc0000002
	.long	 3f - 2f
2:
	.long	 0x3
3:
	.align 8
4:

	.arch armv5t
	.eabi_attribute 20, 1
	.eabi_attribute 21, 1
	.eabi_attribute 23, 3
	.eabi_attribute 24, 1
	.eabi_attribute 25, 1
	.eabi_attribute 26, 2
	.eabi_attribute 30, 2
	.eabi_attribute 34, 0
	.eabi_attribute 18, 4
	.file	"extr_opl3_lib.c_snd_opl3_detect.c"
	.text
	.section	.rodata.str1.4,"aMS",%progbits,1
	.align	2
.LC0:
	.ascii	"OPL3: stat1 = 0x%x\012\000"
	.align	2
.LC1:
	.ascii	"OPL3: stat2 = 0x%x\012\000"
	.text
	.align	2
	.syntax unified
	.arm
	.fpu softvfp
	.type	snd_opl3_detect, %function
snd_opl3_detect:
	@ args = 0, pretend = 0, frame = 8
	@ frame_needed = 0, uses_anonymous_args = 0
	push	{r4, r5, r6, r7, r8, r9, r10, fp, lr}
	mov	r4, r0
	ldr	r5, .L13
	ldr	r7, .L13+4
	ldr	fp, .L13+8
	ldr	r9, .L13+12
	ldr	lr, [fp]
	ldr	ip, [r5]
	ldr	r2, [r9]
	ldr	r1, [r7]
	sub	sp, sp, #12
	orr	r2, lr, r2
	orr	r1, ip, r1
	ldr	r3, [r0, #8]
	blx	r3
	ldr	r10, .L13+16
	ldr	r2, [r7]
	ldr	r1, [r5]
	ldr	r3, [r4, #8]
	orr	r1, r1, r2
	mov	r0, r4
	ldr	r2, [r10]
	blx	r3
	ldr	r0, [r4, #12]
	bl	inb
	ands	r3, r0, #224
	mov	r6, r0
	str	r3, [sp, #4]
	bne	.L10
	ldr	r3, .L13+20
	ldr	r1, [r5]
	ldr	r2, [r3]
	mov	r0, r4
	orr	r1, r1, r2
	ldr	r3, [r4, #8]
	mov	r2, #255
	blx	r3
	ldr	r3, .L13+24
	ldr	r0, [r9]
	ldr	r2, [r3]
	ldr	r1, [r5]
	ldr	r3, [r7]
	orr	r2, r0, r2
	orr	r1, r1, r3
	mov	r0, r4
	ldr	r3, [r4, #8]
	blx	r3
	mov	r0, #200
	bl	udelay
	ldr	r0, [r4, #12]
	bl	inb
	mov	r8, r0
	ldr	ip, [fp]
	ldr	r0, [r5]
	ldr	r2, [r9]
	ldr	r1, [r7]
	orr	r2, ip, r2
	orr	r1, r0, r1
	ldr	r9, [r4, #8]
	mov	r0, r4
	blx	r9
	ldr	r0, [r5]
	ldr	r1, [r7]
	ldr	r2, [r10]
	orr	r1, r0, r1
	ldr	r5, [r4, #8]
	mov	r0, r4
	blx	r5
	and	r2, r8, #224
	cmp	r2, #192
	bne	.L11
	ldr	r3, .L13+28
	ldr	r2, [r4]
	ldr	r3, [r3]
	cmp	r2, r3
	beq	.L12
	ldr	r0, [sp, #4]
	add	sp, sp, #12
	@ sp needed
	pop	{r4, r5, r6, r7, r8, r9, r10, fp, pc}
.L12:
	cmp	r6, #6
	bne	.L5
	ldr	r3, .L13+32
	ldr	r0, [sp, #4]
	ldr	r3, [r3]
	str	r3, [r4]
	add	sp, sp, #12
	@ sp needed
	pop	{r4, r5, r6, r7, r8, r9, r10, fp, pc}
.L11:
	mov	r1, r8
	ldr	r0, .L13+36
	bl	snd_printd
	ldr	r3, .L13+40
	ldr	r0, [r3]
	rsb	r0, r0, #0
	add	sp, sp, #12
	@ sp needed
	pop	{r4, r5, r6, r7, r8, r9, r10, fp, pc}
.L10:
	mov	r1, r0
	ldr	r0, .L13+44
	bl	snd_printd
	ldr	r3, .L13+40
	ldr	r0, [r3]
	rsb	r0, r0, #0
	add	sp, sp, #12
	@ sp needed
	pop	{r4, r5, r6, r7, r8, r9, r10, fp, pc}
.L5:
	ldr	r0, [r4, #4]
	clz	r0, r0
	lsr	r0, r0, #5
	bl	snd_BUG_ON
	cmp	r0, #0
	ldrne	r3, .L13+40
	ldreq	r3, .L13+48
	ldrne	r0, [r3]
	ldreq	r3, [r3]
	rsbne	r0, r0, #0
	streq	r3, [r4]
	add	sp, sp, #12
	@ sp needed
	pop	{r4, r5, r6, r7, r8, r9, r10, fp, pc}
.L14:
	.align	2
.L13:
	.word	OPL3_LEFT
	.word	OPL3_REG_TIMER_CONTROL
	.word	OPL3_TIMER1_MASK
	.word	OPL3_TIMER2_MASK
	.word	OPL3_IRQ_RESET
	.word	OPL3_REG_TIMER1
	.word	OPL3_TIMER1_START
	.word	OPL3_HW_AUTO
	.word	OPL3_HW_OPL2
	.word	.LC1
	.word	ENODEV
	.word	.LC0
	.word	OPL3_HW_OPL3
	.size	snd_opl3_detect, .-snd_opl3_detect
	.comm	OPL3_TIMER2_MASK,4,4
	.comm	OPL3_TIMER1_START,4,4
	.comm	OPL3_TIMER1_MASK,4,4
	.comm	OPL3_REG_TIMER_CONTROL,4,4
	.comm	OPL3_REG_TIMER1,4,4
	.comm	OPL3_LEFT,4,4
	.comm	OPL3_IRQ_RESET,4,4
	.comm	OPL3_HW_OPL3,4,4
	.comm	OPL3_HW_OPL2,4,4
	.comm	OPL3_HW_AUTO,4,4
	.comm	ENODEV,4,4
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
