	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function tls1_get_legacy_sigalg
_tls1_get_legacy_sigalg:                ## @tls1_get_legacy_sigalg
	.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
	movl	%esi, %r15d
	movq	%rdi, %r14
	cmpl	$-1, %esi
	je	LBB0_6
LBB0_1:
	testl	%r15d, %r15d
	js	LBB0_12
## %bb.2:
	movq	_tls_default_sigalg@GOTPCREL(%rip), %rbx
	movq	(%rbx), %rdi
	callq	_OSSL_NELEM
	cmpl	%eax, %r15d
	jge	LBB0_12
## %bb.3:
	movq	%r14, %rdi
	callq	_SSL_USE_SIGALGS
	testq	%rax, %rax
	jne	LBB0_13
## %bb.4:
	movq	_SSL_PKEY_RSA@GOTPCREL(%rip), %rax
	cmpl	(%rax), %r15d
	jne	LBB0_13
## %bb.5:
	movq	_legacy_rsa_sigalg@GOTPCREL(%rip), %rbx
	jmp	LBB0_14
LBB0_12:
	xorl	%ebx, %ebx
LBB0_14:
	movq	%rbx, %rax
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_6:
	cmpq	$0, 16(%r14)
	je	LBB0_15
## %bb.7:
	movq	_SSL_PKEY_NUM@GOTPCREL(%rip), %r12
	movl	$-1, %r15d
	cmpq	$0, (%r12)
	je	LBB0_17
## %bb.8:
	xorl	%ebx, %ebx
	.p2align	4, 0x90
LBB0_9:                                 ## =>This Inner Loop Header: Depth=1
	movq	%rbx, %rdi
	callq	_ssl_cert_lookup_by_idx
	movq	8(%r14), %rcx
	movl	(%rcx), %ecx
	testl	%ecx, (%rax)
	jne	LBB0_16
## %bb.10:                              ##   in Loop: Header=BB0_9 Depth=1
	incq	%rbx
	cmpq	(%r12), %rbx
	jb	LBB0_9
	jmp	LBB0_17
LBB0_13:
	movq	(%rbx), %rax
	movl	%r15d, %ecx
	movl	(%rax,%rcx,4), %edi
	callq	_tls1_lookup_sigalg
	movq	%rax, %rbx
	xorl	%r14d, %r14d
	movq	%rax, %rdi
	xorl	%esi, %esi
	callq	_tls1_lookup_md
	testl	%eax, %eax
	cmoveq	%r14, %rbx
	jmp	LBB0_14
LBB0_15:
	movq	(%r14), %rax
	movq	8(%rax), %r15
	subq	(%rax), %r15
	shrq	$3, %r15
	jmp	LBB0_1
LBB0_16:
	movl	%ebx, %r15d
LBB0_17:
	movq	_SSL_PKEY_GOST01@GOTPCREL(%rip), %rax
	cmpl	(%rax), %r15d
	jne	LBB0_1
## %bb.18:
	movq	8(%r14), %rax
	movslq	(%rax), %rax
	movq	_SSL_aGOST01@GOTPCREL(%rip), %rcx
	cmpq	%rax, (%rcx)
	je	LBB0_1
## %bb.19:
	movq	_SSL_PKEY_GOST12_512@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	cmpl	%r15d, %eax
	jl	LBB0_1
## %bb.20:
	movslq	%eax, %rcx
	movq	(%r14), %rdx
	movq	(%rdx), %rdx
	movslq	%r15d, %rsi
	incq	%rcx
	.p2align	4, 0x90
LBB0_21:                                ## =>This Inner Loop Header: Depth=1
	cmpq	$0, -8(%rdx,%rcx,8)
	jne	LBB0_23
## %bb.22:                              ##   in Loop: Header=BB0_21 Depth=1
	decl	%eax
	decq	%rcx
	cmpq	%rsi, %rcx
	jg	LBB0_21
	jmp	LBB0_1
LBB0_23:
	movl	%eax, %r15d
	jmp	LBB0_1
	.cfi_endproc
                                        ## -- End function
	.comm	_SSL_PKEY_NUM,8,3               ## @SSL_PKEY_NUM
	.comm	_SSL_PKEY_GOST01,4,2            ## @SSL_PKEY_GOST01
	.comm	_SSL_aGOST01,8,3                ## @SSL_aGOST01
	.comm	_SSL_PKEY_GOST12_512,4,2        ## @SSL_PKEY_GOST12_512
	.comm	_tls_default_sigalg,8,3         ## @tls_default_sigalg
	.comm	_SSL_PKEY_RSA,4,2               ## @SSL_PKEY_RSA
	.comm	_legacy_rsa_sigalg,4,2          ## @legacy_rsa_sigalg
	.no_dead_strip	_tls1_get_legacy_sigalg
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function tls1_get_legacy_sigalg
_tls1_get_legacy_sigalg:                ; @tls1_get_legacy_sigalg
	.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
	cmn	w1, #1
	b.eq	LBB0_8
LBB0_1:
	tbnz	w20, #31, LBB0_6
; %bb.2:
Lloh0:
	adrp	x21, _tls_default_sigalg@GOTPAGE
