	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_cms_create_enveloped           ## -- Begin function cms_create_enveloped
	.p2align	4, 0x90
_cms_create_enveloped:                  ## @cms_create_enveloped
	.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	$72, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdx, %r15
	movq	%rdi, %r13
	leaq	-80(%rbp), %rdi
	movq	%rdi, %rbx
	xorl	%esi, %esi
	movl	$4, %edx
	callq	_memset
	movq	_context@GOTPCREL(%rip), %r14
	movl	(%r14), %edi
	leaq	-44(%rbp), %rsi
	callq	_hx509_lock_init
	movl	-44(%rbp), %edi
	leaq	36(%r13), %rsi
	callq	_lock_strings
	movq	(%r15), %rdi
	leaq	-88(%rbp), %rsi
	leaq	-112(%rbp), %rdx
	callq	_rk_undumpdata
	testl	%eax, %eax
	je	LBB0_2
## %bb.1:
	movq	(%r15), %rdx
	leaq	L_.str(%rip), %rsi
	movl	$1, %edi
	movl	%eax, %ecx
	callq	_err
LBB0_2:
	movl	(%r14), %edi
	leaq	L_.str.1(%rip), %rsi
	xorl	%r12d, %r12d
	leaq	-48(%rbp), %r8
	xorl	%edx, %edx
	xorl	%ecx, %ecx
	callq	_hx509_certs_init
	testl	%eax, %eax
	je	LBB0_4
## %bb.3:
	movl	(%r14), %edi
	leaq	L_.str.2(%rip), %rcx
	movl	$1, %esi
	movl	%eax, %edx
	callq	_hx509_err
LBB0_4:
	movl	(%r14), %edi
	movl	-48(%rbp), %edx
	movl	-44(%rbp), %ecx
	leaq	32(%r13), %r8
	leaq	L_.str.3(%rip), %rsi
	callq	_certs_strings
	cmpq	$0, 24(%r13)
	movl	$0, %eax
	je	LBB0_6
## %bb.5:
	movq	_HX509_CMS_EV_ALLOW_WEAK@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
LBB0_6:
	movl	(%r13), %edi
	testl	%edi, %edi
	movl	%eax, -76(%rbp)                 ## 4-byte Spill
	je	LBB0_9
## %bb.7:
	callq	_hx509_crypto_enctype_by_name
	movq	%rax, %r12
	testq	%rax, %rax
	jne	LBB0_9
## %bb.8:
	movl	(%r13), %edx
	leaq	L_.str.4(%rip), %rsi
	movl	$1, %edi
	callq	_errx
	xorl	%r12d, %r12d
LBB0_9:
	movq	%r15, -96(%rbp)                 ## 8-byte Spill
	movl	(%r14), %edi
	leaq	-72(%rbp), %rsi
	callq	_hx509_query_alloc
	testl	%eax, %eax
	je	LBB0_11
## %bb.10:
	leaq	L_.str.5(%rip), %rsi
	movl	$1, %edi
	movl	%eax, %edx
	callq	_errx
LBB0_11:
	movq	-72(%rbp), %rdi
	movq	_HX509_QUERY_OPTION_KU_ENCIPHERMENT@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	callq	_hx509_query_match_option
	movl	(%r14), %edi
	movl	-48(%rbp), %esi
	movq	-72(%rbp), %rdx
	leaq	-60(%rbp), %rcx
	callq	_hx509_certs_find
	movl	%eax, %r15d
	movl	(%r14), %edi
	movq	-72(%rbp), %rsi
	callq	_hx509_query_free
	testl	%r15d, %r15d
	je	LBB0_13
## %bb.12:
	leaq	L_.str.6(%rip), %rsi
	movl	$1, %edi
	movl	%r15d, %edx
	callq	_errx
LBB0_13:
	movl	16(%r13), %edi
	movq	_asn1_oid_id_pkcs7_data@GOTPCREL(%rip), %rsi
	movq	%rbx, %rdx
	callq	_parse_oid
	movl	(%r14), %edi
	movl	-60(%rbp), %edx
	movq	-88(%rbp), %rcx
	movq	-112(%rbp), %r8
	leaq	-56(%rbp), %rax
	movl	-76(%rbp), %esi                 ## 4-byte Reload
	movq	%r12, %r9
	pushq	%rax
	pushq	%rbx
	callq	_hx509_cms_envelope_1
	addq	$16, %rsp
	testl	%eax, %eax
	je	LBB0_15
