	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function ssl_set_cert
_ssl_set_cert:                          ## @ssl_set_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	%rbx
	pushq	%rax
	.cfi_offset %rbx, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rsi, %r14
	movq	%rdi, %r15
	movq	%rsi, %rdi
	callq	_X509_get0_pubkey
	testq	%rax, %rax
	je	LBB0_1
## %bb.3:
	movq	%rax, %rbx
	leaq	-32(%rbp), %rsi
	movq	%rax, %rdi
	callq	_ssl_cert_lookup_by_pkey
	testq	%rax, %rax
	je	LBB0_4
## %bb.5:
	movq	-32(%rbp), %rax
	movq	_SSL_PKEY_ECC@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jne	LBB0_8
## %bb.6:
	movq	%rbx, %rdi
	callq	_EVP_PKEY_get0_EC_KEY
	movl	%eax, %edi
	callq	_EC_KEY_can_sign
	testl	%eax, %eax
	je	LBB0_15
## %bb.7:
	movq	-32(%rbp), %rax
LBB0_8:
	movq	(%r15), %rcx
	shlq	$4, %rax
	movq	8(%rcx,%rax), %rsi
	testq	%rsi, %rsi
	je	LBB0_13
## %bb.9:
	movq	%rbx, %rdi
	callq	_EVP_PKEY_copy_parameters
	xorl	%eax, %eax
	callq	_ERR_clear_error
	movq	(%r15), %rax
	movq	-32(%rbp), %rcx
	shlq	$4, %rcx
	movq	8(%rax,%rcx), %rdi
	callq	_EVP_PKEY_id
	movq	_EVP_PKEY_RSA@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jne	LBB0_11
## %bb.10:
	movq	(%r15), %rax
	movq	-32(%rbp), %rcx
	shlq	$4, %rcx
	movq	8(%rax,%rcx), %rdi
	callq	_EVP_PKEY_get0_RSA
	movl	%eax, %edi
	callq	_RSA_flags
	movq	_RSA_METHOD_FLAG_NO_CHECK@GOTPCREL(%rip), %rcx
	testl	%eax, (%rcx)
	jne	LBB0_13
LBB0_11:
	movq	(%r15), %rax
	movq	-32(%rbp), %rcx
	shlq	$4, %rcx
	movq	8(%rax,%rcx), %rsi
	movq	%r14, %rdi
	callq	_X509_check_private_key
	testl	%eax, %eax
	jne	LBB0_13
## %bb.12:
	movq	(%r15), %rax
	movq	-32(%rbp), %rcx
	shlq	$4, %rcx
	movq	8(%rax,%rcx), %rdi
	callq	_EVP_PKEY_free
	movq	(%r15), %rax
	movq	-32(%rbp), %rcx
	shlq	$4, %rcx
	movq	$0, 8(%rax,%rcx)
	xorl	%eax, %eax
	callq	_ERR_clear_error
LBB0_13:
	movq	(%r15), %rax
	movq	-32(%rbp), %rcx
	shlq	$4, %rcx
	movq	(%rax,%rcx), %rdi
	callq	_X509_free
	movq	%r14, %rdi
	callq	_X509_up_ref
	movq	(%r15), %rax
	movq	-32(%rbp), %rcx
	shlq	$4, %rcx
	leaq	(%rax,%rcx), %rdx
	movq	%r14, (%rax,%rcx)
	movq	%rdx, 8(%r15)
	movl	$1, %eax
	jmp	LBB0_14
LBB0_1:
	movq	_SSL_F_SSL_SET_CERT@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movq	_SSL_R_X509_LIB@GOTPCREL(%rip), %rax
	jmp	LBB0_2
LBB0_4:
	movq	_SSL_F_SSL_SET_CERT@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movq	_SSL_R_UNKNOWN_CERTIFICATE_TYPE@GOTPCREL(%rip), %rax
	jmp	LBB0_2
LBB0_15:
	movq	_SSL_F_SSL_SET_CERT@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movq	_SSL_R_ECC_CERT_NOT_FOR_SIGNING@GOTPCREL(%rip), %rax
