	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function bev_async_consider_writing
_bev_async_consider_writing:            ## @bev_async_consider_writing
	.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
	cmpq	$0, (%rdi)
	jne	LBB0_8
## %bb.1:
	movq	%rdi, %rbx
	cmpq	$0, 16(%rdi)
	je	LBB0_2
LBB0_8:
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_2:
	cmpq	$0, 32(%rbx)
	je	LBB0_9
## %bb.3:
	leaq	24(%rbx), %r14
	movq	_EV_WRITE@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	testl	%eax, (%r14)
	je	LBB0_9
## %bb.4:
	movl	28(%rbx), %edi
	callq	_evbuffer_get_length
	testq	%rax, %rax
	je	LBB0_9
## %bb.5:
	leaq	8(%rbx), %r15
	movl	28(%rbx), %edi
	callq	_evbuffer_get_length
	movq	%rax, %r13
	movq	%r15, %rdi
	callq	_bufferevent_get_write_max_
	cltq
	testl	$-2147483648, %eax              ## imm = 0x80000000
	movq	%r13, %r12
	cmoveq	%rax, %r12
	cmpq	%rax, %r13
	cmovbq	%r13, %r12
	cmpq	$0, 8(%rbx)
	je	LBB0_6
LBB0_9:
	movq	%rbx, %rdi
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_bev_async_del_write            ## TAILCALL
LBB0_6:
	movq	%r14, %rdi
	callq	_bufferevent_incref_
	movl	28(%rbx), %edi
	leaq	40(%rbx), %rdx
	movq	%r12, %rsi
	callq	_evbuffer_launch_write_
	testq	%rax, %rax
	je	LBB0_7
## %bb.10:
	movq	%r14, %rdi
	callq	_bufferevent_decref_
	movq	$0, 32(%rbx)
	movq	_BEV_EVENT_ERROR@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r14, %rdi
	xorl	%edx, %edx
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_bufferevent_run_eventcb_       ## TAILCALL
LBB0_7:
	movq	%r12, (%rbx)
	movq	%r15, %rdi
	movq	%r12, %rsi
	callq	_bufferevent_decrement_write_buckets_
	movq	%rbx, %rdi
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_bev_async_add_write            ## TAILCALL
	.cfi_endproc
                                        ## -- End function
	.comm	_EV_WRITE,4,2                   ## @EV_WRITE
	.comm	_BEV_EVENT_ERROR,4,2            ## @BEV_EVENT_ERROR
	.no_dead_strip	_bev_async_consider_writing
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function bev_async_consider_writing
_bev_async_consider_writing:            ; @bev_async_consider_writing
	.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
	mov	x20, x0
	ldr	x8, [x20], #24
	cbnz	x8, LBB0_2
; %bb.1:
	mov	x19, x0
	ldr	x8, [x0, #16]
	cbz	x8, LBB0_3
LBB0_2:
	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
LBB0_3:
	ldr	x8, [x19, #32]
	cbz	x8, LBB0_7
; %bb.4:
	ldr	w8, [x20]
Lloh0:
	adrp	x9, _EV_WRITE@GOTPAGE
Lloh1:
	ldr	x9, [x9, _EV_WRITE@GOTPAGEOFF]
Lloh2:
	ldr	w9, [x9]
	tst	w9, w8
	b.eq	LBB0_7
; %bb.5:
	ldr	w0, [x19, #28]
	bl	_evbuffer_get_length
	cbz	x0, LBB0_7
; %bb.6:
	add	x21, x19, #8
	ldr	w0, [x19, #28]
	bl	_evbuffer_get_length
	mov	x22, x0
	mov	x0, x21
	bl	_bufferevent_get_write_max_
	sxtw	x8, w0
	tst	x0, #0x80000000
	ccmp	x22, x8, #0, eq
	csel	x22, x8, x22, hs
	ldr	x8, [x19, #8]
	cbz	x8, LBB0_8
LBB0_7:
	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
	b	_bev_async_del_write
LBB0_8:
	mov	x0, x20
	bl	_bufferevent_incref_
	ldr	w0, [x19, #28]
	add	x2, x19, #40
	mov	x1, x22
	bl	_evbuffer_launch_write_
	cbz	x0, LBB0_10
; %bb.9:
	mov	x0, x20
	bl	_bufferevent_decref_
	str	xzr, [x19, #32]
Lloh3:
	adrp	x8, _BEV_EVENT_ERROR@GOTPAGE
Lloh4:
	ldr	x8, [x8, _BEV_EVENT_ERROR@GOTPAGEOFF]
Lloh5:
	ldr	w1, [x8]
	mov	x0, x20
	mov	w2, #0
	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
	b	_bufferevent_run_eventcb_
LBB0_10:
	str	x22, [x19]
	mov	x0, x21
	mov	x1, x22
	bl	_bufferevent_decrement_write_buckets_
	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
	b	_bev_async_add_write
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.cfi_endproc
                                        ; -- End function
	.comm	_EV_WRITE,4,2                   ; @EV_WRITE
	.comm	_BEV_EVENT_ERROR,4,2            ; @BEV_EVENT_ERROR
	.no_dead_strip	_bev_async_consider_writing
.subsections_via_symbols