Lloh1:
	ldr	x21, [x21, _tls_default_sigalg@GOTPAGEOFF]
	ldr	x0, [x21]
	bl	_OSSL_NELEM
	cmp	w20, w0
	b.ge	LBB0_6
; %bb.3:
	mov	x0, x19
	bl	_SSL_USE_SIGALGS
	cbnz	x0, LBB0_20
; %bb.4:
Lloh2:
	adrp	x8, _SSL_PKEY_RSA@GOTPAGE
Lloh3:
	ldr	x8, [x8, _SSL_PKEY_RSA@GOTPAGEOFF]
Lloh4:
	ldr	w8, [x8]
	cmp	w20, w8
	b.ne	LBB0_20
; %bb.5:
Lloh5:
	adrp	x0, _legacy_rsa_sigalg@GOTPAGE
Lloh6:
	ldr	x0, [x0, _legacy_rsa_sigalg@GOTPAGEOFF]
	b	LBB0_7
LBB0_6:
	mov	x0, #0
LBB0_7:
	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_8:
	ldr	x8, [x19, #16]
	cbz	x8, LBB0_21
; %bb.9:
Lloh7:
	adrp	x21, _SSL_PKEY_NUM@GOTPAGE
Lloh8:
	ldr	x21, [x21, _SSL_PKEY_NUM@GOTPAGEOFF]
	ldr	x8, [x21]
	cbz	x8, LBB0_13
; %bb.10:
	mov	x20, #0
LBB0_11:                                ; =>This Inner Loop Header: Depth=1
	mov	x0, x20
	bl	_ssl_cert_lookup_by_idx
	ldr	w8, [x0]
	ldr	x9, [x19, #8]
	ldr	w9, [x9]
	tst	w9, w8
	b.ne	LBB0_14
; %bb.12:                               ;   in Loop: Header=BB0_11 Depth=1
	add	x20, x20, #1
	ldr	x8, [x21]
	cmp	x20, x8
	b.lo	LBB0_11
LBB0_13:
	mov	w20, #-1
LBB0_14:
Lloh9:
	adrp	x8, _SSL_PKEY_GOST01@GOTPAGE
Lloh10:
	ldr	x8, [x8, _SSL_PKEY_GOST01@GOTPAGEOFF]
Lloh11:
	ldr	w8, [x8]
	cmp	w20, w8
	b.ne	LBB0_1
; %bb.15:
	ldr	x8, [x19, #8]
	ldrsw	x8, [x8]
Lloh12:
	adrp	x9, _SSL_aGOST01@GOTPAGE
Lloh13:
	ldr	x9, [x9, _SSL_aGOST01@GOTPAGEOFF]
Lloh14:
	ldr	x9, [x9]
	cmp	x9, x8
	b.eq	LBB0_1
; %bb.16:
Lloh15:
	adrp	x8, _SSL_PKEY_GOST12_512@GOTPAGE
Lloh16:
	ldr	x8, [x8, _SSL_PKEY_GOST12_512@GOTPAGEOFF]
Lloh17:
	ldrsw	x8, [x8]
	cmp	w8, w20
	b.lt	LBB0_1
; %bb.17:
	ldr	x9, [x19]
	ldr	x9, [x9]
	mov	x10, x20
	sxtw	x10, w10
LBB0_18:                                ; =>This Inner Loop Header: Depth=1
	ldr	x11, [x9, x8, lsl #3]
	cbnz	x11, LBB0_22
; %bb.19:                               ;   in Loop: Header=BB0_18 Depth=1
	sub	x11, x8, #1
	cmp	x8, x10
	mov	x8, x11
	b.gt	LBB0_18
	b	LBB0_1
LBB0_20:
	ldr	x8, [x21]
	ldr	w0, [x8, w20, uxtw #2]
	bl	_tls1_lookup_sigalg
	mov	x19, x0
	mov	x1, #0
	bl	_tls1_lookup_md
	cmp	w0, #0
	csel	x0, xzr, x19, eq
	b	LBB0_7
LBB0_21:
	ldr	x8, [x19]
	ldp	x8, x9, [x8]
	sub	x8, x9, x8
	lsr	x20, x8, #3
                                        ; kill: def $w20 killed $w20 killed $x20 def $x20
	b	LBB0_1
LBB0_22:
	mov	x20, x8
	b	LBB0_1
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpLdrGot	Lloh5, Lloh6
	.loh AdrpLdrGot	Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh15, Lloh16, Lloh17
	.cfi_endproc
                                        ; -- End function
	.comm	_SSL_PKEY_NUM,8,3               ; @SSL_PKEY_NUM
	.comm	_SSL_PKEY_GOST01,4,2            ; @SSL_PKEY_GOST01
	.comm	_SSL_aGOST01,8,3                ; @SSL_aGOST01
	.comm	_SSL_PKEY_GOST12_512,4,2        ; @SSL_PKEY_GOST12_512
	.comm	_tls_default_sigalg,8,3         ; @tls_default_sigalg
	.comm	_SSL_PKEY_RSA,4,2               ; @SSL_PKEY_RSA
	.comm	_legacy_rsa_sigalg,4,2          ; @legacy_rsa_sigalg
	.no_dead_strip	_tls1_get_legacy_sigalg
.subsections_via_symbols
