	.file	"extr_pata_hpt37x.c_hpt37x_bmdma_stop.c"
	.intel_syntax noprefix
	.text
	.p2align 4
	.type	hpt37x_bmdma_stop, @function
hpt37x_bmdma_stop:
.LFB0:
	.cfi_startproc
	endbr64
	push	r13
	.cfi_def_cfa_offset 16
	.cfi_offset 13, -16
	push	r12
	.cfi_def_cfa_offset 24
	.cfi_offset 12, -24
	mov	r12, rdi
	push	rbp
	.cfi_def_cfa_offset 32
	.cfi_offset 6, -32
	push	rbx
	.cfi_def_cfa_offset 40
	.cfi_offset 3, -40
	sub	rsp, 24
	.cfi_def_cfa_offset 64
	mov	rbx, QWORD PTR [rdi]
	mov	rax, QWORD PTR fs:40
	mov	QWORD PTR 8[rsp], rax
	xor	eax, eax
	mov	rax, QWORD PTR 8[rbx]
	mov	edi, DWORD PTR [rax]
	call	to_pci_dev@PLT
	mov	rdx, rsp
	mov	esi, 106
	mov	rbp, rax
	mov	eax, DWORD PTR [rbx]
	mov	rdi, rbp
	lea	r13d, 80[0+rax*4]
	call	pci_read_config_byte@PLT
	lea	rdx, 4[rsp]
	mov	esi, r13d
	mov	rdi, rbp
	call	pci_read_config_byte@PLT
	mov	eax, DWORD PTR [rbx]
	mov	ecx, DWORD PTR [rsp]
	bt	ecx, eax
	jc	.L9
.L2:
	mov	rdi, r12
	call	ata_bmdma_stop@PLT
	mov	rax, QWORD PTR 8[rsp]
	xor	rax, QWORD PTR fs:40
	jne	.L10
	add	rsp, 24
	.cfi_remember_state
	.cfi_def_cfa_offset 40
	pop	rbx
	.cfi_def_cfa_offset 32
	pop	rbp
	.cfi_def_cfa_offset 24
	pop	r12
	.cfi_def_cfa_offset 16
	pop	r13
	.cfi_def_cfa_offset 8
	ret
	.p2align 4,,10
	.p2align 3
.L9:
	.cfi_restore_state
	mov	edx, DWORD PTR 4[rsp]
	mov	esi, r13d
	mov	rdi, rbp
	or	edx, 48
	call	pci_write_config_byte@PLT
	jmp	.L2
.L10:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE0:
	.size	hpt37x_bmdma_stop, .-hpt37x_bmdma_stop
	.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_pata_hpt37x.c_hpt37x_bmdma_stop.c"
	.text
	.section	.rodata.cst4,"aM",%progbits,4
	.align	2
.LC0:
	.word	__stack_chk_guard
	.text
	.align	2
	.syntax unified
	.arm
	.fpu softvfp
	.type	hpt37x_bmdma_stop, %function
hpt37x_bmdma_stop:
	@ args = 0, pretend = 0, frame = 16
	@ frame_needed = 0, uses_anonymous_args = 0
	push	{r4, r5, r6, r7, lr}
	ldr	r3, .L11
	ldr	r7, [r0]
	sub	sp, sp, #20
	ldr	r3, [r3]
	str	r3, [sp, #12]
	mov	r3,#0
	ldr	r3, [r7, #4]
	mov	r5, r0
	ldr	r0, [r3]
	bl	to_pci_dev
	mov	r6, r0
	ldr	r4, [r7]
	mov	r1, #106
	add	r4, r4, #20
	add	r2, sp, #4
	lsl	r4, r4, #2
	bl	pci_read_config_byte
	add	r2, sp, #8
	mov	r1, r4
	mov	r0, r6
	bl	pci_read_config_byte
	ldr	r2, [r7]
	ldr	r3, [sp, #4]
	asr	r3, r3, r2
	tst	r3, #1
	bne	.L9
.L2:
	mov	r0, r5
	bl	ata_bmdma_stop
	ldr	r3, .L11
	ldr	r2, [r3]
	ldr	r3, [sp, #12]
	eors	r2, r3, r2
	mov	r3, #0
	bne	.L10
	add	sp, sp, #20
	@ sp needed
	pop	{r4, r5, r6, r7, pc}
.L9:
	ldr	r2, [sp, #8]
	mov	r1, r4
	mov	r0, r6
	orr	r2, r2, #48
	bl	pci_write_config_byte
	b	.L2
.L10:
	bl	__stack_chk_fail
.L12:
	.align	2
.L11:
	.word	.LC0
	.size	hpt37x_bmdma_stop, .-hpt37x_bmdma_stop
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
