	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_cx25821_riscmem_alloc          ## -- Begin function cx25821_riscmem_alloc
	.p2align	4, 0x90
_cx25821_riscmem_alloc:                 ## @cx25821_riscmem_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
	subq	$16, %rsp
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movl	%edx, %r14d
	movq	%rsi, %rbx
	movq	%rdi, %r12
	movl	$0, -36(%rbp)
	movq	8(%rsi), %rdx
	testq	%rdx, %rdx
	je	LBB0_3
## %bb.1:
	movl	(%rbx), %esi
	xorl	%r15d, %r15d
	cmpl	%r14d, %esi
	jae	LBB0_6
## %bb.2:
	movl	4(%rbx), %ecx
	movq	%r12, %rdi
	callq	_pci_free_consistent
	cmpq	$0, 8(%rbx)
	jne	LBB0_6
LBB0_3:
	leaq	-36(%rbp), %rdx
	movq	%r12, %rdi
	movl	%r14d, %esi
	callq	_pci_zalloc_consistent
	testq	%rax, %rax
	je	LBB0_4
## %bb.5:
	movq	%rax, 8(%rbx)
	movl	-36(%rbp), %eax
	movl	%eax, 4(%rbx)
	movl	%r14d, (%rbx)
	xorl	%r15d, %r15d
	jmp	LBB0_6
LBB0_4:
	movq	_ENOMEM@GOTPCREL(%rip), %rax
	xorl	%r15d, %r15d
	subl	(%rax), %r15d
LBB0_6:
	movl	%r15d, %eax
	addq	$16, %rsp
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_ENOMEM,4,2                     ## @ENOMEM
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_cx25821_riscmem_alloc          ; -- Begin function cx25821_riscmem_alloc
	.p2align	2
_cx25821_riscmem_alloc:                 ; @cx25821_riscmem_alloc
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #64
	.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
	mov	x19, x2
	mov	x20, x1
	mov	x21, x0
	str	wzr, [sp, #12]
	ldr	x2, [x1, #8]
	cbz	x2, LBB0_4
; %bb.1:
	ldr	w1, [x20]
	cmp	w1, w19
	b.hs	LBB0_3
; %bb.2:
	ldr	w3, [x20, #4]
	mov	x0, x21
	bl	_pci_free_consistent
	ldr	x8, [x20, #8]
	cbz	x8, LBB0_4
LBB0_3:
	mov	w0, #0
	b	LBB0_7
LBB0_4:
	add	x2, sp, #12
	mov	x0, x21
	mov	x1, x19
	bl	_pci_zalloc_consistent
	cbz	x0, LBB0_6
; %bb.5:
	mov	x8, x0
	mov	w0, #0
	str	x8, [x20, #8]
	ldr	w8, [sp, #12]
	stp	w19, w8, [x20]
	b	LBB0_7
LBB0_6:
Lloh0:
	adrp	x8, _ENOMEM@GOTPAGE
Lloh1:
	ldr	x8, [x8, _ENOMEM@GOTPAGEOFF]
Lloh2:
	ldr	w8, [x8]
	neg	w0, w8
LBB0_7:
	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
	add	sp, sp, #64
	ret
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.cfi_endproc
                                        ; -- End function
	.comm	_ENOMEM,4,2                     ; @ENOMEM
.subsections_via_symbols
