	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function ecdh_cms_set_peerkey
_ecdh_cms_set_peerkey:                  ## @ecdh_cms_set_peerkey
	.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	%r12
	pushq	%rbx
	subq	$48, %rsp
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdx, %r15
	movq	%rsi, %rcx
	movq	%rdi, %r14
	movq	$0, -40(%rbp)
	leaq	-72(%rbp), %rdi
	leaq	-44(%rbp), %rsi
	leaq	-64(%rbp), %rdx
	callq	_X509_ALGOR_get0
	movq	-72(%rbp), %rdi
	callq	_OBJ_obj2nid
	movq	_NID_X9_62_id_ecPublicKey@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jne	LBB0_12
## %bb.1:
	movl	-44(%rbp), %edi
	movq	_V_ASN1_UNDEF@GOTPCREL(%rip), %rax
	cmpl	(%rax), %edi
	je	LBB0_4
## %bb.2:
	movq	_V_ASN1_NULL@GOTPCREL(%rip), %rax
	cmpl	(%rax), %edi
	je	LBB0_4
## %bb.3:
	movq	-64(%rbp), %rsi
	callq	_eckey_type2param
	movq	%rax, -40(%rbp)
	testq	%rax, %rax
	jne	LBB0_7
	jmp	LBB0_12
LBB0_4:
	movq	%r14, %rdi
	callq	_EVP_PKEY_CTX_get0_pkey
	testq	%rax, %rax
	je	LBB0_12
## %bb.5:
	movl	(%rax), %edi
	callq	_EC_KEY_get0_group
	movq	%rax, %r12
	xorl	%ebx, %ebx
	xorl	%eax, %eax
	callq	_EC_KEY_new
	movq	%rax, -40(%rbp)
	testq	%rax, %rax
	je	LBB0_15
## %bb.6:
	movq	%rax, %rdi
	movq	%r12, %rsi
	callq	_EC_KEY_set_group
	testl	%eax, %eax
	je	LBB0_12
LBB0_7:
	movq	%r15, %rdi
	callq	_ASN1_STRING_length
	movl	%eax, %r12d
	movq	%r15, %rdi
	callq	_ASN1_STRING_get0_data
	movq	%rax, -56(%rbp)
	xorl	%r15d, %r15d
	testq	%rax, %rax
	je	LBB0_13
## %bb.8:
	movl	$0, %ebx
	testl	%r12d, %r12d
	je	LBB0_14
## %bb.9:
	leaq	-40(%rbp), %rdi
	leaq	-56(%rbp), %rsi
	movl	%r12d, %edx
	callq	_o2i_ECPublicKey
	testl	%eax, %eax
	je	LBB0_12
## %bb.10:
	xorl	%ebx, %ebx
	xorl	%eax, %eax
	callq	_EVP_PKEY_new
	testq	%rax, %rax
	je	LBB0_15
## %bb.11:
	movq	%rax, %r15
	movq	-40(%rbp), %rsi
	movq	%rax, %rdi
	callq	_EVP_PKEY_set1_EC_KEY
	movq	%r14, %rdi
	movq	%r15, %rsi
	callq	_EVP_PKEY_derive_set_peer
	xorl	%ebx, %ebx
	testq	%rax, %rax
	setg	%bl
	jmp	LBB0_14
LBB0_12:
	xorl	%r15d, %r15d
LBB0_13:
	xorl	%ebx, %ebx
