	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function be_pair_flush
_be_pair_flush:                         ## @be_pair_flush
	.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
	movl	%edx, %r13d
	movl	%esi, %r15d
	movq	%rdi, %r12
	callq	_upcast
	cmpl	$0, (%rax)
	je	LBB0_1
## %bb.2:
	movq	%rax, %rbx
	movq	_BEV_NORMAL@GOTPCREL(%rip), %rax
	xorl	%r14d, %r14d
	cmpl	%r13d, (%rax)
	je	LBB0_14
## %bb.3:
	movq	%r12, %rdi
	callq	_incref_and_lock
	movl	(%rbx), %edi
	callq	_downcast
	movq	%rax, %rbx
	movq	_EV_READ@GOTPCREL(%rip), %rax
	testw	%r15w, (%rax)
	je	LBB0_5
## %bb.4:
	movq	%rbx, %rdi
	movq	%r12, %rsi
	movl	$1, %edx
	callq	_be_pair_transfer
LBB0_5:
	movq	_EV_WRITE@GOTPCREL(%rip), %rdx
	testw	%r15w, (%rdx)
	je	LBB0_7
## %bb.6:
	movq	%r12, %rdi
	movq	%rbx, %rsi
	movl	$1, %edx
	callq	_be_pair_transfer
	movq	_EV_WRITE@GOTPCREL(%rip), %rdx
LBB0_7:
	movq	_BEV_FINISHED@GOTPCREL(%rip), %rax
	cmpl	%r13d, (%rax)
	jne	LBB0_13
## %bb.8:
	movq	_BEV_EVENT_EOF@GOTPCREL(%rip), %rcx
	movq	_EV_READ@GOTPCREL(%rip), %rax
	movzwl	(%rax), %eax
	andw	%r15w, %ax
	je	LBB0_10
## %bb.9:
	movq	_BEV_EVENT_WRITING@GOTPCREL(%rip), %rax
	movzwl	(%rax), %eax
LBB0_10:
	orw	(%rcx), %ax
	andw	(%rdx), %r15w
	je	LBB0_12
## %bb.11:
	movq	_BEV_EVENT_READING@GOTPCREL(%rip), %rcx
	movzwl	(%rcx), %r15d
LBB0_12:
	orl	%r15d, %eax
	movswl	%ax, %esi
	movq	%rbx, %rdi
	xorl	%edx, %edx
	callq	_bufferevent_run_eventcb_
LBB0_13:
	movq	%r12, %rdi
	callq	_decref_and_unlock
	jmp	LBB0_14
LBB0_1:
	movl	$-1, %r14d
LBB0_14:
	movl	%r14d, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_BEV_NORMAL,4,2                 ## @BEV_NORMAL
	.comm	_EV_READ,2,1                    ## @EV_READ
	.comm	_EV_WRITE,2,1                   ## @EV_WRITE
	.comm	_BEV_FINISHED,4,2               ## @BEV_FINISHED
	.comm	_BEV_EVENT_EOF,2,1              ## @BEV_EVENT_EOF
	.comm	_BEV_EVENT_WRITING,2,1          ## @BEV_EVENT_WRITING
	.comm	_BEV_EVENT_READING,2,1          ## @BEV_EVENT_READING
	.no_dead_strip	_be_pair_flush
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function be_pair_flush
_be_pair_flush:                         ; @be_pair_flush
	.cfi_startproc
