	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_ecdh_simple_compute_key        ## -- Begin function ecdh_simple_compute_key
	.p2align	4, 0x90
_ecdh_simple_compute_key:               ## @ecdh_simple_compute_key
	.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	%rcx, %r15
	movq	%rdx, %r12
	movq	%rsi, -72(%rbp)                 ## 8-byte Spill
	movq	%rdi, %rbx
	xorl	%r14d, %r14d
	xorl	%eax, %eax
	callq	_BN_CTX_new
	movq	%rax, %r13
	testq	%rax, %rax
	je	LBB0_17
## %bb.1:
	movq	%r13, %rdi
	callq	_BN_CTX_start
	movq	%r13, %rdi
	callq	_BN_CTX_get
	movq	%rax, -56(%rbp)                 ## 8-byte Spill
	testq	%rax, %rax
	je	LBB0_15
## %bb.2:
	movq	%r12, -48(%rbp)                 ## 8-byte Spill
	movq	%rbx, -64(%rbp)                 ## 8-byte Spill
	movq	%r15, %rdi
	callq	_EC_KEY_get0_private_key
	testq	%rax, %rax
	je	LBB0_8
## %bb.3:
	movq	%rax, %r12
	movq	%r15, %rdi
	callq	_EC_KEY_get0_group
	movq	%rax, %rbx
	movq	%r15, %rdi
	callq	_EC_KEY_get_flags
	movq	_EC_FLAG_COFACTOR_ECDH@GOTPCREL(%rip), %rcx
	testl	%eax, (%rcx)
	je	LBB0_9
## %bb.4:
	xorl	%r14d, %r14d
	movq	%rbx, %r15
	movq	%rbx, %rdi
	movq	-56(%rbp), %rbx                 ## 8-byte Reload
	movq	%rbx, %rsi
	xorl	%edx, %edx
	callq	_EC_GROUP_get_cofactor
	testl	%eax, %eax
	je	LBB0_6
## %bb.5:
	movq	%rbx, %rdi
	movq	%rbx, %rsi
	movq	%r12, %rdx
	movq	%r13, %rcx
	callq	_BN_mul
	movq	%rbx, %r12
	testl	%eax, %eax
	jne	LBB0_10
LBB0_6:
	movq	_EC_F_ECDH_SIMPLE_COMPUTE_KEY@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movq	_ERR_R_MALLOC_FAILURE@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	callq	_ECerr
	jmp	LBB0_17
LBB0_8:
	movq	_EC_F_ECDH_SIMPLE_COMPUTE_KEY@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movq	_EC_R_MISSING_PRIVATE_KEY@GOTPCREL(%rip), %rax
	jmp	LBB0_16
LBB0_9:
	movq	%rbx, %r15
LBB0_10:
	movq	%r15, %rbx
	movq	%r15, %rdi
	callq	_EC_POINT_new
	testq	%rax, %rax
	je	LBB0_15
## %bb.11:
	movq	%rax, %r15
	xorl	%r14d, %r14d
	movq	%rbx, %rdi
	movq	%rax, %rsi
	xorl	%edx, %edx
	movq	-48(%rbp), %rcx                 ## 8-byte Reload
	movq	%r12, %r8
	movq	%r13, %r9
	callq	_EC_POINT_mul
	testl	%eax, %eax
	je	LBB0_20
## %bb.12:
	xorl	%r14d, %r14d
	movq	%rbx, %rdi
	movq	%r15, %rsi
	movq	-56(%rbp), %r12                 ## 8-byte Reload
	movq	%r12, %rdx
	xorl	%ecx, %ecx
	movq	%r13, %r8
	callq	_EC_POINT_get_affine_coordinates
	testl	%eax, %eax
	je	LBB0_20
## %bb.13:
	movq	%rbx, %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
	movslq	%eax, %r14
	movq	%r12, %rdi
	callq	_BN_num_bytes
	cmpq	%r14, %rax
	jbe	LBB0_21
## %bb.14:
	movq	_EC_F_ECDH_SIMPLE_COMPUTE_KEY@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movq	_ERR_R_INTERNAL_ERROR@GOTPCREL(%rip), %rax
	jmp	LBB0_25
LBB0_15:
	movq	_EC_F_ECDH_SIMPLE_COMPUTE_KEY@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movq	_ERR_R_MALLOC_FAILURE@GOTPCREL(%rip), %rax
LBB0_16:
	movl	(%rax), %esi
	callq	_ECerr
	xorl	%r14d, %r14d
LBB0_17:
	xorl	%r15d, %r15d
LBB0_18:
	xorl	%ebx, %ebx
