	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_cms_create_sd                  ## -- Begin function cms_create_sd
	.p2align	4, 0x90
_cms_create_sd:                         ## @cms_create_sd
	.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	$120, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdx, %rbx
	movl	%esi, %r12d
	movq	%rdi, %r15
	movq	$0, -128(%rbp)
	movq	$0, -96(%rbp)
	movq	$0, -72(%rbp)
	leaq	-84(%rbp), %rdi
	xorl	%esi, %esi
	movl	$4, %edx
	callq	_memset
	movq	(%rbx), %r14
	cmpl	$1, %r12d
	jg	LBB0_3
## %bb.1:
	cmpq	$0, 8(%r15)
	leaq	L_.str.2(%rip), %rax
	leaq	L_.str.1(%rip), %rcx
	cmoveq	%rax, %rcx
	leaq	L_.str(%rip), %rsi
	leaq	-72(%rbp), %rdi
	movq	%r14, %rdx
	callq	_asprintf
	cmpq	$0, -72(%rbp)
	jne	LBB0_4
## %bb.2:
	leaq	L_.str.3(%rip), %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	callq	_errx
	jmp	LBB0_4
LBB0_3:
	movq	8(%rbx), %rax
	movq	%rax, -72(%rbp)
LBB0_4:
	movq	_context@GOTPCREL(%rip), %rbx
	movl	(%rbx), %edi
	leaq	-44(%rbp), %rsi
	callq	_hx509_lock_init
	movl	-44(%rbp), %edi
	leaq	96(%r15), %rsi
	callq	_lock_strings
	movl	(%rbx), %edi
	leaq	L_.str.4(%rip), %rsi
	leaq	-120(%rbp), %r8
	xorl	%edx, %edx
	xorl	%ecx, %ecx
	callq	_hx509_certs_init
	testl	%eax, %eax
	je	LBB0_6
## %bb.5:
	movl	(%rbx), %edi
	leaq	L_.str.5(%rip), %rcx
	movl	$1, %esi
	movl	%eax, %edx
	xorl	%eax, %eax
	callq	_hx509_err
LBB0_6:
	movl	(%rbx), %edi
	leaq	L_.str.6(%rip), %rsi
	leaq	-112(%rbp), %r8
	xorl	%edx, %edx
	xorl	%ecx, %ecx
	callq	_hx509_certs_init
	testl	%eax, %eax
	je	LBB0_8
## %bb.7:
	movl	(%rbx), %edi
	leaq	L_.str.5(%rip), %rcx
	movl	$1, %esi
	movl	%eax, %edx
	xorl	%eax, %eax
	callq	_hx509_err
LBB0_8:
	movl	(%rbx), %edi
	movq	-120(%rbp), %rdx
	movl	-44(%rbp), %ecx
	leaq	88(%r15), %r8
	leaq	L_.str.7(%rip), %rsi
	callq	_certs_strings
	movl	(%rbx), %edi
	movq	-112(%rbp), %rdx
	movl	-44(%rbp), %ecx
	leaq	80(%r15), %r8
	leaq	L_.str.8(%rip), %rsi
	callq	_certs_strings
	cmpq	$0, 72(%r15)
	movq	%r14, -144(%rbp)                ## 8-byte Spill
	je	LBB0_12
## %bb.9:
	leaq	72(%r15), %r14
	movl	(%rbx), %edi
	leaq	L_.str.9(%rip), %rsi
	leaq	-104(%rbp), %r8
	xorl	%edx, %edx
	xorl	%ecx, %ecx
	callq	_hx509_certs_init
	testl	%eax, %eax
	je	LBB0_11
## %bb.10:
	movl	(%rbx), %edi
	leaq	L_.str.5(%rip), %rcx
	movl	$1, %esi
	movl	%eax, %edx
	xorl	%eax, %eax
	callq	_hx509_err
LBB0_11:
	movl	(%rbx), %edi
	movq	-104(%rbp), %rdx
	movl	-44(%rbp), %ecx
	leaq	L_.str.10(%rip), %rsi
	movq	%r14, %r8
	callq	_certs_strings
	jmp	LBB0_13
LBB0_12:
	movq	$0, -104(%rbp)
LBB0_13:
	xorl	%r14d, %r14d
	cmpq	$0, (%r15)
	movl	$0, %ebx
	je	LBB0_15
## %bb.14:
	movq	_HX509_CMS_SIGNATURE_DETACHED@GOTPCREL(%rip), %rax
	movl	(%rax), %ebx
LBB0_15:
	cmpq	$0, 64(%r15)
	movl	$0, %r13d
	je	LBB0_17
## %bb.16:
	movq	_HX509_CMS_SIGNATURE_ID_NAME@GOTPCREL(%rip), %rax
	movl	(%rax), %r13d
LBB0_17:
	movq	56(%r15), %rax
	testq	%rax, %rax
	jne	LBB0_19
