	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function bufferevent_openssl_new_impl
_bufferevent_openssl_new_impl:          ## @bufferevent_openssl_new_impl
	.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	%r8d, -56(%rbp)                 ## 4-byte Spill
	movq	%rdi, %r13
	movq	_BEV_OPT_THREADSAFE@GOTPCREL(%rip), %rax
	movl	(%rax), %r12d
	movq	%rsi, %r14
	testq	%rsi, %rsi
	je	LBB0_2
## %bb.1:
	testq	%rdx, %rdx
	jns	LBB0_24
LBB0_2:
	movq	%rcx, -64(%rbp)                 ## 8-byte Spill
	movl	%r9d, %r15d
	movq	%rdx, -48(%rbp)                 ## 8-byte Spill
	movl	$1, %edi
	movl	$56, %esi
	callq	_mm_calloc
	testq	%rax, %rax
	je	LBB0_24
## %bb.3:
	movq	%rax, %rbx
	notl	%r12d
	movl	%r15d, -52(%rbp)                ## 4-byte Spill
	andl	%r15d, %r12d
	leaq	8(%rax), %rdi
	movq	_bufferevent_ops_openssl@GOTPCREL(%rip), %rdx
	movq	%r13, %rsi
	movl	%r12d, %ecx
	movq	%rdi, %r12
	callq	_bufferevent_init_common_
	testq	%rax, %rax
	movl	-56(%rbp), %r15d                ## 4-byte Reload
	js	LBB0_23
## %bb.4:
	movq	%rbx, %r13
	movq	_SSL_MODE_ACCEPT_MOVING_WRITE_BUFFER@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	-64(%rbp), %rbx                 ## 8-byte Reload
	movq	%rbx, %rdi
	callq	_SSL_set_mode
	movq	%r14, 48(%r13)
	movq	%rbx, 32(%r13)
	movl	20(%r13), %edi
	movq	_be_openssl_outbuf_cb@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r13, %rdx
	callq	_evbuffer_add_cb
	movl	%eax, 40(%r13)
	movq	_BEV_OPT_THREADSAFE@GOTPCREL(%rip), %rax
	movl	-52(%rbp), %ecx                 ## 4-byte Reload
	testl	%ecx, (%rax)
	je	LBB0_6
## %bb.5:
	movq	%r12, %rdi
	xorl	%esi, %esi
	callq	_bufferevent_enable_locking_
LBB0_6:
	testq	%r14, %r14
	je	LBB0_8
## %bb.7:
	movq	%r12, %rdi
	callq	_bufferevent_init_generic_timeout_cbs_
	movq	%r14, %rdi
	callq	_bufferevent_incref_
LBB0_8:
	movl	%r15d, (%r13)
	movl	$-1, 4(%r13)
	movq	%r13, %rdi
	callq	_init_bio_counts
	cmpl	$128, %r15d
	je	LBB0_14
## %bb.9:
	cmpl	$129, %r15d
	je	LBB0_13
## %bb.10:
	cmpl	$130, %r15d
	jne	LBB0_23
## %bb.11:
	movq	32(%r13), %rdi
	callq	_SSL_set_accept_state
	jmp	LBB0_12
LBB0_14:
	movq	%r13, %rdi
	movq	-48(%rbp), %rsi                 ## 8-byte Reload
	callq	_set_open_callbacks
	testl	%eax, %eax
	jns	LBB0_16
	jmp	LBB0_23
LBB0_13:
	movq	32(%r13), %rdi
	callq	_SSL_set_connect_state
LBB0_12:
	movq	%r13, %rdi
	movq	-48(%rbp), %rsi                 ## 8-byte Reload
	callq	_set_handshake_callbacks
	testl	%eax, %eax
	js	LBB0_23
LBB0_16:
	movl	%r15d, %ebx
	movq	%r14, %r15
	movq	_EV_READ@GOTPCREL(%rip), %r14
	movl	(%r14), %esi
	testq	%r15, %r15
	je	LBB0_19
## %bb.17:
	movq	%r15, %rdi
	xorl	%edx, %edx
	xorl	%ecx, %ecx
	callq	_bufferevent_setwatermark
	movq	_EV_WRITE@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	orl	(%r14), %esi
	movq	%r15, %rdi
	callq	_bufferevent_enable
	cmpl	$128, %ebx
	jne	LBB0_25
## %bb.18:
	movq	_BEV_SUSPEND_FILT_READ@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r15, %rdi
	callq	_bufferevent_suspend_read_
	jmp	LBB0_25
