	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function client_setup_esni
_client_setup_esni:                     ## @client_setup_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	$24, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%r8, %rbx
	movq	%rcx, %r15
	movq	%rdx, %r12
	movq	%rsi, %r14
	movq	%rdi, %r13
	movl	$56, %edi
	callq	_malloc
	movq	%rax, (%r14)
	testq	%rax, %rax
	je	LBB0_1
## %bb.2:
	movq	%rbx, -48(%rbp)                 ## 8-byte Spill
	xorl	%ebx, %ebx
	movq	%rax, %rdi
	xorl	%esi, %esi
	movl	$56, %edx
	callq	_memset
	movq	(%r14), %r9
	leaq	52(%r9), %rsi
	leaq	8(%r9), %rdx
	leaq	24(%r9), %rcx
	addq	$32, %r9
	leaq	-56(%rbp), %r8
	movq	%r13, %rdi
	pushq	%r12
	pushq	%r15
	callq	_parse_esni_keys
	addq	$16, %rsp
	testq	%rax, %rax
	je	LBB0_4
## %bb.3:
	movq	(%r14), %rdi
	callq	_free
	movq	$0, (%r14)
	jmp	LBB0_8
LBB0_1:
	movq	_PTLS_ERROR_NO_MEMORY@GOTPCREL(%rip), %rax
	movl	(%rax), %ebx
	jmp	LBB0_8
LBB0_4:
	movq	%r12, %r15
	shrq	$32, %r15
	movq	(%r14), %rax
	movl	48(%rax), %edi
	movl	$4, %esi
	callq	*(%r13)
	movq	(%r14), %rax
	movq	24(%rax), %rcx
	movl	(%rcx), %edi
	movl	16(%rax), %esi
	movl	%r15d, %edx
	movl	%r12d, %ecx
	callq	_ptls_calc_hash
	movl	%eax, %r15d
	testl	%eax, %eax
	jne	LBB0_7
## %bb.5:
	movq	(%r14), %rsi
	movq	8(%rsi), %rdi
	leaq	44(%rsi), %rdx
	movq	-56(%rbp), %rcx
	callq	*(%rdi)
	movl	%eax, %r15d
	testl	%eax, %eax
	jne	LBB0_7
## %bb.6:
	movq	(%r14), %rax
	movq	24(%rax), %rcx
	movl	(%rcx), %edi
	movl	40(%rax), %esi
	movl	16(%rax), %edx
	movq	8(%rax), %rcx
	movl	8(%rcx), %ecx
	movl	(%rax), %r8d
	movq	-48(%rbp), %r9                  ## 8-byte Reload
	callq	_build_esni_contents_hash
	movl	%eax, %r15d
	testl	%eax, %eax
	je	LBB0_8
LBB0_7:
	movq	%r14, %rdi
	xorl	%esi, %esi
	callq	_free_esni_secret
	movl	%r15d, %ebx
LBB0_8:
	movl	%ebx, %eax
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_PTLS_ERROR_NO_MEMORY,4,2       ## @PTLS_ERROR_NO_MEMORY
	.no_dead_strip	_client_setup_esni
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function client_setup_esni
_client_setup_esni:                     ; @client_setup_esni
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #80
	.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
	mov	x20, x4
	mov	x23, x3
	mov	x21, x2
	mov	x19, x1
	mov	x22, x0
	mov	w0, #56
	bl	_malloc
	str	x0, [x19]
	cbz	x0, LBB0_3
; %bb.1:
	mov	w1, #0
	mov	w2, #56
	bl	_memset
	ldr	x8, [x19]
	add	x1, x8, #52
	add	x2, x8, #8
	add	x3, x8, #24
	add	x5, x8, #32
	add	x4, sp, #8
	mov	x0, x22
	mov	x6, x23
	mov	x7, x21
	bl	_parse_esni_keys
	cbz	x0, LBB0_4
; %bb.2:
	ldr	x0, [x19]
	bl	_free
	mov	w21, #0
	str	xzr, [x19]
	b	LBB0_8
LBB0_3:
Lloh0:
	adrp	x8, _PTLS_ERROR_NO_MEMORY@GOTPAGE
Lloh1:
	ldr	x8, [x8, _PTLS_ERROR_NO_MEMORY@GOTPAGEOFF]
Lloh2:
	ldr	w21, [x8]
	b	LBB0_8
LBB0_4:
	lsr	x23, x21, #32
	ldr	x8, [x22]
	ldr	x9, [x19]
	ldr	w0, [x9, #48]
	mov	w1, #4
	blr	x8
	ldr	x8, [x19]
	ldr	x9, [x8, #24]
	ldr	w0, [x9]
	ldr	w1, [x8, #16]
	mov	x2, x23
	mov	x3, x21
	bl	_ptls_calc_hash
	mov	x21, x0
	cbnz	w0, LBB0_7
; %bb.5:
	ldr	x1, [x19]
	ldr	x0, [x1, #8]
	ldr	x8, [x0]
	add	x2, x1, #44
	ldr	x3, [sp, #8]
	blr	x8
	mov	x21, x0
	cbnz	w0, LBB0_7
; %bb.6:
	ldr	x8, [x19]
	ldr	x9, [x8, #24]
	ldr	w0, [x9]
	ldr	w1, [x8, #40]
	ldr	w2, [x8, #16]
	ldr	x9, [x8, #8]
	ldr	w3, [x9, #8]
	ldr	w4, [x8]
	mov	x5, x20
	bl	_build_esni_contents_hash
	mov	x21, x0
	cbz	w0, LBB0_8
LBB0_7:
	mov	x0, x19
	mov	w1, #0
	bl	_free_esni_secret
LBB0_8:
	mov	x0, x21
	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
	add	sp, sp, #80
	ret
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.cfi_endproc
                                        ; -- End function
	.comm	_PTLS_ERROR_NO_MEMORY,4,2       ; @PTLS_ERROR_NO_MEMORY
	.no_dead_strip	_client_setup_esni
.subsections_via_symbols
