	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function _thr_rwlock_unlock
__thr_rwlock_unlock:                    ## @_thr_rwlock_unlock
	.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	%r12
	pushq	%rbx
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdi, %r14
	movl	(%rdi), %ebx
	movq	_URWLOCK_WRITE_OWNER@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	testl	%ebx, %esi
	je	LBB0_1
## %bb.10:
	xorl	%ebx, %ebx
	movq	%r14, %rdi
	xorl	%edx, %edx
	callq	_atomic_cmpset_rel_32
	testq	%rax, %rax
	jne	LBB0_11
LBB0_9:
	movq	%r14, %rdi
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	___thr_rwlock_unlock            ## TAILCALL
LBB0_1:
	movl	%ebx, %edi
	callq	_URWLOCK_READER_COUNT
	xorl	%edi, %edi
	testl	%eax, %eax
	sete	%dil
	callq	___predict_false
	testq	%rax, %rax
	je	LBB0_2
LBB0_8:
	movq	_EPERM@GOTPCREL(%rip), %rax
	movl	(%rax), %ebx
LBB0_11:
	movl	%ebx, %eax
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_2:
	movq	_URWLOCK_WRITE_WAITERS@GOTPCREL(%rip), %r15
	movq	_URWLOCK_READ_WAITERS@GOTPCREL(%rip), %r12
	.p2align	4, 0x90
LBB0_3:                                 ## =>This Inner Loop Header: Depth=1
	movl	(%r12), %eax
	orl	(%r15), %eax
	testl	%ebx, %eax
	je	LBB0_5
## %bb.4:                               ##   in Loop: Header=BB0_3 Depth=1
	movl	%ebx, %edi
	callq	_URWLOCK_READER_COUNT
	cmpl	$1, %eax
	je	LBB0_9
LBB0_5:                                 ##   in Loop: Header=BB0_3 Depth=1
	leal	-1(%rbx), %edx
	movq	%r14, %rdi
	movl	%ebx, %esi
	callq	_atomic_cmpset_rel_32
	testq	%rax, %rax
	jne	LBB0_6
## %bb.7:                               ##   in Loop: Header=BB0_3 Depth=1
	movl	(%r14), %ebx
	movl	%ebx, %edi
	callq	_URWLOCK_READER_COUNT
	xorl	%edi, %edi
	testl	%eax, %eax
	sete	%dil
	callq	___predict_false
	testq	%rax, %rax
	je	LBB0_3
	jmp	LBB0_8
LBB0_6:
	xorl	%ebx, %ebx
	jmp	LBB0_11
	.cfi_endproc
                                        ## -- End function
	.comm	_URWLOCK_WRITE_OWNER,4,2        ## @URWLOCK_WRITE_OWNER
	.comm	_EPERM,4,2                      ## @EPERM
	.comm	_URWLOCK_WRITE_WAITERS,4,2      ## @URWLOCK_WRITE_WAITERS
	.comm	_URWLOCK_READ_WAITERS,4,2       ## @URWLOCK_READ_WAITERS
	.no_dead_strip	__thr_rwlock_unlock
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function _thr_rwlock_unlock
__thr_rwlock_unlock:                    ; @_thr_rwlock_unlock
	.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	x19, x0
	ldr	w20, [x0]
Lloh0:
	adrp	x8, _URWLOCK_WRITE_OWNER@GOTPAGE
Lloh1:
	ldr	x8, [x8, _URWLOCK_WRITE_OWNER@GOTPAGEOFF]
Lloh2:
	ldr	w1, [x8]
	tst	w1, w20
	b.eq	LBB0_3
; %bb.1:
	mov	x0, x19
	mov	w2, #0
	bl	_atomic_cmpset_rel_32
	mov	x8, x0
	mov	w0, #0
	cbnz	x8, LBB0_5
LBB0_2:
	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
	b	___thr_rwlock_unlock
LBB0_3:
	mov	x0, x20
	bl	_URWLOCK_READER_COUNT
	cmp	w0, #0
	cset	w0, eq
	bl	___predict_false
	cbz	x0, LBB0_6
LBB0_4:
Lloh3:
	adrp	x8, _EPERM@GOTPAGE
Lloh4:
	ldr	x8, [x8, _EPERM@GOTPAGEOFF]
Lloh5:
	ldr	w0, [x8]
LBB0_5:
	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
LBB0_6:
Lloh6:
	adrp	x21, _URWLOCK_WRITE_WAITERS@GOTPAGE
Lloh7:
	ldr	x21, [x21, _URWLOCK_WRITE_WAITERS@GOTPAGEOFF]
Lloh8:
	adrp	x22, _URWLOCK_READ_WAITERS@GOTPAGE
Lloh9:
	ldr	x22, [x22, _URWLOCK_READ_WAITERS@GOTPAGEOFF]
LBB0_7:                                 ; =>This Inner Loop Header: Depth=1
	ldr	w8, [x21]
	ldr	w9, [x22]
	orr	w8, w9, w8
	tst	w8, w20
	b.eq	LBB0_9
; %bb.8:                                ;   in Loop: Header=BB0_7 Depth=1
	mov	x0, x20
	bl	_URWLOCK_READER_COUNT
	cmp	w0, #1
	b.eq	LBB0_2
LBB0_9:                                 ;   in Loop: Header=BB0_7 Depth=1
	sub	w2, w20, #1
	mov	x0, x19
	mov	x1, x20
	bl	_atomic_cmpset_rel_32
	cbnz	x0, LBB0_11
; %bb.10:                               ;   in Loop: Header=BB0_7 Depth=1
	ldr	w20, [x19]
	mov	x0, x20
	bl	_URWLOCK_READER_COUNT
	cmp	w0, #0
	cset	w0, eq
	bl	___predict_false
	cbz	x0, LBB0_7
	b	LBB0_4
LBB0_11:
	mov	w0, #0
	b	LBB0_5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGot	Lloh8, Lloh9
	.loh AdrpLdrGot	Lloh6, Lloh7
	.cfi_endproc
                                        ; -- End function
	.comm	_URWLOCK_WRITE_OWNER,4,2        ; @URWLOCK_WRITE_OWNER
	.comm	_EPERM,4,2                      ; @EPERM
	.comm	_URWLOCK_WRITE_WAITERS,4,2      ; @URWLOCK_WRITE_WAITERS
	.comm	_URWLOCK_READ_WAITERS,4,2       ; @URWLOCK_READ_WAITERS
	.no_dead_strip	__thr_rwlock_unlock
.subsections_via_symbols