LBB0_2:
	movl	(%rax), %esi
	callq	_SSLerr
	xorl	%eax, %eax
LBB0_14:
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_SSL_F_SSL_SET_CERT,4,2         ## @SSL_F_SSL_SET_CERT
	.comm	_SSL_R_X509_LIB,4,2             ## @SSL_R_X509_LIB
	.comm	_SSL_R_UNKNOWN_CERTIFICATE_TYPE,4,2 ## @SSL_R_UNKNOWN_CERTIFICATE_TYPE
	.comm	_SSL_PKEY_ECC,8,3               ## @SSL_PKEY_ECC
	.comm	_SSL_R_ECC_CERT_NOT_FOR_SIGNING,4,2 ## @SSL_R_ECC_CERT_NOT_FOR_SIGNING
	.comm	_EVP_PKEY_RSA,8,3               ## @EVP_PKEY_RSA
	.comm	_RSA_METHOD_FLAG_NO_CHECK,4,2   ## @RSA_METHOD_FLAG_NO_CHECK
	.no_dead_strip	_ssl_set_cert
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function ssl_set_cert
_ssl_set_cert:                          ; @ssl_set_cert
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #64
	.cfi_def_cfa_offset 64
	stp	x22, x21, [sp, #16]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #32]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #48]             ; 16-byte Folded Spill
	add	x29, sp, #48
	.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
	mov	x0, x1
	bl	_X509_get0_pubkey
	cbz	x0, LBB0_11
; %bb.1:
	mov	x21, x0
	add	x1, sp, #8
	bl	_ssl_cert_lookup_by_pkey
	cbz	x0, LBB0_12
; %bb.2:
	ldr	x8, [sp, #8]
Lloh0:
	adrp	x9, _SSL_PKEY_ECC@GOTPAGE
Lloh1:
	ldr	x9, [x9, _SSL_PKEY_ECC@GOTPAGEOFF]
Lloh2:
	ldr	x9, [x9]
	cmp	x8, x9
	b.ne	LBB0_5
; %bb.3:
	mov	x0, x21
	bl	_EVP_PKEY_get0_EC_KEY
	bl	_EC_KEY_can_sign
	cbz	w0, LBB0_13
; %bb.4:
	ldr	x8, [sp, #8]
LBB0_5:
	ldr	x9, [x19]
	add	x8, x9, x8, lsl #4
	ldr	x1, [x8, #8]
	cbz	x1, LBB0_10
; %bb.6:
	mov	x0, x21
	bl	_EVP_PKEY_copy_parameters
	bl	_ERR_clear_error
	ldr	x8, [x19]
	ldr	x9, [sp, #8]
	add	x8, x8, x9, lsl #4
	ldr	x0, [x8, #8]
	bl	_EVP_PKEY_id
Lloh3:
	adrp	x8, _EVP_PKEY_RSA@GOTPAGE
Lloh4:
	ldr	x8, [x8, _EVP_PKEY_RSA@GOTPAGEOFF]
Lloh5:
	ldr	x8, [x8]
	cmp	x0, x8
	b.ne	LBB0_8
; %bb.7:
	ldr	x8, [x19]
	ldr	x9, [sp, #8]
	add	x8, x8, x9, lsl #4
	ldr	x0, [x8, #8]
	bl	_EVP_PKEY_get0_RSA
	bl	_RSA_flags
Lloh6:
	adrp	x8, _RSA_METHOD_FLAG_NO_CHECK@GOTPAGE
Lloh7:
	ldr	x8, [x8, _RSA_METHOD_FLAG_NO_CHECK@GOTPAGEOFF]
Lloh8:
	ldr	w8, [x8]
	tst	w8, w0
	b.ne	LBB0_10
LBB0_8:
	ldr	x8, [x19]
	ldr	x9, [sp, #8]
	add	x8, x8, x9, lsl #4
	ldr	x1, [x8, #8]
	mov	x0, x20
	bl	_X509_check_private_key
	cbnz	w0, LBB0_10
; %bb.9:
	ldr	x8, [x19]
	ldr	x9, [sp, #8]
	add	x8, x8, x9, lsl #4
	ldr	x0, [x8, #8]
	bl	_EVP_PKEY_free
	ldr	x8, [x19]
	ldr	x9, [sp, #8]
	add	x8, x8, x9, lsl #4
	str	xzr, [x8, #8]
	bl	_ERR_clear_error
LBB0_10:
	ldr	x8, [x19]
	ldr	x9, [sp, #8]
	lsl	x9, x9, #4
	ldr	x0, [x8, x9]
	bl	_X509_free
	mov	x0, x20
	bl	_X509_up_ref
	ldr	x8, [x19]
	ldr	x9, [sp, #8]
	add	x8, x8, x9, lsl #4
	str	x20, [x8]
	str	x8, [x19, #8]
	mov	w0, #1
	b	LBB0_15
LBB0_11:
Lloh9:
	adrp	x8, _SSL_F_SSL_SET_CERT@GOTPAGE
Lloh10:
	ldr	x8, [x8, _SSL_F_SSL_SET_CERT@GOTPAGEOFF]
Lloh11:
	ldr	w0, [x8]
Lloh12:
	adrp	x8, _SSL_R_X509_LIB@GOTPAGE
Lloh13:
	ldr	x8, [x8, _SSL_R_X509_LIB@GOTPAGEOFF]
	b	LBB0_14
LBB0_12:
Lloh14:
	adrp	x8, _SSL_F_SSL_SET_CERT@GOTPAGE
Lloh15:
	ldr	x8, [x8, _SSL_F_SSL_SET_CERT@GOTPAGEOFF]
Lloh16:
	ldr	w0, [x8]
Lloh17:
	adrp	x8, _SSL_R_UNKNOWN_CERTIFICATE_TYPE@GOTPAGE
Lloh18:
	ldr	x8, [x8, _SSL_R_UNKNOWN_CERTIFICATE_TYPE@GOTPAGEOFF]
	b	LBB0_14
LBB0_13:
Lloh19:
	adrp	x8, _SSL_F_SSL_SET_CERT@GOTPAGE
Lloh20:
	ldr	x8, [x8, _SSL_F_SSL_SET_CERT@GOTPAGEOFF]
Lloh21:
	ldr	w0, [x8]
Lloh22:
	adrp	x8, _SSL_R_ECC_CERT_NOT_FOR_SIGNING@GOTPAGE
Lloh23:
	ldr	x8, [x8, _SSL_R_ECC_CERT_NOT_FOR_SIGNING@GOTPAGEOFF]
LBB0_14:
	ldr	w1, [x8]
	bl	_SSLerr
	mov	w0, #0
LBB0_15:
	ldp	x29, x30, [sp, #48]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #32]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #64
	ret
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGot	Lloh12, Lloh13
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGot	Lloh17, Lloh18
	.loh AdrpLdrGotLdr	Lloh14, Lloh15, Lloh16
	.loh AdrpLdrGot	Lloh22, Lloh23
	.loh AdrpLdrGotLdr	Lloh19, Lloh20, Lloh21
	.cfi_endproc
                                        ; -- End function
	.comm	_SSL_F_SSL_SET_CERT,4,2         ; @SSL_F_SSL_SET_CERT
	.comm	_SSL_R_X509_LIB,4,2             ; @SSL_R_X509_LIB
	.comm	_SSL_R_UNKNOWN_CERTIFICATE_TYPE,4,2 ; @SSL_R_UNKNOWN_CERTIFICATE_TYPE
	.comm	_SSL_PKEY_ECC,8,3               ; @SSL_PKEY_ECC
	.comm	_SSL_R_ECC_CERT_NOT_FOR_SIGNING,4,2 ; @SSL_R_ECC_CERT_NOT_FOR_SIGNING
	.comm	_EVP_PKEY_RSA,8,3               ; @EVP_PKEY_RSA
	.comm	_RSA_METHOD_FLAG_NO_CHECK,4,2   ; @RSA_METHOD_FLAG_NO_CHECK
	.no_dead_strip	_ssl_set_cert
.subsections_via_symbols
