	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function secp256r1_on_exchange
_secp256r1_on_exchange:                 ## @secp256r1_on_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	$24, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdi, %r12
	movq	(%rdi), %r14
	testq	%rdx, %rdx
	je	LBB0_6
## %bb.1:
	movq	%rdx, %rbx
	movq	_SECP256R1_PUBLIC_KEY_SIZE@GOTPCREL(%rip), %rax
	movq	_PTLS_ALERT_DECRYPT_ERROR@GOTPCREL(%rip), %rdx
	xorl	%r13d, %r13d
	cmpq	%rcx, (%rax)
	jne	LBB0_8
## %bb.2:
	movq	%r8, %r15
	movq	(%r8), %rax
	movq	_TYPE_UNCOMPRESSED_PUBLIC_KEY@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jne	LBB0_8
## %bb.3:
	movl	%esi, -44(%rbp)                 ## 4-byte Spill
	movq	_SECP256R1_SHARED_SECRET_SIZE@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	callq	_malloc
	testq	%rax, %rax
	je	LBB0_9
## %bb.4:
	addq	$8, %r15
	movl	(%r14), %ecx
	movl	%ecx, -48(%rbp)                 ## 4-byte Spill
	movq	%rax, -56(%rbp)                 ## 8-byte Spill
	xorl	%eax, %eax
	callq	_uECC_secp256r1
	movq	%r15, %rdi
	movl	-48(%rbp), %esi                 ## 4-byte Reload
	movq	-56(%rbp), %r15                 ## 8-byte Reload
	movq	%r15, %rdx
	movl	%eax, %ecx
	callq	_uECC_shared_secret
	testl	%eax, %eax
	movq	%r15, %rdi
	je	LBB0_10
## %bb.5:
	movq	_SECP256R1_SHARED_SECRET_SIZE@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	callq	_ptls_iovec_init
	movq	%rax, (%rbx)
	movq	%rdx, 8(%rbx)
	xorl	%r13d, %r13d
	movl	-44(%rbp), %esi                 ## 4-byte Reload
	testl	%esi, %esi
	jne	LBB0_14
	jmp	LBB0_15
LBB0_8:
	xorl	%edi, %edi
LBB0_11:
	movl	(%rdx), %ebx
	testl	%ebx, %ebx
	je	LBB0_13
## %bb.12:
	movl	%esi, %r15d
	callq	_free
	movl	%r15d, %esi
	movl	%ebx, %r13d
LBB0_13:
	testl	%esi, %esi
	je	LBB0_15
LBB0_14:
	movl	(%r14), %edi
	movl	$4, %esi
	callq	_ptls_clear_memory
	movq	%r14, %rdi
	callq	_free
	movq	$0, (%r12)
LBB0_15:
	movl	%r13d, %eax
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_6:
	xorl	%r13d, %r13d
	testl	%esi, %esi
	jne	LBB0_14
	jmp	LBB0_15
LBB0_9:
	movq	_PTLS_ERROR_NO_MEMORY@GOTPCREL(%rip), %rdx
	xorl	%edi, %edi
	movl	-44(%rbp), %esi                 ## 4-byte Reload
	jmp	LBB0_11
LBB0_10:
	movl	-44(%rbp), %esi                 ## 4-byte Reload
	movq	_PTLS_ALERT_DECRYPT_ERROR@GOTPCREL(%rip), %rdx
	jmp	LBB0_11
	.cfi_endproc
                                        ## -- End function
	.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	_SECP256R1_SHARED_SECRET_SIZE,4,2 ## @SECP256R1_SHARED_SECRET_SIZE
	.comm	_PTLS_ERROR_NO_MEMORY,4,2       ## @PTLS_ERROR_NO_MEMORY
	.no_dead_strip	_secp256r1_on_exchange
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function secp256r1_on_exchange
_secp256r1_on_exchange:                 ; @secp256r1_on_exchange
	.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	x21, x1
	mov	x19, x0
	ldr	x20, [x0]
	cbz	x2, LBB0_9
; %bb.1:
Lloh0:
	adrp	x8, _SECP256R1_PUBLIC_KEY_SIZE@GOTPAGE
Lloh1:
	ldr	x8, [x8, _SECP256R1_PUBLIC_KEY_SIZE@GOTPAGEOFF]
Lloh2:
	ldr	x8, [x8]
	cmp	x3, x8
	b.ne	LBB0_6
; %bb.2:
	mov	x24, x4
	ldr	x8, [x4]
Lloh3:
	adrp	x9, _TYPE_UNCOMPRESSED_PUBLIC_KEY@GOTPAGE
Lloh4:
	ldr	x9, [x9, _TYPE_UNCOMPRESSED_PUBLIC_KEY@GOTPAGEOFF]
Lloh5:
	ldr	x9, [x9]
	cmp	x8, x9
	b.ne	LBB0_6
; %bb.3:
	mov	x23, x2
Lloh6:
	adrp	x26, _SECP256R1_SHARED_SECRET_SIZE@GOTPAGE
Lloh7:
	ldr	x26, [x26, _SECP256R1_SHARED_SECRET_SIZE@GOTPAGEOFF]
	ldr	w0, [x26]
	bl	_malloc
	mov	x22, x0
	cbz	x0, LBB0_13
; %bb.4:
	add	x24, x24, #8
	ldr	w25, [x20]
	bl	_uECC_secp256r1
	mov	x3, x0
	mov	x0, x24
	mov	x1, x25
	mov	x2, x22
	bl	_uECC_shared_secret
	cbz	w0, LBB0_7
; %bb.5:
	ldr	w1, [x26]
	mov	x0, x22
	bl	_ptls_iovec_init
	mov	w24, #0
	stp	x0, x1, [x23]
	b	LBB0_10
LBB0_6:
	mov	x22, #0
LBB0_7:
Lloh8:
	adrp	x8, _PTLS_ALERT_DECRYPT_ERROR@GOTPAGE
Lloh9:
	ldr	x8, [x8, _PTLS_ALERT_DECRYPT_ERROR@GOTPAGEOFF]
Lloh10:
	ldr	w24, [x8]
	cbz	w24, LBB0_10
LBB0_8:
	mov	x0, x22
	bl	_free
	b	LBB0_10
LBB0_9:
	mov	w24, #0
LBB0_10:
	cbz	w21, LBB0_12
; %bb.11:
	ldr	w0, [x20]
	mov	w1, #4
	bl	_ptls_clear_memory
	mov	x0, x20
	bl	_free
	str	xzr, [x19]
LBB0_12:
	mov	x0, x24
	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_13:
Lloh11:
	adrp	x8, _PTLS_ERROR_NO_MEMORY@GOTPAGE
Lloh12:
	ldr	x8, [x8, _PTLS_ERROR_NO_MEMORY@GOTPAGEOFF]
Lloh13:
	ldr	w24, [x8]
	cbnz	w24, LBB0_8
	b	LBB0_10
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGot	Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.cfi_endproc
                                        ; -- End function
	.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	_SECP256R1_SHARED_SECRET_SIZE,4,2 ; @SECP256R1_SHARED_SECRET_SIZE
	.comm	_PTLS_ERROR_NO_MEMORY,4,2       ; @PTLS_ERROR_NO_MEMORY
	.no_dead_strip	_secp256r1_on_exchange
.subsections_via_symbols
