	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_CMS_SignerInfo_sign            ## -- Begin function CMS_SignerInfo_sign
	.p2align	4, 0x90
_CMS_SignerInfo_sign:                   ## @CMS_SignerInfo_sign
	.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	$24, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdi, %r12
	movq	40(%rdi), %r15
	movq	$0, -56(%rbp)
	movq	$0, -48(%rbp)
	movq	32(%rdi), %rax
	movl	(%rax), %edi
	callq	_EVP_get_digestbyobj
	xorl	%r14d, %r14d
	testq	%rax, %rax
	je	LBB0_18
## %bb.1:
	movq	%rax, %rbx
	movq	_NID_pkcs9_signingTime@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r12, %rdi
	movl	$-1, %edx
	callq	_CMS_signed_get_attr_by_NID
	testq	%rax, %rax
	jns	LBB0_3
## %bb.2:
	movq	%r12, %rdi
	xorl	%esi, %esi
	callq	_cms_add1_signingTime
	testl	%eax, %eax
	je	LBB0_17
LBB0_3:
	movq	%r12, %rdi
	callq	_CMS_si_check_attributes
	testl	%eax, %eax
	je	LBB0_17
## %bb.4:
	movq	16(%r12), %rdi
	testq	%rdi, %rdi
	je	LBB0_6
## %bb.5:
	movq	%rdi, -56(%rbp)
	jmp	LBB0_8
LBB0_6:
	movq	%r15, %rdi
	callq	_EVP_MD_CTX_reset
	movl	24(%r12), %r8d
	leaq	-56(%rbp), %rsi
	movq	%r15, %rdi
	movq	%rbx, %rdx
	xorl	%ecx, %ecx
	callq	_EVP_DigestSignInit
	testq	%rax, %rax
	jle	LBB0_17
## %bb.7:
	movq	-56(%rbp), %rdi
	movq	%rdi, 16(%r12)
LBB0_8:
	movq	_EVP_PKEY_OP_SIGN@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	_EVP_PKEY_CTRL_CMS_SIGN@GOTPCREL(%rip), %r13
	movl	(%r13), %ecx
	movl	$-1, %esi
	xorl	%r8d, %r8d
	movq	%r12, %r9
	callq	_EVP_PKEY_CTX_ctrl
	testq	%rax, %rax
	jle	LBB0_16
## %bb.9:
	movq	8(%r12), %rbx
	movq	_CMS_Attributes_Sign@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	callq	_ASN1_ITEM_rptr
	leaq	-48(%rbp), %rsi
	movq	%rbx, %rdi
	movl	%eax, %edx
	callq	_ASN1_item_i2d
	movq	-48(%rbp), %rsi
	testq	%rsi, %rsi
	je	LBB0_17
## %bb.10:
	movq	%r15, %rdi
	movl	%eax, %edx
	callq	_EVP_DigestSignUpdate
	testq	%rax, %rax
	jle	LBB0_17
## %bb.11:
	leaq	-64(%rbp), %rdx
	movq	%r15, %rdi
	xorl	%esi, %esi
	callq	_EVP_DigestSignFinal
	testq	%rax, %rax
	jle	LBB0_17
## %bb.12:
	movq	-48(%rbp), %rdi
	callq	_OPENSSL_free
	movq	-64(%rbp), %rdi
	callq	_OPENSSL_malloc
	movq	%rax, -48(%rbp)
	testq	%rax, %rax
	je	LBB0_17
## %bb.13:
	leaq	-64(%rbp), %rdx
	movq	%r15, %rdi
	movq	%rax, %rsi
	callq	_EVP_DigestSignFinal
	testq	%rax, %rax
	jle	LBB0_17
## %bb.14:
	movq	-56(%rbp), %rdi
	movq	_EVP_PKEY_OP_SIGN@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movl	(%r13), %ecx
	movl	$-1, %esi
	movl	$1, %r8d
	movq	%r12, %r9
	callq	_EVP_PKEY_CTX_ctrl
	testq	%rax, %rax
	jle	LBB0_16
