	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_ptls_handshake                 ## -- Begin function ptls_handshake
	.p2align	4, 0x90
_ptls_handshake:                        ## @ptls_handshake
	.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	$1096, %rsp                     ## imm = 0x448
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%r8, -1120(%rbp)                ## 8-byte Spill
	movq	%rcx, %r13
	movq	%rdx, %rbx
	movq	%rsi, %r14
	movq	%rdi, %r15
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	%rax, -48(%rbp)
	movl	(%rdi), %eax
	movq	_PTLS_STATE_POST_HANDSHAKE_MIN@GOTPCREL(%rip), %rcx
	xorl	%edi, %edi
	cmpl	(%rcx), %eax
	setl	%dil
	callq	_assert
	leaq	-1080(%rbp), %rsi
	movq	%r15, %rdi
	movq	%r14, %rdx
	callq	_init_record_message_emmitter
	movq	%r15, -1104(%rbp)               ## 8-byte Spill
	cmpl	$128, (%r15)
	jne	LBB0_5
## %bb.1:
	testq	%rbx, %rbx
	je	LBB0_2
## %bb.3:
	xorl	%edi, %edi
	cmpq	$0, (%r13)
	sete	%dil
	jmp	LBB0_4
LBB0_5:
	movq	-1080(%rbp), %rax
	movq	(%rax), %r12
	movq	(%r13), %r15
	leaq	(%rbx,%r15,4), %r14
	shlq	$2, %r15
	leaq	-1096(%rbp), %rdi
	leaq	-1072(%rbp), %rsi
	movl	$1024, %edx                     ## imm = 0x400
	callq	_ptls_buffer_init
	testq	%r15, %r15
	je	LBB0_6
## %bb.7:
	movq	%r12, -1112(%rbp)               ## 8-byte Spill
	movq	%r13, -1088(%rbp)               ## 8-byte Spill
	leaq	-1096(%rbp), %r15
	leaq	-1128(%rbp), %r13
	.p2align	4, 0x90
LBB0_8:                                 ## =>This Inner Loop Header: Depth=1
	movq	%r14, %rax
	subq	%rbx, %rax
	sarq	$2, %rax
	movq	%rax, -1128(%rbp)
	movq	-1104(%rbp), %rdi               ## 8-byte Reload
	leaq	-1080(%rbp), %rsi
	movq	%r15, %rdx
	movq	%rbx, %rcx
	movq	%r13, %r8
	movq	-1120(%rbp), %r9                ## 8-byte Reload
	callq	_handle_input
	movl	%eax, %r12d
	movq	-1128(%rbp), %rax
	leaq	(%rbx,%rax,4), %rbx
	xorl	%edi, %edi
	cmpq	$0, -1096(%rbp)
	sete	%dil
	callq	_assert
	cmpl	$130, %r12d
	jne	LBB0_10
## %bb.9:                               ##   in Loop: Header=BB0_8 Depth=1
	cmpq	%r14, %rbx
	jne	LBB0_8
LBB0_10:
	leaq	-1096(%rbp), %rdi
	callq	_ptls_buffer_dispose
	leal	-129(%r12), %eax
	cmpl	$2, %eax
	jae	LBB0_11
LBB0_17:
	movq	-1088(%rbp), %r13               ## 8-byte Reload
	jmp	LBB0_18
LBB0_2:
	movl	$1, %edi
LBB0_4:
	callq	_assert
	movq	-1104(%rbp), %rbx               ## 8-byte Reload
	movq	8(%rbx), %rax
	movq	(%rax), %rax
	xorl	%edi, %edi
	cmpq	$0, (%rax)
	setne	%dil
	callq	_assert
	leaq	-1080(%rbp), %rsi
	movq	%rbx, %rdi
	movq	-1120(%rbp), %rdx               ## 8-byte Reload
	xorl	%ecx, %ecx
	callq	_send_client_hello
	movl	%eax, %r12d
	jmp	LBB0_19
LBB0_6:
	leaq	-1096(%rbp), %rdi
	callq	_ptls_buffer_dispose
	movl	$130, %r12d
	jmp	LBB0_18
LBB0_11:
	testl	%r12d, %r12d
	movq	-1088(%rbp), %r13               ## 8-byte Reload
	je	LBB0_18
## %bb.12:
	movq	-1080(%rbp), %rax
	movl	8(%rax), %edi
	movq	-1112(%rbp), %r15               ## 8-byte Reload
	addl	%r15d, %edi
	movq	(%rax), %rsi
	subq	%r15, %rsi
	callq	_ptls_clear_memory
	movq	-1080(%rbp), %rax
	movq	%r15, (%rax)
	movl	%r12d, %edi
	callq	_PTLS_ERROR_GET_CLASS
	movq	_PTLS_ERROR_CLASS_PEER_ALERT@GOTPCREL(%rip), %rcx
	cmpl	(%rcx), %eax
	jne	LBB0_13
