	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function setup_traffic_protection
_setup_traffic_protection:              ## @setup_traffic_protection
	.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
	pushq	%rax
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movl	%r8d, %r12d
	movq	%rcx, %r14
	movl	%esi, %r15d
	movq	%rdi, %rbx
	xorl	%eax, %eax
	testl	%esi, %esi
	setne	%al
	shlq	$5, %rax
	leaq	(%rax,%rdi), %r13
	addq	$24, %r13
	testq	%rdx, %rdx
	je	LBB0_2
## %bb.1:
	movq	(%rbx), %rdi
	movq	16(%r13), %rsi
	callq	_derive_secret
	testl	%eax, %eax
	jne	LBB0_10
LBB0_2:
	movq	%r14, (%r13)
	movq	8(%rbx), %rax
	movq	8(%rax), %rdi
	testq	%rdi, %rdi
	je	LBB0_5
## %bb.3:
	xorl	%eax, %eax
	testl	%r12d, %r12d
	jne	LBB0_10
## %bb.4:
	movq	(%rdi), %rax
	movq	16(%r13), %r8
	movq	%rbx, %rsi
	movl	%r15d, %edx
	movq	%r14, %rcx
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	jmpq	*%rax                           ## TAILCALL
LBB0_5:
	movq	8(%r13), %rdi
	testq	%rdi, %rdi
	je	LBB0_7
## %bb.6:
	callq	_ptls_aead_free
	movq	8(%rbx), %rax
LBB0_7:
	movq	16(%rbx), %rcx
	movl	(%rcx), %esi
	movl	4(%rcx), %edi
	movq	16(%r13), %rcx
	movl	(%rax), %r8d
	movl	%r15d, %edx
	callq	_ptls_aead_new
	movq	%rax, 8(%r13)
	testq	%rax, %rax
	je	LBB0_8
## %bb.9:
	movq	$0, 24(%r13)
	movq	%rbx, %rdi
	callq	_ptls_is_server
	movslq	%r15d, %rcx
	xorl	%edx, %edx
	cmpq	%rcx, %rax
	sete	%dl
	shlq	$5, %rdx
	leaq	_setup_traffic_protection.log_labels(%rip), %r12
	addq	%r12, %rdx
	movq	(%rdx,%r14,8), %r15
	movq	16(%r13), %rdi
	movq	(%rbx), %rax
	movq	(%rax), %rax
	movq	(%rax), %rax
	movl	(%rax), %esi
	callq	_ptls_iovec_init
	movq	%rbx, %rdi
	movq	%r15, %rsi
	movl	%eax, %edx
	callq	_log_secret
	movq	%rbx, %rdi
	callq	_ptls_is_server
	shlq	$5, %rax
	addq	%r12, %rax
	movq	(%rax,%r14,8), %rsi
	movq	8(%r13), %rax
	movq	16(%r13), %rcx
	movl	(%rcx), %edx
	movl	8(%rcx), %ecx
	movq	(%rax), %rax
	movl	(%rax), %r8d
	movl	8(%rax), %r9d
	leaq	L_.str.5(%rip), %rdi
	callq	_PTLS_DEBUGF
	xorl	%eax, %eax
	jmp	LBB0_10
LBB0_8:
	movq	_PTLS_ERROR_NO_MEMORY@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
LBB0_10:
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.section	__DATA,__const
	.p2align	4                               ## @setup_traffic_protection.log_labels
_setup_traffic_protection.log_labels:
	.quad	0
	.quad	L_.str
	.quad	L_.str.1
	.quad	L_.str.2
	.quad	0
	.quad	0
	.quad	L_.str.3
	.quad	L_.str.4

	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"CLIENT_EARLY_TRAFFIC_SECRET"

L_.str.1:                               ## @.str.1
	.asciz	"CLIENT_HANDSHAKE_TRAFFIC_SECRET"

L_.str.2:                               ## @.str.2
	.asciz	"CLIENT_TRAFFIC_SECRET_0"

L_.str.3:                               ## @.str.3
	.asciz	"SERVER_HANDSHAKE_TRAFFIC_SECRET"

L_.str.4:                               ## @.str.4
	.asciz	"SERVER_TRAFFIC_SECRET_0"

	.comm	_PTLS_ERROR_NO_MEMORY,4,2       ## @PTLS_ERROR_NO_MEMORY
L_.str.5:                               ## @.str.5
	.asciz	"[%s] %02x%02x,%02x%02x\n"

	.no_dead_strip	_setup_traffic_protection
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function setup_traffic_protection
_setup_traffic_protection:              ; @setup_traffic_protection
	.cfi_startproc