## %bb.18:
	movq	_HX509_CMS_SIGNATURE_NO_SIGNER@GOTPCREL(%rip), %rcx
	movl	(%rcx), %r14d
LBB0_19:
	testq	%rax, %rax
	je	LBB0_26
## %bb.20:
	movq	_context@GOTPCREL(%rip), %r12
	movl	(%r12), %edi
	leaq	-80(%rbp), %rsi
	callq	_hx509_query_alloc
	testl	%eax, %eax
	je	LBB0_22
## %bb.21:
	leaq	L_.str.11(%rip), %rsi
	movl	$1, %edi
	movl	%eax, %edx
	xorl	%eax, %eax
	callq	_errx
LBB0_22:
	movq	-80(%rbp), %rdi
	movq	_HX509_QUERY_OPTION_PRIVATE_KEY@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	callq	_hx509_query_match_option
	movq	-80(%rbp), %rdi
	movq	_HX509_QUERY_OPTION_KU_DIGITALSIGNATURE@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	callq	_hx509_query_match_option
	movl	52(%r15), %esi
	testl	%esi, %esi
	je	LBB0_24
## %bb.23:
	movq	-80(%rbp), %rdi
	callq	_hx509_query_match_friendly_name
LBB0_24:
	movl	(%r12), %edi
	movq	-120(%rbp), %rsi
	movq	-80(%rbp), %rdx
	leaq	-96(%rbp), %rcx
	callq	_hx509_certs_filter
	movq	%r12, %rcx
	movl	%eax, %r12d
	movl	(%rcx), %edi
	movq	-80(%rbp), %rsi
	callq	_hx509_query_free
	testl	%r12d, %r12d
	je	LBB0_26
## %bb.25:
	movq	_context@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	leaq	L_.str.12(%rip), %rcx
	movl	$1, %esi
	movl	%r12d, %edx
	xorl	%eax, %eax
	callq	_hx509_err
LBB0_26:
	orl	%ebx, %r13d
	xorl	%r12d, %r12d
	cmpl	$0, 48(%r15)
	movl	$0, %eax
	jne	LBB0_28
## %bb.27:
	movq	_HX509_CMS_SIGNATURE_NO_CERTS@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
LBB0_28:
	orl	%r14d, %r13d
	cmpq	$0, 40(%r15)
	je	LBB0_30
## %bb.29:
	movq	_HX509_CMS_SIGNATURE_LEAF_ONLY@GOTPCREL(%rip), %rcx
	movl	(%rcx), %r12d
LBB0_30:
	orl	%eax, %r13d
	leaq	-136(%rbp), %rsi
	leaq	-152(%rbp), %rdx
	movq	-144(%rbp), %rbx                ## 8-byte Reload
	movq	%rbx, %rdi
	callq	_rk_undumpdata
	testl	%eax, %eax
	je	LBB0_32
## %bb.31:
	leaq	L_.str.13(%rip), %rsi
	movl	$1, %edi
	movq	%rbx, %rdx
	movl	%eax, %ecx
	xorl	%eax, %eax
	callq	_err
LBB0_32:
	orl	%r12d, %r13d
	cmpq	$0, 32(%r15)
	movq	_context@GOTPCREL(%rip), %r12
	je	LBB0_34
## %bb.33:
	leaq	32(%r15), %rdx
	movl	(%r12), %edi
	leaq	-128(%rbp), %rsi
	callq	_peer_strings
LBB0_34:
	movl	24(%r15), %edi
	movq	_asn1_oid_id_pkcs7_data@GOTPCREL(%rip), %rsi
	leaq	-84(%rbp), %r14
	movq	%r14, %rdx
	callq	_parse_oid
	movl	(%r12), %edi
	movq	-136(%rbp), %rcx
	movq	-152(%rbp), %r8
	subq	$8, %rsp
	leaq	-56(%rbp), %rax
	movl	%r13d, %esi
	movq	%r14, %rdx
	xorl	%r9d, %r9d
	pushq	%rax
	pushq	-112(%rbp)
	pushq	-104(%rbp)
	pushq	-128(%rbp)
	pushq	-96(%rbp)
	callq	_hx509_cms_create_signed
	addq	$48, %rsp
	testl	%eax, %eax
	je	LBB0_36
## %bb.35:
	movl	(%r12), %edi
	leaq	L_.str.14(%rip), %rcx
	movl	$1, %esi
	movl	%eax, %edx
	movl	%eax, %r8d
	xorl	%eax, %eax
	callq	_hx509_err
LBB0_36:
	leaq	-104(%rbp), %rdi
	callq	_hx509_certs_free
	leaq	-112(%rbp), %rdi
	callq	_hx509_certs_free
	leaq	-120(%rbp), %rdi
	callq	_hx509_certs_free
	movq	-136(%rbp), %rdi
	callq	_rk_xfree
	movl	-44(%rbp), %edi
	callq	_hx509_lock_free
	movq	-128(%rbp), %rdi
	callq	_hx509_peer_info_free
	leaq	-84(%rbp), %rdi
	callq	_der_free_oid
	cmpq	$0, 16(%r15)
	je	LBB0_40
