	.file	"extr_aic79xx_core.c_ahd_iocell_first_selection.c"
	.intel_syntax noprefix
	.text
	.p2align 4
	.type	ahd_iocell_first_selection, @function
ahd_iocell_first_selection:
.LFB0:
	.cfi_startproc
	endbr64
	mov	eax, DWORD PTR [rdi]
	test	DWORD PTR AHD_HAD_FIRST_SEL[rip], eax
	je	.L12
	ret
	.p2align 4,,10
	.p2align 3
.L12:
	push	r12
	.cfi_def_cfa_offset 16
	.cfi_offset 12, -16
	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	ahd_save_modes@PLT
	mov	esi, DWORD PTR AHD_MODE_SCSI[rip]
	mov	rdi, rbx
	mov	ebp, eax
	mov	edx, esi
	call	ahd_set_modes@PLT
	mov	esi, DWORD PTR SBLKCTL[rip]
	mov	rdi, rbx
	call	ahd_inb@PLT
	mov	esi, DWORD PTR AHD_MODE_CFG[rip]
	mov	rdi, rbx
	mov	r12d, eax
	mov	edx, esi
	call	ahd_set_modes@PLT
	test	DWORD PTR ENAB40[rip], r12d
	jne	.L13
.L3:
	mov	esi, DWORD PTR SIMODE0[rip]
	mov	rdi, rbx
	call	ahd_inb@PLT
	mov	edx, DWORD PTR ENSELDO[rip]
	or	edx, DWORD PTR ENSELDI[rip]
	mov	rdi, rbx
	mov	esi, DWORD PTR SIMODE0[rip]
	not	edx
	and	edx, eax
	call	ahd_outb@PLT
	mov	edx, DWORD PTR CLRSCSIINT[rip]
	mov	esi, DWORD PTR CLRINT[rip]
	mov	rdi, rbx
	call	ahd_outb@PLT
	mov	esi, ebp
	mov	rdi, rbx
	call	ahd_restore_modes@PLT
	mov	eax, DWORD PTR AHD_HAD_FIRST_SEL[rip]
	or	DWORD PTR [rbx], eax
	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
.L13:
	.cfi_restore_state
	mov	esi, DWORD PTR DSPDATACTL[rip]
	mov	rdi, rbx
	call	ahd_inb@PLT
	mov	edx, DWORD PTR BYPASSENAB[rip]
	mov	esi, DWORD PTR DSPDATACTL[rip]
	mov	rdi, rbx
	not	edx
	and	edx, eax
	call	ahd_outb@PLT
	jmp	.L3
	.cfi_endproc
.LFE0:
	.size	ahd_iocell_first_selection, .-ahd_iocell_first_selection
	.comm	ahd_debug,4,4
	.comm	SIMODE0,4,4
	.comm	SBLKCTL,4,4
	.comm	ENSELDO,4,4
	.comm	ENSELDI,4,4
	.comm	ENAB40,4,4
	.comm	DSPDATACTL,4,4
	.comm	CLRSCSIINT,4,4
	.comm	CLRINT,4,4
	.comm	BYPASSENAB,4,4
	.comm	AHD_SHOW_MISC,4,4
	.comm	AHD_MODE_SCSI,4,4
	.comm	AHD_MODE_CFG,4,4
	.comm	AHD_HAD_FIRST_SEL,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_aic79xx_core.c_ahd_iocell_first_selection.c"
	.text
	.align	2
	.syntax unified
	.arm
	.fpu softvfp
	.type	ahd_iocell_first_selection, %function
ahd_iocell_first_selection:
	@ args = 0, pretend = 0, frame = 0
	@ frame_needed = 0, uses_anonymous_args = 0
	push	{r4, r5, r6, r7, r8, lr}
	ldr	r5, .L10
	ldr	r2, [r0]
	ldr	r3, [r5]
	tst	r2, r3
	popne	{r4, r5, r6, r7, r8, pc}
	mov	r4, r0
	bl	ahd_save_modes
	ldr	r3, .L10+4
	mov	r6, r0
	ldr	r2, [r3]
	mov	r0, r4
	mov	r1, r2
	bl	ahd_set_modes
	ldr	r3, .L10+8
	mov	r0, r4
	ldr	r1, [r3]
	bl	ahd_inb
	mov	r7, r0
	ldr	r3, .L10+12
	mov	r0, r4
	ldr	r2, [r3]
	mov	r1, r2
	bl	ahd_set_modes
	ldr	r3, .L10+16
	ldr	r3, [r3]
	tst	r7, r3
	bne	.L9
.L3:
	ldr	r3, .L10+20
	mov	r0, r4
	ldr	r7, [r3]
	mov	r1, r7
	bl	ahd_inb
	ldr	r3, .L10+24
	ldr	r2, .L10+28
	ldr	r3, [r3]
	ldr	r2, [r2]
	mov	r1, r7
	orr	r2, r3, r2
	bic	r2, r0, r2
	mov	r0, r4
	bl	ahd_outb
	ldr	r3, .L10+32
	ldr	r2, .L10+36
	ldr	r1, [r3]
	ldr	r2, [r2]
	mov	r0, r4
	bl	ahd_outb
	mov	r1, r6
	mov	r0, r4
	bl	ahd_restore_modes
	ldr	r2, [r5]
	ldr	r3, [r4]
	orr	r3, r3, r2
	str	r3, [r4]
	pop	{r4, r5, r6, r7, r8, pc}
.L9:
	ldr	r3, .L10+40
	mov	r0, r4
	ldr	r7, [r3]
	mov	r1, r7
	bl	ahd_inb
	mov	r3, r0
	ldr	r2, .L10+44
	mov	r1, r7
	ldr	r2, [r2]
	mov	r0, r4
	bic	r2, r3, r2
	bl	ahd_outb
	b	.L3
.L11:
	.align	2
.L10:
	.word	AHD_HAD_FIRST_SEL
	.word	AHD_MODE_SCSI
	.word	SBLKCTL
	.word	AHD_MODE_CFG
	.word	ENAB40
	.word	SIMODE0
	.word	ENSELDO
	.word	ENSELDI
	.word	CLRINT
	.word	CLRSCSIINT
	.word	DSPDATACTL
	.word	BYPASSENAB
	.size	ahd_iocell_first_selection, .-ahd_iocell_first_selection
	.comm	ahd_debug,4,4
	.comm	SIMODE0,4,4
	.comm	SBLKCTL,4,4
	.comm	ENSELDO,4,4
	.comm	ENSELDI,4,4
	.comm	ENAB40,4,4
	.comm	DSPDATACTL,4,4
	.comm	CLRSCSIINT,4,4
	.comm	CLRINT,4,4
	.comm	BYPASSENAB,4,4
	.comm	AHD_SHOW_MISC,4,4
	.comm	AHD_MODE_SCSI,4,4
	.comm	AHD_MODE_CFG,4,4
	.comm	AHD_HAD_FIRST_SEL,4,4
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
