	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function dh_cms_encrypt
_dh_cms_encrypt:                        ## @dh_cms_encrypt
	.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	%rdi, %r15
	movq	$0, -56(%rbp)
	callq	_CMS_RecipientInfo_get0_pkey_ctx
	testq	%rax, %rax
	je	LBB0_7
## %bb.1:
	movq	%rax, %r12
	movq	%rax, %rdi
	callq	_EVP_PKEY_CTX_get0_pkey
	movq	%rax, %r13
	xorl	%r14d, %r14d
	leaq	-64(%rbp), %rsi
	leaq	-96(%rbp), %rdx
	movq	%r15, %rdi
	xorl	%ecx, %ecx
	xorl	%r8d, %r8d
	xorl	%r9d, %r9d
	callq	_CMS_RecipientInfo_kari_get0_orig_id
	movl	$0, %ecx
	testl	%eax, %eax
	je	LBB0_28
## %bb.2:
	movq	-64(%rbp), %rcx
	leaq	-104(%rbp), %rdi
	xorl	%esi, %esi
	xorl	%edx, %edx
	callq	_X509_ALGOR_get0
	movq	-104(%rbp), %rbx
	movq	_NID_undef@GOTPCREL(%rip), %r14
	movl	(%r14), %edi
	callq	_OBJ_nid2obj
	cmpq	%rax, %rbx
	je	LBB0_8
LBB0_3:
	movq	%r12, %rdi
	callq	_EVP_PKEY_CTX_get_dh_kdf_type
	testl	%eax, %eax
	jle	LBB0_26
## %bb.4:
	movl	%eax, %ebx
	leaq	-80(%rbp), %rsi
	movq	%r12, %rdi
	callq	_EVP_PKEY_CTX_get_dh_kdf_md
	testl	%eax, %eax
	je	LBB0_26
## %bb.5:
	movq	_EVP_PKEY_DH_KDF_NONE@GOTPCREL(%rip), %rax
	movq	_EVP_PKEY_DH_KDF_X9_42@GOTPCREL(%rip), %rcx
	movl	(%rcx), %esi
	cmpl	(%rax), %ebx
	jne	LBB0_11
## %bb.6:
	movq	%r12, %rdi
	callq	_EVP_PKEY_CTX_set_dh_kdf_type
	testq	%rax, %rax
	jg	LBB0_12
	jmp	LBB0_26
LBB0_7:
	xorl	%r14d, %r14d
	jmp	LBB0_29
LBB0_8:
	movq	(%r13), %rax
	movl	(%rax), %edi
	xorl	%r14d, %r14d
	xorl	%esi, %esi
	callq	_BN_to_ASN1_INTEGER
	movl	$0, %ecx
	testq	%rax, %rax
	je	LBB0_28
## %bb.9:
	movq	%rax, %rbx
	leaq	-56(%rbp), %rsi
	movq	%rax, %rdi
	callq	_i2d_ASN1_INTEGER
	movl	%eax, %r14d
	movq	%rbx, %rdi
	callq	_ASN1_INTEGER_free
	testl	%r14d, %r14d
	jle	LBB0_26
## %bb.10:
	movq	-96(%rbp), %rdi
	movq	-56(%rbp), %rsi
	movl	%r14d, %edx
	callq	_ASN1_STRING_set0
	movq	_ASN1_STRING_FLAG_BITS_LEFT@GOTPCREL(%rip), %rax
	movl	(%rax), %ecx
	notl	%ecx
	movq	-96(%rbp), %rdx
	andl	(%rdx), %ecx
	andl	$-8, %ecx
	movl	%ecx, (%rdx)
	orl	(%rax), %ecx
	movl	%ecx, (%rdx)
	movq	$0, -56(%rbp)
	movq	-64(%rbp), %rbx
	movq	_NID_dhpublicnumber@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	callq	_OBJ_nid2obj
	movq	_V_ASN1_UNDEF@GOTPCREL(%rip), %rcx
	movl	(%rcx), %edx
	movq	%rbx, %rdi
	movq	%rax, %rsi
	xorl	%ecx, %ecx
	callq	_X509_ALGOR_set0
	movq	_NID_undef@GOTPCREL(%rip), %r14
	jmp	LBB0_3
LBB0_11:
	cmpl	%esi, %ebx
	jne	LBB0_26
LBB0_12:
	movq	%r14, %rbx
	movq	-80(%rbp), %rdi
	testq	%rdi, %rdi
	je	LBB0_14
## %bb.13:
	callq	_EVP_MD_type
	movq	_NID_sha1@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jne	LBB0_26
	jmp	LBB0_15
