	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_bfregn_to_uar_index            ## -- Begin function bfregn_to_uar_index
	.p2align	4, 0x90
_bfregn_to_uar_index:                   ## @bfregn_to_uar_index
	.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
	movl	%ecx, %r12d
	movl	%edx, %r15d
	movq	%rsi, %rbx
	movq	%rdi, %r14
	movl	24(%rsi), %esi
	callq	_get_uars_per_sys_page
	movl	%eax, %ecx
	movq	_MLX5_NON_FP_BFREGS_PER_UAR@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	imull	%esi, %ecx
	movl	%r15d, %eax
	xorl	%edx, %edx
	divl	%ecx
	testl	%r12d, %r12d
	je	LBB0_1
## %bb.3:
	addl	16(%rbx), %eax
	cmpl	(%rbx), %eax
	jae	LBB0_4
## %bb.6:
	cmpl	%r15d, 4(%rbx)
	jb	LBB0_8
## %bb.7:
	movq	8(%rbx), %rcx
	movl	%eax, %eax
	movq	(%rcx,%rax,8), %rcx
	movq	_MLX5_IB_INVALID_UAR_INDEX@GOTPCREL(%rip), %rax
	cmpq	(%rax), %rcx
	jne	LBB0_2
LBB0_8:
	leaq	L_.str(%rip), %rsi
	movq	%r14, %rdi
	callq	_mlx5_ib_dbg
LBB0_4:
	movq	_EINVAL@GOTPCREL(%rip), %rax
	xorl	%ecx, %ecx
	subl	(%rax), %ecx
	jmp	LBB0_5
LBB0_1:
	movq	8(%rbx), %rcx
	movl	%eax, %eax
	movq	(%rcx,%rax,8), %rcx
LBB0_2:
	movl	%edx, %eax
	xorl	%edx, %edx
	divl	%esi
	addl	%eax, %ecx
LBB0_5:
	movl	%ecx, %eax
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_MLX5_NON_FP_BFREGS_PER_UAR,4,2 ## @MLX5_NON_FP_BFREGS_PER_UAR
	.comm	_EINVAL,4,2                     ## @EINVAL
	.comm	_MLX5_IB_INVALID_UAR_INDEX,8,3  ## @MLX5_IB_INVALID_UAR_INDEX
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Invalid dynamic uar index\n"

.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_bfregn_to_uar_index            ; -- Begin function bfregn_to_uar_index
	.p2align	2
_bfregn_to_uar_index:                   ; @bfregn_to_uar_index
	.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	x22, x3
	mov	x19, x2
	mov	x21, x1
	mov	x20, x0
	ldr	w1, [x1, #24]
	bl	_get_uars_per_sys_page
Lloh0:
	adrp	x8, _MLX5_NON_FP_BFREGS_PER_UAR@GOTPAGE
Lloh1:
	ldr	x8, [x8, _MLX5_NON_FP_BFREGS_PER_UAR@GOTPAGEOFF]
Lloh2:
	ldr	w8, [x8]
	mul	w9, w8, w0
	udiv	w10, w19, w9
	cbz	w22, LBB0_6
; %bb.1:
	ldr	w11, [x21, #16]
	ldr	w12, [x21]
	add	w11, w10, w11
	cmp	w11, w12
	b.hs	LBB0_5
; %bb.2:
	ldr	w12, [x21, #4]
	cmp	w12, w19
	b.lo	LBB0_4
; %bb.3:
	ldr	x12, [x21, #8]
	ldr	x11, [x12, w11, uxtw #3]
Lloh3:
	adrp	x12, _MLX5_IB_INVALID_UAR_INDEX@GOTPAGE
Lloh4:
	ldr	x12, [x12, _MLX5_IB_INVALID_UAR_INDEX@GOTPAGEOFF]
Lloh5:
	ldr	x12, [x12]
	cmp	x11, x12
	b.ne	LBB0_7
LBB0_4:
Lloh6:
	adrp	x1, l_.str@PAGE
Lloh7:
	add	x1, x1, l_.str@PAGEOFF
	mov	x0, x20
	bl	_mlx5_ib_dbg
LBB0_5:
Lloh8:
	adrp	x8, _EINVAL@GOTPAGE
Lloh9:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
Lloh10:
	ldr	w8, [x8]
	neg	w0, w8
	b	LBB0_8
LBB0_6:
	ldr	x11, [x21, #8]
	ldr	x11, [x11, w10, uxtw #3]
LBB0_7:
	msub	w9, w10, w9, w19
	udiv	w8, w9, w8
	add	w0, w8, w11
LBB0_8:
	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
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpAdd	Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.cfi_endproc
                                        ; -- End function
	.comm	_MLX5_NON_FP_BFREGS_PER_UAR,4,2 ; @MLX5_NON_FP_BFREGS_PER_UAR
	.comm	_EINVAL,4,2                     ; @EINVAL
	.comm	_MLX5_IB_INVALID_UAR_INDEX,8,3  ; @MLX5_IB_INVALID_UAR_INDEX
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Invalid dynamic uar index\n"

.subsections_via_symbols
