	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function do_handshake
_do_handshake:                          ## @do_handshake
	.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	%rbx
	pushq	%rax
	.cfi_offset %rbx, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movl	$-131, %eax
	addl	(%rdi), %eax
	cmpl	$2, %eax
	jae	LBB0_1
## %bb.2:
	movq	%rdi, %rbx
	movl	8(%rdi), %edi
	callq	_SSL_do_handshake
	movl	%eax, %r14d
	movq	%rbx, %rdi
	callq	_decrement_buckets
	cmpl	$1, %r14d
	jne	LBB0_4
## %bb.3:
	movl	$130, (%rbx)
	movq	%rbx, %rdi
	movl	$-1, %esi
	callq	_set_open_callbacks
	movl	12(%rbx), %esi
	addq	$12, %rbx
	movq	%rbx, %rdi
	callq	_bufferevent_enable
	movq	_BEV_EVENT_CONNECTED@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%rbx, %rdi
	xorl	%edx, %edx
	callq	_bufferevent_run_eventcb_
	movl	$1, %eax
	jmp	LBB0_12
LBB0_1:
	xorl	%edi, %edi
	callq	_EVUTIL_ASSERT
LBB0_11:
	movl	$-1, %eax
LBB0_12:
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_4:
	movl	8(%rbx), %edi
	movl	%r14d, %esi
	callq	_SSL_get_error
	movl	%eax, %r15d
	movl	%eax, %edi
	callq	_print_err
	cmpl	$129, %r15d
	je	LBB0_8
## %bb.5:
	cmpl	$128, %r15d
	jne	LBB0_10
## %bb.6:
	xorl	%eax, %eax
	cmpl	$0, 4(%rbx)
	jne	LBB0_12
## %bb.7:
	movq	%rbx, %rdi
	callq	_stop_reading
	movq	%rbx, %rdi
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_start_writing                  ## TAILCALL
LBB0_8:
	xorl	%eax, %eax
	cmpl	$0, 4(%rbx)
	jne	LBB0_12
## %bb.9:
	movq	%rbx, %rdi
	callq	_stop_writing
	movq	%rbx, %rdi
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_start_reading                  ## TAILCALL
LBB0_10:
	movq	_BEV_EVENT_READING@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%rbx, %rdi
	movl	%r15d, %edx
	movl	%r14d, %ecx
	callq	_conn_closed
	jmp	LBB0_11
	.cfi_endproc
                                        ## -- End function
	.comm	_BEV_EVENT_CONNECTED,4,2        ## @BEV_EVENT_CONNECTED
	.comm	_BEV_EVENT_READING,4,2          ## @BEV_EVENT_READING
	.no_dead_strip	_do_handshake
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function do_handshake
_do_handshake:                          ; @do_handshake
	.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
	ldr	w8, [x0]
	sub	w8, w8, #131
	cmp	w8, #2
	b.hs	LBB0_3
; %bb.1:
	mov	x19, x0
	ldr	w0, [x0, #8]
	bl	_SSL_do_handshake
	mov	x20, x0
	mov	x0, x19
	bl	_decrement_buckets
	cmp	w20, #1
	b.ne	LBB0_6
; %bb.2:
	mov	w8, #130
	str	w8, [x19]
	mov	x0, x19
	mov	w1, #-1
	bl	_set_open_callbacks
	ldr	w1, [x19, #12]!
	mov	x0, x19
	bl	_bufferevent_enable
Lloh0:
	adrp	x8, _BEV_EVENT_CONNECTED@GOTPAGE
Lloh1:
	ldr	x8, [x8, _BEV_EVENT_CONNECTED@GOTPAGEOFF]
Lloh2:
	ldr	w1, [x8]
	mov	x0, x19
	mov	w2, #0
	bl	_bufferevent_run_eventcb_
	mov	w0, #1
	b	LBB0_5
LBB0_3:
	mov	w0, #0
	bl	_EVUTIL_ASSERT
LBB0_4:
	mov	w0, #-1
LBB0_5:
	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_6:
	ldr	w0, [x19, #8]
	mov	x1, x20
	bl	_SSL_get_error
	mov	x21, x0
	bl	_print_err
	cmp	w21, #129
	b.eq	LBB0_10
; %bb.7:
	cmp	w21, #128
	b.ne	LBB0_12
; %bb.8:
	ldr	w8, [x19, #4]
	cbnz	w8, LBB0_11
; %bb.9:
	mov	x0, x19
	bl	_stop_reading
	mov	x0, x19
	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
	b	_start_writing
LBB0_10:
	ldr	w8, [x19, #4]
	cbz	w8, LBB0_13
LBB0_11:
	mov	w0, #0
	b	LBB0_5
LBB0_12:
Lloh3:
	adrp	x8, _BEV_EVENT_READING@GOTPAGE
Lloh4:
	ldr	x8, [x8, _BEV_EVENT_READING@GOTPAGEOFF]
Lloh5:
	ldr	w1, [x8]
	mov	x0, x19
	mov	x2, x21
	mov	x3, x20
	bl	_conn_closed
	b	LBB0_4
LBB0_13:
	mov	x0, x19
	bl	_stop_writing
	mov	x0, x19
	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
	b	_start_reading
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.cfi_endproc
                                        ; -- End function
	.comm	_BEV_EVENT_CONNECTED,4,2        ; @BEV_EVENT_CONNECTED
	.comm	_BEV_EVENT_READING,4,2          ; @BEV_EVENT_READING
	.no_dead_strip	_do_handshake
.subsections_via_symbols
