	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_vm_page_busy_tryupgrade        ## -- Begin function vm_page_busy_tryupgrade
	.p2align	4, 0x90
_vm_page_busy_tryupgrade:               ## @vm_page_busy_tryupgrade
	.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
	pushq	%rax
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdi, %r12
	callq	_vm_page_assert_sbusied
	movl	(%r12), %edi
	movl	%edi, -44(%rbp)
	callq	_VPB_SHARERS
	cmpl	$1, %eax
	jg	LBB0_4
## %bb.1:
	movq	_VPB_BIT_WAITERS@GOTPCREL(%rip), %r13
	leaq	-44(%rbp), %r15
	movl	$1, %ebx
	.p2align	4, 0x90
LBB0_2:                                 ## =>This Inner Loop Header: Depth=1
	movl	(%r13), %r14d
	notl	%r14d
	andl	-44(%rbp), %r14d
	movl	$1, %edi
	callq	_VPB_SHARERS_WORD
	xorl	%edi, %edi
	cmpl	%eax, %r14d
	sete	%dil
	leaq	L_.str(%rip), %rsi
	callq	_KASSERT
	movl	(%r13), %edx
	andl	-44(%rbp), %edx
	movq	_VPB_SINGLE_EXCLUSIVER@GOTPCREL(%rip), %rax
	orl	(%rax), %edx
	movq	%r12, %rdi
	movq	%r15, %rsi
	callq	_atomic_fcmpset_acq_int
	testl	%eax, %eax
	jne	LBB0_5
## %bb.3:                               ##   in Loop: Header=BB0_2 Depth=1
	movl	-44(%rbp), %edi
	callq	_VPB_SHARERS
	cmpl	$2, %eax
	jl	LBB0_2
LBB0_4:
	xorl	%ebx, %ebx
LBB0_5:
	movl	%ebx, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_VPB_BIT_WAITERS,4,2            ## @VPB_BIT_WAITERS
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"vm_page_busy_tryupgrade: invalid lock state"

	.comm	_VPB_SINGLE_EXCLUSIVER,4,2      ## @VPB_SINGLE_EXCLUSIVER
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_vm_page_busy_tryupgrade        ; -- Begin function vm_page_busy_tryupgrade
	.p2align	2
_vm_page_busy_tryupgrade:               ; @vm_page_busy_tryupgrade
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #80
	.cfi_def_cfa_offset 80
	stp	x24, x23, [sp, #16]             ; 16-byte Folded Spill
	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
	.cfi_offset w23, -56
	.cfi_offset w24, -64
	mov	x19, x0
	bl	_vm_page_assert_sbusied
	ldr	w0, [x19]
	str	w0, [sp, #12]
	bl	_VPB_SHARERS
	cmp	w0, #1
	b.gt	LBB0_4
; %bb.1:
Lloh0:
	adrp	x22, _VPB_BIT_WAITERS@GOTPAGE
Lloh1:
	ldr	x22, [x22, _VPB_BIT_WAITERS@GOTPAGEOFF]
Lloh2:
	adrp	x20, l_.str@PAGE
Lloh3:
	add	x20, x20, l_.str@PAGEOFF
Lloh4:
	adrp	x23, _VPB_SINGLE_EXCLUSIVER@GOTPAGE
Lloh5:
	ldr	x23, [x23, _VPB_SINGLE_EXCLUSIVER@GOTPAGEOFF]
	mov	w21, #1
LBB0_2:                                 ; =>This Inner Loop Header: Depth=1
	ldr	w8, [sp, #12]
	ldr	w9, [x22]
	bic	w24, w8, w9
	mov	w0, #1
	bl	_VPB_SHARERS_WORD
	cmp	w24, w0
	cset	w0, eq
	mov	x1, x20
	bl	_KASSERT
	ldr	w8, [x23]
	ldr	w9, [sp, #12]
	ldr	w10, [x22]
	and	w9, w10, w9
	orr	w2, w9, w8
	add	x1, sp, #12
	mov	x0, x19
	bl	_atomic_fcmpset_acq_int
	cbnz	w0, LBB0_5
; %bb.3:                                ;   in Loop: Header=BB0_2 Depth=1
	ldr	w0, [sp, #12]
	bl	_VPB_SHARERS
	cmp	w0, #2
	b.lt	LBB0_2
LBB0_4:
	mov	w21, #0
LBB0_5:
	mov	x0, x21
	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
	ldp	x24, x23, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #80
	ret
	.loh AdrpLdrGot	Lloh4, Lloh5
	.loh AdrpAdd	Lloh2, Lloh3
	.loh AdrpLdrGot	Lloh0, Lloh1
	.cfi_endproc
                                        ; -- End function
	.comm	_VPB_BIT_WAITERS,4,2            ; @VPB_BIT_WAITERS
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"vm_page_busy_tryupgrade: invalid lock state"

	.comm	_VPB_SINGLE_EXCLUSIVER,4,2      ; @VPB_SINGLE_EXCLUSIVER
.subsections_via_symbols