## %bb.15:
	movq	%r15, %rdi
	callq	_EVP_MD_CTX_reset
	movl	(%r12), %edi
	movq	-48(%rbp), %rsi
	movq	-64(%rbp), %rdx
	callq	_ASN1_STRING_set0
	movl	$1, %r14d
	jmp	LBB0_18
LBB0_16:
	movq	_CMS_F_CMS_SIGNERINFO_SIGN@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movq	_CMS_R_CTRL_ERROR@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	callq	_CMSerr
LBB0_17:
	movq	-48(%rbp), %rdi
	callq	_OPENSSL_free
	movq	%r15, %rdi
	callq	_EVP_MD_CTX_reset
LBB0_18:
	movl	%r14d, %eax
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_NID_pkcs9_signingTime,4,2      ## @NID_pkcs9_signingTime
	.comm	_EVP_PKEY_OP_SIGN,4,2           ## @EVP_PKEY_OP_SIGN
	.comm	_EVP_PKEY_CTRL_CMS_SIGN,4,2     ## @EVP_PKEY_CTRL_CMS_SIGN
	.comm	_CMS_F_CMS_SIGNERINFO_SIGN,4,2  ## @CMS_F_CMS_SIGNERINFO_SIGN
	.comm	_CMS_R_CTRL_ERROR,4,2           ## @CMS_R_CTRL_ERROR
	.comm	_CMS_Attributes_Sign,4,2        ## @CMS_Attributes_Sign
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_CMS_SignerInfo_sign            ; -- Begin function CMS_SignerInfo_sign
	.p2align	2
