	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_dma_alloc_from_coherent        ## -- Begin function dma_alloc_from_coherent
	.p2align	4, 0x90
_dma_alloc_from_coherent:               ## @dma_alloc_from_coherent
	.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	%rcx, %r14
	movq	%rdx, %r15
	movl	%esi, %r13d
	movq	%rdi, %rbx
	movl	%esi, %edi
	callq	_get_order
	movl	%eax, %r12d
	xorl	%eax, %eax
	testq	%rbx, %rbx
	je	LBB0_6
## %bb.1:
	movq	(%rbx), %rbx
	testq	%rbx, %rbx
	je	LBB0_6
## %bb.2:
	movq	$0, (%r14)
	movl	(%rbx), %eax
	movq	_PAGE_SHIFT@GOTPCREL(%rip), %rcx
	movb	(%rcx), %cl
	shll	%cl, %eax
	xorl	%edi, %edi
	cmpl	%r13d, %eax
	setl	%dil
	callq	_unlikely
	testq	%rax, %rax
	jne	LBB0_5
## %bb.3:
	movl	(%rbx), %esi
	movl	24(%rbx), %edi
	movl	%r12d, %edx
	callq	_bitmap_find_free_region
	movl	%eax, %r12d
	movl	%eax, %edi
	shrl	$31, %edi
	callq	_unlikely
	testq	%rax, %rax
	je	LBB0_4
LBB0_5:
	movq	_DMA_MEMORY_EXCLUSIVE@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	andl	4(%rbx), %eax
LBB0_6:
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_4:
	movq	_PAGE_SHIFT@GOTPCREL(%rip), %rax
	movb	(%rax), %cl
	shll	%cl, %r12d
	movslq	%r12d, %rdi
	movq	16(%rbx), %rax
	addq	%rdi, %rax
	movq	%rax, (%r15)
	addq	8(%rbx), %rdi
	movq	%rdi, (%r14)
	xorl	%esi, %esi
	movl	%r13d, %edx
	callq	_memset
	movl	$1, %eax
	jmp	LBB0_6
	.cfi_endproc
                                        ## -- End function
	.comm	_PAGE_SHIFT,4,2                 ## @PAGE_SHIFT
	.comm	_DMA_MEMORY_EXCLUSIVE,4,2       ## @DMA_MEMORY_EXCLUSIVE
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_dma_alloc_from_coherent        ; -- Begin function dma_alloc_from_coherent
	.p2align	2
_dma_alloc_from_coherent:               ; @dma_alloc_from_coherent
	.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, x3
	mov	x21, x2
	mov	x19, x1
	mov	x23, x0
	mov	x0, x1
	bl	_get_order
	cbz	x23, LBB0_5
; %bb.1:
	ldr	x23, [x23]
	cbz	x23, LBB0_5
; %bb.2:
	mov	x22, x0
	str	xzr, [x20]
	ldr	w8, [x23]
Lloh0:
	adrp	x24, _PAGE_SHIFT@GOTPAGE
Lloh1:
	ldr	x24, [x24, _PAGE_SHIFT@GOTPAGEOFF]
	ldr	w9, [x24]
	lsl	w8, w8, w9
	cmp	w8, w19
	cset	w0, lt
	bl	_unlikely
	cbnz	x0, LBB0_4
; %bb.3:
	ldr	w0, [x23, #24]
	ldr	w1, [x23]
	mov	x2, x22
	bl	_bitmap_find_free_region
	mov	x22, x0
	lsr	w0, w0, #31
	bl	_unlikely
	cbz	x0, LBB0_7
LBB0_4:
	ldr	w8, [x23, #4]
Lloh2:
	adrp	x9, _DMA_MEMORY_EXCLUSIVE@GOTPAGE
Lloh3:
	ldr	x9, [x9, _DMA_MEMORY_EXCLUSIVE@GOTPAGEOFF]
Lloh4:
	ldr	w9, [x9]
	and	w0, w9, w8
	b	LBB0_6
LBB0_5:
	mov	w0, #0
LBB0_6:
	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
LBB0_7:
	ldr	w8, [x24]
	lsl	w8, w22, w8
	sxtw	x8, w8
	ldp	x10, x9, [x23, #8]
	add	x9, x9, x8
	str	x9, [x21]
	add	x0, x10, x8
	str	x0, [x20]
	mov	w1, #0
	mov	x2, x19
	bl	_memset
	mov	w0, #1
	b	LBB0_6
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.cfi_endproc
                                        ; -- End function
	.comm	_PAGE_SHIFT,4,2                 ; @PAGE_SHIFT
	.comm	_DMA_MEMORY_EXCLUSIVE,4,2       ; @DMA_MEMORY_EXCLUSIVE
.subsections_via_symbols
