	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_kvm_mmu_calculate_mmu_pages    ## -- Begin function kvm_mmu_calculate_mmu_pages
	.p2align	4, 0x90
_kvm_mmu_calculate_mmu_pages:           ## @kvm_mmu_calculate_mmu_pages
	.cfi_startproc
## %bb.0:
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset %rbp, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register %rbp
	movl	(%rdi), %edi
	callq	_rcu_dereference
	movl	(%rax), %ecx
	testl	%ecx, %ecx
	jle	LBB0_1
## %bb.2:
	movq	8(%rax), %rax
	cmpl	$4, %ecx
	jae	LBB0_4
## %bb.3:
	xorl	%edx, %edx
	xorl	%esi, %esi
	jmp	LBB0_11
LBB0_1:
	xorl	%esi, %esi
	jmp	LBB0_12
LBB0_4:
	movl	%ecx, %edx
	andl	$-4, %edx
	leaq	-4(%rdx), %rsi
	movq	%rsi, %r8
	shrq	$2, %r8
	incq	%r8
	testq	%rsi, %rsi
	je	LBB0_5
## %bb.6:
	movq	%r8, %rsi
	andq	$-2, %rsi
	pxor	%xmm0, %xmm0
	xorl	%edi, %edi
	pxor	%xmm1, %xmm1
	.p2align	4, 0x90
LBB0_7:                                 ## =>This Inner Loop Header: Depth=1
	movdqu	(%rax,%rdi,8), %xmm2
	movdqu	16(%rax,%rdi,8), %xmm3
	movdqu	32(%rax,%rdi,8), %xmm4
	movdqu	48(%rax,%rdi,8), %xmm5
	pshufd	$232, %xmm2, %xmm2              ## xmm2 = xmm2[0,2,2,3]
	paddd	%xmm0, %xmm2
	pshufd	$232, %xmm3, %xmm3              ## xmm3 = xmm3[0,2,2,3]
	paddd	%xmm1, %xmm3
	pshufd	$232, %xmm4, %xmm0              ## xmm0 = xmm4[0,2,2,3]
	paddd	%xmm2, %xmm0
	pshufd	$232, %xmm5, %xmm1              ## xmm1 = xmm5[0,2,2,3]
	paddd	%xmm3, %xmm1
	addq	$8, %rdi
	addq	$-2, %rsi
	jne	LBB0_7
## %bb.8:
	testb	$1, %r8b
	je	LBB0_10
LBB0_9:
	movdqu	(%rax,%rdi,8), %xmm2
	movdqu	16(%rax,%rdi,8), %xmm3
	pshufd	$232, %xmm2, %xmm2              ## xmm2 = xmm2[0,2,2,3]
	paddd	%xmm2, %xmm0
	pshufd	$232, %xmm3, %xmm2              ## xmm2 = xmm3[0,2,2,3]
	paddd	%xmm2, %xmm1
LBB0_10:
	paddd	%xmm1, %xmm0
	pshufd	$85, %xmm0, %xmm1               ## xmm1 = xmm0[1,1,1,1]
	paddd	%xmm0, %xmm1
	movd	%xmm1, %esi
	cmpq	%rcx, %rdx
	je	LBB0_12
	.p2align	4, 0x90
LBB0_11:                                ## =>This Inner Loop Header: Depth=1
	addl	(%rax,%rdx,8), %esi
	incq	%rdx
	cmpq	%rdx, %rcx
	jne	LBB0_11
LBB0_12:
	movq	_KVM_PERMILLE_MMU_PAGES@GOTPCREL(%rip), %rax
	imull	(%rax), %esi
	imulq	$274877907, %rsi, %rdi          ## imm = 0x10624DD3
	shrq	$38, %rdi
	movq	_KVM_MIN_ALLOC_MMU_PAGES@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
                                        ## kill: def $edi killed $edi killed $rdi
	popq	%rbp
	jmp	_max                            ## TAILCALL