; %bb.0:
	stp	x24, x23, [sp, #-64]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 64
	stp	x22, x21, [sp, #16]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #32]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #48]             ; 16-byte Folded Spill
	add	x29, sp, #48
	.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	x22, x4
	mov	x20, x3
	mov	x21, x1
	mov	x19, x0
	add	x8, x0, #56
	add	x9, x0, #24
	cmp	w1, #0
	csel	x23, x9, x8, eq
	cbz	x2, LBB0_2
; %bb.1:
	ldr	x0, [x19]
	ldr	x1, [x23, #16]
	bl	_derive_secret
	cbnz	w0, LBB0_10
LBB0_2:
	str	x20, [x23]
	ldr	x8, [x19, #8]
	ldr	x0, [x8, #8]
	cbz	x0, LBB0_5
; %bb.3:
	cbnz	w22, LBB0_9
; %bb.4:
	ldr	x5, [x0]
	ldr	x4, [x23, #16]
	mov	x1, x19
	mov	x2, x21
	mov	x3, x20
	ldp	x29, x30, [sp, #48]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #32]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #16]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp], #64             ; 16-byte Folded Reload
	br	x5
LBB0_5:
	ldr	x0, [x23, #8]
	cbz	x0, LBB0_7
; %bb.6:
	bl	_ptls_aead_free
	ldr	x8, [x19, #8]
LBB0_7:
	ldr	x9, [x19, #16]
	ldp	w1, w0, [x9]
	ldr	x3, [x23, #16]
	ldr	w4, [x8]
	mov	x2, x21
	bl	_ptls_aead_new
	str	x0, [x23, #8]
	cbz	x0, LBB0_11
; %bb.8:
	str	xzr, [x23, #24]
	mov	x0, x19
	bl	_ptls_is_server
	cmp	x0, w21, sxtw
	cset	w8, eq
Lloh0:
	adrp	x21, _setup_traffic_protection.log_labels@PAGE
Lloh1:
	add	x21, x21, _setup_traffic_protection.log_labels@PAGEOFF
	add	x8, x21, x8, lsl #5
	lsl	x22, x20, #3
	ldr	x20, [x8, x22]
	ldr	x0, [x23, #16]
	ldr	x8, [x19]
	ldr	x8, [x8]
	ldr	x8, [x8]
	ldr	w1, [x8]
	bl	_ptls_iovec_init
	mov	x2, x0
	mov	x0, x19
	mov	x1, x20
	bl	_log_secret
	mov	x0, x19
	bl	_ptls_is_server
	add	x8, x21, x0, lsl #5
	ldr	x1, [x8, x22]
	ldp	x9, x8, [x23, #8]
	ldr	w2, [x8]
	ldr	w3, [x8, #8]
	ldr	x8, [x9]
	ldr	w4, [x8]
	ldr	w5, [x8, #8]
Lloh2:
	adrp	x0, l_.str.5@PAGE
Lloh3:
	add	x0, x0, l_.str.5@PAGEOFF
	bl	_PTLS_DEBUGF
LBB0_9:
	mov	w0, #0
LBB0_10:
	ldp	x29, x30, [sp, #48]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #32]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #16]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp], #64             ; 16-byte Folded Reload
	ret
LBB0_11:
Lloh4:
	adrp	x8, _PTLS_ERROR_NO_MEMORY@GOTPAGE
Lloh5:
	ldr	x8, [x8, _PTLS_ERROR_NO_MEMORY@GOTPAGEOFF]
Lloh6:
	ldr	w0, [x8]
	b	LBB0_10
	.loh AdrpAdd	Lloh2, Lloh3
	.loh AdrpAdd	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh4, Lloh5, Lloh6
	.cfi_endproc
                                        ; -- End function
	.section	__DATA,__const
	.p2align	3                               ; @setup_traffic_protection.log_labels
_setup_traffic_protection.log_labels:
	.quad	0
	.quad	l_.str
	.quad	l_.str.1
	.quad	l_.str.2
	.quad	0
	.quad	0
	.quad	l_.str.3
	.quad	l_.str.4

	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"CLIENT_EARLY_TRAFFIC_SECRET"

l_.str.1:                               ; @.str.1
	.asciz	"CLIENT_HANDSHAKE_TRAFFIC_SECRET"

l_.str.2:                               ; @.str.2
	.asciz	"CLIENT_TRAFFIC_SECRET_0"

l_.str.3:                               ; @.str.3
	.asciz	"SERVER_HANDSHAKE_TRAFFIC_SECRET"

l_.str.4:                               ; @.str.4
	.asciz	"SERVER_TRAFFIC_SECRET_0"

	.comm	_PTLS_ERROR_NO_MEMORY,4,2       ; @PTLS_ERROR_NO_MEMORY
l_.str.5:                               ; @.str.5
	.asciz	"[%s] %02x%02x,%02x%02x\n"

	.no_dead_strip	_setup_traffic_protection
.subsections_via_symbols
