	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_pthread_rwlock_destroy         ## -- Begin function pthread_rwlock_destroy
	.p2align	4, 0x90
_pthread_rwlock_destroy:                ## @pthread_rwlock_destroy
	.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
	testq	%rdi, %rdi
	je	LBB0_2
## %bb.1:
	movq	%rdi, %rbx
	movq	(%rdi), %r14
	testq	%r14, %r14
	je	LBB0_2
## %bb.3:
	movq	_PTHREAD_RWLOCK_INITIALIZER@GOTPCREL(%rip), %r15
	cmpq	(%r15), %r14
	je	LBB0_15
## %bb.4:
	movq	(%r14), %rax
	movq	_PTE_RWLOCK_MAGIC@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jne	LBB0_2
## %bb.5:
	leaq	32(%r14), %r12
	movq	%r12, %rdi
	callq	_pthread_mutex_lock
	movl	%eax, %r15d
	testl	%eax, %eax
	jne	LBB0_21
## %bb.6:
	leaq	36(%r14), %r13
	movq	%r13, %rdi
	callq	_pthread_mutex_lock
	testl	%eax, %eax
	je	LBB0_8
## %bb.7:
	movl	%eax, %r15d
	movq	%r12, %rdi
	callq	_pthread_mutex_unlock
	jmp	LBB0_21
LBB0_2:
	movq	_EINVAL@GOTPCREL(%rip), %rax
	movl	(%rax), %r15d
LBB0_21:
	movl	%r15d, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_15:
	movq	_pte_rwlock_test_init_lock@GOTPCREL(%rip), %r14
	movl	(%r14), %edi
	callq	_pte_osMutexLock
	movq	(%rbx), %rax
	cmpq	(%r15), %rax
	je	LBB0_16
## %bb.17:
	movq	_EBUSY@GOTPCREL(%rip), %rax
	movl	(%rax), %r15d
	jmp	LBB0_18
LBB0_16:
	movq	$0, (%rbx)
	xorl	%r15d, %r15d
LBB0_18:
	movl	(%r14), %edi
	callq	_pte_osMutexUnlock
	testl	%r15d, %r15d
	sete	%al
	xorl	%r12d, %r12d
LBB0_19:
	movl	%r12d, %ebx
LBB0_20:
	testb	%al, %al
	cmovnel	%ebx, %r15d
	jmp	LBB0_21
LBB0_8:
	cmpq	$0, 8(%r14)
	jg	LBB0_10
## %bb.9:
	movq	16(%r14), %rax
	cmpq	24(%r14), %rax
	jle	LBB0_11
LBB0_10:
	movq	%r13, %rdi
	callq	_pthread_mutex_unlock
	movl	%eax, %r15d
	movq	%r12, %rdi
	callq	_pthread_mutex_unlock
	movl	%eax, %ebx
	movq	_EBUSY@GOTPCREL(%rip), %rax
	movl	(%rax), %r12d
LBB0_14:
	testl	%r15d, %r15d
	sete	%al
	testl	%ebx, %ebx
	jne	LBB0_20
	jmp	LBB0_19
LBB0_11:
	movq	$0, (%r14)
	movq	%r13, %rdi
	callq	_pthread_mutex_unlock
	movl	%eax, %r15d
	movq	%r12, %rdi
	callq	_pthread_mutex_unlock
	testl	%r15d, %r15d
	jne	LBB0_21
## %bb.12:
	movl	%eax, %r15d
	testl	%eax, %eax
	jne	LBB0_21
## %bb.13:
	movq	$0, (%rbx)
	leaq	40(%r14), %rdi
	callq	_pthread_cond_destroy
	movl	%eax, %r15d
	movq	%r13, %rdi
	callq	_pthread_mutex_destroy
	movl	%eax, %ebx
	movq	%r12, %rdi
	callq	_pthread_mutex_destroy
	movl	%eax, %r12d
	movq	%r14, %rdi
	callq	_free
	jmp	LBB0_14
	.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
	.comm	_EBUSY,4,2                      ## @EBUSY
	.comm	_pte_rwlock_test_init_lock,4,2  ## @pte_rwlock_test_init_lock
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_pthread_rwlock_destroy         ; -- Begin function pthread_rwlock_destroy
	.p2align	2
_pthread_rwlock_destroy:                ; @pthread_rwlock_destroy
	.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
	cbz	x0, LBB0_7
; %bb.1:
	mov	x20, x0
	ldr	x19, [x0]
	cbz	x19, LBB0_7