## %bb.37:
	movq	_asn1_oid_id_pkcs7_signedData@GOTPCREL(%rip), %rdi
	leaq	-56(%rbp), %rsi
	leaq	-64(%rbp), %rdx
	callq	_hx509_cms_wrap_ContentInfo
	testl	%eax, %eax
	je	LBB0_39
## %bb.38:
	leaq	L_.str.15(%rip), %rsi
	movl	$1, %edi
	movl	%eax, %edx
	xorl	%eax, %eax
	callq	_errx
LBB0_39:
	leaq	-56(%rbp), %rdi
	callq	_der_free_octet_string
	movq	-64(%rbp), %rax
	movq	%rax, -56(%rbp)
LBB0_40:
	cmpq	$0, 8(%r15)
	je	LBB0_48
## %bb.41:
	movq	$0, -64(%rbp)
	cmpq	$0, (%r15)
	leaq	L_.str.18(%rip), %rax
	leaq	L_.str.17(%rip), %rdx
	cmoveq	%rax, %rdx
	leaq	L_.str.16(%rip), %rsi
	leaq	-64(%rbp), %rdi
	callq	_hx509_pem_add_header
	movq	-96(%rbp), %rsi
	testq	%rsi, %rsi
	je	LBB0_44
## %bb.42:
	movl	(%r12), %edi
	movq	_print_signer@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	-64(%rbp), %rcx
	callq	_hx509_certs_iter_f
	testl	%eax, %eax
	je	LBB0_44
## %bb.43:
	movl	(%r12), %edi
	leaq	L_.str.19(%rip), %rcx
	movl	$1, %esi
	movl	%eax, %edx
	xorl	%eax, %eax
	callq	_hx509_err
LBB0_44:
	movq	-72(%rbp), %rdi
	leaq	L_.str.20(%rip), %rsi
	callq	_fopen
	movq	%rax, %rbx
	testq	%rax, %rax
	jne	LBB0_46
## %bb.45:
	movq	-72(%rbp), %rdx
	leaq	L_.str.21(%rip), %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	callq	_err
LBB0_46:
	movl	(%r12), %edi
	movq	-64(%rbp), %rdx
	movl	-56(%rbp), %r8d
	movl	-52(%rbp), %r9d
	leaq	L_.str.22(%rip), %rsi
	movq	%rbx, %rcx
	callq	_hx509_pem_write
	movl	%eax, %r14d
	movq	%rbx, %rdi
	callq	_fclose
	movq	-64(%rbp), %rdi
	callq	_hx509_pem_free_header
	testl	%r14d, %r14d
	je	LBB0_51
## %bb.47:
	leaq	L_.str.23(%rip), %rsi
	movl	$1, %edi
	movl	%r14d, %edx
	jmp	LBB0_50
LBB0_48:
	movq	-72(%rbp), %rdi
	movl	-56(%rbp), %esi
	movl	-52(%rbp), %edx
	callq	__hx509_write_file
	testl	%eax, %eax
	je	LBB0_51
## %bb.49:
	leaq	L_.str.24(%rip), %rsi
	movl	$1, %edi
	movl	%eax, %edx
LBB0_50:
	xorl	%eax, %eax
	callq	_errx
LBB0_51:
	leaq	-96(%rbp), %rdi
	callq	_hx509_certs_free
	movl	-56(%rbp), %edi
	callq	_free
	xorl	%eax, %eax
	addq	$120, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"%s.%s"

L_.str.1:                               ## @.str.1
	.asciz	"pem"

L_.str.2:                               ## @.str.2
	.asciz	"cms-signeddata"

L_.str.3:                               ## @.str.3
	.asciz	"out of memory"

	.comm	_context,4,2                    ## @context
L_.str.4:                               ## @.str.4
	.asciz	"MEMORY:cert-store"

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

L_.str.6:                               ## @.str.6
	.asciz	"MEMORY:cert-pool"

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

L_.str.8:                               ## @.str.8
	.asciz	"pool"

L_.str.9:                               ## @.str.9
	.asciz	"MEMORY:cert-anchors"

L_.str.10:                              ## @.str.10
	.asciz	"anchors"

	.comm	_HX509_CMS_SIGNATURE_DETACHED,4,2 ## @HX509_CMS_SIGNATURE_DETACHED
	.comm	_HX509_CMS_SIGNATURE_ID_NAME,4,2 ## @HX509_CMS_SIGNATURE_ID_NAME
	.comm	_HX509_CMS_SIGNATURE_NO_SIGNER,4,2 ## @HX509_CMS_SIGNATURE_NO_SIGNER
