	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_pvrdma_uar_alloc               ## -- Begin function pvrdma_uar_alloc
	.p2align	4, 0x90
_pvrdma_uar_alloc:                      ## @pvrdma_uar_alloc
	.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, %r14
	movq	%rdi, %rbx
	leaq	16(%rdi), %r15
	movq	%r15, %rdi
	callq	_spin_lock_irqsave
	movl	4(%rbx), %esi
	movl	20(%rbx), %edi
	movl	24(%rbx), %edx
	callq	_find_next_zero_bit
	movl	4(%rbx), %esi
	cmpl	%esi, %eax
	jge	LBB0_2
## %bb.1:
	movl	%eax, %r12d
	cmpl	%esi, %r12d
	jl	LBB0_5
LBB0_4:
	movq	%r15, %rdi
	callq	_spin_unlock_irqrestore
	movq	_ENOMEM@GOTPCREL(%rip), %rcx
	xorl	%eax, %eax
	subl	(%rcx), %eax
	jmp	LBB0_6
LBB0_2:
	movl	8(%rbx), %eax
	addl	%esi, %eax
	andl	12(%rbx), %eax
	movl	%eax, 8(%rbx)
	movl	20(%rbx), %edi
	callq	_find_first_zero_bit
	movl	%eax, %r12d
	movl	4(%rbx), %esi
	cmpl	%esi, %r12d
	jge	LBB0_4
LBB0_5:
	movl	20(%rbx), %esi
	movl	%r12d, %edi
	callq	_set_bit
	orl	8(%rbx), %r12d
	movq	%r15, %rdi
	callq	_spin_unlock_irqrestore
	movl	%r12d, (%r14)
	movl	(%rbx), %edi
	movq	_PVRDMA_PCI_RESOURCE_UAR@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	callq	_pci_resource_start
	movq	_PAGE_SHIFT@GOTPCREL(%rip), %rcx
	movb	(%rcx), %cl
	sarl	%cl, %eax
	addl	(%r14), %eax
	movl	%eax, 4(%r14)
	xorl	%eax, %eax
LBB0_6:
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_ENOMEM,4,2                     ## @ENOMEM
	.comm	_PVRDMA_PCI_RESOURCE_UAR,4,2    ## @PVRDMA_PCI_RESOURCE_UAR
	.comm	_PAGE_SHIFT,4,2                 ## @PAGE_SHIFT
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_pvrdma_uar_alloc               ; -- Begin function pvrdma_uar_alloc
	.p2align	2
_pvrdma_uar_alloc:                      ; @pvrdma_uar_alloc
	.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	x19, x1
	mov	x20, x0
	add	x21, x0, #16
	mov	x0, x21
	bl	_spin_lock_irqsave
	ldr	w1, [x20, #4]
	ldp	w0, w2, [x20, #20]
	bl	_find_next_zero_bit
	ldr	w1, [x20, #4]
	cmp	w0, w1
	b.ge	LBB0_3
; %bb.1:
	mov	x22, x0
	cmp	w22, w1
	b.lt	LBB0_4
LBB0_2:
	mov	x0, x21
	bl	_spin_unlock_irqrestore
Lloh0:
	adrp	x8, _ENOMEM@GOTPAGE
Lloh1:
	ldr	x8, [x8, _ENOMEM@GOTPAGEOFF]
Lloh2:
	ldr	w8, [x8]
	neg	w0, w8
	b	LBB0_5
LBB0_3:
	ldp	w8, w9, [x20, #8]
	add	w8, w8, w1
	and	w8, w8, w9
	str	w8, [x20, #8]
	ldr	w0, [x20, #20]
	bl	_find_first_zero_bit
	mov	x22, x0
	ldr	w1, [x20, #4]
	cmp	w22, w1
	b.ge	LBB0_2
LBB0_4:
	ldr	w1, [x20, #20]
	mov	x0, x22
	bl	_set_bit
	ldr	w8, [x20, #8]
	orr	w22, w8, w22
	mov	x0, x21
	bl	_spin_unlock_irqrestore
	str	w22, [x19]
	ldr	w0, [x20]
Lloh3:
	adrp	x8, _PVRDMA_PCI_RESOURCE_UAR@GOTPAGE
Lloh4:
	ldr	x8, [x8, _PVRDMA_PCI_RESOURCE_UAR@GOTPAGEOFF]
Lloh5:
	ldr	w1, [x8]
	bl	_pci_resource_start
	mov	x8, x0
	mov	w0, #0
Lloh6:
	adrp	x9, _PAGE_SHIFT@GOTPAGE
Lloh7:
	ldr	x9, [x9, _PAGE_SHIFT@GOTPAGEOFF]
Lloh8:
	ldr	w9, [x9]
	asr	w8, w8, w9
	ldr	w9, [x19]
	add	w8, w8, w9
	str	w8, [x19, #4]
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
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.cfi_endproc
                                        ; -- End function
	.comm	_ENOMEM,4,2                     ; @ENOMEM
	.comm	_PVRDMA_PCI_RESOURCE_UAR,4,2    ; @PVRDMA_PCI_RESOURCE_UAR
	.comm	_PAGE_SHIFT,4,2                 ; @PAGE_SHIFT
.subsections_via_symbols
