	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_NextNodeFromList               ## -- Begin function NextNodeFromList
	.p2align	4, 0x90
_NextNodeFromList:                      ## @NextNodeFromList
	.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	%rbx
	pushq	%rax
	.cfi_offset %rbx, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	xorl	%eax, %eax
	callq	_ThreadLock
	movq	_numwaiting@GOTPCREL(%rip), %r15
	movq	(%r15), %rbx
	incq	%rbx
	movq	%rbx, (%r15)
	movq	_firstnode@GOTPCREL(%rip), %r14
	cmpq	$0, (%r14)
	jne	LBB0_3
## %bb.1:
	xorl	%eax, %eax
	callq	_GetNumThreads
	cmpq	%rax, %rbx
	jl	LBB0_3
## %bb.2:
	xorl	%eax, %eax
	callq	_GetNumThreads
	movq	%rax, %rdi
	callq	_ThreadSemaphoreIncrease
LBB0_3:
	xorl	%eax, %eax
	callq	_ThreadUnlock
	xorl	%eax, %eax
	callq	_ThreadSemaphoreWait
	xorl	%eax, %eax
	callq	_ThreadLock
	decq	(%r15)
	movq	(%r14), %rbx
	testq	%rbx, %rbx
	je	LBB0_5
## %bb.4:
	movq	(%rbx), %rax
	movq	%rax, (%r14)
	movq	_nodelistsize@GOTPCREL(%rip), %rcx
	decl	(%rcx)
	testq	%rax, %rax
	jne	LBB0_6
LBB0_5:
	movq	_lastnode@GOTPCREL(%rip), %rax
	movq	$0, (%rax)
LBB0_6:
	xorl	%eax, %eax
	callq	_ThreadUnlock
	movq	%rbx, %rax
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_numwaiting,8,3                 ## @numwaiting
	.comm	_firstnode,8,3                  ## @firstnode
	.comm	_nodelistsize,4,2               ## @nodelistsize
	.comm	_lastnode,8,3                   ## @lastnode
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_NextNodeFromList               ; -- Begin function NextNodeFromList
	.p2align	2
_NextNodeFromList:                      ; @NextNodeFromList
	.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
	bl	_ThreadLock
Lloh0:
	adrp	x19, _numwaiting@GOTPAGE
Lloh1:
	ldr	x19, [x19, _numwaiting@GOTPAGEOFF]
	ldr	x8, [x19]
	add	x21, x8, #1
	str	x21, [x19]
Lloh2:
	adrp	x20, _firstnode@GOTPAGE
Lloh3:
	ldr	x20, [x20, _firstnode@GOTPAGEOFF]
	ldr	x8, [x20]
	cbnz	x8, LBB0_3
; %bb.1:
	bl	_GetNumThreads
	cmp	x21, x0
	b.lt	LBB0_3
; %bb.2:
	bl	_GetNumThreads
	bl	_ThreadSemaphoreIncrease
LBB0_3:
	bl	_ThreadUnlock
	bl	_ThreadSemaphoreWait
	bl	_ThreadLock
	ldr	x8, [x19]
	sub	x8, x8, #1
	str	x8, [x19]
	ldr	x19, [x20]
	cbz	x19, LBB0_5
; %bb.4:
	ldr	x8, [x19]
	str	x8, [x20]
Lloh4:
	adrp	x9, _nodelistsize@GOTPAGE
Lloh5:
	ldr	x9, [x9, _nodelistsize@GOTPAGEOFF]
	ldr	w10, [x9]
	sub	w10, w10, #1
	str	w10, [x9]
	cbnz	x8, LBB0_6
LBB0_5:
Lloh6:
	adrp	x8, _lastnode@GOTPAGE
Lloh7:
	ldr	x8, [x8, _lastnode@GOTPAGEOFF]
Lloh8:
	str	xzr, [x8]
LBB0_6:
	bl	_ThreadUnlock
	mov	x0, x19
	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
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGot	Lloh4, Lloh5
	.loh AdrpLdrGotStr	Lloh6, Lloh7, Lloh8
	.cfi_endproc
                                        ; -- End function
	.comm	_numwaiting,8,3                 ; @numwaiting
	.comm	_firstnode,8,3                  ; @firstnode
	.comm	_nodelistsize,4,2               ; @nodelistsize
	.comm	_lastnode,8,3                   ; @lastnode
.subsections_via_symbols
