	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_rdssl_cert_to_rkey             ## -- Begin function rdssl_cert_to_rkey
	.p2align	4, 0x90
_rdssl_cert_to_rkey:                    ## @rdssl_cert_to_rkey
	.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
	subq	$24, %rsp
	.cfi_offset %rbx, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdi, %rbx
	movq	_MS_ENHANCED_PROV@GOTPCREL(%rip), %r14
	movl	(%r14), %edx
	movq	_PROV_RSA_FULL@GOTPCREL(%rip), %r15
	movl	(%r15), %ecx
	leaq	-28(%rbp), %rdi
	xorl	%esi, %esi
	xorl	%r8d, %r8d
	callq	_CryptAcquireContext
	testq	%rax, %rax
	je	LBB0_1
LBB0_4:
	movl	-28(%rbp), %edi
	movq	_X509_ASN_ENCODING@GOTPCREL(%rip), %rax
	movq	_PKCS_7_ASN_ENCODING@GOTPCREL(%rip), %rcx
	movl	(%rcx), %esi
	orl	(%rax), %esi
	movq	(%rbx), %rdx
	leaq	-32(%rbp), %rax
	movq	%rax, (%rsp)
	xorl	%ecx, %ecx
	xorl	%r8d, %r8d
	xorl	%r9d, %r9d
	callq	_CryptImportPublicKeyInfoEx
	testq	%rax, %rax
	je	LBB0_5
## %bb.7:
	movl	-32(%rbp), %edi
	movq	_PUBLICKEYBLOB@GOTPCREL(%rip), %r14
	movl	(%r14), %edx
	leaq	-40(%rbp), %r9
	xorl	%esi, %esi
	xorl	%ecx, %ecx
	xorl	%r8d, %r8d
	callq	_CryptExportKey
	testq	%rax, %rax
	je	LBB0_8
## %bb.9:
	movq	-40(%rbp), %rdi
	xorl	%esi, %esi
	callq	_g_malloc
	movq	%rax, %rbx
	movl	-32(%rbp), %edi
	movl	(%r14), %edx
	leaq	-40(%rbp), %r9
	xorl	%esi, %esi
	xorl	%ecx, %ecx
	movq	%rax, %r8
	callq	_CryptExportKey
	testq	%rax, %rax
	je	LBB0_10
## %bb.11:
	movl	-32(%rbp), %edi
	callq	_CryptDestroyKey
	movl	-28(%rbp), %edi
	xorl	%esi, %esi
	callq	_CryptReleaseContext
	jmp	LBB0_12
LBB0_1:
	xorl	%eax, %eax
	callq	_GetLastError
	movq	_NTE_BAD_KEYSET@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jne	LBB0_3
## %bb.2:
	movl	(%r14), %edx
	movl	(%r15), %ecx
	movq	_CRYPT_NEWKEYSET@GOTPCREL(%rip), %rax
	movl	(%rax), %r8d
	leaq	l_.str(%rip), %rsi
	leaq	-28(%rbp), %rdi
	callq	_CryptAcquireContext
	testq	%rax, %rax
	jne	LBB0_4
LBB0_3:
	xorl	%ebx, %ebx
	xorl	%eax, %eax
	callq	_GetLastError
	leaq	L_.str.1(%rip), %rdi
	movq	%rax, %rsi
	callq	_error
	jmp	LBB0_12
LBB0_5:
	xorl	%ebx, %ebx
	xorl	%eax, %eax
	callq	_GetLastError
	movq	%rax, %r14
	movl	-28(%rbp), %edi
	xorl	%esi, %esi
	callq	_CryptReleaseContext
	leaq	L_.str.2(%rip), %rdi
	jmp	LBB0_6
LBB0_8:
	xorl	%ebx, %ebx
	xorl	%eax, %eax
	callq	_GetLastError
	movq	%rax, %r14
	movl	-32(%rbp), %edi
	callq	_CryptDestroyKey
	movl	-28(%rbp), %edi
	xorl	%esi, %esi
	callq	_CryptReleaseContext
	leaq	L_.str.3(%rip), %rdi
LBB0_6:
	movq	%r14, %rsi
	callq	_error
	jmp	LBB0_12
LBB0_10:
	xorl	%eax, %eax
	callq	_GetLastError
	movq	%rax, %r14
	movq	%rbx, %rdi
	callq	_g_free
	movl	-32(%rbp), %edi
	callq	_CryptDestroyKey
	movl	-28(%rbp), %edi
	xorl	%esi, %esi
	callq	_CryptReleaseContext
	leaq	L_.str.3(%rip), %rdi
	movq	%r14, %rsi
	callq	_error
	xorl	%ebx, %ebx
