	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_engine_unlocked_finish         ## -- Begin function engine_unlocked_finish
	.p2align	4, 0x90
_engine_unlocked_finish:                ## @engine_unlocked_finish
	.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	%esi, %r15d
	movq	%rdi, %rbx
	decq	(%rdi)
	movl	$1, %r14d
	movl	$1, %esi
	movl	$-1, %edx
	callq	_engine_ref_debug
	movq	(%rbx), %rdi
	testq	%rdi, %rdi
	je	LBB0_1
LBB0_8:
	shrq	$63, %rdi
                                        ## kill: def $edi killed $edi killed $rdi
	callq	_REF_ASSERT_ISNT
	movq	%rbx, %rdi
	xorl	%esi, %esi
	callq	_engine_free_util
	testl	%eax, %eax
	jne	LBB0_11
## %bb.9:
	movq	_ENGINE_F_ENGINE_UNLOCKED_FINISH@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movq	_ENGINE_R_FINISH_FAILED@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	callq	_ENGINEerr
LBB0_10:
	xorl	%r14d, %r14d
LBB0_11:
	movl	%r14d, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_1:
	movq	8(%rbx), %rcx
	testq	%rcx, %rcx
	je	LBB0_2
## %bb.3:
	testl	%r15d, %r15d
	je	LBB0_4
## %bb.5:
	movq	_global_engine_lock@GOTPCREL(%rip), %r15
	movl	(%r15), %edi
	callq	_CRYPTO_THREAD_unlock
	movq	%rbx, %rdi
	callq	*8(%rbx)
	movl	%eax, %r14d
	movl	(%r15), %edi
	callq	_CRYPTO_THREAD_write_lock
	testl	%r14d, %r14d
	jne	LBB0_7
	jmp	LBB0_10
LBB0_2:
	xorl	%edi, %edi
	jmp	LBB0_8
LBB0_4:
	movq	%rbx, %rdi
	callq	*%rcx
	movl	%eax, %r14d
	testl	%r14d, %r14d
	je	LBB0_10
LBB0_7:
	movq	(%rbx), %rdi
	jmp	LBB0_8
	.cfi_endproc
                                        ## -- End function
	.comm	_global_engine_lock,4,2         ## @global_engine_lock
	.comm	_ENGINE_F_ENGINE_UNLOCKED_FINISH,4,2 ## @ENGINE_F_ENGINE_UNLOCKED_FINISH
	.comm	_ENGINE_R_FINISH_FAILED,4,2     ## @ENGINE_R_FINISH_FAILED
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_engine_unlocked_finish         ; -- Begin function engine_unlocked_finish
	.p2align	2
_engine_unlocked_finish:                ; @engine_unlocked_finish
	.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	x21, x1
	mov	x19, x0
	ldr	x8, [x0]
	sub	x8, x8, #1
	str	x8, [x0]
	mov	w20, #1
	mov	w1, #1
	mov	w2, #-1
	bl	_engine_ref_debug
	ldr	x8, [x19]
	cbz	x8, LBB0_4
LBB0_1:
	lsr	x0, x8, #63
                                        ; kill: def $w0 killed $w0 killed $x0
	bl	_REF_ASSERT_ISNT
	mov	x0, x19
	mov	w1, #0
	bl	_engine_free_util
	cbnz	w0, LBB0_3
; %bb.2:
Lloh0:
	adrp	x8, _ENGINE_F_ENGINE_UNLOCKED_FINISH@GOTPAGE
Lloh1:
	ldr	x8, [x8, _ENGINE_F_ENGINE_UNLOCKED_FINISH@GOTPAGEOFF]
Lloh2:
	ldr	w0, [x8]
Lloh3:
	adrp	x8, _ENGINE_R_FINISH_FAILED@GOTPAGE
Lloh4:
	ldr	x8, [x8, _ENGINE_R_FINISH_FAILED@GOTPAGEOFF]
Lloh5:
	ldr	w1, [x8]
	bl	_ENGINEerr
	mov	w20, #0
LBB0_3:
	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
LBB0_4:
	ldr	x8, [x19, #8]
	cbz	x8, LBB0_7
; %bb.5:
	cbz	w21, LBB0_8
; %bb.6:
Lloh6:
	adrp	x21, _global_engine_lock@GOTPAGE
Lloh7:
	ldr	x21, [x21, _global_engine_lock@GOTPAGEOFF]
	ldr	w0, [x21]
	bl	_CRYPTO_THREAD_unlock
	ldr	x8, [x19, #8]
	mov	x0, x19
	blr	x8
	mov	x20, x0
	ldr	w0, [x21]
	bl	_CRYPTO_THREAD_write_lock
	cbnz	w20, LBB0_9
	b	LBB0_3
LBB0_7:
	mov	w20, #1
	b	LBB0_1
LBB0_8:
	mov	x0, x19
	blr	x8
	mov	x20, x0
	cbz	w20, LBB0_3
LBB0_9:
	ldr	x8, [x19]
	b	LBB0_1
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGot	Lloh6, Lloh7
	.cfi_endproc
                                        ; -- End function
	.comm	_global_engine_lock,4,2         ; @global_engine_lock
	.comm	_ENGINE_F_ENGINE_UNLOCKED_FINISH,4,2 ; @ENGINE_F_ENGINE_UNLOCKED_FINISH
	.comm	_ENGINE_R_FINISH_FAILED,4,2     ; @ENGINE_R_FINISH_FAILED
.subsections_via_symbols
