	.file	"extr_ntb_hw_plx.c_ntb_plx_detach.c"
	.intel_syntax noprefix
	.text
	.p2align 4
	.type	ntb_plx_detach, @function
ntb_plx_detach:
.LFB0:
	.cfi_startproc
	endbr64
	push	r12
	.cfi_def_cfa_offset 16
	.cfi_offset 12, -16
	mov	r12d, edi
	push	rbp
	.cfi_def_cfa_offset 24
	.cfi_offset 6, -24
	push	rbx
	.cfi_def_cfa_offset 32
	.cfi_offset 3, -32
	call	device_get_softc@PLT
	mov	edi, r12d
	mov	rbp, rax
	call	ntb_unregister_device@PLT
	mov	edi, r12d
	call	ntb_plx_teardown_intr@PLT
	mov	eax, DWORD PTR 0[rbp]
	test	eax, eax
	jle	.L2
	xor	ebx, ebx
	.p2align 4,,10
	.p2align 3
.L3:
	mov	rax, QWORD PTR 16[rbp]
	mov	esi, DWORD PTR SYS_RES_MEMORY[rip]
	mov	edi, r12d
	lea	rax, [rax+rbx*8]
	add	rbx, 1
	mov	edx, DWORD PTR 4[rax]
	mov	ecx, DWORD PTR [rax]
	call	bus_release_resource@PLT
	cmp	DWORD PTR 0[rbp], ebx
	jg	.L3
.L2:
	mov	ecx, DWORD PTR 4[rbp]
	mov	edx, DWORD PTR 8[rbp]
	mov	edi, r12d
	mov	esi, DWORD PTR SYS_RES_MEMORY[rip]
	call	bus_release_resource@PLT
	pop	rbx
	.cfi_def_cfa_offset 24
	xor	eax, eax
	pop	rbp
	.cfi_def_cfa_offset 16
	pop	r12
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE0:
	.size	ntb_plx_detach, .-ntb_plx_detach
	.comm	SYS_RES_MEMORY,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_ntb_hw_plx.c_ntb_plx_detach.c"
	.text
	.align	2
	.syntax unified
	.arm
	.fpu softvfp
	.type	ntb_plx_detach, %function
ntb_plx_detach:
	@ args = 0, pretend = 0, frame = 0
	@ frame_needed = 0, uses_anonymous_args = 0
	push	{r4, r5, r6, r7, r8, lr}
	mov	r6, r0
	bl	device_get_softc
	mov	r5, r0
	mov	r0, r6
	bl	ntb_unregister_device
	mov	r0, r6
	bl	ntb_plx_teardown_intr
	ldr	r3, [r5]
	cmp	r3, #0
	ldrle	r7, .L9
	ble	.L2
	mov	r4, #0
	ldr	r7, .L9
.L3:
	ldr	r3, [r5, #12]
	mov	r0, r6
	add	r2, r3, r4, lsl #3
	ldr	r1, [r7]
	ldr	r3, [r3, r4, lsl #3]
	ldr	r2, [r2, #4]
	bl	bus_release_resource
	ldr	r3, [r5]
	add	r4, r4, #1
	cmp	r3, r4
	bgt	.L3
.L2:
	mov	r0, r6
	ldr	r1, [r7]
	ldr	r3, [r5, #4]
	ldr	r2, [r5, #8]
	bl	bus_release_resource
	mov	r0, #0
	pop	{r4, r5, r6, r7, r8, pc}
.L10:
	.align	2
.L9:
	.word	SYS_RES_MEMORY
	.size	ntb_plx_detach, .-ntb_plx_detach
	.comm	SYS_RES_MEMORY,4,4
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
