	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_ENGINE_by_id                   ## -- Begin function ENGINE_by_id
	.p2align	4, 0x90
_ENGINE_by_id:                          ## @ENGINE_by_id
	.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
	testq	%rdi, %rdi
	je	LBB0_14
## %bb.1:
	movq	%rdi, %r14
	movq	_do_engine_lock_init@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	_engine_lock_init@GOTPCREL(%rip), %rdi
	callq	_RUN_ONCE
	testl	%eax, %eax
	je	LBB0_15
## %bb.2:
	movq	_global_engine_lock@GOTPCREL(%rip), %r12
	movl	(%r12), %edi
	callq	_CRYPTO_THREAD_write_lock
	movq	_engine_list_head@GOTPCREL(%rip), %rax
	movq	(%rax), %rbx
	testq	%rbx, %rbx
	je	LBB0_5
	.p2align	4, 0x90
LBB0_3:                                 ## =>This Inner Loop Header: Depth=1
	movq	(%rbx), %rsi
	movq	%r14, %rdi
	callq	_strcmp
	testq	%rax, %rax
	je	LBB0_17
## %bb.4:                               ##   in Loop: Header=BB0_3 Depth=1
	movq	16(%rbx), %rbx
	testq	%rbx, %rbx
	jne	LBB0_3
LBB0_5:
	movl	(%r12), %edi
	callq	_CRYPTO_THREAD_unlock
	leaq	L_.str(%rip), %rsi
	movq	%r14, %rdi
	callq	_strcmp
	testq	%rax, %rax
	je	LBB0_21
## %bb.6:
	leaq	L_.str.1(%rip), %rdi
	callq	_ossl_safe_getenv
	movq	%rax, %r15
	testq	%rax, %rax
	jne	LBB0_8
## %bb.7:
	movq	_ENGINESDIR@GOTPCREL(%rip), %rax
	movq	(%rax), %r15
LBB0_8:
	leaq	L_.str(%rip), %rdi
	callq	_ENGINE_by_id
	testq	%rax, %rax
	je	LBB0_21
## %bb.9:
	movq	%rax, %rbx
	leaq	L_.str.2(%rip), %rsi
	movq	%rax, %rdi
	movq	%r14, %rdx
	xorl	%ecx, %ecx
	callq	_ENGINE_ctrl_cmd_string
	testl	%eax, %eax
	je	LBB0_22
## %bb.10:
	leaq	L_.str.3(%rip), %rsi
	leaq	L_.str.4(%rip), %rdx
	movq	%rbx, %rdi
	xorl	%ecx, %ecx
	callq	_ENGINE_ctrl_cmd_string
	testl	%eax, %eax
	je	LBB0_22
## %bb.11:
	leaq	L_.str.5(%rip), %rsi
	movq	%rbx, %rdi
	movq	%r15, %rdx
	xorl	%ecx, %ecx
	callq	_ENGINE_ctrl_cmd_string
	testl	%eax, %eax
	je	LBB0_22
## %bb.12:
	leaq	L_.str.6(%rip), %rsi
	leaq	L_.str.7(%rip), %rdx
	movq	%rbx, %rdi
	xorl	%ecx, %ecx
	callq	_ENGINE_ctrl_cmd_string
	testl	%eax, %eax
	je	LBB0_22
## %bb.13:
	leaq	L_.str.8(%rip), %rsi
	movq	%rbx, %rdi
	xorl	%edx, %edx
	xorl	%ecx, %ecx
	callq	_ENGINE_ctrl_cmd_string
	testl	%eax, %eax
	jne	LBB0_24
	jmp	LBB0_22
LBB0_14:
	movq	_ENGINE_F_ENGINE_BY_ID@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movq	_ERR_R_PASSED_NULL_PARAMETER@GOTPCREL(%rip), %rax
	jmp	LBB0_16
LBB0_15:
	movq	_ENGINE_F_ENGINE_BY_ID@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movq	_ERR_R_MALLOC_FAILURE@GOTPCREL(%rip), %rax
LBB0_16:
	movl	(%rax), %esi
	callq	_ENGINEerr
	jmp	LBB0_23
LBB0_21:
	xorl	%ebx, %ebx
LBB0_22:
	movq	%rbx, %rdi
	callq	_ENGINE_free
	movq	_ENGINE_F_ENGINE_BY_ID@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movq	_ENGINE_R_NO_SUCH_ENGINE@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	callq	_ENGINEerr
	leaq	L_.str.9(%rip), %rsi
	movl	$2, %edi
	movq	%r14, %rdx
	callq	_ERR_add_error_data
LBB0_23:
	xorl	%ebx, %ebx
