	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function alloc_coherent
_alloc_coherent:                        ## @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
	subq	$40, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movl	%ecx, %ebx
	movq	%rdx, %r12
	movq	%rsi, %r15
	movq	%rdi, %r13
	movq	8(%rdi), %r14
	movq	_cnt_alloc_coherent@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	callq	_INC_STATS_COUNTER
	movq	%r13, %rdi
	callq	_check_device
	testl	%eax, %eax
	je	LBB0_13
## %bb.1:
	leaq	-56(%rbp), %rsi
	leaq	-48(%rbp), %rdx
	leaq	-68(%rbp), %rcx
	movq	%r13, %rdi
	callq	_get_device_resources
	testl	%eax, %eax
	movq	%r12, -64(%rbp)                 ## 8-byte Spill
	jne	LBB0_3
## %bb.2:
	movq	___GFP_DMA@GOTPCREL(%rip), %rax
	movq	___GFP_HIGHMEM@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	orl	(%rax), %ecx
	movq	___GFP_DMA32@GOTPCREL(%rip), %rax
	orl	(%rax), %ecx
	notl	%ecx
	andl	%ecx, %ebx
LBB0_3:
	movq	___GFP_ZERO@GOTPCREL(%rip), %rax
	orl	(%rax), %ebx
	movq	%r15, %rdi
	callq	_get_order
	movl	%ebx, %edi
	movl	%eax, %esi
	callq	___get_free_pages
	testq	%rax, %rax
	je	LBB0_13
## %bb.4:
	movq	%rax, %r12
	movq	%rax, %rdi
	callq	_virt_to_phys
	movq	%rax, %rbx
	cmpq	$0, -56(%rbp)
	je	LBB0_6
## %bb.5:
	movq	-48(%rbp), %rdi
	testq	%rdi, %rdi
	je	LBB0_6
## %bb.7:
	callq	_dma_ops_domain
	testl	%eax, %eax
	je	LBB0_12
## %bb.8:
	testq	%r14, %r14
	jne	LBB0_10
## %bb.9:
	movq	(%r13), %rax
	movq	(%rax), %r14
LBB0_10:
	movq	-48(%rbp), %rdi
	callq	_spin_lock_irqsave
	movq	-56(%rbp), %rsi
	movq	-48(%rbp), %rax
	movl	4(%rax), %edx
	movq	_DMA_BIDIRECTIONAL@GOTPCREL(%rip), %rax
	movl	(%rax), %r9d
	movq	%r13, %rdi
	movq	%rbx, %rcx
	movq	%r15, %r8
	pushq	%r14
	pushq	$1
	callq	___map_single
	addq	$16, %rsp
	movq	-64(%rbp), %rcx                 ## 8-byte Reload
	movq	%rax, (%rcx)
	movq	_bad_dma_address@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jne	LBB0_15
## %bb.11:
	movq	-48(%rbp), %rdi
	callq	_spin_unlock_irqrestore
LBB0_12:
	movq	%r15, %rdi
	callq	_get_order
	movq	%r12, %rdi
	movl	%eax, %esi
	callq	_free_pages
LBB0_13:
	xorl	%r12d, %r12d
	jmp	LBB0_14
LBB0_6:
	movq	-64(%rbp), %rax                 ## 8-byte Reload
	movq	%rbx, (%rax)
	jmp	LBB0_14
LBB0_15:
	movq	-56(%rbp), %rdi
	callq	_iommu_completion_wait
	movq	-48(%rbp), %rdi
	callq	_spin_unlock_irqrestore
