	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function do_write
_do_write:                              ## @do_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	$168, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdi, %r15
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	%rax, -48(%rbp)
	leaq	32(%rdi), %rax
	movq	%rax, -192(%rbp)                ## 8-byte Spill
	movq	40(%rdi), %r13
	movl	(%rdi), %esi
	testl	%esi, %esi
	jg	LBB0_2
## %bb.1:
	movq	-192(%rbp), %rdi                ## 8-byte Reload
	callq	_bufferevent_get_write_max_
	movl	%eax, %esi
LBB0_2:
	leaq	40(%r15), %r12
	xorl	%r14d, %r14d
	leaq	-176(%rbp), %rcx
	movq	%r13, %rdi
	xorl	%edx, %edx
	movl	$8, %r8d
	callq	_evbuffer_peek
	testl	%eax, %eax
	js	LBB0_13
## %bb.3:
	je	LBB0_29
## %bb.4:
	movq	%r13, -200(%rbp)                ## 8-byte Spill
	movq	%r12, -208(%rbp)                ## 8-byte Spill
	cmpl	$8, %eax
	movl	$8, %r13d
	cmovll	%eax, %r13d
	shlq	$4, %r13
	xorl	%r14d, %r14d
	xorl	%eax, %eax
	movq	%rax, -184(%rbp)                ## 8-byte Spill
	xorl	%ebx, %ebx
	jmp	LBB0_7
	.p2align	4, 0x90
LBB0_5:                                 ##   in Loop: Header=BB0_7 Depth=1
	addl	%r12d, %ebx
	movl	$-1, (%r15)
	movq	%r15, %rdi
	callq	_decrement_buckets
LBB0_6:                                 ##   in Loop: Header=BB0_7 Depth=1
	addq	$16, %r14
	cmpq	%r14, %r13
	je	LBB0_24
LBB0_7:                                 ## =>This Inner Loop Header: Depth=1
	movq	-192(%rbp), %rax                ## 8-byte Reload
	cmpq	$0, (%rax)
	jne	LBB0_24
## %bb.8:                               ##   in Loop: Header=BB0_7 Depth=1
	movq	-176(%rbp,%r14), %rdx
	testq	%rdx, %rdx
	je	LBB0_6
## %bb.9:                               ##   in Loop: Header=BB0_7 Depth=1
	movl	24(%r15), %edi
	movl	-168(%rbp,%r14), %esi
	callq	_SSL_write
	movl	%eax, %r12d
	testl	%eax, %eax
	jle	LBB0_14
## %bb.10:                              ##   in Loop: Header=BB0_7 Depth=1
	movq	-184(%rbp), %rax                ## 8-byte Reload
	movq	_OP_MADE_PROGRESS@GOTPCREL(%rip), %rcx
	orl	(%rcx), %eax
	movq	%rax, -184(%rbp)                ## 8-byte Spill
	cmpq	$0, 16(%r15)
	je	LBB0_5
## %bb.11:                              ##   in Loop: Header=BB0_7 Depth=1
	movq	%r15, %rdi
	callq	_clear_wbor
	testq	%rax, %rax
	jns	LBB0_5
LBB0_12:
	movq	_OP_ERR@GOTPCREL(%rip), %rax
	movq	-184(%rbp), %r14                ## 8-byte Reload
	orl	(%rax), %r14d
	jmp	LBB0_29
LBB0_13:
	movq	_OP_ERR@GOTPCREL(%rip), %rax
	movl	(%rax), %r14d
	jmp	LBB0_29
LBB0_14:
	movl	24(%r15), %edi
	movl	%r12d, %esi
	callq	_SSL_get_error
	movl	%eax, %r13d
	movl	%eax, %edi
	callq	_print_err
	cmpl	$129, %r13d
	je	LBB0_19
## %bb.15:
	cmpl	$128, %r13d
	jne	LBB0_22
## %bb.16:
	cmpq	$0, 16(%r15)
	je	LBB0_18
## %bb.17:
	movq	%r15, %rdi
	callq	_clear_wbor
	testq	%rax, %rax
	jns	LBB0_18
	jmp	LBB0_12
LBB0_19:
	cmpq	$0, 16(%r15)
	jne	LBB0_18
## %bb.20:
	movq	%r15, %rdi
	callq	_set_wbor
	testl	%eax, %eax
	js	LBB0_12
LBB0_18:
	movl	-176(%rbp,%r14), %eax
	jmp	LBB0_23
LBB0_22:
	movq	_BEV_EVENT_WRITING@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r15, %rdi
	movl	%r13d, %edx
	movl	%r12d, %ecx
	callq	_conn_closed
	movl	$-1, %eax
LBB0_23:
	movl	%eax, (%r15)
	movq	_OP_BLOCKED@GOTPCREL(%rip), %rax
	movq	-184(%rbp), %rcx                ## 8-byte Reload
	orl	(%rax), %ecx
	movq	%rcx, -184(%rbp)                ## 8-byte Spill
