	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_evbuffer_launch_write_         ## -- Begin function evbuffer_launch_write_
	.p2align	4, 0x90
_evbuffer_launch_write_:                ## @evbuffer_launch_write_
	.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	$56, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdx, %r13
	movq	%rsi, %r15
	movq	%rdi, %rbx
	callq	_upcast_evbuffer
	testq	%rbx, %rbx
	je	LBB0_1
## %bb.2:
	movq	%rax, %r12
	movq	%rbx, %rdi
	callq	_EVBUFFER_LOCK
	xorl	%edi, %edi
	cmpl	$0, 32(%r12)
	sete	%dil
	callq	_EVUTIL_ASSERT
	movl	$-1, %r14d
	cmpq	$0, 16(%rbx)
	jne	LBB0_17
## %bb.3:
	cmpl	$0, (%r12)
	jne	LBB0_17
## %bb.4:
	movq	(%rbx), %r14
	testq	%r14, %r14
	je	LBB0_5
## %bb.6:
	movq	%r15, -56(%rbp)                 ## 8-byte Spill
	movq	%rbx, %rdi
	movl	$1, %esi
	callq	_evbuffer_freeze
	movq	$0, 24(%r12)
	movl	$0, 4(%r12)
	movq	8(%r12), %rdi
	movl	$0, -44(%rbp)                   ## 4-byte Folded Spill
	xorl	%esi, %esi
	movl	$8, %edx
	callq	_memset
	movq	8(%rbx), %r15
	movq	%r15, 24(%r12)
	movq	_MAX_WSABUFS@GOTPCREL(%rip), %rax
	cmpl	$0, (%rax)
	movq	%rbx, -80(%rbp)                 ## 8-byte Spill
	movq	%r12, -64(%rbp)                 ## 8-byte Spill
	movq	%r13, -72(%rbp)                 ## 8-byte Spill
	jle	LBB0_13
## %bb.7:
	testq	%r15, %r15
	je	LBB0_13
## %bb.8:
	movq	-56(%rbp), %r13                 ## 8-byte Reload
	cmpq	%r13, %r14
	cmovbq	%r14, %r13
	movl	$8, %r12d
	movl	$1, %ebx
	movl	$0, -44(%rbp)                   ## 4-byte Folded Spill
	movq	%r13, -56(%rbp)                 ## 8-byte Spill
	.p2align	4, 0x90
LBB0_9:                                 ## =>This Inner Loop Header: Depth=1
	movq	-64(%rbp), %rax                 ## 8-byte Reload
	movq	8(%rax), %r14
	movq	8(%r15), %rax
	addq	16(%r15), %rax
	movq	%rax, -8(%r14,%r12)
	movq	_EVBUFFER_MEM_PINNED_W@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r15, %rdi
	callq	_evbuffer_chain_pin_
	movq	(%r15), %rax
	subq	%rax, %r13
	jbe	LBB0_10
## %bb.11:                              ##   in Loop: Header=BB0_9 Depth=1
	movq	%rax, (%r14,%r12)
	movq	_MAX_WSABUFS@GOTPCREL(%rip), %rax
	movslq	(%rax), %rax
	incl	-44(%rbp)                       ## 4-byte Folded Spill
	cmpq	%rax, %rbx
	jge	LBB0_13
## %bb.12:                              ##   in Loop: Header=BB0_9 Depth=1
	movq	24(%r15), %r15
	addq	$16, %r12
	incq	%rbx
	movq	%r13, -56(%rbp)                 ## 8-byte Spill
	testq	%r15, %r15
	jne	LBB0_9
	jmp	LBB0_13
LBB0_1:
	movl	$-1, %r14d
	jmp	LBB0_18
LBB0_5:
	xorl	%r14d, %r14d
	jmp	LBB0_17