## %bb.14:
	leaq	L_.str.7(%rip), %rsi
	movl	$1, %edi
	movl	%eax, %edx
	callq	_errx
LBB0_15:
	movl	-60(%rbp), %edi
	callq	_hx509_cert_free
	leaq	-48(%rbp), %rdi
	callq	_hx509_certs_free
	movq	-88(%rbp), %rdi
	callq	_rk_xfree
	leaq	-80(%rbp), %rdi
	callq	_der_free_oid
	cmpq	$0, 8(%r13)
	movq	-96(%rbp), %rbx                 ## 8-byte Reload
	je	LBB0_19
## %bb.16:
	movq	_asn1_oid_id_pkcs7_envelopedData@GOTPCREL(%rip), %rdi
	leaq	-56(%rbp), %rsi
	leaq	-104(%rbp), %rdx
	callq	_hx509_cms_wrap_ContentInfo
	testl	%eax, %eax
	je	LBB0_18
## %bb.17:
	leaq	L_.str.8(%rip), %rsi
	movl	$1, %edi
	movl	%eax, %edx
	callq	_errx
LBB0_18:
	leaq	-56(%rbp), %rdi
	callq	_der_free_octet_string
	movq	-104(%rbp), %rax
	movq	%rax, -56(%rbp)
LBB0_19:
	movl	-44(%rbp), %edi
	callq	_hx509_lock_free
	movq	8(%rbx), %rdi
	movl	-56(%rbp), %edx
	movl	-52(%rbp), %esi
	callq	__hx509_write_file
	testl	%eax, %eax
	je	LBB0_21
## %bb.20:
	leaq	L_.str.9(%rip), %rsi
	movl	$1, %edi
	movl	%eax, %edx
	callq	_errx
LBB0_21:
	leaq	-56(%rbp), %rdi
	callq	_der_free_octet_string
	xorl	%eax, %eax
	addq	$72, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_context,4,2                    ## @context
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"map_file: %s: %d"

L_.str.1:                               ## @.str.1
	.asciz	"MEMORY:cert-store"

L_.str.2:                               ## @.str.2
	.asciz	"hx509_certs_init: MEMORY"

L_.str.3:                               ## @.str.3
	.asciz	"store"

	.comm	_HX509_CMS_EV_ALLOW_WEAK,4,2    ## @HX509_CMS_EV_ALLOW_WEAK
L_.str.4:                               ## @.str.4
	.asciz	"encryption type: %s no found"

L_.str.5:                               ## @.str.5
	.asciz	"hx509_query_alloc: %d"

	.comm	_HX509_QUERY_OPTION_KU_ENCIPHERMENT,4,2 ## @HX509_QUERY_OPTION_KU_ENCIPHERMENT
L_.str.6:                               ## @.str.6
	.asciz	"hx509_certs_find: %d"

	.comm	_asn1_oid_id_pkcs7_data,4,2     ## @asn1_oid_id_pkcs7_data
L_.str.7:                               ## @.str.7
	.asciz	"hx509_cms_envelope_1: %d"

	.comm	_asn1_oid_id_pkcs7_envelopedData,4,2 ## @asn1_oid_id_pkcs7_envelopedData
L_.str.8:                               ## @.str.8
	.asciz	"hx509_cms_wrap_ContentInfo: %d"

L_.str.9:                               ## @.str.9
	.asciz	"hx509_write_file: %d"

.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_cms_create_enveloped           ; -- Begin function cms_create_enveloped
	.p2align	2
