	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function etnaviv_iommuv2_dump_size
_etnaviv_iommuv2_dump_size:             ## @etnaviv_iommuv2_dump_size
	.cfi_startproc
## %bb.0:
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset %rbp, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register %rbp
	callq	_to_v2_context
	movq	_SZ_4K@GOTPCREL(%rip), %rcx
	movq	(%rcx), %r10
	movq	_MMUv2_MAX_STLB_ENTRIES@GOTPCREL(%rip), %rcx
	movl	(%rcx), %r11d
	testl	%r11d, %r11d
	jle	LBB0_1
## %bb.2:
	movq	(%rax), %rsi
	movq	_MMUv2_PTE_PRESENT@GOTPCREL(%rip), %rax
	movl	(%rax), %r8d
	cmpl	$4, %r11d
	jae	LBB0_4
## %bb.3:
	xorl	%edx, %edx
	movq	%r10, %rax
	jmp	LBB0_11
LBB0_1:
	movq	%r10, %rax
	popq	%rbp
	retq
LBB0_4:
	movl	%r11d, %edx
	andl	$-4, %edx
	movq	%r10, %xmm0
	movd	%r8d, %xmm1
	pshufd	$80, %xmm1, %xmm2               ## xmm2 = xmm1[0,0,1,1]
	pshufd	$68, %xmm0, %xmm1               ## xmm1 = xmm0[0,1,0,1]
	leaq	-4(%rdx), %rax
	movq	%rax, %r9
	shrq	$2, %r9
	incq	%r9
	testq	%rax, %rax
	je	LBB0_5
## %bb.6:
	movq	%r9, %rcx
	andq	$-2, %rcx
	pxor	%xmm4, %xmm4
	xorl	%eax, %eax
	pxor	%xmm3, %xmm3
	.p2align	4, 0x90
LBB0_7:                                 ## =>This Inner Loop Header: Depth=1
	movq	(%rsi,%rax,4), %xmm5            ## xmm5 = mem[0],zero
	movq	8(%rsi,%rax,4), %xmm6           ## xmm6 = mem[0],zero
	pand	%xmm2, %xmm5
	pand	%xmm2, %xmm6
	pcmpeqd	%xmm4, %xmm5
	pmovsxdq	%xmm5, %xmm5
	pcmpeqd	%xmm4, %xmm6
	pmovsxdq	%xmm6, %xmm6
	pandn	%xmm1, %xmm5
	paddq	%xmm0, %xmm5
	pandn	%xmm1, %xmm6
	paddq	%xmm3, %xmm6
	movq	16(%rsi,%rax,4), %xmm0          ## xmm0 = mem[0],zero
	movq	24(%rsi,%rax,4), %xmm3          ## xmm3 = mem[0],zero
	pand	%xmm2, %xmm0
	pand	%xmm2, %xmm3
	pcmpeqd	%xmm4, %xmm0
	pmovsxdq	%xmm0, %xmm0
	pcmpeqd	%xmm4, %xmm3
	pmovsxdq	%xmm3, %xmm3
	pandn	%xmm1, %xmm0
	paddq	%xmm5, %xmm0
	pandn	%xmm1, %xmm3
	paddq	%xmm6, %xmm3
	addq	$8, %rax
	addq	$-2, %rcx
	jne	LBB0_7
## %bb.8:
	testb	$1, %r9b
	je	LBB0_10
LBB0_9:
	movq	(%rsi,%rax,4), %xmm4            ## xmm4 = mem[0],zero
	movq	8(%rsi,%rax,4), %xmm5           ## xmm5 = mem[0],zero
	pand	%xmm2, %xmm4
	pand	%xmm2, %xmm5
	pxor	%xmm2, %xmm2
	pcmpeqd	%xmm2, %xmm4
	pmovsxdq	%xmm4, %xmm4
	pcmpeqd	%xmm2, %xmm5
	pmovsxdq	%xmm5, %xmm2
	pandn	%xmm1, %xmm4
	paddq	%xmm4, %xmm0
	pandn	%xmm1, %xmm2
	paddq	%xmm2, %xmm3
LBB0_10:
	paddq	%xmm3, %xmm0
	pshufd	$238, %xmm0, %xmm1              ## xmm1 = xmm0[2,3,2,3]
	paddq	%xmm0, %xmm1
	movq	%xmm1, %rax
	cmpq	%r11, %rdx
	je	LBB0_13
LBB0_11:
	xorl	%ecx, %ecx
	.p2align	4, 0x90
LBB0_12:                                ## =>This Inner Loop Header: Depth=1
	testl	%r8d, (%rsi,%rdx,4)
	movq	%r10, %rdi
	cmoveq	%rcx, %rdi
	addq	%rdi, %rax
	incq	%rdx
	cmpq	%rdx, %r11
	jne	LBB0_12
LBB0_13:
	popq	%rbp
	retq
