	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function msm_init_vram
_msm_init_vram:                         ## @msm_init_vram
	.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	$24, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdi, %r15
	movq	(%rdi), %rax
	movq	8(%rdi), %r14
	movl	(%rax), %edi
	leaq	L_.str(%rip), %rsi
	xorl	%r13d, %r13d
	xorl	%edx, %edx
	callq	_of_parse_phandle
	testq	%rax, %rax
	je	LBB0_3
## %bb.1:
	movq	%rax, %rbx
	leaq	-56(%rbp), %rdx
	movq	%rax, %rdi
	xorl	%esi, %esi
	callq	_of_address_to_resource
	movl	%eax, %r13d
	movq	%rbx, %rdi
	callq	_of_node_put
	testl	%r13d, %r13d
	jne	LBB0_10
## %bb.2:
	movq	-56(%rbp), %r12
	leaq	-48(%rbp), %rdx
	subq	-48(%rbp), %r12
	leaq	L_.str.1(%rip), %rdi
	movq	%r12, %rsi
	xorl	%eax, %eax
	callq	_DRM_INFO
	testq	%r12, %r12
	je	LBB0_6
LBB0_7:
	movq	%r12, (%r14)
	leaq	20(%r14), %rdi
	movq	_PAGE_SHIFT@GOTPCREL(%rip), %rax
	movb	(%rax), %cl
	movq	%r12, %rdx
	shrq	%cl, %rdx
	decq	%rdx
	xorl	%r13d, %r13d
	xorl	%esi, %esi
	callq	_drm_mm_init
	leaq	16(%r14), %rdi
	callq	_spin_lock_init
	movq	_DMA_ATTR_NO_KERNEL_MAPPING@GOTPCREL(%rip), %rax
	movq	_DMA_ATTR_WRITE_COMBINE@GOTPCREL(%rip), %rcx
	movq	(%rcx), %r8
	orq	(%rax), %r8
	movq	(%r15), %rdi
	addq	$8, %r14
	movq	_GFP_KERNEL@GOTPCREL(%rip), %rax
	movl	(%rax), %ecx
	movq	%r12, %rsi
	movq	%r14, %rdx
	callq	_dma_alloc_attrs
	movq	(%r15), %rdi
	testq	%rax, %rax
	je	LBB0_8
## %bb.9:
	movl	(%r14), %edx
	addl	%edx, %r12d
	leaq	L_.str.4(%rip), %rsi
	movl	%r12d, %ecx
	callq	_DRM_DEV_INFO
	jmp	LBB0_10
LBB0_3:
	movq	%r15, %rdi
	callq	_msm_use_mmu
	testl	%eax, %eax
	jne	LBB0_10
## %bb.4:
	movq	_vram@GOTPCREL(%rip), %rbx
	movslq	(%rbx), %rsi
	leaq	L_.str.2(%rip), %rdi
	xorl	%eax, %eax
	callq	_DRM_INFO
	movl	(%rbx), %edi
	xorl	%esi, %esi
	callq	_memparse
	movq	%rax, %r12
	testq	%r12, %r12
	jne	LBB0_7
LBB0_6:
	xorl	%r13d, %r13d
	jmp	LBB0_10
LBB0_8:
	leaq	L_.str.3(%rip), %rsi
	callq	_DRM_DEV_ERROR
	movq	$0, (%r14)
	movq	_ENOMEM@GOTPCREL(%rip), %rax
	xorl	%r13d, %r13d
	subl	(%rax), %r13d
LBB0_10:
	movl	%r13d, %eax
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"memory-region"

L_.str.1:                               ## @.str.1
	.asciz	"using VRAM carveout: %lx@%pa\n"

L_.str.2:                               ## @.str.2
	.asciz	"using %s VRAM carveout\n"

	.comm	_vram,4,2                       ## @vram
	.comm	_PAGE_SHIFT,8,3                 ## @PAGE_SHIFT
	.comm	_DMA_ATTR_NO_KERNEL_MAPPING,8,3 ## @DMA_ATTR_NO_KERNEL_MAPPING
	.comm	_DMA_ATTR_WRITE_COMBINE,8,3     ## @DMA_ATTR_WRITE_COMBINE
	.comm	_GFP_KERNEL,4,2                 ## @GFP_KERNEL
L_.str.3:                               ## @.str.3
	.asciz	"failed to allocate VRAM\n"

	.comm	_ENOMEM,4,2                     ## @ENOMEM
L_.str.4:                               ## @.str.4
	.asciz	"VRAM: %08x->%08x\n"

	.no_dead_strip	_msm_init_vram
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function msm_init_vram
_msm_init_vram:                         ; @msm_init_vram
	.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	x19, x0
	ldp	x8, x22, [x0]
	ldr	w0, [x8]
Lloh0:
	adrp	x1, l_.str@PAGE
Lloh1:
	add	x1, x1, l_.str@PAGEOFF
	mov	w2, #0
	bl	_of_parse_phandle
	cbz	x0, LBB0_3
; %bb.1:
	mov	x21, x0
	add	x23, sp, #16
	add	x2, sp, #16
	mov	w1, #0
	bl	_of_address_to_resource
	mov	x20, x0
	mov	x0, x21
	bl	_of_node_put
	cbnz	w20, LBB0_9
