	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function pkey_ec_derive
_pkey_ec_derive:                        ## @pkey_ec_derive
	.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	8(%rdi), %rcx
	testq	%rcx, %rcx
	je	LBB0_2
## %bb.1:
	movq	(%rdi), %rax
	testq	%rax, %rax
	je	LBB0_2
## %bb.3:
	movq	%rdx, %r14
	movq	%rsi, %r12
	movq	16(%rdi), %rdx
	movq	(%rdx), %r15
	testq	%r15, %r15
	je	LBB0_4
## %bb.5:
	testq	%r12, %r12
	je	LBB0_6
LBB0_7:
	movl	(%rax), %edi
	callq	_EC_KEY_get0_public_key
	movq	(%r14), %rsi
	xorl	%ebx, %ebx
	movq	%r12, %rdi
	movq	%rax, %rdx
	movq	%r15, %rcx
	xorl	%r8d, %r8d
	callq	_ECDH_compute_key
	testl	%eax, %eax
	jle	LBB0_10
## %bb.8:
	movl	%eax, %eax
	jmp	LBB0_9
LBB0_2:
	movq	_EC_F_PKEY_EC_DERIVE@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movq	_EC_R_KEYS_NOT_SET@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	callq	_ECerr
	xorl	%ebx, %ebx
	jmp	LBB0_10
LBB0_4:
	movq	(%rcx), %r15
	testq	%r12, %r12
	jne	LBB0_7
LBB0_6:
	movq	%r15, %rdi
	callq	_EC_KEY_get0_group
	movq	%rax, %rdi
	callq	_EC_GROUP_get_degree
                                        ## kill: def $eax killed $eax def $rax
	leal	7(%rax), %ecx
	addl	$14, %eax
	testl	%ecx, %ecx
	cmovnsl	%ecx, %eax
	sarl	$3, %eax
	cltq
LBB0_9:
	movq	%rax, (%r14)
	movl	$1, %ebx
LBB0_10:
	movl	%ebx, %eax
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_EC_F_PKEY_EC_DERIVE,4,2        ## @EC_F_PKEY_EC_DERIVE
	.comm	_EC_R_KEYS_NOT_SET,4,2          ## @EC_R_KEYS_NOT_SET
	.no_dead_strip	_pkey_ec_derive
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function pkey_ec_derive
_pkey_ec_derive:                        ; @pkey_ec_derive
	.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
	ldr	x9, [x0, #8]
	cbz	x9, LBB0_6
; %bb.1:
	ldr	x8, [x0]
	cbz	x8, LBB0_6
; %bb.2:
	mov	x19, x2
	mov	x20, x1
	ldr	x10, [x0, #16]
	ldr	x21, [x10]
	cbz	x21, LBB0_8
; %bb.3:
	cbz	x20, LBB0_9
LBB0_4:
	ldr	w0, [x8]
	bl	_EC_KEY_get0_public_key
	mov	x2, x0
	ldr	x1, [x19]
	mov	x0, x20
	mov	x3, x21
	mov	w4, #0
	bl	_ECDH_compute_key
	cmp	w0, #1
	b.lt	LBB0_7
; %bb.5:
	mov	w8, w0
	b	LBB0_10
LBB0_6:
Lloh0:
	adrp	x8, _EC_F_PKEY_EC_DERIVE@GOTPAGE
Lloh1:
	ldr	x8, [x8, _EC_F_PKEY_EC_DERIVE@GOTPAGEOFF]
Lloh2:
	ldr	w0, [x8]
Lloh3:
	adrp	x8, _EC_R_KEYS_NOT_SET@GOTPAGE
Lloh4:
	ldr	x8, [x8, _EC_R_KEYS_NOT_SET@GOTPAGEOFF]
Lloh5:
	ldr	w1, [x8]
	bl	_ECerr
LBB0_7:
	mov	w0, #0
	b	LBB0_11
LBB0_8:
	ldr	x21, [x9]
	cbnz	x20, LBB0_4
LBB0_9:
	mov	x0, x21
	bl	_EC_KEY_get0_group
	bl	_EC_GROUP_get_degree
	add	w8, w0, #7
	add	w9, w0, #14
	cmp	w8, #0
	csel	w8, w9, w8, lt
	sbfx	x8, x8, #3, #29
LBB0_10:
	str	x8, [x19]
	mov	w0, #1
LBB0_11:
	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 AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.cfi_endproc
                                        ; -- End function
	.comm	_EC_F_PKEY_EC_DERIVE,4,2        ; @EC_F_PKEY_EC_DERIVE
	.comm	_EC_R_KEYS_NOT_SET,4,2          ; @EC_R_KEYS_NOT_SET
	.no_dead_strip	_pkey_ec_derive
.subsections_via_symbols
