	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_pthread_rwlock_unlock          ## -- Begin function pthread_rwlock_unlock
	.p2align	4, 0x90
_pthread_rwlock_unlock:                 ## @pthread_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	%rbx
	pushq	%rax
	.cfi_offset %rbx, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	testq	%rdi, %rdi
	je	LBB0_2
## %bb.1:
	movq	(%rdi), %rbx
	testq	%rbx, %rbx
	je	LBB0_2
## %bb.3:
	movq	_PTHREAD_RWLOCK_INITIALIZER@GOTPCREL(%rip), %rax
	cmpq	(%rax), %rbx
	je	LBB0_4
## %bb.5:
	movq	(%rbx), %rax
	movq	_PTE_RWLOCK_MAGIC@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jne	LBB0_2
## %bb.6:
	movq	8(%rbx), %rax
	testq	%rax, %rax
	je	LBB0_7
## %bb.10:
	decq	%rax
	movq	%rax, 8(%rbx)
	leaq	28(%rbx), %rdi
	callq	_pthread_mutex_unlock
	movl	%eax, %r15d
	addq	$24, %rbx
	movq	%rbx, %r14
LBB0_11:
	movq	%r14, %rdi
	callq	_pthread_mutex_unlock
	testl	%r15d, %r15d
	cmovnel	%r15d, %eax
	jmp	LBB0_12
LBB0_2:
	movq	_EINVAL@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
LBB0_12:
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_4:
	xorl	%eax, %eax
	jmp	LBB0_12
LBB0_7:
	leaq	28(%rbx), %r14
	movq	%r14, %rdi
	callq	_pthread_mutex_lock
	testl	%eax, %eax
	jne	LBB0_12
## %bb.8:
	xorl	%r15d, %r15d
	incq	16(%rbx)
	jne	LBB0_11
## %bb.9:
	addq	$32, %rbx
	movq	%rbx, %rdi
	callq	_pthread_cond_signal
	movl	%eax, %r15d
	jmp	LBB0_11
	.cfi_endproc
                                        ## -- End function
	.comm	_EINVAL,4,2                     ## @EINVAL
	.comm	_PTHREAD_RWLOCK_INITIALIZER,8,3 ## @PTHREAD_RWLOCK_INITIALIZER
	.comm	_PTE_RWLOCK_MAGIC,8,3           ## @PTE_RWLOCK_MAGIC
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_pthread_rwlock_unlock          ; -- Begin function pthread_rwlock_unlock
	.p2align	2
_pthread_rwlock_unlock:                 ; @pthread_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
	cbz	x0, LBB0_7
; %bb.1:
	ldr	x21, [x0]
	cbz	x21, LBB0_7
; %bb.2:
Lloh0:
	adrp	x8, _PTHREAD_RWLOCK_INITIALIZER@GOTPAGE
Lloh1:
	ldr	x8, [x8, _PTHREAD_RWLOCK_INITIALIZER@GOTPAGEOFF]
Lloh2:
	ldr	x8, [x8]
	cmp	x21, x8
	b.eq	LBB0_9
; %bb.3:
	ldr	x8, [x21]
Lloh3:
	adrp	x9, _PTE_RWLOCK_MAGIC@GOTPAGE
Lloh4:
	ldr	x9, [x9, _PTE_RWLOCK_MAGIC@GOTPAGEOFF]
Lloh5:
	ldr	x9, [x9]
	cmp	x8, x9
	b.ne	LBB0_7
; %bb.4:
	ldr	x8, [x21, #8]
	cbz	x8, LBB0_10
; %bb.5:
	sub	x8, x8, #1
	str	x8, [x21, #8]
	add	x0, x21, #28
	bl	_pthread_mutex_unlock
	mov	x20, x0
	add	x19, x21, #24
LBB0_6:
	mov	x0, x19
	bl	_pthread_mutex_unlock
	cmp	w20, #0
	csel	w0, w0, w20, eq
	b	LBB0_8
LBB0_7:
Lloh6:
	adrp	x8, _EINVAL@GOTPAGE
Lloh7:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
Lloh8:
	ldr	w0, [x8]
LBB0_8:
	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_9:
	mov	w0, #0
	b	LBB0_8
LBB0_10:
	add	x19, x21, #28
	mov	x0, x19
	bl	_pthread_mutex_lock
	cbnz	w0, LBB0_8
; %bb.11:
	ldr	x8, [x21, #16]
	adds	x8, x8, #1
	str	x8, [x21, #16]
	b.lo	LBB0_13
; %bb.12:
	add	x0, x21, #32
	bl	_pthread_cond_signal
	mov	x20, x0
	b	LBB0_6
LBB0_13:
	mov	w20, #0
	b	LBB0_6
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.cfi_endproc
                                        ; -- End function
	.comm	_EINVAL,4,2                     ; @EINVAL
	.comm	_PTHREAD_RWLOCK_INITIALIZER,8,3 ; @PTHREAD_RWLOCK_INITIALIZER
	.comm	_PTE_RWLOCK_MAGIC,8,3           ; @PTE_RWLOCK_MAGIC
.subsections_via_symbols
