	.file	"extr_i40iw_hmc.c_i40iw_remove_pd_bp.c"
	.intel_syntax noprefix
	.text
	.p2align 4
	.globl	i40iw_remove_pd_bp
	.type	i40iw_remove_pd_bp, @function
i40iw_remove_pd_bp:
.LFB0:
	.cfi_startproc
	endbr64
	push	r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	mov	rax, rdx
	push	r14
	.cfi_def_cfa_offset 24
	.cfi_offset 14, -24
	push	r13
	.cfi_def_cfa_offset 32
	.cfi_offset 13, -32
	push	r12
	.cfi_def_cfa_offset 40
	.cfi_offset 12, -40
	mov	r12, rdx
	xor	edx, edx
	push	rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	push	rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	sub	rsp, 40
	.cfi_def_cfa_offset 96
	div	QWORD PTR I40IW_HMC_PD_CNT_IN_SD[rip]
	cmp	QWORD PTR 8[rsi], rax
	jbe	.L14
	mov	rbx, rax
	mov	r13, rax
	mov	rax, QWORD PTR I40IW_SD_TYPE_PAGED[rip]
	sal	rbx, 5
	add	rbx, QWORD PTR 16[rsi]
	cmp	QWORD PTR [rbx], rax
	je	.L4
	mov	eax, DWORD PTR I40IW_ERR_INVALID_SD_TYPE[rip]
.L1:
	add	rsp, 40
	.cfi_remember_state
	.cfi_def_cfa_offset 56
	pop	rbx
	.cfi_def_cfa_offset 48
	pop	rbp
	.cfi_def_cfa_offset 40
	pop	r12
	.cfi_def_cfa_offset 32
	pop	r13
	.cfi_def_cfa_offset 24
	pop	r14
	.cfi_def_cfa_offset 16
	pop	r15
	.cfi_def_cfa_offset 8
	ret
	.p2align 4,,10
	.p2align 3
.L4:
	.cfi_restore_state
	mov	r10, rdx
	mov	r14, QWORD PTR 24[rbx]
	mov	r15, rdi
	mov	QWORD PTR [rsp], rdx
	sal	r10, 5
	mov	QWORD PTR 8[rsp], rsi
	mov	ebp, ecx
	add	r14, r10
	lea	rax, 8[r14]
	mov	rdi, rax
	mov	QWORD PTR 16[rsp], rax
	call	I40IW_DEC_BP_REFCNT@PLT
	cmp	QWORD PTR 16[r14], 0
	mov	rdx, QWORD PTR [rsp]
	mov	r8, QWORD PTR 8[rsp]
	je	.L5
.L12:
	xor	eax, eax
.L15:
	add	rsp, 40
	.cfi_remember_state
	.cfi_def_cfa_offset 56
	pop	rbx
	.cfi_def_cfa_offset 48
	pop	rbp
	.cfi_def_cfa_offset 40
	pop	r12
	.cfi_def_cfa_offset 32
	pop	r13
	.cfi_def_cfa_offset 24
	pop	r14
	.cfi_def_cfa_offset 16
	pop	r15
	.cfi_def_cfa_offset 8
	ret
	.p2align 4,,10
	.p2align 3
.L14:
	.cfi_restore_state
	mov	eax, DWORD PTR I40IW_ERR_INVALID_PAGE_DESC_INDEX[rip]
	add	rsp, 40
	.cfi_remember_state
	.cfi_def_cfa_offset 56
	pop	rbx
	.cfi_def_cfa_offset 48
	pop	rbp
	.cfi_def_cfa_offset 40
	pop	r12
	.cfi_def_cfa_offset 32
	pop	r13
	.cfi_def_cfa_offset 24
	pop	r14
	.cfi_def_cfa_offset 16
	pop	r15
	.cfi_def_cfa_offset 8
	ret
	.p2align 4,,10
	.p2align 3
.L5:
	.cfi_restore_state
	mov	DWORD PTR [r14], 0
	lea	rax, 8[rbx]
	mov	rdi, rax
	mov	QWORD PTR [rsp], r8
	mov	QWORD PTR 8[rsp], rdx
	mov	QWORD PTR 24[rsp], rax
	call	I40IW_DEC_PD_REFCNT@PLT
	mov	rdx, QWORD PTR 8[rsp]
	mov	rdi, QWORD PTR 16[rbx]
	xor	esi, esi
	sal	rdx, 2
	add	rdi, rdx
	mov	edx, 4
	call	memset@PLT
	test	ebp, ebp
	mov	r8, QWORD PTR [rsp]
	je	.L6
	mov	rdx, r12
	mov	rsi, r13
	mov	rdi, r15
	call	I40IW_INVALIDATE_PF_HMC_PD@PLT
.L7:
	mov	ecx, DWORD PTR 24[r14]
	test	ecx, ecx
	jne	.L8
	mov	edx, DWORD PTR 8[r14]
	mov	eax, DWORD PTR I40IW_ERR_PARAM[rip]
	test	edx, edx
	je	.L1
	mov	rsi, QWORD PTR 16[rsp]
	mov	rdi, r15
	call	i40iw_free_dma_mem@PLT
.L8:
	mov	eax, DWORD PTR 12[rbx]
	test	eax, eax
	jne	.L12
	mov	rsi, QWORD PTR 24[rsp]
	mov	rdi, r15
	call	i40iw_free_virt_mem@PLT
	xor	eax, eax
	jmp	.L15
	.p2align 4,,10
	.p2align 3
