	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_hx509_crypto_select            ## -- Begin function hx509_crypto_select
	.p2align	4, 0x90
_hx509_crypto_select:                   ## @hx509_crypto_select
	.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	$40, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%r8, %rbx
	movq	%rcx, -56(%rbp)                 ## 8-byte Spill
	movq	%rdx, %r13
	movl	%esi, %r12d
	movl	%edi, %r14d
	movq	%r8, %rdi
	xorl	%esi, %esi
	movl	$4, %edx
	callq	_memset
	movq	_HX509_SELECT_DIGEST@GOTPCREL(%rip), %rax
	cmpl	%r12d, (%rax)
	jne	LBB0_3
## %bb.1:
	movq	_SIG_DIGEST@GOTPCREL(%rip), %rax
	movl	(%rax), %r15d
	testq	%r13, %r13
	je	LBB0_13
## %bb.2:
	movq	%r13, %rdi
	movl	%r12d, %esi
	callq	_alg_for_privatekey
	jmp	LBB0_14
LBB0_3:
	movq	_HX509_SELECT_PUBLIC_SIG@GOTPCREL(%rip), %rax
	cmpl	%r12d, (%rax)
	jne	LBB0_8
## %bb.4:
	movq	_SIG_PUBLIC_SIG@GOTPCREL(%rip), %rax
	movl	(%rax), %r15d
	testq	%r13, %r13
	je	LBB0_38
## %bb.5:
	movq	%r13, %rdi
	movl	%r12d, %esi
	callq	_alg_for_privatekey
	testq	%rax, %rax
	jne	LBB0_7
LBB0_6:
	movq	__hx509_crypto_default_sig_alg@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
LBB0_7:
	movq	%rax, -72(%rbp)                 ## 8-byte Spill
	movq	%rbx, -64(%rbp)                 ## 8-byte Spill
	jmp	LBB0_17
LBB0_8:
	movq	_HX509_SELECT_SECRET_ENC@GOTPCREL(%rip), %rax
	cmpl	%r12d, (%rax)
	jne	LBB0_37
## %bb.9:
	movq	%rbx, -64(%rbp)                 ## 8-byte Spill
	movl	%r14d, -44(%rbp)                ## 4-byte Spill
	movq	_SIG_SECRET@GOTPCREL(%rip), %rax
	movl	(%rax), %r15d
	movq	__hx509_crypto_default_secret_alg@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	%rax, -72(%rbp)                 ## 8-byte Spill
	cmpq	$0, -56(%rbp)                   ## 8-byte Folded Reload
	jne	LBB0_18
	jmp	LBB0_10
LBB0_13:
	xorl	%eax, %eax
LBB0_14:
	movq	%rbx, -64(%rbp)                 ## 8-byte Spill
	testq	%rax, %rax
	jne	LBB0_16
## %bb.15:
	movq	__hx509_crypto_default_digest_alg@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
LBB0_16:
	movq	%rax, -72(%rbp)                 ## 8-byte Spill
LBB0_17:
	movl	%r14d, -44(%rbp)                ## 4-byte Spill
	cmpq	$0, -56(%rbp)                   ## 8-byte Folded Reload
	je	LBB0_10
LBB0_18:
	movq	%r13, %rdi
	callq	_find_keytype
	movq	%rax, -80(%rbp)                 ## 8-byte Spill
	movq	-56(%rbp), %rax                 ## 8-byte Reload
	cmpq	$0, (%rax)
	je	LBB0_10
## %bb.19:
	xorl	%r12d, %r12d
	movq	_sig_algs@GOTPCREL(%rip), %r13
	jmp	LBB0_21
	.p2align	4, 0x90
LBB0_20:                                ##   in Loop: Header=BB0_21 Depth=1
	incq	%r12
	movq	-56(%rbp), %rax                 ## 8-byte Reload
	cmpq	(%rax), %r12
	jae	LBB0_10
