	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_etnaviv_iommu_global_init      ## -- Begin function etnaviv_iommu_global_init
	.p2align	4, 0x90
_etnaviv_iommu_global_init:             ## @etnaviv_iommu_global_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	%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	8(%rdi), %rax
	movq	8(%rax), %r15
	movq	_chipMinorFeatures1_MMU_VERSION@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	testl	%ecx, 4(%rdi)
	jne	LBB0_1
## %bb.2:
	movq	_ETNAVIV_IOMMU_V1@GOTPCREL(%rip), %rcx
	jmp	LBB0_3
LBB0_1:
	movq	_ETNAVIV_IOMMU_V2@GOTPCREL(%rip), %rcx
LBB0_3:
	movl	(%rcx), %r12d
	movq	(%r15), %rcx
	testq	%rcx, %rcx
	je	LBB0_7
## %bb.4:
	cmpl	%r12d, (%rcx)
	jne	LBB0_5
## %bb.6:
	incl	4(%rcx)
	xorl	%eax, %eax
	jmp	LBB0_19
LBB0_7:
	movq	(%rax), %r14
	movq	_GFP_KERNEL@GOTPCREL(%rip), %r13
	movl	(%r13), %esi
	movl	$64, %edi
	callq	_kzalloc
	testq	%rax, %rax
	je	LBB0_17
## %bb.8:
	movq	%rax, %rbx
	movq	%r13, %rax
	movq	_SZ_4K@GOTPCREL(%rip), %r13
	movl	(%r13), %esi
	leaq	8(%rbx), %rdx
	movl	(%rax), %ecx
	movq	%r14, %rdi
	callq	_dma_alloc_wc
	movq	%rax, 16(%rbx)
	testq	%rax, %rax
	je	LBB0_16
## %bb.9:
	movl	(%r13), %edx
	sarl	$2, %edx
	movq	%rax, %rdi
	movl	$-559065686, %esi               ## imm = 0xDEAD55AA
	callq	_memset32
	movq	_ETNAVIV_IOMMU_V2@GOTPCREL(%rip), %rax
	cmpl	(%rax), %r12d
	jne	LBB0_11
## %bb.10:
	movq	_ETNAVIV_PTA_SIZE@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	leaq	56(%rbx), %rdx
	movq	_GFP_KERNEL@GOTPCREL(%rip), %rax
	movl	(%rax), %ecx
	movq	%r14, %rdi
	callq	_dma_alloc_wc
	movq	%rax, 48(%rbx)
	testq	%rax, %rax
	je	LBB0_15
LBB0_11:
	movq	%r14, 40(%rbx)
	movl	%r12d, (%rbx)
	movl	$1, 4(%rbx)
	movq	%rbx, %rdi
	addq	$32, %rdi
	callq	_mutex_init
	movq	_ETNAVIV_IOMMU_V1@GOTPCREL(%rip), %rax
	cmpl	(%rax), %r12d
	jne	LBB0_12
## %bb.13:
	movq	_etnaviv_iommuv1_ops@GOTPCREL(%rip), %rax
	jmp	LBB0_14
LBB0_5:
	movl	(%rdi), %edi
	leaq	L_.str(%rip), %rsi
	callq	_dev_err
	movq	_ENXIO@GOTPCREL(%rip), %rcx
	jmp	LBB0_18
LBB0_12:
	movq	_etnaviv_iommuv2_ops@GOTPCREL(%rip), %rax
LBB0_14:
	movq	%rax, 24(%rbx)
	movq	%rbx, (%r15)
	xorl	%eax, %eax
	jmp	LBB0_19
LBB0_15:
	movq	_SZ_4K@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	16(%rbx), %rdx
	movl	8(%rbx), %ecx
	movq	%r14, %rdi
	callq	_dma_free_wc
LBB0_16:
	movq	%rbx, %rdi
	callq	_kfree
LBB0_17:
	movq	_ENOMEM@GOTPCREL(%rip), %rcx
LBB0_18:
	xorl	%eax, %eax
	subl	(%rcx), %eax