L_.str.11:                              ## @.str.11
	.asciz	"hx509_query_alloc: %d"

	.comm	_HX509_QUERY_OPTION_PRIVATE_KEY,4,2 ## @HX509_QUERY_OPTION_PRIVATE_KEY
	.comm	_HX509_QUERY_OPTION_KU_DIGITALSIGNATURE,4,2 ## @HX509_QUERY_OPTION_KU_DIGITALSIGNATURE
L_.str.12:                              ## @.str.12
	.asciz	"hx509_certs_find"

	.comm	_HX509_CMS_SIGNATURE_NO_CERTS,4,2 ## @HX509_CMS_SIGNATURE_NO_CERTS
	.comm	_HX509_CMS_SIGNATURE_LEAF_ONLY,4,2 ## @HX509_CMS_SIGNATURE_LEAF_ONLY
L_.str.13:                              ## @.str.13
	.asciz	"map_file: %s: %d"

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

	.comm	_asn1_oid_id_pkcs7_signedData,4,2 ## @asn1_oid_id_pkcs7_signedData
L_.str.15:                              ## @.str.15
	.asciz	"hx509_cms_wrap_ContentInfo: %d"

L_.str.16:                              ## @.str.16
	.asciz	"Content-disposition"

L_.str.17:                              ## @.str.17
	.asciz	"detached"

L_.str.18:                              ## @.str.18
	.asciz	"inline"

	.comm	_print_signer,4,2               ## @print_signer
L_.str.19:                              ## @.str.19
	.asciz	"print signer"

L_.str.20:                              ## @.str.20
	.asciz	"w"

L_.str.21:                              ## @.str.21
	.asciz	"open %s"

L_.str.22:                              ## @.str.22
	.asciz	"CMS SIGNEDDATA"

L_.str.23:                              ## @.str.23
	.asciz	"hx509_pem_write: %d"

L_.str.24:                              ## @.str.24
	.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_sd                  ; -- Begin function cms_create_sd
	.p2align	2
