	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function ecdh_cms_encrypt
_ecdh_cms_encrypt:                      ## @ecdh_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	$56, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdi, %r13
	movq	$0, -48(%rbp)
	callq	_CMS_RecipientInfo_get0_pkey_ctx
	testq	%rax, %rax
	je	LBB0_9
## %bb.1:
	movq	%rax, %r12
	movq	%rax, %rdi
	callq	_EVP_PKEY_CTX_get0_pkey
	movq	%rax, %r14
	xorl	%r15d, %r15d
	leaq	-56(%rbp), %rsi
	leaq	-88(%rbp), %rdx
	movq	%r13, %rdi
	xorl	%ecx, %ecx
	xorl	%r8d, %r8d
	xorl	%r9d, %r9d
	callq	_CMS_RecipientInfo_kari_get0_orig_id
	movl	$0, %ebx
	testl	%eax, %eax
	je	LBB0_38
## %bb.2:
	movq	-56(%rbp), %rcx
	leaq	-96(%rbp), %rdi
	xorl	%esi, %esi
	xorl	%edx, %edx
	callq	_X509_ALGOR_get0
	movq	-96(%rbp), %rbx
	movq	_NID_undef@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	callq	_OBJ_nid2obj
	cmpq	%rax, %rbx
	je	LBB0_10
LBB0_3:
	movq	%r12, %rdi
	callq	_EVP_PKEY_CTX_get_ecdh_kdf_type
	testl	%eax, %eax
	jle	LBB0_36
## %bb.4:
	movl	%eax, %ebx
	leaq	-64(%rbp), %rsi
	movq	%r12, %rdi
	callq	_EVP_PKEY_CTX_get_ecdh_kdf_md
	testl	%eax, %eax
	je	LBB0_36
## %bb.5:
	movq	%r12, %rdi
	callq	_EVP_PKEY_CTX_get_ecdh_cofactor_mode
	testl	%eax, %eax
	js	LBB0_36
## %bb.6:
	movl	%eax, %r14d
	cmpl	$1, %eax
	je	LBB0_15
## %bb.7:
	testl	%r14d, %r14d
	jne	LBB0_17
## %bb.8:
	movq	_NID_dh_std_kdf@GOTPCREL(%rip), %rax
	jmp	LBB0_16
LBB0_9:
	xorl	%r15d, %r15d
	jmp	LBB0_39
LBB0_10:
	movq	(%r14), %rbx
	xorl	%r15d, %r15d
	movq	%rbx, %rdi
	xorl	%esi, %esi
	callq	_i2o_ECPublicKey
	testl	%eax, %eax
	jle	LBB0_37
## %bb.11:
	movl	%eax, %edi
	callq	_OPENSSL_malloc
	movq	%rax, -48(%rbp)
	testq	%rax, %rax
	je	LBB0_37
## %bb.12:
	movq	%rax, %r14
	movq	%rax, -72(%rbp)
	leaq	-72(%rbp), %rsi
	movq	%rbx, %rdi
	callq	_i2o_ECPublicKey
	testl	%eax, %eax
	jle	LBB0_37
## %bb.13:
	movq	-88(%rbp), %rdi
	movq	%r14, %rsi
	movl	%eax, %edx
	callq	_ASN1_STRING_set0
	movq	_ASN1_STRING_FLAG_BITS_LEFT@GOTPCREL(%rip), %rax
	movl	(%rax), %ecx
	notl	%ecx
	movq	-88(%rbp), %rdx
	andl	(%rdx), %ecx
	andl	$-8, %ecx
	movl	%ecx, (%rdx)
	orl	(%rax), %ecx
	movl	%ecx, (%rdx)
	movq	$0, -48(%rbp)
	movq	-56(%rbp), %rbx
	movq	_NID_X9_62_id_ecPublicKey@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
	jmp	LBB0_3
LBB0_15:
	movq	_NID_dh_cofactor_kdf@GOTPCREL(%rip), %rax
LBB0_16:
	movl	(%rax), %r14d
LBB0_17:
	movq	_EVP_PKEY_ECDH_KDF_NONE@GOTPCREL(%rip), %rax
	cmpl	(%rax), %ebx
	jne	LBB0_36
