	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function dh_cms_set_peerkey
_dh_cms_set_peerkey:                    ## @dh_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	%r13
	pushq	%r12
	pushq	%rbx
	subq	$40, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdx, %rbx
	movq	%rsi, %rcx
	movq	%rdi, %r15
	leaq	-72(%rbp), %rdi
	leaq	-44(%rbp), %rsi
	leaq	-80(%rbp), %rdx
	callq	_X509_ALGOR_get0
	movq	-72(%rbp), %rdi
	callq	_OBJ_obj2nid
	movq	_NID_dhpublicnumber@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jne	LBB0_11
## %bb.1:
	movl	-44(%rbp), %eax
	movq	_V_ASN1_UNDEF@GOTPCREL(%rip), %rcx
	cmpl	(%rcx), %eax
	je	LBB0_3
## %bb.2:
	movq	_V_ASN1_NULL@GOTPCREL(%rip), %rcx
	cmpl	(%rcx), %eax
	je	LBB0_11
LBB0_3:
	movq	%r15, %rdi
	callq	_EVP_PKEY_CTX_get0_pkey
	testq	%rax, %rax
	je	LBB0_11
## %bb.4:
	movq	(%rax), %rdx
	movq	_EVP_PKEY_DHX@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rdx
	jne	LBB0_11
## %bb.5:
	movq	%rax, -56(%rbp)                 ## 8-byte Spill
	movl	16(%rax), %edi
	callq	_DHparams_dup
	movq	%rax, %r14
	movq	%rbx, %rdi
	callq	_ASN1_STRING_length
	movl	%eax, %r13d
	movq	%rbx, %rdi
	callq	_ASN1_STRING_get0_data
	movq	%rax, -64(%rbp)
	xorl	%r12d, %r12d
	testq	%rax, %rax
	je	LBB0_15
## %bb.6:
	testl	%r13d, %r13d
	je	LBB0_15
## %bb.7:
	xorl	%r12d, %r12d
	leaq	-64(%rbp), %rsi
	xorl	%edi, %edi
	movl	%r13d, %edx
	callq	_d2i_ASN1_INTEGER
	testq	%rax, %rax
	je	LBB0_14
## %bb.8:
	movq	%rax, %rbx
	xorl	%r12d, %r12d
	movq	%rax, %rdi
	xorl	%esi, %esi
	callq	_ASN1_INTEGER_to_BN
	movq	%rax, (%r14)
	testq	%rax, %rax
	je	LBB0_16
## %bb.9:
	xorl	%eax, %eax
	callq	_EVP_PKEY_new
	testq	%rax, %rax
	je	LBB0_17
## %bb.10:
	movq	%rax, %r13
	movq	-56(%rbp), %rax                 ## 8-byte Reload
	movq	8(%rax), %rax
	movl	(%rax), %esi
	movq	%r13, %rdi
	movq	%r14, %rdx
	callq	_EVP_PKEY_assign
	movq	%r15, %rdi
	movq	%r13, %rsi
	callq	_EVP_PKEY_derive_set_peer
	xorl	%r12d, %r12d
	testq	%rax, %rax
	setg	%r12b
	xorl	%r14d, %r14d
	jmp	LBB0_13
LBB0_11:
	xorl	%r12d, %r12d
	xorl	%r13d, %r13d
	xorl	%r14d, %r14d
LBB0_12:
	xorl	%ebx, %ebx
LBB0_13:
	movq	%rbx, %rdi
	callq	_ASN1_INTEGER_free
	movq	%r13, %rdi
	callq	_EVP_PKEY_free
	movq	%r14, %rdi
	callq	_DH_free
	movl	%r12d, %eax
	addq	$40, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_14:
	movq	_DH_F_DH_CMS_SET_PEERKEY@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movq	_DH_R_DECODE_ERROR@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	callq	_DHerr
LBB0_15:
	xorl	%r13d, %r13d
	jmp	LBB0_12
LBB0_16:
	movq	_DH_F_DH_CMS_SET_PEERKEY@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movq	_DH_R_BN_DECODE_ERROR@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	callq	_DHerr
	xorl	%r12d, %r12d
LBB0_17:
	xorl	%r13d, %r13d
	jmp	LBB0_13
	.cfi_endproc
                                        ## -- End function
	.comm	_NID_dhpublicnumber,8,3         ## @NID_dhpublicnumber
	.comm	_V_ASN1_UNDEF,4,2               ## @V_ASN1_UNDEF
	.comm	_V_ASN1_NULL,4,2                ## @V_ASN1_NULL
	.comm	_EVP_PKEY_DHX,8,3               ## @EVP_PKEY_DHX
	.comm	_DH_F_DH_CMS_SET_PEERKEY,4,2    ## @DH_F_DH_CMS_SET_PEERKEY
	.comm	_DH_R_DECODE_ERROR,4,2          ## @DH_R_DECODE_ERROR
	.comm	_DH_R_BN_DECODE_ERROR,4,2       ## @DH_R_BN_DECODE_ERROR
	.no_dead_strip	_dh_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 dh_cms_set_peerkey