LBB0_5:
	pxor	%xmm3, %xmm3
	xorl	%eax, %eax
	testb	$1, %r9b
	jne	LBB0_9
	jmp	LBB0_10
	.cfi_endproc
                                        ## -- End function
	.comm	_SZ_4K,8,3                      ## @SZ_4K
	.comm	_MMUv2_MAX_STLB_ENTRIES,4,2     ## @MMUv2_MAX_STLB_ENTRIES
	.comm	_MMUv2_PTE_PRESENT,4,2          ## @MMUv2_PTE_PRESENT
	.no_dead_strip	_etnaviv_iommuv2_dump_size
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function etnaviv_iommuv2_dump_size
_etnaviv_iommuv2_dump_size:             ; @etnaviv_iommuv2_dump_size
	.cfi_startproc
; %bb.0:
	stp	x29, x30, [sp, #-16]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 16
	mov	x29, sp
	.cfi_def_cfa w29, 16
	.cfi_offset w30, -8
	.cfi_offset w29, -16
	bl	_to_v2_context
Lloh0:
	adrp	x8, _SZ_4K@GOTPAGE
Lloh1:
	ldr	x8, [x8, _SZ_4K@GOTPAGEOFF]
Lloh2:
	ldr	x8, [x8]
Lloh3:
	adrp	x9, _MMUv2_MAX_STLB_ENTRIES@GOTPAGE
Lloh4:
	ldr	x9, [x9, _MMUv2_MAX_STLB_ENTRIES@GOTPAGEOFF]
Lloh5:
	ldr	w10, [x9]
	cmp	w10, #1
	b.lt	LBB0_3
; %bb.1:
	ldr	x11, [x0]
Lloh6:
	adrp	x9, _MMUv2_PTE_PRESENT@GOTPAGE
Lloh7:
	ldr	x9, [x9, _MMUv2_PTE_PRESENT@GOTPAGEOFF]
Lloh8:
	ldr	w9, [x9]
	cmp	w10, #8
	b.hs	LBB0_4
; %bb.2:
	mov	x12, #0
	mov	x0, x8
	b	LBB0_7
LBB0_3:
	mov	x0, x8
	ldp	x29, x30, [sp], #16             ; 16-byte Folded Reload
	ret
LBB0_4:
	and	x12, x10, #0xfffffff8
	movi.2d	v0, #0000000000000000
	movi.2d	v1, #0000000000000000
	mov.d	v1[0], x8
	dup.2s	v2, w9
	dup.2d	v3, x8
	add	x13, x11, #16
	mov	x14, x12
	movi.2d	v4, #0000000000000000
	movi.2d	v5, #0000000000000000
LBB0_5:                                 ; =>This Inner Loop Header: Depth=1
	ldp	d6, d7, [x13, #-16]
	ldp	d16, d17, [x13], #32
	and.8b	v6, v2, v6
	and.8b	v7, v2, v7
	and.8b	v16, v2, v16
	and.8b	v17, v2, v17
	cmeq.2s	v6, v6, #0
	sshll.2d	v6, v6, #0
	cmeq.2s	v7, v7, #0
	sshll.2d	v7, v7, #0
	cmeq.2s	v16, v16, #0
	sshll.2d	v16, v16, #0
	cmeq.2s	v17, v17, #0
	sshll.2d	v17, v17, #0
	bic.16b	v6, v3, v6
	bic.16b	v7, v3, v7
	bic.16b	v16, v3, v16
	bic.16b	v17, v3, v17
	add.2d	v1, v6, v1
	add.2d	v0, v7, v0
	add.2d	v4, v16, v4
	add.2d	v5, v17, v5
	subs	x14, x14, #8
	b.ne	LBB0_5
; %bb.6:
	add.2d	v0, v0, v1
	add.2d	v0, v4, v0
	add.2d	v0, v5, v0
	addp.2d	d0, v0
	fmov	x0, d0
	cmp	x12, x10
	b.eq	LBB0_9
LBB0_7:
	add	x11, x11, x12, lsl #2
	sub	x10, x10, x12
LBB0_8:                                 ; =>This Inner Loop Header: Depth=1
	ldr	w12, [x11], #4
	tst	w9, w12
	csel	x12, xzr, x8, eq
	add	x0, x12, x0
	subs	x10, x10, #1
	b.ne	LBB0_8
LBB0_9:
	ldp	x29, x30, [sp], #16             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.cfi_endproc
                                        ; -- End function
	.comm	_SZ_4K,8,3                      ; @SZ_4K
	.comm	_MMUv2_MAX_STLB_ENTRIES,4,2     ; @MMUv2_MAX_STLB_ENTRIES
	.comm	_MMUv2_PTE_PRESENT,4,2          ; @MMUv2_PTE_PRESENT
	.no_dead_strip	_etnaviv_iommuv2_dump_size
.subsections_via_symbols
