	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_v3d_gem_init                   ## -- Begin function v3d_gem_init
	.p2align	4, 0x90
_v3d_gem_init:                          ## @v3d_gem_init
	.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	%r12
	pushq	%rbx
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	callq	_to_v3d_dev
	movq	%rax, %r14
	movq	%rax, %r12
	movq	_V3D_MAX_QUEUES@GOTPCREL(%rip), %r15
	cmpl	$0, (%r15)
	jle	LBB0_3
## %bb.1:
	xorl	%ebx, %ebx
	.p2align	4, 0x90
LBB0_2:                                 ## =>This Inner Loop Header: Depth=1
	movl	$1, %edi
	callq	_dma_fence_context_alloc
	movq	48(%r12), %rcx
	movl	%eax, (%rcx,%rbx,4)
	incq	%rbx
	movslq	(%r15), %rax
	cmpq	%rax, %rbx
	jl	LBB0_2
LBB0_3:
	leaq	44(%r14), %rdi
	callq	_spin_lock_init
	leaq	40(%r14), %rdi
	callq	_spin_lock_init
	leaq	36(%r14), %rdi
	callq	_mutex_init
	leaq	32(%r14), %rdi
	callq	_mutex_init
	leaq	28(%r14), %rdi
	callq	_mutex_init
	leaq	24(%r14), %rdi
	callq	_mutex_init
	addq	$20, %r14
	movq	%r14, %rdi
	movl	$1, %esi
	movl	$1048575, %edx                  ## imm = 0xFFFFF
	callq	_drm_mm_init
	movq	_GFP_KERNEL@GOTPCREL(%rip), %rax
	movq	___GFP_NOWARN@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	orl	(%rax), %ecx
	movl	16(%r12), %edi
	movq	___GFP_ZERO@GOTPCREL(%rip), %rax
	orl	(%rax), %ecx
	movl	$4194304, %esi                  ## imm = 0x400000
	movq	%r12, %rdx
	callq	_dma_alloc_wc
	movq	%rax, 8(%r12)
	testq	%rax, %rax
	je	LBB0_4
## %bb.5:
	movq	%r12, %rdi
	callq	_v3d_init_hw_state
	movq	%r12, %rdi
	callq	_v3d_mmu_set_page_table
	movq	%r12, %rdi
	callq	_v3d_sched_init
	xorl	%r15d, %r15d
	testl	%eax, %eax
	je	LBB0_7
## %bb.6:
	movq	%r14, %rdi
	callq	_drm_mm_takedown
	movl	16(%r12), %edi
	movq	8(%r12), %rdx
	movl	(%r12), %ecx
	movl	$4194304, %esi                  ## imm = 0x400000
	callq	_dma_free_coherent
	jmp	LBB0_7
LBB0_4:
	movq	%r14, %rdi
	callq	_drm_mm_takedown
	movl	16(%r12), %edi
	leaq	L_.str(%rip), %rsi
	callq	_dev_err
	movq	_ENOMEM@GOTPCREL(%rip), %rax
	xorl	%r15d, %r15d
	subl	(%rax), %r15d
LBB0_7:
	movl	%r15d, %eax
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_V3D_MAX_QUEUES,4,2             ## @V3D_MAX_QUEUES
	.comm	_GFP_KERNEL,4,2                 ## @GFP_KERNEL
	.comm	___GFP_NOWARN,4,2               ## @__GFP_NOWARN
	.comm	___GFP_ZERO,4,2                 ## @__GFP_ZERO
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Failed to allocate page tables. Please ensure you have CMA enabled.\n"

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

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_v3d_gem_init                   ; -- Begin function v3d_gem_init
	.p2align	2
_v3d_gem_init:                          ; @v3d_gem_init
	.cfi_startproc
