	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_mem_valid                      ## -- Begin function mem_valid
	.p2align	4, 0x90
_mem_valid:                             ## @mem_valid
	.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
	subq	$24, %rsp
	.cfi_offset %rbx, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movl	%esi, %r14d
	movq	%rdi, %rbx
	movq	_npregions@GOTPCREL(%rip), %r15
	movl	(%r15), %edx
	testl	%edx, %edx
	je	LBB0_1
## %bb.2:
	testl	%edx, %edx
	jg	LBB0_3
	jmp	LBB0_8
LBB0_1:
	leaq	-48(%rbp), %rdi
	leaq	-28(%rbp), %rsi
	leaq	-40(%rbp), %rdx
	leaq	-32(%rbp), %rcx
	callq	_mem_regions
	movl	(%r15), %edx
	testl	%edx, %edx
	jle	LBB0_8
LBB0_3:
	movq	_pregions@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movslq	%r14d, %rcx
	addq	%rbx, %rcx
	movl	%edx, %edx
	shlq	$4, %rdx
	xorl	%esi, %esi
	jmp	LBB0_4
	.p2align	4, 0x90
LBB0_7:                                 ##   in Loop: Header=BB0_4 Depth=1
	addq	$16, %rsi
	cmpq	%rsi, %rdx
	je	LBB0_8
LBB0_4:                                 ## =>This Inner Loop Header: Depth=1
	movq	(%rax,%rsi), %rdi
	cmpq	%rbx, %rdi
	jg	LBB0_7
## %bb.5:                               ##   in Loop: Header=BB0_4 Depth=1
	addq	8(%rax,%rsi), %rdi
	cmpq	%rdi, %rcx
	jg	LBB0_7
## %bb.6:
	xorl	%eax, %eax
	jmp	LBB0_9
LBB0_8:
	movq	_EFAULT@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
LBB0_9:
	addq	$24, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_npregions,4,2                  ## @npregions
	.comm	_pregions,8,3                   ## @pregions
	.comm	_EFAULT,4,2                     ## @EFAULT
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_mem_valid                      ; -- Begin function mem_valid
	.p2align	2
_mem_valid:                             ; @mem_valid
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #80
	.cfi_def_cfa_offset 80
	stp	x22, x21, [sp, #32]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #48]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #64]             ; 16-byte Folded Spill
	add	x29, sp, #64
	.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	x19, x0
Lloh0:
	adrp	x21, _npregions@GOTPAGE
Lloh1:
	ldr	x21, [x21, _npregions@GOTPAGEOFF]
	ldr	w9, [x21]
	cbz	w9, LBB0_2
; %bb.1:
	cmp	w9, #1
	b.ge	LBB0_3
	b	LBB0_8
LBB0_2:
	add	x0, sp, #24
	add	x1, sp, #8
	add	x2, sp, #16
	add	x3, sp, #12
	bl	_mem_regions
	ldr	w9, [x21]
	cmp	w9, #1
	b.lt	LBB0_8
LBB0_3:
Lloh2:
	adrp	x8, _pregions@GOTPAGE
Lloh3:
	ldr	x8, [x8, _pregions@GOTPAGEOFF]
Lloh4:
	ldr	x10, [x8]
	add	x8, x19, w20, sxtw
	mov	w9, w9
	add	x10, x10, #8
	b	LBB0_5
LBB0_4:                                 ;   in Loop: Header=BB0_5 Depth=1
	add	x10, x10, #16
	subs	x9, x9, #1
	b.eq	LBB0_8
LBB0_5:                                 ; =>This Inner Loop Header: Depth=1
	ldur	x11, [x10, #-8]
	cmp	x11, x19
	b.gt	LBB0_4
; %bb.6:                                ;   in Loop: Header=BB0_5 Depth=1
	ldr	x12, [x10]
	add	x11, x12, x11
	cmp	x8, x11
	b.gt	LBB0_4
; %bb.7:
	mov	w0, #0
	b	LBB0_9
LBB0_8:
Lloh5:
	adrp	x8, _EFAULT@GOTPAGE
Lloh6:
	ldr	x8, [x8, _EFAULT@GOTPAGEOFF]
Lloh7:
	ldr	w0, [x8]
LBB0_9:
	ldp	x29, x30, [sp, #64]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #48]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #32]             ; 16-byte Folded Reload
	add	sp, sp, #80
	ret
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.cfi_endproc
                                        ; -- End function
	.comm	_npregions,4,2                  ; @npregions
	.comm	_pregions,8,3                   ; @pregions
	.comm	_EFAULT,4,2                     ; @EFAULT
.subsections_via_symbols