## %bb.18:
	movq	_EVP_PKEY_ECDH_KDF_X9_63@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r12, %rdi
	callq	_EVP_PKEY_CTX_set_ecdh_kdf_type
	testq	%rax, %rax
	jle	LBB0_36
## %bb.19:
	cmpq	$0, -64(%rbp)
	jne	LBB0_21
## %bb.20:
	xorl	%r15d, %r15d
	xorl	%eax, %eax
	callq	_EVP_sha1
	movq	%rax, -64(%rbp)
	movq	%r12, %rdi
	movq	%rax, %rsi
	callq	_EVP_PKEY_CTX_set_ecdh_kdf_md
	testq	%rax, %rax
	jle	LBB0_37
LBB0_21:
	leaq	-56(%rbp), %rsi
	leaq	-72(%rbp), %rdx
	movq	%r13, %rdi
	callq	_CMS_RecipientInfo_kari_get0_alg
	testl	%eax, %eax
	je	LBB0_36
## %bb.22:
	movq	-64(%rbp), %rdi
	callq	_EVP_MD_type
	leaq	-80(%rbp), %rdi
	movl	%eax, %esi
	movl	%r14d, %edx
	callq	_OBJ_find_sigid_by_algs
	testl	%eax, %eax
	je	LBB0_36
## %bb.23:
	movq	%r13, %rdi
	callq	_CMS_RecipientInfo_kari_get0_ctx
	movq	%rax, %rbx
	movq	%rax, %rdi
	callq	_EVP_CIPHER_CTX_type
	movl	%eax, %r14d
	movq	%rbx, %rdi
	callq	_EVP_CIPHER_CTX_key_length
	movl	%eax, -76(%rbp)                 ## 4-byte Spill
	xorl	%r15d, %r15d
	xorl	%eax, %eax
	callq	_X509_ALGOR_new
	testq	%rax, %rax
	je	LBB0_37
## %bb.24:
	movq	%rax, %r13
	movl	%r14d, %edi
	callq	_OBJ_nid2obj
	movq	%rax, 8(%r13)
	xorl	%r15d, %r15d
	xorl	%eax, %eax
	callq	_ASN1_TYPE_new
	movq	%r13, %r14
	movq	%rax, (%r13)
	testq	%rax, %rax
	je	LBB0_35
## %bb.25:
	movq	%rbx, %rdi
	movq	%rax, %rsi
	callq	_EVP_CIPHER_param_to_asn1
	testq	%rax, %rax
	jle	LBB0_35
## %bb.26:
	movq	%r14, %rbx
	movq	(%r14), %rdi
	callq	_ASN1_TYPE_get
	movq	_NID_undef@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jne	LBB0_28
## %bb.27:
	movq	(%rbx), %rdi
	callq	_ASN1_TYPE_free
	movq	$0, (%rbx)
LBB0_28:
	movq	%r12, %rdi
	movl	-76(%rbp), %r13d                ## 4-byte Reload
	movl	%r13d, %esi
	callq	_EVP_PKEY_CTX_set_ecdh_kdf_outlen
	testq	%rax, %rax
	jle	LBB0_38
## %bb.29:
	movq	-72(%rbp), %rdx
	leaq	-48(%rbp), %rdi
	movq	%rbx, %rsi
	movl	%r13d, %ecx
	callq	_CMS_SharedInfo_encode
	testl	%eax, %eax
	je	LBB0_38
## %bb.30:
	movq	-48(%rbp), %rsi
	movq	%r12, %rdi
	movl	%eax, %edx
	callq	_EVP_PKEY_CTX_set0_ecdh_kdf_ukm
	testq	%rax, %rax
	jle	LBB0_38
## %bb.31:
	movq	$0, -48(%rbp)
	leaq	-48(%rbp), %rsi
	movq	%rbx, %rdi
	callq	_i2d_X509_ALGOR
	cmpq	$0, -48(%rbp)
	je	LBB0_35
## %bb.32:
	movl	%eax, %ebx
	testl	%eax, %eax
	je	LBB0_35