LBB0_21:                                ## =>This Loop Header: Depth=1
                                        ##     Child Loop BB0_24 Depth 2
	movq	(%r13), %rax
	movq	(%rax), %rax
	testq	%rax, %rax
	je	LBB0_31
## %bb.22:                              ##   in Loop: Header=BB0_21 Depth=1
	xorl	%ebx, %ebx
	jmp	LBB0_24
	.p2align	4, 0x90
LBB0_23:                                ##   in Loop: Header=BB0_24 Depth=2
	movq	(%r13), %rax
	movq	8(%rax,%rbx), %rax
	addq	$8, %rbx
	testq	%rax, %rax
	je	LBB0_31
LBB0_24:                                ##   Parent Loop BB0_21 Depth=1
                                        ## =>  This Inner Loop Header: Depth=2
	movl	(%rax), %ecx
	notl	%ecx
	testl	%ecx, %r15d
	jne	LBB0_23
## %bb.25:                              ##   in Loop: Header=BB0_24 Depth=2
	movq	16(%rax), %rdi
	leaq	(,%r12,4), %r14
	movq	-56(%rbp), %rax                 ## 8-byte Reload
	movq	8(%rax), %rsi
	addq	%r14, %rsi
	callq	_der_heim_oid_cmp
	testq	%rax, %rax
	jne	LBB0_23
## %bb.26:                              ##   in Loop: Header=BB0_24 Depth=2
	cmpq	$0, -80(%rbp)                   ## 8-byte Folded Reload
	je	LBB0_29
## %bb.27:                              ##   in Loop: Header=BB0_24 Depth=2
	movq	(%r13), %rax
	movq	(%rax,%rbx), %rax
	movq	8(%rax), %rsi
	testq	%rsi, %rsi
	je	LBB0_29
## %bb.28:                              ##   in Loop: Header=BB0_24 Depth=2
	movq	-80(%rbp), %rdi                 ## 8-byte Reload
	callq	_der_heim_oid_cmp
	testq	%rax, %rax
	jne	LBB0_23
	jmp	LBB0_29
	.p2align	4, 0x90
LBB0_31:                                ##   in Loop: Header=BB0_21 Depth=1
	movq	_SIG_SECRET@GOTPCREL(%rip), %rax
	testl	%r15d, (%rax)
	je	LBB0_20
## %bb.32:                              ##   in Loop: Header=BB0_21 Depth=1
	leaq	(,%r12,4), %rdi
	movq	-56(%rbp), %rax                 ## 8-byte Reload
	addq	8(%rax), %rdi
	callq	_find_cipher_by_oid
	testq	%rax, %rax
	je	LBB0_20
## %bb.33:                              ##   in Loop: Header=BB0_21 Depth=1
	movq	(%rax), %rcx
	testq	%rcx, %rcx
	je	LBB0_20
## %bb.34:
	xorl	%ebx, %ebx
	xorl	%eax, %eax
	callq	*%rcx
	movq	%rax, %rdi
	movq	-64(%rbp), %rsi                 ## 8-byte Reload
	callq	_copy_AlgorithmIdentifier
	testl	%eax, %eax
	je	LBB0_36
## %bb.35:
	movl	%eax, %r14d
	movl	-44(%rbp), %edi                 ## 4-byte Reload
	callq	_hx509_clear_error_string
	movl	%r14d, %ebx
	jmp	LBB0_36
LBB0_10:
	movq	-72(%rbp), %rdi                 ## 8-byte Reload
	jmp	LBB0_11
LBB0_29:
	movq	-56(%rbp), %rax                 ## 8-byte Reload
	addq	8(%rax), %r14
	movq	%r14, %rdi
LBB0_11:
	movq	-64(%rbp), %rsi                 ## 8-byte Reload
	callq	_copy_AlgorithmIdentifier
	testl	%eax, %eax
	je	LBB0_30
