	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_cms_unenvelope                 ## -- Begin function cms_unenvelope
	.p2align	4, 0x90
_cms_unenvelope:                        ## @cms_unenvelope
	.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	$88, %rsp
	.cfi_offset %rbx, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdx, %r14
	movq	%rdi, %rbx
	xorps	%xmm0, %xmm0
	movaps	%xmm0, -112(%rbp)
	movq	_context@GOTPCREL(%rip), %r15
	movl	(%r15), %edi
	leaq	-28(%rbp), %rsi
	callq	_hx509_lock_init
	movl	-28(%rbp), %edi
	leaq	24(%rbx), %rsi
	callq	_lock_strings
	movq	(%r14), %rdi
	leaq	-56(%rbp), %rsi
	leaq	-96(%rbp), %rdx
	callq	_rk_undumpdata
	testl	%eax, %eax
	je	LBB0_2
## %bb.1:
	movq	(%r14), %rdx
	leaq	L_.str(%rip), %rsi
	movl	$1, %edi
	movl	%eax, %ecx
	callq	_err
LBB0_2:
	movq	-56(%rbp), %rax
	movq	%rax, -48(%rbp)
	movq	-96(%rbp), %rax
	movq	%rax, -40(%rbp)
	cmpq	$0, 16(%rbx)
	je	LBB0_8
## %bb.3:
	leaq	-48(%rbp), %rdi
	leaq	-72(%rbp), %rsi
	leaq	-88(%rbp), %rdx
	xorl	%ecx, %ecx
	callq	_hx509_cms_unwrap_ContentInfo
	testl	%eax, %eax
	je	LBB0_5
## %bb.4:
	leaq	L_.str.1(%rip), %rsi
	movl	$1, %edi
	movl	%eax, %edx
	xorl	%eax, %eax
	callq	_errx
LBB0_5:
	movq	_asn1_oid_id_pkcs7_envelopedData@GOTPCREL(%rip), %rsi
	leaq	-72(%rbp), %rdi
	callq	_der_heim_oid_cmp
	testq	%rax, %rax
	je	LBB0_7
## %bb.6:
	leaq	L_.str.2(%rip), %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	callq	_errx
LBB0_7:
	leaq	-72(%rbp), %rdi
	callq	_der_free_oid
	movups	-88(%rbp), %xmm0
	movaps	%xmm0, -48(%rbp)
LBB0_8:
	movl	(%r15), %edi
	leaq	L_.str.3(%rip), %rsi
	leaq	-72(%rbp), %r8
	xorl	%edx, %edx
	xorl	%ecx, %ecx
	callq	_hx509_certs_init
	testl	%eax, %eax
	je	LBB0_10
## %bb.9:
	leaq	L_.str.4(%rip), %rsi
	movl	$1, %edi
	movl	%eax, %edx
	xorl	%eax, %eax
	callq	_errx
LBB0_10:
	movl	(%r15), %edi
	movl	-72(%rbp), %edx
	movl	-28(%rbp), %ecx
	leaq	8(%rbx), %r8
	leaq	L_.str.5(%rip), %rsi
	callq	_certs_strings
	cmpq	$0, (%rbx)
	movl	$0, %edx
	je	LBB0_12
## %bb.11:
	movq	_HX509_CMS_UE_ALLOW_WEAK@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
LBB0_12:
	movl	(%r15), %edi
	movl	-72(%rbp), %esi
	movq	-48(%rbp), %rcx
	movq	-40(%rbp), %r8
	subq	$8, %rsp
	leaq	-88(%rbp), %rax
	leaq	-112(%rbp), %rbx
	xorl	%r9d, %r9d
	pushq	%rax
	pushq	%rbx
	pushq	$0
	callq	_hx509_cms_unenvelope
	addq	$32, %rsp
	movl	%eax, %ebx
	movq	-48(%rbp), %rax
	cmpq	-56(%rbp), %rax
	je	LBB0_14
## %bb.13:
	leaq	-48(%rbp), %rdi
	callq	_der_free_octet_string
LBB0_14:
	testl	%ebx, %ebx
	je	LBB0_16
## %bb.15:
	movl	(%r15), %edi
	leaq	L_.str.6(%rip), %rcx
	movl	$1, %esi
	movl	%ebx, %edx
	callq	_hx509_err
