	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.section	__TEXT,__literal16,16byte_literals
	.p2align	4                               ## -- Begin function check_residency
LCPI0_0:
	.quad	1                               ## 0x1
	.quad	1                               ## 0x1
	.section	__TEXT,__text,regular,pure_instructions
	.p2align	4, 0x90
_check_residency:                       ## @check_residency
	.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	%rbx
	pushq	%rax
	.cfi_offset %rbx, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rsi, %r14
	movq	%rdi, %rbx
	movq	%rsi, %rdi
	callq	_malloc
	movq	%rax, %r15
	xorl	%edi, %edi
	testq	%rax, %rax
	setne	%dil
	callq	_ATF_REQUIRE
	movq	_page@GOTPCREL(%rip), %rax
	movq	(%rax), %rsi
	imulq	%r14, %rsi
	movq	%rbx, %rdi
	movq	%r15, %rdx
	callq	_mincore
	xorl	%edi, %edi
	testq	%rax, %rax
	sete	%dil
	callq	_ATF_REQUIRE
	testq	%r14, %r14
	je	LBB0_1
## %bb.2:
	cmpq	$4, %r14
	jae	LBB0_4
## %bb.3:
	xorl	%eax, %eax
	xorl	%ebx, %ebx
	jmp	LBB0_11
LBB0_1:
	xorl	%ebx, %ebx
	jmp	LBB0_12
LBB0_4:
	movq	%r14, %rax
	andq	$-4, %rax
	leaq	-4(%rax), %rdx
	movq	%rdx, %rcx
	shrq	$2, %rcx
	incq	%rcx
	testq	%rdx, %rdx
	je	LBB0_5
## %bb.6:
	movq	%rcx, %rsi
	andq	$-2, %rsi
	pxor	%xmm2, %xmm2
	xorl	%edx, %edx
	pcmpeqd	%xmm3, %xmm3
	movdqa	LCPI0_0(%rip), %xmm4            ## xmm4 = [1,1]
	pxor	%xmm0, %xmm0
	pxor	%xmm1, %xmm1
	.p2align	4, 0x90
LBB0_7:                                 ## =>This Inner Loop Header: Depth=1
	movzwl	(%r15,%rdx), %edi
	movd	%edi, %xmm5
	movzwl	2(%r15,%rdx), %edi
	movd	%edi, %xmm6
	pcmpeqb	%xmm2, %xmm5
	pxor	%xmm3, %xmm5
	pmovzxbq	%xmm5, %xmm5                    ## xmm5 = xmm5[0],zero,zero,zero,zero,zero,zero,zero,xmm5[1],zero,zero,zero,zero,zero,zero,zero
	pand	%xmm4, %xmm5
	paddq	%xmm0, %xmm5
	pcmpeqb	%xmm2, %xmm6
	pxor	%xmm3, %xmm6
	pmovzxbq	%xmm6, %xmm6                    ## xmm6 = xmm6[0],zero,zero,zero,zero,zero,zero,zero,xmm6[1],zero,zero,zero,zero,zero,zero,zero
	pand	%xmm4, %xmm6
	paddq	%xmm1, %xmm6
	movzwl	4(%r15,%rdx), %edi
	movd	%edi, %xmm0
	movzwl	6(%r15,%rdx), %edi
	movd	%edi, %xmm1
	pcmpeqb	%xmm2, %xmm0
	pxor	%xmm3, %xmm0
	pmovzxbq	%xmm0, %xmm0                    ## xmm0 = xmm0[0],zero,zero,zero,zero,zero,zero,zero,xmm0[1],zero,zero,zero,zero,zero,zero,zero
	pand	%xmm4, %xmm0
	paddq	%xmm5, %xmm0
	pcmpeqb	%xmm2, %xmm1
	pxor	%xmm3, %xmm1
	pmovzxbq	%xmm1, %xmm1                    ## xmm1 = xmm1[0],zero,zero,zero,zero,zero,zero,zero,xmm1[1],zero,zero,zero,zero,zero,zero,zero
	pand	%xmm4, %xmm1
	paddq	%xmm6, %xmm1
	addq	$8, %rdx
	addq	$-2, %rsi
	jne	LBB0_7
