	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_pthread_mutex_lock             ## -- Begin function pthread_mutex_lock
	.p2align	4, 0x90
_pthread_mutex_lock:                    ## @pthread_mutex_lock
	.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
	movq	(%rdi), %r13
	testq	%r13, %r13
	je	LBB0_1
## %bb.2:
	movq	_PTHREAD_ERRORCHECK_MUTEX_INITIALIZER@GOTPCREL(%rip), %rax
	cmpq	(%rax), %r13
	jb	LBB0_5
## %bb.3:
	movq	%rdi, %rbx
	callq	_pte_mutex_check_need_init
	movl	%eax, %r12d
	testl	%eax, %eax
	jne	LBB0_23
## %bb.4:
	movq	(%rbx), %r13
LBB0_5:
	movq	(%r13), %rax
	movq	_PTHREAD_MUTEX_NORMAL@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jne	LBB0_10
## %bb.6:
	leaq	28(%r13), %rbx
	movq	%rbx, %rdi
	movl	$1, %esi
	callq	_PTE_ATOMIC_EXCHANGE
	testq	%rax, %rax
	je	LBB0_18
## %bb.7:
	xorl	%r12d, %r12d
	movq	_PTE_OS_OK@GOTPCREL(%rip), %r14
	.p2align	4, 0x90
LBB0_8:                                 ## =>This Inner Loop Header: Depth=1
	movq	%rbx, %rdi
	movl	$-1, %esi
	callq	_PTE_ATOMIC_EXCHANGE
	testq	%rax, %rax
	je	LBB0_23
## %bb.9:                               ##   in Loop: Header=BB0_8 Depth=1
	movl	24(%r13), %edi
	xorl	%esi, %esi
	callq	_pte_osSemaphorePend
	cmpq	(%r14), %rax
	je	LBB0_8
LBB0_1:
	movq	_EINVAL@GOTPCREL(%rip), %rax
LBB0_22:
	movl	(%rax), %r12d
LBB0_23:
	movl	%r12d, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_10:
	xorl	%r12d, %r12d
	xorl	%eax, %eax
	callq	_pthread_self
	movq	%rax, %r14
	leaq	28(%r13), %r15
	movq	%r15, %rdi
	movl	$1, %esi
	xorl	%edx, %edx
	callq	_PTE_ATOMIC_COMPARE_EXCHANGE
	testq	%rax, %rax
	je	LBB0_11
## %bb.12:
	movq	16(%r13), %rdi
	movq	%r14, %rsi
	callq	_pthread_equal
	testq	%rax, %rax
	je	LBB0_13
## %bb.19:
	movq	(%r13), %rax
	movq	_PTHREAD_MUTEX_RECURSIVE@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jne	LBB0_21
## %bb.20:
	incl	8(%r13)
	xorl	%r12d, %r12d
	jmp	LBB0_23
LBB0_11:
	movl	$1, 8(%r13)
	movq	%r14, 16(%r13)
	jmp	LBB0_23
LBB0_13:
	movq	_PTE_OS_OK@GOTPCREL(%rip), %rbx
	.p2align	4, 0x90
LBB0_14:                                ## =>This Inner Loop Header: Depth=1
	movq	%r15, %rdi
	movl	$-1, %esi
	callq	_PTE_ATOMIC_EXCHANGE
	testq	%rax, %rax
	je	LBB0_17
## %bb.15:                              ##   in Loop: Header=BB0_14 Depth=1
	movl	24(%r13), %edi
	xorl	%esi, %esi
	callq	_pte_osSemaphorePend
	cmpq	(%rbx), %rax
	je	LBB0_14
## %bb.16:
	movq	_EINVAL@GOTPCREL(%rip), %rax
	movl	(%rax), %r12d
	testl	%r12d, %r12d
	jne	LBB0_23
LBB0_17:
	movl	$1, 8(%r13)
	movq	%r14, 16(%r13)
LBB0_18:
	xorl	%r12d, %r12d
	jmp	LBB0_23
LBB0_21:
	movq	_EDEADLK@GOTPCREL(%rip), %rax
	jmp	LBB0_22
	.cfi_endproc
                                        ## -- End function
	.comm	_EINVAL,4,2                     ## @EINVAL
	.comm	_PTHREAD_ERRORCHECK_MUTEX_INITIALIZER,8,3 ## @PTHREAD_ERRORCHECK_MUTEX_INITIALIZER
	.comm	_PTHREAD_MUTEX_NORMAL,8,3       ## @PTHREAD_MUTEX_NORMAL
	.comm	_PTE_OS_OK,8,3                  ## @PTE_OS_OK
	.comm	_PTHREAD_MUTEX_RECURSIVE,8,3    ## @PTHREAD_MUTEX_RECURSIVE
	.comm	_EDEADLK,4,2                    ## @EDEADLK
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_pthread_mutex_lock             ; -- Begin function pthread_mutex_lock
	.p2align	2
_pthread_mutex_lock:                    ; @pthread_mutex_lock
	.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
	ldr	x21, [x0]
	cbz	x21, LBB0_9
; %bb.1:
Lloh0:
	adrp	x8, _PTHREAD_ERRORCHECK_MUTEX_INITIALIZER@GOTPAGE
Lloh1:
	ldr	x8, [x8, _PTHREAD_ERRORCHECK_MUTEX_INITIALIZER@GOTPAGEOFF]