LBB0_19:
	movq	_EV_WRITE@GOTPCREL(%rip), %rax
	orl	(%rax), %esi
	movl	%esi, 8(%r13)
	cmpq	$0, 24(%r13)
	je	LBB0_25
## %bb.20:
	cmpl	$128, %ebx
	je	LBB0_22
## %bb.21:
	leaq	16(%r13), %rdi
	xorl	%esi, %esi
	callq	_event_add
	testq	%rax, %rax
	js	LBB0_23
LBB0_22:
	addq	$12, %r13
	movq	%r13, %rdi
	xorl	%esi, %esi
	callq	_event_add
	testq	%rax, %rax
	jns	LBB0_25
LBB0_23:
	movq	%r12, %rdi
	callq	_bufferevent_free
LBB0_24:
	xorl	%r12d, %r12d
LBB0_25:
	movq	%r12, %rax
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_BEV_OPT_THREADSAFE,4,2         ## @BEV_OPT_THREADSAFE
	.comm	_bufferevent_ops_openssl,4,2    ## @bufferevent_ops_openssl
	.comm	_SSL_MODE_ACCEPT_MOVING_WRITE_BUFFER,4,2 ## @SSL_MODE_ACCEPT_MOVING_WRITE_BUFFER
	.comm	_be_openssl_outbuf_cb,4,2       ## @be_openssl_outbuf_cb
	.comm	_EV_READ,4,2                    ## @EV_READ
	.comm	_EV_WRITE,4,2                   ## @EV_WRITE
	.comm	_BEV_SUSPEND_FILT_READ,4,2      ## @BEV_SUSPEND_FILT_READ
	.no_dead_strip	_bufferevent_openssl_new_impl
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function bufferevent_openssl_new_impl
_bufferevent_openssl_new_impl:          ; @bufferevent_openssl_new_impl
	.cfi_startproc