LBB0_12:
	movq	%rbx, %rax
	addq	$24, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_MS_ENHANCED_PROV,4,2           ## @MS_ENHANCED_PROV
	.comm	_PROV_RSA_FULL,4,2              ## @PROV_RSA_FULL
	.comm	_NTE_BAD_KEYSET,8,3             ## @NTE_BAD_KEYSET
	.section	__TEXT,__const
	.p2align	2                               ## @.str
l_.str:
	.long	77                              ## 0x4d
	.long	83                              ## 0x53
	.long	84                              ## 0x54
	.long	83                              ## 0x53
	.long	67                              ## 0x43
	.long	0                               ## 0x0

	.comm	_CRYPT_NEWKEYSET,4,2            ## @CRYPT_NEWKEYSET
	.section	__TEXT,__cstring,cstring_literals
L_.str.1:                               ## @.str.1
	.asciz	"CryptAcquireContext call failed with %lx\n"

	.comm	_X509_ASN_ENCODING,4,2          ## @X509_ASN_ENCODING
	.comm	_PKCS_7_ASN_ENCODING,4,2        ## @PKCS_7_ASN_ENCODING
L_.str.2:                               ## @.str.2
	.asciz	"CryptImportPublicKeyInfoEx call failed with %lx\n"

	.comm	_PUBLICKEYBLOB,4,2              ## @PUBLICKEYBLOB
L_.str.3:                               ## @.str.3
	.asciz	"CryptExportKey call failed with %lx\n"

.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_rdssl_cert_to_rkey             ; -- Begin function rdssl_cert_to_rkey
	.p2align	2
_rdssl_cert_to_rkey:                    ; @rdssl_cert_to_rkey
	.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	x19, x0
Lloh0:
	adrp	x20, _MS_ENHANCED_PROV@GOTPAGE
Lloh1:
	ldr	x20, [x20, _MS_ENHANCED_PROV@GOTPAGEOFF]
	ldr	w2, [x20]
Lloh2:
	adrp	x21, _PROV_RSA_FULL@GOTPAGE
Lloh3:
	ldr	x21, [x21, _PROV_RSA_FULL@GOTPAGEOFF]
	ldr	w3, [x21]
	add	x0, sp, #12
	mov	x1, #0
	mov	w4, #0
	bl	_CryptAcquireContext
	cbz	x0, LBB0_5