## %bb.12:
	movl	%eax, %ebx
	movl	-44(%rbp), %edi                 ## 4-byte Reload
	callq	_hx509_clear_error_string
	jmp	LBB0_36
LBB0_30:
	xorl	%ebx, %ebx
	jmp	LBB0_36
LBB0_37:
	movq	_EINVAL@GOTPCREL(%rip), %rbx
	movl	(%rbx), %edx
	leaq	L_.str(%rip), %rcx
	movl	%r14d, %edi
	xorl	%esi, %esi
	movl	%r12d, %r8d
	callq	_hx509_set_error_string
	movl	(%rbx), %ebx
LBB0_36:
	movl	%ebx, %eax
	addq	$40, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_38:
	xorl	%eax, %eax
	testq	%rax, %rax
	je	LBB0_6
	jmp	LBB0_7
	.cfi_endproc
                                        ## -- End function
	.comm	_HX509_SELECT_DIGEST,4,2        ## @HX509_SELECT_DIGEST
	.comm	_SIG_DIGEST,4,2                 ## @SIG_DIGEST
	.comm	__hx509_crypto_default_digest_alg,8,3 ## @_hx509_crypto_default_digest_alg
	.comm	_HX509_SELECT_PUBLIC_SIG,4,2    ## @HX509_SELECT_PUBLIC_SIG
	.comm	_SIG_PUBLIC_SIG,4,2             ## @SIG_PUBLIC_SIG
	.comm	__hx509_crypto_default_sig_alg,8,3 ## @_hx509_crypto_default_sig_alg
	.comm	_HX509_SELECT_SECRET_ENC,4,2    ## @HX509_SELECT_SECRET_ENC
	.comm	_SIG_SECRET,4,2                 ## @SIG_SECRET
	.comm	__hx509_crypto_default_secret_alg,8,3 ## @_hx509_crypto_default_secret_alg
	.comm	_EINVAL,4,2                     ## @EINVAL
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Unknown type %d of selection"

	.comm	_sig_algs,8,3                   ## @sig_algs
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_hx509_crypto_select            ; -- Begin function hx509_crypto_select
	.p2align	2
_hx509_crypto_select:                   ; @hx509_crypto_select
	.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	x20, x4
	mov	x21, x3
	mov	x23, x2
	mov	x22, x1
	mov	x19, x0
	mov	x0, x4
	mov	w1, #0
	mov	w2, #4
	bl	_memset
Lloh0:
	adrp	x8, _HX509_SELECT_DIGEST@GOTPAGE
Lloh1:
	ldr	x8, [x8, _HX509_SELECT_DIGEST@GOTPAGEOFF]
Lloh2:
	ldr	w8, [x8]
	cmp	w8, w22
	b.ne	LBB0_3
; %bb.1:
Lloh3:
	adrp	x8, _SIG_DIGEST@GOTPAGE
Lloh4:
	ldr	x8, [x8, _SIG_DIGEST@GOTPAGEOFF]
Lloh5:
	ldr	w24, [x8]
	cbz	x23, LBB0_8
; %bb.2:
	mov	x0, x23
	mov	x1, x22
	bl	_alg_for_privatekey
	b	LBB0_9
LBB0_3:
Lloh6:
	adrp	x8, _HX509_SELECT_PUBLIC_SIG@GOTPAGE
Lloh7:
	ldr	x8, [x8, _HX509_SELECT_PUBLIC_SIG@GOTPAGEOFF]
Lloh8:
	ldr	w8, [x8]
	cmp	w8, w22
	b.ne	LBB0_6
; %bb.4:
Lloh9:
	adrp	x8, _SIG_PUBLIC_SIG@GOTPAGE
Lloh10:
	ldr	x8, [x8, _SIG_PUBLIC_SIG@GOTPAGEOFF]
Lloh11:
	ldr	w24, [x8]
	cbz	x23, LBB0_11
