	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function rockchip_gem_alloc_dma
_rockchip_gem_alloc_dma:                ## @rockchip_gem_alloc_dma
	.cfi_startproc
## %bb.0:
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset %rbp, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register %rbp
	pushq	%rbx
	pushq	%rax
	.cfi_offset %rbx, -24
	movq	%rdi, %rbx
	movq	24(%rdi), %rax
	movq	_DMA_ATTR_WRITE_COMBINE@GOTPCREL(%rip), %rcx
	movl	(%rcx), %r8d
	movl	%r8d, 4(%rdi)
	testl	%esi, %esi
	jne	LBB0_2
## %bb.1:
	movq	_DMA_ATTR_NO_KERNEL_MAPPING@GOTPCREL(%rip), %rcx
	orl	(%rcx), %r8d
	movl	%r8d, 4(%rbx)
LBB0_2:
	movl	(%rax), %edi
	movl	16(%rbx), %esi
	leaq	8(%rbx), %rdx
	movq	_GFP_KERNEL@GOTPCREL(%rip), %rax
	movl	(%rax), %ecx
	callq	_dma_alloc_attrs
	movl	%eax, %ecx
	movl	%eax, (%rbx)
	xorl	%eax, %eax
	testl	%ecx, %ecx
	jne	LBB0_4
## %bb.3:
	movl	16(%rbx), %esi
	leaq	L_.str(%rip), %rdi
	callq	_DRM_ERROR
	movq	_ENOMEM@GOTPCREL(%rip), %rcx
	xorl	%eax, %eax
	subl	(%rcx), %eax
LBB0_4:
	addq	$8, %rsp
	popq	%rbx
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_DMA_ATTR_WRITE_COMBINE,4,2     ## @DMA_ATTR_WRITE_COMBINE
	.comm	_DMA_ATTR_NO_KERNEL_MAPPING,4,2 ## @DMA_ATTR_NO_KERNEL_MAPPING
	.comm	_GFP_KERNEL,4,2                 ## @GFP_KERNEL
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"failed to allocate %zu byte dma buffer"

	.comm	_ENOMEM,4,2                     ## @ENOMEM
	.no_dead_strip	_rockchip_gem_alloc_dma
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function rockchip_gem_alloc_dma
_rockchip_gem_alloc_dma:                ; @rockchip_gem_alloc_dma
	.cfi_startproc
; %bb.0:
	stp	x20, x19, [sp, #-32]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 32
	stp	x29, x30, [sp, #16]             ; 16-byte Folded Spill
	add	x29, sp, #16
	.cfi_def_cfa w29, 16
	.cfi_offset w30, -8
	.cfi_offset w29, -16
	.cfi_offset w19, -24
	.cfi_offset w20, -32
	mov	x19, x0
	ldr	x8, [x0, #24]
Lloh0:
	adrp	x9, _DMA_ATTR_WRITE_COMBINE@GOTPAGE
Lloh1:
	ldr	x9, [x9, _DMA_ATTR_WRITE_COMBINE@GOTPAGEOFF]
Lloh2:
	ldr	w4, [x9]
	str	w4, [x0, #4]
	cbnz	w1, LBB0_2
; %bb.1:
Lloh3:
	adrp	x9, _DMA_ATTR_NO_KERNEL_MAPPING@GOTPAGE
Lloh4:
	ldr	x9, [x9, _DMA_ATTR_NO_KERNEL_MAPPING@GOTPAGEOFF]
Lloh5:
	ldr	w9, [x9]
	orr	w4, w9, w4
	str	w4, [x19, #4]
LBB0_2:
	ldr	w0, [x8]
	ldr	w1, [x19, #16]
	add	x2, x19, #8
Lloh6:
	adrp	x8, _GFP_KERNEL@GOTPAGE
Lloh7:
	ldr	x8, [x8, _GFP_KERNEL@GOTPAGEOFF]
Lloh8:
	ldr	w3, [x8]
	bl	_dma_alloc_attrs
	str	w0, [x19]
	cbz	w0, LBB0_4
; %bb.3:
	mov	w0, #0
	b	LBB0_5
LBB0_4:
	ldr	w1, [x19, #16]
Lloh9:
	adrp	x0, l_.str@PAGE
Lloh10:
	add	x0, x0, l_.str@PAGEOFF
	bl	_DRM_ERROR
Lloh11:
	adrp	x8, _ENOMEM@GOTPAGE
Lloh12:
	ldr	x8, [x8, _ENOMEM@GOTPAGEOFF]
Lloh13:
	ldr	w8, [x8]
	neg	w0, w8
LBB0_5:
	ldp	x29, x30, [sp, #16]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp], #32             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.loh AdrpAdd	Lloh9, Lloh10
	.cfi_endproc
                                        ; -- End function
	.comm	_DMA_ATTR_WRITE_COMBINE,4,2     ; @DMA_ATTR_WRITE_COMBINE
	.comm	_DMA_ATTR_NO_KERNEL_MAPPING,4,2 ; @DMA_ATTR_NO_KERNEL_MAPPING
	.comm	_GFP_KERNEL,4,2                 ; @GFP_KERNEL
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"failed to allocate %zu byte dma buffer"

	.comm	_ENOMEM,4,2                     ; @ENOMEM
	.no_dead_strip	_rockchip_gem_alloc_dma
.subsections_via_symbols
