	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function client_hello_decrypt_esni
_client_hello_decrypt_esni:             ## @client_hello_decrypt_esni
	.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	$56, %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, %r13
	movq	%rsi, %r12
	movq	%rdi, %rbx
	movq	$0, -48(%rbp)
	xorl	%edi, %edi
	cmpq	$0, (%rdx)
	sete	%dil
	callq	_assert
	movl	$16, %edi
	callq	_malloc
	movq	%rax, (%r13)
	testq	%rax, %rax
	je	LBB0_15
## %bb.1:
	movq	%rax, %rdi
	xorl	%esi, %esi
	movl	$16, %edx
	callq	_memset
	movq	(%rbx), %r14
	movq	(%r14), %rax
	testq	%rax, %rax
	je	LBB0_8
LBB0_2:                                 ## =>This Loop Header: Depth=1
                                        ##     Child Loop BB0_4 Depth 2
	movq	24(%rax), %rax
	movq	8(%rax), %rdx
	testq	%rdx, %rdx
	je	LBB0_8
## %bb.3:                               ##   in Loop: Header=BB0_2 Depth=1
	movq	16(%r15), %rcx
	movq	(%rcx), %rsi
	.p2align	4, 0x90
LBB0_4:                                 ##   Parent Loop BB0_2 Depth=1
                                        ## =>  This Inner Loop Header: Depth=2
	cmpq	%rsi, (%rdx)
	je	LBB0_6
## %bb.5:                               ##   in Loop: Header=BB0_4 Depth=2
	movq	24(%rax), %rdx
	addq	$16, %rax
	testq	%rdx, %rdx
	jne	LBB0_4
	jmp	LBB0_8
	.p2align	4, 0x90
LBB0_6:                                 ##   in Loop: Header=BB0_2 Depth=1
	movl	(%rax), %edi
	movl	40(%r15), %esi
	movq	16(%rcx), %rax
	movl	(%rax), %edx
	callq	_memcmp
	testq	%rax, %rax
	je	LBB0_18
## %bb.7:                               ##   in Loop: Header=BB0_2 Depth=1
	movq	8(%r14), %rax
	addq	$8, %r14
	testq	%rax, %rax
	jne	LBB0_2
LBB0_8:
	movq	_PTLS_ALERT_ILLEGAL_PARAMETER@GOTPCREL(%rip), %rax
LBB0_9:
	movl	(%rax), %ebx
LBB0_10:
	movq	-48(%rbp), %rdi
	testq	%rdi, %rdi
	je	LBB0_12
## %bb.11:
	callq	_ptls_aead_free
LBB0_12:
	testl	%ebx, %ebx
	je	LBB0_16
## %bb.13:
	cmpq	$0, (%r13)
	je	LBB0_17
## %bb.14:
	movq	%r13, %rdi
	movl	$1, %esi
	callq	_free_esni_secret
	jmp	LBB0_17
LBB0_15:
	movq	_PTLS_ERROR_NO_MEMORY@GOTPCREL(%rip), %rax
	movl	(%rax), %ebx
	jmp	LBB0_17
LBB0_16:
	xorl	%ebx, %ebx
LBB0_17:
	movl	%ebx, %eax
	addq	$56, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_18:
	movq	%r12, -80(%rbp)                 ## 8-byte Spill
	movq	(%r14), %rcx
	movl	16(%rcx), %edx
	movq	(%r13), %rax
	movl	%edx, 12(%rax)
	movq	8(%rcx), %r12
	movq	(%r12), %rdx
	testq	%rdx, %rdx
	je	LBB0_8
## %bb.19:
	movq	32(%r15), %rcx
	movq	(%rcx), %rcx
LBB0_20:                                ## =>This Inner Loop Header: Depth=1
	movq	8(%rdx), %rdx
	cmpq	%rcx, (%rdx)
	je	LBB0_22
