	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_vm_object_madvise              ## -- Begin function vm_object_madvise
	.p2align	4, 0x90
_vm_object_madvise:                     ## @vm_object_madvise
	.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, -80(%rbp)                 ## 8-byte Spill
	testq	%rdi, %rdi
	je	LBB0_33
## %bb.1:
	movl	%ecx, %r14d
	movq	%rsi, %rbx
	movq	%rdi, %r15
	callq	_VM_OBJECT_WLOCK
	movq	%r15, %rdi
	movl	%r14d, -44(%rbp)                ## 4-byte Spill
	movl	%r14d, %esi
	callq	_vm_object_advice_applies
	testl	%eax, %eax
	je	LBB0_35
## %bb.2:
	movq	%r15, -64(%rbp)                 ## 8-byte Spill
LBB0_3:                                 ## =>This Loop Header: Depth=1
                                        ##     Child Loop BB0_6 Depth 2
                                        ##       Child Loop BB0_13 Depth 3
	movq	%r15, %rdi
	movq	%rbx, %rsi
	callq	_vm_page_find_least
	cmpq	-80(%rbp), %rbx                 ## 8-byte Folded Reload
	jge	LBB0_35
## %bb.4:                               ##   in Loop: Header=BB0_3 Depth=1
	movq	%rax, %r12
	jmp	LBB0_6
	.p2align	4, 0x90
LBB0_22:                                ##   in Loop: Header=BB0_6 Depth=2
	movq	%r13, %r12
	cmpq	%r15, %r14
	je	LBB0_5
LBB0_27:                                ##   in Loop: Header=BB0_6 Depth=2
	movq	%r14, %rdi
	callq	_VM_OBJECT_WUNLOCK
LBB0_5:                                 ##   in Loop: Header=BB0_6 Depth=2
	incq	%rbx
	cmpq	-80(%rbp), %rbx                 ## 8-byte Folded Reload
	jge	LBB0_35
LBB0_6:                                 ##   Parent Loop BB0_3 Depth=1
                                        ## =>  This Loop Header: Depth=2
                                        ##       Child Loop BB0_13 Depth 3
	testq	%r12, %r12
	je	LBB0_12
## %bb.7:                               ##   in Loop: Header=BB0_6 Depth=2
	movq	(%r12), %r14
	cmpq	%rbx, %r14
	jle	LBB0_11
## %bb.8:                               ##   in Loop: Header=BB0_6 Depth=2
	movq	%r12, -72(%rbp)                 ## 8-byte Spill
	cmpq	$0, 8(%r15)
	movq	%rbx, -56(%rbp)                 ## 8-byte Spill
	movq	%rbx, %r12
	movl	-44(%rbp), %ebx                 ## 4-byte Reload
	jne	LBB0_13
## %bb.9:                               ##   in Loop: Header=BB0_6 Depth=2
	cmpq	-80(%rbp), %r14                 ## 8-byte Folded Reload
	jge	LBB0_34
## %bb.10:                              ##   in Loop: Header=BB0_6 Depth=2
	movl	%r14d, %ecx
	movq	-56(%rbp), %rdx                 ## 8-byte Reload
	subl	%edx, %ecx
	movq	-64(%rbp), %r15                 ## 8-byte Reload
	movq	%r15, %rdi
	movl	%ebx, %esi
	callq	_vm_object_madvise_freespace
	movq	%r14, %rbx
	movq	-72(%rbp), %r12                 ## 8-byte Reload
LBB0_11:                                ##   in Loop: Header=BB0_6 Depth=2
	movq	_listq@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r12, %rdi
	callq	_TAILQ_NEXT
	movq	%rax, %r13
	movq	%r15, %r14
	jmp	LBB0_19
	.p2align	4, 0x90
LBB0_12:                                ##   in Loop: Header=BB0_6 Depth=2
	movq	%r12, -72(%rbp)                 ## 8-byte Spill
	cmpq	$0, 8(%r15)
	movq	%rbx, -56(%rbp)                 ## 8-byte Spill
	movq	%rbx, %r12
	movl	-44(%rbp), %ebx                 ## 4-byte Reload
	je	LBB0_34
	.p2align	4, 0x90
