	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_pthread_rwlock_timedwrlock     ## -- Begin function pthread_rwlock_timedwrlock
	.p2align	4, 0x90
_pthread_rwlock_timedwrlock:            ## @pthread_rwlock_timedwrlock
	.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), %r12
	testq	%r12, %r12
	je	LBB0_2
## %bb.3:
	movq	%rsi, %r14
	movq	_PTHREAD_RWLOCK_INITIALIZER@GOTPCREL(%rip), %rax
	cmpq	(%rax), %r12
	jne	LBB0_7
## %bb.4:
	movq	%rbx, %rdi
	callq	_pte_rwlock_check_need_init
	testl	%eax, %eax
	je	LBB0_6
## %bb.5:
	movl	%eax, %r13d
	movq	_EBUSY@GOTPCREL(%rip), %rax
	cmpl	(%rax), %r13d
	jne	LBB0_21
LBB0_6:
	movq	(%rbx), %r12
LBB0_7:
	movq	(%r12), %rax
	movq	_PTE_RWLOCK_MAGIC@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jne	LBB0_2
## %bb.8:
	leaq	32(%r12), %rbx
	movq	%rbx, %rdi
	movq	%r14, %rsi
	callq	_pthread_mutex_timedlock
	movl	%eax, %r13d
	testl	%eax, %eax
	jne	LBB0_21
## %bb.9:
	leaq	20(%r12), %r15
	movq	%r15, %rdi
	movq	%r14, %rsi
	callq	_pthread_mutex_timedlock
	testl	%eax, %eax
	je	LBB0_11
## %bb.10:
	movl	%eax, %r13d
	movq	%rbx, %rdi
	callq	_pthread_mutex_unlock
	jmp	LBB0_21
LBB0_2:
	movq	_EINVAL@GOTPCREL(%rip), %rax
	movl	(%rax), %r13d
LBB0_21:
	movl	%r13d, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_11:
	movq	8(%r12), %rax
	testq	%rax, %rax
	je	LBB0_12
LBB0_20:
	incq	%rax
	movq	%rax, 8(%r12)
	xorl	%r13d, %r13d
	jmp	LBB0_21
LBB0_12:
	movl	16(%r12), %eax
	movl	28(%r12), %ecx
	testl	%ecx, %ecx
	jle	LBB0_14
## %bb.13:
	subl	%ecx, %eax
	movl	%eax, 16(%r12)
	movl	$0, 28(%r12)
LBB0_14:
	testl	%eax, %eax
	jle	LBB0_15
## %bb.16:
	negl	%eax
	movl	%eax, 28(%r12)
	movq	_pte_rwlock_cancelwrwait@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movq	%r12, %rsi
	callq	_pthread_cleanup_push
	leaq	24(%r12), %rbx
LBB0_17:                                ## =>This Inner Loop Header: Depth=1
	movq	%rbx, %rdi
	movq	%r15, %rsi
	movq	%r14, %rdx
	callq	_pthread_cond_timedwait
	testl	%eax, %eax
	jne	LBB0_22
## %bb.18:                              ##   in Loop: Header=BB0_17 Depth=1
	cmpl	$0, 28(%r12)
	js	LBB0_17
## %bb.19:
	xorl	%edi, %edi
	callq	_pthread_cleanup_pop
	movl	$0, 16(%r12)
	movq	8(%r12), %rax
	jmp	LBB0_20
LBB0_15:
	xorl	%eax, %eax
	jmp	LBB0_20
LBB0_22:
	movl	%eax, %r13d
	movl	$1, %edi
	callq	_pthread_cleanup_pop
	jmp	LBB0_21
	.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
	.comm	_pte_rwlock_cancelwrwait,4,2    ## @pte_rwlock_cancelwrwait
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_pthread_rwlock_timedwrlock     ; -- Begin function pthread_rwlock_timedwrlock
	.p2align	2
