	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_i40iw_remove_pd_bp             ## -- Begin function i40iw_remove_pd_bp
	.p2align	4, 0x90
_i40iw_remove_pd_bp:                    ## @i40iw_remove_pd_bp
	.cfi_startproc
## %bb.0:
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset %rbp, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register %rbp
	pushq	%r15
	pushq	%r14
	pushq	%r13
	pushq	%r12
	pushq	%rbx
	subq	$56, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdx, %r13
	movq	_I40IW_HMC_PD_CNT_IN_SD@GOTPCREL(%rip), %rax
	movq	(%rax), %rbx
	movq	%rdx, %rax
	orq	%rbx, %rax
	shrq	$32, %rax
	je	LBB0_6
## %bb.1:
	movq	%r13, %rax
	xorl	%edx, %edx
	divq	%rbx
	movq	%rax, %r14
	cmpq	8(%rsi), %r14
	jae	LBB0_7
LBB0_2:
	movq	16(%rsi), %r12
	movq	%r14, %r15
	shlq	$5, %r15
	movq	(%r12,%r15), %rax
	movq	_I40IW_SD_TYPE_PAGED@GOTPCREL(%rip), %rbx
	cmpq	(%rbx), %rax
	jne	LBB0_8
## %bb.3:
	movq	%rsi, -80(%rbp)                 ## 8-byte Spill
	movl	%ecx, -48(%rbp)                 ## 4-byte Spill
	movq	%rdi, -56(%rbp)                 ## 8-byte Spill
	movq	24(%r12,%r15), %rax
	movq	%rax, -64(%rbp)                 ## 8-byte Spill
	movq	%rdx, %rbx
	shlq	$5, %rbx
	leaq	(%rax,%rbx), %rdi
	addq	$8, %rdi
	movq	%rdi, -96(%rbp)                 ## 8-byte Spill
	movq	%rdx, -88(%rbp)                 ## 8-byte Spill
	callq	_I40IW_DEC_BP_REFCNT
	movq	-64(%rbp), %rcx                 ## 8-byte Reload
	movq	%r12, %rax
	xorl	%r12d, %r12d
	cmpq	$0, 16(%rcx,%rbx)
	jne	LBB0_10
## %bb.4:
	leaq	(%rax,%r15), %rdi
	addq	$8, %rdi
	movq	%rbx, %r12
	movl	$0, (%rcx,%rbx)
	movq	%rdi, -72(%rbp)                 ## 8-byte Spill
	movq	%rax, %rbx
	callq	_I40IW_DEC_PD_REFCNT
	movq	-88(%rbp), %rdi                 ## 8-byte Reload
	shlq	$2, %rdi
	addq	16(%rbx,%r15), %rdi
	xorl	%esi, %esi
	movl	$4, %edx
	callq	_memset
	cmpl	$0, -48(%rbp)                   ## 4-byte Folded Reload
	movq	%rbx, -48(%rbp)                 ## 8-byte Spill
	je	LBB0_11
## %bb.5:
	movq	-56(%rbp), %rbx                 ## 8-byte Reload
	movq	%rbx, %rdi
	movq	%r14, %rsi
	movq	%r13, %rdx
	callq	_I40IW_INVALIDATE_PF_HMC_PD
	jmp	LBB0_12
LBB0_6:
	movl	%r13d, %eax
	xorl	%edx, %edx
	divl	%ebx
                                        ## kill: def $edx killed $edx def $rdx
	movl	%eax, %r14d
	cmpq	8(%rsi), %r14
	jb	LBB0_2
LBB0_7:
	movq	_I40IW_ERR_INVALID_PAGE_DESC_INDEX@GOTPCREL(%rip), %rax
	jmp	LBB0_9
LBB0_8:
	movq	_I40IW_ERR_INVALID_SD_TYPE@GOTPCREL(%rip), %rax
LBB0_9:
	movl	(%rax), %r12d