; %bb.0:
	stp	x24, x23, [sp, #-64]!           ; 16-byte Folded Spill
	.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
	.cfi_offset w23, -56
	.cfi_offset w24, -64
	mov	x20, x2
	mov	x21, x1
	mov	x19, x0
	bl	_upcast
	ldr	w8, [x0]
	cbz	w8, LBB0_10
; %bb.1:
Lloh0:
	adrp	x8, _BEV_NORMAL@GOTPAGE
Lloh1:
	ldr	x8, [x8, _BEV_NORMAL@GOTPAGEOFF]
Lloh2:
	ldr	w8, [x8]
	cmp	w8, w20
	b.eq	LBB0_9
; %bb.2:
	mov	x22, x0
	and	w23, w21, #0xffff
	mov	x0, x19
	bl	_incref_and_lock
	ldr	w0, [x22]
	bl	_downcast
	mov	x21, x0
Lloh3:
	adrp	x22, _EV_READ@GOTPAGE
Lloh4:
	ldr	x22, [x22, _EV_READ@GOTPAGEOFF]
	ldrh	w8, [x22]
	tst	w8, w23
	b.eq	LBB0_4
; %bb.3:
	mov	x0, x21
	mov	x1, x19
	mov	w2, #1
	bl	_be_pair_transfer
LBB0_4:
Lloh5:
	adrp	x24, _EV_WRITE@GOTPAGE
Lloh6:
	ldr	x24, [x24, _EV_WRITE@GOTPAGEOFF]
	ldrh	w8, [x24]
	tst	w8, w23
	b.eq	LBB0_6
; %bb.5:
	mov	x0, x19
	mov	x1, x21
	mov	w2, #1
	bl	_be_pair_transfer
LBB0_6:
Lloh7:
	adrp	x8, _BEV_FINISHED@GOTPAGE
Lloh8:
	ldr	x8, [x8, _BEV_FINISHED@GOTPAGEOFF]
Lloh9:
	ldr	w8, [x8]
	cmp	w8, w20
	b.ne	LBB0_8
; %bb.7:
Lloh10:
	adrp	x8, _BEV_EVENT_EOF@GOTPAGE
Lloh11:
	ldr	x8, [x8, _BEV_EVENT_EOF@GOTPAGEOFF]
	ldrh	w8, [x8]
	ldrh	w9, [x22]
Lloh12:
	adrp	x10, _BEV_EVENT_WRITING@GOTPAGE
Lloh13:
	ldr	x10, [x10, _BEV_EVENT_WRITING@GOTPAGEOFF]
	ldrh	w10, [x10]
	tst	w9, w23
	csel	w9, wzr, w10, eq
	orr	w8, w9, w8
Lloh14:
	adrp	x9, _BEV_EVENT_READING@GOTPAGE
Lloh15:
	ldr	x9, [x9, _BEV_EVENT_READING@GOTPAGEOFF]
	ldrh	w10, [x24]
	ldrh	w9, [x9]
	tst	w10, w23
	csel	w9, wzr, w9, eq
	orr	w8, w8, w9
	sxth	w1, w8
	mov	x0, x21
	mov	w2, #0
	bl	_bufferevent_run_eventcb_
LBB0_8:
	mov	x0, x19
	bl	_decref_and_unlock
LBB0_9:
	mov	w0, #0
	b	LBB0_11
LBB0_10:
	mov	w0, #-1
LBB0_11:
	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
	ldp	x24, x23, [sp], #64             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGot	Lloh3, Lloh4
	.loh AdrpLdrGot	Lloh5, Lloh6
	.loh AdrpLdrGotLdr	Lloh7, Lloh8, Lloh9
	.loh AdrpLdrGot	Lloh14, Lloh15
	.loh AdrpLdrGot	Lloh12, Lloh13
	.loh AdrpLdrGot	Lloh10, Lloh11
	.cfi_endproc
                                        ; -- End function
	.comm	_BEV_NORMAL,4,2                 ; @BEV_NORMAL
	.comm	_EV_READ,2,1                    ; @EV_READ
	.comm	_EV_WRITE,2,1                   ; @EV_WRITE
	.comm	_BEV_FINISHED,4,2               ; @BEV_FINISHED
	.comm	_BEV_EVENT_EOF,2,1              ; @BEV_EVENT_EOF
	.comm	_BEV_EVENT_WRITING,2,1          ; @BEV_EVENT_WRITING
	.comm	_BEV_EVENT_READING,2,1          ; @BEV_EVENT_READING
	.no_dead_strip	_be_pair_flush
.subsections_via_symbols
