	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function write_complete
_write_complete:                        ## @write_complete
	.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
	movl	%ecx, %r13d
	movl	%edx, %r15d
	movq	%rdi, -56(%rbp)                 ## 8-byte Spill
	callq	_upcast_write
	movq	%rax, %rbx
	leaq	16(%rax), %r14
	movq	_BEV_EVENT_WRITING@GOTPCREL(%rip), %rax
	movzwl	(%rax), %eax
	movw	%ax, -42(%rbp)                  ## 2-byte Spill
	movq	%r14, %rdi
	callq	_BEV_LOCK
	movl	(%rbx), %edi
	callq	_EVUTIL_ASSERT
	movl	(%rbx), %r12d
	movl	16(%rbx), %edi
	movl	%r15d, %esi
	callq	_evbuffer_commit_write_
	movl	$0, (%rbx)
	cmpl	%r15d, %r12d
	jne	LBB0_1
## %bb.2:
	testl	%r13d, %r13d
	je	LBB0_3
LBB0_4:
	cmpq	$0, 8(%rbx)
	jne	LBB0_5
	jmp	LBB0_13
LBB0_1:
	movl	%r15d, %esi
	subl	%r12d, %esi
	movq	%r14, %rdi
	callq	_bufferevent_decrement_write_buckets_
	testl	%r13d, %r13d
	jne	LBB0_4
LBB0_3:
	movq	%r14, %rdi
	movq	-56(%rbp), %rsi                 ## 8-byte Reload
	callq	_bev_async_set_wsa_error
	cmpq	$0, 8(%rbx)
	je	LBB0_13
LBB0_5:
	testl	%r15d, %r15d
	je	LBB0_8
## %bb.6:
	testl	%r13d, %r13d
	je	LBB0_8
## %bb.7:
	movq	%r14, %rdi
	callq	_BEV_RESET_GENERIC_WRITE_TIMEOUT
	movq	_EV_WRITE@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r14, %rdi
	xorl	%edx, %edx
	callq	_bufferevent_trigger_nolock_
	movq	%rbx, %rdi
	callq	_bev_async_consider_writing
	jmp	LBB0_13
LBB0_8:
	testl	%r13d, %r13d
	je	LBB0_9
## %bb.10:
	testl	%r15d, %r15d
	jne	LBB0_13
## %bb.11:
	movq	_BEV_EVENT_EOF@GOTPCREL(%rip), %rax
	jmp	LBB0_12
LBB0_9:
	movq	_BEV_EVENT_ERROR@GOTPCREL(%rip), %rax
LBB0_12:
	movzwl	-42(%rbp), %ecx                 ## 2-byte Folded Reload
	orw	(%rax), %cx
	movq	$0, 8(%rbx)
	movswl	%cx, %esi
	movq	%r14, %rdi
	xorl	%edx, %edx
	callq	_bufferevent_run_eventcb_
LBB0_13:
	movq	%r14, %rdi
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_bufferevent_decref_and_unlock_ ## TAILCALL
	.cfi_endproc
                                        ## -- End function
	.comm	_BEV_EVENT_WRITING,2,1          ## @BEV_EVENT_WRITING
	.comm	_EV_WRITE,4,2                   ## @EV_WRITE
	.comm	_BEV_EVENT_ERROR,2,1            ## @BEV_EVENT_ERROR
	.comm	_BEV_EVENT_EOF,2,1              ## @BEV_EVENT_EOF
	.no_dead_strip	_write_complete
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function write_complete
_write_complete:                        ; @write_complete
	.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	x22, x3
	mov	x21, x2
	mov	x23, x0
	bl	_upcast_write
	mov	x20, x0
	add	x19, x0, #16
Lloh0:
	adrp	x8, _BEV_EVENT_WRITING@GOTPAGE
Lloh1:
	ldr	x8, [x8, _BEV_EVENT_WRITING@GOTPAGEOFF]
	ldrh	w24, [x8]
	mov	x0, x19
	bl	_BEV_LOCK
	ldr	w0, [x20]
	bl	_EVUTIL_ASSERT
	ldr	w25, [x20]
	ldr	w0, [x20, #16]
	mov	x1, x21
	bl	_evbuffer_commit_write_
	str	wzr, [x20]
	cmp	w25, w21
	b.ne	LBB0_3
; %bb.1:
	cbz	w22, LBB0_4
LBB0_2:
	ldr	x8, [x20, #8]
	cbnz	x8, LBB0_5
	b	LBB0_13
LBB0_3:
	sub	w1, w21, w25
	mov	x0, x19
	bl	_bufferevent_decrement_write_buckets_
	cbnz	w22, LBB0_2
LBB0_4:
	mov	x0, x19
	mov	x1, x23
	bl	_bev_async_set_wsa_error
	ldr	x8, [x20, #8]
	cbz	x8, LBB0_13
LBB0_5:
	cbz	w21, LBB0_8
; %bb.6:
	cbz	w22, LBB0_8
; %bb.7:
	mov	x0, x19
	bl	_BEV_RESET_GENERIC_WRITE_TIMEOUT
Lloh2:
	adrp	x8, _EV_WRITE@GOTPAGE
Lloh3:
	ldr	x8, [x8, _EV_WRITE@GOTPAGEOFF]
Lloh4:
	ldr	w1, [x8]
	mov	x0, x19
	mov	w2, #0
	bl	_bufferevent_trigger_nolock_
	mov	x0, x20
	bl	_bev_async_consider_writing
	b	LBB0_13
LBB0_8:
	cbz	w22, LBB0_11
; %bb.9:
	cbnz	w21, LBB0_13
; %bb.10:
Lloh5:
	adrp	x8, _BEV_EVENT_EOF@GOTPAGE
Lloh6:
	ldr	x8, [x8, _BEV_EVENT_EOF@GOTPAGEOFF]
	b	LBB0_12
LBB0_11:
Lloh7:
	adrp	x8, _BEV_EVENT_ERROR@GOTPAGE
Lloh8:
	ldr	x8, [x8, _BEV_EVENT_ERROR@GOTPAGEOFF]
LBB0_12:
	ldrh	w8, [x8]
	orr	w8, w8, w24
	str	xzr, [x20, #8]
	sxth	w1, w8
	mov	x0, x19
	mov	w2, #0
	bl	_bufferevent_run_eventcb_
LBB0_13:
	mov	x0, x19
	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
	b	_bufferevent_decref_and_unlock_
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpLdrGot	Lloh5, Lloh6
	.loh AdrpLdrGot	Lloh7, Lloh8
	.cfi_endproc
                                        ; -- End function
	.comm	_BEV_EVENT_WRITING,2,1          ; @BEV_EVENT_WRITING
	.comm	_EV_WRITE,4,2                   ; @EV_WRITE
	.comm	_BEV_EVENT_ERROR,2,1            ; @BEV_EVENT_ERROR
	.comm	_BEV_EVENT_EOF,2,1              ; @BEV_EVENT_EOF
	.no_dead_strip	_write_complete
.subsections_via_symbols
