	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function etnaviv_iommuv2_ensure_stlb
_etnaviv_iommuv2_ensure_stlb:           ## @etnaviv_iommuv2_ensure_stlb
	.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
	movq	16(%rdi), %rax
	movslq	%esi, %r15
	xorl	%r14d, %r14d
	cmpq	$0, (%rax,%r15,8)
	jne	LBB0_4
## %bb.1:
	movq	%rdi, %rbx
	movq	24(%rdi), %rax
	movl	(%rax), %edi
	movq	_SZ_4K@GOTPCREL(%rip), %r12
	movl	(%r12), %esi
	leaq	(,%r15,4), %rdx
	addq	(%rbx), %rdx
	movq	_GFP_KERNEL@GOTPCREL(%rip), %rax
	movl	(%rax), %ecx
	callq	_dma_alloc_wc
	movq	16(%rbx), %rcx
	movq	%rax, (%rcx,%r15,8)
	testq	%rax, %rax
	je	LBB0_2
## %bb.3:
	movq	_MMUv2_PTE_EXCEPTION@GOTPCREL(%rip), %rcx
	movl	(%rcx), %esi
	movl	(%r12), %edx
	sarl	$2, %edx
	movq	%rax, %rdi
	callq	_memset32
	movq	_MMUv2_PTE_PRESENT@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movq	(%rbx), %rcx
	movq	8(%rbx), %rdx
	orl	(%rcx,%r15,4), %eax
	movl	%eax, (%rdx,%r15,4)
	jmp	LBB0_4
LBB0_2:
	movq	_ENOMEM@GOTPCREL(%rip), %rax
	xorl	%r14d, %r14d
	subl	(%rax), %r14d
LBB0_4:
	movl	%r14d, %eax
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_SZ_4K,4,2                      ## @SZ_4K
	.comm	_GFP_KERNEL,4,2                 ## @GFP_KERNEL
	.comm	_ENOMEM,4,2                     ## @ENOMEM
	.comm	_MMUv2_PTE_EXCEPTION,4,2        ## @MMUv2_PTE_EXCEPTION
	.comm	_MMUv2_PTE_PRESENT,4,2          ## @MMUv2_PTE_PRESENT
	.no_dead_strip	_etnaviv_iommuv2_ensure_stlb
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function etnaviv_iommuv2_ensure_stlb
_etnaviv_iommuv2_ensure_stlb:           ; @etnaviv_iommuv2_ensure_stlb
	.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
                                        ; kill: def $w1 killed $w1 def $x1
	ldr	x8, [x0, #16]
	ldr	x8, [x8, w1, sxtw #3]
	cbz	x8, LBB0_2
; %bb.1:
	mov	w0, #0
	b	LBB0_5
LBB0_2:
	mov	x19, x0
	sxtw	x20, w1
	ldr	x8, [x0, #24]
	ldr	w0, [x8]
Lloh0:
	adrp	x21, _SZ_4K@GOTPAGE
Lloh1:
	ldr	x21, [x21, _SZ_4K@GOTPAGEOFF]
	ldr	w1, [x21]
	ldr	x8, [x19]
	add	x2, x8, x20, lsl #2
Lloh2:
	adrp	x8, _GFP_KERNEL@GOTPAGE
Lloh3:
	ldr	x8, [x8, _GFP_KERNEL@GOTPAGEOFF]
Lloh4:
	ldr	w3, [x8]
	bl	_dma_alloc_wc
	ldr	x8, [x19, #16]
	str	x0, [x8, x20, lsl #3]
	cbz	x0, LBB0_4
; %bb.3:
Lloh5:
	adrp	x8, _MMUv2_PTE_EXCEPTION@GOTPAGE
Lloh6:
	ldr	x8, [x8, _MMUv2_PTE_EXCEPTION@GOTPAGEOFF]
Lloh7:
	ldr	w1, [x8]
	ldr	w8, [x21]
	asr	w2, w8, #2
	bl	_memset32
	mov	w0, #0
	lsl	x8, x20, #2
	ldp	x9, x10, [x19]
	ldr	w9, [x9, x8]
Lloh8:
	adrp	x11, _MMUv2_PTE_PRESENT@GOTPAGE
Lloh9:
	ldr	x11, [x11, _MMUv2_PTE_PRESENT@GOTPAGEOFF]
Lloh10:
	ldr	w11, [x11]
	orr	w9, w11, w9
	str	w9, [x10, x8]
	b	LBB0_5
LBB0_4:
Lloh11:
	adrp	x8, _ENOMEM@GOTPAGE
Lloh12:
	ldr	x8, [x8, _ENOMEM@GOTPAGEOFF]
Lloh13:
	ldr	w8, [x8]
	neg	w0, w8
LBB0_5:
	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 AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.cfi_endproc
                                        ; -- End function
	.comm	_SZ_4K,4,2                      ; @SZ_4K
	.comm	_GFP_KERNEL,4,2                 ; @GFP_KERNEL
	.comm	_ENOMEM,4,2                     ; @ENOMEM
	.comm	_MMUv2_PTE_EXCEPTION,4,2        ; @MMUv2_PTE_EXCEPTION
	.comm	_MMUv2_PTE_PRESENT,4,2          ; @MMUv2_PTE_PRESENT
	.no_dead_strip	_etnaviv_iommuv2_ensure_stlb
.subsections_via_symbols
