	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_bufferevent_init_common_       ## -- Begin function bufferevent_init_common_
	.p2align	4, 0x90
_bufferevent_init_common_:              ## @bufferevent_init_common_
	.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	%ecx, %r15d
	movq	%rdx, %r13
	movq	%rsi, %r12
	movq	%rdi, %rbx
	cmpq	$0, 24(%rdi)
	jne	LBB0_2
## %bb.1:
	xorl	%eax, %eax
	callq	_evbuffer_new
	movq	%rax, 24(%rbx)
	testq	%rax, %rax
	je	LBB0_15
LBB0_2:
	leaq	16(%rbx), %r14
	cmpq	$0, (%r14)
	jne	LBB0_4
## %bb.3:
	xorl	%eax, %eax
	callq	_evbuffer_new
	movq	%rax, (%r14)
	testq	%rax, %rax
	je	LBB0_14
LBB0_4:
	movl	$1, (%rbx)
	movq	%r12, 56(%rbx)
	leaq	52(%rbx), %rdi
	callq	_evutil_timerclear
	leaq	48(%rbx), %rdi
	callq	_evutil_timerclear
	movq	%r13, 40(%rbx)
	movq	%rbx, %rdi
	callq	_bufferevent_ratelim_init_
	movq	_EV_WRITE@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, 32(%rbx)
	movq	_BEV_OPT_THREADSAFE@GOTPCREL(%rip), %rax
	testl	%r15d, (%rax)
	je	LBB0_6
## %bb.5:
	movq	%r14, %rdi
	xorl	%esi, %esi
	callq	_bufferevent_enable_locking_
	testq	%rax, %rax
	js	LBB0_10
LBB0_6:
	movq	_BEV_OPT_DEFER_CALLBACKS@GOTPCREL(%rip), %rax
	movq	_BEV_OPT_UNLOCK_CALLBACKS@GOTPCREL(%rip), %rcx
	movl	(%rcx), %r13d
	movl	(%rax), %eax
	orl	%r13d, %eax
	andl	%r15d, %eax
	cmpl	%r13d, %eax
	jne	LBB0_8
## %bb.7:
	leaq	L_.str(%rip), %rdi
	callq	_event_warnx
	jmp	LBB0_15
LBB0_8:
	leaq	8(%rbx), %rax
	movq	%rax, -48(%rbp)                 ## 8-byte Spill
	movq	%r12, %rdi
	callq	_event_base_get_npriorities
	movl	%eax, %esi
	shrl	$31, %esi
	addl	%eax, %esi
	sarl	%esi
	testl	%r15d, %r13d
	jne	LBB0_12
## %bb.9:
	movq	_bufferevent_run_deferred_callbacks_locked@GOTPCREL(%rip), %rax
	jmp	LBB0_13
LBB0_10:
	movq	24(%rbx), %rdi
	callq	_evbuffer_free
	movq	16(%rbx), %rdi
	callq	_evbuffer_free
	xorps	%xmm0, %xmm0
	movups	%xmm0, (%r14)
	jmp	LBB0_15
LBB0_12:
	movq	_bufferevent_run_deferred_callbacks_unlocked@GOTPCREL(%rip), %rax
LBB0_13:
	movl	(%rax), %edx
	movq	-48(%rbp), %rdi                 ## 8-byte Reload
	movq	%rbx, %rcx
	callq	_event_deferred_cb_init_
	movl	%r15d, 4(%rbx)
	movq	24(%rbx), %rdi
	movq	%r14, %rsi
	callq	_evbuffer_set_parent_
	movq	16(%rbx), %rdi
	movq	%r14, %rsi
	callq	_evbuffer_set_parent_
	xorl	%eax, %eax
	jmp	LBB0_16
LBB0_14:
	movq	24(%rbx), %rdi
	callq	_evbuffer_free
LBB0_15:
	movl	$-1, %eax
LBB0_16:
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_EV_WRITE,4,2                   ## @EV_WRITE
	.comm	_BEV_OPT_THREADSAFE,4,2         ## @BEV_OPT_THREADSAFE
	.comm	_BEV_OPT_DEFER_CALLBACKS,4,2    ## @BEV_OPT_DEFER_CALLBACKS
	.comm	_BEV_OPT_UNLOCK_CALLBACKS,4,2   ## @BEV_OPT_UNLOCK_CALLBACKS
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"UNLOCK_CALLBACKS requires DEFER_CALLBACKS"

	.comm	_bufferevent_run_deferred_callbacks_unlocked,4,2 ## @bufferevent_run_deferred_callbacks_unlocked
	.comm	_bufferevent_run_deferred_callbacks_locked,4,2 ## @bufferevent_run_deferred_callbacks_locked
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_bufferevent_init_common_       ; -- Begin function bufferevent_init_common_
	.p2align	2