_pthread_rwlock_timedwrlock:            ; @pthread_rwlock_timedwrlock
	.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_10
; %bb.1:
	mov	x21, x0
	ldr	x20, [x0]
	cbz	x20, LBB0_10
; %bb.2:
	mov	x19, x1
Lloh0:
	adrp	x8, _PTHREAD_RWLOCK_INITIALIZER@GOTPAGE
Lloh1:
	ldr	x8, [x8, _PTHREAD_RWLOCK_INITIALIZER@GOTPAGEOFF]
Lloh2:
	ldr	x8, [x8]
	cmp	x20, x8
	b.ne	LBB0_6
; %bb.3:
	mov	x0, x21
	bl	_pte_rwlock_check_need_init
	cbz	w0, LBB0_5
; %bb.4:
	mov	x22, x0
Lloh3:
	adrp	x8, _EBUSY@GOTPAGE
Lloh4:
	ldr	x8, [x8, _EBUSY@GOTPAGEOFF]
Lloh5:
	ldr	w8, [x8]
	cmp	w0, w8
	b.ne	LBB0_11
LBB0_5:
	ldr	x20, [x21]
LBB0_6:
	ldr	x8, [x20]
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	x23, x20, #32
	mov	x0, x23
	mov	x1, x19
	bl	_pthread_mutex_timedlock
	mov	x22, x0
	cbnz	w0, LBB0_11
; %bb.8:
	add	x21, x20, #20
	mov	x0, x21
	mov	x1, x19
	bl	_pthread_mutex_timedlock
	cbz	w0, LBB0_12
; %bb.9:
	mov	x22, x0
	mov	x0, x23
	bl	_pthread_mutex_unlock
	b	LBB0_11
LBB0_10:
Lloh9:
	adrp	x8, _EINVAL@GOTPAGE
Lloh10:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
Lloh11:
	ldr	w22, [x8]
LBB0_11:
	mov	x0, x22
	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_12:
	ldr	x8, [x20, #8]
	cbz	x8, LBB0_14
LBB0_13:
	mov	w22, #0
	add	x8, x8, #1
	str	x8, [x20, #8]
	b	LBB0_11
LBB0_14:
	ldr	w9, [x20, #28]
	ldr	w8, [x20, #16]
	cmp	w9, #1
	b.lt	LBB0_16
; %bb.15:
	sub	w8, w8, w9
	str	w8, [x20, #16]
	str	wzr, [x20, #28]
LBB0_16:
	cmp	w8, #1
	b.lt	LBB0_21
; %bb.17:
	neg	w8, w8
	str	w8, [x20, #28]
Lloh12:
	adrp	x8, _pte_rwlock_cancelwrwait@GOTPAGE
Lloh13:
	ldr	x8, [x8, _pte_rwlock_cancelwrwait@GOTPAGEOFF]
Lloh14:
	ldr	w0, [x8]
	mov	x1, x20
	bl	_pthread_cleanup_push
	add	x23, x20, #24
LBB0_18:                                ; =>This Inner Loop Header: Depth=1
	mov	x0, x23
	mov	x1, x21
	mov	x2, x19
	bl	_pthread_cond_timedwait
	cbnz	w0, LBB0_22
; %bb.19:                               ;   in Loop: Header=BB0_18 Depth=1
	ldr	w8, [x20, #28]
	tbnz	w8, #31, LBB0_18
; %bb.20:
	mov	w0, #0
	bl	_pthread_cleanup_pop
	str	wzr, [x20, #16]
	ldr	x8, [x20, #8]
	b	LBB0_13
LBB0_21:
	mov	x8, #0
	b	LBB0_13
LBB0_22:
	mov	x22, x0
	mov	w0, #1
	bl	_pthread_cleanup_pop
	b	LBB0_11
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.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
	.comm	_pte_rwlock_cancelwrwait,4,2    ; @pte_rwlock_cancelwrwait
.subsections_via_symbols
