	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function secp256r1_key_exchange
_secp256r1_key_exchange:                ## @secp256r1_key_exchange
	.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	%r8, %r14
	movq	%rcx, %rbx
	movq	%rdx, %r15
	movq	%rsi, %r13
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	%rax, -48(%rbp)
	movq	_SECP256R1_PRIVATE_KEY_SIZE@GOTPCREL(%rip), %rax
	movl	(%rax), %r12d
	movq	%r12, %rax
	shlq	$3, %rax
	callq	____chkstk_darwin
	addq	$15, %rax
	andq	$-16, %rax
	subq	%rax, %rsp
	movq	%rsp, %rdi
	movq	_SECP256R1_PUBLIC_KEY_SIZE@GOTPCREL(%rip), %rax
	movq	_PTLS_ALERT_DECRYPT_ERROR@GOTPCREL(%rip), %rcx
	cmpq	%rbx, (%rax)
	jne	LBB0_1
## %bb.2:
	movq	%r13, -80(%rbp)                 ## 8-byte Spill
	movq	(%r14), %r13
	movq	_TYPE_UNCOMPRESSED_PUBLIC_KEY@GOTPCREL(%rip), %rax
	cmpq	(%rax), %r13
	jne	LBB0_1
## %bb.3:
	movq	%r14, -72(%rbp)                 ## 8-byte Spill
	movq	%r15, -64(%rbp)                 ## 8-byte Spill
	movq	%rdi, -56(%rbp)                 ## 8-byte Spill
	movq	%rbx, %rdi
	callq	_malloc
	movq	_PTLS_ERROR_NO_MEMORY@GOTPCREL(%rip), %rbx
	testq	%rax, %rax
	je	LBB0_4
## %bb.5:
	movq	%rax, %r15
	movq	_SECP256R1_SHARED_SECRET_SIZE@GOTPCREL(%rip), %rax
	movq	(%rax), %rdi
	callq	_malloc
	testq	%rax, %rax
	je	LBB0_6
## %bb.7:
	movq	%rax, %r14
	movq	%r13, (%r15)
	movq	%r15, %rbx
	addq	$8, %rbx
	xorl	%eax, %eax
	callq	_uECC_secp256r1
	movq	%rbx, %rdi
	movq	-56(%rbp), %r13                 ## 8-byte Reload
	movq	%r13, %rsi
	movl	%eax, %edx
	callq	_uECC_make_key
	movq	-72(%rbp), %rbx                 ## 8-byte Reload
	addq	$8, %rbx
	xorl	%eax, %eax
	callq	_uECC_secp256r1
	movq	%rbx, %rdi
	movq	%r13, %rsi
	movq	%r14, %rdx
	movl	%eax, %ecx
	callq	_uECC_shared_secret
	testl	%eax, %eax
	je	LBB0_8
## %bb.13:
	movq	_SECP256R1_PUBLIC_KEY_SIZE@GOTPCREL(%rip), %rax
	movq	(%rax), %rsi
	movq	%r15, %rdi
	callq	_ptls_iovec_init
	movq	-80(%rbp), %rcx                 ## 8-byte Reload
	movq	%rax, (%rcx)
	movq	%rdx, 8(%rcx)
	movq	_SECP256R1_SHARED_SECRET_SIZE@GOTPCREL(%rip), %rax
	movq	(%rax), %rsi
	movq	%r14, %rdi
	callq	_ptls_iovec_init
	movq	-64(%rbp), %rcx                 ## 8-byte Reload
	movq	%rax, (%rcx)
	movq	%rdx, 8(%rcx)
	leal	(,%r12,8), %esi
	movq	%r13, %rdi
	callq	_ptls_clear_memory
	xorl	%eax, %eax
	jmp	LBB0_11
LBB0_1:
	xorl	%r14d, %r14d
	xorl	%r15d, %r15d
LBB0_9:
	movl	(%rcx), %ebx
	leal	(,%r12,8), %esi
	callq	_ptls_clear_memory
	testl	%ebx, %ebx
	movl	$0, %eax
	je	LBB0_11
## %bb.10:
	movq	%r14, %rdi
	callq	_free
	movq	%r15, %rdi
	callq	_free
	movl	%ebx, %eax
LBB0_11:
	movq	___stack_chk_guard@GOTPCREL(%rip), %rcx
	movq	(%rcx), %rcx
	cmpq	-48(%rbp), %rcx
	jne	LBB0_14
