	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_vm_phys_alloc_contig           ## -- Begin function vm_phys_alloc_contig
	.p2align	4, 0x90
_vm_phys_alloc_contig:                  ## @vm_phys_alloc_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	$40, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%r9, %r12
	movq	%r8, %r13
	movq	%rcx, -56(%rbp)                 ## 8-byte Spill
	movq	%rdx, %r15
	movq	%rsi, %rbx
	movl	%edi, %r14d
	xorl	%edi, %edi
	testq	%rsi, %rsi
	setg	%dil
	leaq	L_.str(%rip), %rsi
	callq	_KASSERT
	movq	%r13, %rdi
	callq	_powerof2
	leaq	L_.str.1(%rip), %rsi
	movl	%eax, %edi
	callq	_KASSERT
	movq	%r12, %rdi
	callq	_powerof2
	leaq	L_.str.2(%rip), %rsi
	movl	%eax, %edi
	callq	_KASSERT
	movl	%r14d, %edi
	callq	_VM_DOMAIN
	movl	%eax, %edi
	callq	_vm_domain_free_assert_locked
	movq	-56(%rbp), %rcx                 ## 8-byte Reload
	cmpq	%rcx, %r15
	jge	LBB0_9
## %bb.1:
	movq	%r15, %rdx
	movl	%r14d, -44(%rbp)                ## 4-byte Spill
	movq	_vm_phys_nsegs@GOTPCREL(%rip), %rax
	movl	(%rax), %r15d
	testl	%r15d, %r15d
	jle	LBB0_9
## %bb.2:
	movq	%rbx, -64(%rbp)                 ## 8-byte Spill
	movq	%r13, -72(%rbp)                 ## 8-byte Spill
	movq	%r12, -80(%rbp)                 ## 8-byte Spill
	incq	%r15
	movq	_vm_phys_segs@GOTPCREL(%rip), %rsi
	movl	-44(%rbp), %r12d                ## 4-byte Reload
	jmp	LBB0_3
	.p2align	4, 0x90
LBB0_8:                                 ##   in Loop: Header=BB0_3 Depth=1
	decq	%r15
	cmpq	$1, %r15
	jbe	LBB0_9
LBB0_3:                                 ## =>This Inner Loop Header: Depth=1
	leal	-2(%r15), %eax
	movq	(%rsi), %r14
	leaq	(%rax,%rax,2), %r13
	movq	(%r14,%r13,8), %rax
	cmpq	%rcx, %rax
	jge	LBB0_8
## %bb.4:                               ##   in Loop: Header=BB0_3 Depth=1
	cmpl	%r12d, 8(%r14,%r13,8)
	jne	LBB0_8
## %bb.5:                               ##   in Loop: Header=BB0_3 Depth=1
	movq	16(%r14,%r13,8), %r12
	cmpq	%rdx, %r12
	jle	LBB0_9
## %bb.6:                               ##   in Loop: Header=BB0_3 Depth=1
	cmpq	%rdx, %rax
	cmovleq	%rdx, %rax
	cmpq	%rcx, %r12
	cmovgeq	%rcx, %r12
	subq	%rax, %r12
	movq	-64(%rbp), %rdi                 ## 8-byte Reload
	movq	%rdx, %rbx
	callq	_ptoa
	movq	_vm_phys_segs@GOTPCREL(%rip), %rsi
	movq	-56(%rbp), %rcx                 ## 8-byte Reload
	movq	%rbx, %rdx
	cmpq	%rax, %r12
	movl	-44(%rbp), %r12d                ## 4-byte Reload
	jl	LBB0_8
## %bb.7:                               ##   in Loop: Header=BB0_3 Depth=1
	leaq	(%r14,%r13,8), %rdi
	movq	-64(%rbp), %rsi                 ## 8-byte Reload
	movq	%rbx, %rdx
	movq	-72(%rbp), %r8                  ## 8-byte Reload
	movq	-80(%rbp), %r9                  ## 8-byte Reload
	callq	_vm_phys_alloc_seg_contig
	movq	_vm_phys_segs@GOTPCREL(%rip), %rsi
	movq	-56(%rbp), %rcx                 ## 8-byte Reload
	movq	%rbx, %rdx
	testq	%rax, %rax
	je	LBB0_8
	jmp	LBB0_10