LBB0_13:                                ##   Parent Loop BB0_3 Depth=1
                                        ##     Parent Loop BB0_6 Depth=2
                                        ## =>    This Inner Loop Header: Depth=3
	movq	%r15, %rdi
	movl	%ebx, %esi
	movq	%r12, %rdx
	movl	$1, %ecx
	callq	_vm_object_madvise_freespace
	movq	8(%r15), %r14
	testq	%r14, %r14
	je	LBB0_23
## %bb.14:                              ##   in Loop: Header=BB0_13 Depth=3
	movq	%r14, %rdi
	callq	_VM_OBJECT_WLOCK
	movl	(%r15), %edi
	callq	_OFF_TO_IDX
	movq	%rax, %r13
	cmpq	-64(%rbp), %r15                 ## 8-byte Folded Reload
	je	LBB0_16
## %bb.15:                              ##   in Loop: Header=BB0_13 Depth=3
	movq	%r15, %rdi
	callq	_VM_OBJECT_WUNLOCK
LBB0_16:                                ##   in Loop: Header=BB0_13 Depth=3
	movq	%r14, %rdi
	movl	%ebx, %esi
	callq	_vm_object_advice_applies
	testl	%eax, %eax
	je	LBB0_24
## %bb.17:                              ##   in Loop: Header=BB0_13 Depth=3
	addq	%r13, %r12
	movq	%r14, %rdi
	movq	%r12, %rsi
	callq	_vm_page_lookup
	movq	%r14, %r15
	testq	%rax, %rax
	je	LBB0_13
## %bb.18:                              ##   in Loop: Header=BB0_6 Depth=2
	movq	-72(%rbp), %r13                 ## 8-byte Reload
	movq	%rax, %r12
	movq	-64(%rbp), %r15                 ## 8-byte Reload
	movq	-56(%rbp), %rbx                 ## 8-byte Reload
LBB0_19:                                ##   in Loop: Header=BB0_6 Depth=2
	movq	%r12, %rdi
	callq	_vm_page_all_valid
	testl	%eax, %eax
	je	LBB0_22
## %bb.20:                              ##   in Loop: Header=BB0_6 Depth=2
	movq	%r12, %rdi
	callq	_vm_page_wired
	testq	%rax, %rax
	jne	LBB0_22
## %bb.25:                              ##   in Loop: Header=BB0_6 Depth=2
	movq	_PG_FICTITIOUS@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	xorl	%edi, %edi
	andl	8(%r12), %eax
	sete	%dil
	movq	%r12, %rsi
	callq	_KASSERT
	movq	_VPO_UNMANAGED@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	xorl	%edi, %edi
	andl	12(%r12), %eax
	sete	%dil
	movq	%r12, %rsi
	callq	_KASSERT
	movq	%r12, %rdi
	callq	_vm_page_tryxbusy
	testq	%rax, %rax
	je	LBB0_28
## %bb.26:                              ##   in Loop: Header=BB0_6 Depth=2
	movq	%r12, %rdi
	callq	_vm_page_lock
	movq	%r12, %rdi
	movq	%r13, -56(%rbp)                 ## 8-byte Spill
	movq	%r12, %r13
	movl	-44(%rbp), %r12d                ## 4-byte Reload
	movl	%r12d, %esi
	callq	_vm_page_advise
	movq	%r13, %rdi
	callq	_vm_page_unlock
	movq	%r13, %rdi
	callq	_vm_page_xunbusy
	movq	(%r13), %rdx
	movq	%r14, %rdi
	movl	%r12d, %esi
	movl	$1, %ecx
	callq	_vm_object_madvise_freespace
	movq	-56(%rbp), %r12                 ## 8-byte Reload
	cmpq	%r15, %r14
	jne	LBB0_27
	jmp	LBB0_5
LBB0_23:                                ##   in Loop: Header=BB0_6 Depth=2
	movq	%r15, %r14
LBB0_24:                                ##   in Loop: Header=BB0_6 Depth=2
	movq	-64(%rbp), %r15                 ## 8-byte Reload
	movq	-56(%rbp), %rbx                 ## 8-byte Reload
	movq	-72(%rbp), %r12                 ## 8-byte Reload
	cmpq	%r15, %r14
	jne	LBB0_27
	jmp	LBB0_5
