	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_visibilitymap_count            ## -- Begin function visibilitymap_count
	.p2align	4, 0x90
_visibilitymap_count:                   ## @visibilitymap_count
	.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
	subq	$40, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdx, %rbx
	movl	%edi, %r14d
	movq	%rsi, -56(%rbp)                 ## 8-byte Spill
	movq	%rsi, %rdi
	callq	_Assert
	xorl	%r15d, %r15d
	movl	%r14d, -44(%rbp)                ## 4-byte Spill
	movl	%r14d, %edi
	xorl	%esi, %esi
	xorl	%edx, %edx
	callq	_vm_readbuf
	movl	%eax, %r14d
	movl	%eax, %edi
	callq	_BufferIsValid
	movq	%rbx, %rcx
	movl	$0, %r13d
	testl	%eax, %eax
	je	LBB0_10
## %bb.1:
	xorl	%ebx, %ebx
	movq	_MAPSIZE@GOTPCREL(%rip), %r12
	xorl	%r13d, %r13d
	xorl	%r15d, %r15d
	movq	%rcx, -64(%rbp)                 ## 8-byte Spill
	jmp	LBB0_2
	.p2align	4, 0x90
LBB0_9:                                 ##   in Loop: Header=BB0_2 Depth=1
	movl	-48(%rbp), %edi                 ## 4-byte Reload
	callq	_ReleaseBuffer
	movq	-72(%rbp), %rbx                 ## 8-byte Reload
	incq	%rbx
	movl	-44(%rbp), %edi                 ## 4-byte Reload
	movq	%rbx, %rsi
	xorl	%edx, %edx
	callq	_vm_readbuf
	movl	%eax, %r14d
	movl	%eax, %edi
	callq	_BufferIsValid
	testl	%eax, %eax
	movq	-64(%rbp), %rcx                 ## 8-byte Reload
	movq	_MAPSIZE@GOTPCREL(%rip), %r12
	je	LBB0_10
LBB0_2:                                 ## =>This Loop Header: Depth=1
                                        ##     Child Loop BB0_5 Depth 2
                                        ##     Child Loop BB0_8 Depth 2
	movq	%rbx, -72(%rbp)                 ## 8-byte Spill
	movl	%r14d, -48(%rbp)                ## 4-byte Spill
	movl	%r14d, %edi
	movq	%rcx, %rbx
	callq	_BufferGetPage
	movl	%eax, %edi
	callq	_PageGetContents
	movq	%rax, %r14
	xorl	%edi, %edi
	testb	$3, (%r12)
	sete	%dil
	leaq	L_.str(%rip), %rsi
	callq	_StaticAssertStmt
	movl	(%r12), %eax
	testq	%rbx, %rbx
	je	LBB0_6
## %bb.3:                               ##   in Loop: Header=BB0_2 Depth=1
	cmpl	$4, %eax
	jb	LBB0_9
## %bb.4:                               ##   in Loop: Header=BB0_2 Depth=1
	xorl	%ebx, %ebx
	movq	_FROZEN_MASK64@GOTPCREL(%rip), %r12
	.p2align	4, 0x90
LBB0_5:                                 ##   Parent Loop BB0_2 Depth=1
                                        ## =>  This Inner Loop Header: Depth=2
	movq	_VISIBLE_MASK64@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	andl	(%r14,%rbx,4), %edi
	callq	_pg_popcount64
	addq	%rax, %r13
	movl	(%r12), %edi
	andl	(%r14,%rbx,4), %edi
	callq	_pg_popcount64
	addq	%rax, %r15
	incq	%rbx
	movq	_MAPSIZE@GOTPCREL(%rip), %rax
	movslq	(%rax), %rax
	shrq	$2, %rax
	cmpq	%rbx, %rax
	ja	LBB0_5
	jmp	LBB0_9
	.p2align	4, 0x90
LBB0_6:                                 ##   in Loop: Header=BB0_2 Depth=1
	cmpl	$4, %eax
	jb	LBB0_9
## %bb.7:                               ##   in Loop: Header=BB0_2 Depth=1
	xorl	%ebx, %ebx
	movq	_VISIBLE_MASK64@GOTPCREL(%rip), %r12
	.p2align	4, 0x90
LBB0_8:                                 ##   Parent Loop BB0_2 Depth=1
                                        ## =>  This Inner Loop Header: Depth=2
	movl	(%r12), %edi
	andl	(%r14,%rbx,4), %edi
	callq	_pg_popcount64
	addq	%rax, %r13
	incq	%rbx
	movq	_MAPSIZE@GOTPCREL(%rip), %rax
	movslq	(%rax), %rax
	shrq	$2, %rax
	cmpq	%rbx, %rax
	ja	LBB0_8
	jmp	LBB0_9
LBB0_10:
	movq	-56(%rbp), %rax                 ## 8-byte Reload
	movq	%r13, (%rax)
	testq	%rcx, %rcx
	je	LBB0_12
## %bb.11:
	movq	%r15, (%rcx)
LBB0_12:
	addq	$40, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_MAPSIZE,4,2                    ## @MAPSIZE
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"unsupported MAPSIZE"

	.comm	_VISIBLE_MASK64,4,2             ## @VISIBLE_MASK64
	.comm	_FROZEN_MASK64,4,2              ## @FROZEN_MASK64
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_visibilitymap_count            ; -- Begin function visibilitymap_count
	.p2align	2