LBB0_19:
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_ETNAVIV_IOMMU_V1,4,2           ## @ETNAVIV_IOMMU_V1
	.comm	_chipMinorFeatures1_MMU_VERSION,4,2 ## @chipMinorFeatures1_MMU_VERSION
	.comm	_ETNAVIV_IOMMU_V2,4,2           ## @ETNAVIV_IOMMU_V2
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"MMU version doesn't match global version\n"

	.comm	_ENXIO,4,2                      ## @ENXIO
	.comm	_GFP_KERNEL,4,2                 ## @GFP_KERNEL
	.comm	_ENOMEM,4,2                     ## @ENOMEM
	.comm	_SZ_4K,4,2                      ## @SZ_4K
	.comm	_ETNAVIV_PTA_SIZE,4,2           ## @ETNAVIV_PTA_SIZE
	.comm	_etnaviv_iommuv1_ops,4,2        ## @etnaviv_iommuv1_ops
	.comm	_etnaviv_iommuv2_ops,4,2        ## @etnaviv_iommuv2_ops
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_etnaviv_iommu_global_init      ; -- Begin function etnaviv_iommu_global_init
	.p2align	2
_etnaviv_iommu_global_init:             ; @etnaviv_iommu_global_init
	.cfi_startproc
; %bb.0:
	stp	x26, x25, [sp, #-80]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 80
	stp	x24, x23, [sp, #16]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #32]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #48]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #64]             ; 16-byte Folded Spill
	add	x29, sp, #64
	.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
	.cfi_offset w25, -72
	.cfi_offset w26, -80
	ldr	x8, [x0, #8]
	ldr	x21, [x8, #8]
	ldr	w9, [x0, #4]
Lloh0:
	adrp	x10, _chipMinorFeatures1_MMU_VERSION@GOTPAGE
Lloh1:
	ldr	x10, [x10, _chipMinorFeatures1_MMU_VERSION@GOTPAGEOFF]
Lloh2:
	ldr	w10, [x10]
Lloh3:
	adrp	x23, _ETNAVIV_IOMMU_V1@GOTPAGE
Lloh4:
	ldr	x23, [x23, _ETNAVIV_IOMMU_V1@GOTPAGEOFF]
Lloh5:
	adrp	x24, _ETNAVIV_IOMMU_V2@GOTPAGE
Lloh6:
	ldr	x24, [x24, _ETNAVIV_IOMMU_V2@GOTPAGEOFF]
	tst	w10, w9
	csel	x9, x23, x24, eq
	ldr	w22, [x9]
	ldr	x9, [x21]
	cbz	x9, LBB0_3
; %bb.1:
	ldr	w8, [x9]
	cmp	w8, w22
	b.ne	LBB0_8
; %bb.2:
	mov	w0, #0
	ldr	w8, [x9, #4]
	add	w8, w8, #1
	str	w8, [x9, #4]
	b	LBB0_13
LBB0_3:
	ldr	x20, [x8]
Lloh7:
	adrp	x25, _GFP_KERNEL@GOTPAGE
Lloh8:
	ldr	x25, [x25, _GFP_KERNEL@GOTPAGEOFF]
	ldr	w1, [x25]
	mov	w0, #64
	bl	_kzalloc
	cbz	x0, LBB0_11
; %bb.4:
	mov	x19, x0
Lloh9:
	adrp	x26, _SZ_4K@GOTPAGE
Lloh10:
	ldr	x26, [x26, _SZ_4K@GOTPAGEOFF]
	ldr	w1, [x26]
	add	x2, x0, #8
	ldr	w3, [x25]
	mov	x0, x20
	bl	_dma_alloc_wc
	str	x0, [x19, #16]
	cbz	x0, LBB0_10
; %bb.5:
	ldr	w8, [x26]
	asr	w2, w8, #2
	mov	w1, #21930
	movk	w1, #57005, lsl #16
	bl	_memset32
	ldr	w8, [x24]
	cmp	w22, w8
	b.ne	LBB0_7
; %bb.6:
Lloh11:
	adrp	x8, _ETNAVIV_PTA_SIZE@GOTPAGE
Lloh12:
	ldr	x8, [x8, _ETNAVIV_PTA_SIZE@GOTPAGEOFF]
Lloh13:
	ldr	w1, [x8]
	add	x2, x19, #56
	ldr	w3, [x25]
	mov	x0, x20
	bl	_dma_alloc_wc
	str	x0, [x19, #48]
	cbz	x0, LBB0_9
LBB0_7:
	str	x20, [x19, #40]
	mov	w8, #1
	stp	w22, w8, [x19]
	add	x0, x19, #32
	bl	_mutex_init
	mov	w0, #0
	ldr	w8, [x23]
Lloh14:
	adrp	x9, _etnaviv_iommuv2_ops@GOTPAGE
Lloh15:
	ldr	x9, [x9, _etnaviv_iommuv2_ops@GOTPAGEOFF]
Lloh16:
	adrp	x10, _etnaviv_iommuv1_ops@GOTPAGE
Lloh17:
	ldr	x10, [x10, _etnaviv_iommuv1_ops@GOTPAGEOFF]
	cmp	w22, w8
	csel	x8, x10, x9, eq
	str	x8, [x19, #24]
	str	x19, [x21]
	b	LBB0_13
LBB0_8:
	ldr	w0, [x0]
Lloh18:
	adrp	x1, l_.str@PAGE
Lloh19:
	add	x1, x1, l_.str@PAGEOFF
	bl	_dev_err
Lloh20:
	adrp	x8, _ENXIO@GOTPAGE
Lloh21:
	ldr	x8, [x8, _ENXIO@GOTPAGEOFF]
	b	LBB0_12
LBB0_9:
	ldr	w1, [x26]
	ldr	x2, [x19, #16]
	ldr	w3, [x19, #8]
	mov	x0, x20
	bl	_dma_free_wc
LBB0_10:
	mov	x0, x19
	bl	_kfree
LBB0_11:
Lloh22:
	adrp	x8, _ENOMEM@GOTPAGE
Lloh23:
	ldr	x8, [x8, _ENOMEM@GOTPAGEOFF]
LBB0_12:
	ldr	w8, [x8]
	neg	w0, w8
LBB0_13:
	ldp	x29, x30, [sp, #64]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #48]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #32]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #16]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp], #80             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGot	Lloh5, Lloh6
	.loh AdrpLdrGot	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGot	Lloh7, Lloh8
	.loh AdrpLdrGot	Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.loh AdrpLdrGot	Lloh16, Lloh17
	.loh AdrpLdrGot	Lloh14, Lloh15
	.loh AdrpLdrGot	Lloh20, Lloh21
	.loh AdrpAdd	Lloh18, Lloh19
	.loh AdrpLdrGot	Lloh22, Lloh23
	.cfi_endproc
                                        ; -- End function
	.comm	_ETNAVIV_IOMMU_V1,4,2           ; @ETNAVIV_IOMMU_V1
	.comm	_chipMinorFeatures1_MMU_VERSION,4,2 ; @chipMinorFeatures1_MMU_VERSION
	.comm	_ETNAVIV_IOMMU_V2,4,2           ; @ETNAVIV_IOMMU_V2
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"MMU version doesn't match global version\n"

	.comm	_ENXIO,4,2                      ; @ENXIO
	.comm	_GFP_KERNEL,4,2                 ; @GFP_KERNEL
	.comm	_ENOMEM,4,2                     ; @ENOMEM
	.comm	_SZ_4K,4,2                      ; @SZ_4K
	.comm	_ETNAVIV_PTA_SIZE,4,2           ; @ETNAVIV_PTA_SIZE
	.comm	_etnaviv_iommuv1_ops,4,2        ; @etnaviv_iommuv1_ops
	.comm	_etnaviv_iommuv2_ops,4,2        ; @etnaviv_iommuv2_ops
.subsections_via_symbols
