	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_SSL_CTX_add_session            ## -- Begin function SSL_CTX_add_session
	.p2align	4, 0x90
_SSL_CTX_add_session:                   ## @SSL_CTX_add_session
	.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	%r12
	pushq	%rbx
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rsi, %r14
	movq	%rdi, %r12
	movq	%rsi, %rdi
	callq	_SSL_SESSION_up_ref
	movl	(%r12), %edi
	callq	_CRYPTO_THREAD_write_lock
	movl	12(%r12), %edi
	movq	%r14, %rsi
	callq	_lh_SSL_SESSION_insert
	movq	%rax, %r15
	testq	%rax, %rax
	je	LBB0_8
## %bb.1:
	cmpq	%r14, %r15
	je	LBB0_8
## %bb.2:
	movq	%r12, %rdi
	movq	%r15, %rsi
	callq	_SSL_SESSION_list_remove
	movq	%r15, %rdi
	callq	_SSL_SESSION_free
LBB0_3:
	movq	%r12, %rdi
	movq	%r14, %rsi
	callq	_SSL_SESSION_list_add
	movq	%r12, %rdi
	callq	_SSL_CTX_sess_get_cache_size
	movl	$1, %r14d
	testq	%rax, %rax
	jle	LBB0_13
## %bb.4:
	movq	%r12, %rdi
	callq	_SSL_CTX_sess_number
	movq	%rax, %r15
	movq	%r12, %rdi
	callq	_SSL_CTX_sess_get_cache_size
	cmpq	%rax, %r15
	jle	LBB0_13
## %bb.5:
	leaq	4(%r12), %r15
	.p2align	4, 0x90
LBB0_6:                                 ## =>This Inner Loop Header: Depth=1
	movl	8(%r12), %esi
	movq	%r12, %rdi
	xorl	%edx, %edx
	callq	_remove_session_lock
	testl	%eax, %eax
	je	LBB0_13
## %bb.7:                               ##   in Loop: Header=BB0_6 Depth=1
	movq	%r15, %rdi
	callq	_tsan_counter
	movq	%r12, %rdi
	callq	_SSL_CTX_sess_number
	movq	%rax, %rbx
	movq	%r12, %rdi
	callq	_SSL_CTX_sess_get_cache_size
	cmpq	%rax, %rbx
	jg	LBB0_6
	jmp	LBB0_13
LBB0_8:
	testq	%r15, %r15
	jne	LBB0_12
## %bb.9:
	movl	12(%r12), %edi
	movq	%r14, %rsi
	callq	_lh_SSL_SESSION_retrieve
	testq	%rax, %rax
	jne	LBB0_3
## %bb.10:
	testq	%r14, %r14
	je	LBB0_3
## %bb.11:
	movq	%r14, %r15
LBB0_12:
	movq	%r15, %rdi
	callq	_SSL_SESSION_free
	xorl	%r14d, %r14d
LBB0_13:
	movl	(%r12), %edi
	callq	_CRYPTO_THREAD_unlock
	movl	%r14d, %eax
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_SSL_CTX_add_session            ; -- Begin function SSL_CTX_add_session
	.p2align	2
_SSL_CTX_add_session:                   ; @SSL_CTX_add_session
	.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
	mov	x20, x1
	mov	x19, x0
	mov	x0, x1
	bl	_SSL_SESSION_up_ref
	ldr	w0, [x19]
	bl	_CRYPTO_THREAD_write_lock
	ldr	w0, [x19, #12]
	mov	x1, x20
	bl	_lh_SSL_SESSION_insert
	mov	x21, x0
	cmp	x0, #0
	ccmp	x0, x20, #4, ne
	b.ne	LBB0_6
; %bb.1:
	cbnz	x21, LBB0_5
; %bb.2:
	ldr	w0, [x19, #12]
	mov	x1, x20
	bl	_lh_SSL_SESSION_retrieve
	cbnz	x0, LBB0_7
; %bb.3:
	cbz	x20, LBB0_7
; %bb.4:
	mov	x21, x20
LBB0_5:
	mov	x0, x21
	bl	_SSL_SESSION_free
	mov	w20, #0
	b	LBB0_13
LBB0_6:
	mov	x0, x19
	mov	x1, x21
	bl	_SSL_SESSION_list_remove
	mov	x0, x21
	bl	_SSL_SESSION_free
LBB0_7:
	mov	x0, x19
	mov	x1, x20
	bl	_SSL_SESSION_list_add
	mov	x0, x19
	bl	_SSL_CTX_sess_get_cache_size
	cmp	x0, #1
	b.lt	LBB0_12
; %bb.8:
	mov	x0, x19
	bl	_SSL_CTX_sess_number
	mov	x20, x0
	mov	x0, x19
	bl	_SSL_CTX_sess_get_cache_size
	cmp	x20, x0
	b.le	LBB0_12
; %bb.9:
	add	x20, x19, #4
LBB0_10:                                ; =>This Inner Loop Header: Depth=1
	ldr	w1, [x19, #8]
	mov	x0, x19
	mov	w2, #0
	bl	_remove_session_lock
	cbz	w0, LBB0_12
; %bb.11:                               ;   in Loop: Header=BB0_10 Depth=1
	mov	x0, x20
	bl	_tsan_counter
	mov	x0, x19
	bl	_SSL_CTX_sess_number
	mov	x21, x0
	mov	x0, x19
	bl	_SSL_CTX_sess_get_cache_size
	cmp	x21, x0
	b.gt	LBB0_10
LBB0_12:
	mov	w20, #1
LBB0_13:
	ldr	w0, [x19]
	bl	_CRYPTO_THREAD_unlock
	mov	x0, x20
	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
	.cfi_endproc
                                        ; -- End function
.subsections_via_symbols