LBB0_19:
	movq	%r15, %rdi
	callq	_EC_POINT_clear_free
	movq	%r13, %rdi
	callq	_BN_CTX_end
	movq	%r13, %rdi
	callq	_BN_CTX_free
	movq	%rbx, %rdi
	callq	_OPENSSL_free
	movl	%r14d, %eax
	addq	$40, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_20:
	movq	_EC_F_ECDH_SIMPLE_COMPUTE_KEY@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movq	_EC_R_POINT_ARITHMETIC_FAILURE@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	callq	_ECerr
	jmp	LBB0_18
LBB0_21:
	movq	%rax, %r12
	movq	%r14, %rdi
	callq	_OPENSSL_malloc
	testq	%rax, %rax
	je	LBB0_24
## %bb.22:
	movq	%rax, %rbx
	movq	%r14, %rdx
	subq	%r12, %rdx
	movq	%r14, -48(%rbp)                 ## 8-byte Spill
	xorl	%r14d, %r14d
	movq	%rax, %rdi
	xorl	%esi, %esi
	callq	_memset
	movq	%rbx, %rsi
	addq	-48(%rbp), %rsi                 ## 8-byte Folded Reload
	subq	%r12, %rsi
	movq	-56(%rbp), %rdi                 ## 8-byte Reload
	callq	_BN_bn2bin
	cmpq	%rax, %r12
	jne	LBB0_26
## %bb.23:
	movq	-64(%rbp), %rax                 ## 8-byte Reload
	movq	%rbx, (%rax)
	movq	-72(%rbp), %rax                 ## 8-byte Reload
	movq	-48(%rbp), %rcx                 ## 8-byte Reload
	movq	%rcx, (%rax)
	movl	$1, %r14d
	jmp	LBB0_18
LBB0_24:
	movq	_EC_F_ECDH_SIMPLE_COMPUTE_KEY@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movq	_ERR_R_MALLOC_FAILURE@GOTPCREL(%rip), %rax
LBB0_25:
	movl	(%rax), %esi
	callq	_ECerr
	xorl	%r14d, %r14d
	jmp	LBB0_18
LBB0_26:
	movq	_EC_F_ECDH_SIMPLE_COMPUTE_KEY@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movq	_ERR_R_BN_LIB@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	callq	_ECerr
	jmp	LBB0_19
	.cfi_endproc
                                        ## -- End function
	.comm	_EC_F_ECDH_SIMPLE_COMPUTE_KEY,4,2 ## @EC_F_ECDH_SIMPLE_COMPUTE_KEY
	.comm	_ERR_R_MALLOC_FAILURE,4,2       ## @ERR_R_MALLOC_FAILURE
	.comm	_EC_R_MISSING_PRIVATE_KEY,4,2   ## @EC_R_MISSING_PRIVATE_KEY
	.comm	_EC_FLAG_COFACTOR_ECDH,4,2      ## @EC_FLAG_COFACTOR_ECDH
	.comm	_EC_R_POINT_ARITHMETIC_FAILURE,4,2 ## @EC_R_POINT_ARITHMETIC_FAILURE
	.comm	_ERR_R_INTERNAL_ERROR,4,2       ## @ERR_R_INTERNAL_ERROR
	.comm	_ERR_R_BN_LIB,4,2               ## @ERR_R_BN_LIB
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_ecdh_simple_compute_key        ; -- Begin function ecdh_simple_compute_key
	.p2align	2
_ecdh_simple_compute_key:               ; @ecdh_simple_compute_key
	.cfi_startproc