## %bb.33:
	xorl	%r15d, %r15d
	xorl	%eax, %eax
	callq	_ASN1_STRING_new
	testq	%rax, %rax
	je	LBB0_35
## %bb.34:
	movq	%rax, %r12
	movq	-48(%rbp), %rsi
	movq	%rax, %rdi
	movl	%ebx, %edx
	callq	_ASN1_STRING_set0
	movq	$0, -48(%rbp)
	movq	-56(%rbp), %rbx
	movl	-80(%rbp), %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, %r15d
LBB0_35:
	movq	%r14, %rbx
	jmp	LBB0_38
LBB0_36:
	xorl	%r15d, %r15d
LBB0_37:
	xorl	%ebx, %ebx
LBB0_38:
	movq	-48(%rbp), %rdi
	callq	_OPENSSL_free
	movq	%rbx, %rdi
	callq	_X509_ALGOR_free
LBB0_39:
	movl	%r15d, %eax
	addq	$56, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.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_X9_62_id_ecPublicKey,4,2   ## @NID_X9_62_id_ecPublicKey
	.comm	_V_ASN1_UNDEF,4,2               ## @V_ASN1_UNDEF
	.comm	_NID_dh_std_kdf,4,2             ## @NID_dh_std_kdf
	.comm	_NID_dh_cofactor_kdf,4,2        ## @NID_dh_cofactor_kdf
	.comm	_EVP_PKEY_ECDH_KDF_NONE,4,2     ## @EVP_PKEY_ECDH_KDF_NONE
	.comm	_EVP_PKEY_ECDH_KDF_X9_63,4,2    ## @EVP_PKEY_ECDH_KDF_X9_63
	.comm	_V_ASN1_SEQUENCE,4,2            ## @V_ASN1_SEQUENCE
	.no_dead_strip	_ecdh_cms_encrypt
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function ecdh_cms_encrypt
_ecdh_cms_encrypt:                      ; @ecdh_cms_encrypt
	.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	x20, x0
	str	xzr, [sp, #24]
	bl	_CMS_RecipientInfo_get0_pkey_ctx
	mov	x19, x0
	cbz	x0, LBB0_35
; %bb.1:
	mov	x0, x19
	bl	_EVP_PKEY_CTX_get0_pkey
	mov	x21, x0
	add	x1, sp, #56
	add	x2, sp, #40
	mov	x0, x20
	mov	x3, #0
	mov	x4, #0
	mov	x5, #0
	bl	_CMS_RecipientInfo_kari_get0_orig_id
	cbz	w0, LBB0_33
; %bb.2:
	ldr	x3, [sp, #56]
	add	x0, sp, #48
	mov	x1, #0
	mov	x2, #0
	bl	_X509_ALGOR_get0
	ldr	x22, [sp, #48]
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_9
LBB0_3:
	mov	x0, x19
	bl	_EVP_PKEY_CTX_get_ecdh_kdf_type
	cmp	w0, #1
	b.lt	LBB0_33
; %bb.4:
	mov	x22, x0
	add	x1, sp, #8
	mov	x0, x19
	bl	_EVP_PKEY_CTX_get_ecdh_kdf_md
	cbz	w0, LBB0_33
; %bb.5:
	mov	x0, x19
	bl	_EVP_PKEY_CTX_get_ecdh_cofactor_mode
	tbnz	w0, #31, LBB0_33
; %bb.6:
	mov	x21, x0
	cmp	w0, #1
	b.eq	LBB0_13
; %bb.7:
	cbnz	w21, LBB0_15
; %bb.8:
Lloh2:
	adrp	x8, _NID_dh_std_kdf@GOTPAGE
Lloh3:
	ldr	x8, [x8, _NID_dh_std_kdf@GOTPAGEOFF]
	b	LBB0_14
LBB0_9:
	ldr	x21, [x21]
	mov	x0, x21
	mov	x1, #0
	bl	_i2o_ECPublicKey
	cmp	w0, #1
	b.lt	LBB0_33
; %bb.10:
	bl	_OPENSSL_malloc
	str	x0, [sp, #24]
	cbz	x0, LBB0_33
; %bb.11:
	mov	x22, x0
	str	x0, [sp, #32]
	add	x1, sp, #32
	mov	x0, x21
	bl	_i2o_ECPublicKey
	cmp	w0, #0
	b.le	LBB0_33
; %bb.12:
	mov	x2, x0
	ldr	x0, [sp, #40]
	mov	x1, x22
	bl	_ASN1_STRING_set0
Lloh4:
	adrp	x8, _ASN1_STRING_FLAG_BITS_LEFT@GOTPAGE
Lloh5:
	ldr	x8, [x8, _ASN1_STRING_FLAG_BITS_LEFT@GOTPAGEOFF]
	ldr	w9, [x8]
	ldr	x10, [sp, #40]
	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, #24]
	ldr	x21, [sp, #56]
Lloh6:
	adrp	x8, _NID_X9_62_id_ecPublicKey@GOTPAGE
Lloh7:
	ldr	x8, [x8, _NID_X9_62_id_ecPublicKey@GOTPAGEOFF]
Lloh8:
	ldr	w0, [x8]
	bl	_OBJ_nid2obj
	mov	x1, x0
Lloh9:
	adrp	x8, _V_ASN1_UNDEF@GOTPAGE
Lloh10:
	ldr	x8, [x8, _V_ASN1_UNDEF@GOTPAGEOFF]
Lloh11:
	ldr	w2, [x8]
	mov	x0, x21
	mov	x3, #0
	bl	_X509_ALGOR_set0
	b	LBB0_3
LBB0_13:
Lloh12:
	adrp	x8, _NID_dh_cofactor_kdf@GOTPAGE
Lloh13:
	ldr	x8, [x8, _NID_dh_cofactor_kdf@GOTPAGEOFF]
LBB0_14:
	ldr	w21, [x8]
LBB0_15:
Lloh14:
	adrp	x8, _EVP_PKEY_ECDH_KDF_NONE@GOTPAGE
Lloh15:
	ldr	x8, [x8, _EVP_PKEY_ECDH_KDF_NONE@GOTPAGEOFF]
Lloh16:
	ldr	w8, [x8]
	cmp	w22, w8
	b.ne	LBB0_33
; %bb.16:
Lloh17:
	adrp	x8, _EVP_PKEY_ECDH_KDF_X9_63@GOTPAGE
Lloh18:
	ldr	x8, [x8, _EVP_PKEY_ECDH_KDF_X9_63@GOTPAGEOFF]
Lloh19:
	ldr	w1, [x8]
	mov	x0, x19
	bl	_EVP_PKEY_CTX_set_ecdh_kdf_type
	cmp	x0, #1
	b.lt	LBB0_33
; %bb.17:
	ldr	x8, [sp, #8]
	cbnz	x8, LBB0_19
; %bb.18:
	bl	_EVP_sha1
	mov	x1, x0
	str	x0, [sp, #8]
	mov	x0, x19
	bl	_EVP_PKEY_CTX_set_ecdh_kdf_md
	cmp	x0, #1
	b.lt	LBB0_33
LBB0_19:
	add	x1, sp, #56
	add	x2, sp, #32
	mov	x0, x20
	bl	_CMS_RecipientInfo_kari_get0_alg
	cbz	w0, LBB0_33
; %bb.20:
	ldr	x0, [sp, #8]
	bl	_EVP_MD_type
	mov	x1, x0
	add	x0, sp, #20
	mov	x2, x21
	bl	_OBJ_find_sigid_by_algs
	cbz	w0, LBB0_33
; %bb.21:
	mov	x0, x20
	bl	_CMS_RecipientInfo_kari_get0_ctx
	mov	x22, x0
	bl	_EVP_CIPHER_CTX_type
	mov	x23, x0
	mov	x0, x22
	bl	_EVP_CIPHER_CTX_key_length
	mov	x21, x0
	bl	_X509_ALGOR_new
	mov	x20, x0
	cbz	x0, LBB0_36
; %bb.22:
	mov	x0, x23
	bl	_OBJ_nid2obj
	str	x0, [x20, #8]
	bl	_ASN1_TYPE_new
	str	x0, [x20]
	cbz	x0, LBB0_36
; %bb.23:
	mov	x1, x0
	mov	x0, x22
	bl	_EVP_CIPHER_param_to_asn1
	cmp	x0, #1
	b.lt	LBB0_36
; %bb.24:
	ldr	x0, [x20]
	bl	_ASN1_TYPE_get
	ldr	x8, [x24]
	cmp	x0, x8
	b.ne	LBB0_26
; %bb.25:
	ldr	x0, [x20]
	bl	_ASN1_TYPE_free
	str	xzr, [x20]
LBB0_26:
	mov	x0, x19
	mov	x1, x21
	bl	_EVP_PKEY_CTX_set_ecdh_kdf_outlen
	cmp	x0, #1
	b.lt	LBB0_36
; %bb.27:
	ldr	x2, [sp, #32]
	add	x0, sp, #24
	mov	x1, x20
	mov	x3, x21
	bl	_CMS_SharedInfo_encode
	cbz	w0, LBB0_36
; %bb.28:
	mov	x2, x0
	ldr	x1, [sp, #24]
	mov	x0, x19
	bl	_EVP_PKEY_CTX_set0_ecdh_kdf_ukm
	cmp	x0, #1
	b.lt	LBB0_36
; %bb.29:
	str	xzr, [sp, #24]
	add	x1, sp, #24
	mov	x0, x20
	bl	_i2d_X509_ALGOR
	mov	w19, #0
	ldr	x8, [sp, #24]
	cbz	x8, LBB0_34
; %bb.30:
	mov	x21, x0
	cbz	w0, LBB0_34
; %bb.31:
	bl	_ASN1_STRING_new
	mov	x19, x0
	cbz	x0, LBB0_34
; %bb.32:
	ldr	x1, [sp, #24]
	mov	x0, x19
	mov	x2, x21
	bl	_ASN1_STRING_set0
	str	xzr, [sp, #24]
	ldr	x21, [sp, #56]
	ldr	w0, [sp, #20]
	bl	_OBJ_nid2obj
	mov	x1, x0
Lloh20:
	adrp	x8, _V_ASN1_SEQUENCE@GOTPAGE
Lloh21:
	ldr	x8, [x8, _V_ASN1_SEQUENCE@GOTPAGEOFF]
Lloh22:
	ldr	w2, [x8]
	mov	x0, x21
	mov	x3, x19
	bl	_X509_ALGOR_set0
	mov	w19, #1
	b	LBB0_34
LBB0_33:
	mov	w19, #0
	mov	x20, #0
LBB0_34:
	ldr	x0, [sp, #24]
	bl	_OPENSSL_free
	mov	x0, x20
	bl	_X509_ALGOR_free
LBB0_35:
	mov	x0, x19
	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
LBB0_36:
	mov	w19, #0
	b	LBB0_34
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGot	Lloh4, Lloh5
	.loh AdrpLdrGot	Lloh12, Lloh13
	.loh AdrpLdrGotLdr	Lloh14, Lloh15, Lloh16
	.loh AdrpLdrGotLdr	Lloh17, Lloh18, Lloh19
	.loh AdrpLdrGotLdr	Lloh20, Lloh21, Lloh22
	.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_X9_62_id_ecPublicKey,4,2   ; @NID_X9_62_id_ecPublicKey
	.comm	_V_ASN1_UNDEF,4,2               ; @V_ASN1_UNDEF
	.comm	_NID_dh_std_kdf,4,2             ; @NID_dh_std_kdf
	.comm	_NID_dh_cofactor_kdf,4,2        ; @NID_dh_cofactor_kdf
	.comm	_EVP_PKEY_ECDH_KDF_NONE,4,2     ; @EVP_PKEY_ECDH_KDF_NONE
	.comm	_EVP_PKEY_ECDH_KDF_X9_63,4,2    ; @EVP_PKEY_ECDH_KDF_X9_63
	.comm	_V_ASN1_SEQUENCE,4,2            ; @V_ASN1_SEQUENCE
	.no_dead_strip	_ecdh_cms_encrypt
.subsections_via_symbols
