	.file	"extr_ntb_transport.c_ntb_transport_free.c"
	.intel_syntax noprefix
	.text
	.p2align 4
	.type	ntb_transport_free, @function
ntb_transport_free:
.LFB0:
	.cfi_startproc
	endbr64
	push	r14
	.cfi_def_cfa_offset 16
	.cfi_offset 14, -16
	push	r13
	.cfi_def_cfa_offset 24
	.cfi_offset 13, -24
	mov	r13, rsi
	push	r12
	.cfi_def_cfa_offset 32
	.cfi_offset 12, -32
	push	rbp
	.cfi_def_cfa_offset 40
	.cfi_offset 6, -40
	push	rbx
	.cfi_def_cfa_offset 48
	.cfi_offset 3, -48
	mov	rbp, QWORD PTR [rsi]
	mov	rdi, rbp
	call	ntb_transport_link_cleanup@PLT
	lea	rdi, 44[rbp]
	call	cancel_work_sync@PLT
	lea	rdi, 40[rbp]
	call	cancel_delayed_work_sync@PLT
	mov	r12d, DWORD PTR 4[rbp]
	mov	eax, DWORD PTR 8[rbp]
	not	r12d
	and	r12d, DWORD PTR 0[rbp]
	test	eax, eax
	jle	.L2
	xor	r14d, r14d
	jmp	.L4
	.p2align 4,,10
	.p2align 3
.L3:
	mov	edi, DWORD PTR 36[rbx]
	add	r14, 1
	call	debugfs_remove_recursive@PLT
	cmp	DWORD PTR 8[rbp], r14d
	jle	.L2
.L4:
	lea	rbx, [r14+r14*2]
	mov	edi, r14d
	sal	rbx, 4
	add	rbx, QWORD PTR 24[rbp]
	call	BIT_ULL@PLT
	test	eax, r12d
	je	.L3
	mov	rdi, rbx
	call	ntb_transport_free_queue@PLT
	jmp	.L3
	.p2align 4,,10
	.p2align 3
.L2:
	mov	rdi, r13
	call	ntb_link_disable@PLT
	mov	rdi, r13
	call	ntb_clear_ctx@PLT
	mov	rdi, rbp
	call	ntb_bus_remove@PLT
	mov	eax, DWORD PTR 12[rbp]
	lea	ebx, -1[rax]
	test	eax, eax
	je	.L5
	movsx	rax, ebx
	lea	r12, [rax+rax*2]
	sal	r12, 4
	.p2align 4,,10
	.p2align 3
.L6:
	mov	esi, ebx
	mov	rdi, rbp
	sub	ebx, 1
	call	ntb_free_mw@PLT
	mov	rax, QWORD PTR 16[rbp]
	mov	edi, DWORD PTR 32[rax+r12]
	sub	r12, 48
	call	iounmap@PLT
	cmp	ebx, -1
	jne	.L6
.L5:
	mov	rdi, QWORD PTR 24[rbp]
	call	kfree@PLT
	mov	rdi, QWORD PTR 16[rbp]
	call	kfree@PLT
	pop	rbx
	.cfi_def_cfa_offset 40
	mov	rdi, rbp
	pop	rbp
	.cfi_def_cfa_offset 32
	pop	r12
	.cfi_def_cfa_offset 24
	pop	r13
	.cfi_def_cfa_offset 16
	pop	r14
	.cfi_def_cfa_offset 8
	jmp	kfree@PLT
	.cfi_endproc
.LFE0:
	.size	ntb_transport_free, .-ntb_transport_free
	.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_transport.c_ntb_transport_free.c"
	.text
	.align	2
	.syntax unified
	.arm
	.fpu softvfp
	.type	ntb_transport_free, %function
ntb_transport_free:
	@ args = 0, pretend = 0, frame = 0
	@ frame_needed = 0, uses_anonymous_args = 0
	push	{r4, r5, r6, r7, r8, r9, r10, lr}
	ldr	r5, [r1]
	mov	r9, r1
	mov	r0, r5
	bl	ntb_transport_link_cleanup
	add	r0, r5, #36
	bl	cancel_work_sync
	add	r0, r5, #32
	bl	cancel_delayed_work_sync
	ldr	r2, [r5, #8]
	ldr	r3, [r5, #4]
	ldr	r8, [r5]
	cmp	r2, #0
	bic	r8, r8, r3
	ble	.L2
	mov	r7, #0
	mov	r6, r7
	b	.L4
.L3:
	ldr	r0, [r4, #28]
	bl	debugfs_remove_recursive
	ldr	r3, [r5, #8]
	add	r7, r7, #40
	cmp	r3, r6
	ble	.L2
.L4:
	mov	r0, r6
	ldr	r4, [r5, #20]
	bl	BIT_ULL
	tst	r0, r8
	add	r4, r4, r7
	add	r6, r6, #1
	beq	.L3
	mov	r0, r4
	bl	ntb_transport_free_queue
	b	.L3
.L2:
	mov	r0, r9
	bl	ntb_link_disable
	mov	r0, r9
	bl	ntb_clear_ctx
	mov	r0, r5
	bl	ntb_bus_remove
	ldr	r4, [r5, #12]
	cmp	r4, #0
	sub	r4, r4, #1
	beq	.L5
.L6:
	mov	r1, r4
	mov	r0, r5
	bl	ntb_free_mw
	ldr	r3, [r5, #16]
	add	r2, r4, r4, lsl #2
	add	r3, r3, r2, lsl #3
	ldr	r0, [r3, #24]
	sub	r4, r4, #1
	bl	iounmap
	cmn	r4, #1
	bne	.L6
.L5:
	ldr	r0, [r5, #20]
	bl	kfree
	ldr	r0, [r5, #16]
	bl	kfree
	mov	r0, r5
	pop	{r4, r5, r6, r7, r8, r9, r10, lr}
	b	kfree
	.size	ntb_transport_free, .-ntb_transport_free
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