## %bb.8:
	testb	$1, %cl
	je	LBB0_10
LBB0_9:
	movzwl	(%r15,%rdx), %ecx
	movd	%ecx, %xmm2
	movzwl	2(%r15,%rdx), %ecx
	movd	%ecx, %xmm3
	pxor	%xmm4, %xmm4
	pcmpeqb	%xmm4, %xmm2
	pcmpeqd	%xmm5, %xmm5
	pxor	%xmm5, %xmm2
	pmovzxbq	%xmm2, %xmm2                    ## xmm2 = xmm2[0],zero,zero,zero,zero,zero,zero,zero,xmm2[1],zero,zero,zero,zero,zero,zero,zero
	movdqa	LCPI0_0(%rip), %xmm6            ## xmm6 = [1,1]
	pand	%xmm6, %xmm2
	paddq	%xmm2, %xmm0
	pcmpeqb	%xmm4, %xmm3
	pxor	%xmm5, %xmm3
	pmovzxbq	%xmm3, %xmm2                    ## xmm2 = xmm3[0],zero,zero,zero,zero,zero,zero,zero,xmm3[1],zero,zero,zero,zero,zero,zero,zero
	pand	%xmm6, %xmm2
	paddq	%xmm2, %xmm1
LBB0_10:
	paddq	%xmm1, %xmm0
	pshufd	$238, %xmm0, %xmm1              ## xmm1 = xmm0[2,3,2,3]
	paddq	%xmm0, %xmm1
	movq	%xmm1, %rbx
	cmpq	%r14, %rax
	je	LBB0_12
	.p2align	4, 0x90
LBB0_11:                                ## =>This Inner Loop Header: Depth=1
	cmpb	$1, (%r15,%rax)
	sbbq	$-1, %rbx
	incq	%rax
	cmpq	%rax, %r14
	jne	LBB0_11
LBB0_12:
	movq	%r15, %rdi
	callq	_free
	movq	%rbx, %rax
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_5:
	pxor	%xmm0, %xmm0
	xorl	%edx, %edx
	pxor	%xmm1, %xmm1
	testb	$1, %cl
	jne	LBB0_9
	jmp	LBB0_10
	.cfi_endproc
                                        ## -- End function
	.comm	_page,8,3                       ## @page
	.comm	_stderr,4,2                     ## @stderr
	.no_dead_strip	_check_residency
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function check_residency
_check_residency:                       ; @check_residency
	.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
	mov	x20, x1
	mov	x21, x0
	mov	x0, x1
	bl	_malloc
	mov	x19, x0
	cmp	x0, #0
	cset	w0, ne
	bl	_ATF_REQUIRE
Lloh0:
	adrp	x8, _page@GOTPAGE
Lloh1:
	ldr	x8, [x8, _page@GOTPAGEOFF]
Lloh2:
	ldr	x8, [x8]
	mul	x1, x8, x20
	mov	x0, x21
	mov	x2, x19
	bl	_mincore
	cmp	x0, #0
	cset	w0, eq
	bl	_ATF_REQUIRE
	cbz	x20, LBB0_3
; %bb.1:
	cmp	x20, #8
	b.hs	LBB0_4
; %bb.2:
	mov	x8, #0
	mov	x21, #0
	b	LBB0_13
LBB0_3:
	mov	x21, #0
	b	LBB0_15
LBB0_4:
	cmp	x20, #16
	b.hs	LBB0_6
; %bb.5:
	mov	x21, #0
	mov	x8, #0
	b	LBB0_10
LBB0_6:
	movi.2d	v0, #0000000000000000
	mov	w8, #1
	dup.2d	v2, x8
	movi.2d	v1, #0000000000000000
	and	x8, x20, #0xfffffffffffffff0
	mov	x9, x8
	mov	x10, x19
	movi.2d	v4, #0000000000000000
	movi.2d	v3, #0000000000000000
	movi.2d	v7, #0000000000000000
	movi.2d	v5, #0000000000000000
	movi.2d	v16, #0000000000000000
	movi.2d	v6, #0000000000000000