.L6:
	mov	ecx, DWORD PTR [r8]
	mov	rdx, r12
	mov	rsi, r13
	mov	rdi, r15
	call	I40IW_INVALIDATE_VF_HMC_PD@PLT
	jmp	.L7
	.cfi_endproc
.LFE0:
	.size	i40iw_remove_pd_bp, .-i40iw_remove_pd_bp
	.comm	I40IW_SD_TYPE_PAGED,8,8
	.comm	I40IW_HMC_PD_CNT_IN_SD,8,8
	.comm	I40IW_ERR_PARAM,4,4
	.comm	I40IW_ERR_INVALID_SD_TYPE,4,4
	.comm	I40IW_ERR_INVALID_PAGE_DESC_INDEX,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_i40iw_hmc.c_i40iw_remove_pd_bp.c"
	.text
	.global	__aeabi_uidivmod
	.align	2
	.global	i40iw_remove_pd_bp
	.syntax unified
	.arm
	.fpu softvfp
	.type	i40iw_remove_pd_bp, %function
i40iw_remove_pd_bp:
	@ args = 0, pretend = 0, frame = 16
	@ frame_needed = 0, uses_anonymous_args = 0
	push	{r4, r5, r6, r7, r8, r9, r10, fp, lr}
	mov	r6, r2
	ldr	r2, .L14
	mov	r5, r1
	mov	r7, r0
	ldr	r1, [r2]
	mov	r0, r6
	sub	sp, sp, #20
	mov	r9, r3
	bl	__aeabi_uidivmod
	ldr	r3, [r5, #4]
	cmp	r3, r0
	bls	.L13
	ldr	r8, [r5, #8]
	ldr	r2, .L14+4
	add	r3, r0, r0, lsl #2
	mov	r4, r0
	ldr	r2, [r2]
	ldr	r0, [r8, r3, lsl #2]
	add	r8, r8, r3, lsl #2
	cmp	r0, r2
	beq	.L4
	ldr	r3, .L14+8
	ldr	r0, [r3]
.L1:
	add	sp, sp, #20
	@ sp needed
	pop	{r4, r5, r6, r7, r8, r9, r10, fp, pc}
.L4:
	ldr	r2, [r8, #16]
	str	r1, [sp, #8]
	add	r10, r2, r1, lsl #4
	add	fp, r10, #4
	mov	r0, fp
	str	r2, [sp, #4]
	bl	I40IW_DEC_BP_REFCNT
	ldr	r3, [r10, #8]
	ldr	r2, [sp, #4]
	cmp	r3, #0
	ldr	r1, [sp, #8]
	beq	.L5
.L10:
	mov	r0, #0
	add	sp, sp, #20
	@ sp needed
	pop	{r4, r5, r6, r7, r8, r9, r10, fp, pc}
.L13:
	ldr	r3, .L14+12
	ldr	r0, [r3]
	add	sp, sp, #20
	@ sp needed
	pop	{r4, r5, r6, r7, r8, r9, r10, fp, pc}
.L5:
	str	r3, [r2, r1, lsl #4]
	add	r0, r8, #4
	stmib	sp, {r1, r3}
	str	r0, [sp, #12]
	bl	I40IW_DEC_PD_REFCNT
	ldr	r0, [r8, #12]
	ldr	r1, [sp, #4]
	ldr	r3, [sp, #8]
	add	r2, r0, r1, lsl #2
	cmp	r9, #0
	strb	r3, [r0, r1, lsl #2]
	strb	r3, [r2, #1]
	strb	r3, [r2, #2]
	strb	r3, [r2, #3]
	beq	.L6
	mov	r2, r6
	mov	r1, r4
	mov	r0, r7
	bl	I40IW_INVALIDATE_PF_HMC_PD
.L7:
	ldr	r3, [r10, #12]
	cmp	r3, #0
	bne	.L8
	ldr	r3, [r10, #4]
	cmp	r3, #0
	ldreq	r3, .L14+16
	ldreq	r0, [r3]
	beq	.L1
.L9:
	mov	r1, fp
	mov	r0, r7
	bl	i40iw_free_dma_mem
.L8:
	ldr	r4, [r8, #8]
	cmp	r4, #0
	bne	.L10
	mov	r0, r7
	ldr	r1, [sp, #12]
	bl	i40iw_free_virt_mem
	mov	r0, r4
	b	.L1
.L6:
	mov	r2, r6
	mov	r1, r4
	mov	r0, r7
	ldr	r3, [r5]
	bl	I40IW_INVALIDATE_VF_HMC_PD
	b	.L7
.L15:
	.align	2
.L14:
	.word	I40IW_HMC_PD_CNT_IN_SD
	.word	I40IW_SD_TYPE_PAGED
	.word	I40IW_ERR_INVALID_SD_TYPE
	.word	I40IW_ERR_INVALID_PAGE_DESC_INDEX
	.word	I40IW_ERR_PARAM
	.size	i40iw_remove_pd_bp, .-i40iw_remove_pd_bp
	.comm	I40IW_SD_TYPE_PAGED,4,4
	.comm	I40IW_HMC_PD_CNT_IN_SD,4,4
	.comm	I40IW_ERR_PARAM,4,4
	.comm	I40IW_ERR_INVALID_SD_TYPE,4,4
	.comm	I40IW_ERR_INVALID_PAGE_DESC_INDEX,4,4
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
