	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_mlx4_bf_free                   ## -- Begin function mlx4_bf_free
	.p2align	4, 0x90
_mlx4_bf_free:                          ## @mlx4_bf_free
	.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, %r15
	callq	_mlx4_priv
	movq	%rax, %r14
	movq	8(%rbx), %rax
	testq	%rax, %rax
	je	LBB0_9
## %bb.1:
	cmpl	$0, (%rax)
	je	LBB0_9
## %bb.2:
	movq	%r14, %rdi
	callq	_mutex_lock
	movl	(%rbx), %eax
	movq	8(%rbx), %rsi
	subl	(%rsi), %eax
	cltd
	idivl	(%r15)
	movl	$-2, %edx
	movl	%eax, %ecx
	roll	%cl, %edx
	leaq	8(%rsi), %rdi
	andl	%edx, 4(%rsi)
	setne	%r12b
	callq	_list_empty
	testb	%r12b, %r12b
	je	LBB0_3
## %bb.6:
	testq	%rax, %rax
	je	LBB0_8
## %bb.7:
	movq	8(%rbx), %rdi
	addq	$8, %rdi
	movq	%r14, %rsi
	addq	$4, %rsi
	callq	_list_add
	jmp	LBB0_8
LBB0_9:
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_3:
	testq	%rax, %rax
	jne	LBB0_5
## %bb.4:
	movq	8(%rbx), %rdi
	addq	$8, %rdi
	callq	_list_del
LBB0_5:
	movq	8(%rbx), %rax
	movl	(%rax), %edi
	callq	_io_mapping_unmap
	movq	8(%rbx), %rax
	movl	12(%rax), %edi
	callq	_iounmap
	movq	8(%rbx), %rsi
	movq	%r15, %rdi
	callq	_mlx4_uar_free
	movq	8(%rbx), %rdi
	callq	_kfree
LBB0_8:
	movq	%r14, %rdi
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_mutex_unlock                   ## TAILCALL
	.cfi_endproc
                                        ## -- End function
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_mlx4_bf_free                   ; -- Begin function mlx4_bf_free
	.p2align	2
_mlx4_bf_free:                          ; @mlx4_bf_free
	.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	x21, x0
	bl	_mlx4_priv
	ldr	x8, [x20, #8]
	cbz	x8, LBB0_5
; %bb.1:
	ldr	w8, [x8]
	cbz	w8, LBB0_5
; %bb.2:
	mov	x19, x0
	bl	_mutex_lock
	ldr	w8, [x20]
	ldr	x9, [x20, #8]
	ldp	w10, w11, [x9]
	sub	w8, w8, w10
	ldr	w10, [x21]
	sdiv	w8, w8, w10
	mov	w10, #1
	lsl	w8, w10, w8
	bic	w22, w11, w8
	str	w22, [x9, #4]
	add	x0, x9, #8
	bl	_list_empty
	cbz	w22, LBB0_6
; %bb.3:
	cbz	x0, LBB0_9
; %bb.4:
	ldr	x8, [x20, #8]
	add	x0, x8, #8
	add	x1, x19, #4
	bl	_list_add
	b	LBB0_9
LBB0_5:
	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
	ret
LBB0_6:
	cbnz	x0, LBB0_8
; %bb.7:
	ldr	x8, [x20, #8]
	add	x0, x8, #8
	bl	_list_del
LBB0_8:
	ldr	x8, [x20, #8]
	ldr	w0, [x8]
	bl	_io_mapping_unmap
	ldr	x8, [x20, #8]
	ldr	w0, [x8, #12]
	bl	_iounmap
	ldr	x1, [x20, #8]
	mov	x0, x21
	bl	_mlx4_uar_free
	ldr	x0, [x20, #8]
	bl	_kfree
LBB0_9:
	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
	.cfi_endproc
                                        ; -- End function
.subsections_via_symbols