LBB0_24:
	movq	%rbx, %rax
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_17:
	movq	_ENGINE_FLAGS_BY_ID_COPY@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	testl	%eax, 8(%rbx)
	je	LBB0_25
## %bb.18:
	xorl	%eax, %eax
	callq	_ENGINE_new
	testq	%rax, %rax
	je	LBB0_5
## %bb.19:
	movq	%rax, %r15
	movq	%rax, %rdi
	movq	%rbx, %rsi
	callq	_engine_cpy
	movq	%r15, %rbx
	jmp	LBB0_26
LBB0_25:
	incl	12(%rbx)
	movq	%rbx, %rdi
	xorl	%esi, %esi
	movl	$1, %edx
	callq	_engine_ref_debug
LBB0_26:
	movl	(%r12), %edi
	callq	_CRYPTO_THREAD_unlock
	jmp	LBB0_24
	.cfi_endproc
                                        ## -- End function
	.comm	_ENGINE_F_ENGINE_BY_ID,4,2      ## @ENGINE_F_ENGINE_BY_ID
	.comm	_ERR_R_PASSED_NULL_PARAMETER,4,2 ## @ERR_R_PASSED_NULL_PARAMETER
	.comm	_engine_lock_init,4,2           ## @engine_lock_init
	.comm	_do_engine_lock_init,4,2        ## @do_engine_lock_init
	.comm	_ERR_R_MALLOC_FAILURE,4,2       ## @ERR_R_MALLOC_FAILURE
	.comm	_global_engine_lock,4,2         ## @global_engine_lock
	.comm	_engine_list_head,8,3           ## @engine_list_head
	.comm	_ENGINE_FLAGS_BY_ID_COPY,4,2    ## @ENGINE_FLAGS_BY_ID_COPY
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"dynamic"

L_.str.1:                               ## @.str.1
	.asciz	"OPENSSL_ENGINES"

	.comm	_ENGINESDIR,8,3                 ## @ENGINESDIR
L_.str.2:                               ## @.str.2
	.asciz	"ID"

L_.str.3:                               ## @.str.3
	.asciz	"DIR_LOAD"

L_.str.4:                               ## @.str.4
	.asciz	"2"

L_.str.5:                               ## @.str.5
	.asciz	"DIR_ADD"

L_.str.6:                               ## @.str.6
	.asciz	"LIST_ADD"

L_.str.7:                               ## @.str.7
	.asciz	"1"

L_.str.8:                               ## @.str.8
	.asciz	"LOAD"

	.comm	_ENGINE_R_NO_SUCH_ENGINE,4,2    ## @ENGINE_R_NO_SUCH_ENGINE
L_.str.9:                               ## @.str.9
	.asciz	"id="

.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_ENGINE_by_id                   ; -- Begin function ENGINE_by_id
	.p2align	2
_ENGINE_by_id:                          ; @ENGINE_by_id
	.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
	cbz	x0, LBB0_5
; %bb.1:
	mov	x19, x0
Lloh0:
	adrp	x8, _do_engine_lock_init@GOTPAGE
Lloh1:
	ldr	x8, [x8, _do_engine_lock_init@GOTPAGEOFF]
Lloh2:
	ldr	w1, [x8]
Lloh3:
	adrp	x0, _engine_lock_init@GOTPAGE
Lloh4:
	ldr	x0, [x0, _engine_lock_init@GOTPAGEOFF]
	bl	_RUN_ONCE
	cbz	w0, LBB0_6
; %bb.2:
Lloh5:
	adrp	x22, _global_engine_lock@GOTPAGE
Lloh6:
	ldr	x22, [x22, _global_engine_lock@GOTPAGEOFF]
	ldr	w0, [x22]
	bl	_CRYPTO_THREAD_write_lock
Lloh7:
	adrp	x8, _engine_list_head@GOTPAGE
Lloh8:
	ldr	x8, [x8, _engine_list_head@GOTPAGEOFF]
Lloh9:
	ldr	x20, [x8]
	cbz	x20, LBB0_11
LBB0_3:                                 ; =>This Inner Loop Header: Depth=1
	ldr	x1, [x20]
	mov	x0, x19
	bl	_strcmp
	cbz	x0, LBB0_8