LBB0_14:
	xorl	%r14d, %r14d
	xorl	%eax, %eax
	callq	_EVP_sha1
	movq	%rax, -80(%rbp)
	movq	%r12, %rdi
	movq	%rax, %rsi
	callq	_EVP_PKEY_CTX_set_dh_kdf_md
	testq	%rax, %rax
	jle	LBB0_27
LBB0_15:
	leaq	-64(%rbp), %rsi
	leaq	-88(%rbp), %rdx
	movq	%r15, %rdi
	callq	_CMS_RecipientInfo_kari_get0_alg
	testl	%eax, %eax
	je	LBB0_26
## %bb.16:
	movq	%r15, %rdi
	callq	_CMS_RecipientInfo_kari_get0_ctx
	movq	%rax, %r15
	movq	%rax, %rdi
	callq	_EVP_CIPHER_CTX_type
	movl	%eax, %r13d
	movl	%eax, %edi
	callq	_OBJ_nid2obj
	movq	%r12, %rdi
	movq	%rax, %rsi
	callq	_EVP_PKEY_CTX_set0_dh_kdf_oid
	testq	%rax, %rax
	jle	LBB0_26
## %bb.17:
	movq	%r15, %rdi
	callq	_EVP_CIPHER_CTX_key_length
	movl	%eax, -68(%rbp)                 ## 4-byte Spill
	xorl	%r14d, %r14d
	xorl	%eax, %eax
	callq	_X509_ALGOR_new
	testq	%rax, %rax
	je	LBB0_27
## %bb.18:
	movq	%rax, -48(%rbp)                 ## 8-byte Spill
	movl	%r13d, %edi
	callq	_OBJ_nid2obj
	movq	-48(%rbp), %rcx                 ## 8-byte Reload
	movq	%rax, 8(%rcx)
	xorl	%r14d, %r14d
	xorl	%eax, %eax
	callq	_ASN1_TYPE_new
	movq	-48(%rbp), %rcx                 ## 8-byte Reload
	movq	%rax, (%rcx)
	testq	%rax, %rax
	je	LBB0_28
## %bb.19:
	movq	%r15, %rdi
	movq	%rax, %rsi
	callq	_EVP_CIPHER_param_to_asn1
	testq	%rax, %rax
	jle	LBB0_38
## %bb.20:
	movq	-48(%rbp), %rax                 ## 8-byte Reload
	movq	(%rax), %rdi
	callq	_ASN1_TYPE_get
	cmpq	(%rbx), %rax
	jne	LBB0_22
## %bb.21:
	movq	-48(%rbp), %rbx                 ## 8-byte Reload
	movq	(%rbx), %rdi
	callq	_ASN1_TYPE_free
	movq	$0, (%rbx)
LBB0_22:
	movq	%r12, %rdi
	movl	-68(%rbp), %esi                 ## 4-byte Reload
	callq	_EVP_PKEY_CTX_set_dh_kdf_outlen
	testq	%rax, %rax
	jle	LBB0_38
## %bb.23:
	movq	-88(%rbp), %rdi
	xorl	%r14d, %r14d
	testq	%rdi, %rdi
	je	LBB0_32
## %bb.24:
	callq	_ASN1_STRING_length
	movq	%rax, %r15
	movq	-88(%rbp), %rdi
	callq	_ASN1_STRING_get0_data
	movl	%eax, %edi
	movq	%r15, %rsi
	callq	_OPENSSL_memdup
	testq	%rax, %rax
	je	LBB0_38
## %bb.25:
	movq	%rax, %rsi
	jmp	LBB0_33
LBB0_26:
	xorl	%r14d, %r14d
LBB0_27:
	xorl	%ecx, %ecx
LBB0_28:
	movq	%rcx, %rbx
	movq	-56(%rbp), %rdi
	callq	_OPENSSL_free
	movq	%rbx, %rdi
	callq	_X509_ALGOR_free
LBB0_29:
	movl	%r14d, %eax
	addq	$72, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_32:
	xorl	%esi, %esi
	xorl	%r15d, %r15d
LBB0_33:
	movq	%r12, %rdi
	movq	%r15, %rdx
	callq	_EVP_PKEY_CTX_set0_dh_kdf_ukm
	testq	%rax, %rax
	jle	LBB0_38
## %bb.34:
	movq	$0, -56(%rbp)
	leaq	-56(%rbp), %rsi
	movq	-48(%rbp), %rdi                 ## 8-byte Reload
	callq	_i2d_X509_ALGOR
	cmpq	$0, -56(%rbp)
	je	LBB0_38