LBB0_10:
	movl	%r12d, %eax
	addq	$56, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_11:
	movq	-80(%rbp), %rax                 ## 8-byte Reload
	movl	(%rax), %ecx
	movq	-56(%rbp), %rbx                 ## 8-byte Reload
	movq	%rbx, %rdi
	movq	%r14, %rsi
	movq	%r13, %rdx
	callq	_I40IW_INVALIDATE_VF_HMC_PD
LBB0_12:
	movq	-64(%rbp), %rax                 ## 8-byte Reload
	cmpl	$0, 24(%rax,%r12)
	movq	-96(%rbp), %rsi                 ## 8-byte Reload
	jne	LBB0_15
## %bb.13:
	cmpl	$0, (%rsi)
	je	LBB0_17
## %bb.14:
	movq	%rbx, %rdi
	callq	_i40iw_free_dma_mem
LBB0_15:
	xorl	%r12d, %r12d
	movq	-48(%rbp), %rax                 ## 8-byte Reload
	cmpl	$0, 12(%rax,%r15)
	jne	LBB0_10
## %bb.16:
	movq	-56(%rbp), %rdi                 ## 8-byte Reload
	movq	-72(%rbp), %rsi                 ## 8-byte Reload
	callq	_i40iw_free_virt_mem
	jmp	LBB0_10
LBB0_17:
	movq	_I40IW_ERR_PARAM@GOTPCREL(%rip), %rax
	jmp	LBB0_9
	.cfi_endproc
                                        ## -- End function
	.comm	_I40IW_HMC_PD_CNT_IN_SD,8,3     ## @I40IW_HMC_PD_CNT_IN_SD
	.comm	_I40IW_ERR_INVALID_PAGE_DESC_INDEX,4,2 ## @I40IW_ERR_INVALID_PAGE_DESC_INDEX
	.comm	_I40IW_SD_TYPE_PAGED,8,3        ## @I40IW_SD_TYPE_PAGED
	.comm	_I40IW_ERR_INVALID_SD_TYPE,4,2  ## @I40IW_ERR_INVALID_SD_TYPE
	.comm	_I40IW_ERR_PARAM,4,2            ## @I40IW_ERR_PARAM
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_i40iw_remove_pd_bp             ; -- Begin function i40iw_remove_pd_bp
	.p2align	2