LBB0_24:
	testl	%ebx, %ebx
	movq	-208(%rbp), %r12                ## 8-byte Reload
	je	LBB0_28
## %bb.25:
	movq	-200(%rbp), %rdi                ## 8-byte Reload
	movl	%ebx, %esi
	callq	_evbuffer_drain
	cmpq	$0, 8(%r15)
	movq	-184(%rbp), %r14                ## 8-byte Reload
	je	LBB0_27
## %bb.26:
	movq	%r12, %rdi
	callq	_BEV_RESET_GENERIC_WRITE_TIMEOUT
LBB0_27:
	movq	_EV_WRITE@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r12, %rdi
	xorl	%edx, %edx
	callq	_bufferevent_trigger_nolock_
	jmp	LBB0_29
LBB0_28:
	movq	-184(%rbp), %r14                ## 8-byte Reload
LBB0_29:
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	cmpq	-48(%rbp), %rax
	jne	LBB0_31
## %bb.30:
	movl	%r14d, %eax
	addq	$168, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_31:
	callq	___stack_chk_fail
	.cfi_endproc
                                        ## -- End function
	.comm	_OP_ERR,4,2                     ## @OP_ERR
	.comm	_OP_MADE_PROGRESS,4,2           ## @OP_MADE_PROGRESS
	.comm	_BEV_EVENT_WRITING,4,2          ## @BEV_EVENT_WRITING
	.comm	_OP_BLOCKED,4,2                 ## @OP_BLOCKED
	.comm	_EV_WRITE,4,2                   ## @EV_WRITE
	.no_dead_strip	_do_write
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function do_write
_do_write:                              ; @do_write
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #240
	.cfi_def_cfa_offset 240
	stp	x28, x27, [sp, #144]            ; 16-byte Folded Spill
	stp	x26, x25, [sp, #160]            ; 16-byte Folded Spill
	stp	x24, x23, [sp, #176]            ; 16-byte Folded Spill
	stp	x22, x21, [sp, #192]            ; 16-byte Folded Spill
	stp	x20, x19, [sp, #208]            ; 16-byte Folded Spill
	stp	x29, x30, [sp, #224]            ; 16-byte Folded Spill
	add	x29, sp, #224
	.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, x0
Lloh0:
	adrp	x8, ___stack_chk_guard@GOTPAGE
Lloh1:
	ldr	x8, [x8, ___stack_chk_guard@GOTPAGEOFF]
Lloh2:
	ldr	x8, [x8]
	stur	x8, [x29, #-88]
	add	x24, x0, #32
	mov	x20, x0
	ldr	x19, [x20, #40]!
	ldr	w1, [x0]
	cmp	w1, #0
	b.gt	LBB0_2
; %bb.1:
	mov	x0, x24
	bl	_bufferevent_get_write_max_
	mov	x1, x0
LBB0_2:
	add	x3, sp, #8
	mov	x0, x19
	mov	x2, #0
	mov	w4, #8
	bl	_evbuffer_peek
	tbnz	w0, #31, LBB0_13
; %bb.3:
	cbz	w0, LBB0_14
; %bb.4:
	str	x19, [sp]                       ; 8-byte Folded Spill
	mov	w19, #0
	mov	w23, #0
	mov	w8, #8
	cmp	w0, #8
	csel	w27, w0, w8, lt
	add	x26, sp, #8
Lloh3:
	adrp	x28, _OP_MADE_PROGRESS@GOTPAGE
Lloh4:
	ldr	x28, [x28, _OP_MADE_PROGRESS@GOTPAGEOFF]
	mov	w22, #-1
	b	LBB0_7
LBB0_5:                                 ;   in Loop: Header=BB0_7 Depth=1
	add	w23, w25, w23
	str	w22, [x21]
	mov	x0, x21
	bl	_decrement_buckets
LBB0_6:                                 ;   in Loop: Header=BB0_7 Depth=1
	add	x26, x26, #16
	subs	x27, x27, #1
	b.eq	LBB0_24
LBB0_7:                                 ; =>This Inner Loop Header: Depth=1
	ldr	x8, [x24]
	cbnz	x8, LBB0_24
; %bb.8:                                ;   in Loop: Header=BB0_7 Depth=1
	ldr	x2, [x26]
	cbz	x2, LBB0_6
; %bb.9:                                ;   in Loop: Header=BB0_7 Depth=1
	ldr	w0, [x21, #24]
	ldr	w1, [x26, #8]
	bl	_SSL_write
	mov	x25, x0
	cmp	w0, #1
	b.lt	LBB0_15
; %bb.10:                               ;   in Loop: Header=BB0_7 Depth=1
	ldr	w8, [x28]
	orr	w19, w8, w19
	ldr	x8, [x21, #16]
	cbz	x8, LBB0_5
; %bb.11:                               ;   in Loop: Header=BB0_7 Depth=1
	mov	x0, x21
	bl	_clear_wbor
	tbz	x0, #63, LBB0_5
LBB0_12:
Lloh5:
	adrp	x8, _OP_ERR@GOTPAGE
Lloh6:
	ldr	x8, [x8, _OP_ERR@GOTPAGEOFF]
Lloh7:
	ldr	w8, [x8]
	orr	w19, w8, w19
	b	LBB0_28
LBB0_13:
Lloh8:
	adrp	x8, _OP_ERR@GOTPAGE
Lloh9:
	ldr	x8, [x8, _OP_ERR@GOTPAGEOFF]
Lloh10:
	ldr	w19, [x8]
	b	LBB0_28
LBB0_14:
	mov	w19, #0
	b	LBB0_28
LBB0_15:
	ldr	w0, [x21, #24]
	mov	x1, x25
	bl	_SSL_get_error
	mov	x24, x0
	bl	_print_err
	cmp	w24, #129
	b.eq	LBB0_19
; %bb.16:
	cmp	w24, #128
	b.ne	LBB0_22
; %bb.17:
	ldr	x8, [x21, #16]
	cbz	x8, LBB0_21
; %bb.18:
	mov	x0, x21
	bl	_clear_wbor
	tbz	x0, #63, LBB0_21
	b	LBB0_12
LBB0_19:
	ldr	x8, [x21, #16]
	cbnz	x8, LBB0_21
; %bb.20:
	mov	x0, x21
	bl	_set_wbor
	tbnz	w0, #31, LBB0_12
LBB0_21:
	ldr	w8, [x26]
	b	LBB0_23
LBB0_22:
Lloh11:
	adrp	x8, _BEV_EVENT_WRITING@GOTPAGE
Lloh12:
	ldr	x8, [x8, _BEV_EVENT_WRITING@GOTPAGEOFF]
Lloh13:
	ldr	w1, [x8]
	mov	x0, x21
	mov	x2, x24
	mov	x3, x25
	bl	_conn_closed
	mov	w8, #-1
LBB0_23:
	str	w8, [x21]
Lloh14:
	adrp	x8, _OP_BLOCKED@GOTPAGE
Lloh15:
	ldr	x8, [x8, _OP_BLOCKED@GOTPAGEOFF]
Lloh16:
	ldr	w8, [x8]
	orr	w19, w8, w19
LBB0_24:
	cbz	w23, LBB0_28
; %bb.25:
	ldr	x0, [sp]                        ; 8-byte Folded Reload
	mov	x1, x23
	bl	_evbuffer_drain
	ldr	x8, [x21, #8]
	cbz	x8, LBB0_27
; %bb.26:
	mov	x0, x20
	bl	_BEV_RESET_GENERIC_WRITE_TIMEOUT
LBB0_27:
Lloh17:
	adrp	x8, _EV_WRITE@GOTPAGE
Lloh18:
	ldr	x8, [x8, _EV_WRITE@GOTPAGEOFF]
Lloh19:
	ldr	w1, [x8]
	mov	x0, x20
	mov	w2, #0
	bl	_bufferevent_trigger_nolock_
LBB0_28:
	ldur	x8, [x29, #-88]
Lloh20:
	adrp	x9, ___stack_chk_guard@GOTPAGE
Lloh21:
	ldr	x9, [x9, ___stack_chk_guard@GOTPAGEOFF]
Lloh22:
	ldr	x9, [x9]
	cmp	x9, x8
	b.ne	LBB0_30
; %bb.29:
	mov	x0, x19
	ldp	x29, x30, [sp, #224]            ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #208]            ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #192]            ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #176]            ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #160]            ; 16-byte Folded Reload
	ldp	x28, x27, [sp, #144]            ; 16-byte Folded Reload
	add	sp, sp, #240
	ret
LBB0_30:
	bl	___stack_chk_fail
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGot	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.loh AdrpLdrGotLdr	Lloh14, Lloh15, Lloh16
	.loh AdrpLdrGotLdr	Lloh17, Lloh18, Lloh19
	.loh AdrpLdrGotLdr	Lloh20, Lloh21, Lloh22
	.cfi_endproc
                                        ; -- End function
	.comm	_OP_ERR,4,2                     ; @OP_ERR
	.comm	_OP_MADE_PROGRESS,4,2           ; @OP_MADE_PROGRESS
	.comm	_BEV_EVENT_WRITING,4,2          ; @BEV_EVENT_WRITING
	.comm	_OP_BLOCKED,4,2                 ; @OP_BLOCKED
	.comm	_EV_WRITE,4,2                   ; @EV_WRITE
	.no_dead_strip	_do_write
.subsections_via_symbols