LBB0_18:
	subq	%rbx, %r14
	sarq	$2, %r14
	subq	%r14, (%r13)
LBB0_19:
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	cmpq	-48(%rbp), %rax
	jne	LBB0_21
## %bb.20:
	movl	%r12d, %eax
	addq	$1096, %rsp                     ## imm = 0x448
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_13:
	movq	-1080(%rbp), %r13
	movq	_PTLS_ALERT_LEVEL_FATAL@GOTPCREL(%rip), %rax
	movl	(%rax), %r15d
	movl	%r12d, %edi
	callq	_PTLS_ERROR_GET_CLASS
	movq	_PTLS_ERROR_CLASS_SELF_ALERT@GOTPCREL(%rip), %rdx
	movl	%r12d, %ecx
	cmpl	(%rdx), %eax
	je	LBB0_15
## %bb.14:
	movq	_PTLS_ALERT_INTERNAL_ERROR@GOTPCREL(%rip), %rax
	movl	(%rax), %ecx
LBB0_15:
	movq	-1104(%rbp), %rdi               ## 8-byte Reload
	movq	%r13, %rsi
	movl	%r15d, %edx
	callq	_ptls_send_alert
	testl	%eax, %eax
	je	LBB0_17
## %bb.16:
	movq	-1080(%rbp), %rax
	movq	-1112(%rbp), %rcx               ## 8-byte Reload
	movq	%rcx, (%rax)
	jmp	LBB0_17
LBB0_21:
	callq	___stack_chk_fail
	.cfi_endproc
                                        ## -- End function
	.comm	_PTLS_STATE_POST_HANDSHAKE_MIN,4,2 ## @PTLS_STATE_POST_HANDSHAKE_MIN
	.comm	_PTLS_ERROR_CLASS_PEER_ALERT,4,2 ## @PTLS_ERROR_CLASS_PEER_ALERT
	.comm	_PTLS_ALERT_LEVEL_FATAL,4,2     ## @PTLS_ALERT_LEVEL_FATAL
	.comm	_PTLS_ERROR_CLASS_SELF_ALERT,4,2 ## @PTLS_ERROR_CLASS_SELF_ALERT
	.comm	_PTLS_ALERT_INTERNAL_ERROR,4,2  ## @PTLS_ALERT_INTERNAL_ERROR
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_ptls_handshake                 ; -- Begin function ptls_handshake
	.p2align	2
_ptls_handshake:                        ; @ptls_handshake
	.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, #1056
	mov	x23, x4
	mov	x19, x3
	mov	x20, x2
	mov	x22, x1
	mov	x21, x0
Lloh0:
	adrp	x8, ___stack_chk_guard@GOTPAGE
Lloh1:
	ldr	x8, [x8, ___stack_chk_guard@GOTPAGEOFF]
