	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_evbuffer_remove_buffer         ## -- Begin function evbuffer_remove_buffer
	.p2align	4, 0x90
_evbuffer_remove_buffer:                ## @evbuffer_remove_buffer
	.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
	subq	$24, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdx, %r12
	movq	%rsi, %r13
	movq	%rdi, %r15
	callq	_EVBUFFER_LOCK2
	xorl	%ebx, %ebx
	cmpq	%r15, %r13
	je	LBB0_17
## %bb.1:
	testq	%r12, %r12
	je	LBB0_17
## %bb.2:
	movl	$-1, %ebx
	cmpq	$0, 56(%r13)
	jne	LBB0_17
## %bb.3:
	cmpq	$0, 48(%r15)
	jne	LBB0_17
## %bb.4:
	movq	(%r15), %rbx
	cmpq	%r12, %rbx
	jbe	LBB0_7
## %bb.5:
	movq	24(%r15), %r14
	cmpq	%r12, (%r14)
	jbe	LBB0_8
## %bb.6:
	xorl	%ebx, %ebx
	jmp	LBB0_15
LBB0_7:
	movq	%r13, %rdi
	movq	%r15, %rsi
	callq	_evbuffer_add_buffer
	jmp	LBB0_17
LBB0_8:
	movq	%r13, -48(%rbp)                 ## 8-byte Spill
	leaq	24(%r15), %rax
	movq	%rax, -56(%rbp)                 ## 8-byte Spill
	movq	40(%r15), %rax
	xorl	%ebx, %ebx
	jmp	LBB0_9
	.p2align	4, 0x90
LBB0_11:                                ##   in Loop: Header=BB0_9 Depth=1
	addq	%rcx, %rbx
	movq	(%rdx), %r14
	cmpq	%r12, (%r14)
	ja	LBB0_12
LBB0_9:                                 ## =>This Inner Loop Header: Depth=1
	movq	%r14, %r13
	xorl	%edi, %edi
	cmpq	(%rax), %r14
	setne	%dil
	callq	_EVUTIL_ASSERT
	movq	(%r14), %rcx
	subq	%rcx, %r12
	movq	40(%r15), %rax
	movq	%r14, -64(%rbp)                 ## 8-byte Spill
	leaq	24(%r14), %rdx
	cmpq	%rdx, %rax
	jne	LBB0_11
## %bb.10:                              ##   in Loop: Header=BB0_9 Depth=1
	movq	-56(%rbp), %rax                 ## 8-byte Reload
	movq	%rax, 40(%r15)
	jmp	LBB0_11
LBB0_12:
	testq	%rbx, %rbx
	je	LBB0_13
## %bb.14:
	movq	-48(%rbp), %r13                 ## 8-byte Reload
	movq	%r13, %rdi
	callq	_evbuffer_free_trailing_empty_chains
	cmpq	$0, 24(%r13)
	leaq	24(%r13), %rcx
	movq	-56(%rbp), %rsi                 ## 8-byte Reload
	movq	(%rsi), %rdx
	cmovneq	%rax, %rcx
	movq	%rdx, (%rcx)
	movq	-64(%rbp), %rax                 ## 8-byte Reload
	movq	%rax, 32(%r13)
	movq	$0, 24(%rax)
	movq	%r14, (%rsi)
	movq	%r13, %rdi
	callq	_advance_last_with_data
	movdqu	(%r13), %xmm0
	movq	%rbx, %xmm1
	pshufd	$68, %xmm1, %xmm1               ## xmm1 = xmm1[0,1,0,1]
	paddq	%xmm0, %xmm1
	movdqu	%xmm1, (%r13)
	jmp	LBB0_15
LBB0_13:
	xorl	%ebx, %ebx
	movq	-48(%rbp), %r13                 ## 8-byte Reload
LBB0_15:
	movq	8(%r14), %rsi
	addq	16(%r14), %rsi
	movq	%r13, %rdi
	movq	%r12, %rdx
	callq	_evbuffer_add
	addq	%r12, 8(%r14)
	subq	%r12, (%r14)
	addq	%r12, %rbx
	subq	%rbx, (%r15)
	addq	%rbx, 16(%r15)
	testq	%rbx, %rbx
	je	LBB0_17
## %bb.16:
	movq	%r13, %rdi
	callq	_evbuffer_invoke_callbacks_
	movq	%r15, %rdi
	callq	_evbuffer_invoke_callbacks_
