	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function gart_alloc_coherent
_gart_alloc_coherent:                   ## @gart_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	%rdx, %r14
	movq	%rsi, %r15
	movq	%rdi, %r13
	movq	_force_iommu@GOTPCREL(%rip), %rax
	cmpq	$0, (%rax)
	je	LBB0_7
## %bb.1:
	movq	_GFP_DMA@GOTPCREL(%rip), %rax
	testl	%ecx, (%rax)
	je	LBB0_2
LBB0_7:
	movq	%r13, %rdi
	movq	%r15, %rsi
	movq	%r14, %rdx
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_dma_generic_alloc_coherent     ## TAILCALL
LBB0_2:
	movq	___GFP_DMA@GOTPCREL(%rip), %rax
	movq	___GFP_HIGHMEM@GOTPCREL(%rip), %rdx
	movl	(%rdx), %ebx
	orl	(%rax), %ebx
	movq	___GFP_DMA32@GOTPCREL(%rip), %rax
	orl	(%rax), %ebx
	notl	%ebx
	andl	%ecx, %ebx
	movq	___GFP_ZERO@GOTPCREL(%rip), %rax
	orl	(%rax), %ebx
	movq	%r15, %rdi
	callq	_get_order
	movl	%ebx, %edi
	movq	%rax, %rsi
	callq	_alloc_pages
	testq	%rax, %rax
	je	LBB0_5
## %bb.3:
	movq	%rax, %r12
	movq	%r15, %rdi
	callq	_get_order
	movq	$-1, %rbx
	movl	%eax, %ecx
	shlq	%cl, %rbx
	notq	%rbx
	movq	%r12, %rdi
	callq	_page_to_phys
	movq	_DMA_BIDIRECTIONAL@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	movq	%r13, %rdi
	movl	%eax, %esi
	movq	%r15, %rdx
	movq	%rbx, %r8
	callq	_dma_map_area
	movq	%rax, %rbx
	xorl	%eax, %eax
	callq	_flush_gart
	movq	_bad_dma_address@GOTPCREL(%rip), %rax
	cmpq	(%rax), %rbx
	jne	LBB0_6
## %bb.4:
	movq	%r15, %rdi
	callq	_get_order
	movq	%r12, %rdi
	movq	%rax, %rsi
	callq	___free_pages
LBB0_5:
	xorl	%eax, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_6:
	movq	%rbx, (%r14)
	movq	%r12, %rdi
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_page_address                   ## TAILCALL
	.cfi_endproc
                                        ## -- End function
	.comm	_force_iommu,8,3                ## @force_iommu
	.comm	_GFP_DMA,4,2                    ## @GFP_DMA
	.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	_gart_alloc_coherent
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function gart_alloc_coherent
_gart_alloc_coherent:                   ; @gart_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	x19, x2
	mov	x20, x1
	mov	x21, x0
Lloh0:
	adrp	x8, _force_iommu@GOTPAGE
Lloh1:
	ldr	x8, [x8, _force_iommu@GOTPAGEOFF]
Lloh2:
	ldr	x8, [x8]
	cbz	x8, LBB0_2
; %bb.1:
Lloh3:
	adrp	x8, _GFP_DMA@GOTPAGE
Lloh4:
	ldr	x8, [x8, _GFP_DMA@GOTPAGEOFF]
Lloh5:
	ldr	w8, [x8]
	tst	w8, w3
	b.eq	LBB0_3
LBB0_2:
	mov	x0, x21
	mov	x1, x20
	mov	x2, x19
	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
	b	_dma_generic_alloc_coherent
LBB0_3:
Lloh6:
	adrp	x8, ___GFP_DMA@GOTPAGE
Lloh7:
	ldr	x8, [x8, ___GFP_DMA@GOTPAGEOFF]
Lloh8:
	adrp	x9, ___GFP_HIGHMEM@GOTPAGE
Lloh9:
	ldr	x9, [x9, ___GFP_HIGHMEM@GOTPAGEOFF]
Lloh10:
	ldr	w8, [x8]
Lloh11:
	ldr	w9, [x9]
	orr	w8, w9, w8
Lloh12:
	adrp	x9, ___GFP_DMA32@GOTPAGE
Lloh13:
	ldr	x9, [x9, ___GFP_DMA32@GOTPAGEOFF]
Lloh14:
	ldr	w9, [x9]
	orr	w8, w8, w9
	bic	w8, w3, w8
Lloh15:
	adrp	x9, ___GFP_ZERO@GOTPAGE
Lloh16:
	ldr	x9, [x9, ___GFP_ZERO@GOTPAGEOFF]
Lloh17:
	ldr	w9, [x9]
	orr	w22, w8, w9
	mov	x0, x20
	bl	_get_order
	mov	x1, x0
	mov	x0, x22
	bl	_alloc_pages
	cbz	x0, LBB0_6
; %bb.4:
	mov	x22, x0
	mov	x0, x20
	bl	_get_order
	mov	x8, #-1
	lsl	x8, x8, x0
	mvn	x23, x8
	mov	x0, x22
	bl	_page_to_phys
	mov	x1, x0
Lloh18:
	adrp	x8, _DMA_BIDIRECTIONAL@GOTPAGE
Lloh19:
	ldr	x8, [x8, _DMA_BIDIRECTIONAL@GOTPAGEOFF]
Lloh20:
	ldr	w3, [x8]
	mov	x0, x21
	mov	x2, x20
	mov	x4, x23
	bl	_dma_map_area
	mov	x21, x0
	bl	_flush_gart
Lloh21:
	adrp	x8, _bad_dma_address@GOTPAGE
Lloh22:
	ldr	x8, [x8, _bad_dma_address@GOTPAGEOFF]
Lloh23:
	ldr	x8, [x8]
	cmp	x21, x8
	b.ne	LBB0_7
; %bb.5:
	mov	x0, x20
	bl	_get_order
	mov	x1, x0
	mov	x0, x22
	bl	___free_pages
LBB0_6:
	mov	x0, #0
	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:
	str	x21, [x19]
	mov	x0, x22
	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
	b	_page_address
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh15, Lloh16, Lloh17
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh11
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh10
	.loh AdrpLdrGotLdr	Lloh21, Lloh22, Lloh23
	.loh AdrpLdrGotLdr	Lloh18, Lloh19, Lloh20
	.cfi_endproc
                                        ; -- End function
	.comm	_force_iommu,8,3                ; @force_iommu
	.comm	_GFP_DMA,4,2                    ; @GFP_DMA
	.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	_gart_alloc_coherent
.subsections_via_symbols