## %bb.12:
                                        ## kill: def $eax killed $eax killed $rax
	leaq	-40(%rbp), %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_4:
	xorl	%r14d, %r14d
	movq	%rbx, %rcx
	xorl	%r15d, %r15d
	movq	-56(%rbp), %rdi                 ## 8-byte Reload
	jmp	LBB0_9
LBB0_6:
	xorl	%r14d, %r14d
	movq	%rbx, %rcx
	movq	-56(%rbp), %rdi                 ## 8-byte Reload
	jmp	LBB0_9
LBB0_8:
	movq	%r13, %rdi
	movq	_PTLS_ALERT_DECRYPT_ERROR@GOTPCREL(%rip), %rcx
	jmp	LBB0_9
LBB0_14:
	callq	___stack_chk_fail
	.cfi_endproc
                                        ## -- End function
	.comm	_SECP256R1_PRIVATE_KEY_SIZE,4,2 ## @SECP256R1_PRIVATE_KEY_SIZE
	.comm	_SECP256R1_PUBLIC_KEY_SIZE,8,3  ## @SECP256R1_PUBLIC_KEY_SIZE
	.comm	_TYPE_UNCOMPRESSED_PUBLIC_KEY,8,3 ## @TYPE_UNCOMPRESSED_PUBLIC_KEY
	.comm	_PTLS_ALERT_DECRYPT_ERROR,4,2   ## @PTLS_ALERT_DECRYPT_ERROR
	.comm	_PTLS_ERROR_NO_MEMORY,4,2       ## @PTLS_ERROR_NO_MEMORY
	.comm	_SECP256R1_SHARED_SECRET_SIZE,8,3 ## @SECP256R1_SHARED_SECRET_SIZE
	.no_dead_strip	_secp256r1_key_exchange
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function secp256r1_key_exchange
_secp256r1_key_exchange:                ; @secp256r1_key_exchange
	.cfi_startproc
