	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_evbuffer_add_buffer_reference  ## -- Begin function evbuffer_add_buffer_reference
	.p2align	4, 0x90
_evbuffer_add_buffer_reference:         ## @evbuffer_add_buffer_reference
	.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, %rbx
	movq	%rdi, %r14
	movq	%rsi, %rdi
	movq	%r14, %rsi
	callq	_EVBUFFER_LOCK2
	movq	(%rbx), %r12
	xorl	%r15d, %r15d
	testq	%r12, %r12
	je	LBB0_13
## %bb.1:
	cmpq	%rbx, %r14
	je	LBB0_12
## %bb.2:
	cmpq	$0, 24(%r14)
	jne	LBB0_12
## %bb.3:
	movq	(%r14), %rax
	movq	16(%rbx), %rcx
	testq	%rcx, %rcx
	je	LBB0_7
## %bb.4:
	movq	_EVBUFFER_FILESEGMENT@GOTPCREL(%rip), %rsi
	movq	_EVBUFFER_SENDFILE@GOTPCREL(%rip), %rdx
	movl	(%rdx), %edx
	orl	(%rsi), %edx
	movq	_EVBUFFER_MULTICAST@GOTPCREL(%rip), %rsi
	orl	(%rsi), %edx
	.p2align	4, 0x90
LBB0_5:                                 ## =>This Inner Loop Header: Depth=1
	testl	%edx, (%rcx)
	jne	LBB0_12
## %bb.6:                               ##   in Loop: Header=BB0_5 Depth=1
	movq	8(%rcx), %rcx
	testq	%rcx, %rcx
	jne	LBB0_5
LBB0_7:
	testq	%rax, %rax
	jne	LBB0_9
## %bb.8:
	movq	16(%r14), %rdi
	callq	_evbuffer_free_all_chains
LBB0_9:
	movq	%r14, %rdi
	movq	%rbx, %rsi
	callq	_APPEND_CHAIN_MULTICAST
	addq	%r12, 8(%r14)
	movq	%r14, %rdi
	callq	_evbuffer_invoke_callbacks_
	jmp	LBB0_13
LBB0_12:
	movl	$-1, %r15d
LBB0_13:
	movq	%rbx, %rdi
	movq	%r14, %rsi
	callq	_EVBUFFER_UNLOCK2
	movl	%r15d, %eax
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_EVBUFFER_FILESEGMENT,4,2       ## @EVBUFFER_FILESEGMENT
	.comm	_EVBUFFER_SENDFILE,4,2          ## @EVBUFFER_SENDFILE
	.comm	_EVBUFFER_MULTICAST,4,2         ## @EVBUFFER_MULTICAST
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_evbuffer_add_buffer_reference  ; -- Begin function evbuffer_add_buffer_reference
	.p2align	2
_evbuffer_add_buffer_reference:         ; @evbuffer_add_buffer_reference
	.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
	mov	x0, x1
	mov	x1, x19
	bl	_EVBUFFER_LOCK2
	ldr	x22, [x20]
	cbz	x22, LBB0_10
; %bb.1:
	mov	w21, #-1
	cmp	x19, x20
	b.eq	LBB0_11
; %bb.2:
	ldr	x8, [x19, #24]
	cbnz	x8, LBB0_11
; %bb.3:
	ldr	x8, [x19]
	ldr	x9, [x20, #16]
	cbz	x9, LBB0_7
; %bb.4:
Lloh0:
	adrp	x10, _EVBUFFER_FILESEGMENT@GOTPAGE
Lloh1:
	ldr	x10, [x10, _EVBUFFER_FILESEGMENT@GOTPAGEOFF]
Lloh2:
	ldr	w10, [x10]
Lloh3:
	adrp	x11, _EVBUFFER_SENDFILE@GOTPAGE
Lloh4:
	ldr	x11, [x11, _EVBUFFER_SENDFILE@GOTPAGEOFF]
Lloh5:
	ldr	w11, [x11]
	orr	w10, w11, w10
Lloh6:
	adrp	x11, _EVBUFFER_MULTICAST@GOTPAGE
Lloh7:
	ldr	x11, [x11, _EVBUFFER_MULTICAST@GOTPAGEOFF]
Lloh8:
	ldr	w11, [x11]
	orr	w10, w10, w11
LBB0_5:                                 ; =>This Inner Loop Header: Depth=1
	ldr	w11, [x9]
	tst	w10, w11
	b.ne	LBB0_12
; %bb.6:                                ;   in Loop: Header=BB0_5 Depth=1
	ldr	x9, [x9, #8]
	cbnz	x9, LBB0_5
LBB0_7:
	cbnz	x8, LBB0_9
; %bb.8:
	ldr	x0, [x19, #16]
	bl	_evbuffer_free_all_chains
LBB0_9:
	mov	x0, x19
	mov	x1, x20
	bl	_APPEND_CHAIN_MULTICAST
	ldr	x8, [x19, #8]
	add	x8, x8, x22
	str	x8, [x19, #8]
	mov	x0, x19
	bl	_evbuffer_invoke_callbacks_
LBB0_10:
	mov	w21, #0
LBB0_11:
	mov	x0, x20
	mov	x1, x19
	bl	_EVBUFFER_UNLOCK2
	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
	ret
LBB0_12:
	mov	w21, #-1
	b	LBB0_11
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.cfi_endproc
                                        ; -- End function
	.comm	_EVBUFFER_FILESEGMENT,4,2       ; @EVBUFFER_FILESEGMENT
	.comm	_EVBUFFER_SENDFILE,4,2          ; @EVBUFFER_SENDFILE
	.comm	_EVBUFFER_MULTICAST,4,2         ; @EVBUFFER_MULTICAST
.subsections_via_symbols
