	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_ocrdma_alloc_av                ## -- Begin function ocrdma_alloc_av
	.p2align	4, 0x90
_ocrdma_alloc_av:                       ## @ocrdma_alloc_av
	.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
	pushq	%rax
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rsi, -48(%rbp)                 ## 8-byte Spill
	movq	%rdi, %rbx
	movq	_EINVAL@GOTPCREL(%rip), %rax
	xorl	%r12d, %r12d
	xorl	%r13d, %r13d
	subl	(%rax), %r13d
	movq	8(%rdi), %r15
	leaq	4(%rdi), %r14
	movq	%r14, %rdi
	callq	_spin_lock_irqsave
	movl	(%rbx), %eax
	xorl	%ecx, %ecx
	testl	%eax, %eax
	jle	LBB0_5
	.p2align	4, 0x90
LBB0_1:                                 ## =>This Inner Loop Header: Depth=1
	cmpq	$0, (%r15)
	je	LBB0_2
## %bb.3:                               ##   in Loop: Header=BB0_1 Depth=1
	addq	$8, %r15
	incl	%ecx
	cmpl	%ecx, %eax
	jne	LBB0_1
## %bb.4:
	movl	%eax, %ecx
	jmp	LBB0_5
LBB0_2:
	movq	_OCRDMA_AV_VALID@GOTPCREL(%rip), %rdx
	movq	(%rdx), %rdx
	movq	%rdx, (%r15)
	movq	-48(%rbp), %rdx                 ## 8-byte Reload
	movq	%r15, 8(%rdx)
	movl	%ecx, (%rdx)
	xorl	%r13d, %r13d
LBB0_5:
	movq	_EAGAIN@GOTPCREL(%rip), %rdx
	subl	(%rdx), %r12d
	cmpl	%eax, %ecx
	cmovnel	%r13d, %r12d
	movq	%r14, %rdi
	callq	_spin_unlock_irqrestore
	movl	%r12d, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_EINVAL,4,2                     ## @EINVAL
	.comm	_OCRDMA_AV_VALID,8,3            ## @OCRDMA_AV_VALID
	.comm	_EAGAIN,4,2                     ## @EAGAIN
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_ocrdma_alloc_av                ; -- Begin function ocrdma_alloc_av
	.p2align	2
_ocrdma_alloc_av:                       ; @ocrdma_alloc_av
	.cfi_startproc
; %bb.0:
	stp	x24, x23, [sp, #-64]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 64
	stp	x22, x21, [sp, #16]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #32]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #48]             ; 16-byte Folded Spill
	add	x29, sp, #48
	.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
	mov	x20, x1
	mov	x21, x0
Lloh0:
	adrp	x8, _EINVAL@GOTPAGE
Lloh1:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
Lloh2:
	ldr	w8, [x8]
	neg	w22, w8
	ldr	x23, [x0, #8]
	add	x19, x0, #4
	mov	x0, x19
	bl	_spin_lock_irqsave
	ldr	w8, [x21]
	cmp	w8, #1
	b.lt	LBB0_5
; %bb.1:
	mov	w9, #0
LBB0_2:                                 ; =>This Inner Loop Header: Depth=1
	ldr	x10, [x23]
	cbz	x10, LBB0_6
; %bb.3:                                ;   in Loop: Header=BB0_2 Depth=1
	add	x23, x23, #8
	add	w9, w9, #1
	cmp	w8, w9
	b.ne	LBB0_2
; %bb.4:
	mov	x9, x8
	b	LBB0_7
LBB0_5:
	mov	w9, #0
	b	LBB0_7
LBB0_6:
	mov	w22, #0
Lloh3:
	adrp	x10, _OCRDMA_AV_VALID@GOTPAGE
Lloh4:
	ldr	x10, [x10, _OCRDMA_AV_VALID@GOTPAGEOFF]
Lloh5:
	ldr	x10, [x10]
	str	x10, [x23]
	str	x23, [x20, #8]
	str	w9, [x20]
LBB0_7:
Lloh6:
	adrp	x10, _EAGAIN@GOTPAGE
Lloh7:
	ldr	x10, [x10, _EAGAIN@GOTPAGEOFF]
Lloh8:
	ldr	w10, [x10]
	cmp	w9, w8
	csneg	w20, w22, w10, ne
	mov	x0, x19
	bl	_spin_unlock_irqrestore
	mov	x0, x20
	ldp	x29, x30, [sp, #48]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #32]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #16]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp], #64             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.cfi_endproc
                                        ; -- End function
	.comm	_EINVAL,4,2                     ; @EINVAL
	.comm	_OCRDMA_AV_VALID,8,3            ; @OCRDMA_AV_VALID
	.comm	_EAGAIN,4,2                     ; @EAGAIN
.subsections_via_symbols
