	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_crypto_dh_derive_secret        ## -- Begin function crypto_dh_derive_secret
	.p2align	4, 0x90
_crypto_dh_derive_secret:               ## @crypto_dh_derive_secret
	.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	$32, %rsp
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%r9, %r15
	movq	%rdx, %r14
	movq	%rsi, %r12
	movl	%edi, -36(%rbp)
	movl	$4, %edi
	callq	_os_malloc
	testq	%rax, %rax
	je	LBB0_1
## %bb.2:
	movq	%rax, %rbx
	movq	%rax, %rdi
	callq	_wc_InitDhKey
	leaq	-36(%rbp), %rcx
	movq	%rbx, %rdi
	movq	%r12, %rsi
	movq	%r14, %rdx
	movl	$1, %r8d
	callq	_wc_DhSetKey
	movl	$-1, %r14d
	testq	%rax, %rax
	jne	LBB0_5
## %bb.3:
	movq	40(%rbp), %rsi
	movq	32(%rbp), %rax
	movq	24(%rbp), %r9
	movq	16(%rbp), %r8
	movq	%rax, (%rsp)
	leaq	-48(%rbp), %rdx
	movq	%rbx, %rdi
	movq	%r15, %rcx
	callq	_wc_DhAgree
	testq	%rax, %rax
	jne	LBB0_5
## %bb.4:
	movq	48(%rbp), %rax
	movq	-48(%rbp), %rcx
	movq	%rcx, (%rax)
	xorl	%r14d, %r14d
LBB0_5:
	movq	%rbx, %rdi
	callq	_wc_FreeDhKey
	movq	%rbx, %rdi
	callq	_os_free
	jmp	LBB0_6
LBB0_1:
	movl	$-1, %r14d
LBB0_6:
	movl	%r14d, %eax
	addq	$32, %rsp
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_crypto_dh_derive_secret        ; -- Begin function crypto_dh_derive_secret
	.p2align	2
_crypto_dh_derive_secret:               ; @crypto_dh_derive_secret
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #80
	.cfi_def_cfa_offset 80
	stp	x24, x23, [sp, #16]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #32]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #48]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #64]             ; 16-byte Folded Spill
	add	x29, sp, #64
	.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, x7
	mov	x21, x6
	mov	x22, x5
	mov	x23, x2
	mov	x24, x1
	str	w0, [sp, #12]
	mov	w0, #4
	bl	_os_malloc
	cbz	x0, LBB0_5
; %bb.1:
	mov	x19, x0
	bl	_wc_InitDhKey
	add	x3, sp, #12
	mov	x0, x19
	mov	x1, x24
	mov	x2, x23
	mov	w4, #1
	bl	_wc_DhSetKey
	cbnz	x0, LBB0_3
; %bb.2:
	ldp	x6, x1, [x29, #16]
	mov	x2, sp
	mov	x0, x19
	mov	x3, x22
	mov	x4, x21
	mov	x5, x20
	bl	_wc_DhAgree
	cbz	x0, LBB0_7
LBB0_3:
	mov	w20, #-1
LBB0_4:
	mov	x0, x19
	bl	_wc_FreeDhKey
	mov	x0, x19
	bl	_os_free
	b	LBB0_6
LBB0_5:
	mov	w20, #-1
LBB0_6:
	mov	x0, x20
	ldp	x29, x30, [sp, #64]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #48]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #32]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #80
	ret
LBB0_7:
	mov	w20, #0
	ldr	x8, [x29, #32]
	ldr	x9, [sp]
	str	x9, [x8]
	b	LBB0_4
	.cfi_endproc
                                        ; -- End function
.subsections_via_symbols