; %bb.5:
	mov	x0, x23
	mov	x1, x22
	bl	_alg_for_privatekey
	b	LBB0_12
LBB0_6:
Lloh12:
	adrp	x8, _HX509_SELECT_SECRET_ENC@GOTPAGE
Lloh13:
	ldr	x8, [x8, _HX509_SELECT_SECRET_ENC@GOTPAGEOFF]
Lloh14:
	ldr	w8, [x8]
	cmp	w8, w22
	b.ne	LBB0_10
; %bb.7:
Lloh15:
	adrp	x8, _SIG_SECRET@GOTPAGE
Lloh16:
	ldr	x8, [x8, _SIG_SECRET@GOTPAGEOFF]
Lloh17:
	ldr	w24, [x8]
Lloh18:
	adrp	x8, __hx509_crypto_default_secret_alg@GOTPAGE
Lloh19:
	ldr	x8, [x8, __hx509_crypto_default_secret_alg@GOTPAGEOFF]
Lloh20:
	ldr	x22, [x8]
	cbnz	x21, LBB0_14
	b	LBB0_29
LBB0_8:
	mov	x0, #0
LBB0_9:
Lloh21:
	adrp	x8, __hx509_crypto_default_digest_alg@GOTPAGE
Lloh22:
	ldr	x8, [x8, __hx509_crypto_default_digest_alg@GOTPAGEOFF]
	b	LBB0_13
LBB0_10:
Lloh23:
	adrp	x20, _EINVAL@GOTPAGE
Lloh24:
	ldr	x20, [x20, _EINVAL@GOTPAGEOFF]
	ldr	w2, [x20]
Lloh25:
	adrp	x3, l_.str@PAGE
Lloh26:
	add	x3, x3, l_.str@PAGEOFF
	mov	x0, x19
	mov	w1, #0
	mov	x4, x22
	bl	_hx509_set_error_string
	ldr	w20, [x20]
	b	LBB0_33
LBB0_11:
	mov	x0, #0
LBB0_12:
Lloh27:
	adrp	x8, __hx509_crypto_default_sig_alg@GOTPAGE
Lloh28:
	ldr	x8, [x8, __hx509_crypto_default_sig_alg@GOTPAGEOFF]
LBB0_13:
	ldr	x8, [x8]
	cmp	x0, #0
	csel	x22, x8, x0, eq
	cbz	x21, LBB0_29
LBB0_14:
	mov	x0, x23
	bl	_find_keytype
	ldr	x8, [x21]
	cbz	x8, LBB0_29
; %bb.15:
	mov	x23, x0
	mov	x25, #0
Lloh29:
	adrp	x26, _sig_algs@GOTPAGE
Lloh30:
	ldr	x26, [x26, _sig_algs@GOTPAGEOFF]
Lloh31:
	adrp	x27, _SIG_SECRET@GOTPAGE
Lloh32:
	ldr	x27, [x27, _SIG_SECRET@GOTPAGEOFF]
	b	LBB0_17
LBB0_16:                                ;   in Loop: Header=BB0_17 Depth=1
	add	x25, x25, #1
	ldr	x8, [x21]
	cmp	x25, x8
	b.hs	LBB0_29
LBB0_17:                                ; =>This Loop Header: Depth=1
                                        ;     Child Loop BB0_20 Depth 2
	ldr	x8, [x26]
	ldr	x8, [x8]
	cbz	x8, LBB0_25
; %bb.18:                               ;   in Loop: Header=BB0_17 Depth=1
	mov	x28, #0
	b	LBB0_20
