	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_vm_phys_scan_contig            ## -- Begin function vm_phys_scan_contig
	.p2align	4, 0x90
_vm_phys_scan_contig:                   ## @vm_phys_scan_contig
	.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	$56, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%r9, %r14
	movq	%r8, %rbx
	movq	%rcx, %r15
	movq	%rdx, %r12
	movl	%edi, -44(%rbp)                 ## 4-byte Spill
	xorl	%edi, %edi
	movq	%rsi, -72(%rbp)                 ## 8-byte Spill
	testq	%rsi, %rsi
	setg	%dil
	leaq	L_.str(%rip), %rsi
	callq	_KASSERT
	movq	%rbx, -80(%rbp)                 ## 8-byte Spill
	movq	%rbx, %rdi
	callq	_powerof2
	leaq	L_.str.1(%rip), %rsi
	movl	%eax, %edi
	callq	_KASSERT
	movq	%r14, -88(%rbp)                 ## 8-byte Spill
	movq	%r14, %rdi
	callq	_powerof2
	leaq	L_.str.2(%rip), %rsi
	movl	%eax, %edi
	callq	_KASSERT
	xorl	%eax, %eax
	cmpq	%r15, %r12
	jge	LBB0_12
## %bb.1:
	movq	_vm_phys_nsegs@GOTPCREL(%rip), %rdx
	cmpl	$0, (%rdx)
	jle	LBB0_12
## %bb.2:
	movq	%r12, %rdi
	movl	$24, %r12d
	movq	_vm_phys_segs@GOTPCREL(%rip), %rsi
	xorl	%r14d, %r14d
	movq	%rdi, -56(%rbp)                 ## 8-byte Spill
	movl	-44(%rbp), %ecx                 ## 4-byte Reload
	movq	%r15, -64(%rbp)                 ## 8-byte Spill
	jmp	LBB0_3
	.p2align	4, 0x90
LBB0_10:                                ##   in Loop: Header=BB0_3 Depth=1
	incq	%r14
	movslq	(%rdx), %rax
	addq	$32, %r12
	cmpq	%rax, %r14
	jge	LBB0_11
LBB0_3:                                 ## =>This Inner Loop Header: Depth=1
	movq	(%rsi), %rbx
	cmpl	%ecx, -24(%rbx,%r12)
	jne	LBB0_10
## %bb.4:                               ##   in Loop: Header=BB0_3 Depth=1
	movq	-16(%rbx,%r12), %rax
	cmpq	%r15, %rax
	jge	LBB0_11
## %bb.5:                               ##   in Loop: Header=BB0_3 Depth=1
	movq	-8(%rbx,%r12), %r13
	cmpq	%rdi, %r13
	jle	LBB0_10
## %bb.6:                               ##   in Loop: Header=BB0_3 Depth=1
	movq	(%rbx,%r12), %rcx
	cmpq	%rdi, %rax
	jge	LBB0_8
## %bb.7:                               ##   in Loop: Header=BB0_3 Depth=1
	subq	%rax, %rdi
	movq	%rcx, %r13
	callq	_atop
	movq	%r13, %rcx
	leaq	(,%rax,4), %rcx
	addq	%r13, %rcx
	movq	-8(%rbx,%r12), %r13
LBB0_8:                                 ##   in Loop: Header=BB0_3 Depth=1
	movq	%rcx, -96(%rbp)                 ## 8-byte Spill
	cmpq	%r15, %r13
	cmovgeq	%r15, %r13
	movq	%rcx, %rdi
	callq	_VM_PAGE_TO_PHYS
	movq	%r13, %r15
	subq	%rax, %r15
	movq	-72(%rbp), %rdi                 ## 8-byte Reload
	callq	_ptoa
	cmpq	%rax, %r15
	movq	-64(%rbp), %r15                 ## 8-byte Reload
	movq	-56(%rbp), %rdi                 ## 8-byte Reload
	movl	-44(%rbp), %ecx                 ## 4-byte Reload
	movq	_vm_phys_nsegs@GOTPCREL(%rip), %rdx
	movq	_vm_phys_segs@GOTPCREL(%rip), %rsi
	jl	LBB0_10
