	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function x25519_on_exchange
_x25519_on_exchange:                    ## @x25519_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	%r12
	pushq	%rbx
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movl	%esi, %r15d
	movq	%rdi, %r14
	movq	(%rdi), %rbx
	testq	%rdx, %rdx
	je	LBB0_1
## %bb.2:
	movq	_X25519_KEY_SIZE@GOTPCREL(%rip), %rax
	cmpq	%rcx, (%rax)
	jne	LBB0_3
## %bb.4:
	movl	(%rbx), %esi
	movl	4(%rbx), %eax
	movq	%rdx, %rdi
	movl	%eax, %edx
	xorl	%ecx, %ecx
	callq	_x25519_derive_secret
	movl	%eax, %r12d
	testl	%r15d, %r15d
	jne	LBB0_6
	jmp	LBB0_7
LBB0_1:
	xorl	%r12d, %r12d
	testl	%r15d, %r15d
	jne	LBB0_6
	jmp	LBB0_7
LBB0_3:
	movq	_PTLS_ALERT_DECRYPT_ERROR@GOTPCREL(%rip), %rax
	movl	(%rax), %r12d
	testl	%r15d, %r15d
	je	LBB0_7
LBB0_6:
	movl	(%rbx), %edi
	movl	$4, %esi
	callq	_ptls_clear_memory
	movq	%rbx, %rdi
	callq	_free
	movq	$0, (%r14)
LBB0_7:
	movl	%r12d, %eax
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_X25519_KEY_SIZE,8,3            ## @X25519_KEY_SIZE
	.comm	_PTLS_ALERT_DECRYPT_ERROR,4,2   ## @PTLS_ALERT_DECRYPT_ERROR
	.no_dead_strip	_x25519_on_exchange
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function x25519_on_exchange
_x25519_on_exchange:                    ; @x25519_on_exchange
	.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
	mov	x21, x1
	mov	x19, x0
	ldr	x20, [x0]
	cbz	x2, LBB0_3
; %bb.1:
Lloh0:
	adrp	x8, _X25519_KEY_SIZE@GOTPAGE
Lloh1:
	ldr	x8, [x8, _X25519_KEY_SIZE@GOTPAGEOFF]
Lloh2:
	ldr	x8, [x8]
	cmp	x3, x8
	b.ne	LBB0_4
; %bb.2:
	ldp	w1, w8, [x20]
	mov	x0, x2
	mov	x2, x8
	mov	x3, #0
                                        ; kill: def $w4 killed $w4 killed $x4
	bl	_x25519_derive_secret
	mov	x22, x0
	cbnz	w21, LBB0_5
	b	LBB0_6
LBB0_3:
	mov	w22, #0
	cbnz	w21, LBB0_5
	b	LBB0_6
LBB0_4:
Lloh3:
	adrp	x8, _PTLS_ALERT_DECRYPT_ERROR@GOTPAGE
Lloh4:
	ldr	x8, [x8, _PTLS_ALERT_DECRYPT_ERROR@GOTPAGEOFF]
Lloh5:
	ldr	w22, [x8]
	cbz	w21, LBB0_6
LBB0_5:
	ldr	w0, [x20]
	mov	w1, #4
	bl	_ptls_clear_memory
	mov	x0, x20
	bl	_free
	str	xzr, [x19]
LBB0_6:
	mov	x0, x22
	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	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.cfi_endproc
                                        ; -- End function
	.comm	_X25519_KEY_SIZE,8,3            ; @X25519_KEY_SIZE
	.comm	_PTLS_ALERT_DECRYPT_ERROR,4,2   ; @PTLS_ALERT_DECRYPT_ERROR
	.no_dead_strip	_x25519_on_exchange
.subsections_via_symbols