LBB0_19:                                ;   in Loop: Header=BB0_20 Depth=2
	ldr	x8, [x26]
	add	x8, x8, x28
	ldr	x8, [x8, #8]
	add	x28, x28, #8
	cbz	x8, LBB0_25
LBB0_20:                                ;   Parent Loop BB0_17 Depth=1
                                        ; =>  This Inner Loop Header: Depth=2
	ldr	w9, [x8]
	bics	wzr, w24, w9
	b.ne	LBB0_19
; %bb.21:                               ;   in Loop: Header=BB0_20 Depth=2
	ldr	x0, [x8, #16]
	ldr	x8, [x21, #8]
	add	x1, x8, x25, lsl #2
	bl	_der_heim_oid_cmp
	cbnz	x0, LBB0_19
; %bb.22:                               ;   in Loop: Header=BB0_20 Depth=2
	cbz	x23, LBB0_30
; %bb.23:                               ;   in Loop: Header=BB0_20 Depth=2
	ldr	x8, [x26]
	ldr	x8, [x8, x28]
	ldr	x1, [x8, #8]
	cbz	x1, LBB0_30
; %bb.24:                               ;   in Loop: Header=BB0_20 Depth=2
	mov	x0, x23
	bl	_der_heim_oid_cmp
	cbnz	x0, LBB0_19
	b	LBB0_30
LBB0_25:                                ;   in Loop: Header=BB0_17 Depth=1
	ldr	w8, [x27]
	tst	w8, w24
	b.eq	LBB0_16
; %bb.26:                               ;   in Loop: Header=BB0_17 Depth=1
	ldr	x8, [x21, #8]
	add	x0, x8, x25, lsl #2
	bl	_find_cipher_by_oid
	cbz	x0, LBB0_16
; %bb.27:                               ;   in Loop: Header=BB0_17 Depth=1
	ldr	x8, [x0]
	cbz	x8, LBB0_16
; %bb.28:
	blr	x8
	b	LBB0_31
LBB0_29:
	mov	x0, x22
	b	LBB0_31
LBB0_30:
	ldr	x8, [x21, #8]
	add	x0, x8, x25, lsl #2
LBB0_31:
	mov	x1, x20
	bl	_copy_AlgorithmIdentifier
	mov	x20, x0
	cbz	w0, LBB0_33
; %bb.32:
	mov	x0, x19
	bl	_hx509_clear_error_string
LBB0_33:
	mov	x0, x20
	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 AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh18, Lloh19, Lloh20
	.loh AdrpLdrGotLdr	Lloh15, Lloh16, Lloh17
	.loh AdrpLdrGot	Lloh21, Lloh22
	.loh AdrpAdd	Lloh25, Lloh26
	.loh AdrpLdrGot	Lloh23, Lloh24
	.loh AdrpLdrGot	Lloh27, Lloh28
	.loh AdrpLdrGot	Lloh31, Lloh32
	.loh AdrpLdrGot	Lloh29, Lloh30
	.cfi_endproc
                                        ; -- End function
	.comm	_HX509_SELECT_DIGEST,4,2        ; @HX509_SELECT_DIGEST
	.comm	_SIG_DIGEST,4,2                 ; @SIG_DIGEST
	.comm	__hx509_crypto_default_digest_alg,8,3 ; @_hx509_crypto_default_digest_alg
	.comm	_HX509_SELECT_PUBLIC_SIG,4,2    ; @HX509_SELECT_PUBLIC_SIG
	.comm	_SIG_PUBLIC_SIG,4,2             ; @SIG_PUBLIC_SIG
	.comm	__hx509_crypto_default_sig_alg,8,3 ; @_hx509_crypto_default_sig_alg
	.comm	_HX509_SELECT_SECRET_ENC,4,2    ; @HX509_SELECT_SECRET_ENC
	.comm	_SIG_SECRET,4,2                 ; @SIG_SECRET
	.comm	__hx509_crypto_default_secret_alg,8,3 ; @_hx509_crypto_default_secret_alg
	.comm	_EINVAL,4,2                     ; @EINVAL
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Unknown type %d of selection"

	.comm	_sig_algs,8,3                   ; @sig_algs
.subsections_via_symbols