LBB0_28:                                ##   in Loop: Header=BB0_3 Depth=1
	cmpq	%r15, %r14
	je	LBB0_30
## %bb.29:                              ##   in Loop: Header=BB0_3 Depth=1
	movq	%r15, %rdi
	callq	_VM_OBJECT_WUNLOCK
LBB0_30:                                ##   in Loop: Header=BB0_3 Depth=1
	movl	-44(%rbp), %eax                 ## 4-byte Reload
	movq	_MADV_WILLNEED@GOTPCREL(%rip), %rcx
	cmpl	%eax, (%rcx)
	jne	LBB0_32
## %bb.31:                              ##   in Loop: Header=BB0_3 Depth=1
	movq	_PGA_REFERENCED@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r12, %rdi
	callq	_vm_page_aflag_set
LBB0_32:                                ##   in Loop: Header=BB0_3 Depth=1
	movq	%r12, %rdi
	leaq	L_.str.2(%rip), %rsi
	xorl	%edx, %edx
	callq	_vm_page_busy_sleep
	movq	%r15, %rdi
	callq	_VM_OBJECT_WLOCK
	movq	%r15, %rdi
	movl	-44(%rbp), %esi                 ## 4-byte Reload
	callq	_vm_object_advice_applies
	testl	%eax, %eax
	jne	LBB0_3
	jmp	LBB0_35
LBB0_33:
	addq	$40, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_34:
	movq	-80(%rbp), %rcx                 ## 8-byte Reload
	movq	-56(%rbp), %rdx                 ## 8-byte Reload
	subl	%edx, %ecx
	movq	-64(%rbp), %r15                 ## 8-byte Reload
	movq	%r15, %rdi
	movl	%ebx, %esi
                                        ## kill: def $ecx killed $ecx killed $rcx
	callq	_vm_object_madvise_freespace
LBB0_35:
	movq	%r15, %rdi
	addq	$40, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_VM_OBJECT_WUNLOCK              ## TAILCALL
	.cfi_endproc
                                        ## -- End function
	.comm	_listq,4,2                      ## @listq
	.comm	_PG_FICTITIOUS,4,2              ## @PG_FICTITIOUS
	.comm	_VPO_UNMANAGED,4,2              ## @VPO_UNMANAGED
	.comm	_MADV_WILLNEED,4,2              ## @MADV_WILLNEED
	.comm	_PGA_REFERENCED,4,2             ## @PGA_REFERENCED
	.section	__TEXT,__cstring,cstring_literals
L_.str.2:                               ## @.str.2
	.asciz	"madvpo"

.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_vm_object_madvise              ; -- Begin function vm_object_madvise
	.p2align	2
_vm_object_madvise:                     ; @vm_object_madvise
	.cfi_startproc
; %bb.0:
	cbz	x0, LBB0_32