LBB0_1:
	ldr	w0, [sp, #12]
Lloh4:
	adrp	x8, _X509_ASN_ENCODING@GOTPAGE
Lloh5:
	ldr	x8, [x8, _X509_ASN_ENCODING@GOTPAGEOFF]
Lloh6:
	ldr	w8, [x8]
Lloh7:
	adrp	x9, _PKCS_7_ASN_ENCODING@GOTPAGE
Lloh8:
	ldr	x9, [x9, _PKCS_7_ASN_ENCODING@GOTPAGEOFF]
Lloh9:
	ldr	w9, [x9]
	orr	w1, w9, w8
	ldr	x2, [x19]
	add	x6, sp, #8
	mov	w3, #0
	mov	w4, #0
	mov	x5, #0
	bl	_CryptImportPublicKeyInfoEx
	cbz	x0, LBB0_8
; %bb.2:
	ldr	w0, [sp, #8]
Lloh10:
	adrp	x20, _PUBLICKEYBLOB@GOTPAGE
Lloh11:
	ldr	x20, [x20, _PUBLICKEYBLOB@GOTPAGEOFF]
	ldr	w2, [x20]
	mov	x5, sp
	mov	w1, #0
	mov	w3, #0
	mov	x4, #0
	bl	_CryptExportKey
	cbz	x0, LBB0_9
; %bb.3:
	ldr	x0, [sp]
	mov	w1, #0
	bl	_g_malloc
	mov	x19, x0
	ldr	w0, [sp, #8]
	ldr	w2, [x20]
	mov	x5, sp
	mov	w1, #0
	mov	w3, #0
	mov	x4, x19
	bl	_CryptExportKey
	cbz	x0, LBB0_11
; %bb.4:
	ldr	w0, [sp, #8]
	bl	_CryptDestroyKey
	ldr	w0, [sp, #12]
	mov	w1, #0
	bl	_CryptReleaseContext
	b	LBB0_13
LBB0_5:
	bl	_GetLastError
Lloh12:
	adrp	x8, _NTE_BAD_KEYSET@GOTPAGE
Lloh13:
	ldr	x8, [x8, _NTE_BAD_KEYSET@GOTPAGEOFF]
Lloh14:
	ldr	x8, [x8]
	cmp	x0, x8
	b.ne	LBB0_7
; %bb.6:
	ldr	w2, [x20]
	ldr	w3, [x21]
Lloh15:
	adrp	x8, _CRYPT_NEWKEYSET@GOTPAGE
Lloh16:
	ldr	x8, [x8, _CRYPT_NEWKEYSET@GOTPAGEOFF]
Lloh17:
	ldr	w4, [x8]
Lloh18:
	adrp	x1, l_.str@PAGE
Lloh19:
	add	x1, x1, l_.str@PAGEOFF
	add	x0, sp, #12
	bl	_CryptAcquireContext
	cbnz	x0, LBB0_1
LBB0_7:
	bl	_GetLastError
	mov	x1, x0
Lloh20:
	adrp	x0, l_.str.1@PAGE
Lloh21:
	add	x0, x0, l_.str.1@PAGEOFF
	b	LBB0_12
LBB0_8:
	bl	_GetLastError
	mov	x19, x0
	ldr	w0, [sp, #12]
	mov	w1, #0
	bl	_CryptReleaseContext
Lloh22:
	adrp	x0, l_.str.2@PAGE
Lloh23:
	add	x0, x0, l_.str.2@PAGEOFF
	b	LBB0_10
LBB0_9:
	bl	_GetLastError
	mov	x19, x0
	ldr	w0, [sp, #8]
	bl	_CryptDestroyKey
	ldr	w0, [sp, #12]
	mov	w1, #0
	bl	_CryptReleaseContext
Lloh24:
	adrp	x0, l_.str.3@PAGE
Lloh25:
	add	x0, x0, l_.str.3@PAGEOFF
LBB0_10:
	mov	x1, x19
	b	LBB0_12
LBB0_11:
	bl	_GetLastError
	mov	x20, x0
	mov	x0, x19
	bl	_g_free
	ldr	w0, [sp, #8]
	bl	_CryptDestroyKey
	ldr	w0, [sp, #12]
	mov	w1, #0
	bl	_CryptReleaseContext
Lloh26:
	adrp	x0, l_.str.3@PAGE
Lloh27:
	add	x0, x0, l_.str.3@PAGEOFF
	mov	x1, x20
LBB0_12:
	bl	_error
	mov	x19, #0
LBB0_13:
	mov	x0, x19
	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 AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh7, Lloh8, Lloh9
	.loh AdrpLdrGotLdr	Lloh4, Lloh5, Lloh6
	.loh AdrpLdrGot	Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.loh AdrpAdd	Lloh18, Lloh19
	.loh AdrpLdrGotLdr	Lloh15, Lloh16, Lloh17
	.loh AdrpAdd	Lloh20, Lloh21
	.loh AdrpAdd	Lloh22, Lloh23
	.loh AdrpAdd	Lloh24, Lloh25
	.loh AdrpAdd	Lloh26, Lloh27
	.cfi_endproc
                                        ; -- End function
	.comm	_MS_ENHANCED_PROV,4,2           ; @MS_ENHANCED_PROV
	.comm	_PROV_RSA_FULL,4,2              ; @PROV_RSA_FULL
	.comm	_NTE_BAD_KEYSET,8,3             ; @NTE_BAD_KEYSET
	.section	__TEXT,__const
	.p2align	2                               ; @.str
l_.str:
	.long	77                              ; 0x4d
	.long	83                              ; 0x53
	.long	84                              ; 0x54
	.long	83                              ; 0x53
	.long	67                              ; 0x43
	.long	0                               ; 0x0

	.comm	_CRYPT_NEWKEYSET,4,2            ; @CRYPT_NEWKEYSET
	.section	__TEXT,__cstring,cstring_literals
l_.str.1:                               ; @.str.1
	.asciz	"CryptAcquireContext call failed with %lx\n"

	.comm	_X509_ASN_ENCODING,4,2          ; @X509_ASN_ENCODING
	.comm	_PKCS_7_ASN_ENCODING,4,2        ; @PKCS_7_ASN_ENCODING
l_.str.2:                               ; @.str.2
	.asciz	"CryptImportPublicKeyInfoEx call failed with %lx\n"

	.comm	_PUBLICKEYBLOB,4,2              ; @PUBLICKEYBLOB
l_.str.3:                               ; @.str.3
	.asciz	"CryptExportKey call failed with %lx\n"

.subsections_via_symbols