LBB0_17:
	movq	%r15, %rdi
	movq	%r13, %rsi
	callq	_EVBUFFER_UNLOCK2
	movl	%ebx, %eax
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_evbuffer_remove_buffer         ; -- Begin function evbuffer_remove_buffer
	.p2align	2
_evbuffer_remove_buffer:                ; @evbuffer_remove_buffer
	.cfi_startproc
; %bb.0:
	stp	x26, x25, [sp, #-80]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 80
	stp	x24, x23, [sp, #16]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #32]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #48]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #64]             ; 16-byte Folded Spill
	add	x29, sp, #64
	.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
	.cfi_offset w25, -72
	.cfi_offset w26, -80
	mov	x21, x2
	mov	x19, x1
	mov	x20, x0
	bl	_EVBUFFER_LOCK2
	mov	w22, #0
	cmp	x19, x20
	b.eq	LBB0_5
; %bb.1:
	cbz	x21, LBB0_5
; %bb.2:
	ldr	x8, [x19, #56]
	cbnz	x8, LBB0_4
; %bb.3:
	ldr	x8, [x20, #48]
	cbz	x8, LBB0_6
LBB0_4:
	mov	w22, #-1
LBB0_5:
	mov	x0, x20
	mov	x1, x19
	bl	_EVBUFFER_UNLOCK2
	mov	x0, x22
	ldp	x29, x30, [sp, #64]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #48]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #32]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #16]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp], #80             ; 16-byte Folded Reload
	ret
LBB0_6:
	ldr	x22, [x20]
	cmp	x22, x21
	b.ls	LBB0_9
; %bb.7:
	mov	x24, x20
	ldr	x23, [x24, #24]!
	ldr	x8, [x23]
	cmp	x8, x21
	b.ls	LBB0_10
; %bb.8:
	mov	x22, #0
	b	LBB0_16
LBB0_9:
	mov	x0, x19
	mov	x1, x20
	bl	_evbuffer_add_buffer
                                        ; kill: def $w22 killed $w22 killed $x22 def $x22
	b	LBB0_5
LBB0_10:
	mov	x22, #0
	ldr	x8, [x20, #40]
	b	LBB0_12
LBB0_11:                                ;   in Loop: Header=BB0_12 Depth=1
	add	x22, x10, x22
	ldr	x23, [x9]
	ldr	x9, [x23]
	cmp	x9, x21
	b.hi	LBB0_14
LBB0_12:                                ; =>This Inner Loop Header: Depth=1
	mov	x25, x23
	ldr	x8, [x8]
	cmp	x23, x8
	cset	w0, ne
	bl	_EVUTIL_ASSERT
	ldr	x10, [x23]
	sub	x21, x21, x10
	ldr	x8, [x20, #40]
	add	x9, x23, #24
	cmp	x8, x9
	b.ne	LBB0_11
; %bb.13:                               ;   in Loop: Header=BB0_12 Depth=1
	str	x24, [x20, #40]
	mov	x8, x24
	b	LBB0_11
LBB0_14:
	cbz	x22, LBB0_16
; %bb.15:
	mov	x0, x19
	bl	_evbuffer_free_trailing_empty_chains
	mov	x8, x19
	ldr	x9, [x8, #24]!
	ldr	x10, [x24]
	cmp	x9, #0
	csel	x8, x8, x0, eq
	str	x10, [x8]
	str	x25, [x19, #32]
	str	xzr, [x25, #24]
	str	x23, [x24]
	mov	x0, x19
	bl	_advance_last_with_data
	ldr	q0, [x19]
	dup.2d	v1, x22
	add.2d	v0, v0, v1
	str	q0, [x19]
LBB0_16:
	ldp	x9, x8, [x23, #8]
	add	x1, x9, x8
	mov	x0, x19
	mov	x2, x21
	bl	_evbuffer_add
	ldp	x9, x8, [x23]
	add	x8, x8, x21
	sub	x9, x9, x21
	stp	x9, x8, [x23]
	ldr	x8, [x20]
	add	x22, x21, x22
	sub	x8, x8, x22
	str	x8, [x20]
	ldr	x8, [x20, #16]
	add	x8, x8, x22
	str	x8, [x20, #16]
	cbz	x22, LBB0_5
; %bb.17:
	mov	x0, x19
	bl	_evbuffer_invoke_callbacks_
	mov	x0, x20
	bl	_evbuffer_invoke_callbacks_
	b	LBB0_5
	.cfi_endproc
                                        ; -- End function
.subsections_via_symbols