; %bb.2:
	add	x8, x23, #8
	ldp	x9, x10, [sp, #16]
	sub	x20, x9, x10
	str	x8, [sp]
Lloh2:
	adrp	x0, l_.str.1@PAGE
Lloh3:
	add	x0, x0, l_.str.1@PAGEOFF
	mov	x1, x20
	bl	_DRM_INFO
	cbnz	x20, LBB0_5
	b	LBB0_9
LBB0_3:
	mov	x0, x19
	bl	_msm_use_mmu
	cbnz	w0, LBB0_7
; %bb.4:
Lloh4:
	adrp	x20, _vram@GOTPAGE
Lloh5:
	ldr	x20, [x20, _vram@GOTPAGEOFF]
	ldrsw	x1, [x20]
Lloh6:
	adrp	x0, l_.str.2@PAGE
Lloh7:
	add	x0, x0, l_.str.2@PAGEOFF
	bl	_DRM_INFO
	ldr	w0, [x20]
	mov	x1, #0
	bl	_memparse
	mov	x20, x0
	cbz	x20, LBB0_9
LBB0_5:
	mov	x21, x22
	str	x20, [x21], #8
	add	x0, x22, #20
Lloh8:
	adrp	x8, _PAGE_SHIFT@GOTPAGE
Lloh9:
	ldr	x8, [x8, _PAGE_SHIFT@GOTPAGEOFF]
Lloh10:
	ldr	x8, [x8]
	lsr	x8, x20, x8
	sub	x2, x8, #1
	mov	w1, #0
	bl	_drm_mm_init
	add	x0, x22, #16
	bl	_spin_lock_init
Lloh11:
	adrp	x8, _DMA_ATTR_NO_KERNEL_MAPPING@GOTPAGE
Lloh12:
	ldr	x8, [x8, _DMA_ATTR_NO_KERNEL_MAPPING@GOTPAGEOFF]
Lloh13:
	ldr	x8, [x8]
Lloh14:
	adrp	x9, _DMA_ATTR_WRITE_COMBINE@GOTPAGE
Lloh15:
	ldr	x9, [x9, _DMA_ATTR_WRITE_COMBINE@GOTPAGEOFF]
Lloh16:
	ldr	x9, [x9]
	orr	x4, x9, x8
	ldr	x0, [x19]
Lloh17:
	adrp	x8, _GFP_KERNEL@GOTPAGE
Lloh18:
	ldr	x8, [x8, _GFP_KERNEL@GOTPAGEOFF]
Lloh19:
	ldr	w3, [x8]
	mov	x1, x20
	mov	x2, x21
	bl	_dma_alloc_attrs
	mov	x8, x0
	ldr	x0, [x19]
	cbz	x8, LBB0_8
; %bb.6:
	ldr	w2, [x21]
	add	w3, w2, w20
Lloh20:
	adrp	x1, l_.str.4@PAGE
Lloh21:
	add	x1, x1, l_.str.4@PAGEOFF
	bl	_DRM_DEV_INFO
LBB0_7:
	mov	w20, #0
	b	LBB0_9
LBB0_8:
Lloh22:
	adrp	x1, l_.str.3@PAGE
Lloh23:
	add	x1, x1, l_.str.3@PAGEOFF
	bl	_DRM_DEV_ERROR
	str	xzr, [x21]
Lloh24:
	adrp	x8, _ENOMEM@GOTPAGE
Lloh25:
	ldr	x8, [x8, _ENOMEM@GOTPAGEOFF]
Lloh26:
	ldr	w8, [x8]
	neg	w20, w8
LBB0_9:
	mov	x0, x20
	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 AdrpAdd	Lloh0, Lloh1
	.loh AdrpAdd	Lloh2, Lloh3
	.loh AdrpAdd	Lloh6, Lloh7
	.loh AdrpLdrGot	Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh17, Lloh18, Lloh19
	.loh AdrpLdrGotLdr	Lloh14, Lloh15, Lloh16
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpAdd	Lloh20, Lloh21
	.loh AdrpLdrGotLdr	Lloh24, Lloh25, Lloh26
	.loh AdrpAdd	Lloh22, Lloh23
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"memory-region"

l_.str.1:                               ; @.str.1
	.asciz	"using VRAM carveout: %lx@%pa\n"

l_.str.2:                               ; @.str.2
	.asciz	"using %s VRAM carveout\n"

	.comm	_vram,4,2                       ; @vram
	.comm	_PAGE_SHIFT,8,3                 ; @PAGE_SHIFT
	.comm	_DMA_ATTR_NO_KERNEL_MAPPING,8,3 ; @DMA_ATTR_NO_KERNEL_MAPPING
	.comm	_DMA_ATTR_WRITE_COMBINE,8,3     ; @DMA_ATTR_WRITE_COMBINE
	.comm	_GFP_KERNEL,4,2                 ; @GFP_KERNEL
l_.str.3:                               ; @.str.3
	.asciz	"failed to allocate VRAM\n"

	.comm	_ENOMEM,4,2                     ; @ENOMEM
l_.str.4:                               ; @.str.4
	.asciz	"VRAM: %08x->%08x\n"

	.no_dead_strip	_msm_init_vram
.subsections_via_symbols
