	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function alloc_uars_page
_alloc_uars_page:                       ## @alloc_uars_page
	.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	$24, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movl	%esi, -44(%rbp)                 ## 4-byte Spill
	movq	%rdi, %rbx
	movq	_ENOMEM@GOTPCREL(%rip), %rax
	xorl	%r13d, %r13d
	subl	(%rax), %r13d
	callq	_uars_per_sys_page
	movl	%eax, %r15d
	movq	_MLX5_BFREGS_PER_UAR@GOTPCREL(%rip), %rax
	imull	(%rax), %r15d
	movq	_GFP_KERNEL@GOTPCREL(%rip), %r14
	movl	(%r14), %esi
	movl	$56, %edi
	callq	_kzalloc
	testq	%rax, %rax
	je	LBB0_16
## %bb.1:
	movq	%rax, %r12
	movq	%rbx, 48(%rax)
	movl	(%r14), %esi
	movl	%r15d, %edi
	callq	_bitmap_zalloc
	movq	%rax, 16(%r12)
	testq	%rax, %rax
	je	LBB0_15
## %bb.2:
	movl	(%r14), %esi
	movl	%r15d, %edi
	callq	_bitmap_zalloc
	movq	%rax, 24(%r12)
	testq	%rax, %rax
	je	LBB0_15
## %bb.3:
	movq	%rbx, -64(%rbp)                 ## 8-byte Spill
	movq	%r12, -56(%rbp)                 ## 8-byte Spill
	testl	%r15d, %r15d
	movq	_MLX5_BFREGS_PER_UAR@GOTPCREL(%rip), %r14
	jle	LBB0_6
## %bb.4:
	movq	-56(%rbp), %rax                 ## 8-byte Reload
	leaq	16(%rax), %r13
	leaq	24(%rax), %r12
	xorl	%ebx, %ebx
	.p2align	4, 0x90
LBB0_5:                                 ## =>This Inner Loop Header: Depth=1
	movl	%ebx, %eax
	cltd
	idivl	(%r14)
	movq	_MLX5_NON_FP_BFREGS_PER_UAR@GOTPCREL(%rip), %rax
	cmpl	(%rax), %edx
	movq	%r12, %rax
	cmovlq	%r13, %rax
	movq	(%rax), %rsi
	movl	%ebx, %edi
	callq	_set_bit
	incl	%ebx
	cmpl	%ebx, %r15d
	jne	LBB0_5
LBB0_6:
	movq	-56(%rbp), %r12                 ## 8-byte Reload
	movl	%r15d, (%r12)
	movq	_MLX5_FP_BFREGS_PER_UAR@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	imull	%r15d, %eax
	movl	(%r14), %ecx
	cltd
	idivl	%ecx
	movl	%eax, 4(%r12)
	movq	_MLX5_NON_FP_BFREGS_PER_UAR@GOTPCREL(%rip), %rax
	imull	(%rax), %r15d
	movl	%r15d, %eax
	cltd
	idivl	%ecx
	movl	%eax, 8(%r12)
	leaq	12(%r12), %r14
	movq	-64(%rbp), %r15                 ## 8-byte Reload
	movq	%r15, %rdi
	movq	%r14, %rsi
	callq	_mlx5_cmd_alloc_uar
	testl	%eax, %eax
	je	LBB0_8
## %bb.7:
	movl	%eax, %r13d
	leaq	L_.str(%rip), %rsi
	movq	%r15, %rdi
	movl	%eax, %edx
LBB0_14:
	callq	_mlx5_core_warn
LBB0_15:
	movq	24(%r12), %rdi
	callq	_bitmap_free
	movq	16(%r12), %rdi
	callq	_bitmap_free
	movq	%r12, %rdi
	callq	_kfree
LBB0_16:
	movl	%r13d, %edi
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_ERR_PTR                        ## TAILCALL
LBB0_8:
	movl	(%r14), %esi
	movq	%r15, %rdi
	callq	_uar2pfn
	movq	_PAGE_SHIFT@GOTPCREL(%rip), %rcx
	movb	(%rcx), %cl
	shll	%cl, %eax
	movq	_PAGE_SIZE@GOTPCREL(%rip), %rcx
	movl	(%rcx), %esi
	cmpl	$0, -44(%rbp)                   ## 4-byte Folded Reload
	je	LBB0_11
## %bb.9:
	movl	%eax, %edi
	callq	_ioremap_wc
	movq	%rax, 40(%r12)
	testq	%rax, %rax
	jne	LBB0_17
## %bb.10:
	movq	_EAGAIN@GOTPCREL(%rip), %rax
	jmp	LBB0_12
LBB0_11:
	movl	%eax, %edi
	callq	_ioremap
	movq	%rax, 40(%r12)
	testq	%rax, %rax
	movq	_ENOMEM@GOTPCREL(%rip), %rax
	je	LBB0_12