## %bb.9:                               ##   in Loop: Header=BB0_3 Depth=1
	movq	(%rbx,%r12), %r15
	subq	-16(%rbx,%r12), %r13
	movq	%r13, %rdi
	callq	_atop
	leaq	(%r15,%rax,4), %rdx
	movq	-64(%rbp), %r15                 ## 8-byte Reload
	movq	-72(%rbp), %rdi                 ## 8-byte Reload
	movq	-96(%rbp), %rsi                 ## 8-byte Reload
	movq	-80(%rbp), %rcx                 ## 8-byte Reload
	movq	-88(%rbp), %r8                  ## 8-byte Reload
	movl	16(%rbp), %r9d
	callq	_vm_page_scan_contig
	movq	_vm_phys_segs@GOTPCREL(%rip), %rsi
	movq	_vm_phys_nsegs@GOTPCREL(%rip), %rdx
	movl	-44(%rbp), %ecx                 ## 4-byte Reload
	movq	-56(%rbp), %rdi                 ## 8-byte Reload
	testq	%rax, %rax
	je	LBB0_10
	jmp	LBB0_12
LBB0_11:
	xorl	%eax, %eax
LBB0_12:
	addq	$56, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"npages is 0"

L_.str.1:                               ## @.str.1
	.asciz	"alignment is not a power of 2"

L_.str.2:                               ## @.str.2
	.asciz	"boundary is not a power of 2"

	.comm	_vm_phys_nsegs,4,2              ## @vm_phys_nsegs
	.comm	_vm_phys_segs,8,3               ## @vm_phys_segs
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_vm_phys_scan_contig            ; -- Begin function vm_phys_scan_contig
	.p2align	2