; %bb.0:
	stp	x28, x27, [sp, #-96]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 96
	stp	x26, x25, [sp, #16]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #32]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #48]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #64]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #80]             ; 16-byte Folded Spill
	add	x29, sp, #80
	.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
	.cfi_offset w27, -88
	.cfi_offset w28, -96
	sub	sp, sp, #16
	mov	x24, x4
	mov	x22, x2
	mov	x23, x1
Lloh0:
	adrp	x8, ___stack_chk_guard@GOTPAGE
Lloh1:
	ldr	x8, [x8, ___stack_chk_guard@GOTPAGEOFF]
Lloh2:
	ldr	x8, [x8]
	stur	x8, [x29, #-88]
Lloh3:
	adrp	x8, _SECP256R1_PRIVATE_KEY_SIZE@GOTPAGE
Lloh4:
	ldr	x8, [x8, _SECP256R1_PRIVATE_KEY_SIZE@GOTPAGEOFF]
Lloh5:
	ldr	w26, [x8]
	lsl	x8, x26, #3
	mov	x9, x8
Lloh6:
	adrp	x16, ___chkstk_darwin@GOTPAGE
Lloh7:
	ldr	x16, [x16, ___chkstk_darwin@GOTPAGEOFF]
	blr	x16
	mov	x9, sp
	add	x8, x8, #15
	and	x8, x8, #0xffffffff0
	sub	x19, x9, x8
	mov	sp, x19
Lloh8:
	adrp	x27, _SECP256R1_PUBLIC_KEY_SIZE@GOTPAGE
Lloh9:
	ldr	x27, [x27, _SECP256R1_PUBLIC_KEY_SIZE@GOTPAGEOFF]
	ldr	x8, [x27]
	cmp	x3, x8
	b.ne	LBB0_6
; %bb.1:
	ldr	x28, [x24]
Lloh10:
	adrp	x8, _TYPE_UNCOMPRESSED_PUBLIC_KEY@GOTPAGE
Lloh11:
	ldr	x8, [x8, _TYPE_UNCOMPRESSED_PUBLIC_KEY@GOTPAGEOFF]
Lloh12:
	ldr	x8, [x8]
	cmp	x28, x8
	b.ne	LBB0_6
; %bb.2:
	mov	x0, x3
	bl	_malloc
	mov	x20, x0
	cbz	x0, LBB0_12
; %bb.3:
Lloh13:
	adrp	x8, _SECP256R1_SHARED_SECRET_SIZE@GOTPAGE
Lloh14:
	ldr	x8, [x8, _SECP256R1_SHARED_SECRET_SIZE@GOTPAGEOFF]
Lloh15:
	ldr	x0, [x8]
	bl	_malloc
	mov	x21, x0
	cbz	x0, LBB0_13
; %bb.4:
	mov	x25, x20
	str	x28, [x25], #8
	bl	_uECC_secp256r1
	mov	x2, x0
	mov	x0, x25
	mov	x1, x19
	bl	_uECC_make_key
	add	x24, x24, #8
	bl	_uECC_secp256r1
	mov	x3, x0
	mov	x0, x24
	mov	x1, x19
	mov	x2, x21
	bl	_uECC_shared_secret
	cbz	w0, LBB0_7
; %bb.5:
	ldr	x1, [x27]
	mov	x0, x20
	bl	_ptls_iovec_init
	stp	x0, x1, [x23]
Lloh16:
	adrp	x8, _SECP256R1_SHARED_SECRET_SIZE@GOTPAGE
Lloh17:
	ldr	x8, [x8, _SECP256R1_SHARED_SECRET_SIZE@GOTPAGEOFF]
Lloh18:
	ldr	x1, [x8]
	mov	x0, x21
	bl	_ptls_iovec_init
	stp	x0, x1, [x22]
	lsl	w1, w26, #3
	mov	x0, x19
	bl	_ptls_clear_memory
	mov	w22, #0
	b	LBB0_10
LBB0_6:
	mov	x21, #0
	mov	x20, #0
LBB0_7:
Lloh19:
	adrp	x8, _PTLS_ALERT_DECRYPT_ERROR@GOTPAGE
Lloh20:
	ldr	x8, [x8, _PTLS_ALERT_DECRYPT_ERROR@GOTPAGEOFF]
LBB0_8:
	ldr	w22, [x8]
	lsl	w1, w26, #3
	mov	x0, x19
	bl	_ptls_clear_memory
	cbz	w22, LBB0_10
; %bb.9:
	mov	x0, x21
	bl	_free
	mov	x0, x20
	bl	_free
LBB0_10:
	ldur	x8, [x29, #-88]
Lloh21:
	adrp	x9, ___stack_chk_guard@GOTPAGE
Lloh22:
	ldr	x9, [x9, ___stack_chk_guard@GOTPAGEOFF]
Lloh23:
	ldr	x9, [x9]
	cmp	x9, x8
	b.ne	LBB0_14
; %bb.11:
	mov	x0, x22
	sub	sp, x29, #80
	ldp	x29, x30, [sp, #80]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #64]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #48]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #32]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #16]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp], #96             ; 16-byte Folded Reload
	ret
LBB0_12:
	mov	x21, #0
LBB0_13:
Lloh24:
	adrp	x8, _PTLS_ERROR_NO_MEMORY@GOTPAGE
Lloh25:
	ldr	x8, [x8, _PTLS_ERROR_NO_MEMORY@GOTPAGEOFF]
	b	LBB0_8
LBB0_14:
	bl	___stack_chk_fail
	.loh AdrpLdrGot	Lloh8, Lloh9
	.loh AdrpLdrGot	Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh10, Lloh11, Lloh12
	.loh AdrpLdrGotLdr	Lloh13, Lloh14, Lloh15
	.loh AdrpLdrGotLdr	Lloh16, Lloh17, Lloh18
	.loh AdrpLdrGot	Lloh19, Lloh20
	.loh AdrpLdrGotLdr	Lloh21, Lloh22, Lloh23
	.loh AdrpLdrGot	Lloh24, Lloh25
	.cfi_endproc
                                        ; -- End function
	.comm	_SECP256R1_PRIVATE_KEY_SIZE,4,2 ; @SECP256R1_PRIVATE_KEY_SIZE
	.comm	_SECP256R1_PUBLIC_KEY_SIZE,8,3  ; @SECP256R1_PUBLIC_KEY_SIZE
	.comm	_TYPE_UNCOMPRESSED_PUBLIC_KEY,8,3 ; @TYPE_UNCOMPRESSED_PUBLIC_KEY
	.comm	_PTLS_ALERT_DECRYPT_ERROR,4,2   ; @PTLS_ALERT_DECRYPT_ERROR
	.comm	_PTLS_ERROR_NO_MEMORY,4,2       ; @PTLS_ERROR_NO_MEMORY
	.comm	_SECP256R1_SHARED_SECRET_SIZE,8,3 ; @SECP256R1_SHARED_SECRET_SIZE
	.no_dead_strip	_secp256r1_key_exchange
.subsections_via_symbols
