	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_pthread_once                   ## -- Begin function pthread_once
	.p2align	4, 0x90
_pthread_once:                          ## @pthread_once
	.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
	subq	$24, %rsp
	.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_18
## %bb.1:
	movq	%rsi, %r15
	testq	%rsi, %rsi
	je	LBB0_18
## %bb.2:
	movq	%rdi, %rbx
	movq	_PTE_ONCE_STARTED@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	_PTE_ONCE_INIT@GOTPCREL(%rip), %r14
	movl	(%r14), %edx
	callq	_PTE_ATOMIC_COMPARE_EXCHANGE
	movq	_PTE_ONCE_DONE@GOTPCREL(%rip), %r13
	xorl	%ecx, %ecx
	cmpl	(%r13), %eax
	je	LBB0_17
## %bb.3:
	movq	%r15, -56(%rbp)                 ## 8-byte Spill
	leaq	16(%rbx), %r15
	leaq	8(%rbx), %r12
	jmp	LBB0_4
	.p2align	4, 0x90
LBB0_12:                                ##   in Loop: Header=BB0_4 Depth=1
	movq	%r15, %rdi
	callq	_PTE_ATOMIC_DECREMENT
	testq	%rax, %rax
	je	LBB0_13
LBB0_15:                                ##   in Loop: Header=BB0_4 Depth=1
	movq	_PTE_ONCE_STARTED@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movl	(%r14), %edx
	movq	%rbx, %rdi
	callq	_PTE_ATOMIC_COMPARE_EXCHANGE
	cmpl	(%r13), %eax
	je	LBB0_16
LBB0_4:                                 ## =>This Inner Loop Header: Depth=1
	cmpl	%eax, (%r14)
	jne	LBB0_7
## %bb.5:                               ##   in Loop: Header=BB0_4 Depth=1
	movq	_pte_once_init_routine_cleanup@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movq	%rbx, %rsi
	callq	_pthread_cleanup_push
	callq	*-56(%rbp)                      ## 8-byte Folded Reload
	xorl	%edi, %edi
	callq	_pthread_cleanup_pop
	movl	(%r13), %esi
	movq	%rbx, %rdi
	callq	_PTE_ATOMIC_EXCHANGE
	movq	%r12, %rdi
	xorl	%esi, %esi
	callq	_PTE_ATOMIC_EXCHANGE_ADD
	testq	%rax, %rax
	je	LBB0_15
## %bb.6:                               ##   in Loop: Header=BB0_4 Depth=1
	movq	(%r12), %rdi
	movl	(%r15), %esi
	callq	_pte_osSemaphorePost
	jmp	LBB0_15
	.p2align	4, 0x90
LBB0_7:                                 ##   in Loop: Header=BB0_4 Depth=1
	movq	%r15, %rdi
	callq	_PTE_ATOMIC_INCREMENT
	movq	%r12, %rdi
	xorl	%esi, %esi
	callq	_PTE_ATOMIC_EXCHANGE_ADD
	testq	%rax, %rax
	jne	LBB0_10
## %bb.8:                               ##   in Loop: Header=BB0_4 Depth=1
	xorl	%edi, %edi
	leaq	-48(%rbp), %rsi
	callq	_pte_osSemaphoreCreate
	movl	-48(%rbp), %esi
	movq	%r12, %rdi
	xorl	%edx, %edx
	callq	_PTE_ATOMIC_COMPARE_EXCHANGE
	testl	%eax, %eax
	je	LBB0_10
## %bb.9:                               ##   in Loop: Header=BB0_4 Depth=1
	movq	-48(%rbp), %rdi
	callq	_pte_osSemaphoreDelete
LBB0_10:                                ##   in Loop: Header=BB0_4 Depth=1
	movq	%rbx, %rdi
	xorl	%esi, %esi
	callq	_PTE_ATOMIC_EXCHANGE_ADD
	movq	_PTE_ONCE_STARTED@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jne	LBB0_12
## %bb.11:                              ##   in Loop: Header=BB0_4 Depth=1
	movq	(%r12), %rdi
	xorl	%esi, %esi
	callq	_pte_osSemaphorePend
	jmp	LBB0_12
LBB0_13:                                ##   in Loop: Header=BB0_4 Depth=1
	movq	%r12, %rdi
	xorl	%esi, %esi
	callq	_PTE_ATOMIC_EXCHANGE
	movq	%rax, -48(%rbp)
	testq	%rax, %rax
	je	LBB0_15
## %bb.14:                              ##   in Loop: Header=BB0_4 Depth=1
	movq	%rax, %rdi
	callq	_pte_osSemaphoreDelete
	jmp	LBB0_15
LBB0_18:
	movq	_EINVAL@GOTPCREL(%rip), %rax
	movl	(%rax), %ecx
	jmp	LBB0_17
LBB0_16:
	xorl	%ecx, %ecx
LBB0_17:
	movl	%ecx, %eax
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_EINVAL,4,2                     ## @EINVAL
	.comm	_PTE_ONCE_STARTED,8,3           ## @PTE_ONCE_STARTED
	.comm	_PTE_ONCE_INIT,4,2              ## @PTE_ONCE_INIT
	.comm	_PTE_ONCE_DONE,4,2              ## @PTE_ONCE_DONE
	.comm	_pte_once_init_routine_cleanup,4,2 ## @pte_once_init_routine_cleanup
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_pthread_once                   ; -- Begin function pthread_once
	.p2align	2