_i40iw_remove_pd_bp:                    ; @i40iw_remove_pd_bp
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #112
	.cfi_def_cfa_offset 112
	stp	x28, x27, [sp, #16]             ; 16-byte Folded Spill
	stp	x26, x25, [sp, #32]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #48]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #64]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #80]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #96]             ; 16-byte Folded Spill
	add	x29, sp, #96
	.cfi_def_cfa w29, 16
	.cfi_offset w30, -8
	.cfi_offset w29, -16
	.cfi_offset w19, -24
	.cfi_offset w20, -32
	.cfi_offset w21, -40
	.cfi_offset w22, -48
	.cfi_offset w23, -56
	.cfi_offset w24, -64
	.cfi_offset w25, -72
	.cfi_offset w26, -80
	.cfi_offset w27, -88
	.cfi_offset w28, -96
Lloh0:
	adrp	x8, _I40IW_HMC_PD_CNT_IN_SD@GOTPAGE
Lloh1:
	ldr	x8, [x8, _I40IW_HMC_PD_CNT_IN_SD@GOTPAGEOFF]
Lloh2:
	ldr	x8, [x8]
	udiv	x20, x2, x8
	ldr	x9, [x1, #8]
	cmp	x20, x9
	b.hs	LBB0_5
; %bb.1:
	mov	x24, x1
	ldr	x26, [x1, #16]
	lsl	x9, x20, #5
	ldr	x9, [x26, x9]
Lloh3:
	adrp	x10, _I40IW_SD_TYPE_PAGED@GOTPAGE
Lloh4:
	ldr	x10, [x10, _I40IW_SD_TYPE_PAGED@GOTPAGEOFF]
Lloh5:
	ldr	x10, [x10]
	cmp	x9, x10
	b.ne	LBB0_6
; %bb.2:
	mov	x25, x3
	mov	x21, x2
	str	x0, [sp, #8]                    ; 8-byte Folded Spill
	msub	x27, x20, x8, x2
	add	x22, x26, x20, lsl #5
	ldr	x19, [x22, #24]
	add	x23, x19, x27, lsl #5
	add	x28, x23, #8
	mov	x0, x28
	bl	_I40IW_DEC_BP_REFCNT
	ldr	x8, [x23, #16]
	cbnz	x8, LBB0_13
; %bb.3:
	add	x0, x22, #8
	lsl	x8, x27, #5
	mov	x23, x19
	str	wzr, [x19, x8]
	str	x0, [sp]                        ; 8-byte Folded Spill
	bl	_I40IW_DEC_PD_REFCNT
	ldr	x8, [x22, #16]
	add	x0, x8, x27, lsl #2
	mov	w1, #0
	mov	w2, #4
	bl	_memset
	cbz	w25, LBB0_7
; %bb.4:
	ldr	x19, [sp, #8]                   ; 8-byte Folded Reload
	mov	x0, x19
	mov	x1, x20
	mov	x2, x21
	bl	_I40IW_INVALIDATE_PF_HMC_PD
	b	LBB0_8
LBB0_5:
Lloh6:
	adrp	x8, _I40IW_ERR_INVALID_PAGE_DESC_INDEX@GOTPAGE
Lloh7:
	ldr	x8, [x8, _I40IW_ERR_INVALID_PAGE_DESC_INDEX@GOTPAGEOFF]
Lloh8:
	ldr	w0, [x8]
	b	LBB0_14
LBB0_6:
Lloh9:
	adrp	x8, _I40IW_ERR_INVALID_SD_TYPE@GOTPAGE
Lloh10:
	ldr	x8, [x8, _I40IW_ERR_INVALID_SD_TYPE@GOTPAGEOFF]
Lloh11:
	ldr	w0, [x8]
	b	LBB0_14
LBB0_7:
	ldr	w3, [x24]
	ldr	x19, [sp, #8]                   ; 8-byte Folded Reload
	mov	x0, x19
	mov	x1, x20
	mov	x2, x21
	bl	_I40IW_INVALIDATE_VF_HMC_PD
LBB0_8:
	add	x8, x23, x27, lsl #5
	ldr	w8, [x8, #24]
	cbnz	w8, LBB0_11
; %bb.9:
	ldr	w8, [x28]
	cbz	w8, LBB0_15
; %bb.10:
	mov	x0, x19
	mov	x1, x28
	bl	_i40iw_free_dma_mem
LBB0_11:
	add	x8, x26, x20, lsl #5
	ldr	w8, [x8, #12]
	cbnz	w8, LBB0_13
; %bb.12:
	mov	x0, x19
	ldr	x1, [sp]                        ; 8-byte Folded Reload
	bl	_i40iw_free_virt_mem
LBB0_13:
	mov	w0, #0
LBB0_14:
	ldp	x29, x30, [sp, #96]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #80]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #64]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #48]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #32]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #112
	ret
LBB0_15:
Lloh12:
	adrp	x8, _I40IW_ERR_PARAM@GOTPAGE
Lloh13:
	ldr	x8, [x8, _I40IW_ERR_PARAM@GOTPAGEOFF]
Lloh14:
	ldr	w0, [x8]
	b	LBB0_14
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.cfi_endproc
                                        ; -- End function
	.comm	_I40IW_HMC_PD_CNT_IN_SD,8,3     ; @I40IW_HMC_PD_CNT_IN_SD
	.comm	_I40IW_ERR_INVALID_PAGE_DESC_INDEX,4,2 ; @I40IW_ERR_INVALID_PAGE_DESC_INDEX
	.comm	_I40IW_SD_TYPE_PAGED,8,3        ; @I40IW_SD_TYPE_PAGED
	.comm	_I40IW_ERR_INVALID_SD_TYPE,4,2  ; @I40IW_ERR_INVALID_SD_TYPE
	.comm	_I40IW_ERR_PARAM,4,2            ; @I40IW_ERR_PARAM
.subsections_via_symbols