; %bb.0:
	stp	x28, x27, [sp, #-96]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 96
	stp	x26, x25, [sp, #16]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #32]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #48]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #64]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #80]             ; 16-byte Folded Spill
	add	x29, sp, #80
	.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	x24, x5
	mov	x20, x4
	mov	x25, x3
	mov	x23, x2
	mov	x21, x1
	mov	x26, x0
Lloh0:
	adrp	x27, _BEV_OPT_THREADSAFE@GOTPAGE
Lloh1:
	ldr	x27, [x27, _BEV_OPT_THREADSAFE@GOTPAGEOFF]
	ldr	w19, [x27]
	cbz	x1, LBB0_2
; %bb.1:
	tbz	x23, #63, LBB0_23
LBB0_2:
	mov	w0, #1
	mov	w1, #56
	bl	_mm_calloc
	cbz	x0, LBB0_23
; %bb.3:
	mov	x22, x0
	bic	w3, w24, w19
	add	x19, x0, #8
Lloh2:
	adrp	x2, _bufferevent_ops_openssl@GOTPAGE
Lloh3:
	ldr	x2, [x2, _bufferevent_ops_openssl@GOTPAGEOFF]
	mov	x0, x19
	mov	x1, x26
	bl	_bufferevent_init_common_
	tbnz	x0, #63, LBB0_22
; %bb.4:
Lloh4:
	adrp	x8, _SSL_MODE_ACCEPT_MOVING_WRITE_BUFFER@GOTPAGE
Lloh5:
	ldr	x8, [x8, _SSL_MODE_ACCEPT_MOVING_WRITE_BUFFER@GOTPAGEOFF]
Lloh6:
	ldr	w1, [x8]
	mov	x0, x25
	bl	_SSL_set_mode
	str	x21, [x22, #48]
	str	x25, [x22, #32]
	ldr	w0, [x22, #20]
Lloh7:
	adrp	x8, _be_openssl_outbuf_cb@GOTPAGE
Lloh8:
	ldr	x8, [x8, _be_openssl_outbuf_cb@GOTPAGEOFF]
Lloh9:
	ldr	w1, [x8]
	mov	x2, x22
	bl	_evbuffer_add_cb
	str	w0, [x22, #40]
	ldr	w8, [x27]
	tst	w8, w24
	b.eq	LBB0_6
; %bb.5:
	mov	x0, x19
	mov	x1, #0
	bl	_bufferevent_enable_locking_
LBB0_6:
	cbz	x21, LBB0_8
; %bb.7:
	mov	x0, x19
	bl	_bufferevent_init_generic_timeout_cbs_
	mov	x0, x21
	bl	_bufferevent_incref_
LBB0_8:
	mov	w8, #-1
	stp	w20, w8, [x22]
	mov	x0, x22
	bl	_init_bio_counts
	cmp	w20, #128
	b.eq	LBB0_12
; %bb.9:
	cmp	w20, #129
	b.eq	LBB0_13
; %bb.10:
	cmp	w20, #130
	b.ne	LBB0_22
; %bb.11:
	ldr	x0, [x22, #32]
	bl	_SSL_set_accept_state
	b	LBB0_14
LBB0_12:
	mov	x0, x22
	mov	x1, x23
	bl	_set_open_callbacks
	tbz	w0, #31, LBB0_15
	b	LBB0_22
LBB0_13:
	ldr	x0, [x22, #32]
	bl	_SSL_set_connect_state
LBB0_14:
	mov	x0, x22
	mov	x1, x23
	bl	_set_handshake_callbacks
	tbnz	w0, #31, LBB0_22
LBB0_15:
Lloh10:
	adrp	x23, _EV_READ@GOTPAGE
Lloh11:
	ldr	x23, [x23, _EV_READ@GOTPAGEOFF]
	ldr	w1, [x23]
	cbz	x21, LBB0_18
; %bb.16:
	mov	x0, x21
	mov	w2, #0
	mov	w3, #0
	bl	_bufferevent_setwatermark
	ldr	w8, [x23]
Lloh12:
	adrp	x9, _EV_WRITE@GOTPAGE
Lloh13:
	ldr	x9, [x9, _EV_WRITE@GOTPAGEOFF]
Lloh14:
	ldr	w9, [x9]
	orr	w1, w9, w8
	mov	x0, x21
	bl	_bufferevent_enable
	cmp	w20, #128
	b.ne	LBB0_24
; %bb.17:
Lloh15:
	adrp	x8, _BEV_SUSPEND_FILT_READ@GOTPAGE
Lloh16:
	ldr	x8, [x8, _BEV_SUSPEND_FILT_READ@GOTPAGEOFF]
Lloh17:
	ldr	w1, [x8]
	mov	x0, x21
	bl	_bufferevent_suspend_read_
	b	LBB0_24
LBB0_18:
Lloh18:
	adrp	x8, _EV_WRITE@GOTPAGE
Lloh19:
	ldr	x8, [x8, _EV_WRITE@GOTPAGEOFF]
Lloh20:
	ldr	w8, [x8]
	orr	w8, w8, w1
	str	w8, [x22, #8]
	ldr	x8, [x22, #24]
	cbz	x8, LBB0_24
; %bb.19:
	cmp	w20, #128
	b.eq	LBB0_21
; %bb.20:
	add	x0, x22, #16
	mov	x1, #0
	bl	_event_add
	tbnz	x0, #63, LBB0_22
LBB0_21:
	add	x0, x22, #12
	mov	x1, #0
	bl	_event_add
	tbz	x0, #63, LBB0_24
LBB0_22:
	mov	x0, x19
	bl	_bufferevent_free
LBB0_23:
	mov	x19, #0
LBB0_24:
	mov	x0, x19
	ldp	x29, x30, [sp, #80]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #64]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #48]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #32]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #16]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp], #96             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpLdrGotLdr	Lloh7, Lloh8, Lloh9
	.loh AdrpLdrGotLdr	Lloh4, Lloh5, Lloh6
	.loh AdrpLdrGot	Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh15, Lloh16, Lloh17
	.loh AdrpLdrGotLdr	Lloh18, Lloh19, Lloh20
	.cfi_endproc
                                        ; -- End function
	.comm	_BEV_OPT_THREADSAFE,4,2         ; @BEV_OPT_THREADSAFE
	.comm	_bufferevent_ops_openssl,4,2    ; @bufferevent_ops_openssl
	.comm	_SSL_MODE_ACCEPT_MOVING_WRITE_BUFFER,4,2 ; @SSL_MODE_ACCEPT_MOVING_WRITE_BUFFER
	.comm	_be_openssl_outbuf_cb,4,2       ; @be_openssl_outbuf_cb
	.comm	_EV_READ,4,2                    ; @EV_READ
	.comm	_EV_WRITE,4,2                   ; @EV_WRITE
	.comm	_BEV_SUSPEND_FILT_READ,4,2      ; @BEV_SUSPEND_FILT_READ
	.no_dead_strip	_bufferevent_openssl_new_impl
.subsections_via_symbols
