	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_hns_roce_free_db               ## -- Begin function hns_roce_free_db
	.p2align	4, 0x90
_hns_roce_free_db:                      ## @hns_roce_free_db
	.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	%r12
	pushq	%rbx
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rsi, %rbx
	movq	%rdi, %r14
	callq	_mutex_lock
	movl	(%rbx), %ecx
	movl	4(%rbx), %r15d
	testl	%ecx, %ecx
	jne	LBB0_4
## %bb.1:
	movl	%r15d, %r12d
	xorl	$1, %r12d
	movq	8(%rbx), %rax
	movl	24(%rax), %esi
	movl	%r12d, %edi
	callq	_test_bit
	testq	%rax, %rax
	je	LBB0_2
## %bb.3:
	movq	8(%rbx), %rax
	movl	24(%rax), %esi
	movl	%r12d, %edi
	callq	_clear_bit
	movl	$1, %ecx
	jmp	LBB0_4
LBB0_2:
	xorl	%ecx, %ecx
LBB0_4:
	sarl	%cl, %r15d
	movq	8(%rbx), %rax
	movq	16(%rax), %rax
	movslq	%ecx, %rcx
	movl	(%rax,%rcx,4), %esi
	movl	%r15d, %edi
	callq	_set_bit
	movq	8(%rbx), %rax
	movl	12(%rax), %edi
	movq	_HNS_ROCE_DB_PER_PAGE@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movq	_HNS_ROCE_DB_TYPE_COUNT@GOTPCREL(%rip), %rcx
	cltd
	idivl	(%rcx)
	movl	%eax, %esi
	callq	_bitmap_full
	testq	%rax, %rax
	je	LBB0_6
## %bb.5:
	movl	4(%r14), %edi
	movq	_PAGE_SIZE@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	8(%rbx), %rax
	movl	4(%rax), %ecx
	movl	8(%rax), %edx
	callq	_dma_free_coherent
	movq	8(%rbx), %rdi
	callq	_list_del
	movq	8(%rbx), %rdi
	callq	_kfree
LBB0_6:
	movq	%r14, %rdi
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_mutex_unlock                   ## TAILCALL
	.cfi_endproc
                                        ## -- End function
	.comm	_HNS_ROCE_DB_PER_PAGE,4,2       ## @HNS_ROCE_DB_PER_PAGE
	.comm	_HNS_ROCE_DB_TYPE_COUNT,4,2     ## @HNS_ROCE_DB_TYPE_COUNT
	.comm	_PAGE_SIZE,4,2                  ## @PAGE_SIZE
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_hns_roce_free_db               ; -- Begin function hns_roce_free_db
	.p2align	2
_hns_roce_free_db:                      ; @hns_roce_free_db
	.cfi_startproc
; %bb.0:
	stp	x22, x21, [sp, #-48]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 48
	stp	x20, x19, [sp, #16]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #32]             ; 16-byte Folded Spill
	add	x29, sp, #32
	.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
	mov	x20, x1
	mov	x19, x0
	bl	_mutex_lock
	ldp	w8, w22, [x20]
	cbnz	w8, LBB0_4
; %bb.1:
	eor	w21, w22, #0x1
	ldr	x8, [x20, #8]
	ldr	w1, [x8, #24]
	mov	x0, x21
	bl	_test_bit
	cbz	x0, LBB0_3
; %bb.2:
	ldr	x8, [x20, #8]
	ldr	w1, [x8, #24]
	mov	x0, x21
	bl	_clear_bit
	mov	w8, #1
	b	LBB0_4
LBB0_3:
	mov	w8, #0
LBB0_4:
	asr	w0, w22, w8
	ldr	x9, [x20, #8]
	ldr	x9, [x9, #16]
	ldr	w1, [x9, w8, sxtw #2]
	bl	_set_bit
	ldr	x8, [x20, #8]
Lloh0:
	adrp	x9, _HNS_ROCE_DB_PER_PAGE@GOTPAGE
Lloh1:
	ldr	x9, [x9, _HNS_ROCE_DB_PER_PAGE@GOTPAGEOFF]
	ldr	w0, [x8, #12]
Lloh2:
	ldr	w8, [x9]
Lloh3:
	adrp	x9, _HNS_ROCE_DB_TYPE_COUNT@GOTPAGE
Lloh4:
	ldr	x9, [x9, _HNS_ROCE_DB_TYPE_COUNT@GOTPAGEOFF]
Lloh5:
	ldr	w9, [x9]
	sdiv	w1, w8, w9
	bl	_bitmap_full
	cbz	x0, LBB0_6
; %bb.5:
	ldr	w0, [x19, #4]
Lloh6:
	adrp	x8, _PAGE_SIZE@GOTPAGE
Lloh7:
	ldr	x8, [x8, _PAGE_SIZE@GOTPAGEOFF]
Lloh8:
	ldr	w1, [x8]
	ldr	x8, [x20, #8]
	ldp	w3, w2, [x8, #4]
	bl	_dma_free_coherent
	ldr	x0, [x20, #8]
	bl	_list_del
	ldr	x0, [x20, #8]
	bl	_kfree
LBB0_6:
	mov	x0, x19
	ldp	x29, x30, [sp, #32]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #16]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp], #48             ; 16-byte Folded Reload
	b	_mutex_unlock
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.cfi_endproc
                                        ; -- End function
	.comm	_HNS_ROCE_DB_PER_PAGE,4,2       ; @HNS_ROCE_DB_PER_PAGE
	.comm	_HNS_ROCE_DB_TYPE_COUNT,4,2     ; @HNS_ROCE_DB_TYPE_COUNT
	.comm	_PAGE_SIZE,4,2                  ; @PAGE_SIZE
.subsections_via_symbols
