	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_mlx5_free_bfreg                ## -- Begin function mlx5_free_bfreg
	.p2align	4, 0x90
_mlx5_free_bfreg:                       ## @mlx5_free_bfreg
	.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	$40, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rsi, %rdx
	movq	%rdi, %r12
	movq	(%rsi), %rbx
	movq	8(%rsi), %rax
	leaq	8(%rdi), %r15
	movq	%rax, -48(%rbp)                 ## 8-byte Spill
	testq	%rax, %rax
	movq	%r15, -56(%rbp)                 ## 8-byte Spill
	cmoveq	%rdi, %r15
	movq	%rbx, %rsi
	callq	_addr_to_dbi_in_syspage
	movl	%eax, %r13d
	movq	_MLX5_BFREGS_PER_UAR@GOTPCREL(%rip), %rcx
	xorl	%edx, %edx
	divl	(%rcx)
	movq	_MLX5_NON_FP_BFREGS_PER_UAR@GOTPCREL(%rip), %rax
	xorl	%r14d, %r14d
	cmpl	(%rax), %edx
	setb	%r14b
	shlq	$4, %r14
	movq	8(%rbx,%r14), %rax
	movq	%rax, -64(%rbp)                 ## 8-byte Spill
	movq	%r15, -72(%rbp)                 ## 8-byte Spill
	movq	%r15, %rdi
	callq	_mutex_lock
	incl	(%rbx,%r14)
	movl	%r13d, %edi
	movq	-64(%rbp), %rsi                 ## 8-byte Reload
	callq	_set_bit
	cmpl	$1, (%rbx,%r14)
	jne	LBB0_2
## %bb.1:
	cmpq	$0, -48(%rbp)                   ## 8-byte Folded Reload
	movq	-56(%rbp), %rsi                 ## 8-byte Reload
	cmoveq	%r12, %rsi
	addq	$4, %rsi
	leaq	36(%rbx), %rdi
	callq	_list_add_tail
LBB0_2:
	addq	$32, %rbx
	movq	_up_rel_func@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%rbx, %rdi
	callq	_kref_put
	movq	-72(%rbp), %rdi                 ## 8-byte Reload
	addq	$40, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_mutex_unlock                   ## TAILCALL
	.cfi_endproc
                                        ## -- End function
	.comm	_MLX5_BFREGS_PER_UAR,4,2        ## @MLX5_BFREGS_PER_UAR
	.comm	_MLX5_NON_FP_BFREGS_PER_UAR,4,2 ## @MLX5_NON_FP_BFREGS_PER_UAR
	.comm	_up_rel_func,4,2                ## @up_rel_func
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_mlx5_free_bfreg                ; -- Begin function mlx5_free_bfreg
	.p2align	2
_mlx5_free_bfreg:                       ; @mlx5_free_bfreg
	.cfi_startproc
; %bb.0:
	stp	x26, x25, [sp, #-80]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 80
	stp	x24, x23, [sp, #16]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #32]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #48]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #64]             ; 16-byte Folded Spill
	add	x29, sp, #64
	.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
	mov	x2, x1
	mov	x21, x0
	add	x8, x0, #8
	ldp	x20, x24, [x1]
	cmp	x24, #0
	csel	x19, x0, x8, eq
	mov	x1, x20
	bl	_addr_to_dbi_in_syspage
	mov	x22, x0
Lloh0:
	adrp	x8, _MLX5_BFREGS_PER_UAR@GOTPAGE
Lloh1:
	ldr	x8, [x8, _MLX5_BFREGS_PER_UAR@GOTPAGEOFF]
Lloh2:
	ldr	w8, [x8]
	udiv	w9, w0, w8
	msub	w8, w9, w8, w0
Lloh3:
	adrp	x9, _MLX5_NON_FP_BFREGS_PER_UAR@GOTPAGE
Lloh4:
	ldr	x9, [x9, _MLX5_NON_FP_BFREGS_PER_UAR@GOTPAGEOFF]
Lloh5:
	ldr	w9, [x9]
	cmp	w8, w9
	cset	w8, lo
	lsl	x25, x8, #4
	mov	w8, #8
	mov	w9, #24
	csel	x8, x9, x8, lo
	ldr	x23, [x20, x8]
	mov	x0, x19
	bl	_mutex_lock
	ldr	w8, [x20, x25]
	add	w8, w8, #1
	str	w8, [x20, x25]
	mov	x0, x22
	mov	x1, x23
	bl	_set_bit
	ldr	w8, [x20, x25]
	cmp	w8, #1
	b.ne	LBB0_2
; %bb.1:
	add	x8, x21, #4
	add	x9, x21, #12
	cmp	x24, #0
	csel	x1, x8, x9, eq
	add	x0, x20, #36
	bl	_list_add_tail
LBB0_2:
	add	x0, x20, #32
Lloh6:
	adrp	x8, _up_rel_func@GOTPAGE
Lloh7:
	ldr	x8, [x8, _up_rel_func@GOTPAGEOFF]
Lloh8:
	ldr	w1, [x8]
	bl	_kref_put
	mov	x0, x19
	ldp	x29, x30, [sp, #64]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #48]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #32]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #16]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp], #80             ; 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	_MLX5_BFREGS_PER_UAR,4,2        ; @MLX5_BFREGS_PER_UAR
	.comm	_MLX5_NON_FP_BFREGS_PER_UAR,4,2 ; @MLX5_NON_FP_BFREGS_PER_UAR
	.comm	_up_rel_func,4,2                ; @up_rel_func
.subsections_via_symbols
