	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function pop_next_work_item
_pop_next_work_item:                    ## @pop_next_work_item
	.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	%rdx, %r13
	movq	%rsi, %rbx
	movq	%rsi, %rdi
	callq	_ready_list_sort
	movslq	(%rbx), %r15
	cmpl	4(%rbx), %r15d
	jle	LBB0_1
LBB0_11:
	leaq	L_.str(%rip), %rdi
	callq	_pg_log_debug
	xorl	%r12d, %r12d
	jmp	LBB0_12
LBB0_1:
	movq	%rbx, -48(%rbp)                 ## 8-byte Spill
LBB0_2:                                 ## =>This Loop Header: Depth=1
                                        ##     Child Loop BB0_4 Depth 2
	movq	8(%rbx), %rax
	movq	(%rax,%r15,8), %r12
	movl	(%r13), %eax
	testl	%eax, %eax
	jle	LBB0_9
## %bb.3:                               ##   in Loop: Header=BB0_2 Depth=1
	xorl	%r14d, %r14d
	jmp	LBB0_4
	.p2align	4, 0x90
LBB0_8:                                 ##   in Loop: Header=BB0_4 Depth=2
	incq	%r14
	movslq	%eax, %rcx
	cmpq	%rcx, %r14
	jge	LBB0_9
LBB0_4:                                 ##   Parent Loop BB0_2 Depth=1
                                        ## =>  This Inner Loop Header: Depth=2
	movq	8(%r13), %rcx
	movq	(%rcx,%r14,8), %rbx
	testq	%rbx, %rbx
	je	LBB0_8
## %bb.5:                               ##   in Loop: Header=BB0_4 Depth=2
	movq	%r12, %rdi
	movq	%rbx, %rsi
	callq	_has_lock_conflicts
	testq	%rax, %rax
	jne	LBB0_10
## %bb.6:                               ##   in Loop: Header=BB0_4 Depth=2
	movq	%rbx, %rdi
	movq	%r12, %rsi
	callq	_has_lock_conflicts
	testq	%rax, %rax
	jne	LBB0_10
## %bb.7:                               ##   in Loop: Header=BB0_4 Depth=2
	movl	(%r13), %eax
	jmp	LBB0_8
	.p2align	4, 0x90
LBB0_10:                                ##   in Loop: Header=BB0_2 Depth=1
	leaq	1(%r15), %rax
	movq	-48(%rbp), %rbx                 ## 8-byte Reload
	movslq	4(%rbx), %rcx
	cmpq	%rcx, %r15
	movq	%rax, %r15
	jl	LBB0_2
	jmp	LBB0_11
LBB0_9:
	movq	-48(%rbp), %rdi                 ## 8-byte Reload
	movl	%r15d, %esi
	callq	_ready_list_remove
LBB0_12:
	movq	%r12, %rax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"no item ready"

	.no_dead_strip	_pop_next_work_item
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function pop_next_work_item
_pop_next_work_item:                    ; @pop_next_work_item
	.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
	mov	x20, x2
	mov	x19, x1
	mov	x0, x1
	bl	_ready_list_sort
	ldp	w21, w8, [x19]
                                        ; kill: def $w21 killed $w21 def $x21
	sxtw	x21, w21
	cmp	w21, w8
	b.le	LBB0_2
LBB0_1:
Lloh0:
	adrp	x0, l_.str@PAGE
Lloh1:
	add	x0, x0, l_.str@PAGEOFF
	bl	_pg_log_debug
	mov	x22, #0
	b	LBB0_11
LBB0_2:                                 ; =>This Loop Header: Depth=1
                                        ;     Child Loop BB0_5 Depth 2
	ldr	x8, [x19, #8]
	ldr	x22, [x8, x21, lsl #3]
	ldr	w8, [x20]
	cmp	w8, #1
	b.lt	LBB0_10
; %bb.3:                                ;   in Loop: Header=BB0_2 Depth=1
	mov	x24, #0
	b	LBB0_5
LBB0_4:                                 ;   in Loop: Header=BB0_5 Depth=2
	add	x24, x24, #1
	cmp	x24, w8, sxtw
	b.ge	LBB0_10
LBB0_5:                                 ;   Parent Loop BB0_2 Depth=1
                                        ; =>  This Inner Loop Header: Depth=2
	ldr	x9, [x20, #8]
	ldr	x23, [x9, x24, lsl #3]
	cbz	x23, LBB0_4
; %bb.6:                                ;   in Loop: Header=BB0_5 Depth=2
	mov	x0, x22
	mov	x1, x23
	bl	_has_lock_conflicts
	cbnz	x0, LBB0_9
; %bb.7:                                ;   in Loop: Header=BB0_5 Depth=2
	mov	x0, x23
	mov	x1, x22
	bl	_has_lock_conflicts
	cbnz	x0, LBB0_9
; %bb.8:                                ;   in Loop: Header=BB0_5 Depth=2
	ldr	w8, [x20]
	b	LBB0_4
LBB0_9:                                 ;   in Loop: Header=BB0_2 Depth=1
	add	x8, x21, #1
	ldrsw	x9, [x19, #4]
	cmp	x21, x9
	mov	x21, x8
	b.lt	LBB0_2
	b	LBB0_1
LBB0_10:
	mov	x0, x19
	mov	x1, x21
	bl	_ready_list_remove
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
	.loh AdrpAdd	Lloh0, Lloh1
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"no item ready"

	.no_dead_strip	_pop_next_work_item
.subsections_via_symbols