LBB0_14:
	movq	-40(%rbp), %rdi
	callq	_EC_KEY_free
	movq	%r15, %rdi
	callq	_EVP_PKEY_free
	movl	%ebx, %eax
	addq	$48, %rsp
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_15:
	xorl	%r15d, %r15d
	jmp	LBB0_14
	.cfi_endproc
                                        ## -- End function
	.comm	_NID_X9_62_id_ecPublicKey,8,3   ## @NID_X9_62_id_ecPublicKey
	.comm	_V_ASN1_UNDEF,4,2               ## @V_ASN1_UNDEF
	.comm	_V_ASN1_NULL,4,2                ## @V_ASN1_NULL
	.no_dead_strip	_ecdh_cms_set_peerkey
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function ecdh_cms_set_peerkey
_ecdh_cms_set_peerkey:                  ; @ecdh_cms_set_peerkey
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #96
	.cfi_def_cfa_offset 96
	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
	mov	x20, x2
	mov	x3, x1
	mov	x19, x0
	str	xzr, [sp, #16]
	add	x0, sp, #40
	add	x1, sp, #36
	add	x2, sp, #24
	bl	_X509_ALGOR_get0
	ldr	x0, [sp, #40]
	bl	_OBJ_obj2nid
Lloh0:
	adrp	x8, _NID_X9_62_id_ecPublicKey@GOTPAGE
Lloh1:
	ldr	x8, [x8, _NID_X9_62_id_ecPublicKey@GOTPAGEOFF]
Lloh2:
	ldr	x8, [x8]
	cmp	x0, x8
	b.ne	LBB0_11
; %bb.1:
	ldr	w0, [sp, #36]
Lloh3:
	adrp	x8, _V_ASN1_UNDEF@GOTPAGE
Lloh4:
	ldr	x8, [x8, _V_ASN1_UNDEF@GOTPAGEOFF]
Lloh5:
	ldr	w8, [x8]
Lloh6:
	adrp	x9, _V_ASN1_NULL@GOTPAGE
Lloh7:
	ldr	x9, [x9, _V_ASN1_NULL@GOTPAGEOFF]
Lloh8:
	ldr	w9, [x9]
	cmp	w0, w8
	ccmp	w0, w9, #4, ne
	b.ne	LBB0_5
; %bb.2:
	mov	x0, x19
	bl	_EVP_PKEY_CTX_get0_pkey
	cbz	x0, LBB0_11
; %bb.3:
	ldr	w0, [x0]
	bl	_EC_KEY_get0_group
	mov	x21, x0
	bl	_EC_KEY_new
	str	x0, [sp, #16]
	cbz	x0, LBB0_11
; %bb.4:
	mov	x1, x21
	bl	_EC_KEY_set_group
	cbnz	w0, LBB0_6
	b	LBB0_11
LBB0_5:
	ldr	x1, [sp, #24]
	bl	_eckey_type2param
	str	x0, [sp, #16]
	cbz	x0, LBB0_11
LBB0_6:
	mov	x0, x20
	bl	_ASN1_STRING_length
	mov	x22, x0
	mov	x0, x20
	bl	_ASN1_STRING_get0_data
	mov	w21, #0
	mov	x20, #0
	str	x0, [sp, #8]
	cbz	x0, LBB0_13
; %bb.7:
	cbz	w22, LBB0_13
; %bb.8:
	add	x0, sp, #16
	add	x1, sp, #8
	mov	x2, x22
	bl	_o2i_ECPublicKey
	cbz	w0, LBB0_11
; %bb.9:
	bl	_EVP_PKEY_new
	mov	x20, x0
	cbz	x0, LBB0_12
; %bb.10:
	ldr	x1, [sp, #16]
	mov	x0, x20
	bl	_EVP_PKEY_set1_EC_KEY
	mov	x0, x19
	mov	x1, x20
	bl	_EVP_PKEY_derive_set_peer
	cmp	x0, #0
	cset	w21, gt
	b	LBB0_13
LBB0_11:
	mov	x20, #0
LBB0_12:
	mov	w21, #0
LBB0_13:
	ldr	x0, [sp, #16]
	bl	_EC_KEY_free
	mov	x0, x20
	bl	_EVP_PKEY_free
	mov	x0, x21
	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
	add	sp, sp, #96
	ret
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.cfi_endproc
                                        ; -- End function
	.comm	_NID_X9_62_id_ecPublicKey,8,3   ; @NID_X9_62_id_ecPublicKey
	.comm	_V_ASN1_UNDEF,4,2               ; @V_ASN1_UNDEF
	.comm	_V_ASN1_NULL,4,2                ; @V_ASN1_NULL
	.no_dead_strip	_ecdh_cms_set_peerkey
.subsections_via_symbols
