	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function ssl_pick_cert
_ssl_pick_cert:                         ## @ssl_pick_cert
	.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	$24, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rsi, %r15
	movq	%rdi, %r14
	movq	%rsi, %rdi
	callq	_mbedtls_ssl_get_ciphersuite_sig_pk_alg
	movq	%rax, %rbx
	movq	_MBEDTLS_PK_NONE@GOTPCREL(%rip), %rcx
	xorl	%eax, %eax
	cmpq	(%rcx), %rbx
	je	LBB0_15
## %bb.1:
	movq	16(%r14), %rax
	movq	(%rax), %r13
	leaq	L_.str(%rip), %rsi
	movl	$3, %edi
	callq	_MBEDTLS_SSL_DEBUG_MSG
	testq	%r13, %r13
	je	LBB0_16
## %bb.2:
	movq	%r14, -48(%rbp)                 ## 8-byte Spill
	xorl	%r14d, %r14d
	leaq	L_.str.2(%rip), %r12
	jmp	LBB0_3
	.p2align	4, 0x90
LBB0_4:                                 ##   in Loop: Header=BB0_3 Depth=1
	leaq	L_.str.3(%rip), %rsi
LBB0_12:                                ##   in Loop: Header=BB0_3 Depth=1
	movl	$3, %edi
	callq	_MBEDTLS_SSL_DEBUG_MSG
	movq	16(%r13), %r13
	testq	%r13, %r13
	je	LBB0_13
LBB0_3:                                 ## =>This Inner Loop Header: Depth=1
	movq	(%r13), %rdx
	movl	$3, %edi
	movq	%r12, %rsi
	callq	_MBEDTLS_SSL_DEBUG_CRT
	movl	8(%r13), %edi
	movq	%rbx, %rsi
	callq	_mbedtls_pk_can_do
	testl	%eax, %eax
	je	LBB0_4
## %bb.5:                               ##   in Loop: Header=BB0_3 Depth=1
	movq	(%r13), %rdi
	movq	_MBEDTLS_SSL_IS_SERVER@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	%r15, %rsi
	leaq	-52(%rbp), %rcx
	callq	_mbedtls_ssl_check_cert_usage
	testq	%rax, %rax
	je	LBB0_7
## %bb.6:                               ##   in Loop: Header=BB0_3 Depth=1
	leaq	L_.str.4(%rip), %rsi
	jmp	LBB0_12
	.p2align	4, 0x90
LBB0_7:                                 ##   in Loop: Header=BB0_3 Depth=1
	movq	-48(%rbp), %rax                 ## 8-byte Reload
	movq	(%rax), %rax
	movq	_MBEDTLS_SSL_MINOR_VERSION_3@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jge	LBB0_8
## %bb.10:                              ##   in Loop: Header=BB0_3 Depth=1
	movq	(%r13), %rax
	movq	(%rax), %rax
	movq	_MBEDTLS_MD_SHA1@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	je	LBB0_8
## %bb.11:                              ##   in Loop: Header=BB0_3 Depth=1
	testq	%r14, %r14
	cmoveq	%r13, %r14
	leaq	L_.str.5(%rip), %rsi
	jmp	LBB0_12
LBB0_13:
	testq	%r14, %r14
	jne	LBB0_9
	jmp	LBB0_14
LBB0_16:
	leaq	L_.str.1(%rip), %rsi
	movl	$3, %edi
	callq	_MBEDTLS_SSL_DEBUG_MSG
LBB0_14:
	movl	$-1, %eax
	jmp	LBB0_15
LBB0_8:
	movq	%r13, %r14
LBB0_9:
	movq	-48(%rbp), %rax                 ## 8-byte Reload
	movq	8(%rax), %rax
	movq	%r14, (%rax)
	movq	(%r14), %rdx
	leaq	L_.str.6(%rip), %rsi
	movl	$3, %edi
	callq	_MBEDTLS_SSL_DEBUG_CRT
	xorl	%eax, %eax
LBB0_15:
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_MBEDTLS_PK_NONE,8,3            ## @MBEDTLS_PK_NONE
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"ciphersuite requires certificate"

L_.str.1:                               ## @.str.1
	.asciz	"server has no certificate"

L_.str.2:                               ## @.str.2
	.asciz	"candidate certificate chain, certificate"

