	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_rw_tryenter                    ## -- Begin function rw_tryenter
	.p2align	4, 0x90
_rw_tryenter:                           ## @rw_tryenter
	.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	%rsi, %r14
	movq	%rdi, %r15
	movq	(%rdi), %rax
	movq	_B_TRUE@GOTPCREL(%rip), %rcx
	xorl	%edi, %edi
	cmpq	(%rcx), %rax
	sete	%dil
	callq	_ASSERT
	xorl	%edi, %edi
	cmpq	$-1, 8(%r15)
	setne	%dil
	callq	_ASSERT
	movq	8(%r15), %rax
	movq	_curthread@GOTPCREL(%rip), %r12
	xorl	%edi, %edi
	cmpq	(%r12), %rax
	setne	%dil
	callq	_ASSERT
	movq	_RW_READER@GOTPCREL(%rip), %r13
	leaq	20(%r15), %rdi
	cmpq	%r14, (%r13)
	jne	LBB0_2
## %bb.1:
	callq	_rw_tryrdlock
	jmp	LBB0_3
LBB0_2:
	callq	_rw_trywrlock
LBB0_3:
	xorl	%ebx, %ebx
	testl	%eax, %eax
	jne	LBB0_7
## %bb.4:
	xorl	%edi, %edi
	cmpq	$0, 8(%r15)
	sete	%dil
	callq	_ASSERT
	movl	16(%r15), %edi
	cmpq	%r14, (%r13)
	jne	LBB0_6
## %bb.5:
	addq	$16, %r15
	notl	%edi
	shrl	$31, %edi
	callq	_ASSERT
	movl	$1, %ebx
	movq	%r15, %rdi
	movl	$1, %esi
	callq	_atomic_add_int
	jmp	LBB0_7
LBB0_6:
	xorl	%eax, %eax
	testl	%edi, %edi
	sete	%al
	movl	%eax, %edi
	callq	_ASSERT
	movl	$-1, 16(%r15)
	movq	(%r12), %rax
	movq	%rax, 8(%r15)
	movl	$1, %ebx
LBB0_7:
	movl	%ebx, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_B_TRUE,8,3                     ## @B_TRUE
	.comm	_curthread,8,3                  ## @curthread
	.comm	_RW_READER,8,3                  ## @RW_READER
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_rw_tryenter                    ; -- Begin function rw_tryenter
	.p2align	2
_rw_tryenter:                           ; @rw_tryenter
	.cfi_startproc
; %bb.0:
	stp	x22, x21, [sp, #-48]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 48
	stp	x20, x19, [sp, #16]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #32]             ; 16-byte Folded Spill
	add	x29, sp, #32
	.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
	mov	x20, x1
	mov	x19, x0
	ldr	x8, [x0]
Lloh0:
	adrp	x9, _B_TRUE@GOTPAGE
Lloh1:
	ldr	x9, [x9, _B_TRUE@GOTPAGEOFF]
Lloh2:
	ldr	x9, [x9]
	cmp	x8, x9
	cset	w0, eq
	bl	_ASSERT
	ldr	x8, [x19, #8]
	cmn	x8, #1
	cset	w0, ne
	bl	_ASSERT
	ldr	x8, [x19, #8]
Lloh3:
	adrp	x22, _curthread@GOTPAGE
Lloh4:
	ldr	x22, [x22, _curthread@GOTPAGEOFF]
	ldr	x9, [x22]
	cmp	x8, x9
	cset	w0, ne
	bl	_ASSERT
Lloh5:
	adrp	x21, _RW_READER@GOTPAGE
Lloh6:
	ldr	x21, [x21, _RW_READER@GOTPAGEOFF]
	ldr	x8, [x21]
	add	x0, x19, #20
	cmp	x8, x20
	b.ne	LBB0_3
; %bb.1:
	bl	_rw_tryrdlock
	cbz	w0, LBB0_4
LBB0_2:
	mov	w19, #0
	b	LBB0_7
LBB0_3:
	bl	_rw_trywrlock
	cbnz	w0, LBB0_2
LBB0_4:
	ldr	x8, [x19, #8]
	cmp	x8, #0
	cset	w0, eq
	bl	_ASSERT
	ldr	x9, [x21]
	mov	x21, x19
	ldr	w8, [x21, #16]!
	cmp	x9, x20
	b.ne	LBB0_6
; %bb.5:
	mvn	w8, w8
	lsr	w0, w8, #31
	bl	_ASSERT
	mov	w19, #1
	mov	x0, x21
	mov	w1, #1
	bl	_atomic_add_int
	b	LBB0_7
LBB0_6:
	cmp	w8, #0
	cset	w0, eq
	bl	_ASSERT
	mov	w8, #-1
	str	w8, [x19, #16]
	ldr	x8, [x22]
	str	x8, [x19, #8]
	mov	w19, #1
LBB0_7:
	mov	x0, x19
	ldp	x29, x30, [sp, #32]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #16]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp], #48             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGot	Lloh5, Lloh6
	.loh AdrpLdrGot	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.cfi_endproc
                                        ; -- End function
	.comm	_B_TRUE,8,3                     ; @B_TRUE
	.comm	_curthread,8,3                  ; @curthread
	.comm	_RW_READER,8,3                  ; @RW_READER
.subsections_via_symbols