_vm_phys_scan_contig:                   ; @vm_phys_scan_contig
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #144
	.cfi_def_cfa_offset 144
	stp	x28, x27, [sp, #48]             ; 16-byte Folded Spill
	stp	x26, x25, [sp, #64]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #80]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #96]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #112]            ; 16-byte Folded Spill
	stp	x29, x30, [sp, #128]            ; 16-byte Folded Spill
	add	x29, sp, #128
	.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
	str	w6, [sp, #28]                   ; 4-byte Folded Spill
	mov	x19, x5
	mov	x20, x4
	mov	x22, x3
	mov	x21, x2
	mov	x25, x0
	str	x1, [sp, #40]                   ; 8-byte Folded Spill
	cmp	x1, #0
	cset	w0, gt
Lloh0:
	adrp	x1, l_.str@PAGE
Lloh1:
	add	x1, x1, l_.str@PAGEOFF
	bl	_KASSERT
	str	x20, [sp, #8]                   ; 8-byte Folded Spill
	mov	x0, x20
	bl	_powerof2
Lloh2:
	adrp	x1, l_.str.1@PAGE
Lloh3:
	add	x1, x1, l_.str.1@PAGEOFF
	bl	_KASSERT
	str	x19, [sp, #16]                  ; 8-byte Folded Spill
	mov	x0, x19
	bl	_powerof2
Lloh4:
	adrp	x1, l_.str.2@PAGE
Lloh5:
	add	x1, x1, l_.str.2@PAGEOFF
	bl	_KASSERT
	mov	x0, #0
	cmp	x21, x22
	b.ge	LBB0_12
; %bb.1:
Lloh6:
	adrp	x27, _vm_phys_nsegs@GOTPAGE
Lloh7:
	ldr	x27, [x27, _vm_phys_nsegs@GOTPAGEOFF]
	ldr	w8, [x27]
	cmp	w8, #1
	b.lt	LBB0_12
; %bb.2:
	mov	x12, x21
	mov	x28, #0
	mov	x19, #0
Lloh8:
	adrp	x11, _vm_phys_segs@GOTPAGE
Lloh9:
	ldr	x11, [x11, _vm_phys_segs@GOTPAGEOFF]
	str	x21, [sp, #32]                  ; 8-byte Folded Spill
	b	LBB0_4
LBB0_3:                                 ;   in Loop: Header=BB0_4 Depth=1
	add	x19, x19, #1
	ldrsw	x8, [x27]
	add	x28, x28, #32
	cmp	x19, x8
	b.ge	LBB0_11
LBB0_4:                                 ; =>This Inner Loop Header: Depth=1
	ldr	x9, [x11]
	ldr	w8, [x9, x28]
	cmp	w8, w25
	b.ne	LBB0_3
; %bb.5:                                ;   in Loop: Header=BB0_4 Depth=1
	add	x21, x9, x28
	ldr	x10, [x21, #8]
	cmp	x10, x22
	b.ge	LBB0_11
; %bb.6:                                ;   in Loop: Header=BB0_4 Depth=1
	ldr	x8, [x21, #16]
	cmp	x8, x12
	b.le	LBB0_3
; %bb.7:                                ;   in Loop: Header=BB0_4 Depth=1
	mov	x23, x11
	add	x24, x9, x28
	ldr	x26, [x24, #24]
	cmp	x10, x12
	b.ge	LBB0_9
; %bb.8:                                ;   in Loop: Header=BB0_4 Depth=1
	sub	x0, x12, x10
	bl	_atop
	add	x26, x26, x0, lsl #2
	ldr	x8, [x21, #16]
LBB0_9:                                 ;   in Loop: Header=BB0_4 Depth=1
	cmp	x8, x22
	csel	x20, x8, x22, lt
	mov	x0, x26
	bl	_VM_PAGE_TO_PHYS
	sub	x27, x20, x0
	ldr	x0, [sp, #40]                   ; 8-byte Folded Reload
	bl	_ptoa
	cmp	x27, x0
Lloh10:
	adrp	x27, _vm_phys_nsegs@GOTPAGE
Lloh11:
	ldr	x27, [x27, _vm_phys_nsegs@GOTPAGEOFF]
	mov	x11, x23
	ldr	x12, [sp, #32]                  ; 8-byte Folded Reload
	b.lt	LBB0_3
; %bb.10:                               ;   in Loop: Header=BB0_4 Depth=1
	ldr	x24, [x24, #24]
	ldr	x8, [x21, #8]
	sub	x0, x20, x8
	bl	_atop
	add	x2, x24, x0, lsl #2
	ldr	x0, [sp, #40]                   ; 8-byte Folded Reload
	mov	x1, x26
	ldp	x3, x4, [sp, #8]                ; 16-byte Folded Reload
	ldr	w5, [sp, #28]                   ; 4-byte Folded Reload
	bl	_vm_page_scan_contig
	ldr	x12, [sp, #32]                  ; 8-byte Folded Reload
	mov	x11, x23
	cbz	x0, LBB0_3
	b	LBB0_12
LBB0_11:
	mov	x0, #0
LBB0_12:
	ldp	x29, x30, [sp, #128]            ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #112]            ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #96]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #80]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #64]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp, #48]             ; 16-byte Folded Reload
	add	sp, sp, #144
	ret
	.loh AdrpAdd	Lloh4, Lloh5
	.loh AdrpAdd	Lloh2, Lloh3
	.loh AdrpAdd	Lloh0, Lloh1
	.loh AdrpLdrGot	Lloh6, Lloh7
	.loh AdrpLdrGot	Lloh8, Lloh9
	.loh AdrpLdrGot	Lloh10, Lloh11
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"npages is 0"

l_.str.1:                               ; @.str.1
	.asciz	"alignment is not a power of 2"

l_.str.2:                               ; @.str.2
	.asciz	"boundary is not a power of 2"

	.comm	_vm_phys_nsegs,4,2              ; @vm_phys_nsegs
	.comm	_vm_phys_segs,8,3               ; @vm_phys_segs
.subsections_via_symbols