LBB0_17:
	movq	%r12, %rdi
	addq	$32, %rdi
	callq	_kref_init
	movl	(%r12), %ecx
	movl	12(%r12), %edx
	leaq	L_.str.1(%rip), %rsi
	movq	%r15, %rdi
	callq	_mlx5_core_dbg
	movq	%r12, %rax
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_12:
	xorl	%r13d, %r13d
	subl	(%rax), %r13d
	movl	(%r14), %esi
	movq	%r15, %rdi
	callq	_mlx5_cmd_free_uar
	testq	%rax, %rax
	je	LBB0_15
## %bb.13:
	movl	(%r14), %edx
	leaq	L_.str.2(%rip), %rsi
	movq	%r15, %rdi
	jmp	LBB0_14
	.cfi_endproc
                                        ## -- End function
	.comm	_ENOMEM,4,2                     ## @ENOMEM
	.comm	_MLX5_BFREGS_PER_UAR,4,2        ## @MLX5_BFREGS_PER_UAR
	.comm	_GFP_KERNEL,4,2                 ## @GFP_KERNEL
	.comm	_MLX5_NON_FP_BFREGS_PER_UAR,4,2 ## @MLX5_NON_FP_BFREGS_PER_UAR
	.comm	_MLX5_FP_BFREGS_PER_UAR,4,2     ## @MLX5_FP_BFREGS_PER_UAR
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"mlx5_cmd_alloc_uar() failed, %d\n"

	.comm	_PAGE_SHIFT,4,2                 ## @PAGE_SHIFT
	.comm	_PAGE_SIZE,4,2                  ## @PAGE_SIZE
	.comm	_EAGAIN,4,2                     ## @EAGAIN
L_.str.1:                               ## @.str.1
	.asciz	"allocated UAR page: index %d, total bfregs %d\n"

L_.str.2:                               ## @.str.2
	.asciz	"failed to free uar index %d\n"

	.no_dead_strip	_alloc_uars_page
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function alloc_uars_page
_alloc_uars_page:                       ; @alloc_uars_page
	.cfi_startproc