; %bb.4:                                ;   in Loop: Header=BB0_3 Depth=1
	ldr	x20, [x20, #16]
	cbnz	x20, LBB0_3
	b	LBB0_11
LBB0_5:
Lloh10:
	adrp	x8, _ENGINE_F_ENGINE_BY_ID@GOTPAGE
Lloh11:
	ldr	x8, [x8, _ENGINE_F_ENGINE_BY_ID@GOTPAGEOFF]
Lloh12:
	ldr	w0, [x8]
Lloh13:
	adrp	x8, _ERR_R_PASSED_NULL_PARAMETER@GOTPAGE
Lloh14:
	ldr	x8, [x8, _ERR_R_PASSED_NULL_PARAMETER@GOTPAGEOFF]
	b	LBB0_7
LBB0_6:
Lloh15:
	adrp	x8, _ENGINE_F_ENGINE_BY_ID@GOTPAGE
Lloh16:
	ldr	x8, [x8, _ENGINE_F_ENGINE_BY_ID@GOTPAGEOFF]
Lloh17:
	ldr	w0, [x8]
Lloh18:
	adrp	x8, _ERR_R_MALLOC_FAILURE@GOTPAGE
Lloh19:
	ldr	x8, [x8, _ERR_R_MALLOC_FAILURE@GOTPAGEOFF]
LBB0_7:
	ldr	w1, [x8]
	bl	_ENGINEerr
	b	LBB0_20
LBB0_8:
	ldr	w8, [x20, #8]
Lloh20:
	adrp	x9, _ENGINE_FLAGS_BY_ID_COPY@GOTPAGE
Lloh21:
	ldr	x9, [x9, _ENGINE_FLAGS_BY_ID_COPY@GOTPAGEOFF]
Lloh22:
	ldr	w9, [x9]
	tst	w9, w8
	b.eq	LBB0_22
; %bb.9:
	bl	_ENGINE_new
	cbz	x0, LBB0_11
; %bb.10:
	mov	x21, x0
	mov	x1, x20
	bl	_engine_cpy
	mov	x20, x21
	b	LBB0_23
LBB0_11:
	ldr	w0, [x22]
	bl	_CRYPTO_THREAD_unlock
Lloh23:
	adrp	x1, l_.str@PAGE
Lloh24:
	add	x1, x1, l_.str@PAGEOFF
	mov	x0, x19
	bl	_strcmp
	cbz	x0, LBB0_18
; %bb.12:
Lloh25:
	adrp	x0, l_.str.1@PAGE
Lloh26:
	add	x0, x0, l_.str.1@PAGEOFF
	bl	_ossl_safe_getenv
Lloh27:
	adrp	x8, _ENGINESDIR@GOTPAGE
Lloh28:
	ldr	x8, [x8, _ENGINESDIR@GOTPAGEOFF]
Lloh29:
	ldr	x8, [x8]
	cmp	x0, #0
	csel	x21, x8, x0, eq
Lloh30:
	adrp	x0, l_.str@PAGE
Lloh31:
	add	x0, x0, l_.str@PAGEOFF
	bl	_ENGINE_by_id
	mov	x20, x0
	cbz	x0, LBB0_19
; %bb.13:
Lloh32:
	adrp	x1, l_.str.2@PAGE
Lloh33:
	add	x1, x1, l_.str.2@PAGEOFF
	mov	x0, x20
	mov	x2, x19
	mov	w3, #0
	bl	_ENGINE_ctrl_cmd_string
	cbz	w0, LBB0_19
; %bb.14:
Lloh34:
	adrp	x1, l_.str.3@PAGE
Lloh35:
	add	x1, x1, l_.str.3@PAGEOFF
Lloh36:
	adrp	x2, l_.str.4@PAGE
Lloh37:
	add	x2, x2, l_.str.4@PAGEOFF
	mov	x0, x20
	mov	w3, #0
	bl	_ENGINE_ctrl_cmd_string
	cbz	w0, LBB0_19
; %bb.15:
Lloh38:
	adrp	x1, l_.str.5@PAGE
Lloh39:
	add	x1, x1, l_.str.5@PAGEOFF
	mov	x0, x20
	mov	x2, x21
	mov	w3, #0
	bl	_ENGINE_ctrl_cmd_string
	cbz	w0, LBB0_19
; %bb.16:
Lloh40:
	adrp	x1, l_.str.6@PAGE
Lloh41:
	add	x1, x1, l_.str.6@PAGEOFF
Lloh42:
	adrp	x2, l_.str.7@PAGE
Lloh43:
	add	x2, x2, l_.str.7@PAGEOFF
	mov	x0, x20
	mov	w3, #0
	bl	_ENGINE_ctrl_cmd_string
	cbz	w0, LBB0_19
; %bb.17:
Lloh44:
	adrp	x1, l_.str.8@PAGE
Lloh45:
	add	x1, x1, l_.str.8@PAGEOFF
	mov	x0, x20
	mov	x2, #0
	mov	w3, #0
	bl	_ENGINE_ctrl_cmd_string
	cbnz	w0, LBB0_21
	b	LBB0_19
LBB0_18:
	mov	x20, #0
LBB0_19:
	mov	x0, x20
	bl	_ENGINE_free
Lloh46:
	adrp	x8, _ENGINE_F_ENGINE_BY_ID@GOTPAGE
Lloh47:
	ldr	x8, [x8, _ENGINE_F_ENGINE_BY_ID@GOTPAGEOFF]
Lloh48:
	ldr	w0, [x8]
Lloh49:
	adrp	x8, _ENGINE_R_NO_SUCH_ENGINE@GOTPAGE
Lloh50:
	ldr	x8, [x8, _ENGINE_R_NO_SUCH_ENGINE@GOTPAGEOFF]
Lloh51:
	ldr	w1, [x8]
	bl	_ENGINEerr
Lloh52:
	adrp	x1, l_.str.9@PAGE
Lloh53:
	add	x1, x1, l_.str.9@PAGEOFF
	mov	w0, #2
	mov	x2, x19
	bl	_ERR_add_error_data
LBB0_20:
	mov	x20, #0
LBB0_21:
	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_22:
	ldr	w8, [x20, #12]
	add	w8, w8, #1
	str	w8, [x20, #12]
	mov	x0, x20
	mov	w1, #0
	mov	w2, #1
	bl	_engine_ref_debug
LBB0_23:
	ldr	w0, [x22]
	bl	_CRYPTO_THREAD_unlock
	b	LBB0_21
	.loh AdrpLdrGot	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh7, Lloh8, Lloh9
	.loh AdrpLdrGot	Lloh5, Lloh6
	.loh AdrpLdrGot	Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh10, Lloh11, Lloh12
	.loh AdrpLdrGot	Lloh18, Lloh19
	.loh AdrpLdrGotLdr	Lloh15, Lloh16, Lloh17
	.loh AdrpLdrGotLdr	Lloh20, Lloh21, Lloh22
	.loh AdrpAdd	Lloh23, Lloh24
	.loh AdrpAdd	Lloh30, Lloh31
	.loh AdrpLdrGotLdr	Lloh27, Lloh28, Lloh29
	.loh AdrpAdd	Lloh25, Lloh26
	.loh AdrpAdd	Lloh32, Lloh33
	.loh AdrpAdd	Lloh36, Lloh37
	.loh AdrpAdd	Lloh34, Lloh35
	.loh AdrpAdd	Lloh38, Lloh39
	.loh AdrpAdd	Lloh42, Lloh43
	.loh AdrpAdd	Lloh40, Lloh41
	.loh AdrpAdd	Lloh44, Lloh45
	.loh AdrpAdd	Lloh52, Lloh53
	.loh AdrpLdrGotLdr	Lloh49, Lloh50, Lloh51
	.loh AdrpLdrGotLdr	Lloh46, Lloh47, Lloh48
	.cfi_endproc
                                        ; -- End function
	.comm	_ENGINE_F_ENGINE_BY_ID,4,2      ; @ENGINE_F_ENGINE_BY_ID
	.comm	_ERR_R_PASSED_NULL_PARAMETER,4,2 ; @ERR_R_PASSED_NULL_PARAMETER
	.comm	_engine_lock_init,4,2           ; @engine_lock_init
	.comm	_do_engine_lock_init,4,2        ; @do_engine_lock_init
	.comm	_ERR_R_MALLOC_FAILURE,4,2       ; @ERR_R_MALLOC_FAILURE
	.comm	_global_engine_lock,4,2         ; @global_engine_lock
	.comm	_engine_list_head,8,3           ; @engine_list_head
	.comm	_ENGINE_FLAGS_BY_ID_COPY,4,2    ; @ENGINE_FLAGS_BY_ID_COPY
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"dynamic"

l_.str.1:                               ; @.str.1
	.asciz	"OPENSSL_ENGINES"

	.comm	_ENGINESDIR,8,3                 ; @ENGINESDIR
l_.str.2:                               ; @.str.2
	.asciz	"ID"

l_.str.3:                               ; @.str.3
	.asciz	"DIR_LOAD"

l_.str.4:                               ; @.str.4
	.asciz	"2"

l_.str.5:                               ; @.str.5
	.asciz	"DIR_ADD"

l_.str.6:                               ; @.str.6
	.asciz	"LIST_ADD"

l_.str.7:                               ; @.str.7
	.asciz	"1"

l_.str.8:                               ; @.str.8
	.asciz	"LOAD"

	.comm	_ENGINE_R_NO_SUCH_ENGINE,4,2    ; @ENGINE_R_NO_SUCH_ENGINE
l_.str.9:                               ; @.str.9
	.asciz	"id="

.subsections_via_symbols