; %bb.2:
Lloh0:
	adrp	x21, _PTHREAD_RWLOCK_INITIALIZER@GOTPAGE
Lloh1:
	ldr	x21, [x21, _PTHREAD_RWLOCK_INITIALIZER@GOTPAGEOFF]
	ldr	x8, [x21]
	cmp	x19, x8
	b.eq	LBB0_9
; %bb.3:
	ldr	x8, [x19]
Lloh2:
	adrp	x9, _PTE_RWLOCK_MAGIC@GOTPAGE
Lloh3:
	ldr	x9, [x9, _PTE_RWLOCK_MAGIC@GOTPAGEOFF]
Lloh4:
	ldr	x9, [x9]
	cmp	x8, x9
	b.ne	LBB0_7
; %bb.4:
	add	x22, x19, #32
	mov	x0, x22
	bl	_pthread_mutex_lock
	mov	x21, x0
	cbnz	w0, LBB0_8
; %bb.5:
	add	x23, x19, #36
	mov	x0, x23
	bl	_pthread_mutex_lock
	cbz	w0, LBB0_15
; %bb.6:
	mov	x21, x0
	mov	x0, x22
	bl	_pthread_mutex_unlock
	b	LBB0_8
LBB0_7:
Lloh5:
	adrp	x8, _EINVAL@GOTPAGE
Lloh6:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
Lloh7:
	ldr	w21, [x8]
LBB0_8:
	mov	x0, x21
	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_9:
Lloh8:
	adrp	x19, _pte_rwlock_test_init_lock@GOTPAGE
Lloh9:
	ldr	x19, [x19, _pte_rwlock_test_init_lock@GOTPAGEOFF]
	ldr	w0, [x19]
	bl	_pte_osMutexLock
	ldr	x8, [x20]
	ldr	x9, [x21]
	cmp	x8, x9
	b.eq	LBB0_11
; %bb.10:
Lloh10:
	adrp	x8, _EBUSY@GOTPAGE
Lloh11:
	ldr	x8, [x8, _EBUSY@GOTPAGEOFF]
Lloh12:
	ldr	w21, [x8]
	b	LBB0_12
LBB0_11:
	mov	w21, #0
	str	xzr, [x20]
LBB0_12:
	ldr	w0, [x19]
	bl	_pte_osMutexUnlock
	mov	w20, #0
	cmp	w21, #0
	cset	w8, eq
LBB0_13:
	mov	x23, x20
LBB0_14:
	cmp	w8, #0
	csel	w21, w23, w21, ne
	b	LBB0_8
LBB0_15:
	ldr	x8, [x19, #8]
	cmp	x8, #0
	b.gt	LBB0_17
; %bb.16:
	ldp	x8, x9, [x19, #16]
	cmp	x8, x9
	b.le	LBB0_19
LBB0_17:
	mov	x0, x23
	bl	_pthread_mutex_unlock
	mov	x21, x0
	mov	x0, x22
	bl	_pthread_mutex_unlock
	mov	x23, x0
Lloh13:
	adrp	x8, _EBUSY@GOTPAGE
Lloh14:
	ldr	x8, [x8, _EBUSY@GOTPAGEOFF]
Lloh15:
	ldr	w20, [x8]
LBB0_18:
	cmp	w21, #0
	cset	w8, eq
	cbnz	w23, LBB0_14
	b	LBB0_13
LBB0_19:
	str	xzr, [x19]
	mov	x0, x23
	bl	_pthread_mutex_unlock
	mov	x21, x0
	mov	x0, x22
	bl	_pthread_mutex_unlock
	cbnz	w21, LBB0_8
; %bb.20:
	mov	x21, x0
	cbnz	w0, LBB0_8
; %bb.21:
	str	xzr, [x20]
	add	x0, x19, #40
	bl	_pthread_cond_destroy
	mov	x21, x0
	mov	x0, x23
	bl	_pthread_mutex_destroy
	mov	x23, x0
	mov	x0, x22
	bl	_pthread_mutex_destroy
	mov	x20, x0
	mov	x0, x19
	bl	_free
	b	LBB0_18
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpLdrGot	Lloh8, Lloh9
	.loh AdrpLdrGotLdr	Lloh10, Lloh11, Lloh12
	.loh AdrpLdrGotLdr	Lloh13, Lloh14, Lloh15
	.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
	.comm	_EBUSY,4,2                      ; @EBUSY
	.comm	_pte_rwlock_test_init_lock,4,2  ; @pte_rwlock_test_init_lock
.subsections_via_symbols
