	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function ws_set_handshake_headers
_ws_set_handshake_headers:              ## @ws_set_handshake_headers
	.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	%rdi, %r15
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	%rax, -48(%rbp)
	movl	28(%rdi), %edi
	callq	_strlen
	movq	%rax, %rbx
	movq	_WS_MAGIC_STR@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	callq	_strlen
	movq	%rax, %r13
	addq	%rbx, %rax
	movq	%rax, -64(%rbp)                 ## 8-byte Spill
	leaq	(%rbx,%r13), %rdi
	incq	%rdi
	callq	_xmalloc
	movq	%rax, %r14
	movq	_SHA_DIGEST_LENGTH@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movq	%rax, -56(%rbp)                 ## 8-byte Spill
	shlq	$2, %rax
	callq	____chkstk_darwin
	addq	$15, %rax
	andq	$-16, %rax
	subq	%rax, %rsp
	movq	%rsp, %r12
	movq	%r12, %rdi
	xorl	%esi, %esi
	movl	$4, %edx
	callq	_memset
	movl	28(%r15), %esi
	movq	%r14, %rdi
	movq	%rbx, %rdx
	callq	_memcpy
	addq	%r14, %rbx
	movq	_WS_MAGIC_STR@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	incq	%r13
	movq	%rbx, %rdi
	movq	%r13, %rdx
	callq	_memcpy
	movq	%r14, %rdi
	movq	-64(%rbp), %rsi                 ## 8-byte Reload
	movq	%r12, %rdx
	callq	_ws_sha1_digest
	movq	-56(%rbp), %rax                 ## 8-byte Reload
	leal	(,%rax,4), %esi
	movq	%r12, %rdi
	callq	_base64_encode
	movl	%eax, 24(%r15)
	movq	_WS_SWITCH_PROTO_STR@GOTPCREL(%rip), %rax
	movq	(%rax), %rdi
	callq	_xstrdup
	movq	%rax, 16(%r15)
	cmpq	$0, (%r15)
	je	LBB0_1
## %bb.2:
	cmpl	$0, 8(%r15)
	je	LBB0_3
LBB0_4:
	movq	%r14, %rdi
	callq	_free
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	cmpq	-48(%rbp), %rax
	jne	LBB0_6
## %bb.5:
	leaq	-40(%rbp), %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_1:
	leaq	L_.str(%rip), %rdi
	callq	_xstrdup
	movq	%rax, (%r15)
	cmpl	$0, 8(%r15)
	jne	LBB0_4
LBB0_3:
	leaq	L_.str.1(%rip), %rdi
	callq	_xstrdup
	movq	%rax, (%r15)
	jmp	LBB0_4
LBB0_6:
	callq	___stack_chk_fail
	.cfi_endproc
                                        ## -- End function
	.comm	_WS_MAGIC_STR,4,2               ## @WS_MAGIC_STR
	.comm	_SHA_DIGEST_LENGTH,4,2          ## @SHA_DIGEST_LENGTH
	.comm	_WS_SWITCH_PROTO_STR,8,3        ## @WS_SWITCH_PROTO_STR
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"websocket"

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

	.no_dead_strip	_ws_set_handshake_headers
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function ws_set_handshake_headers
_ws_set_handshake_headers:              ; @ws_set_handshake_headers
	.cfi_startproc
