	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function setup_peer
_setup_peer:                            ## @setup_peer
	.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
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rcx, %r8
	movq	%rdx, %r14
	movq	%rdi, %r15
	movq	_FORMAT_ENGINE@GOTPCREL(%rip), %rax
	xorl	%r12d, %r12d
	cmpl	%esi, (%rax)
	cmovneq	%r12, %r8
	leaq	L_.str(%rip), %r9
	movq	%rdx, %rdi
	xorl	%edx, %edx
	xorl	%ecx, %ecx
	callq	_load_pubkey
	testq	%rax, %rax
	je	LBB0_1
## %bb.2:
	movq	%rax, %rbx
	movq	%r15, %rdi
	movq	%rax, %rsi
	callq	_EVP_PKEY_derive_set_peer
	movl	%eax, %r12d
	movq	%rbx, %rdi
	callq	_EVP_PKEY_free
	testl	%r12d, %r12d
	jg	LBB0_4
	jmp	LBB0_3
LBB0_1:
	movq	_bio_err@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	leaq	L_.str.1(%rip), %rsi
	movq	%r14, %rdx
	callq	_BIO_printf
LBB0_3:
	movq	_bio_err@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	callq	_ERR_print_errors
LBB0_4:
	movl	%r12d, %eax
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_FORMAT_ENGINE,4,2              ## @FORMAT_ENGINE
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Peer Key"

	.comm	_bio_err,4,2                    ## @bio_err
L_.str.1:                               ## @.str.1
	.asciz	"Error reading peer key %s\n"

	.no_dead_strip	_setup_peer
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function setup_peer
_setup_peer:                            ; @setup_peer
	.cfi_startproc
; %bb.0:
	stp	x22, x21, [sp, #-48]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 48
	stp	x20, x19, [sp, #16]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #32]             ; 16-byte Folded Spill
	add	x29, sp, #32
	.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	x19, x2
	mov	x20, x0
Lloh0:
	adrp	x8, _FORMAT_ENGINE@GOTPAGE
Lloh1:
	ldr	x8, [x8, _FORMAT_ENGINE@GOTPAGEOFF]
Lloh2:
	ldr	w8, [x8]
	cmp	w8, w1
	csel	x4, x3, xzr, eq
Lloh3:
	adrp	x5, l_.str@PAGE
Lloh4:
	add	x5, x5, l_.str@PAGEOFF
	mov	x0, x2
	mov	w2, #0
	mov	x3, #0
	bl	_load_pubkey
	cbz	x0, LBB0_2
; %bb.1:
	mov	x21, x0
	mov	x0, x20
	mov	x1, x21
	bl	_EVP_PKEY_derive_set_peer
	mov	x19, x0
	mov	x0, x21
	bl	_EVP_PKEY_free
	cmp	w19, #0
	b.gt	LBB0_4
	b	LBB0_3
LBB0_2:
Lloh5:
	adrp	x8, _bio_err@GOTPAGE
Lloh6:
	ldr	x8, [x8, _bio_err@GOTPAGEOFF]
Lloh7:
	ldr	w0, [x8]
Lloh8:
	adrp	x1, l_.str.1@PAGE
Lloh9:
	add	x1, x1, l_.str.1@PAGEOFF
	mov	x2, x19
	bl	_BIO_printf
	mov	w19, #0
LBB0_3:
Lloh10:
	adrp	x8, _bio_err@GOTPAGE
Lloh11:
	ldr	x8, [x8, _bio_err@GOTPAGEOFF]
Lloh12:
	ldr	w0, [x8]
	bl	_ERR_print_errors
LBB0_4:
	mov	x0, x19
	ldp	x29, x30, [sp, #32]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #16]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp], #48             ; 16-byte Folded Reload
	ret
	.loh AdrpAdd	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpAdd	Lloh8, Lloh9
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh10, Lloh11, Lloh12
	.cfi_endproc
                                        ; -- End function
	.comm	_FORMAT_ENGINE,4,2              ; @FORMAT_ENGINE
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Peer Key"

	.comm	_bio_err,4,2                    ; @bio_err
l_.str.1:                               ; @.str.1
	.asciz	"Error reading peer key %s\n"

	.no_dead_strip	_setup_peer
.subsections_via_symbols
