	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	__vm_map_lock_upgrade           ## -- Begin function _vm_map_lock_upgrade
	.p2align	4, 0x90
__vm_map_lock_upgrade:                  ## @_vm_map_lock_upgrade
	.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
	movl	%edx, %r14d
	movq	%rsi, %r15
	movq	%rdi, %rbx
	cmpq	$0, 16(%rdi)
	je	LBB0_3
## %bb.1:
	leaq	8(%rbx), %rdi
	movq	_MA_OWNED@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r15, %rdx
	movl	%r14d, %ecx
	callq	_mtx_assert_
	jmp	LBB0_2
LBB0_3:
	leaq	4(%rbx), %r12
	movq	%r12, %rdi
	movq	%r15, %rsi
	movl	%r14d, %edx
	callq	_sx_try_upgrade_
	testl	%eax, %eax
	jne	LBB0_2
## %bb.4:
	movl	(%rbx), %r13d
	movq	%r12, %rdi
	movq	%r15, %rsi
	movl	%r14d, %edx
	callq	_sx_sunlock_
	xorl	%eax, %eax
	callq	_vm_map_process_deferred
	movq	%r12, %rdi
	movq	%r15, %rsi
	movl	%r14d, %edx
	callq	_sx_xlock_
	cmpl	(%rbx), %r13d
	jne	LBB0_5
LBB0_2:
	incl	(%rbx)
	xorl	%eax, %eax
LBB0_6:
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_5:
	movq	%r12, %rdi
	movq	%r15, %rsi
	movl	%r14d, %edx
	callq	_sx_xunlock_
	movl	$1, %eax
	jmp	LBB0_6
	.cfi_endproc
                                        ## -- End function
	.comm	_MA_OWNED,4,2                   ## @MA_OWNED
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	__vm_map_lock_upgrade           ; -- Begin function _vm_map_lock_upgrade
	.p2align	2
__vm_map_lock_upgrade:                  ; @_vm_map_lock_upgrade
	.cfi_startproc
; %bb.0:
	stp	x24, x23, [sp, #-64]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 64
	stp	x22, x21, [sp, #16]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #32]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #48]             ; 16-byte Folded Spill
	add	x29, sp, #48
	.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	x20, x2
	mov	x21, x1
	mov	x19, x0
	ldr	x8, [x0, #16]
	cbz	x8, LBB0_2
; %bb.1:
	add	x0, x19, #8
Lloh0:
	adrp	x8, _MA_OWNED@GOTPAGE
Lloh1:
	ldr	x8, [x8, _MA_OWNED@GOTPAGEOFF]
Lloh2:
	ldr	w1, [x8]
	mov	x2, x21
	mov	x3, x20
	bl	_mtx_assert_
	b	LBB0_4
LBB0_2:
	add	x22, x19, #4
	mov	x0, x22
	mov	x1, x21
	mov	x2, x20
	bl	_sx_try_upgrade_
	cbnz	w0, LBB0_4
; %bb.3:
	ldr	w23, [x19]
	mov	x0, x22
	mov	x1, x21
	mov	x2, x20
	bl	_sx_sunlock_
	bl	_vm_map_process_deferred
	mov	x0, x22
	mov	x1, x21
	mov	x2, x20
	bl	_sx_xlock_
	ldr	w8, [x19]
	cmp	w23, w8
	b.ne	LBB0_6
LBB0_4:
	mov	w0, #0
	ldr	w8, [x19]
	add	w8, w8, #1
	str	w8, [x19]
LBB0_5:
	ldp	x29, x30, [sp, #48]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #32]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #16]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp], #64             ; 16-byte Folded Reload
	ret
LBB0_6:
	mov	x0, x22
	mov	x1, x21
	mov	x2, x20
	bl	_sx_xunlock_
	mov	w0, #1
	b	LBB0_5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.cfi_endproc
                                        ; -- End function
	.comm	_MA_OWNED,4,2                   ; @MA_OWNED
.subsections_via_symbols