_dh_cms_set_peerkey:                    ; @dh_cms_set_peerkey
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #112
	.cfi_def_cfa_offset 112
	stp	x26, x25, [sp, #32]             ; 16-byte Folded Spill
	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
	.cfi_offset w25, -72
	.cfi_offset w26, -80
	mov	x21, x2
	mov	x3, x1
	mov	x20, x0
	add	x0, sp, #24
	add	x1, sp, #20
	add	x2, sp, #8
	bl	_X509_ALGOR_get0
	ldr	x0, [sp, #24]
	bl	_OBJ_obj2nid
Lloh0:
	adrp	x8, _NID_dhpublicnumber@GOTPAGE
Lloh1:
	ldr	x8, [x8, _NID_dhpublicnumber@GOTPAGEOFF]
Lloh2:
	ldr	x8, [x8]
	cmp	x0, x8
	b.ne	LBB0_10
; %bb.1:
	ldr	w8, [sp, #20]
Lloh3:
	adrp	x9, _V_ASN1_UNDEF@GOTPAGE
Lloh4:
	ldr	x9, [x9, _V_ASN1_UNDEF@GOTPAGEOFF]
Lloh5:
	ldr	w9, [x9]
Lloh6:
	adrp	x10, _V_ASN1_NULL@GOTPAGE
Lloh7:
	ldr	x10, [x10, _V_ASN1_NULL@GOTPAGEOFF]
Lloh8:
	ldr	w10, [x10]
	cmp	w8, w9
	ccmp	w8, w10, #0, ne
	b.eq	LBB0_10
; %bb.2:
	mov	x0, x20
	bl	_EVP_PKEY_CTX_get0_pkey
	cbz	x0, LBB0_10
; %bb.3:
	mov	x24, x0
	ldr	x8, [x0]
Lloh9:
	adrp	x9, _EVP_PKEY_DHX@GOTPAGE
Lloh10:
	ldr	x9, [x9, _EVP_PKEY_DHX@GOTPAGEOFF]
Lloh11:
	ldr	x9, [x9]
	cmp	x8, x9
	b.ne	LBB0_10
; %bb.4:
	ldr	w0, [x24, #16]
	bl	_DHparams_dup
	mov	x19, x0
	mov	x0, x21
	bl	_ASN1_STRING_length
	mov	x25, x0
	mov	x0, x21
	bl	_ASN1_STRING_get0_data
	mov	x22, #0
	mov	w23, #0
	str	x0, [sp]
	cbz	x0, LBB0_12
; %bb.5:
	cbz	w25, LBB0_12
; %bb.6:
	mov	x1, sp
	mov	x0, #0
	mov	x2, x25
	bl	_d2i_ASN1_INTEGER
	mov	x21, x0
	cbz	x0, LBB0_13
; %bb.7:
	mov	x0, x21
	mov	x1, #0
	bl	_ASN1_INTEGER_to_BN
	str	x0, [x19]
	cbz	x0, LBB0_14
; %bb.8:
	bl	_EVP_PKEY_new
	mov	x22, x0
	cbz	x0, LBB0_16
; %bb.9:
	ldr	x8, [x24, #8]
	ldr	w1, [x8]
	mov	x0, x22
	mov	x2, x19
	bl	_EVP_PKEY_assign
	mov	x0, x20
	mov	x1, x22
	bl	_EVP_PKEY_derive_set_peer
	mov	x19, #0
	cmp	x0, #0
	cset	w23, gt
	b	LBB0_11
LBB0_10:
	mov	w23, #0
	mov	x22, #0
	mov	x19, #0
	mov	x21, #0
LBB0_11:
	mov	x0, x21
	bl	_ASN1_INTEGER_free
	mov	x0, x22
	bl	_EVP_PKEY_free
	mov	x0, x19
	bl	_DH_free
	mov	x0, x23
	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
	ldp	x26, x25, [sp, #32]             ; 16-byte Folded Reload
	add	sp, sp, #112
	ret
LBB0_12:
	mov	x21, x22
	b	LBB0_11
LBB0_13:
Lloh12:
	adrp	x8, _DH_F_DH_CMS_SET_PEERKEY@GOTPAGE
Lloh13:
	ldr	x8, [x8, _DH_F_DH_CMS_SET_PEERKEY@GOTPAGEOFF]
Lloh14:
	ldr	w0, [x8]
Lloh15:
	adrp	x8, _DH_R_DECODE_ERROR@GOTPAGE
Lloh16:
	ldr	x8, [x8, _DH_R_DECODE_ERROR@GOTPAGEOFF]
	b	LBB0_15
LBB0_14:
Lloh17:
	adrp	x8, _DH_F_DH_CMS_SET_PEERKEY@GOTPAGE
Lloh18:
	ldr	x8, [x8, _DH_F_DH_CMS_SET_PEERKEY@GOTPAGEOFF]
Lloh19:
	ldr	w0, [x8]
Lloh20:
	adrp	x8, _DH_R_BN_DECODE_ERROR@GOTPAGE
Lloh21:
	ldr	x8, [x8, _DH_R_BN_DECODE_ERROR@GOTPAGEOFF]
LBB0_15:
	ldr	w1, [x8]
	bl	_DHerr
	mov	w23, #0
	mov	x22, #0
	b	LBB0_11
LBB0_16:
	mov	w23, #0
	b	LBB0_11
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGot	Lloh15, Lloh16
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.loh AdrpLdrGot	Lloh20, Lloh21
	.loh AdrpLdrGotLdr	Lloh17, Lloh18, Lloh19
	.cfi_endproc
                                        ; -- End function
	.comm	_NID_dhpublicnumber,8,3         ; @NID_dhpublicnumber
	.comm	_V_ASN1_UNDEF,4,2               ; @V_ASN1_UNDEF
	.comm	_V_ASN1_NULL,4,2                ; @V_ASN1_NULL
	.comm	_EVP_PKEY_DHX,8,3               ; @EVP_PKEY_DHX
	.comm	_DH_F_DH_CMS_SET_PEERKEY,4,2    ; @DH_F_DH_CMS_SET_PEERKEY
	.comm	_DH_R_DECODE_ERROR,4,2          ; @DH_R_DECODE_ERROR
	.comm	_DH_R_BN_DECODE_ERROR,4,2       ; @DH_R_BN_DECODE_ERROR
	.no_dead_strip	_dh_cms_set_peerkey
.subsections_via_symbols