LBB0_10:
	movq	-56(%rbp), %rax                 ## 8-byte Reload
	movq	%rax, (%r14,%r12)
	movl	%ebx, %eax
	movl	%ebx, -44(%rbp)                 ## 4-byte Spill
LBB0_13:
	movq	-64(%rbp), %r15                 ## 8-byte Reload
	movl	-44(%rbp), %r12d                ## 4-byte Reload
	movl	%r12d, 4(%r15)
	movq	-80(%rbp), %rbx                 ## 8-byte Reload
	movq	%rbx, %rdi
	callq	_evbuffer_incref_
	movl	16(%r15), %edi
	movq	8(%r15), %rsi
	movq	$0, (%rsp)
	leaq	-84(%rbp), %rcx
	xorl	%r14d, %r14d
	movl	%r12d, %edx
	xorl	%r8d, %r8d
	movq	-72(%rbp), %r9                  ## 8-byte Reload
	callq	_WSASend
	testq	%rax, %rax
	je	LBB0_16
## %bb.14:
	xorl	%eax, %eax
	callq	_WSAGetLastError
	movq	_WSA_IO_PENDING@GOTPCREL(%rip), %rcx
	cmpl	(%rcx), %eax
	jne	LBB0_15
LBB0_16:
	movl	$1, (%r15)
	jmp	LBB0_17
LBB0_15:
	movq	_EVBUFFER_MEM_PINNED_W@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r15, %rdi
	callq	_pin_release
	movq	%rbx, %rdi
	movl	$1, %esi
	callq	_evbuffer_unfreeze
	movq	%rbx, %rdi
	callq	_evbuffer_free
	movl	$-1, %r14d
LBB0_17:
	movq	%rbx, %rdi
	callq	_EVBUFFER_UNLOCK
LBB0_18:
	movl	%r14d, %eax
	addq	$56, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_MAX_WSABUFS,4,2                ## @MAX_WSABUFS
	.comm	_EVBUFFER_MEM_PINNED_W,4,2      ## @EVBUFFER_MEM_PINNED_W
	.comm	_WSA_IO_PENDING,4,2             ## @WSA_IO_PENDING
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_evbuffer_launch_write_         ; -- Begin function evbuffer_launch_write_
	.p2align	2
