	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function bev_refill_callback_
_bev_refill_callback_:                  ## @bev_refill_callback_
	.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	%r12
	pushq	%rbx
	subq	$16, %rsp
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdx, %rbx
	leaq	8(%rdx), %r14
	movq	%r14, %rdi
	callq	_BEV_LOCK
	movq	16(%rbx), %rax
	testq	%rax, %rax
	je	LBB0_13
## %bb.1:
	cmpq	$0, (%rax)
	je	LBB0_13
## %bb.2:
	movl	8(%rbx), %edi
	leaq	-40(%rbp), %r15
	movq	%r15, %rsi
	callq	_event_base_gettimeofday_cached
	movq	16(%rbx), %rax
	movq	(%rax), %rsi
	movq	%r15, %rdi
	callq	_ev_token_bucket_get_tick_
	movq	16(%rbx), %rdi
	movq	(%rdi), %rsi
	addq	$16, %rdi
	movl	%eax, %edx
	callq	_ev_token_bucket_update_
	movq	_BEV_SUSPEND_BW@GOTPCREL(%rip), %r12
	movl	(%r12), %esi
	movb	$1, %r15b
	testl	%esi, (%rbx)
	je	LBB0_6
## %bb.3:
	movq	16(%rbx), %rax
	cmpq	$0, 16(%rax)
	jle	LBB0_4
## %bb.5:
	movq	%r14, %rdi
	callq	_bufferevent_unsuspend_read_
	movl	(%r12), %esi
LBB0_6:
	testl	%esi, 4(%rbx)
	je	LBB0_9
LBB0_7:
	movq	16(%rbx), %rdi
	cmpq	$0, 24(%rdi)
	jle	LBB0_11
## %bb.8:
	movq	%r14, %rdi
	callq	_bufferevent_unsuspend_write_
	jmp	LBB0_9
LBB0_13:
	movq	%r14, %rdi
	addq	$16, %rsp
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_BEV_UNLOCK                     ## TAILCALL
LBB0_4:
	xorl	%r15d, %r15d
	testl	%esi, 4(%rbx)
	jne	LBB0_7
LBB0_9:
	testb	%r15b, %r15b
	jne	LBB0_12
## %bb.10:
	movq	16(%rbx), %rdi
LBB0_11:
	movq	(%rdi), %rsi
	addq	$8, %rdi
	callq	_event_add
LBB0_12:
	movq	%r14, %rdi
	callq	_BEV_UNLOCK
	addq	$16, %rsp
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_BEV_SUSPEND_BW,4,2             ## @BEV_SUSPEND_BW
	.no_dead_strip	_bev_refill_callback_
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function bev_refill_callback_
_bev_refill_callback_:                  ; @bev_refill_callback_
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #64
	.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
	mov	x20, x2
	add	x19, x2, #8
	mov	x0, x19
	bl	_BEV_LOCK
	ldr	x8, [x20, #16]
	cbz	x8, LBB0_6
; %bb.1:
	ldr	x8, [x8]
	cbz	x8, LBB0_6
; %bb.2:
	ldr	w0, [x20, #8]
	add	x1, sp, #8
	bl	_event_base_gettimeofday_cached
	ldr	x8, [x20, #16]
	ldr	x1, [x8]
	add	x0, sp, #8
	bl	_ev_token_bucket_get_tick_
	mov	x2, x0
	ldr	x0, [x20, #16]
	ldr	x1, [x0], #16
	bl	_ev_token_bucket_update_
	ldr	w8, [x20]
Lloh0:
	adrp	x21, _BEV_SUSPEND_BW@GOTPAGE
Lloh1:
	ldr	x21, [x21, _BEV_SUSPEND_BW@GOTPAGEOFF]
	ldr	w1, [x21]
	tst	w1, w8
	b.eq	LBB0_5
; %bb.3:
	ldr	x8, [x20, #16]
	ldr	x8, [x8, #16]
	cmp	x8, #1
	b.lt	LBB0_7
; %bb.4:
	mov	x0, x19
	bl	_bufferevent_unsuspend_read_
	ldr	w1, [x21]
LBB0_5:
	mov	w21, #1
	b	LBB0_8
LBB0_6:
	mov	x0, x19
	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
	add	sp, sp, #64
	b	_BEV_UNLOCK
LBB0_7:
	mov	w21, #0
LBB0_8:
	ldr	w8, [x20, #4]
	tst	w1, w8
	b.eq	LBB0_11
; %bb.9:
	ldr	x0, [x20, #16]
	ldr	x8, [x0, #24]
	cmp	x8, #1
	b.lt	LBB0_13
; %bb.10:
	mov	x0, x19
	bl	_bufferevent_unsuspend_write_
LBB0_11:
	tbnz	w21, #0, LBB0_14
; %bb.12:
	ldr	x0, [x20, #16]
LBB0_13:
	ldr	x1, [x0], #8
	bl	_event_add
LBB0_14:
	mov	x0, x19
	bl	_BEV_UNLOCK
	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
	add	sp, sp, #64
	ret
	.loh AdrpLdrGot	Lloh0, Lloh1
	.cfi_endproc
                                        ; -- End function
	.comm	_BEV_SUSPEND_BW,4,2             ; @BEV_SUSPEND_BW
	.no_dead_strip	_bev_refill_callback_
.subsections_via_symbols