; %bb.1:
	stp	x28, x27, [sp, #-96]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 96
	stp	x26, x25, [sp, #16]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #32]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #48]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #64]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #80]             ; 16-byte Folded Spill
	add	x29, sp, #80
	.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
	.cfi_remember_state
	mov	x20, x3
	mov	x21, x2
	mov	x22, x1
	mov	x19, x0
	bl	_VM_OBJECT_WLOCK
	mov	x0, x19
	mov	x1, x20
	bl	_vm_object_advice_applies
	cbz	w0, LBB0_34
; %bb.2:
Lloh0:
	adrp	x23, _listq@GOTPAGE
Lloh1:
	ldr	x23, [x23, _listq@GOTPAGEOFF]
LBB0_3:                                 ; =>This Loop Header: Depth=1
                                        ;     Child Loop BB0_6 Depth 2
                                        ;       Child Loop BB0_13 Depth 3
	mov	x0, x19
	mov	x1, x22
	bl	_vm_page_find_least
	cmp	x22, x21
	b.ge	LBB0_34
; %bb.4:                                ;   in Loop: Header=BB0_3 Depth=1
	mov	x24, x0
	b	LBB0_6
LBB0_5:                                 ;   in Loop: Header=BB0_6 Depth=2
	add	x22, x22, #1
	cmp	x22, x21
	b.ge	LBB0_34
LBB0_6:                                 ;   Parent Loop BB0_3 Depth=1
                                        ; =>  This Loop Header: Depth=2
                                        ;       Child Loop BB0_13 Depth 3
	cbz	x24, LBB0_12
; %bb.7:                                ;   in Loop: Header=BB0_6 Depth=2
	ldr	x25, [x24]
	cmp	x25, x22
	b.le	LBB0_11
; %bb.8:                                ;   in Loop: Header=BB0_6 Depth=2
	ldr	x8, [x19, #8]
	mov	x26, x22
	mov	x27, x19
	cbnz	x8, LBB0_13
; %bb.9:                                ;   in Loop: Header=BB0_6 Depth=2
	cmp	x25, x21
	b.ge	LBB0_33
; %bb.10:                               ;   in Loop: Header=BB0_6 Depth=2
	sub	w3, w25, w22
	mov	x0, x19
	mov	x1, x20
	mov	x2, x22
	bl	_vm_object_madvise_freespace
	mov	x22, x25
LBB0_11:                                ;   in Loop: Header=BB0_6 Depth=2
	ldr	w1, [x23]
	mov	x0, x24
	bl	_TAILQ_NEXT
	mov	x26, x0
	mov	x25, x19
	b	LBB0_19
LBB0_12:                                ;   in Loop: Header=BB0_6 Depth=2
	ldr	x8, [x19, #8]
	mov	x26, x22
	mov	x27, x19
	cbz	x8, LBB0_33
LBB0_13:                                ;   Parent Loop BB0_3 Depth=1
                                        ;     Parent Loop BB0_6 Depth=2
                                        ; =>    This Inner Loop Header: Depth=3
	mov	x0, x27
	mov	x1, x20
	mov	x2, x26
	mov	w3, #1
	bl	_vm_object_madvise_freespace
	ldr	x25, [x27, #8]
	cbz	x25, LBB0_26
; %bb.14:                               ;   in Loop: Header=BB0_13 Depth=3
	mov	x0, x25
	bl	_VM_OBJECT_WLOCK
	ldr	w0, [x27]
	bl	_OFF_TO_IDX
	mov	x28, x0
	cmp	x27, x19
	b.eq	LBB0_16
; %bb.15:                               ;   in Loop: Header=BB0_13 Depth=3
	mov	x0, x27
	bl	_VM_OBJECT_WUNLOCK
LBB0_16:                                ;   in Loop: Header=BB0_13 Depth=3
	mov	x0, x25
	mov	x1, x20
	bl	_vm_object_advice_applies
	cbz	w0, LBB0_24
; %bb.17:                               ;   in Loop: Header=BB0_13 Depth=3
	add	x26, x28, x26
	mov	x0, x25
	mov	x1, x26
	bl	_vm_page_lookup
	mov	x27, x25
	cbz	x0, LBB0_13
; %bb.18:                               ;   in Loop: Header=BB0_6 Depth=2
	mov	x26, x24
	mov	x24, x0
LBB0_19:                                ;   in Loop: Header=BB0_6 Depth=2
	mov	x0, x24
	bl	_vm_page_all_valid
	cbz	w0, LBB0_23
; %bb.20:                               ;   in Loop: Header=BB0_6 Depth=2
	mov	x0, x24
	bl	_vm_page_wired
	cbnz	x0, LBB0_23
; %bb.21:                               ;   in Loop: Header=BB0_6 Depth=2
	ldr	w8, [x24, #8]
Lloh2:
	adrp	x9, _PG_FICTITIOUS@GOTPAGE
Lloh3:
	ldr	x9, [x9, _PG_FICTITIOUS@GOTPAGEOFF]
Lloh4:
	ldr	w9, [x9]
	tst	w9, w8
	cset	w0, eq
	mov	x1, x24
	bl	_KASSERT
	ldr	w8, [x24, #12]
Lloh5:
	adrp	x9, _VPO_UNMANAGED@GOTPAGE
Lloh6:
	ldr	x9, [x9, _VPO_UNMANAGED@GOTPAGEOFF]
Lloh7:
	ldr	w9, [x9]
	tst	w9, w8
	cset	w0, eq
	mov	x1, x24
	bl	_KASSERT
	mov	x0, x24
	bl	_vm_page_tryxbusy
	cbz	x0, LBB0_27
; %bb.22:                               ;   in Loop: Header=BB0_6 Depth=2
	mov	x0, x24
	bl	_vm_page_lock
	mov	x0, x24
	mov	x1, x20
	bl	_vm_page_advise
	mov	x0, x24
	bl	_vm_page_unlock
	mov	x0, x24
	bl	_vm_page_xunbusy
	ldr	x2, [x24]
	mov	x0, x25
	mov	x1, x20
	mov	w3, #1
	bl	_vm_object_madvise_freespace
LBB0_23:                                ;   in Loop: Header=BB0_6 Depth=2
	mov	x24, x26
LBB0_24:                                ;   in Loop: Header=BB0_6 Depth=2
	cmp	x25, x19
	b.eq	LBB0_5
LBB0_25:                                ;   in Loop: Header=BB0_6 Depth=2
	mov	x0, x25
	bl	_VM_OBJECT_WUNLOCK
	b	LBB0_5
LBB0_26:                                ;   in Loop: Header=BB0_6 Depth=2
	mov	x25, x27
	cmp	x25, x19
	b.ne	LBB0_25
	b	LBB0_5
LBB0_27:                                ;   in Loop: Header=BB0_3 Depth=1
	cmp	x25, x19
	b.eq	LBB0_29
; %bb.28:                               ;   in Loop: Header=BB0_3 Depth=1
	mov	x0, x19
	bl	_VM_OBJECT_WUNLOCK
LBB0_29:                                ;   in Loop: Header=BB0_3 Depth=1
Lloh8:
	adrp	x8, _MADV_WILLNEED@GOTPAGE
Lloh9:
	ldr	x8, [x8, _MADV_WILLNEED@GOTPAGEOFF]
Lloh10:
	ldr	w8, [x8]
	cmp	w8, w20
	b.ne	LBB0_31
; %bb.30:                               ;   in Loop: Header=BB0_3 Depth=1
Lloh11:
	adrp	x8, _PGA_REFERENCED@GOTPAGE
Lloh12:
	ldr	x8, [x8, _PGA_REFERENCED@GOTPAGEOFF]
Lloh13:
	ldr	w1, [x8]
	mov	x0, x24
	bl	_vm_page_aflag_set
LBB0_31:                                ;   in Loop: Header=BB0_3 Depth=1
	mov	x0, x24
Lloh14:
	adrp	x1, l_.str.2@PAGE
Lloh15:
	add	x1, x1, l_.str.2@PAGEOFF
	mov	w2, #0
	bl	_vm_page_busy_sleep
	mov	x0, x19
	bl	_VM_OBJECT_WLOCK
	mov	x0, x19
	mov	x1, x20
	bl	_vm_object_advice_applies
	cbnz	w0, LBB0_3
	b	LBB0_34
LBB0_32:
	.cfi_def_cfa wsp, 0
	.cfi_same_value w30
	.cfi_same_value w29
	.cfi_same_value w19
	.cfi_same_value w20
	.cfi_same_value w21
	.cfi_same_value w22
	.cfi_same_value w23
	.cfi_same_value w24
	.cfi_same_value w25
	.cfi_same_value w26
	.cfi_same_value w27
	.cfi_same_value w28
	ret
LBB0_33:
	.cfi_restore_state
	sub	w3, w21, w22
	mov	x0, x19
	mov	x1, x20
	mov	x2, x22
	bl	_vm_object_madvise_freespace
LBB0_34:
	mov	x0, x19
	ldp	x29, x30, [sp, #80]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #64]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #48]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #32]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #16]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp], #96             ; 16-byte Folded Reload
	b	_VM_OBJECT_WUNLOCK
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.loh AdrpAdd	Lloh14, Lloh15
	.cfi_endproc
                                        ; -- End function
	.comm	_listq,4,2                      ; @listq
	.comm	_PG_FICTITIOUS,4,2              ; @PG_FICTITIOUS
	.comm	_VPO_UNMANAGED,4,2              ; @VPO_UNMANAGED
	.comm	_MADV_WILLNEED,4,2              ; @MADV_WILLNEED
	.comm	_PGA_REFERENCED,4,2             ; @PGA_REFERENCED
	.section	__TEXT,__cstring,cstring_literals
l_.str.2:                               ; @.str.2
	.asciz	"madvpo"

.subsections_via_symbols