## %bb.21:                              ##   in Loop: Header=BB0_20 Depth=1
	movq	8(%r12), %rdx
	addq	$8, %r12
	testq	%rdx, %rdx
	jne	LBB0_20
	jmp	LBB0_8
LBB0_22:
	movq	16(%r15), %rdx
	movq	16(%rdx), %rdi
	movl	4(%rax), %esi
	movl	40(%r15), %edx
	movl	24(%r15), %r8d
	movl	48(%r15), %r9d
	callq	_build_esni_contents_hash
	movl	%eax, %ebx
	testl	%eax, %eax
	jne	LBB0_10
## %bb.23:
	movq	(%r12), %rax
	movq	(%r13), %rdx
	addq	$8, %rdx
	movl	24(%r15), %ecx
	movq	%r12, %rdi
	xorl	%esi, %esi
	callq	*(%rax)
	movl	%eax, %ebx
	testl	%eax, %eax
	jne	LBB0_10
## %bb.24:
	movl	8(%r15), %edi
	movq	16(%r15), %rax
	movq	8(%rax), %rax
	subl	(%rax), %edi
	movq	(%r14), %rax
	movq	_PTLS_ESNI_NONCE_SIZE@GOTPCREL(%rip), %r12
	movl	(%r12), %ecx
	addl	(%rax), %ecx
	cmpl	%ecx, %edi
	jne	LBB0_8
## %bb.25:
	callq	_malloc
	movq	%rax, -56(%rbp)                 ## 8-byte Spill
	testq	%rax, %rax
	je	LBB0_30
## %bb.26:
	movq	16(%r15), %rdx
	movq	(%r13), %rax
	movl	4(%rax), %r8d
	movl	8(%rax), %ecx
	leaq	-48(%rbp), %rdi
	xorl	%esi, %esi
	callq	_create_esni_aead
	movl	%eax, %ebx
	testl	%eax, %eax
	jne	LBB0_33
## %bb.27:
	movq	-48(%rbp), %rdi
	movl	12(%r15), %edx
	movl	8(%r15), %ecx
	movl	(%r15), %eax
	movl	4(%r15), %r9d
	movl	%eax, (%rsp)
	movq	-56(%rbp), %rsi                 ## 8-byte Reload
	xorl	%r8d, %r8d
	callq	_ptls_aead_decrypt
	movq	(%r14), %rcx
	movl	(%r12), %edx
	addl	(%rcx), %edx
	cmpl	%edx, %eax
	jne	LBB0_31
## %bb.28:
	movq	-48(%rbp), %rdi
	callq	_ptls_aead_free
	movq	$0, -48(%rbp)
	movq	(%r14), %rax
	movslq	(%rax), %r15
	movl	(%r12), %edx
	cmpl	%edx, %r15d
	jge	LBB0_34
LBB0_29:
	movq	_PTLS_ALERT_ILLEGAL_PARAMETER@GOTPCREL(%rip), %rax
	jmp	LBB0_32
LBB0_30:
	movq	_PTLS_ERROR_NO_MEMORY@GOTPCREL(%rip), %rax
	jmp	LBB0_9
LBB0_31:
	movq	_PTLS_ALERT_DECRYPT_ERROR@GOTPCREL(%rip), %rax
LBB0_32:
	movl	(%rax), %ebx
LBB0_33:
	movq	-56(%rbp), %rdi                 ## 8-byte Reload
	callq	_free
	jmp	LBB0_10
LBB0_34:
	movq	-56(%rbp), %rbx                 ## 8-byte Reload
	addq	%rbx, %r15
	movq	(%r13), %rax
	movl	(%rax), %edi
	movq	%rbx, %rsi
	callq	_memcpy
	movslq	(%r12), %rax
	addq	%rbx, %rax
	movq	%rax, -72(%rbp)
	leaq	-64(%rbp), %rdi
	leaq	-72(%rbp), %rsi
	movq	%r15, %rdx
	callq	_client_hello_decode_server_name
	movl	%eax, %ebx
	testl	%eax, %eax
	jne	LBB0_33
