	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_etnaviv_iommuv1_context_alloc  ## -- Begin function etnaviv_iommuv1_context_alloc
	.p2align	4, 0x90
_etnaviv_iommuv1_context_alloc:         ## @etnaviv_iommuv1_context_alloc
	.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	%rbx
	pushq	%rax
	.cfi_offset %rbx, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdi, %r14
	callq	_mutex_lock
	movq	8(%r14), %rbx
	testq	%rbx, %rbx
	je	LBB0_3
## %bb.1:
	movq	%rbx, %rdi
	callq	_etnaviv_iommu_context_get
LBB0_2:
	movq	%r14, %rdi
	callq	_mutex_unlock
	jmp	LBB0_9
LBB0_3:
	movq	_GFP_KERNEL@GOTPCREL(%rip), %r15
	movl	(%r15), %esi
	movl	$32, %edi
	callq	_kzalloc
	testq	%rax, %rax
	je	LBB0_4
## %bb.5:
	movq	%rax, %rbx
	movl	20(%r14), %edi
	movq	_PT_SIZE@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	leaq	28(%rbx), %rdx
	movl	(%r15), %ecx
	callq	_dma_alloc_wc
	movl	%eax, 24(%rbx)
	testl	%eax, %eax
	je	LBB0_7
## %bb.6:
	movl	16(%r14), %esi
	movq	_PT_ENTRIES@GOTPCREL(%rip), %r15
	movl	(%r15), %edx
	movl	%eax, %edi
	callq	_memset32
	movq	%r14, (%rbx)
	leaq	20(%rbx), %rdi
	callq	_kref_init
	leaq	16(%rbx), %rdi
	callq	_mutex_init
	leaq	12(%rbx), %rdi
	callq	_INIT_LIST_HEAD
	movq	%rbx, %rdi
	addq	$8, %rdi
	movq	_GPU_MEM_START@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	_SZ_4K@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	imull	(%r15), %edx
	callq	_drm_mm_init
	movq	(%rbx), %rax
	movq	%rbx, 8(%rax)
	jmp	LBB0_2
LBB0_4:
	movq	%r14, %rdi
	callq	_mutex_unlock
	jmp	LBB0_8
LBB0_7:
	movq	%r14, %rdi
	callq	_mutex_unlock
	movq	%rbx, %rdi
	callq	_kfree
LBB0_8:
	xorl	%ebx, %ebx
LBB0_9:
	movq	%rbx, %rax
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_GFP_KERNEL,4,2                 ## @GFP_KERNEL
	.comm	_PT_SIZE,4,2                    ## @PT_SIZE
	.comm	_PT_ENTRIES,4,2                 ## @PT_ENTRIES
	.comm	_GPU_MEM_START,4,2              ## @GPU_MEM_START
	.comm	_SZ_4K,4,2                      ## @SZ_4K
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_etnaviv_iommuv1_context_alloc  ; -- Begin function etnaviv_iommuv1_context_alloc
	.p2align	2
_etnaviv_iommuv1_context_alloc:         ; @etnaviv_iommuv1_context_alloc
	.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
	mov	x20, x0
	bl	_mutex_lock
	ldr	x19, [x20, #8]
	cbz	x19, LBB0_4
; %bb.1:
	mov	x0, x19
	bl	_etnaviv_iommu_context_get
LBB0_2:
	mov	x0, x20
	bl	_mutex_unlock
LBB0_3:
	mov	x0, x19
	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
LBB0_4:
Lloh0:
	adrp	x21, _GFP_KERNEL@GOTPAGE
Lloh1:
	ldr	x21, [x21, _GFP_KERNEL@GOTPAGEOFF]
	ldr	w1, [x21]
	mov	w0, #32
	bl	_kzalloc
	mov	x19, x0
	cbz	x0, LBB0_2
; %bb.5:
	ldr	w0, [x20, #20]
Lloh2:
	adrp	x8, _PT_SIZE@GOTPAGE
Lloh3:
	ldr	x8, [x8, _PT_SIZE@GOTPAGEOFF]
Lloh4:
	ldr	w1, [x8]
	add	x2, x19, #28
	ldr	w3, [x21]
	bl	_dma_alloc_wc
	str	w0, [x19, #24]
	cbz	w0, LBB0_7
; %bb.6:
	ldr	w1, [x20, #16]
Lloh5:
	adrp	x21, _PT_ENTRIES@GOTPAGE
Lloh6:
	ldr	x21, [x21, _PT_ENTRIES@GOTPAGEOFF]
	ldr	w2, [x21]
	bl	_memset32
	str	x20, [x19]
	add	x0, x19, #20
	bl	_kref_init
	add	x0, x19, #16
	bl	_mutex_init
	add	x0, x19, #12
	bl	_INIT_LIST_HEAD
	add	x0, x19, #8
Lloh7:
	adrp	x8, _GPU_MEM_START@GOTPAGE
Lloh8:
	ldr	x8, [x8, _GPU_MEM_START@GOTPAGEOFF]
Lloh9:
	ldr	w1, [x8]
	ldr	w8, [x21]
Lloh10:
	adrp	x9, _SZ_4K@GOTPAGE
Lloh11:
	ldr	x9, [x9, _SZ_4K@GOTPAGEOFF]
Lloh12:
	ldr	w9, [x9]
	mul	w2, w9, w8
	bl	_drm_mm_init
	ldr	x8, [x19]
	str	x19, [x8, #8]
	b	LBB0_2
LBB0_7:
	mov	x0, x20
	bl	_mutex_unlock
	mov	x0, x19
	bl	_kfree
	mov	x19, #0
	b	LBB0_3
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh10, Lloh11, Lloh12
	.loh AdrpLdrGotLdr	Lloh7, Lloh8, Lloh9
	.loh AdrpLdrGot	Lloh5, Lloh6
	.cfi_endproc
                                        ; -- End function
	.comm	_GFP_KERNEL,4,2                 ; @GFP_KERNEL
	.comm	_PT_SIZE,4,2                    ; @PT_SIZE
	.comm	_PT_ENTRIES,4,2                 ; @PT_ENTRIES
	.comm	_GPU_MEM_START,4,2              ; @GPU_MEM_START
	.comm	_SZ_4K,4,2                      ; @SZ_4K
.subsections_via_symbols