_visibilitymap_count:                   ; @visibilitymap_count
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #128
	.cfi_def_cfa_offset 128
	stp	x28, x27, [sp, #32]             ; 16-byte Folded Spill
	stp	x26, x25, [sp, #48]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #64]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #80]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #96]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #112]            ; 16-byte Folded Spill
	add	x29, sp, #112
	.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
	.cfi_offset w27, -88
	.cfi_offset w28, -96
	mov	x19, x2
	mov	x20, x0
	str	x1, [sp, #8]                    ; 8-byte Folded Spill
	mov	x0, x1
	bl	_Assert
	str	w20, [sp, #28]                  ; 4-byte Folded Spill
	mov	x0, x20
	mov	x1, #0
	mov	w2, #0
	bl	_vm_readbuf
	mov	x23, x0
	bl	_BufferIsValid
	cbz	w0, LBB0_10
; %bb.1:
	mov	x22, #0
	mov	x27, #0
	mov	x26, #0
Lloh0:
	adrp	x28, _MAPSIZE@GOTPAGE
Lloh1:
	ldr	x28, [x28, _MAPSIZE@GOTPAGEOFF]
Lloh2:
	adrp	x20, _VISIBLE_MASK64@GOTPAGE
Lloh3:
	ldr	x20, [x20, _VISIBLE_MASK64@GOTPAGEOFF]
Lloh4:
	adrp	x24, _FROZEN_MASK64@GOTPAGE
Lloh5:
	ldr	x24, [x24, _FROZEN_MASK64@GOTPAGEOFF]
	str	x19, [sp, #16]                  ; 8-byte Folded Spill
	b	LBB0_3
LBB0_2:                                 ;   in Loop: Header=BB0_3 Depth=1
	mov	x0, x23
	bl	_ReleaseBuffer
	add	x22, x22, #1
	ldr	w0, [sp, #28]                   ; 4-byte Folded Reload
	mov	x1, x22
	mov	w2, #0
	bl	_vm_readbuf
	mov	x23, x0
	bl	_BufferIsValid
	ldr	x19, [sp, #16]                  ; 8-byte Folded Reload
	cbz	w0, LBB0_11
LBB0_3:                                 ; =>This Loop Header: Depth=1
                                        ;     Child Loop BB0_6 Depth 2
                                        ;     Child Loop BB0_9 Depth 2
	mov	x0, x23
	bl	_BufferGetPage
	bl	_PageGetContents
	mov	x25, x0
	ldr	w8, [x28]
	tst	w8, #0x3
	cset	w0, eq
Lloh6:
	adrp	x1, l_.str@PAGE
Lloh7:
	add	x1, x1, l_.str@PAGEOFF
	bl	_StaticAssertStmt
	ldr	w8, [x28]
	cmp	w8, #4
	cbz	x19, LBB0_7
; %bb.4:                                ;   in Loop: Header=BB0_3 Depth=1
	b.lo	LBB0_2
; %bb.5:                                ;   in Loop: Header=BB0_3 Depth=1
	mov	x19, #0
LBB0_6:                                 ;   Parent Loop BB0_3 Depth=1
                                        ; =>  This Inner Loop Header: Depth=2
	lsl	x21, x19, #2
	ldr	w8, [x25, x21]
	ldr	w9, [x20]
	and	w0, w9, w8
	bl	_pg_popcount64
	add	x27, x0, x27
	ldr	w8, [x25, x21]
	ldr	w9, [x24]
	and	w0, w9, w8
	bl	_pg_popcount64
	add	x26, x0, x26
	add	x19, x19, #1
	ldrsw	x8, [x28]
	cmp	x19, x8, lsr #2
	b.lo	LBB0_6
	b	LBB0_2
LBB0_7:                                 ;   in Loop: Header=BB0_3 Depth=1
	b.lo	LBB0_2
; %bb.8:                                ;   in Loop: Header=BB0_3 Depth=1
	mov	x19, #0
LBB0_9:                                 ;   Parent Loop BB0_3 Depth=1
                                        ; =>  This Inner Loop Header: Depth=2
	ldr	w8, [x25, x19, lsl #2]
	ldr	w9, [x20]
	and	w0, w9, w8
	bl	_pg_popcount64
	add	x27, x0, x27
	add	x19, x19, #1
	ldrsw	x8, [x28]
	cmp	x19, x8, lsr #2
	b.lo	LBB0_9
	b	LBB0_2
LBB0_10:
	mov	x26, #0
	mov	x27, #0
LBB0_11:
	ldr	x8, [sp, #8]                    ; 8-byte Folded Reload
	str	x27, [x8]
	cbz	x19, LBB0_13
; %bb.12:
	str	x26, [x19]
LBB0_13:
	ldp	x29, x30, [sp, #112]            ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #96]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #80]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #64]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #48]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp, #32]             ; 16-byte Folded Reload
	add	sp, sp, #128
	ret
	.loh AdrpLdrGot	Lloh4, Lloh5
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpAdd	Lloh6, Lloh7
	.cfi_endproc
                                        ; -- End function
	.comm	_MAPSIZE,4,2                    ; @MAPSIZE
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"unsupported MAPSIZE"

	.comm	_VISIBLE_MASK64,4,2             ; @VISIBLE_MASK64
	.comm	_FROZEN_MASK64,4,2              ; @FROZEN_MASK64
.subsections_via_symbols