LBB0_16:
	movq	-56(%rbp), %rdi
	callq	_rk_xfree
	movl	-28(%rbp), %edi
	callq	_hx509_lock_free
	leaq	-72(%rbp), %rdi
	callq	_hx509_certs_free
	leaq	-112(%rbp), %rdi
	callq	_der_free_oid
	movq	8(%r14), %rdi
	movq	-88(%rbp), %rsi
	movq	-80(%rbp), %rdx
	callq	__hx509_write_file
	testl	%eax, %eax
	je	LBB0_18
## %bb.17:
	leaq	L_.str.7(%rip), %rsi
	movl	$1, %edi
	movl	%eax, %edx
	xorl	%eax, %eax
	callq	_errx
LBB0_18:
	leaq	-88(%rbp), %rdi
	callq	_der_free_octet_string
	xorl	%eax, %eax
	addq	$88, %rsp
	popq	%rbx
	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	"hx509_cms_unwrap_ContentInfo: %d"

	.comm	_asn1_oid_id_pkcs7_envelopedData,4,2 ## @asn1_oid_id_pkcs7_envelopedData
L_.str.2:                               ## @.str.2
	.asciz	"Content is not SignedData"

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

L_.str.4:                               ## @.str.4
	.asciz	"hx509_certs_init: MEMORY: %d"

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

	.comm	_HX509_CMS_UE_ALLOW_WEAK,4,2    ## @HX509_CMS_UE_ALLOW_WEAK
L_.str.6:                               ## @.str.6
	.asciz	"hx509_cms_unenvelope"

L_.str.7:                               ## @.str.7
	.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_unenvelope                 ; -- Begin function cms_unenvelope
	.p2align	2