LBB0_9:
	xorl	%eax, %eax
LBB0_10:
	addq	$40, %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_alloc_contig           ; -- Begin function vm_phys_alloc_contig
	.p2align	2
_vm_phys_alloc_contig:                  ; @vm_phys_alloc_contig
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #112
	.cfi_def_cfa_offset 112
	stp	x28, x27, [sp, #16]             ; 16-byte Folded Spill
	stp	x26, x25, [sp, #32]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #48]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #64]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #80]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #96]             ; 16-byte Folded Spill
	add	x29, sp, #96
	.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, x5
	mov	x20, x4
	mov	x21, x3
	mov	x22, x2
	mov	x23, x1
	mov	x24, x0
	cmp	x1, #0
	cset	w0, gt
Lloh0:
	adrp	x1, l_.str@PAGE
Lloh1:
	add	x1, x1, l_.str@PAGEOFF
	bl	_KASSERT
	mov	x0, x20
	bl	_powerof2
Lloh2:
	adrp	x1, l_.str.1@PAGE
Lloh3:
	add	x1, x1, l_.str.1@PAGEOFF
	bl	_KASSERT
	mov	x0, x19
	bl	_powerof2
Lloh4:
	adrp	x1, l_.str.2@PAGE
Lloh5:
	add	x1, x1, l_.str.2@PAGEOFF
	bl	_KASSERT
	mov	x0, x24
	bl	_VM_DOMAIN
	bl	_vm_domain_free_assert_locked
	cmp	x22, x21
	b.ge	LBB0_9
; %bb.1:
Lloh6:
	adrp	x8, _vm_phys_nsegs@GOTPAGE
Lloh7:
	ldr	x8, [x8, _vm_phys_nsegs@GOTPAGEOFF]
Lloh8:
	ldr	w8, [x8]
	cmp	w8, #1
	b.lt	LBB0_9
; %bb.2:
	str	x19, [sp, #8]                   ; 8-byte Folded Spill
	add	x26, x8, #1
Lloh9:
	adrp	x27, _vm_phys_segs@GOTPAGE
Lloh10:
	ldr	x27, [x27, _vm_phys_segs@GOTPAGEOFF]
	mov	w28, #24
	b	LBB0_4
LBB0_3:                                 ;   in Loop: Header=BB0_4 Depth=1
	sub	x26, x26, #1
	cmp	x26, #1
	b.ls	LBB0_9
LBB0_4:                                 ; =>This Inner Loop Header: Depth=1
	sub	w9, w26, #2
	ldr	x10, [x27]
	umaddl	x25, w9, w28, x10
	ldr	x8, [x25]
	cmp	x8, x21
	b.ge	LBB0_3
; %bb.5:                                ;   in Loop: Header=BB0_4 Depth=1
	madd	x11, x9, x28, x10
	ldr	w11, [x11, #8]
	cmp	w11, w24
	b.ne	LBB0_3
; %bb.6:                                ;   in Loop: Header=BB0_4 Depth=1
	madd	x9, x9, x28, x10
	ldr	x9, [x9, #16]
	cmp	x9, x22
	b.le	LBB0_9
; %bb.7:                                ;   in Loop: Header=BB0_4 Depth=1
	cmp	x8, x22
	csel	x8, x8, x22, gt
	cmp	x9, x21
	csel	x9, x9, x21, lt
	sub	x19, x9, x8
	mov	x0, x23
	bl	_ptoa
	cmp	x19, x0
	b.lt	LBB0_3
; %bb.8:                                ;   in Loop: Header=BB0_4 Depth=1
	mov	x0, x25
	mov	x1, x23
	mov	x2, x22
	mov	x3, x21
	mov	x4, x20
	ldr	x5, [sp, #8]                    ; 8-byte Folded Reload
	bl	_vm_phys_alloc_seg_contig
	cbz	x0, LBB0_3
	b	LBB0_10
LBB0_9:
	mov	x0, #0
LBB0_10:
	ldp	x29, x30, [sp, #96]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #80]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #64]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #48]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #32]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #112
	ret
	.loh AdrpAdd	Lloh4, Lloh5
	.loh AdrpAdd	Lloh2, Lloh3
	.loh AdrpAdd	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGot	Lloh9, Lloh10
	.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
