	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_pthread_rwlock_trywrlock       ## -- Begin function pthread_rwlock_trywrlock
	.p2align	4, 0x90
_pthread_rwlock_trywrlock:              ## @pthread_rwlock_trywrlock
	.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), %r13
	testq	%r13, %r13
	je	LBB0_2
## %bb.3:
	movq	_PTHREAD_RWLOCK_INITIALIZER@GOTPCREL(%rip), %rax
	cmpq	(%rax), %r13
	jne	LBB0_7
## %bb.4:
	movq	%rbx, %rdi
	callq	_pte_rwlock_check_need_init
	testl	%eax, %eax
	je	LBB0_6
## %bb.5:
	movl	%eax, %r12d
	movq	_EBUSY@GOTPCREL(%rip), %rax
	cmpl	(%rax), %r12d
	jne	LBB0_22
LBB0_6:
	movq	(%rbx), %r13
LBB0_7:
	movq	(%r13), %rax
	movq	_PTE_RWLOCK_MAGIC@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jne	LBB0_2
## %bb.8:
	leaq	32(%r13), %r14
	movq	%r14, %rdi
	callq	_pthread_mutex_trylock
	movl	%eax, %r12d
	testl	%eax, %eax
	jne	LBB0_22
## %bb.9:
	leaq	36(%r13), %r15
	movq	%r15, %rdi
	callq	_pthread_mutex_trylock
	testl	%eax, %eax
	je	LBB0_11
## %bb.10:
	movl	%eax, %r12d
	movq	%r14, %rdi
	callq	_pthread_mutex_unlock
	testl	%eax, %eax
	cmovnel	%eax, %r12d
	jmp	LBB0_22
LBB0_2:
	movq	_EINVAL@GOTPCREL(%rip), %rax
LBB0_21:
	movl	(%rax), %r12d
LBB0_22:
	movl	%r12d, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_11:
	cmpl	$0, 8(%r13)
	je	LBB0_12
## %bb.20:
	movq	_EBUSY@GOTPCREL(%rip), %rax
	jmp	LBB0_21
LBB0_12:
	movq	16(%r13), %rcx
	movq	24(%r13), %rax
	testq	%rcx, %rcx
	jle	LBB0_14
## %bb.13:
	subq	%rcx, %rax
	movq	%rax, 24(%r13)
	movq	$0, 16(%r13)
LBB0_14:
	testq	%rax, %rax
	jle	LBB0_19
## %bb.15:
	movq	%r15, %rdi
	callq	_pthread_mutex_unlock
	movl	%eax, %r12d
	movq	%r14, %rdi
	callq	_pthread_mutex_unlock
	testl	%r12d, %r12d
	jne	LBB0_22
## %bb.16:
	testl	%eax, %eax
	jne	LBB0_18
## %bb.17:
	movq	_EBUSY@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
LBB0_18:
	movl	%eax, %r12d
	jmp	LBB0_22
LBB0_19:
	movl	$1, 8(%r13)
	xorl	%r12d, %r12d
	jmp	LBB0_22
	.cfi_endproc
                                        ## -- End function
	.comm	_EINVAL,4,2                     ## @EINVAL
	.comm	_PTHREAD_RWLOCK_INITIALIZER,8,3 ## @PTHREAD_RWLOCK_INITIALIZER
	.comm	_EBUSY,4,2                      ## @EBUSY
	.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_trywrlock       ; -- Begin function pthread_rwlock_trywrlock
	.p2align	2
_pthread_rwlock_trywrlock:              ; @pthread_rwlock_trywrlock
	.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_10
; %bb.1:
	mov	x19, x0
	ldr	x22, [x0]
	cbz	x22, LBB0_10
; %bb.2:
Lloh0:
	adrp	x8, _PTHREAD_RWLOCK_INITIALIZER@GOTPAGE
Lloh1:
	ldr	x8, [x8, _PTHREAD_RWLOCK_INITIALIZER@GOTPAGEOFF]
Lloh2:
	ldr	x8, [x8]
	cmp	x22, x8
	b.ne	LBB0_6
; %bb.3:
	mov	x0, x19
	bl	_pte_rwlock_check_need_init
	cbz	w0, LBB0_5
; %bb.4:
	mov	x20, x0
Lloh3:
	adrp	x8, _EBUSY@GOTPAGE
Lloh4:
	ldr	x8, [x8, _EBUSY@GOTPAGEOFF]
Lloh5:
	ldr	w8, [x8]
	cmp	w0, w8
	b.ne	LBB0_12
LBB0_5:
	ldr	x22, [x19]
LBB0_6:
	ldr	x8, [x22]
Lloh6:
	adrp	x9, _PTE_RWLOCK_MAGIC@GOTPAGE
Lloh7:
	ldr	x9, [x9, _PTE_RWLOCK_MAGIC@GOTPAGEOFF]
Lloh8:
	ldr	x9, [x9]
	cmp	x8, x9
	b.ne	LBB0_10
; %bb.7:
	add	x19, x22, #32
	mov	x0, x19
	bl	_pthread_mutex_trylock
	mov	x20, x0
	cbnz	w0, LBB0_12
; %bb.8:
	add	x20, x22, #36
	mov	x0, x20
	bl	_pthread_mutex_trylock
	cbz	w0, LBB0_13
; %bb.9:
	mov	x21, x0
	mov	x0, x19
	bl	_pthread_mutex_unlock
	cmp	w0, #0
	csel	w20, w21, w0, eq
	b	LBB0_12
LBB0_10:
Lloh9:
	adrp	x8, _EINVAL@GOTPAGE
Lloh10:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
LBB0_11:
	ldr	w20, [x8]
LBB0_12:
	mov	x0, x20
	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_13:
	ldr	w8, [x22, #8]
	cbz	w8, LBB0_15
; %bb.14:
Lloh11:
	adrp	x8, _EBUSY@GOTPAGE
Lloh12:
	ldr	x8, [x8, _EBUSY@GOTPAGEOFF]
	b	LBB0_11
LBB0_15:
	ldp	x9, x8, [x22, #16]
	cmp	x9, #1
	b.lt	LBB0_17
; %bb.16:
	sub	x8, x8, x9
	stp	xzr, x8, [x22, #16]
LBB0_17:
	cmp	x8, #1
	b.lt	LBB0_20
; %bb.18:
	mov	x0, x20
	bl	_pthread_mutex_unlock
	mov	x20, x0
	mov	x0, x19
	bl	_pthread_mutex_unlock
	cbnz	w20, LBB0_12
; %bb.19:
Lloh13:
	adrp	x8, _EBUSY@GOTPAGE
Lloh14:
	ldr	x8, [x8, _EBUSY@GOTPAGEOFF]
Lloh15:
	ldr	w8, [x8]
	cmp	w0, #0
	csel	w20, w8, w0, eq
	b	LBB0_12
LBB0_20:
	mov	w20, #0
	mov	w8, #1
	str	w8, [x22, #8]
	b	LBB0_12
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGot	Lloh9, Lloh10
	.loh AdrpLdrGot	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	_EBUSY,4,2                      ; @EBUSY
	.comm	_PTE_RWLOCK_MAGIC,8,3           ; @PTE_RWLOCK_MAGIC
.subsections_via_symbols