## %bb.35:
	movl	%eax, %r15d
	testl	%eax, %eax
	je	LBB0_38
## %bb.36:
	xorl	%r14d, %r14d
	xorl	%eax, %eax
	callq	_ASN1_STRING_new
	testq	%rax, %rax
	je	LBB0_38
## %bb.37:
	movq	%rax, %r12
	movq	-56(%rbp), %rsi
	movq	%rax, %rdi
	movl	%r15d, %edx
	callq	_ASN1_STRING_set0
	movq	$0, -56(%rbp)
	movq	-64(%rbp), %rbx
	movq	_NID_id_smime_alg_ESDH@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	callq	_OBJ_nid2obj
	movq	_V_ASN1_SEQUENCE@GOTPCREL(%rip), %rcx
	movl	(%rcx), %edx
	movq	%rbx, %rdi
	movq	%rax, %rsi
	movq	%r12, %rcx
	callq	_X509_ALGOR_set0
	movl	$1, %r14d
LBB0_38:
	movq	-48(%rbp), %rcx                 ## 8-byte Reload
	jmp	LBB0_28
	.cfi_endproc
                                        ## -- End function
	.comm	_NID_undef,8,3                  ## @NID_undef
	.comm	_ASN1_STRING_FLAG_BITS_LEFT,4,2 ## @ASN1_STRING_FLAG_BITS_LEFT
	.comm	_NID_dhpublicnumber,4,2         ## @NID_dhpublicnumber
	.comm	_V_ASN1_UNDEF,4,2               ## @V_ASN1_UNDEF
	.comm	_EVP_PKEY_DH_KDF_NONE,4,2       ## @EVP_PKEY_DH_KDF_NONE
	.comm	_EVP_PKEY_DH_KDF_X9_42,4,2      ## @EVP_PKEY_DH_KDF_X9_42
	.comm	_NID_sha1,8,3                   ## @NID_sha1
	.comm	_NID_id_smime_alg_ESDH,4,2      ## @NID_id_smime_alg_ESDH
	.comm	_V_ASN1_SEQUENCE,4,2            ## @V_ASN1_SEQUENCE
	.no_dead_strip	_dh_cms_encrypt
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function dh_cms_encrypt
_dh_cms_encrypt:                        ; @dh_cms_encrypt
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #112
	.cfi_def_cfa_offset 112
	stp	x24, x23, [sp, #48]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #64]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #80]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #96]             ; 16-byte Folded Spill
	add	x29, sp, #96
	.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
	str	xzr, [sp, #8]
	bl	_CMS_RecipientInfo_get0_pkey_ctx
	mov	x19, x0
	cbz	x0, LBB0_27
; %bb.1:
	mov	x0, x19
	bl	_EVP_PKEY_CTX_get0_pkey
	mov	x21, x0
	add	x1, sp, #40
	add	x2, sp, #24
	mov	x0, x20
	mov	x3, #0
	mov	x4, #0
	mov	x5, #0
	bl	_CMS_RecipientInfo_kari_get0_orig_id
	cbz	w0, LBB0_25
; %bb.2:
	ldr	x3, [sp, #40]
	add	x0, sp, #32
	mov	x1, #0
	mov	x2, #0
	bl	_X509_ALGOR_get0
	ldr	x22, [sp, #32]
Lloh0:
	adrp	x24, _NID_undef@GOTPAGE
Lloh1:
	ldr	x24, [x24, _NID_undef@GOTPAGEOFF]
	ldr	w0, [x24]
	bl	_OBJ_nid2obj
	cmp	x22, x0
	b.eq	LBB0_7
LBB0_3:
	mov	x0, x19
	bl	_EVP_PKEY_CTX_get_dh_kdf_type
	cmp	w0, #1
	b.lt	LBB0_25
; %bb.4:
	mov	x21, x0
	mov	x1, sp
	mov	x0, x19
	bl	_EVP_PKEY_CTX_get_dh_kdf_md
	cbz	w0, LBB0_25
; %bb.5:
Lloh2:
	adrp	x8, _EVP_PKEY_DH_KDF_NONE@GOTPAGE
Lloh3:
	ldr	x8, [x8, _EVP_PKEY_DH_KDF_NONE@GOTPAGEOFF]
Lloh4:
	ldr	w8, [x8]
Lloh5:
	adrp	x9, _EVP_PKEY_DH_KDF_X9_42@GOTPAGE
Lloh6:
	ldr	x9, [x9, _EVP_PKEY_DH_KDF_X9_42@GOTPAGEOFF]
Lloh7:
	ldr	w1, [x9]
	cmp	w21, w8
	b.ne	LBB0_10
; %bb.6:
	mov	x0, x19
	bl	_EVP_PKEY_CTX_set_dh_kdf_type
	cmp	x0, #1
	b.ge	LBB0_11
	b	LBB0_25
LBB0_7:
	ldr	x8, [x21]
	ldr	w0, [x8]
	mov	x1, #0
	bl	_BN_to_ASN1_INTEGER
	cbz	x0, LBB0_25
; %bb.8:
	mov	x22, x0
	add	x1, sp, #8
	bl	_i2d_ASN1_INTEGER
	mov	x21, x0
	mov	x0, x22
	bl	_ASN1_INTEGER_free
	cmp	w21, #1
	b.lt	LBB0_25
; %bb.9:
	ldr	x0, [sp, #24]
	ldr	x1, [sp, #8]
	mov	x2, x21
	bl	_ASN1_STRING_set0
Lloh8:
	adrp	x8, _ASN1_STRING_FLAG_BITS_LEFT@GOTPAGE
Lloh9:
	ldr	x8, [x8, _ASN1_STRING_FLAG_BITS_LEFT@GOTPAGEOFF]
	ldr	w9, [x8]
	ldr	x10, [sp, #24]
	ldr	w11, [x10]
	bic	w9, w11, w9
	and	w9, w9, #0xfffffff8
	str	w9, [x10]
	ldr	w8, [x8]
	orr	w8, w8, w9
	str	w8, [x10]
	str	xzr, [sp, #8]
	ldr	x21, [sp, #40]
Lloh10:
	adrp	x8, _NID_dhpublicnumber@GOTPAGE
Lloh11:
	ldr	x8, [x8, _NID_dhpublicnumber@GOTPAGEOFF]
Lloh12:
	ldr	w0, [x8]
	bl	_OBJ_nid2obj
	mov	x1, x0
Lloh13:
	adrp	x8, _V_ASN1_UNDEF@GOTPAGE
Lloh14:
	ldr	x8, [x8, _V_ASN1_UNDEF@GOTPAGEOFF]
Lloh15:
	ldr	w2, [x8]
	mov	x0, x21
	mov	x3, #0
	bl	_X509_ALGOR_set0
	b	LBB0_3
LBB0_10:
	cmp	w21, w1
	b.ne	LBB0_25
LBB0_11:
	ldr	x0, [sp]
	cbz	x0, LBB0_13
; %bb.12:
	bl	_EVP_MD_type
Lloh16:
	adrp	x8, _NID_sha1@GOTPAGE
Lloh17:
	ldr	x8, [x8, _NID_sha1@GOTPAGEOFF]
Lloh18:
	ldr	x8, [x8]
	cmp	x0, x8
	b.ne	LBB0_25
	b	LBB0_14
LBB0_13:
	bl	_EVP_sha1
	mov	x1, x0
	str	x0, [sp]
	mov	x0, x19
	bl	_EVP_PKEY_CTX_set_dh_kdf_md
	cmp	x0, #1
	b.lt	LBB0_25
LBB0_14:
	add	x1, sp, #40
	add	x2, sp, #16
	mov	x0, x20
	bl	_CMS_RecipientInfo_kari_get0_alg
	cbz	w0, LBB0_25
; %bb.15:
	mov	x0, x20
	bl	_CMS_RecipientInfo_kari_get0_ctx
	mov	x22, x0
	bl	_EVP_CIPHER_CTX_type
	mov	x23, x0
	bl	_OBJ_nid2obj
	mov	x1, x0
	mov	x0, x19
	bl	_EVP_PKEY_CTX_set0_dh_kdf_oid
	cmp	x0, #1
	b.lt	LBB0_25
; %bb.16:
	mov	x0, x22
	bl	_EVP_CIPHER_CTX_key_length
	mov	x21, x0
	bl	_X509_ALGOR_new
	mov	x20, x0
	cbz	x0, LBB0_34
; %bb.17:
	mov	x0, x23
	bl	_OBJ_nid2obj
	str	x0, [x20, #8]
	bl	_ASN1_TYPE_new
	str	x0, [x20]
	cbz	x0, LBB0_34
; %bb.18:
	mov	x1, x0
	mov	x0, x22
	bl	_EVP_CIPHER_param_to_asn1
	cmp	x0, #1
	b.lt	LBB0_34
; %bb.19:
	ldr	x0, [x20]
	bl	_ASN1_TYPE_get
	ldr	x8, [x24]
	cmp	x0, x8
	b.ne	LBB0_21
; %bb.20:
	ldr	x0, [x20]
	bl	_ASN1_TYPE_free
	str	xzr, [x20]
LBB0_21:
	mov	x0, x19
	mov	x1, x21
	bl	_EVP_PKEY_CTX_set_dh_kdf_outlen
	cmp	x0, #1
	b.lt	LBB0_34
; %bb.22:
	ldr	x0, [sp, #16]
	cbz	x0, LBB0_28
; %bb.23:
	bl	_ASN1_STRING_length
	mov	x21, x0
	ldr	x0, [sp, #16]
	bl	_ASN1_STRING_get0_data
	mov	x1, x21
	bl	_OPENSSL_memdup
	cbz	x0, LBB0_34
; %bb.24:
	mov	x1, x0
	b	LBB0_29
LBB0_25:
	mov	w19, #0
	mov	x20, #0
LBB0_26:
	ldr	x0, [sp, #8]
	bl	_OPENSSL_free
	mov	x0, x20
	bl	_X509_ALGOR_free
LBB0_27:
	mov	x0, x19
	ldp	x29, x30, [sp, #96]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #80]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #64]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #48]             ; 16-byte Folded Reload
	add	sp, sp, #112
	ret
LBB0_28:
	mov	x1, #0
	mov	x21, #0
LBB0_29:
	mov	x0, x19
	mov	x2, x21
	bl	_EVP_PKEY_CTX_set0_dh_kdf_ukm
	cmp	x0, #1
	b.lt	LBB0_34
; %bb.30:
	str	xzr, [sp, #8]
	add	x1, sp, #8
	mov	x0, x20
	bl	_i2d_X509_ALGOR
	mov	w19, #0
	ldr	x8, [sp, #8]
	cbz	x8, LBB0_26
; %bb.31:
	mov	x21, x0
	cbz	w0, LBB0_26
; %bb.32:
	bl	_ASN1_STRING_new
	mov	x19, x0
	cbz	x0, LBB0_26
; %bb.33:
	ldr	x1, [sp, #8]
	mov	x0, x19
	mov	x2, x21
	bl	_ASN1_STRING_set0
	str	xzr, [sp, #8]
	ldr	x21, [sp, #40]
Lloh19:
	adrp	x8, _NID_id_smime_alg_ESDH@GOTPAGE
Lloh20:
	ldr	x8, [x8, _NID_id_smime_alg_ESDH@GOTPAGEOFF]
Lloh21:
	ldr	w0, [x8]
	bl	_OBJ_nid2obj
	mov	x1, x0
Lloh22:
	adrp	x8, _V_ASN1_SEQUENCE@GOTPAGE
Lloh23:
	ldr	x8, [x8, _V_ASN1_SEQUENCE@GOTPAGEOFF]
Lloh24:
	ldr	w2, [x8]
	mov	x0, x21
	mov	x3, x19
	bl	_X509_ALGOR_set0
	mov	w19, #1
	b	LBB0_26
LBB0_34:
	mov	w19, #0
	b	LBB0_26
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh13, Lloh14, Lloh15
	.loh AdrpLdrGotLdr	Lloh10, Lloh11, Lloh12
	.loh AdrpLdrGot	Lloh8, Lloh9
	.loh AdrpLdrGotLdr	Lloh16, Lloh17, Lloh18
	.loh AdrpLdrGotLdr	Lloh22, Lloh23, Lloh24
	.loh AdrpLdrGotLdr	Lloh19, Lloh20, Lloh21
	.cfi_endproc
                                        ; -- End function
	.comm	_NID_undef,8,3                  ; @NID_undef
	.comm	_ASN1_STRING_FLAG_BITS_LEFT,4,2 ; @ASN1_STRING_FLAG_BITS_LEFT
	.comm	_NID_dhpublicnumber,4,2         ; @NID_dhpublicnumber
	.comm	_V_ASN1_UNDEF,4,2               ; @V_ASN1_UNDEF
	.comm	_EVP_PKEY_DH_KDF_NONE,4,2       ; @EVP_PKEY_DH_KDF_NONE
	.comm	_EVP_PKEY_DH_KDF_X9_42,4,2      ; @EVP_PKEY_DH_KDF_X9_42
	.comm	_NID_sha1,8,3                   ; @NID_sha1
	.comm	_NID_id_smime_alg_ESDH,4,2      ; @NID_id_smime_alg_ESDH
	.comm	_V_ASN1_SEQUENCE,4,2            ; @V_ASN1_SEQUENCE
	.no_dead_strip	_dh_cms_encrypt
.subsections_via_symbols
