	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function readcb
_readcb:                                ## @readcb
	.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
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rsi, %r15
	movq	%rdi, %r14
	callq	_bufferevent_get_input
	movq	%rax, %rbx
	movq	%rax, %rdi
	callq	_evbuffer_get_length
	testq	%r15, %r15
	je	LBB0_3
## %bb.1:
	movq	%r15, %rdi
	callq	_bufferevent_get_output
	movq	%rax, %r12
	movq	%rax, %rdi
	movq	%rbx, %rsi
	callq	_evbuffer_add_buffer
	movq	%r12, %rdi
	callq	_evbuffer_get_length
	movq	_MAX_OUTPUT@GOTPCREL(%rip), %rbx
	cmpl	(%rbx), %eax
	jge	LBB0_4
## %bb.2:
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_3:
	movslq	%eax, %rsi
	movq	%rbx, %rdi
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_evbuffer_drain                 ## TAILCALL
LBB0_4:
	movq	_drained_writecb@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	_eventcb@GOTPCREL(%rip), %rax
	movl	(%rax), %ecx
	leaq	_readcb(%rip), %rsi
	movq	%r15, %rdi
	movq	%r14, %r8
	callq	_bufferevent_setcb
	movq	_EV_WRITE@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movl	(%rbx), %ecx
	movl	%ecx, %edx
	shrl	$31, %edx
	addl	%ecx, %edx
	sarl	%edx
	movq	%r15, %rdi
	callq	_bufferevent_setwatermark
	movq	_EV_READ@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r14, %rdi
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_bufferevent_disable            ## TAILCALL
	.cfi_endproc
                                        ## -- End function
	.comm	_MAX_OUTPUT,4,2                 ## @MAX_OUTPUT
	.comm	_drained_writecb,4,2            ## @drained_writecb
	.comm	_eventcb,4,2                    ## @eventcb
	.comm	_EV_WRITE,4,2                   ## @EV_WRITE
	.comm	_EV_READ,4,2                    ## @EV_READ
	.no_dead_strip	_readcb
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function readcb
_readcb:                                ; @readcb
	.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, x1
	mov	x19, x0
	bl	_bufferevent_get_input
	mov	x21, x0
	bl	_evbuffer_get_length
                                        ; kill: def $w0 killed $w0 def $x0
	cbz	x20, LBB0_3
; %bb.1:
	mov	x0, x20
	bl	_bufferevent_get_output
	mov	x22, x0
	mov	x1, x21
	bl	_evbuffer_add_buffer
	mov	x0, x22
	bl	_evbuffer_get_length
Lloh0:
	adrp	x21, _MAX_OUTPUT@GOTPAGE
Lloh1:
	ldr	x21, [x21, _MAX_OUTPUT@GOTPAGEOFF]
	ldr	w8, [x21]
	cmp	w0, w8
	b.ge	LBB0_4
; %bb.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:
	sxtw	x1, w0
	mov	x0, x21
	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	_evbuffer_drain
LBB0_4:
Lloh2:
	adrp	x8, _drained_writecb@GOTPAGE
Lloh3:
	ldr	x8, [x8, _drained_writecb@GOTPAGEOFF]
Lloh4:
	ldr	w2, [x8]
Lloh5:
	adrp	x8, _eventcb@GOTPAGE
Lloh6:
	ldr	x8, [x8, _eventcb@GOTPAGEOFF]
Lloh7:
	ldr	w3, [x8]
Lloh8:
	adrp	x1, _readcb@PAGE
Lloh9:
	add	x1, x1, _readcb@PAGEOFF
	mov	x0, x20
	mov	x4, x19
	bl	_bufferevent_setcb
Lloh10:
	adrp	x8, _EV_WRITE@GOTPAGE
Lloh11:
	ldr	x8, [x8, _EV_WRITE@GOTPAGEOFF]
Lloh12:
	ldr	w1, [x8]
	ldr	w3, [x21]
	cmp	w3, #0
	cinc	w8, w3, lt
	asr	w2, w8, #1
	mov	x0, x20
	bl	_bufferevent_setwatermark
Lloh13:
	adrp	x8, _EV_READ@GOTPAGE
Lloh14:
	ldr	x8, [x8, _EV_READ@GOTPAGEOFF]
Lloh15:
	ldr	w1, [x8]
	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	_bufferevent_disable
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh13, Lloh14, Lloh15
	.loh AdrpLdrGotLdr	Lloh10, Lloh11, Lloh12
	.loh AdrpAdd	Lloh8, Lloh9
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.cfi_endproc
                                        ; -- End function
	.comm	_MAX_OUTPUT,4,2                 ; @MAX_OUTPUT
	.comm	_drained_writecb,4,2            ; @drained_writecb
	.comm	_eventcb,4,2                    ; @eventcb
	.comm	_EV_WRITE,4,2                   ; @EV_WRITE
	.comm	_EV_READ,4,2                    ; @EV_READ
	.no_dead_strip	_readcb
.subsections_via_symbols