; %bb.0:
	stp	x22, x21, [sp, #-48]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 48
	stp	x20, x19, [sp, #16]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #32]             ; 16-byte Folded Spill
	add	x29, sp, #32
	.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
	bl	_to_v3d_dev
	mov	x19, x0
Lloh0:
	adrp	x20, _V3D_MAX_QUEUES@GOTPAGE
Lloh1:
	ldr	x20, [x20, _V3D_MAX_QUEUES@GOTPAGEOFF]
	ldr	w8, [x20]
	cmp	w8, #1
	b.lt	LBB0_3
; %bb.1:
	mov	x21, #0
LBB0_2:                                 ; =>This Inner Loop Header: Depth=1
	mov	w0, #1
	bl	_dma_fence_context_alloc
	ldr	x8, [x19, #48]
	str	w0, [x8, x21, lsl #2]
	add	x21, x21, #1
	ldrsw	x8, [x20]
	cmp	x21, x8
	b.lt	LBB0_2
LBB0_3:
	add	x0, x19, #44
	bl	_spin_lock_init
	add	x0, x19, #40
	bl	_spin_lock_init
	add	x0, x19, #36
	bl	_mutex_init
	add	x0, x19, #32
	bl	_mutex_init
	add	x0, x19, #28
	bl	_mutex_init
	add	x0, x19, #24
	bl	_mutex_init
	add	x20, x19, #20
	mov	x0, x20
	mov	w1, #1
	mov	w2, #1048575
	bl	_drm_mm_init
	ldr	w0, [x19, #16]
Lloh2:
	adrp	x8, _GFP_KERNEL@GOTPAGE
Lloh3:
	ldr	x8, [x8, _GFP_KERNEL@GOTPAGEOFF]
Lloh4:
	ldr	w8, [x8]
Lloh5:
	adrp	x9, ___GFP_NOWARN@GOTPAGE
Lloh6:
	ldr	x9, [x9, ___GFP_NOWARN@GOTPAGEOFF]
Lloh7:
	ldr	w9, [x9]
	orr	w8, w9, w8
Lloh8:
	adrp	x9, ___GFP_ZERO@GOTPAGE
Lloh9:
	ldr	x9, [x9, ___GFP_ZERO@GOTPAGEOFF]
Lloh10:
	ldr	w9, [x9]
	orr	w3, w8, w9
	mov	w1, #4194304
	mov	x2, x19
	bl	_dma_alloc_wc
	str	x0, [x19, #8]
	cbz	x0, LBB0_6
; %bb.4:
	mov	x0, x19
	bl	_v3d_init_hw_state
	mov	x0, x19
	bl	_v3d_mmu_set_page_table
	mov	x0, x19
	bl	_v3d_sched_init
	cbz	w0, LBB0_7
; %bb.5:
	mov	x0, x20
	bl	_drm_mm_takedown
	ldr	w0, [x19, #16]
	ldr	x2, [x19, #8]
	ldr	w3, [x19]
	mov	w1, #4194304
	bl	_dma_free_coherent
	mov	w0, #0
	b	LBB0_7
LBB0_6:
	mov	x0, x20
	bl	_drm_mm_takedown
	ldr	w0, [x19, #16]
Lloh11:
	adrp	x1, l_.str@PAGE
Lloh12:
	add	x1, x1, l_.str@PAGEOFF
	bl	_dev_err
Lloh13:
	adrp	x8, _ENOMEM@GOTPAGE
Lloh14:
	ldr	x8, [x8, _ENOMEM@GOTPAGEOFF]
Lloh15:
	ldr	w8, [x8]
	neg	w0, w8
LBB0_7:
	ldp	x29, x30, [sp, #32]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #16]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp], #48             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh13, Lloh14, Lloh15
	.loh AdrpAdd	Lloh11, Lloh12
	.cfi_endproc
                                        ; -- End function
	.comm	_V3D_MAX_QUEUES,4,2             ; @V3D_MAX_QUEUES
	.comm	_GFP_KERNEL,4,2                 ; @GFP_KERNEL
	.comm	___GFP_NOWARN,4,2               ; @__GFP_NOWARN
	.comm	___GFP_ZERO,4,2                 ; @__GFP_ZERO
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Failed to allocate page tables. Please ensure you have CMA enabled.\n"

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