Lloh2:
	ldr	x8, [x8]
	cmp	x21, x8
	b.lo	LBB0_4
; %bb.2:
	mov	x19, x0
	bl	_pte_mutex_check_need_init
	cbnz	w0, LBB0_11
; %bb.3:
	ldr	x21, [x19]
LBB0_4:
	ldr	x8, [x21]
Lloh3:
	adrp	x9, _PTHREAD_MUTEX_NORMAL@GOTPAGE
Lloh4:
	ldr	x9, [x9, _PTHREAD_MUTEX_NORMAL@GOTPAGEOFF]
Lloh5:
	ldr	x9, [x9]
	cmp	x8, x9
	b.ne	LBB0_12
; %bb.5:
	add	x19, x21, #28
	mov	x0, x19
	mov	w1, #1
	bl	_PTE_ATOMIC_EXCHANGE
	cbz	x0, LBB0_11
; %bb.6:
Lloh6:
	adrp	x20, _PTE_OS_OK@GOTPAGE
Lloh7:
	ldr	x20, [x20, _PTE_OS_OK@GOTPAGEOFF]
LBB0_7:                                 ; =>This Inner Loop Header: Depth=1
	mov	x0, x19
	mov	w1, #-1
	bl	_PTE_ATOMIC_EXCHANGE
	cbz	x0, LBB0_11
; %bb.8:                                ;   in Loop: Header=BB0_7 Depth=1
	ldr	w0, [x21, #24]
	mov	x1, #0
	bl	_pte_osSemaphorePend
	ldr	x8, [x20]
	cmp	x0, x8
	b.eq	LBB0_7
LBB0_9:
Lloh8:
	adrp	x8, _EINVAL@GOTPAGE
Lloh9:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
LBB0_10:
	ldr	w0, [x8]
LBB0_11:
	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_12:
	bl	_pthread_self
	mov	x19, x0
	add	x20, x21, #28
	mov	w22, #1
	mov	x0, x20
	mov	w1, #1
	mov	w2, #0
	bl	_PTE_ATOMIC_COMPARE_EXCHANGE
	cbz	x0, LBB0_16
; %bb.13:
	ldr	x0, [x21, #16]
	mov	x1, x19
	bl	_pthread_equal
	cbz	x0, LBB0_17
; %bb.14:
	ldr	x8, [x21]
Lloh10:
	adrp	x9, _PTHREAD_MUTEX_RECURSIVE@GOTPAGE
Lloh11:
	ldr	x9, [x9, _PTHREAD_MUTEX_RECURSIVE@GOTPAGEOFF]
Lloh12:
	ldr	x9, [x9]
	cmp	x8, x9
	b.ne	LBB0_22
; %bb.15:
	mov	w0, #0
	ldr	w8, [x21, #8]
	add	w8, w8, #1
	str	w8, [x21, #8]
	b	LBB0_11
LBB0_16:
	str	w22, [x21, #8]
	str	x19, [x21, #16]
	b	LBB0_11
LBB0_17:
Lloh13:
	adrp	x22, _PTE_OS_OK@GOTPAGE
Lloh14:
	ldr	x22, [x22, _PTE_OS_OK@GOTPAGEOFF]
LBB0_18:                                ; =>This Inner Loop Header: Depth=1
	mov	x0, x20
	mov	w1, #-1
	bl	_PTE_ATOMIC_EXCHANGE
	cbz	x0, LBB0_21
; %bb.19:                               ;   in Loop: Header=BB0_18 Depth=1
	ldr	w0, [x21, #24]
	mov	x1, #0
	bl	_pte_osSemaphorePend
	ldr	x8, [x22]
	cmp	x0, x8
	b.eq	LBB0_18
; %bb.20:
Lloh15:
	adrp	x8, _EINVAL@GOTPAGE
Lloh16:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
Lloh17:
	ldr	w0, [x8]
	cbnz	w0, LBB0_11
LBB0_21:
	mov	w0, #0
	mov	w8, #1
	str	w8, [x21, #8]
	str	x19, [x21, #16]
	b	LBB0_11
LBB0_22:
Lloh18:
	adrp	x8, _EDEADLK@GOTPAGE
Lloh19:
	ldr	x8, [x8, _EDEADLK@GOTPAGEOFF]
	b	LBB0_10
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGot	Lloh6, Lloh7
	.loh AdrpLdrGot	Lloh8, Lloh9
	.loh AdrpLdrGotLdr	Lloh10, Lloh11, Lloh12
	.loh AdrpLdrGot	Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh15, Lloh16, Lloh17
	.loh AdrpLdrGot	Lloh18, Lloh19
	.cfi_endproc
                                        ; -- End function
	.comm	_EINVAL,4,2                     ; @EINVAL
	.comm	_PTHREAD_ERRORCHECK_MUTEX_INITIALIZER,8,3 ; @PTHREAD_ERRORCHECK_MUTEX_INITIALIZER
	.comm	_PTHREAD_MUTEX_NORMAL,8,3       ; @PTHREAD_MUTEX_NORMAL
	.comm	_PTE_OS_OK,8,3                  ; @PTE_OS_OK
	.comm	_PTHREAD_MUTEX_RECURSIVE,8,3    ; @PTHREAD_MUTEX_RECURSIVE
	.comm	_EDEADLK,4,2                    ; @EDEADLK
.subsections_via_symbols