_cms_unenvelope:                        ; @cms_unenvelope
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #144
	.cfi_def_cfa_offset 144
	stp	x22, x21, [sp, #96]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #112]            ; 16-byte Folded Spill
	stp	x29, x30, [sp, #128]            ; 16-byte Folded Spill
	add	x29, sp, #128
	.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, x2
	mov	x20, x0
	stp	xzr, xzr, [x29, #-48]
Lloh0:
	adrp	x21, _context@GOTPAGE
Lloh1:
	ldr	x21, [x21, _context@GOTPAGEOFF]
	ldr	w0, [x21]
	add	x1, sp, #28
	bl	_hx509_lock_init
	ldr	w0, [sp, #28]
	add	x1, x20, #24
	bl	_lock_strings
	ldr	x0, [x19]
	add	x1, sp, #32
	add	x2, sp, #40
	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:
	ldp	x8, x9, [sp, #32]
	stp	x8, x9, [sp, #48]
	ldr	x8, [x20, #16]
	cbz	x8, LBB0_8
; %bb.3:
	add	x0, sp, #48
	add	x1, sp, #8
	add	x2, sp, #64
	mov	x3, #0
	bl	_hx509_cms_unwrap_ContentInfo
                                        ; kill: def $w0 killed $w0 def $x0
	cbz	w0, LBB0_5
; %bb.4:
	str	x0, [sp]
Lloh4:
	adrp	x1, l_.str.1@PAGE
Lloh5:
	add	x1, x1, l_.str.1@PAGEOFF
	mov	w0, #1
	bl	_errx
LBB0_5:
Lloh6:
	adrp	x1, _asn1_oid_id_pkcs7_envelopedData@GOTPAGE
Lloh7:
	ldr	x1, [x1, _asn1_oid_id_pkcs7_envelopedData@GOTPAGEOFF]
	add	x0, sp, #8
	bl	_der_heim_oid_cmp
	cbz	x0, LBB0_7
; %bb.6:
Lloh8:
	adrp	x1, l_.str.2@PAGE
Lloh9:
	add	x1, x1, l_.str.2@PAGEOFF
	mov	w0, #1
	bl	_errx
LBB0_7:
	add	x0, sp, #8
	bl	_der_free_oid
	ldr	q0, [sp, #64]
	str	q0, [sp, #48]
LBB0_8:
	ldr	w0, [x21]
Lloh10:
	adrp	x1, l_.str.3@PAGE
Lloh11:
	add	x1, x1, l_.str.3@PAGEOFF
	add	x4, sp, #8
	mov	w2, #0
	mov	x3, #0
	bl	_hx509_certs_init
                                        ; kill: def $w0 killed $w0 def $x0
	cbz	w0, LBB0_10
; %bb.9:
	str	x0, [sp]
Lloh12:
	adrp	x1, l_.str.4@PAGE
Lloh13:
	add	x1, x1, l_.str.4@PAGEOFF
	mov	w0, #1
	bl	_errx
LBB0_10:
	ldr	w0, [x21]
	ldr	w2, [sp, #8]
	add	x4, x20, #8
	ldr	w3, [sp, #28]
Lloh14:
	adrp	x1, l_.str.5@PAGE
Lloh15:
	add	x1, x1, l_.str.5@PAGEOFF
	bl	_certs_strings
	ldr	x8, [x20]
Lloh16:
	adrp	x9, _HX509_CMS_UE_ALLOW_WEAK@GOTPAGE
Lloh17:
	ldr	x9, [x9, _HX509_CMS_UE_ALLOW_WEAK@GOTPAGEOFF]
Lloh18:
	ldr	w9, [x9]
	cmp	x8, #0
	csel	w2, wzr, w9, eq
	ldr	w0, [x21]
	ldr	w1, [sp, #8]
	ldp	x3, x4, [sp, #48]
	add	x8, sp, #64
	str	x8, [sp]
	sub	x7, x29, #48
	mov	x5, #0
	mov	w6, #0
	bl	_hx509_cms_unenvelope
	mov	x20, x0
	ldr	x8, [sp, #48]
	ldr	x9, [sp, #32]
	cmp	x8, x9
	b.eq	LBB0_12
; %bb.11:
	add	x0, sp, #48
	bl	_der_free_octet_string
LBB0_12:
	cbz	w20, LBB0_14
; %bb.13:
	ldr	w0, [x21]
Lloh19:
	adrp	x3, l_.str.6@PAGE
Lloh20:
	add	x3, x3, l_.str.6@PAGEOFF
	mov	w1, #1
	mov	x2, x20
	bl	_hx509_err
LBB0_14:
	ldr	x0, [sp, #32]
	bl	_rk_xfree
	ldr	w0, [sp, #28]
	bl	_hx509_lock_free
	add	x0, sp, #8
	bl	_hx509_certs_free
	sub	x0, x29, #48
	bl	_der_free_oid
	ldr	x0, [x19, #8]
	ldp	x1, x2, [sp, #64]
	bl	__hx509_write_file
                                        ; kill: def $w0 killed $w0 def $x0
	cbz	w0, LBB0_16
; %bb.15:
	str	x0, [sp]
Lloh21:
	adrp	x1, l_.str.7@PAGE
Lloh22:
	add	x1, x1, l_.str.7@PAGEOFF
	mov	w0, #1
	bl	_errx
LBB0_16:
	add	x0, sp, #64
	bl	_der_free_octet_string
	mov	w0, #0
	ldp	x29, x30, [sp, #128]            ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #112]            ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #96]             ; 16-byte Folded Reload
	add	sp, sp, #144
	ret
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpAdd	Lloh2, Lloh3
	.loh AdrpAdd	Lloh4, Lloh5
	.loh AdrpLdrGot	Lloh6, Lloh7
	.loh AdrpAdd	Lloh8, Lloh9
	.loh AdrpAdd	Lloh10, Lloh11
	.loh AdrpAdd	Lloh12, Lloh13
	.loh AdrpLdrGotLdr	Lloh16, Lloh17, Lloh18
	.loh AdrpAdd	Lloh14, Lloh15
	.loh AdrpAdd	Lloh19, Lloh20
	.loh AdrpAdd	Lloh21, Lloh22
	.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	"hx509_cms_unwrap_ContentInfo: %d"

	.comm	_asn1_oid_id_pkcs7_envelopedData,4,2 ; @asn1_oid_id_pkcs7_envelopedData
l_.str.2:                               ; @.str.2
	.asciz	"Content is not SignedData"

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

l_.str.4:                               ; @.str.4
	.asciz	"hx509_certs_init: MEMORY: %d"

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

	.comm	_HX509_CMS_UE_ALLOW_WEAK,4,2    ; @HX509_CMS_UE_ALLOW_WEAK
l_.str.6:                               ; @.str.6
	.asciz	"hx509_cms_unenvelope"

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

.subsections_via_symbols