_pthread_once:                          ; @pthread_once
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #96
	.cfi_def_cfa_offset 96
	stp	x26, x25, [sp, #16]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #32]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #48]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #64]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #80]             ; 16-byte Folded Spill
	add	x29, sp, #80
	.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
	.cfi_offset w25, -72
	.cfi_offset w26, -80
	cbz	x0, LBB0_4
; %bb.1:
	mov	x19, x1
	cbz	x1, LBB0_4
; %bb.2:
	mov	x20, x0
Lloh0:
	adrp	x23, _PTE_ONCE_STARTED@GOTPAGE
Lloh1:
	ldr	x23, [x23, _PTE_ONCE_STARTED@GOTPAGEOFF]
	ldr	w1, [x23]
Lloh2:
	adrp	x24, _PTE_ONCE_INIT@GOTPAGE
Lloh3:
	ldr	x24, [x24, _PTE_ONCE_INIT@GOTPAGEOFF]
	ldr	w2, [x24]
	bl	_PTE_ATOMIC_COMPARE_EXCHANGE
Lloh4:
	adrp	x25, _PTE_ONCE_DONE@GOTPAGE
Lloh5:
	ldr	x25, [x25, _PTE_ONCE_DONE@GOTPAGEOFF]
	ldr	w8, [x25]
	cmp	w0, w8
	b.ne	LBB0_6
LBB0_3:
	mov	w0, #0
	b	LBB0_5
LBB0_4:
Lloh6:
	adrp	x8, _EINVAL@GOTPAGE
Lloh7:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
Lloh8:
	ldr	w0, [x8]
LBB0_5:
	ldp	x29, x30, [sp, #80]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #64]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #48]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #32]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #96
	ret
LBB0_6:
	add	x21, x20, #16
	add	x22, x20, #8
Lloh9:
	adrp	x26, _pte_once_init_routine_cleanup@GOTPAGE
Lloh10:
	ldr	x26, [x26, _pte_once_init_routine_cleanup@GOTPAGEOFF]
	b	LBB0_9
LBB0_7:                                 ;   in Loop: Header=BB0_9 Depth=1
	mov	x0, x21
	bl	_PTE_ATOMIC_DECREMENT
	cbz	x0, LBB0_17
LBB0_8:                                 ;   in Loop: Header=BB0_9 Depth=1
	ldr	w1, [x23]
	ldr	w2, [x24]
	mov	x0, x20
	bl	_PTE_ATOMIC_COMPARE_EXCHANGE
	ldr	w8, [x25]
	cmp	w0, w8
	b.eq	LBB0_3
LBB0_9:                                 ; =>This Inner Loop Header: Depth=1
	ldr	w8, [x24]
	cmp	w8, w0
	b.ne	LBB0_12
; %bb.10:                               ;   in Loop: Header=BB0_9 Depth=1
	ldr	w0, [x26]
	mov	x1, x20
	bl	_pthread_cleanup_push
	blr	x19
	mov	w0, #0
	bl	_pthread_cleanup_pop
	ldr	w1, [x25]
	mov	x0, x20
	bl	_PTE_ATOMIC_EXCHANGE
	mov	x0, x22
	mov	x1, #0
	bl	_PTE_ATOMIC_EXCHANGE_ADD
	cbz	x0, LBB0_8
; %bb.11:                               ;   in Loop: Header=BB0_9 Depth=1
	ldr	x0, [x22]
	ldr	w1, [x21]
	bl	_pte_osSemaphorePost
	b	LBB0_8
LBB0_12:                                ;   in Loop: Header=BB0_9 Depth=1
	mov	x0, x21
	bl	_PTE_ATOMIC_INCREMENT
	mov	x0, x22
	mov	x1, #0
	bl	_PTE_ATOMIC_EXCHANGE_ADD
	cbnz	x0, LBB0_15
; %bb.13:                               ;   in Loop: Header=BB0_9 Depth=1
	add	x1, sp, #8
	bl	_pte_osSemaphoreCreate
	ldr	w1, [sp, #8]
	mov	x0, x22
	mov	w2, #0
	bl	_PTE_ATOMIC_COMPARE_EXCHANGE
	cbz	w0, LBB0_15
; %bb.14:                               ;   in Loop: Header=BB0_9 Depth=1
	ldr	x0, [sp, #8]
	bl	_pte_osSemaphoreDelete
LBB0_15:                                ;   in Loop: Header=BB0_9 Depth=1
	mov	x0, x20
	mov	x1, #0
	bl	_PTE_ATOMIC_EXCHANGE_ADD
	ldr	x8, [x23]
	cmp	x0, x8
	b.ne	LBB0_7
; %bb.16:                               ;   in Loop: Header=BB0_9 Depth=1
	ldr	x0, [x22]
	mov	x1, #0
	bl	_pte_osSemaphorePend
	b	LBB0_7
LBB0_17:                                ;   in Loop: Header=BB0_9 Depth=1
	mov	x0, x22
	mov	w1, #0
	bl	_PTE_ATOMIC_EXCHANGE
	str	x0, [sp, #8]
	cbz	x0, LBB0_8
; %bb.18:                               ;   in Loop: Header=BB0_9 Depth=1
	bl	_pte_osSemaphoreDelete
	b	LBB0_8
	.loh AdrpLdrGot	Lloh4, Lloh5
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGot	Lloh9, Lloh10
	.cfi_endproc
                                        ; -- End function
	.comm	_EINVAL,4,2                     ; @EINVAL
	.comm	_PTE_ONCE_STARTED,8,3           ; @PTE_ONCE_STARTED
	.comm	_PTE_ONCE_INIT,4,2              ; @PTE_ONCE_INIT
	.comm	_PTE_ONCE_DONE,4,2              ; @PTE_ONCE_DONE
	.comm	_pte_once_init_routine_cleanup,4,2 ; @pte_once_init_routine_cleanup
.subsections_via_symbols
