	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_evbuffer_write_atmost          ## -- Begin function evbuffer_write_atmost
	.p2align	4, 0x90
_evbuffer_write_atmost:                 ## @evbuffer_write_atmost
	.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	%rdx, %r14
	movl	%esi, %r15d
	movq	%rdi, %rbx
	callq	_EVBUFFER_LOCK
	movl	$-1, %r12d
	cmpq	$0, 16(%rbx)
	jne	LBB0_4
## %bb.1:
	movq	(%rbx), %rax
	cmpq	%r14, %rax
	cmovbq	%rax, %r14
	testq	%r14, %r14
	je	LBB0_4
## %bb.2:
	movq	%rbx, %rdi
	movq	%r14, %rsi
	callq	_evbuffer_pullup
	movq	%rax, %r12
	xorl	%edi, %edi
	testq	%rax, %rax
	setne	%dil
	callq	_EVUTIL_ASSERT
	movl	%r15d, %edi
	movq	%r12, %rsi
	movq	%r14, %rdx
	callq	_write
	movl	%eax, %r12d
	testl	%eax, %eax
	jle	LBB0_4
## %bb.3:
	movq	%rbx, %rdi
	movl	%r12d, %esi
	callq	_evbuffer_drain
LBB0_4:
	movq	%rbx, %rdi
	callq	_EVBUFFER_UNLOCK
	movl	%r12d, %eax
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_EVBUFFER_SENDFILE,4,2          ## @EVBUFFER_SENDFILE
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_evbuffer_write_atmost          ; -- Begin function evbuffer_write_atmost
	.p2align	2
_evbuffer_write_atmost:                 ; @evbuffer_write_atmost
	.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	x21, x2
	mov	x20, x1
	mov	x19, x0
	bl	_EVBUFFER_LOCK
	ldr	x8, [x19, #16]
	cbz	x8, LBB0_3
LBB0_1:
	mov	w20, #-1
LBB0_2:
	mov	x0, x19
	bl	_EVBUFFER_UNLOCK
	mov	x0, x20
	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:
	ldr	x8, [x19]
	cmp	x8, x21
	csel	x21, x8, x21, lo
	cbz	x21, LBB0_1
; %bb.4:
	mov	x0, x19
	mov	x1, x21
	bl	_evbuffer_pullup
	mov	x22, x0
	cmp	x0, #0
	cset	w0, ne
	bl	_EVUTIL_ASSERT
	mov	x0, x20
	mov	x1, x22
	mov	x2, x21
	bl	_write
	mov	x20, x0
	cmp	w0, #1
	b.lt	LBB0_2
; %bb.5:
	mov	x0, x19
	mov	x1, x20
	bl	_evbuffer_drain
	b	LBB0_2
	.cfi_endproc
                                        ; -- End function
	.comm	_EVBUFFER_SENDFILE,4,2          ; @EVBUFFER_SENDFILE
.subsections_via_symbols