L_.str.3:                               ## @.str.3
	.asciz	"certificate mismatch: key type"

	.comm	_MBEDTLS_SSL_IS_SERVER,4,2      ## @MBEDTLS_SSL_IS_SERVER
L_.str.4:                               ## @.str.4
	.asciz	"certificate mismatch: (extended) key usage extension"

	.comm	_MBEDTLS_SSL_MINOR_VERSION_3,8,3 ## @MBEDTLS_SSL_MINOR_VERSION_3
	.comm	_MBEDTLS_MD_SHA1,8,3            ## @MBEDTLS_MD_SHA1
L_.str.5:                               ## @.str.5
	.asciz	"certificate not preferred: sha-2 with pre-TLS 1.2 client"

L_.str.6:                               ## @.str.6
	.asciz	"selected certificate chain, certificate"

	.comm	_MBEDTLS_PK_ECDSA,8,3           ## @MBEDTLS_PK_ECDSA
	.no_dead_strip	_ssl_pick_cert
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function ssl_pick_cert
_ssl_pick_cert:                         ; @ssl_pick_cert
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #112
	.cfi_def_cfa_offset 112
	stp	x28, x27, [sp, #16]             ; 16-byte Folded Spill
	stp	x26, x25, [sp, #32]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #48]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #64]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #80]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #96]             ; 16-byte Folded Spill
	add	x29, sp, #96
	.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, x1
	mov	x19, x0
	mov	x0, x1
	bl	_mbedtls_ssl_get_ciphersuite_sig_pk_alg
Lloh0:
	adrp	x8, _MBEDTLS_PK_NONE@GOTPAGE
Lloh1:
	ldr	x8, [x8, _MBEDTLS_PK_NONE@GOTPAGEOFF]
Lloh2:
	ldr	x8, [x8]
	cmp	x0, x8
	b.eq	LBB0_16
; %bb.1:
	mov	x21, x0
	ldr	x8, [x19, #16]
	ldr	x23, [x8]
Lloh3:
	adrp	x1, l_.str@PAGE
Lloh4:
	add	x1, x1, l_.str@PAGEOFF
	mov	w0, #3
	bl	_MBEDTLS_SSL_DEBUG_MSG
	cbz	x23, LBB0_12
; %bb.2:
	mov	x24, #0
Lloh5:
	adrp	x22, l_.str.2@PAGE
Lloh6:
	add	x22, x22, l_.str.2@PAGEOFF
Lloh7:
	adrp	x25, l_.str.3@PAGE
Lloh8:
	add	x25, x25, l_.str.3@PAGEOFF
Lloh9:
	adrp	x26, _MBEDTLS_SSL_IS_SERVER@GOTPAGE
Lloh10:
	ldr	x26, [x26, _MBEDTLS_SSL_IS_SERVER@GOTPAGEOFF]
Lloh11:
	adrp	x27, l_.str.4@PAGE
Lloh12:
	add	x27, x27, l_.str.4@PAGEOFF
Lloh13:
	adrp	x28, _MBEDTLS_SSL_MINOR_VERSION_3@GOTPAGE
Lloh14:
	ldr	x28, [x28, _MBEDTLS_SSL_MINOR_VERSION_3@GOTPAGEOFF]
	b	LBB0_5
LBB0_3:                                 ;   in Loop: Header=BB0_5 Depth=1
	mov	x1, x25
LBB0_4:                                 ;   in Loop: Header=BB0_5 Depth=1
	mov	w0, #3
	bl	_MBEDTLS_SSL_DEBUG_MSG
	ldr	x23, [x23, #16]
	cbz	x23, LBB0_11
LBB0_5:                                 ; =>This Inner Loop Header: Depth=1
	ldr	x2, [x23]
	mov	w0, #3
	mov	x1, x22
	bl	_MBEDTLS_SSL_DEBUG_CRT
	ldr	w0, [x23, #8]
	mov	x1, x21
	bl	_mbedtls_pk_can_do
	cbz	w0, LBB0_3
; %bb.6:                                ;   in Loop: Header=BB0_5 Depth=1
	ldr	x0, [x23]
	ldr	w2, [x26]
	add	x3, sp, #12
	mov	x1, x20
	bl	_mbedtls_ssl_check_cert_usage
	cbz	x0, LBB0_8
; %bb.7:                                ;   in Loop: Header=BB0_5 Depth=1
	mov	x1, x27
	b	LBB0_4
LBB0_8:                                 ;   in Loop: Header=BB0_5 Depth=1
	ldr	x8, [x19]
	ldr	x9, [x28]
	cmp	x8, x9
	b.ge	LBB0_14
; %bb.9:                                ;   in Loop: Header=BB0_5 Depth=1
	ldr	x8, [x23]
	ldr	x8, [x8]
Lloh15:
	adrp	x9, _MBEDTLS_MD_SHA1@GOTPAGE
Lloh16:
	ldr	x9, [x9, _MBEDTLS_MD_SHA1@GOTPAGEOFF]
Lloh17:
	ldr	x9, [x9]
	cmp	x8, x9
	b.eq	LBB0_14
; %bb.10:                               ;   in Loop: Header=BB0_5 Depth=1
	cmp	x24, #0
	csel	x24, x23, x24, eq
Lloh18:
	adrp	x1, l_.str.5@PAGE
Lloh19:
	add	x1, x1, l_.str.5@PAGEOFF
	b	LBB0_4
LBB0_11:
	cbnz	x24, LBB0_15
	b	LBB0_13
LBB0_12:
Lloh20:
	adrp	x1, l_.str.1@PAGE
Lloh21:
	add	x1, x1, l_.str.1@PAGEOFF
	mov	w0, #3
	bl	_MBEDTLS_SSL_DEBUG_MSG
LBB0_13:
	mov	w0, #-1
	b	LBB0_17
LBB0_14:
	mov	x24, x23
LBB0_15:
	ldr	x8, [x19, #8]
	str	x24, [x8]
	ldr	x2, [x24]
Lloh22:
	adrp	x1, l_.str.6@PAGE
Lloh23:
	add	x1, x1, l_.str.6@PAGEOFF
	mov	w0, #3
	bl	_MBEDTLS_SSL_DEBUG_CRT
LBB0_16:
	mov	w0, #0
LBB0_17:
	ldp	x29, x30, [sp, #96]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #80]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #64]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #48]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #32]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #112
	ret
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpAdd	Lloh3, Lloh4
	.loh AdrpLdrGot	Lloh13, Lloh14
	.loh AdrpAdd	Lloh11, Lloh12
	.loh AdrpLdrGot	Lloh9, Lloh10
	.loh AdrpAdd	Lloh7, Lloh8
	.loh AdrpAdd	Lloh5, Lloh6
	.loh AdrpLdrGotLdr	Lloh15, Lloh16, Lloh17
	.loh AdrpAdd	Lloh18, Lloh19
	.loh AdrpAdd	Lloh20, Lloh21
	.loh AdrpAdd	Lloh22, Lloh23
	.cfi_endproc
                                        ; -- End function
	.comm	_MBEDTLS_PK_NONE,8,3            ; @MBEDTLS_PK_NONE
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"ciphersuite requires certificate"

l_.str.1:                               ; @.str.1
	.asciz	"server has no certificate"

l_.str.2:                               ; @.str.2
	.asciz	"candidate certificate chain, certificate"

l_.str.3:                               ; @.str.3
	.asciz	"certificate mismatch: key type"

	.comm	_MBEDTLS_SSL_IS_SERVER,4,2      ; @MBEDTLS_SSL_IS_SERVER
l_.str.4:                               ; @.str.4
	.asciz	"certificate mismatch: (extended) key usage extension"

	.comm	_MBEDTLS_SSL_MINOR_VERSION_3,8,3 ; @MBEDTLS_SSL_MINOR_VERSION_3
	.comm	_MBEDTLS_MD_SHA1,8,3            ; @MBEDTLS_MD_SHA1
l_.str.5:                               ; @.str.5
	.asciz	"certificate not preferred: sha-2 with pre-TLS 1.2 client"

l_.str.6:                               ; @.str.6
	.asciz	"selected certificate chain, certificate"

	.comm	_MBEDTLS_PK_ECDSA,8,3           ; @MBEDTLS_PK_ECDSA
	.no_dead_strip	_ssl_pick_cert
.subsections_via_symbols