_cms_create_enveloped:                  ; @cms_create_enveloped
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #128
	.cfi_def_cfa_offset 128
	stp	x24, x23, [sp, #64]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #80]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #96]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #112]            ; 16-byte Folded Spill
	add	x29, sp, #112
	.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
	mov	x19, x2
	mov	x20, x0
	sub	x0, x29, #52
	mov	w1, #0
	mov	w2, #4
	bl	_memset
Lloh0:
	adrp	x24, _context@GOTPAGE
Lloh1:
	ldr	x24, [x24, _context@GOTPAGEOFF]
	ldr	w0, [x24]
	add	x1, sp, #12
	bl	_hx509_lock_init
	ldr	w0, [sp, #12]
	add	x1, x20, #36
	bl	_lock_strings
	ldr	x0, [x19]
	add	x1, sp, #16
	add	x2, sp, #24
	bl	_rk_undumpdata
	cbz	w0, LBB0_2
; %bb.1:
	mov	x3, x0
	ldr	x2, [x19]
Lloh2:
	adrp	x1, l_.str@PAGE
Lloh3:
	add	x1, x1, l_.str@PAGEOFF
	mov	w0, #1
	bl	_err
LBB0_2:
	ldr	w0, [x24]
Lloh4:
	adrp	x1, l_.str.1@PAGE
Lloh5:
	add	x1, x1, l_.str.1@PAGEOFF
	add	x4, sp, #36
	mov	w2, #0
	mov	x3, #0
	bl	_hx509_certs_init
	cbz	w0, LBB0_4
; %bb.3:
	mov	x2, x0
	ldr	w0, [x24]
Lloh6:
	adrp	x3, l_.str.2@PAGE
Lloh7:
	add	x3, x3, l_.str.2@PAGEOFF
	mov	w1, #1
	bl	_hx509_err
LBB0_4:
	ldr	w0, [x24]
	ldr	w2, [sp, #36]
	add	x4, x20, #32
	ldr	w3, [sp, #12]
Lloh8:
	adrp	x1, l_.str.3@PAGE
Lloh9:
	add	x1, x1, l_.str.3@PAGEOFF
	bl	_certs_strings
	ldr	x8, [x20, #24]
Lloh10:
	adrp	x9, _HX509_CMS_EV_ALLOW_WEAK@GOTPAGE
Lloh11:
	ldr	x9, [x9, _HX509_CMS_EV_ALLOW_WEAK@GOTPAGEOFF]
Lloh12:
	ldr	w9, [x9]
	cmp	x8, #0
	csel	w21, wzr, w9, eq
	ldr	w0, [x20]
	cbz	w0, LBB0_7
; %bb.5:
	bl	_hx509_crypto_enctype_by_name
	mov	x22, x0
	cbnz	x0, LBB0_8
; %bb.6:
	ldr	w2, [x20]
Lloh13:
	adrp	x1, l_.str.4@PAGE
Lloh14:
	add	x1, x1, l_.str.4@PAGEOFF
	mov	w0, #1
	bl	_errx
	b	LBB0_8
LBB0_7:
	mov	x22, #0
LBB0_8:
	ldr	w0, [x24]
	add	x1, sp, #40
	bl	_hx509_query_alloc
	cbz	w0, LBB0_10
; %bb.9:
	mov	x2, x0
Lloh15:
	adrp	x1, l_.str.5@PAGE
Lloh16:
	add	x1, x1, l_.str.5@PAGEOFF
	mov	w0, #1
	bl	_errx
LBB0_10:
	ldr	x0, [sp, #40]
Lloh17:
	adrp	x8, _HX509_QUERY_OPTION_KU_ENCIPHERMENT@GOTPAGE
Lloh18:
	ldr	x8, [x8, _HX509_QUERY_OPTION_KU_ENCIPHERMENT@GOTPAGEOFF]
Lloh19:
	ldr	w1, [x8]
	bl	_hx509_query_match_option
	ldr	w0, [x24]
	ldr	w1, [sp, #36]
	ldr	x2, [sp, #40]
	add	x3, sp, #32
	bl	_hx509_certs_find
	mov	x23, x0
	ldr	w0, [x24]
	ldr	x1, [sp, #40]
	bl	_hx509_query_free
	cbz	w23, LBB0_12
; %bb.11:
Lloh20:
	adrp	x1, l_.str.6@PAGE
Lloh21:
	add	x1, x1, l_.str.6@PAGEOFF
	mov	w0, #1
	mov	x2, x23
	bl	_errx
LBB0_12:
	ldr	w0, [x20, #16]
Lloh22:
	adrp	x1, _asn1_oid_id_pkcs7_data@GOTPAGE
Lloh23:
	ldr	x1, [x1, _asn1_oid_id_pkcs7_data@GOTPAGEOFF]
	sub	x2, x29, #52
	bl	_parse_oid
	ldr	w0, [x24]
	ldr	w2, [sp, #32]
	ldp	x3, x4, [sp, #16]
	sub	x6, x29, #52
	add	x7, sp, #48
	mov	x1, x21
	mov	x5, x22
	bl	_hx509_cms_envelope_1
	cbz	w0, LBB0_14
; %bb.13:
	mov	x2, x0
Lloh24:
	adrp	x1, l_.str.7@PAGE
Lloh25:
	add	x1, x1, l_.str.7@PAGEOFF
	mov	w0, #1
	bl	_errx
LBB0_14:
	ldr	w0, [sp, #32]
	bl	_hx509_cert_free
	add	x0, sp, #36
	bl	_hx509_certs_free
	ldr	x0, [sp, #16]
	bl	_rk_xfree
	sub	x0, x29, #52
	bl	_der_free_oid
	ldr	x8, [x20, #8]
	cbz	x8, LBB0_18
; %bb.15:
Lloh26:
	adrp	x0, _asn1_oid_id_pkcs7_envelopedData@GOTPAGE
Lloh27:
	ldr	x0, [x0, _asn1_oid_id_pkcs7_envelopedData@GOTPAGEOFF]
	add	x1, sp, #48
	mov	x2, sp
	bl	_hx509_cms_wrap_ContentInfo
	cbz	w0, LBB0_17
; %bb.16:
	mov	x2, x0
Lloh28:
	adrp	x1, l_.str.8@PAGE
Lloh29:
	add	x1, x1, l_.str.8@PAGEOFF
	mov	w0, #1
	bl	_errx
LBB0_17:
	add	x0, sp, #48
	bl	_der_free_octet_string
	ldr	x8, [sp]
	str	x8, [sp, #48]
LBB0_18:
	ldr	w0, [sp, #12]
	bl	_hx509_lock_free
	ldr	x0, [x19, #8]
	ldp	w2, w1, [sp, #48]
	bl	__hx509_write_file
	cbz	w0, LBB0_20
; %bb.19:
	mov	x2, x0
Lloh30:
	adrp	x1, l_.str.9@PAGE
Lloh31:
	add	x1, x1, l_.str.9@PAGEOFF
	mov	w0, #1
	bl	_errx
LBB0_20:
	add	x0, sp, #48
	bl	_der_free_octet_string
	mov	w0, #0
	ldp	x29, x30, [sp, #112]            ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #96]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #80]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #64]             ; 16-byte Folded Reload
	add	sp, sp, #128
	ret
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpAdd	Lloh2, Lloh3
	.loh AdrpAdd	Lloh4, Lloh5
	.loh AdrpAdd	Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh10, Lloh11, Lloh12
	.loh AdrpAdd	Lloh8, Lloh9
	.loh AdrpAdd	Lloh13, Lloh14
	.loh AdrpAdd	Lloh15, Lloh16
	.loh AdrpLdrGotLdr	Lloh17, Lloh18, Lloh19
	.loh AdrpAdd	Lloh20, Lloh21
	.loh AdrpLdrGot	Lloh22, Lloh23
	.loh AdrpAdd	Lloh24, Lloh25
	.loh AdrpLdrGot	Lloh26, Lloh27
	.loh AdrpAdd	Lloh28, Lloh29
	.loh AdrpAdd	Lloh30, Lloh31
	.cfi_endproc
                                        ; -- End function
	.comm	_context,4,2                    ; @context
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"map_file: %s: %d"

l_.str.1:                               ; @.str.1
	.asciz	"MEMORY:cert-store"

l_.str.2:                               ; @.str.2
	.asciz	"hx509_certs_init: MEMORY"

l_.str.3:                               ; @.str.3
	.asciz	"store"

	.comm	_HX509_CMS_EV_ALLOW_WEAK,4,2    ; @HX509_CMS_EV_ALLOW_WEAK
l_.str.4:                               ; @.str.4
	.asciz	"encryption type: %s no found"

l_.str.5:                               ; @.str.5
	.asciz	"hx509_query_alloc: %d"

	.comm	_HX509_QUERY_OPTION_KU_ENCIPHERMENT,4,2 ; @HX509_QUERY_OPTION_KU_ENCIPHERMENT
l_.str.6:                               ; @.str.6
	.asciz	"hx509_certs_find: %d"

	.comm	_asn1_oid_id_pkcs7_data,4,2     ; @asn1_oid_id_pkcs7_data
l_.str.7:                               ; @.str.7
	.asciz	"hx509_cms_envelope_1: %d"

	.comm	_asn1_oid_id_pkcs7_envelopedData,4,2 ; @asn1_oid_id_pkcs7_envelopedData
l_.str.8:                               ; @.str.8
	.asciz	"hx509_cms_wrap_ContentInfo: %d"

l_.str.9:                               ; @.str.9
	.asciz	"hx509_write_file: %d"

.subsections_via_symbols