_evbuffer_launch_write_:                ; @evbuffer_launch_write_
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #112
	.cfi_def_cfa_offset 112
	stp	x28, x27, [sp, #16]             ; 16-byte Folded Spill
	stp	x26, x25, [sp, #32]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #48]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #64]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #80]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #96]             ; 16-byte Folded Spill
	add	x29, sp, #96
	.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
	.cfi_offset w27, -88
	.cfi_offset w28, -96
	mov	x21, x2
	mov	x24, x1
	mov	x19, x0
	bl	_upcast_evbuffer
	cbz	x19, LBB0_5
; %bb.1:
	mov	x20, x0
	mov	x0, x19
	bl	_EVBUFFER_LOCK
	ldr	w8, [x20, #32]
	cmp	w8, #0
	cset	w0, eq
	bl	_EVUTIL_ASSERT
	ldr	x8, [x19, #16]
	cbnz	x8, LBB0_3
; %bb.2:
	ldr	w8, [x20]
	cbz	w8, LBB0_7
LBB0_3:
	mov	w21, #-1
LBB0_4:
	mov	x0, x19
	bl	_EVBUFFER_UNLOCK
	b	LBB0_6
LBB0_5:
	mov	w21, #-1
LBB0_6:
	mov	x0, x21
	ldp	x29, x30, [sp, #96]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #80]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #64]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #48]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #32]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #112
	ret
LBB0_7:
	ldr	x27, [x19]
	cbz	x27, LBB0_12
; %bb.8:
	mov	x0, x19
	mov	w1, #1
	bl	_evbuffer_freeze
	str	xzr, [x20, #24]
	str	wzr, [x20, #4]
	ldr	x0, [x20, #8]
	mov	w1, #0
	mov	w2, #8
	bl	_memset
	mov	w22, #0
	ldr	x23, [x19, #8]
	str	x23, [x20, #24]
Lloh0:
	adrp	x25, _MAX_WSABUFS@GOTPAGE
Lloh1:
	ldr	x25, [x25, _MAX_WSABUFS@GOTPAGEOFF]
	ldr	w8, [x25]
	cmp	w8, #1
	ccmp	x23, #0, #4, ge
	b.eq	LBB0_14
; %bb.9:
	mov	x26, #0
	mov	x22, #0
	cmp	x27, x24
	csel	x27, x27, x24, lo
Lloh2:
	adrp	x24, _EVBUFFER_MEM_PINNED_W@GOTPAGE
Lloh3:
	ldr	x24, [x24, _EVBUFFER_MEM_PINNED_W@GOTPAGEOFF]
LBB0_10:                                ; =>This Inner Loop Header: Depth=1
	ldr	x28, [x20, #8]
	ldp	x9, x8, [x23, #8]
	add	x8, x9, x8
	str	x8, [x28, x26]
	ldr	w1, [x24]
	mov	x0, x23
	bl	_evbuffer_chain_pin_
	ldr	x9, [x23]
	subs	x8, x27, x9
	b.ls	LBB0_13
; %bb.11:                               ;   in Loop: Header=BB0_10 Depth=1
	add	x10, x28, x26
	str	x9, [x10, #8]
	add	x22, x22, #1
	ldr	x23, [x23, #24]
	ldrsw	x9, [x25]
	add	x26, x26, #16
	cmp	x22, x9
	ccmp	x23, #0, #4, lt
	mov	x27, x8
	b.ne	LBB0_10
	b	LBB0_14
LBB0_12:
	mov	w21, #0
	b	LBB0_4
LBB0_13:
	add	x8, x28, x26
	str	x27, [x8, #8]
	add	w22, w22, #1
LBB0_14:
	str	w22, [x20, #4]
	mov	x0, x19
	bl	_evbuffer_incref_
	ldr	w0, [x20, #16]
	ldr	x1, [x20, #8]
	add	x3, sp, #12
	mov	x2, x22
	mov	w4, #0
	mov	x5, x21
	mov	x6, #0
	bl	_WSASend
	cbz	x0, LBB0_16
; %bb.15:
	bl	_WSAGetLastError
Lloh4:
	adrp	x8, _WSA_IO_PENDING@GOTPAGE
Lloh5:
	ldr	x8, [x8, _WSA_IO_PENDING@GOTPAGEOFF]
Lloh6:
	ldr	w8, [x8]
	cmp	w0, w8
	b.ne	LBB0_17
LBB0_16:
	mov	w21, #0
	mov	w8, #1
	str	w8, [x20]
	b	LBB0_4
LBB0_17:
Lloh7:
	adrp	x8, _EVBUFFER_MEM_PINNED_W@GOTPAGE
Lloh8:
	ldr	x8, [x8, _EVBUFFER_MEM_PINNED_W@GOTPAGEOFF]
Lloh9:
	ldr	w1, [x8]
	mov	x0, x20
	bl	_pin_release
	mov	x0, x19
	mov	w1, #1
	bl	_evbuffer_unfreeze
	mov	x0, x19
	bl	_evbuffer_free
	b	LBB0_3
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpLdrGotLdr	Lloh4, Lloh5, Lloh6
	.loh AdrpLdrGotLdr	Lloh7, Lloh8, Lloh9
	.cfi_endproc
                                        ; -- End function
	.comm	_MAX_WSABUFS,4,2                ; @MAX_WSABUFS
	.comm	_EVBUFFER_MEM_PINNED_W,4,2      ; @EVBUFFER_MEM_PINNED_W
	.comm	_WSA_IO_PENDING,4,2             ; @WSA_IO_PENDING
.subsections_via_symbols