_cms_create_sd:                         ; @cms_create_sd
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #192
	.cfi_def_cfa_offset 192
	stp	x24, x23, [sp, #128]            ; 16-byte Folded Spill
	stp	x22, x21, [sp, #144]            ; 16-byte Folded Spill
	stp	x20, x19, [sp, #160]            ; 16-byte Folded Spill
	stp	x29, x30, [sp, #176]            ; 16-byte Folded Spill
	add	x29, sp, #176
	.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	x21, x2
	mov	x22, x1
	mov	x19, x0
	stur	xzr, [x29, #-64]
	str	xzr, [sp, #56]
	str	xzr, [sp, #32]
	sub	x0, x29, #52
	mov	w1, #0
	mov	w2, #4
	bl	_memset
	ldr	x20, [x21]
	cmp	w22, #1
	b.gt	LBB0_3
; %bb.1:
	ldr	x8, [x19, #8]
Lloh0:
	adrp	x9, l_.str.1@PAGE
Lloh1:
	add	x9, x9, l_.str.1@PAGEOFF
Lloh2:
	adrp	x10, l_.str.2@PAGE
Lloh3:
	add	x10, x10, l_.str.2@PAGEOFF
	cmp	x8, #0
	csel	x3, x10, x9, eq
Lloh4:
	adrp	x1, l_.str@PAGE
Lloh5:
	add	x1, x1, l_.str@PAGEOFF
	add	x0, sp, #32
	mov	x2, x20
	bl	_asprintf
	ldr	x8, [sp, #32]
	cbnz	x8, LBB0_4
; %bb.2:
Lloh6:
	adrp	x1, l_.str.3@PAGE
Lloh7:
	add	x1, x1, l_.str.3@PAGEOFF
	mov	w0, #1
	bl	_errx
	b	LBB0_4
LBB0_3:
	ldr	x8, [x21, #8]
	str	x8, [sp, #32]
LBB0_4:
Lloh8:
	adrp	x22, _context@GOTPAGE
Lloh9:
	ldr	x22, [x22, _context@GOTPAGEOFF]
	ldr	w0, [x22]
	sub	x1, x29, #84
	bl	_hx509_lock_init
	ldur	w0, [x29, #-84]
	add	x1, x19, #96
	bl	_lock_strings
	ldr	w0, [x22]
Lloh10:
	adrp	x1, l_.str.4@PAGE
Lloh11:
	add	x1, x1, l_.str.4@PAGEOFF
	add	x4, sp, #80
	mov	w2, #0
	mov	x3, #0
	bl	_hx509_certs_init
	cbz	w0, LBB0_6
; %bb.5:
	mov	x2, x0
	ldr	w0, [x22]
Lloh12:
	adrp	x3, l_.str.5@PAGE
Lloh13:
	add	x3, x3, l_.str.5@PAGEOFF
	mov	w1, #1
	bl	_hx509_err
LBB0_6:
	ldr	w0, [x22]
Lloh14:
	adrp	x1, l_.str.6@PAGE
Lloh15:
	add	x1, x1, l_.str.6@PAGEOFF
	add	x4, sp, #72
	mov	w2, #0
	mov	x3, #0
	bl	_hx509_certs_init
	cbz	w0, LBB0_8
; %bb.7:
	mov	x2, x0
	ldr	w0, [x22]
Lloh16:
	adrp	x3, l_.str.5@PAGE
Lloh17:
	add	x3, x3, l_.str.5@PAGEOFF
	mov	w1, #1
	bl	_hx509_err
LBB0_8:
	ldr	w0, [x22]
	ldr	x2, [sp, #80]
	add	x4, x19, #88
	ldur	w3, [x29, #-84]
Lloh18:
	adrp	x1, l_.str.7@PAGE
Lloh19:
	add	x1, x1, l_.str.7@PAGEOFF
	bl	_certs_strings
	ldr	w0, [x22]
	ldr	x2, [sp, #72]
	add	x4, x19, #80
	ldur	w3, [x29, #-84]
Lloh20:
	adrp	x1, l_.str.8@PAGE
Lloh21:
	add	x1, x1, l_.str.8@PAGEOFF
	bl	_certs_strings
	mov	x21, x19
	ldr	x8, [x21, #72]!
	cbz	x8, LBB0_12
; %bb.9:
	ldr	w0, [x22]
Lloh22:
	adrp	x1, l_.str.9@PAGE
Lloh23:
	add	x1, x1, l_.str.9@PAGEOFF
	add	x4, sp, #64
	mov	w2, #0
	mov	x3, #0
	bl	_hx509_certs_init
	cbz	w0, LBB0_11
; %bb.10:
	mov	x2, x0
	ldr	w0, [x22]
Lloh24:
	adrp	x3, l_.str.5@PAGE
Lloh25:
	add	x3, x3, l_.str.5@PAGEOFF
	mov	w1, #1
	bl	_hx509_err
LBB0_11:
	ldr	w0, [x22]
	ldr	x2, [sp, #64]
	ldur	w3, [x29, #-84]
Lloh26:
	adrp	x1, l_.str.10@PAGE
Lloh27:
	add	x1, x1, l_.str.10@PAGEOFF
	mov	x4, x21
	bl	_certs_strings
	b	LBB0_13
LBB0_12:
	str	xzr, [sp, #64]
LBB0_13:
Lloh28:
	adrp	x8, _HX509_CMS_SIGNATURE_DETACHED@GOTPAGE
Lloh29:
	ldr	x8, [x8, _HX509_CMS_SIGNATURE_DETACHED@GOTPAGEOFF]
	ldr	x9, [x19]
Lloh30:
	ldr	w8, [x8]
	cmp	x9, #0
	csel	w8, wzr, w8, eq
	ldp	x10, x9, [x19, #56]
	cmp	x9, #0
Lloh31:
	adrp	x9, _HX509_CMS_SIGNATURE_ID_NAME@GOTPAGE
Lloh32:
	ldr	x9, [x9, _HX509_CMS_SIGNATURE_ID_NAME@GOTPAGEOFF]
Lloh33:
	ldr	w9, [x9]
	csel	w9, wzr, w9, eq
	orr	w8, w9, w8
Lloh34:
	adrp	x9, _HX509_CMS_SIGNATURE_NO_SIGNER@GOTPAGE
Lloh35:
	ldr	x9, [x9, _HX509_CMS_SIGNATURE_NO_SIGNER@GOTPAGEOFF]
Lloh36:
	ldr	w9, [x9]
	cmp	x10, #0
	csel	w9, w9, wzr, eq
	orr	w23, w8, w9
	cbz	x10, LBB0_20
; %bb.14:
	ldr	w0, [x22]
	sub	x1, x29, #80
	bl	_hx509_query_alloc
                                        ; kill: def $w0 killed $w0 def $x0
	cbz	w0, LBB0_16
; %bb.15:
	str	x0, [sp]
Lloh37:
	adrp	x1, l_.str.11@PAGE
Lloh38:
	add	x1, x1, l_.str.11@PAGEOFF
	mov	w0, #1
	bl	_errx
LBB0_16:
	ldur	x0, [x29, #-80]
Lloh39:
	adrp	x8, _HX509_QUERY_OPTION_PRIVATE_KEY@GOTPAGE
Lloh40:
	ldr	x8, [x8, _HX509_QUERY_OPTION_PRIVATE_KEY@GOTPAGEOFF]
Lloh41:
	ldr	w1, [x8]
	bl	_hx509_query_match_option
	ldur	x0, [x29, #-80]
Lloh42:
	adrp	x8, _HX509_QUERY_OPTION_KU_DIGITALSIGNATURE@GOTPAGE
Lloh43:
	ldr	x8, [x8, _HX509_QUERY_OPTION_KU_DIGITALSIGNATURE@GOTPAGEOFF]
Lloh44:
	ldr	w1, [x8]
	bl	_hx509_query_match_option
	ldr	w1, [x19, #52]
	cbz	w1, LBB0_18
; %bb.17:
	ldur	x0, [x29, #-80]
	bl	_hx509_query_match_friendly_name
LBB0_18:
	ldr	w0, [x22]
	ldr	x1, [sp, #80]
	ldur	x2, [x29, #-80]
	add	x3, sp, #56
	bl	_hx509_certs_filter
	mov	x21, x0
	ldr	w0, [x22]
	ldur	x1, [x29, #-80]
	bl	_hx509_query_free
	cbz	w21, LBB0_20
; %bb.19:
	ldr	w0, [x22]
Lloh45:
	adrp	x3, l_.str.12@PAGE
Lloh46:
	add	x3, x3, l_.str.12@PAGEOFF
	mov	w1, #1
	mov	x2, x21
	bl	_hx509_err
LBB0_20:
Lloh47:
	adrp	x8, _HX509_CMS_SIGNATURE_NO_CERTS@GOTPAGE
Lloh48:
	ldr	x8, [x8, _HX509_CMS_SIGNATURE_NO_CERTS@GOTPAGEOFF]
	ldr	w9, [x19, #48]
Lloh49:
	ldr	w8, [x8]
	cmp	w9, #0
	csel	w8, w8, wzr, eq
	orr	w8, w23, w8
	ldr	x9, [x19, #40]
Lloh50:
	adrp	x10, _HX509_CMS_SIGNATURE_LEAF_ONLY@GOTPAGE
Lloh51:
	ldr	x10, [x10, _HX509_CMS_SIGNATURE_LEAF_ONLY@GOTPAGEOFF]
Lloh52:
	ldr	w10, [x10]
	cmp	x9, #0
	csel	w9, wzr, w10, eq
	orr	w21, w8, w9
	add	x1, sp, #40
	add	x2, sp, #48
	mov	x0, x20
	bl	_rk_undumpdata
                                        ; kill: def $w0 killed $w0 def $x0
	cbz	w0, LBB0_22
; %bb.21:
	str	x0, [sp]
Lloh53:
	adrp	x1, l_.str.13@PAGE
Lloh54:
	add	x1, x1, l_.str.13@PAGEOFF
	mov	w0, #1
	mov	x2, x20
	bl	_err
LBB0_22:
	mov	x2, x19
	ldr	x8, [x2, #32]!
	cbz	x8, LBB0_24
; %bb.23:
	ldr	w0, [x22]
	sub	x1, x29, #64
	bl	_peer_strings
LBB0_24:
	ldr	w0, [x19, #24]
Lloh55:
	adrp	x1, _asn1_oid_id_pkcs7_data@GOTPAGE
Lloh56:
	ldr	x1, [x1, _asn1_oid_id_pkcs7_data@GOTPAGEOFF]
	sub	x2, x29, #52
	bl	_parse_oid
	ldr	w0, [x22]
	ldp	x3, x4, [sp, #40]
	ldp	x6, x8, [sp, #56]
	ldur	x7, [x29, #-64]
	ldr	x9, [sp, #72]
	sub	x10, x29, #72
	stp	x9, x10, [sp, #8]
	str	x8, [sp]
	sub	x2, x29, #52
	mov	x1, x21
	mov	x5, #0
	bl	_hx509_cms_create_signed
	cbz	w0, LBB0_26
; %bb.25:
	mov	x2, x0
	ldr	w0, [x22]
	str	x2, [sp]
Lloh57:
	adrp	x3, l_.str.14@PAGE
Lloh58:
	add	x3, x3, l_.str.14@PAGEOFF
	mov	w1, #1
                                        ; kill: def $w2 killed $w2 killed $x2
	bl	_hx509_err
LBB0_26:
	add	x0, sp, #64
	bl	_hx509_certs_free
	add	x0, sp, #72
	bl	_hx509_certs_free
	add	x0, sp, #80
	bl	_hx509_certs_free
	ldr	x0, [sp, #40]
	bl	_rk_xfree
	ldur	w0, [x29, #-84]
	bl	_hx509_lock_free
	ldur	x0, [x29, #-64]
	bl	_hx509_peer_info_free
	sub	x0, x29, #52
	bl	_der_free_oid
	ldr	x8, [x19, #16]
	cbz	x8, LBB0_30
; %bb.27:
Lloh59:
	adrp	x0, _asn1_oid_id_pkcs7_signedData@GOTPAGE
Lloh60:
	ldr	x0, [x0, _asn1_oid_id_pkcs7_signedData@GOTPAGEOFF]
	sub	x1, x29, #72
	add	x2, sp, #24
	bl	_hx509_cms_wrap_ContentInfo
                                        ; kill: def $w0 killed $w0 def $x0
	cbz	w0, LBB0_29
; %bb.28:
	str	x0, [sp]
Lloh61:
	adrp	x1, l_.str.15@PAGE
Lloh62:
	add	x1, x1, l_.str.15@PAGEOFF
	mov	w0, #1
	bl	_errx
LBB0_29:
	sub	x0, x29, #72
	bl	_der_free_octet_string
	ldr	x8, [sp, #24]
	stur	x8, [x29, #-72]
LBB0_30:
	ldr	x8, [x19, #8]
	cbz	x8, LBB0_38
; %bb.31:
	str	xzr, [sp, #24]
	ldr	x8, [x19]
Lloh63:
	adrp	x9, l_.str.17@PAGE
Lloh64:
	add	x9, x9, l_.str.17@PAGEOFF
Lloh65:
	adrp	x10, l_.str.18@PAGE
Lloh66:
	add	x10, x10, l_.str.18@PAGEOFF
	cmp	x8, #0
	csel	x2, x10, x9, eq
Lloh67:
	adrp	x1, l_.str.16@PAGE
Lloh68:
	add	x1, x1, l_.str.16@PAGEOFF
	add	x0, sp, #24
	bl	_hx509_pem_add_header
	ldr	x1, [sp, #56]
	cbz	x1, LBB0_34
; %bb.32:
	ldr	w0, [x22]
Lloh69:
	adrp	x8, _print_signer@GOTPAGE
Lloh70:
	ldr	x8, [x8, _print_signer@GOTPAGEOFF]
Lloh71:
	ldr	w2, [x8]
	ldr	x3, [sp, #24]
	bl	_hx509_certs_iter_f
	cbz	w0, LBB0_34
; %bb.33:
	mov	x2, x0
	ldr	w0, [x22]
Lloh72:
	adrp	x3, l_.str.19@PAGE
Lloh73:
	add	x3, x3, l_.str.19@PAGEOFF
	mov	w1, #1
	bl	_hx509_err
LBB0_34:
	ldr	x0, [sp, #32]
Lloh74:
	adrp	x1, l_.str.20@PAGE
Lloh75:
	add	x1, x1, l_.str.20@PAGEOFF
	bl	_fopen
	mov	x19, x0
	cbnz	x0, LBB0_36
; %bb.35:
	ldr	x2, [sp, #32]
Lloh76:
	adrp	x1, l_.str.21@PAGE
Lloh77:
	add	x1, x1, l_.str.21@PAGEOFF
	mov	w0, #1
	bl	_err
LBB0_36:
	ldr	w0, [x22]
	ldr	x2, [sp, #24]
	ldp	w4, w5, [x29, #-72]
Lloh78:
	adrp	x1, l_.str.22@PAGE
Lloh79:
	add	x1, x1, l_.str.22@PAGEOFF
	mov	x3, x19
	bl	_hx509_pem_write
	mov	x20, x0
	mov	x0, x19
	bl	_fclose
	ldr	x0, [sp, #24]
	bl	_hx509_pem_free_header
	cbz	w20, LBB0_41
; %bb.37:
	str	x20, [sp]
Lloh80:
	adrp	x1, l_.str.23@PAGE
Lloh81:
	add	x1, x1, l_.str.23@PAGEOFF
	b	LBB0_40
LBB0_38:
	ldr	x0, [sp, #32]
	ldp	w1, w2, [x29, #-72]
	bl	__hx509_write_file
                                        ; kill: def $w0 killed $w0 def $x0
	cbz	w0, LBB0_41
; %bb.39:
	str	x0, [sp]
Lloh82:
	adrp	x1, l_.str.24@PAGE
Lloh83:
	add	x1, x1, l_.str.24@PAGEOFF
LBB0_40:
	mov	w0, #1
	bl	_errx
LBB0_41:
	add	x0, sp, #56
	bl	_hx509_certs_free
	ldur	w0, [x29, #-72]
	bl	_free
	mov	w0, #0
	ldp	x29, x30, [sp, #176]            ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #160]            ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #144]            ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #128]            ; 16-byte Folded Reload
	add	sp, sp, #192
	ret
	.loh AdrpAdd	Lloh4, Lloh5
	.loh AdrpAdd	Lloh2, Lloh3
	.loh AdrpAdd	Lloh0, Lloh1
	.loh AdrpAdd	Lloh6, Lloh7
	.loh AdrpAdd	Lloh10, Lloh11
	.loh AdrpLdrGot	Lloh8, Lloh9
	.loh AdrpAdd	Lloh12, Lloh13
	.loh AdrpAdd	Lloh14, Lloh15
	.loh AdrpAdd	Lloh16, Lloh17
	.loh AdrpAdd	Lloh20, Lloh21
	.loh AdrpAdd	Lloh18, Lloh19
	.loh AdrpAdd	Lloh22, Lloh23
	.loh AdrpAdd	Lloh24, Lloh25
	.loh AdrpAdd	Lloh26, Lloh27
	.loh AdrpLdrGotLdr	Lloh34, Lloh35, Lloh36
	.loh AdrpLdrGotLdr	Lloh31, Lloh32, Lloh33
	.loh AdrpLdrGotLdr	Lloh28, Lloh29, Lloh30
	.loh AdrpAdd	Lloh37, Lloh38
	.loh AdrpLdrGotLdr	Lloh42, Lloh43, Lloh44
	.loh AdrpLdrGotLdr	Lloh39, Lloh40, Lloh41
	.loh AdrpAdd	Lloh45, Lloh46
	.loh AdrpLdrGotLdr	Lloh50, Lloh51, Lloh52
	.loh AdrpLdrGotLdr	Lloh47, Lloh48, Lloh49
	.loh AdrpAdd	Lloh53, Lloh54
	.loh AdrpLdrGot	Lloh55, Lloh56
	.loh AdrpAdd	Lloh57, Lloh58
	.loh AdrpLdrGot	Lloh59, Lloh60
	.loh AdrpAdd	Lloh61, Lloh62
	.loh AdrpAdd	Lloh67, Lloh68
	.loh AdrpAdd	Lloh65, Lloh66
	.loh AdrpAdd	Lloh63, Lloh64
	.loh AdrpLdrGotLdr	Lloh69, Lloh70, Lloh71
	.loh AdrpAdd	Lloh72, Lloh73
	.loh AdrpAdd	Lloh74, Lloh75
	.loh AdrpAdd	Lloh76, Lloh77
	.loh AdrpAdd	Lloh78, Lloh79
	.loh AdrpAdd	Lloh80, Lloh81
	.loh AdrpAdd	Lloh82, Lloh83
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"%s.%s"

l_.str.1:                               ; @.str.1
	.asciz	"pem"

l_.str.2:                               ; @.str.2
	.asciz	"cms-signeddata"

l_.str.3:                               ; @.str.3
	.asciz	"out of memory"

	.comm	_context,4,2                    ; @context
l_.str.4:                               ; @.str.4
	.asciz	"MEMORY:cert-store"

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

l_.str.6:                               ; @.str.6
	.asciz	"MEMORY:cert-pool"

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

l_.str.8:                               ; @.str.8
	.asciz	"pool"

l_.str.9:                               ; @.str.9
	.asciz	"MEMORY:cert-anchors"

l_.str.10:                              ; @.str.10
	.asciz	"anchors"

	.comm	_HX509_CMS_SIGNATURE_DETACHED,4,2 ; @HX509_CMS_SIGNATURE_DETACHED
	.comm	_HX509_CMS_SIGNATURE_ID_NAME,4,2 ; @HX509_CMS_SIGNATURE_ID_NAME
	.comm	_HX509_CMS_SIGNATURE_NO_SIGNER,4,2 ; @HX509_CMS_SIGNATURE_NO_SIGNER
l_.str.11:                              ; @.str.11
	.asciz	"hx509_query_alloc: %d"

	.comm	_HX509_QUERY_OPTION_PRIVATE_KEY,4,2 ; @HX509_QUERY_OPTION_PRIVATE_KEY
	.comm	_HX509_QUERY_OPTION_KU_DIGITALSIGNATURE,4,2 ; @HX509_QUERY_OPTION_KU_DIGITALSIGNATURE
l_.str.12:                              ; @.str.12
	.asciz	"hx509_certs_find"

	.comm	_HX509_CMS_SIGNATURE_NO_CERTS,4,2 ; @HX509_CMS_SIGNATURE_NO_CERTS
	.comm	_HX509_CMS_SIGNATURE_LEAF_ONLY,4,2 ; @HX509_CMS_SIGNATURE_LEAF_ONLY
l_.str.13:                              ; @.str.13
	.asciz	"map_file: %s: %d"

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

	.comm	_asn1_oid_id_pkcs7_signedData,4,2 ; @asn1_oid_id_pkcs7_signedData
l_.str.15:                              ; @.str.15
	.asciz	"hx509_cms_wrap_ContentInfo: %d"

l_.str.16:                              ; @.str.16
	.asciz	"Content-disposition"

l_.str.17:                              ; @.str.17
	.asciz	"detached"

l_.str.18:                              ; @.str.18
	.asciz	"inline"

	.comm	_print_signer,4,2               ; @print_signer
l_.str.19:                              ; @.str.19
	.asciz	"print signer"

l_.str.20:                              ; @.str.20
	.asciz	"w"

l_.str.21:                              ; @.str.21
	.asciz	"open %s"

l_.str.22:                              ; @.str.22
	.asciz	"CMS SIGNEDDATA"

l_.str.23:                              ; @.str.23
	.asciz	"hx509_pem_write: %d"

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

.subsections_via_symbols