LBB0_5:
	pxor	%xmm0, %xmm0
	xorl	%edi, %edi
	pxor	%xmm1, %xmm1
	testb	$1, %r8b
	jne	LBB0_9
	jmp	LBB0_10
	.cfi_endproc
                                        ## -- End function
	.comm	_KVM_PERMILLE_MMU_PAGES,4,2     ## @KVM_PERMILLE_MMU_PAGES
	.comm	_KVM_MIN_ALLOC_MMU_PAGES,8,3    ## @KVM_MIN_ALLOC_MMU_PAGES
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_kvm_mmu_calculate_mmu_pages    ; -- Begin function kvm_mmu_calculate_mmu_pages
	.p2align	2
_kvm_mmu_calculate_mmu_pages:           ; @kvm_mmu_calculate_mmu_pages
	.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
	ldr	w0, [x0]
	bl	_rcu_dereference
	ldr	w8, [x0]
	cmp	w8, #1
	b.lt	LBB0_3
; %bb.1:
	ldr	x9, [x0, #8]
	cmp	w8, #8
	b.hs	LBB0_4
; %bb.2:
	mov	x10, #0
	mov	w11, #0
	b	LBB0_7
LBB0_3:
	mov	w11, #0
	b	LBB0_9
LBB0_4:
	and	x10, x8, #0xfffffff8
	movi.2d	v0, #0000000000000000
	add	x11, x9, #32
	mov	x12, x10
	movi.2d	v1, #0000000000000000
	movi.2d	v2, #0000000000000000
	movi.2d	v3, #0000000000000000
LBB0_5:                                 ; =>This Inner Loop Header: Depth=1
	ldp	q4, q5, [x11, #-32]
	ldp	q6, q7, [x11], #64
	xtn.2s	v4, v4
	xtn.2s	v5, v5
	xtn.2s	v6, v6
	xtn.2s	v7, v7
	add.2s	v0, v0, v4
	add.2s	v1, v1, v5
	add.2s	v2, v2, v6
	add.2s	v3, v3, v7
	subs	x12, x12, #8
	b.ne	LBB0_5
; %bb.6:
	add.2s	v0, v1, v0
	add.2s	v0, v2, v0
	add.2s	v0, v3, v0
	addp.2s	v0, v0, v0
	fmov	w11, s0
	cmp	x10, x8
	b.eq	LBB0_9
LBB0_7:
	add	x9, x9, x10, lsl #3
	sub	x8, x8, x10
LBB0_8:                                 ; =>This Inner Loop Header: Depth=1
	ldr	w10, [x9], #8
	add	w11, w11, w10
	subs	x8, x8, #1
	b.ne	LBB0_8
LBB0_9:
Lloh0:
	adrp	x8, _KVM_PERMILLE_MMU_PAGES@GOTPAGE
Lloh1:
	ldr	x8, [x8, _KVM_PERMILLE_MMU_PAGES@GOTPAGEOFF]
Lloh2:
	ldr	w8, [x8]
	mul	w8, w8, w11
	mov	w9, #19923
	movk	w9, #4194, lsl #16
	umull	x8, w8, w9
	lsr	x0, x8, #38
Lloh3:
	adrp	x8, _KVM_MIN_ALLOC_MMU_PAGES@GOTPAGE
Lloh4:
	ldr	x8, [x8, _KVM_MIN_ALLOC_MMU_PAGES@GOTPAGEOFF]
Lloh5:
	ldr	w1, [x8]
                                        ; kill: def $w0 killed $w0 killed $x0
	ldp	x29, x30, [sp], #16             ; 16-byte Folded Reload
	b	_max
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.cfi_endproc
                                        ; -- End function
	.comm	_KVM_PERMILLE_MMU_PAGES,4,2     ; @KVM_PERMILLE_MMU_PAGES
	.comm	_KVM_MIN_ALLOC_MMU_PAGES,8,3    ; @KVM_MIN_ALLOC_MMU_PAGES
.subsections_via_symbols