; %bb.0:
	stp	x26, x25, [sp, #-80]!           ; 16-byte Folded Spill
	.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
	.cfi_offset w25, -72
	.cfi_offset w26, -80
	mov	x20, x3
	mov	x24, x2
	mov	x21, x1
	mov	x22, x0
	bl	_BN_CTX_new
	mov	x19, x0
	cbz	x0, LBB0_14
; %bb.1:
	mov	x0, x19
	bl	_BN_CTX_start
	mov	x0, x19
	bl	_BN_CTX_get
	cbz	x0, LBB0_11
; %bb.2:
	mov	x23, x0
	mov	x0, x20
	bl	_EC_KEY_get0_private_key
	cbz	x0, LBB0_12
; %bb.3:
	mov	x26, x0
	mov	x0, x20
	bl	_EC_KEY_get0_group
	mov	x25, x0
	mov	x0, x20
	bl	_EC_KEY_get_flags
Lloh0:
	adrp	x8, _EC_FLAG_COFACTOR_ECDH@GOTPAGE
Lloh1:
	ldr	x8, [x8, _EC_FLAG_COFACTOR_ECDH@GOTPAGEOFF]
Lloh2:
	ldr	w8, [x8]
	tst	w8, w0
	b.eq	LBB0_6
; %bb.4:
	mov	x0, x25
	mov	x1, x23
	mov	x2, #0
	bl	_EC_GROUP_get_cofactor
	cbz	w0, LBB0_11
; %bb.5:
	mov	x0, x23
	mov	x1, x23
	mov	x2, x26
	mov	x3, x19
	bl	_BN_mul
	mov	x26, x23
	cbz	w0, LBB0_11
LBB0_6:
	mov	x0, x25
	bl	_EC_POINT_new
	mov	x20, x0
	cbz	x0, LBB0_18
; %bb.7:
	mov	x0, x25
	mov	x1, x20
	mov	x2, #0
	mov	x3, x24
	mov	x4, x26
	mov	x5, x19
	bl	_EC_POINT_mul
	cbz	w0, LBB0_17
; %bb.8:
	mov	x0, x25
	mov	x1, x20
	mov	x2, x23
	mov	x3, #0
	mov	x4, x19
	bl	_EC_POINT_get_affine_coordinates
	cbz	w0, LBB0_17
; %bb.9:
	mov	x0, x25
	bl	_EC_GROUP_get_degree
	add	w8, w0, #7
	add	w9, w0, #14
	cmp	w8, #0
	csel	w8, w9, w8, lt
	sbfx	x25, x8, #3, #29
	mov	x0, x23
	bl	_BN_num_bytes
	cmp	x0, x25
	b.ls	LBB0_20
; %bb.10:
Lloh3:
	adrp	x8, _EC_F_ECDH_SIMPLE_COMPUTE_KEY@GOTPAGE
Lloh4:
	ldr	x8, [x8, _EC_F_ECDH_SIMPLE_COMPUTE_KEY@GOTPAGEOFF]
Lloh5:
	ldr	w0, [x8]
Lloh6:
	adrp	x8, _ERR_R_INTERNAL_ERROR@GOTPAGE
Lloh7:
	ldr	x8, [x8, _ERR_R_INTERNAL_ERROR@GOTPAGEOFF]
	b	LBB0_19
LBB0_11:
Lloh8:
	adrp	x8, _EC_F_ECDH_SIMPLE_COMPUTE_KEY@GOTPAGE
Lloh9:
	ldr	x8, [x8, _EC_F_ECDH_SIMPLE_COMPUTE_KEY@GOTPAGEOFF]
Lloh10:
	ldr	w0, [x8]
Lloh11:
	adrp	x8, _ERR_R_MALLOC_FAILURE@GOTPAGE
Lloh12:
	ldr	x8, [x8, _ERR_R_MALLOC_FAILURE@GOTPAGEOFF]
	b	LBB0_13
LBB0_12:
Lloh13:
	adrp	x8, _EC_F_ECDH_SIMPLE_COMPUTE_KEY@GOTPAGE
Lloh14:
	ldr	x8, [x8, _EC_F_ECDH_SIMPLE_COMPUTE_KEY@GOTPAGEOFF]
Lloh15:
	ldr	w0, [x8]
Lloh16:
	adrp	x8, _EC_R_MISSING_PRIVATE_KEY@GOTPAGE
Lloh17:
	ldr	x8, [x8, _EC_R_MISSING_PRIVATE_KEY@GOTPAGEOFF]
LBB0_13:
	ldr	w1, [x8]
	bl	_ECerr
LBB0_14:
	mov	w21, #0
	mov	x20, #0
LBB0_15:
	mov	x24, #0
LBB0_16:
	mov	x0, x20
	bl	_EC_POINT_clear_free
	mov	x0, x19
	bl	_BN_CTX_end
	mov	x0, x19
	bl	_BN_CTX_free
	mov	x0, x24
	bl	_OPENSSL_free
	mov	x0, x21
	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
	ldp	x26, x25, [sp], #80             ; 16-byte Folded Reload
	ret
LBB0_17:
Lloh18:
	adrp	x8, _EC_F_ECDH_SIMPLE_COMPUTE_KEY@GOTPAGE
Lloh19:
	ldr	x8, [x8, _EC_F_ECDH_SIMPLE_COMPUTE_KEY@GOTPAGEOFF]
Lloh20:
	ldr	w0, [x8]
Lloh21:
	adrp	x8, _EC_R_POINT_ARITHMETIC_FAILURE@GOTPAGE
Lloh22:
	ldr	x8, [x8, _EC_R_POINT_ARITHMETIC_FAILURE@GOTPAGEOFF]
	b	LBB0_19
LBB0_18:
Lloh23:
	adrp	x8, _EC_F_ECDH_SIMPLE_COMPUTE_KEY@GOTPAGE
Lloh24:
	ldr	x8, [x8, _EC_F_ECDH_SIMPLE_COMPUTE_KEY@GOTPAGEOFF]
Lloh25:
	ldr	w0, [x8]
Lloh26:
	adrp	x8, _ERR_R_MALLOC_FAILURE@GOTPAGE
Lloh27:
	ldr	x8, [x8, _ERR_R_MALLOC_FAILURE@GOTPAGEOFF]
LBB0_19:
	ldr	w1, [x8]
	bl	_ECerr
	mov	w21, #0
	b	LBB0_15
LBB0_20:
	mov	x26, x0
	mov	x0, x25
	bl	_OPENSSL_malloc
	mov	x24, x0
	cbz	x0, LBB0_23
; %bb.21:
	sub	x2, x25, x26
	mov	x0, x24
	mov	w1, #0
	bl	_memset
	add	x8, x24, x25
	sub	x1, x8, x26
	mov	x0, x23
	bl	_BN_bn2bin
	cmp	x26, x0
	b.ne	LBB0_24
; %bb.22:
	str	x24, [x22]
	str	x25, [x21]
	mov	w21, #1
	b	LBB0_15
LBB0_23:
Lloh28:
	adrp	x8, _EC_F_ECDH_SIMPLE_COMPUTE_KEY@GOTPAGE
Lloh29:
	ldr	x8, [x8, _EC_F_ECDH_SIMPLE_COMPUTE_KEY@GOTPAGEOFF]
Lloh30:
	ldr	w0, [x8]
Lloh31:
	adrp	x8, _ERR_R_MALLOC_FAILURE@GOTPAGE
Lloh32:
	ldr	x8, [x8, _ERR_R_MALLOC_FAILURE@GOTPAGEOFF]
	b	LBB0_25
LBB0_24:
Lloh33:
	adrp	x8, _EC_F_ECDH_SIMPLE_COMPUTE_KEY@GOTPAGE
Lloh34:
	ldr	x8, [x8, _EC_F_ECDH_SIMPLE_COMPUTE_KEY@GOTPAGEOFF]
Lloh35:
	ldr	w0, [x8]
Lloh36:
	adrp	x8, _ERR_R_BN_LIB@GOTPAGE
Lloh37:
	ldr	x8, [x8, _ERR_R_BN_LIB@GOTPAGEOFF]
LBB0_25:
	ldr	w1, [x8]
	bl	_ECerr
	mov	w21, #0
	b	LBB0_16
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGot	Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGot	Lloh11, Lloh12
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpLdrGot	Lloh16, Lloh17
	.loh AdrpLdrGotLdr	Lloh13, Lloh14, Lloh15
	.loh AdrpLdrGot	Lloh21, Lloh22
	.loh AdrpLdrGotLdr	Lloh18, Lloh19, Lloh20
	.loh AdrpLdrGot	Lloh26, Lloh27
	.loh AdrpLdrGotLdr	Lloh23, Lloh24, Lloh25
	.loh AdrpLdrGot	Lloh31, Lloh32
	.loh AdrpLdrGotLdr	Lloh28, Lloh29, Lloh30
	.loh AdrpLdrGot	Lloh36, Lloh37
	.loh AdrpLdrGotLdr	Lloh33, Lloh34, Lloh35
	.cfi_endproc
                                        ; -- End function
	.comm	_EC_F_ECDH_SIMPLE_COMPUTE_KEY,4,2 ; @EC_F_ECDH_SIMPLE_COMPUTE_KEY
	.comm	_ERR_R_MALLOC_FAILURE,4,2       ; @ERR_R_MALLOC_FAILURE
	.comm	_EC_R_MISSING_PRIVATE_KEY,4,2   ; @EC_R_MISSING_PRIVATE_KEY
	.comm	_EC_FLAG_COFACTOR_ECDH,4,2      ; @EC_FLAG_COFACTOR_ECDH
	.comm	_EC_R_POINT_ARITHMETIC_FAILURE,4,2 ; @EC_R_POINT_ARITHMETIC_FAILURE
	.comm	_ERR_R_INTERNAL_ERROR,4,2       ; @ERR_R_INTERNAL_ERROR
	.comm	_ERR_R_BN_LIB,4,2               ; @ERR_R_BN_LIB
.subsections_via_symbols
