	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_dma_alloc_coherent             ## -- Begin function dma_alloc_coherent
	.p2align	4, 0x90
_dma_alloc_coherent:                    ## @dma_alloc_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	___GFP_DMA@GOTPCREL(%rip), %rax
	movq	___GFP_HIGHMEM@GOTPCREL(%rip), %rbx
	movl	(%rbx), %ebx
	orl	(%rax), %ebx
	movq	%rdx, %r14
	movq	%rsi, %r15
	notl	%ebx
	andl	%ecx, %ebx
	testq	%rdi, %rdi
	je	LBB0_2
## %bb.1:
	cmpl	$-1, (%rdi)
	je	LBB0_3
LBB0_2:
	movq	_GFP_DMA@GOTPCREL(%rip), %rax
	orl	(%rax), %ebx
LBB0_3:
	movq	%r15, %rdi
	callq	_get_order
	movl	%ebx, %edi
	movl	%eax, %esi
	callq	___get_free_pages
	testq	%rax, %rax
	je	LBB0_4
## %bb.5:
	movq	%rax, %r12
	movq	_XCHAL_KSEG_CACHED_VADDR@GOTPCREL(%rip), %r13
	movq	(%r13), %rax
	cmpq	%rax, %r12
	jb	LBB0_7
## %bb.6:
	movq	_XCHAL_KSEG_SIZE@GOTPCREL(%rip), %rcx
	addq	(%rcx), %rax
	cmpq	%rax, %r12
	jb	LBB0_8
LBB0_7:
	xorl	%eax, %eax
	callq	_BUG
LBB0_8:
	movq	%r12, %rdi
	xorl	%esi, %esi
	movq	%r15, %rdx
	callq	_memset
	movq	_XCHAL_KSEG_BYPASS_VADDR@GOTPCREL(%rip), %rax
	movq	(%rax), %rbx
	addq	%r12, %rbx
	subq	(%r13), %rbx
	movq	%r12, %rdi
	callq	_virt_to_bus
	movl	%eax, (%r14)
	movq	%r12, %rdi
	movq	%r15, %rsi
	callq	___flush_invalidate_dcache_range
	jmp	LBB0_9
LBB0_4:
	xorl	%ebx, %ebx
LBB0_9:
	movq	%rbx, %rax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	___GFP_DMA,4,2                  ## @__GFP_DMA
	.comm	___GFP_HIGHMEM,4,2              ## @__GFP_HIGHMEM
	.comm	_GFP_DMA,4,2                    ## @GFP_DMA
	.comm	_XCHAL_KSEG_CACHED_VADDR,8,3    ## @XCHAL_KSEG_CACHED_VADDR
	.comm	_XCHAL_KSEG_SIZE,8,3            ## @XCHAL_KSEG_SIZE
	.comm	_XCHAL_KSEG_BYPASS_VADDR,8,3    ## @XCHAL_KSEG_BYPASS_VADDR
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_dma_alloc_coherent             ; -- Begin function dma_alloc_coherent
	.p2align	2
_dma_alloc_coherent:                    ; @dma_alloc_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, x2
	mov	x19, x1
Lloh0:
	adrp	x8, ___GFP_DMA@GOTPAGE
Lloh1:
	ldr	x8, [x8, ___GFP_DMA@GOTPAGEOFF]
Lloh2:
	ldr	w8, [x8]
Lloh3:
	adrp	x9, ___GFP_HIGHMEM@GOTPAGE
Lloh4:
	ldr	x9, [x9, ___GFP_HIGHMEM@GOTPAGEOFF]
Lloh5:
	ldr	w9, [x9]
	orr	w8, w9, w8
	bic	w21, w3, w8
	cbz	x0, LBB0_2
; %bb.1:
	ldr	w8, [x0]
	cmn	w8, #1
	b.eq	LBB0_3
LBB0_2:
Lloh6:
	adrp	x8, _GFP_DMA@GOTPAGE
Lloh7:
	ldr	x8, [x8, _GFP_DMA@GOTPAGEOFF]
Lloh8:
	ldr	w8, [x8]
	orr	w21, w8, w21
LBB0_3:
	mov	x0, x19
	bl	_get_order
	mov	x1, x0
	mov	x0, x21
	bl	___get_free_pages
	cbz	x0, LBB0_8
; %bb.4:
	mov	x21, x0
Lloh9:
	adrp	x22, _XCHAL_KSEG_CACHED_VADDR@GOTPAGE
Lloh10:
	ldr	x22, [x22, _XCHAL_KSEG_CACHED_VADDR@GOTPAGEOFF]
	ldr	x8, [x22]
	cmp	x0, x8
	b.lo	LBB0_6
; %bb.5:
Lloh11:
	adrp	x9, _XCHAL_KSEG_SIZE@GOTPAGE
Lloh12:
	ldr	x9, [x9, _XCHAL_KSEG_SIZE@GOTPAGEOFF]
Lloh13:
	ldr	x9, [x9]
	add	x8, x9, x8
	cmp	x21, x8
	b.lo	LBB0_7
LBB0_6:
	bl	_BUG
LBB0_7:
	mov	x0, x21
	mov	w1, #0
	mov	x2, x19
	bl	_memset
Lloh14:
	adrp	x8, _XCHAL_KSEG_BYPASS_VADDR@GOTPAGE
Lloh15:
	ldr	x8, [x8, _XCHAL_KSEG_BYPASS_VADDR@GOTPAGEOFF]
Lloh16:
	ldr	x23, [x8]
	ldr	x22, [x22]
	mov	x0, x21
	bl	_virt_to_bus
	str	w0, [x20]
	mov	x0, x21
	mov	x1, x19
	bl	___flush_invalidate_dcache_range
	add	x8, x23, x21
	sub	x0, x8, x22
LBB0_8:
	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	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGot	Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.loh AdrpLdrGotLdr	Lloh14, Lloh15, Lloh16
	.cfi_endproc
                                        ; -- End function
	.comm	___GFP_DMA,4,2                  ; @__GFP_DMA
	.comm	___GFP_HIGHMEM,4,2              ; @__GFP_HIGHMEM
	.comm	_GFP_DMA,4,2                    ; @GFP_DMA
	.comm	_XCHAL_KSEG_CACHED_VADDR,8,3    ; @XCHAL_KSEG_CACHED_VADDR
	.comm	_XCHAL_KSEG_SIZE,8,3            ; @XCHAL_KSEG_SIZE
	.comm	_XCHAL_KSEG_BYPASS_VADDR,8,3    ; @XCHAL_KSEG_BYPASS_VADDR
.subsections_via_symbols
