	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function bytes_to_read
_bytes_to_read:                         ## @bytes_to_read
	.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	%rbx
	pushq	%rax
	.cfi_offset %rbx, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	cmpq	$0, 32(%rdi)
	je	LBB0_1
LBB0_8:
	xorl	%eax, %eax
LBB0_9:
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_1:
	movq	%rdi, %rbx
	movq	_EV_READ@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	testl	%eax, 8(%rdi)
	je	LBB0_8
## %bb.2:
	cmpq	$0, (%rbx)
	jne	LBB0_8
## %bb.3:
	cmpq	$0, 16(%rbx)
	je	LBB0_6
## %bb.4:
	movq	24(%rbx), %r14
	movq	%r14, %rdi
	callq	_evbuffer_get_length
	movq	16(%rbx), %r15
	cmpq	%r15, %rax
	jge	LBB0_8
## %bb.5:
	movq	%r14, %rdi
	callq	_evbuffer_get_length
	subl	%eax, %r15d
	jmp	LBB0_7
LBB0_6:
	movq	_READ_DEFAULT@GOTPCREL(%rip), %rax
	movl	(%rax), %r15d
LBB0_7:
	movq	%rbx, %rdi
	callq	_bufferevent_get_read_max_
	cmpl	%eax, %r15d
	cmovll	%r15d, %eax
	jmp	LBB0_9
	.cfi_endproc
                                        ## -- End function
	.comm	_READ_DEFAULT,4,2               ## @READ_DEFAULT
	.comm	_EV_READ,4,2                    ## @EV_READ
	.no_dead_strip	_bytes_to_read
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function bytes_to_read
_bytes_to_read:                         ; @bytes_to_read
	.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
	ldr	x8, [x0, #32]
	cbz	x8, LBB0_3
LBB0_1:
	mov	w0, #0
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:
	mov	x19, x0
	ldr	w8, [x0, #8]
Lloh0:
	adrp	x9, _EV_READ@GOTPAGE
Lloh1:
	ldr	x9, [x9, _EV_READ@GOTPAGEOFF]
Lloh2:
	ldr	w9, [x9]
	tst	w9, w8
	b.eq	LBB0_1
; %bb.4:
	ldr	x8, [x19]
	cbnz	x8, LBB0_1
; %bb.5:
	ldr	x8, [x19, #16]
	cbz	x8, LBB0_8
; %bb.6:
	ldr	x20, [x19, #24]
	mov	x0, x20
	bl	_evbuffer_get_length
	ldr	x21, [x19, #16]
	cmp	x0, x21
	b.ge	LBB0_1
; %bb.7:
	mov	x0, x20
	bl	_evbuffer_get_length
	sub	w20, w21, w0
	b	LBB0_9
LBB0_8:
Lloh3:
	adrp	x8, _READ_DEFAULT@GOTPAGE
Lloh4:
	ldr	x8, [x8, _READ_DEFAULT@GOTPAGEOFF]
Lloh5:
	ldr	w20, [x8]
LBB0_9:
	mov	x0, x19
	bl	_bufferevent_get_read_max_
	cmp	w20, w0
	csel	w0, w20, w0, lt
	b	LBB0_2
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.cfi_endproc
                                        ; -- End function
	.comm	_READ_DEFAULT,4,2               ; @READ_DEFAULT
	.comm	_EV_READ,4,2                    ; @EV_READ
	.no_dead_strip	_bytes_to_read
.subsections_via_symbols