_CMS_SignerInfo_sign:                   ; @CMS_SignerInfo_sign
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #96
	.cfi_def_cfa_offset 96
	stp	x24, x23, [sp, #32]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #48]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #64]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #80]             ; 16-byte Folded Spill
	add	x29, sp, #80
	.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	x20, x0
	stp	xzr, xzr, [sp, #16]
	ldp	x8, x19, [x0, #32]
	ldr	w0, [x8]
	bl	_EVP_get_digestbyobj
	cbz	x0, LBB0_18
; %bb.1:
	mov	x21, x0
Lloh0:
	adrp	x8, _NID_pkcs9_signingTime@GOTPAGE
Lloh1:
	ldr	x8, [x8, _NID_pkcs9_signingTime@GOTPAGEOFF]
Lloh2:
	ldr	w1, [x8]
	mov	x0, x20
	mov	w2, #-1
	bl	_CMS_signed_get_attr_by_NID
	tbz	x0, #63, LBB0_3
; %bb.2:
	mov	x0, x20
	mov	x1, #0
	bl	_cms_add1_signingTime
	cbz	w0, LBB0_17
LBB0_3:
	mov	x0, x20
	bl	_CMS_si_check_attributes
	cbz	w0, LBB0_17
; %bb.4:
	ldr	x0, [x20, #16]
	cbz	x0, LBB0_6
; %bb.5:
	str	x0, [sp, #24]
	b	LBB0_8
LBB0_6:
	mov	x0, x19
	bl	_EVP_MD_CTX_reset
	ldr	w4, [x20, #24]
	add	x1, sp, #24
	mov	x0, x19
	mov	x2, x21
	mov	x3, #0
	bl	_EVP_DigestSignInit
	cmp	x0, #1
	b.lt	LBB0_17
; %bb.7:
	ldr	x0, [sp, #24]
	str	x0, [x20, #16]
LBB0_8:
Lloh3:
	adrp	x22, _EVP_PKEY_OP_SIGN@GOTPAGE
Lloh4:
	ldr	x22, [x22, _EVP_PKEY_OP_SIGN@GOTPAGEOFF]
	ldr	w2, [x22]
Lloh5:
	adrp	x23, _EVP_PKEY_CTRL_CMS_SIGN@GOTPAGE
Lloh6:
	ldr	x23, [x23, _EVP_PKEY_CTRL_CMS_SIGN@GOTPAGEOFF]
	ldr	w3, [x23]
	mov	w1, #-1
	mov	w4, #0
	mov	x5, x20
	bl	_EVP_PKEY_CTX_ctrl
	cmp	x0, #1
	b.lt	LBB0_16
; %bb.9:
	ldr	x21, [x20, #8]
Lloh7:
	adrp	x8, _CMS_Attributes_Sign@GOTPAGE
Lloh8:
	ldr	x8, [x8, _CMS_Attributes_Sign@GOTPAGEOFF]
Lloh9:
	ldr	w0, [x8]
	bl	_ASN1_ITEM_rptr
	mov	x2, x0
	add	x1, sp, #16
	mov	x0, x21
	bl	_ASN1_item_i2d
	ldr	x1, [sp, #16]
	cbz	x1, LBB0_17
; %bb.10:
	mov	x2, x0
	mov	x0, x19
	bl	_EVP_DigestSignUpdate
	cmp	x0, #1
	b.lt	LBB0_17
; %bb.11:
	add	x2, sp, #8
	mov	x0, x19
	mov	x1, #0
	bl	_EVP_DigestSignFinal
	cmp	x0, #1
	b.lt	LBB0_17
; %bb.12:
	ldr	x0, [sp, #16]
	bl	_OPENSSL_free
	ldr	x0, [sp, #8]
	bl	_OPENSSL_malloc
	str	x0, [sp, #16]
	cbz	x0, LBB0_17
; %bb.13:
	mov	x1, x0
	add	x2, sp, #8
	mov	x0, x19
	bl	_EVP_DigestSignFinal
	cmp	x0, #1
	b.lt	LBB0_17
; %bb.14:
	ldr	x0, [sp, #24]
	ldr	w2, [x22]
	ldr	w3, [x23]
	mov	w1, #-1
	mov	w4, #1
	mov	x5, x20
	bl	_EVP_PKEY_CTX_ctrl
	cmp	x0, #1
	b.lt	LBB0_16
; %bb.15:
	mov	x0, x19
	bl	_EVP_MD_CTX_reset
	ldr	w0, [x20]
	ldp	x2, x1, [sp, #8]
	bl	_ASN1_STRING_set0
	mov	w0, #1
	b	LBB0_18
LBB0_16:
Lloh10:
	adrp	x8, _CMS_F_CMS_SIGNERINFO_SIGN@GOTPAGE
Lloh11:
	ldr	x8, [x8, _CMS_F_CMS_SIGNERINFO_SIGN@GOTPAGEOFF]
Lloh12:
	ldr	w0, [x8]
Lloh13:
	adrp	x8, _CMS_R_CTRL_ERROR@GOTPAGE
Lloh14:
	ldr	x8, [x8, _CMS_R_CTRL_ERROR@GOTPAGEOFF]
Lloh15:
	ldr	w1, [x8]
	bl	_CMSerr
LBB0_17:
	ldr	x0, [sp, #16]
	bl	_OPENSSL_free
	mov	x0, x19
	bl	_EVP_MD_CTX_reset
	mov	w0, #0
LBB0_18:
	ldp	x29, x30, [sp, #80]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #64]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #48]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #32]             ; 16-byte Folded Reload
	add	sp, sp, #96
	ret
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGot	Lloh5, Lloh6
	.loh AdrpLdrGot	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh7, Lloh8, Lloh9
	.loh AdrpLdrGotLdr	Lloh13, Lloh14, Lloh15
	.loh AdrpLdrGotLdr	Lloh10, Lloh11, Lloh12
	.cfi_endproc
                                        ; -- End function
	.comm	_NID_pkcs9_signingTime,4,2      ; @NID_pkcs9_signingTime
	.comm	_EVP_PKEY_OP_SIGN,4,2           ; @EVP_PKEY_OP_SIGN
	.comm	_EVP_PKEY_CTRL_CMS_SIGN,4,2     ; @EVP_PKEY_CTRL_CMS_SIGN
	.comm	_CMS_F_CMS_SIGNERINFO_SIGN,4,2  ; @CMS_F_CMS_SIGNERINFO_SIGN
	.comm	_CMS_R_CTRL_ERROR,4,2           ; @CMS_R_CTRL_ERROR
	.comm	_CMS_Attributes_Sign,4,2        ; @CMS_Attributes_Sign
.subsections_via_symbols