; %bb.0:
	stp	x26, x25, [sp, #-80]!           ; 16-byte Folded Spill
	.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
	.cfi_offset w25, -72
	.cfi_offset w26, -80
	sub	sp, sp, #16
	mov	x19, x0
Lloh0:
	adrp	x8, ___stack_chk_guard@GOTPAGE
Lloh1:
	ldr	x8, [x8, ___stack_chk_guard@GOTPAGEOFF]
Lloh2:
	ldr	x8, [x8]
	stur	x8, [x29, #-72]
	ldr	w0, [x0, #28]
	bl	_strlen
	mov	x21, x0
Lloh3:
	adrp	x25, _WS_MAGIC_STR@GOTPAGE
Lloh4:
	ldr	x25, [x25, _WS_MAGIC_STR@GOTPAGEOFF]
	ldr	w0, [x25]
	bl	_strlen
	mov	x22, x0
	add	x23, x0, x21
	add	x0, x23, #1
	bl	_xmalloc
	mov	x20, x0
Lloh5:
	adrp	x8, _SHA_DIGEST_LENGTH@GOTPAGE
Lloh6:
	ldr	x8, [x8, _SHA_DIGEST_LENGTH@GOTPAGEOFF]
Lloh7:
	ldr	w26, [x8]
	lsl	x8, x26, #2
	mov	x9, x8
Lloh8:
	adrp	x16, ___chkstk_darwin@GOTPAGE
Lloh9:
	ldr	x16, [x16, ___chkstk_darwin@GOTPAGEOFF]
	blr	x16
	mov	x9, sp
	add	x8, x8, #15
	and	x8, x8, #0x7fffffff0
	sub	x24, x9, x8
	mov	sp, x24
	mov	x0, x24
	mov	w1, #0
	mov	w2, #4
	bl	_memset
	ldr	w1, [x19, #28]
	mov	x0, x20
	mov	x2, x21
	bl	_memcpy
	add	x0, x20, x21
	ldr	w1, [x25]
	add	x2, x22, #1
	bl	_memcpy
	mov	x0, x20
	mov	x1, x23
	mov	x2, x24
	bl	_ws_sha1_digest
	lsl	w1, w26, #2
	mov	x0, x24
	bl	_base64_encode
	str	w0, [x19, #24]
Lloh10:
	adrp	x8, _WS_SWITCH_PROTO_STR@GOTPAGE
Lloh11:
	ldr	x8, [x8, _WS_SWITCH_PROTO_STR@GOTPAGEOFF]
Lloh12:
	ldr	x0, [x8]
	bl	_xstrdup
	str	x0, [x19, #16]
	ldr	x8, [x19]
	cbz	x8, LBB0_4
; %bb.1:
	ldr	w8, [x19, #8]
	cbz	w8, LBB0_5
LBB0_2:
	mov	x0, x20
	bl	_free
	ldur	x8, [x29, #-72]
Lloh13:
	adrp	x9, ___stack_chk_guard@GOTPAGE
Lloh14:
	ldr	x9, [x9, ___stack_chk_guard@GOTPAGEOFF]
Lloh15:
	ldr	x9, [x9]
	cmp	x9, x8
	b.ne	LBB0_6
; %bb.3:
	sub	sp, x29, #64
	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
	ldp	x26, x25, [sp], #80             ; 16-byte Folded Reload
	ret
LBB0_4:
Lloh16:
	adrp	x0, l_.str@PAGE
Lloh17:
	add	x0, x0, l_.str@PAGEOFF
	bl	_xstrdup
	str	x0, [x19]
	ldr	w8, [x19, #8]
	cbnz	w8, LBB0_2
LBB0_5:
Lloh18:
	adrp	x0, l_.str.1@PAGE
Lloh19:
	add	x0, x0, l_.str.1@PAGEOFF
	bl	_xstrdup
	str	x0, [x19]
	b	LBB0_2
LBB0_6:
	bl	___stack_chk_fail
	.loh AdrpLdrGotLdr	Lloh10, Lloh11, Lloh12
	.loh AdrpLdrGot	Lloh8, Lloh9
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpLdrGot	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh13, Lloh14, Lloh15
	.loh AdrpAdd	Lloh16, Lloh17
	.loh AdrpAdd	Lloh18, Lloh19
	.cfi_endproc
                                        ; -- End function
	.comm	_WS_MAGIC_STR,4,2               ; @WS_MAGIC_STR
	.comm	_SHA_DIGEST_LENGTH,4,2          ; @SHA_DIGEST_LENGTH
	.comm	_WS_SWITCH_PROTO_STR,8,3        ; @WS_SWITCH_PROTO_STR
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"websocket"

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

	.no_dead_strip	_ws_set_handshake_headers
.subsections_via_symbols