LBB0_14:
	movq	%r12, %rax
	addq	$40, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_cnt_alloc_coherent,4,2         ## @cnt_alloc_coherent
	.comm	___GFP_DMA,4,2                  ## @__GFP_DMA
	.comm	___GFP_HIGHMEM,4,2              ## @__GFP_HIGHMEM
	.comm	___GFP_DMA32,4,2                ## @__GFP_DMA32
	.comm	___GFP_ZERO,4,2                 ## @__GFP_ZERO
	.comm	_DMA_BIDIRECTIONAL,4,2          ## @DMA_BIDIRECTIONAL
	.comm	_bad_dma_address,8,3            ## @bad_dma_address
	.no_dead_strip	_alloc_coherent
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function alloc_coherent
_alloc_coherent:                        ; @alloc_coherent
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #96
	.cfi_def_cfa_offset 96
	stp	x24, x23, [sp, #32]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #48]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #64]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #80]             ; 16-byte Folded Spill
	add	x29, sp, #80
	.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	x23, x3
	mov	x20, x2
	mov	x19, x1
	mov	x22, x0
	ldr	x21, [x0, #8]
Lloh0:
	adrp	x8, _cnt_alloc_coherent@GOTPAGE
Lloh1:
	ldr	x8, [x8, _cnt_alloc_coherent@GOTPAGEOFF]
Lloh2:
	ldr	w0, [x8]
	bl	_INC_STATS_COUNTER
	mov	x0, x22
	bl	_check_device
	cbz	w0, LBB0_12
; %bb.1:
	add	x1, sp, #24
	add	x2, sp, #16
	add	x3, sp, #12
	mov	x0, x22
	bl	_get_device_resources
	cbnz	w0, LBB0_3
; %bb.2:
Lloh3:
	adrp	x8, ___GFP_DMA@GOTPAGE
Lloh4:
	ldr	x8, [x8, ___GFP_DMA@GOTPAGEOFF]
Lloh5:
	ldr	w8, [x8]
Lloh6:
	adrp	x9, ___GFP_HIGHMEM@GOTPAGE
Lloh7:
	ldr	x9, [x9, ___GFP_HIGHMEM@GOTPAGEOFF]
Lloh8:
	ldr	w9, [x9]
	orr	w8, w9, w8
Lloh9:
	adrp	x9, ___GFP_DMA32@GOTPAGE
Lloh10:
	ldr	x9, [x9, ___GFP_DMA32@GOTPAGEOFF]
Lloh11:
	ldr	w9, [x9]
	orr	w8, w8, w9
	bic	w23, w23, w8
LBB0_3:
Lloh12:
	adrp	x8, ___GFP_ZERO@GOTPAGE
Lloh13:
	ldr	x8, [x8, ___GFP_ZERO@GOTPAGEOFF]
Lloh14:
	ldr	w8, [x8]
	orr	w23, w8, w23
	mov	x0, x19
	bl	_get_order
	mov	x1, x0
	mov	x0, x23
	bl	___get_free_pages
	mov	x23, x0
	cbz	x0, LBB0_15
; %bb.4:
	mov	x0, x23
	bl	_virt_to_phys
	mov	x24, x0
	ldr	x8, [sp, #24]
	cbz	x8, LBB0_13
; %bb.5:
	ldr	x0, [sp, #16]
	cbz	x0, LBB0_13
; %bb.6:
	bl	_dma_ops_domain
	cbz	w0, LBB0_11
; %bb.7:
	cbnz	x21, LBB0_9
; %bb.8:
	ldr	x8, [x22]
	ldr	x21, [x8]
LBB0_9:
	ldr	x0, [sp, #16]
	bl	_spin_lock_irqsave
	ldp	x8, x1, [sp, #16]
	ldr	w2, [x8, #4]
Lloh15:
	adrp	x8, _DMA_BIDIRECTIONAL@GOTPAGE
Lloh16:
	ldr	x8, [x8, _DMA_BIDIRECTIONAL@GOTPAGEOFF]
Lloh17:
	ldr	w5, [x8]
	mov	x0, x22
	mov	x3, x24
	mov	x4, x19
	mov	w6, #1
	mov	x7, x21
	bl	___map_single
	str	x0, [x20]
Lloh18:
	adrp	x8, _bad_dma_address@GOTPAGE
Lloh19:
	ldr	x8, [x8, _bad_dma_address@GOTPAGEOFF]
Lloh20:
	ldr	x8, [x8]
	cmp	x0, x8
	b.ne	LBB0_14
; %bb.10:
	ldr	x0, [sp, #16]
	bl	_spin_unlock_irqrestore
LBB0_11:
	mov	x0, x19
	bl	_get_order
	mov	x1, x0
	mov	x0, x23
	bl	_free_pages
LBB0_12:
	mov	x23, #0
	b	LBB0_15
LBB0_13:
	str	x24, [x20]
	b	LBB0_15
LBB0_14:
	ldr	x0, [sp, #24]
	bl	_iommu_completion_wait
	ldr	x0, [sp, #16]
	bl	_spin_unlock_irqrestore
LBB0_15:
	mov	x0, x23
	ldp	x29, x30, [sp, #80]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #64]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #48]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #32]             ; 16-byte Folded Reload
	add	sp, sp, #96
	ret
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh18, Lloh19, Lloh20
	.loh AdrpLdrGotLdr	Lloh15, Lloh16, Lloh17
	.cfi_endproc
                                        ; -- End function
	.comm	_cnt_alloc_coherent,4,2         ; @cnt_alloc_coherent
	.comm	___GFP_DMA,4,2                  ; @__GFP_DMA
	.comm	___GFP_HIGHMEM,4,2              ; @__GFP_HIGHMEM
	.comm	___GFP_DMA32,4,2                ; @__GFP_DMA32
	.comm	___GFP_ZERO,4,2                 ; @__GFP_ZERO
	.comm	_DMA_BIDIRECTIONAL,4,2          ; @DMA_BIDIRECTIONAL
	.comm	_bad_dma_address,8,3            ; @bad_dma_address
	.no_dead_strip	_alloc_coherent
.subsections_via_symbols