_bufferevent_init_common_:              ; @bufferevent_init_common_
	.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	x21, x3
	mov	x23, x2
	mov	x22, x1
	mov	x19, x0
	ldr	x8, [x0, #24]
	cbnz	x8, LBB0_2
; %bb.1:
	bl	_evbuffer_new
	str	x0, [x19, #24]
	cbz	x0, LBB0_11
LBB0_2:
	add	x20, x19, #16
	ldr	x8, [x20]
	cbnz	x8, LBB0_4
; %bb.3:
	bl	_evbuffer_new
	str	x0, [x20]
	cbz	x0, LBB0_10
LBB0_4:
	mov	w8, #1
	str	w8, [x19]
	str	x22, [x19, #56]
	add	x0, x19, #52
	bl	_evutil_timerclear
	add	x0, x19, #48
	bl	_evutil_timerclear
	str	x23, [x19, #40]
	mov	x0, x19
	bl	_bufferevent_ratelim_init_
Lloh0:
	adrp	x8, _EV_WRITE@GOTPAGE
Lloh1:
	ldr	x8, [x8, _EV_WRITE@GOTPAGEOFF]
Lloh2:
	ldr	w8, [x8]
	str	w8, [x19, #32]
Lloh3:
	adrp	x8, _BEV_OPT_THREADSAFE@GOTPAGE
Lloh4:
	ldr	x8, [x8, _BEV_OPT_THREADSAFE@GOTPAGEOFF]
Lloh5:
	ldr	w8, [x8]
	tst	w8, w21
	b.eq	LBB0_6
; %bb.5:
	mov	x0, x20
	mov	x1, #0
	bl	_bufferevent_enable_locking_
	tbnz	x0, #63, LBB0_9
LBB0_6:
Lloh6:
	adrp	x8, _BEV_OPT_DEFER_CALLBACKS@GOTPAGE
Lloh7:
	ldr	x8, [x8, _BEV_OPT_DEFER_CALLBACKS@GOTPAGEOFF]
Lloh8:
	ldr	w8, [x8]
Lloh9:
	adrp	x9, _BEV_OPT_UNLOCK_CALLBACKS@GOTPAGE
Lloh10:
	ldr	x9, [x9, _BEV_OPT_UNLOCK_CALLBACKS@GOTPAGEOFF]
Lloh11:
	ldr	w24, [x9]
	orr	w8, w24, w8
	and	w8, w8, w21
	cmp	w8, w24
	b.ne	LBB0_8
; %bb.7:
Lloh12:
	adrp	x0, l_.str@PAGE
Lloh13:
	add	x0, x0, l_.str@PAGEOFF
	bl	_event_warnx
	b	LBB0_11
LBB0_8:
	add	x23, x19, #8
	mov	x0, x22
	bl	_event_base_get_npriorities
	cmp	w0, #0
	cinc	w8, w0, lt
Lloh14:
	adrp	x9, _bufferevent_run_deferred_callbacks_locked@GOTPAGE
Lloh15:
	ldr	x9, [x9, _bufferevent_run_deferred_callbacks_locked@GOTPAGEOFF]
	asr	w1, w8, #1
Lloh16:
	adrp	x8, _bufferevent_run_deferred_callbacks_unlocked@GOTPAGE
Lloh17:
	ldr	x8, [x8, _bufferevent_run_deferred_callbacks_unlocked@GOTPAGEOFF]
	tst	w24, w21
	csel	x8, x9, x8, eq
	ldr	w2, [x8]
	mov	x0, x23
	mov	x3, x19
	bl	_event_deferred_cb_init_
	str	w21, [x19, #4]
	ldr	x0, [x19, #24]
	mov	x1, x20
	bl	_evbuffer_set_parent_
	ldr	x0, [x19, #16]
	mov	x1, x20
	bl	_evbuffer_set_parent_
	mov	w0, #0
	b	LBB0_12
LBB0_9:
	ldr	x0, [x19, #24]
	bl	_evbuffer_free
	ldr	x0, [x19, #16]
	bl	_evbuffer_free
	stp	xzr, xzr, [x20]
	b	LBB0_11
LBB0_10:
	ldr	x0, [x19, #24]
	bl	_evbuffer_free
LBB0_11:
	mov	w0, #-1
LBB0_12:
	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	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpAdd	Lloh12, Lloh13
	.loh AdrpLdrGot	Lloh16, Lloh17
	.loh AdrpLdrGot	Lloh14, Lloh15
	.cfi_endproc
                                        ; -- End function
	.comm	_EV_WRITE,4,2                   ; @EV_WRITE
	.comm	_BEV_OPT_THREADSAFE,4,2         ; @BEV_OPT_THREADSAFE
	.comm	_BEV_OPT_DEFER_CALLBACKS,4,2    ; @BEV_OPT_DEFER_CALLBACKS
	.comm	_BEV_OPT_UNLOCK_CALLBACKS,4,2   ; @BEV_OPT_UNLOCK_CALLBACKS
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"UNLOCK_CALLBACKS requires DEFER_CALLBACKS"

	.comm	_bufferevent_run_deferred_callbacks_unlocked,4,2 ; @bufferevent_run_deferred_callbacks_unlocked
	.comm	_bufferevent_run_deferred_callbacks_locked,4,2 ; @bufferevent_run_deferred_callbacks_locked
.subsections_via_symbols