Lloh2:
	ldr	x8, [x8]
	stur	x8, [x29, #-88]
	ldr	w8, [x0]
Lloh3:
	adrp	x9, _PTLS_STATE_POST_HANDSHAKE_MIN@GOTPAGE
Lloh4:
	ldr	x9, [x9, _PTLS_STATE_POST_HANDSHAKE_MIN@GOTPAGEOFF]
Lloh5:
	ldr	w9, [x9]
	cmp	w8, w9
	cset	w0, lt
	bl	_assert
	add	x1, sp, #16
	mov	x0, x21
	mov	x2, x22
	bl	_init_record_message_emmitter
	ldr	w8, [x21]
	cmp	w8, #128
	b.ne	LBB0_3
; %bb.1:
	cbz	x20, LBB0_11
; %bb.2:
	ldr	x8, [x19]
	cmp	x8, #0
	cset	w0, eq
	b	LBB0_12
LBB0_3:
	ldr	x8, [sp, #16]
	ldr	x26, [x8]
	ldr	x8, [x19]
	lsl	x22, x8, #2
	add	x25, x20, x22
	add	x0, sp, #8
	add	x1, sp, #24
	mov	w2, #1024
	bl	_ptls_buffer_init
	cbz	x22, LBB0_13
LBB0_4:                                 ; =>This Inner Loop Header: Depth=1
	sub	x8, x25, x20
	asr	x8, x8, #2
	str	x8, [sp]
	add	x1, sp, #16
	add	x2, sp, #8
	mov	x4, sp
	mov	x0, x21
	mov	x3, x20
	mov	x5, x23
	bl	_handle_input
	mov	x22, x0
	ldr	x8, [sp]
	add	x20, x20, x8, lsl #2
	ldr	x8, [sp, #8]
	cmp	x8, #0
	cset	w0, eq
	bl	_assert
	cmp	w22, #130
	b.ne	LBB0_6
; %bb.5:                                ;   in Loop: Header=BB0_4 Depth=1
	cmp	x20, x25
	b.ne	LBB0_4
LBB0_6:
	add	x0, sp, #8
	bl	_ptls_buffer_dispose
	sub	w8, w22, #129
	cmp	w8, #2
	b.lo	LBB0_14
; %bb.7:
	cbz	w22, LBB0_14
; %bb.8:
	ldr	x8, [sp, #16]
	ldr	w9, [x8, #8]
	add	w0, w9, w26
	ldr	x8, [x8]
	sub	x1, x8, x26
	bl	_ptls_clear_memory
	ldr	x8, [sp, #16]
	str	x26, [x8]
	mov	x0, x22
	bl	_PTLS_ERROR_GET_CLASS
Lloh6:
	adrp	x8, _PTLS_ERROR_CLASS_PEER_ALERT@GOTPAGE
Lloh7:
	ldr	x8, [x8, _PTLS_ERROR_CLASS_PEER_ALERT@GOTPAGEOFF]
Lloh8:
	ldr	w8, [x8]
	cmp	w0, w8
	b.eq	LBB0_14
; %bb.9:
	ldr	x23, [sp, #16]
Lloh9:
	adrp	x8, _PTLS_ALERT_LEVEL_FATAL@GOTPAGE
Lloh10:
	ldr	x8, [x8, _PTLS_ALERT_LEVEL_FATAL@GOTPAGEOFF]
Lloh11:
	ldr	w24, [x8]
	mov	x0, x22
	bl	_PTLS_ERROR_GET_CLASS
Lloh12:
	adrp	x8, _PTLS_ERROR_CLASS_SELF_ALERT@GOTPAGE
Lloh13:
	ldr	x8, [x8, _PTLS_ERROR_CLASS_SELF_ALERT@GOTPAGEOFF]
Lloh14:
	ldr	w8, [x8]
Lloh15:
	adrp	x9, _PTLS_ALERT_INTERNAL_ERROR@GOTPAGE
Lloh16:
	ldr	x9, [x9, _PTLS_ALERT_INTERNAL_ERROR@GOTPAGEOFF]
Lloh17:
	ldr	w9, [x9]
	cmp	w0, w8
	csel	w3, w22, w9, eq
	mov	x0, x21
	mov	x1, x23
	mov	x2, x24
	bl	_ptls_send_alert
	cbz	w0, LBB0_14
; %bb.10:
	ldr	x8, [sp, #16]
	str	x26, [x8]
	b	LBB0_14
LBB0_11:
	mov	w0, #1
LBB0_12:
	bl	_assert
	ldr	x8, [x21, #8]
	ldr	x8, [x8]
	ldr	x8, [x8]
	cmp	x8, #0
	cset	w0, ne
	bl	_assert
	add	x1, sp, #16
	mov	x0, x21
	mov	x2, x23
	mov	x3, #0
	bl	_send_client_hello
	mov	x22, x0
	b	LBB0_15
LBB0_13:
	add	x0, sp, #8
	bl	_ptls_buffer_dispose
	mov	w22, #130
LBB0_14:
	sub	x8, x25, x20
	ldr	x9, [x19]
	sub	x8, x9, x8, asr #2
	str	x8, [x19]
LBB0_15:
	ldur	x8, [x29, #-88]
Lloh18:
	adrp	x9, ___stack_chk_guard@GOTPAGE
Lloh19:
	ldr	x9, [x9, ___stack_chk_guard@GOTPAGEOFF]
Lloh20:
	ldr	x9, [x9]
	cmp	x9, x8
	b.ne	LBB0_17
; %bb.16:
	mov	x0, x22
	add	sp, sp, #1056
	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_17:
	bl	___stack_chk_fail
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh15, Lloh16, Lloh17
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh18, Lloh19, Lloh20
	.cfi_endproc
                                        ; -- End function
	.comm	_PTLS_STATE_POST_HANDSHAKE_MIN,4,2 ; @PTLS_STATE_POST_HANDSHAKE_MIN
	.comm	_PTLS_ERROR_CLASS_PEER_ALERT,4,2 ; @PTLS_ERROR_CLASS_PEER_ALERT
	.comm	_PTLS_ALERT_LEVEL_FATAL,4,2     ; @PTLS_ALERT_LEVEL_FATAL
	.comm	_PTLS_ERROR_CLASS_SELF_ALERT,4,2 ; @PTLS_ERROR_CLASS_SELF_ALERT
	.comm	_PTLS_ALERT_INTERNAL_ERROR,4,2  ; @PTLS_ALERT_INTERNAL_ERROR
.subsections_via_symbols