LBB0_7:                                 ; =>This Inner Loop Header: Depth=1
	ldr	q17, [x10], #16
	cmtst.16b	v17, v17, v17
	ushll.8h	v18, v17, #0
	ushll.4s	v19, v18, #0
	ushll.2d	v20, v19, #0
	and.16b	v20, v20, v2
	ushll2.2d	v19, v19, #0
	and.16b	v19, v19, v2
	ushll2.4s	v18, v18, #0
	ushll.2d	v21, v18, #0
	and.16b	v21, v21, v2
	ushll2.8h	v17, v17, #0
	ushll.4s	v22, v17, #0
	ushll.2d	v23, v22, #0
	and.16b	v23, v23, v2
	ushll2.2d	v18, v18, #0
	and.16b	v18, v18, v2
	ushll2.2d	v22, v22, #0
	and.16b	v22, v22, v2
	ushll2.4s	v17, v17, #0
	ushll.2d	v24, v17, #0
	and.16b	v24, v24, v2
	ushll2.2d	v17, v17, #0
	and.16b	v17, v17, v2
	add.2d	v6, v6, v17
	add.2d	v16, v16, v24
	add.2d	v5, v5, v22
	add.2d	v3, v3, v18
	add.2d	v7, v7, v23
	add.2d	v4, v4, v21
	add.2d	v1, v1, v19
	add.2d	v0, v0, v20
	subs	x9, x9, #16
	b.ne	LBB0_7
; %bb.8:
	add.2d	v0, v0, v7
	add.2d	v2, v4, v16
	add.2d	v0, v0, v2
	add.2d	v1, v1, v5
	add.2d	v2, v3, v6
	add.2d	v1, v1, v2
	add.2d	v0, v0, v1
	addp.2d	d0, v0
	fmov	x21, d0
	cmp	x8, x20
	b.eq	LBB0_15
; %bb.9:
	tbz	w20, #3, LBB0_13
LBB0_10:
	mov	x10, x8
	and	x8, x20, #0xfffffffffffffff8
	movi.2d	v0, #0000000000000000
	movi.2d	v1, #0000000000000000
	mov.d	v1[0], x21
	add	x9, x19, x10
	sub	x10, x10, x8
	mov	w11, #1
	dup.2d	v2, x11
	movi.2d	v3, #0000000000000000
	movi.2d	v4, #0000000000000000
LBB0_11:                                ; =>This Inner Loop Header: Depth=1
	ldr	d5, [x9], #8
	cmtst.8b	v5, v5, v5
	ushll.8h	v5, v5, #0
	ushll.4s	v6, v5, #0
	ushll.2d	v7, v6, #0
	and.16b	v7, v7, v2
	ushll2.2d	v6, v6, #0
	and.16b	v6, v6, v2
	ushll2.4s	v5, v5, #0
	ushll.2d	v16, v5, #0
	and.16b	v16, v16, v2
	ushll2.2d	v5, v5, #0
	and.16b	v5, v5, v2
	add.2d	v4, v4, v5
	add.2d	v3, v3, v16
	add.2d	v0, v0, v6
	add.2d	v1, v1, v7
	adds	x10, x10, #8
	b.ne	LBB0_11
; %bb.12:
	add.2d	v1, v1, v3
	add.2d	v0, v0, v4
	add.2d	v0, v1, v0
	addp.2d	d0, v0
	fmov	x21, d0
	cmp	x8, x20
	b.eq	LBB0_15
LBB0_13:
	sub	x9, x20, x8
	add	x8, x19, x8
LBB0_14:                                ; =>This Inner Loop Header: Depth=1
	ldrb	w10, [x8], #1
	cmp	w10, #0
	cinc	x21, x21, ne
	subs	x9, x9, #1
	b.ne	LBB0_14
LBB0_15:
	mov	x0, x19
	bl	_free
	mov	x0, x21
	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	Lloh0, Lloh1, Lloh2
	.cfi_endproc
                                        ; -- End function
	.comm	_page,8,3                       ; @page
	.comm	_stderr,4,2                     ; @stderr
	.no_dead_strip	_check_residency
.subsections_via_symbols
