	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function bucket_drain
_bucket_drain:                          ## @bucket_drain
	.cfi_startproc
## %bb.0:
	testq	%rsi, %rsi
	je	LBB0_12
## %bb.1:
	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
	movq	%rsi, %r14
	movq	%rdi, %r15
	movq	48(%rdi), %rax
	movl	(%rsi), %edx
	testq	%rax, %rax
	je	LBB0_6
## %bb.2:
	testl	%edx, %edx
	jle	LBB0_6
## %bb.3:
	movq	8(%r14), %rcx
	movl	(%rcx), %edi
	movl	40(%r15), %esi
	callq	*%rax
	movl	(%r14), %edx
	cmpl	$2, %edx
	jl	LBB0_6
## %bb.4:
	movl	$1, %ebx
	.p2align	4, 0x90
LBB0_5:                                 ## =>This Inner Loop Header: Depth=1
	movq	8(%r14), %rax
	movl	(%rax,%rbx,4), %edi
	movl	40(%r15), %esi
	callq	*48(%r15)
	incq	%rbx
	movslq	(%r14), %rdx
	cmpq	%rdx, %rbx
	jl	LBB0_5
LBB0_6:
	movl	24(%r15), %edi
	movq	8(%r14), %rsi
                                        ## kill: def $edx killed $edx killed $rdx
	callq	*32(%r15)
	cmpq	$0, (%r15)
	jle	LBB0_11
## %bb.7:
	movq	%r15, %rdi
	callq	_ZONE_LOCK
	movslq	(%r14), %rcx
	movq	8(%r15), %rax
	subq	%rcx, %rax
	movq	%rax, 8(%r15)
	cmpq	$0, 16(%r15)
	je	LBB0_10
## %bb.8:
	cmpq	(%r15), %rax
	jge	LBB0_10
## %bb.9:
	movq	%r15, %rdi
	callq	_wakeup_one
LBB0_10:
	movq	%r15, %rdi
	callq	_ZONE_UNLOCK
LBB0_11:
	movl	$0, (%r14)
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
LBB0_12:
	retq
	.cfi_endproc
                                        ## -- End function
	.no_dead_strip	_bucket_drain
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function bucket_drain
_bucket_drain:                          ; @bucket_drain
	.cfi_startproc
; %bb.0:
	cbz	x1, LBB0_11
; %bb.1:
	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
	mov	x19, x1
	mov	x20, x0
	ldr	x8, [x0, #48]
	ldr	w2, [x1]
	cmp	x8, #0
	ccmp	w2, #1, #8, ne
	b.lt	LBB0_5
; %bb.2:
	ldr	x9, [x19, #8]
	ldr	w0, [x9]
	ldr	w1, [x20, #40]
	blr	x8
	ldr	w2, [x19]
	cmp	w2, #2
	b.lt	LBB0_5
; %bb.3:
	mov	w21, #1
LBB0_4:                                 ; =>This Inner Loop Header: Depth=1
	ldr	x8, [x20, #48]
	ldr	x9, [x19, #8]
	ldr	w0, [x9, x21, lsl #2]
	ldr	w1, [x20, #40]
	blr	x8
	add	x21, x21, #1
	ldrsw	x2, [x19]
	cmp	x21, x2
	b.lt	LBB0_4
LBB0_5:
	ldr	x8, [x20, #32]
	ldr	w0, [x20, #24]
	ldr	x1, [x19, #8]
                                        ; kill: def $w2 killed $w2 killed $x2
	blr	x8
	ldr	x8, [x20]
	cmp	x8, #1
	b.lt	LBB0_10
; %bb.6:
	mov	x0, x20
	bl	_ZONE_LOCK
	ldrsw	x8, [x19]
	ldp	x9, x10, [x20, #8]
	sub	x8, x9, x8
	str	x8, [x20, #8]
	cbz	x10, LBB0_9
; %bb.7:
	ldr	x9, [x20]
	cmp	x8, x9
	b.ge	LBB0_9
; %bb.8:
	mov	x0, x20
	bl	_wakeup_one
LBB0_9:
	mov	x0, x20
	bl	_ZONE_UNLOCK
LBB0_10:
	str	wzr, [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
LBB0_11:
	.cfi_def_cfa wsp, 0
	.cfi_same_value w30
	.cfi_same_value w29
	.cfi_same_value w19
	.cfi_same_value w20
	.cfi_same_value w21
	.cfi_same_value w22
	ret
	.cfi_endproc
                                        ; -- End function
	.no_dead_strip	_bucket_drain
.subsections_via_symbols