## %bb.35:
	movq	-72(%rbp), %rax
	cmpq	%r15, %rax
	je	LBB0_38
LBB0_36:                                ## =>This Inner Loop Header: Depth=1
	cmpb	$0, (%rax)
	jne	LBB0_29
## %bb.37:                              ##   in Loop: Header=BB0_36 Depth=1
	incq	%rax
	movq	%rax, -72(%rbp)
	cmpq	%r15, %rax
	jne	LBB0_36
LBB0_38:
	movl	-64(%rbp), %edx
	movl	-60(%rbp), %esi
	movq	-56(%rbp), %rbx                 ## 8-byte Reload
	movq	%rbx, %rdi
	callq	_memmove
	movl	-64(%rbp), %esi
	movq	%rbx, %rdi
	callq	_ptls_iovec_init
	movq	-80(%rbp), %rcx                 ## 8-byte Reload
	movq	%rax, (%rcx)
	xorl	%ebx, %ebx
	jmp	LBB0_10
	.cfi_endproc
                                        ## -- End function
	.comm	_PTLS_ERROR_NO_MEMORY,4,2       ## @PTLS_ERROR_NO_MEMORY
	.comm	_PTLS_ALERT_ILLEGAL_PARAMETER,4,2 ## @PTLS_ALERT_ILLEGAL_PARAMETER
	.comm	_PTLS_ESNI_NONCE_SIZE,4,2       ## @PTLS_ESNI_NONCE_SIZE
	.comm	_PTLS_ALERT_DECRYPT_ERROR,4,2   ## @PTLS_ALERT_DECRYPT_ERROR
	.no_dead_strip	_client_hello_decrypt_esni
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function client_hello_decrypt_esni
_client_hello_decrypt_esni:             ; @client_hello_decrypt_esni
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #112
	.cfi_def_cfa_offset 112
	stp	x26, x25, [sp, #32]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #48]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #64]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #80]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #96]             ; 16-byte Folded Spill
	add	x29, sp, #96
	.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, x3
	mov	x19, x2
	mov	x20, x1
	mov	x22, x0
	str	xzr, [sp, #24]
	ldr	x8, [x2]
	cmp	x8, #0
	cset	w0, eq
	bl	_assert
	mov	w0, #16
	bl	_malloc
	str	x0, [x19]
	cbz	x0, LBB0_8
; %bb.1:
	mov	w1, #0
	mov	w2, #16
	bl	_memset
	ldr	x24, [x22]
	ldr	x8, [x24]
	cbz	x8, LBB0_13
LBB0_2:                                 ; =>This Loop Header: Depth=1
                                        ;     Child Loop BB0_4 Depth 2
	ldr	x8, [x8, #24]
	ldr	x10, [x8, #8]
	cbz	x10, LBB0_13
; %bb.3:                                ;   in Loop: Header=BB0_2 Depth=1
	ldr	x9, [x21, #16]
	ldr	x11, [x9]
LBB0_4:                                 ;   Parent Loop BB0_2 Depth=1
                                        ; =>  This Inner Loop Header: Depth=2
	ldr	x10, [x10]
	cmp	x10, x11
	b.eq	LBB0_6
; %bb.5:                                ;   in Loop: Header=BB0_4 Depth=2
	ldr	x10, [x8, #24]
	add	x8, x8, #16
	cbnz	x10, LBB0_4
	b	LBB0_13
LBB0_6:                                 ;   in Loop: Header=BB0_2 Depth=1
	ldr	w0, [x8]
	ldr	w1, [x21, #40]
	ldr	x8, [x9, #16]
	ldr	w2, [x8]
	bl	_memcmp
	cbz	x0, LBB0_9
; %bb.7:                                ;   in Loop: Header=BB0_2 Depth=1
	ldr	x8, [x24, #8]!
	cbnz	x8, LBB0_2
	b	LBB0_13
LBB0_8:
Lloh0:
	adrp	x8, _PTLS_ERROR_NO_MEMORY@GOTPAGE
Lloh1:
	ldr	x8, [x8, _PTLS_ERROR_NO_MEMORY@GOTPAGEOFF]
Lloh2:
	ldr	w23, [x8]
	b	LBB0_20
LBB0_9:
	ldr	x9, [x24]
	ldr	w10, [x9, #16]
	ldr	x8, [x19]
	str	w10, [x8, #12]
	ldr	x22, [x9, #8]
	ldr	x9, [x22]
	cbz	x9, LBB0_13
; %bb.10:
	ldr	x10, [x21, #32]
	ldr	x3, [x10]
LBB0_11:                                ; =>This Inner Loop Header: Depth=1
	ldr	x9, [x9, #8]
	ldr	x9, [x9]
	cmp	x9, x3
	b.eq	LBB0_21
; %bb.12:                               ;   in Loop: Header=BB0_11 Depth=1
	ldr	x9, [x22, #8]!
	cbnz	x9, LBB0_11
LBB0_13:
Lloh3:
	adrp	x8, _PTLS_ALERT_ILLEGAL_PARAMETER@GOTPAGE
Lloh4:
	ldr	x8, [x8, _PTLS_ALERT_ILLEGAL_PARAMETER@GOTPAGEOFF]
LBB0_14:
	ldr	w23, [x8]
LBB0_15:
	ldr	x0, [sp, #24]
	cbz	x0, LBB0_17
; %bb.16:
	bl	_ptls_aead_free
LBB0_17:
	cbz	w23, LBB0_20
; %bb.18:
	ldr	x8, [x19]
	cbz	x8, LBB0_20
; %bb.19:
	mov	x0, x19
	mov	w1, #1
	bl	_free_esni_secret
LBB0_20:
	mov	x0, x23
	ldp	x29, x30, [sp, #96]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #80]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #64]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #48]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #32]             ; 16-byte Folded Reload
	add	sp, sp, #112
	ret
LBB0_21:
	ldr	x9, [x21, #16]
	ldr	x0, [x9, #16]
	ldr	w1, [x8, #4]
	ldr	w2, [x21, #40]
	ldr	w4, [x21, #24]
	ldr	w5, [x21, #48]
	bl	_build_esni_contents_hash
	mov	x23, x0
	cbnz	w0, LBB0_15
; %bb.22:
	ldr	x8, [x22]
	ldr	x8, [x8]
	ldr	x9, [x19]
	add	x2, x9, #8
	ldr	w3, [x21, #24]
	mov	x0, x22
	mov	w1, #0
	blr	x8
	mov	x23, x0
	cbnz	w0, LBB0_15
; %bb.23:
	ldr	w8, [x21, #8]
	ldr	x9, [x21, #16]
	ldr	x9, [x9, #8]
	ldr	w9, [x9]
	sub	w0, w8, w9
	ldr	x8, [x24]
	ldr	w8, [x8]
Lloh5:
	adrp	x25, _PTLS_ESNI_NONCE_SIZE@GOTPAGE
Lloh6:
	ldr	x25, [x25, _PTLS_ESNI_NONCE_SIZE@GOTPAGEOFF]
	ldr	w9, [x25]
	add	w8, w9, w8
	cmp	w0, w8
	b.ne	LBB0_13
; %bb.24:
	bl	_malloc
	cbz	x0, LBB0_29
; %bb.25:
	mov	x22, x0
	ldr	x2, [x21, #16]
	ldr	x8, [x19]
	ldp	w4, w3, [x8, #4]
	add	x0, sp, #24
	mov	w1, #0
	bl	_create_esni_aead
	mov	x23, x0
	cbnz	w0, LBB0_32
; %bb.26:
	ldr	x0, [sp, #24]
	ldp	w3, w2, [x21, #8]
	ldp	w6, w5, [x21]
	mov	x1, x22
	mov	w4, #0
	bl	_ptls_aead_decrypt
	ldr	x8, [x24]
	ldr	w8, [x8]
	ldr	w9, [x25]
	add	w8, w9, w8
	cmp	w0, w8
	b.ne	LBB0_30
; %bb.27:
	ldr	x0, [sp, #24]
	bl	_ptls_aead_free
	str	xzr, [sp, #24]
	ldr	x8, [x24]
	ldrsw	x8, [x8]
	ldr	w2, [x25]
	cmp	w8, w2
	b.ge	LBB0_33
LBB0_28:
Lloh7:
	adrp	x8, _PTLS_ALERT_ILLEGAL_PARAMETER@GOTPAGE
Lloh8:
	ldr	x8, [x8, _PTLS_ALERT_ILLEGAL_PARAMETER@GOTPAGEOFF]
	b	LBB0_31
LBB0_29:
Lloh9:
	adrp	x8, _PTLS_ERROR_NO_MEMORY@GOTPAGE
Lloh10:
	ldr	x8, [x8, _PTLS_ERROR_NO_MEMORY@GOTPAGEOFF]
	b	LBB0_14
LBB0_30:
Lloh11:
	adrp	x8, _PTLS_ALERT_DECRYPT_ERROR@GOTPAGE
Lloh12:
	ldr	x8, [x8, _PTLS_ALERT_DECRYPT_ERROR@GOTPAGEOFF]
LBB0_31:
	ldr	w23, [x8]
LBB0_32:
	mov	x0, x22
	bl	_free
	b	LBB0_15
LBB0_33:
	add	x21, x22, x8
	ldr	x8, [x19]
	ldr	w0, [x8]
	mov	x1, x22
	bl	_memcpy
	ldrsw	x8, [x25]
	add	x8, x22, x8
	str	x8, [sp, #16]
	add	x0, sp, #8
	add	x1, sp, #16
	mov	x2, x21
	bl	_client_hello_decode_server_name
	mov	x23, x0
	cbnz	w0, LBB0_32
; %bb.34:
	ldr	x8, [sp, #16]
	cmp	x8, x21
	b.eq	LBB0_37
LBB0_35:                                ; =>This Inner Loop Header: Depth=1
	ldrb	w9, [x8]
	cbnz	w9, LBB0_28
; %bb.36:                               ;   in Loop: Header=BB0_35 Depth=1
	add	x8, x8, #1
	str	x8, [sp, #16]
	cmp	x8, x21
	b.ne	LBB0_35
LBB0_37:
	ldp	w2, w1, [sp, #8]
	mov	x0, x22
	bl	_memmove
	ldr	w1, [sp, #8]
	mov	x0, x22
	bl	_ptls_iovec_init
	mov	w23, #0
	str	x0, [x20]
	b	LBB0_15
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGot	Lloh3, Lloh4
	.loh AdrpLdrGot	Lloh5, Lloh6
	.loh AdrpLdrGot	Lloh7, Lloh8
	.loh AdrpLdrGot	Lloh9, Lloh10
	.loh AdrpLdrGot	Lloh11, Lloh12
	.cfi_endproc
                                        ; -- End function
	.comm	_PTLS_ERROR_NO_MEMORY,4,2       ; @PTLS_ERROR_NO_MEMORY
	.comm	_PTLS_ALERT_ILLEGAL_PARAMETER,4,2 ; @PTLS_ALERT_ILLEGAL_PARAMETER
	.comm	_PTLS_ESNI_NONCE_SIZE,4,2       ; @PTLS_ESNI_NONCE_SIZE
	.comm	_PTLS_ALERT_DECRYPT_ERROR,4,2   ; @PTLS_ALERT_DECRYPT_ERROR
	.no_dead_strip	_client_hello_decrypt_esni
.subsections_via_symbols