; %bb.0:
	stp	x28, x27, [sp, #-96]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 96
	stp	x26, x25, [sp, #16]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #32]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #48]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #64]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #80]             ; 16-byte Folded Spill
	add	x29, sp, #80
	.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
	mov	x21, x1
	mov	x20, x0
Lloh0:
	adrp	x8, _ENOMEM@GOTPAGE
Lloh1:
	ldr	x8, [x8, _ENOMEM@GOTPAGEOFF]
Lloh2:
	ldr	w8, [x8]
	neg	w22, w8
	bl	_uars_per_sys_page
	mov	x23, x0
Lloh3:
	adrp	x24, _MLX5_BFREGS_PER_UAR@GOTPAGE
Lloh4:
	ldr	x24, [x24, _MLX5_BFREGS_PER_UAR@GOTPAGEOFF]
	ldr	w25, [x24]
Lloh5:
	adrp	x26, _GFP_KERNEL@GOTPAGE
Lloh6:
	ldr	x26, [x26, _GFP_KERNEL@GOTPAGEOFF]
	ldr	w1, [x26]
	mov	w0, #56
	bl	_kzalloc
	cbz	x0, LBB0_10
; %bb.1:
	mov	x19, x0
	mul	w23, w25, w23
	str	x20, [x0, #48]
	ldr	w1, [x26]
	mov	x0, x23
	bl	_bitmap_zalloc
	mov	x25, x19
	str	x0, [x25, #16]!
	cbz	x0, LBB0_9
; %bb.2:
	ldr	w1, [x26]
	mov	x0, x23
	bl	_bitmap_zalloc
	mov	x27, x19
	str	x0, [x27, #24]!
	cbz	x0, LBB0_9
; %bb.3:
Lloh7:
	adrp	x26, _MLX5_NON_FP_BFREGS_PER_UAR@GOTPAGE
Lloh8:
	ldr	x26, [x26, _MLX5_NON_FP_BFREGS_PER_UAR@GOTPAGEOFF]
	cmp	w23, #1
	b.lt	LBB0_6
; %bb.4:
	mov	w22, #0
LBB0_5:                                 ; =>This Inner Loop Header: Depth=1
	ldr	w8, [x24]
	sdiv	w9, w22, w8
	msub	w8, w9, w8, w22
	ldr	w9, [x26]
	cmp	w8, w9
	csel	x8, x25, x27, lt
	ldr	x1, [x8]
	mov	x0, x22
	bl	_set_bit
	add	w22, w22, #1
	cmp	w23, w22
	b.ne	LBB0_5
LBB0_6:
	str	w23, [x19]
Lloh9:
	adrp	x8, _MLX5_FP_BFREGS_PER_UAR@GOTPAGE
Lloh10:
	ldr	x8, [x8, _MLX5_FP_BFREGS_PER_UAR@GOTPAGEOFF]
Lloh11:
	ldr	w8, [x8]
	mul	w8, w8, w23
	ldr	w9, [x24]
	sdiv	w8, w8, w9
	ldr	w10, [x26]
	mul	w10, w10, w23
	sdiv	w9, w10, w9
	stp	w8, w9, [x19, #4]
	add	x23, x19, #12
	mov	x0, x20
	mov	x1, x23
	bl	_mlx5_cmd_alloc_uar
	cbz	w0, LBB0_11
; %bb.7:
	mov	x22, x0
Lloh12:
	adrp	x1, l_.str@PAGE
Lloh13:
	add	x1, x1, l_.str@PAGEOFF
	mov	x0, x20
	mov	x2, x22
LBB0_8:
	bl	_mlx5_core_warn
LBB0_9:
	ldr	x0, [x19, #24]
	bl	_bitmap_free
	ldr	x0, [x19, #16]
	bl	_bitmap_free
	mov	x0, x19
	bl	_kfree
LBB0_10:
	mov	x0, x22
	ldp	x29, x30, [sp, #80]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #64]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #48]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #32]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #16]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp], #96             ; 16-byte Folded Reload
	b	_ERR_PTR
LBB0_11:
	ldr	w1, [x23]
	mov	x0, x20
	bl	_uar2pfn
Lloh14:
	adrp	x8, _PAGE_SHIFT@GOTPAGE
Lloh15:
	ldr	x8, [x8, _PAGE_SHIFT@GOTPAGEOFF]
Lloh16:
	ldr	w8, [x8]
	lsl	w0, w0, w8
Lloh17:
	adrp	x8, _PAGE_SIZE@GOTPAGE
Lloh18:
	ldr	x8, [x8, _PAGE_SIZE@GOTPAGEOFF]
Lloh19:
	ldr	w1, [x8]
	cbz	w21, LBB0_14
; %bb.12:
	bl	_ioremap_wc
	str	x0, [x19, #40]
	cbnz	x0, LBB0_15
; %bb.13:
Lloh20:
	adrp	x8, _EAGAIN@GOTPAGE
Lloh21:
	ldr	x8, [x8, _EAGAIN@GOTPAGEOFF]
	b	LBB0_17
LBB0_14:
	bl	_ioremap
	str	x0, [x19, #40]
	cbz	x0, LBB0_16
LBB0_15:
	add	x0, x19, #32
	bl	_kref_init
	ldr	w2, [x19, #12]
	ldr	w3, [x19]
Lloh22:
	adrp	x1, l_.str.1@PAGE
Lloh23:
	add	x1, x1, l_.str.1@PAGEOFF
	mov	x0, x20
	bl	_mlx5_core_dbg
	mov	x0, x19
	ldp	x29, x30, [sp, #80]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #64]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #48]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #32]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #16]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp], #96             ; 16-byte Folded Reload
	ret
LBB0_16:
Lloh24:
	adrp	x8, _ENOMEM@GOTPAGE
Lloh25:
	ldr	x8, [x8, _ENOMEM@GOTPAGEOFF]
LBB0_17:
	ldr	w8, [x8]
	neg	w22, w8
	ldr	w1, [x23]
	mov	x0, x20
	bl	_mlx5_cmd_free_uar
	cbz	x0, LBB0_9
; %bb.18:
	ldr	w2, [x23]
Lloh26:
	adrp	x1, l_.str.2@PAGE
Lloh27:
	add	x1, x1, l_.str.2@PAGEOFF
	mov	x0, x20
	b	LBB0_8
	.loh AdrpLdrGot	Lloh5, Lloh6
	.loh AdrpLdrGot	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGot	Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpAdd	Lloh12, Lloh13
	.loh AdrpLdrGotLdr	Lloh17, Lloh18, Lloh19
	.loh AdrpLdrGotLdr	Lloh14, Lloh15, Lloh16
	.loh AdrpLdrGot	Lloh20, Lloh21
	.loh AdrpAdd	Lloh22, Lloh23
	.loh AdrpLdrGot	Lloh24, Lloh25
	.loh AdrpAdd	Lloh26, Lloh27
	.cfi_endproc
                                        ; -- End function
	.comm	_ENOMEM,4,2                     ; @ENOMEM
	.comm	_MLX5_BFREGS_PER_UAR,4,2        ; @MLX5_BFREGS_PER_UAR
	.comm	_GFP_KERNEL,4,2                 ; @GFP_KERNEL
	.comm	_MLX5_NON_FP_BFREGS_PER_UAR,4,2 ; @MLX5_NON_FP_BFREGS_PER_UAR
	.comm	_MLX5_FP_BFREGS_PER_UAR,4,2     ; @MLX5_FP_BFREGS_PER_UAR
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"mlx5_cmd_alloc_uar() failed, %d\n"

	.comm	_PAGE_SHIFT,4,2                 ; @PAGE_SHIFT
	.comm	_PAGE_SIZE,4,2                  ; @PAGE_SIZE
	.comm	_EAGAIN,4,2                     ; @EAGAIN
l_.str.1:                               ; @.str.1
	.asciz	"allocated UAR page: index %d, total bfregs %d\n"

l_.str.2:                               ; @.str.2
	.asciz	"failed to free uar index %d\n"

	.no_dead_strip	_alloc_uars_page
.subsections_via_symbols
