	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_h2o_upgrade_to_websocket       ## -- Begin function h2o_upgrade_to_websocket
	.p2align	4, 0x90
_h2o_upgrade_to_websocket:              ## @h2o_upgrade_to_websocket
	.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
	movl	%ecx, %r12d
	movq	%rdx, %r13
	movq	%rsi, %r15
	movq	%rdi, %r14
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	%rax, -48(%rbp)
	movl	$32, %edi
	callq	_h2o_mem_alloc
	movq	%rax, %rbx
	xorl	%edi, %edi
	cmpl	$512, (%r14)                    ## imm = 0x200
	setl	%dil
	callq	_assert
	movq	%rbx, %rdi
	xorl	%esi, %esi
	movl	$32, %edx
	callq	_memset
	movq	_recv_callback@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, 8(%rbx)
	movq	_send_callback@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, 4(%rbx)
	movq	_on_msg_callback@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, (%rbx)
	movq	%r13, 24(%rbx)
	movl	%r12d, 16(%rbx)
	leaq	12(%rbx), %rdi
	movq	%rbx, %rsi
	movq	%rbx, %rdx
	callq	_wslay_event_context_server_init
	leaq	-80(%rbp), %rdi
	movq	%r15, %rsi
	callq	_create_accept_key
	movl	$101, 8(%r14)
	leaq	L_.str(%rip), %rax
	movq	%rax, 16(%r14)
	leaq	32(%r14), %r15
	leaq	24(%r14), %r13
	movq	_H2O_TOKEN_UPGRADE@GOTPCREL(%rip), %rax
	movl	(%rax), %r12d
	leaq	L_.str.1(%rip), %rdi
	callq	_H2O_STRLIT
	movq	%r15, %rdi
	movq	%r13, %rsi
	movl	%r12d, %edx
	xorl	%ecx, %ecx
	movl	%eax, %r8d
	callq	_h2o_add_header
	leaq	L_.str.2(%rip), %rdi
	callq	_H2O_STRLIT
	movl	%eax, %r12d
	leaq	-80(%rbp), %rdi
	callq	_strlen
	movl	%eax, (%rsp)
	movq	%r15, %rdi
	movq	%r13, %rsi
	movl	%r12d, %edx
	xorl	%ecx, %ecx
	xorl	%r8d, %r8d
	leaq	-80(%rbp), %r9
	callq	_h2o_add_header_by_str
	movq	_on_complete@GOTPCREL(%rip), %rax
	movl	(%rax), %ecx
	movq	%r14, %rdi
	xorl	%esi, %esi
	xorl	%edx, %edx
	movq	%rbx, %r8
	callq	_h2o_http1_upgrade
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	cmpq	-48(%rbp), %rax
	jne	LBB0_2
## %bb.1:
	movq	%rbx, %rax
	addq	$56, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_2:
	callq	___stack_chk_fail
	.cfi_endproc
                                        ## -- End function
	.comm	_recv_callback,4,2              ## @recv_callback
	.comm	_send_callback,4,2              ## @send_callback
	.comm	_on_msg_callback,4,2            ## @on_msg_callback
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Switching Protocols"

	.comm	_H2O_TOKEN_UPGRADE,4,2          ## @H2O_TOKEN_UPGRADE
L_.str.1:                               ## @.str.1
	.asciz	"websocket"

L_.str.2:                               ## @.str.2
	.asciz	"sec-websocket-accept"

	.comm	_on_complete,4,2                ## @on_complete
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_h2o_upgrade_to_websocket       ; -- Begin function h2o_upgrade_to_websocket
	.p2align	2
_h2o_upgrade_to_websocket:              ; @h2o_upgrade_to_websocket
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #112
	.cfi_def_cfa_offset 112
	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
	mov	x21, x3
	mov	x22, x2
	mov	x23, x1
	mov	x20, x0
Lloh0:
	adrp	x8, ___stack_chk_guard@GOTPAGE
Lloh1:
	ldr	x8, [x8, ___stack_chk_guard@GOTPAGEOFF]
Lloh2:
	ldr	x8, [x8]
	str	x8, [sp, #40]
	mov	w0, #32
	bl	_h2o_mem_alloc
	mov	x19, x0
	ldr	w8, [x20]
	cmp	w8, #512
	cset	w0, lt
	bl	_assert
	mov	x0, x19
	mov	w1, #0
	mov	w2, #32
	bl	_memset
Lloh3:
	adrp	x8, _recv_callback@GOTPAGE
Lloh4:
	ldr	x8, [x8, _recv_callback@GOTPAGEOFF]
Lloh5:
	ldr	w8, [x8]
	str	w8, [x19, #8]
Lloh6:
	adrp	x8, _send_callback@GOTPAGE
Lloh7:
	ldr	x8, [x8, _send_callback@GOTPAGEOFF]
Lloh8:
	ldr	w8, [x8]
Lloh9:
	adrp	x9, _on_msg_callback@GOTPAGE
Lloh10:
	ldr	x9, [x9, _on_msg_callback@GOTPAGEOFF]
Lloh11:
	ldr	w9, [x9]
	stp	w9, w8, [x19]
	str	x22, [x19, #24]
	str	w21, [x19, #16]
	add	x0, x19, #12
	mov	x1, x19
	mov	x2, x19
	bl	_wslay_event_context_server_init
	add	x0, sp, #11
	mov	x1, x23
	bl	_create_accept_key
	mov	w8, #101
	str	w8, [x20, #8]
Lloh12:
	adrp	x8, l_.str@PAGE
Lloh13:
	add	x8, x8, l_.str@PAGEOFF
	str	x8, [x20, #16]
	add	x21, x20, #32
	add	x22, x20, #24
Lloh14:
	adrp	x8, _H2O_TOKEN_UPGRADE@GOTPAGE
Lloh15:
	ldr	x8, [x8, _H2O_TOKEN_UPGRADE@GOTPAGEOFF]
Lloh16:
	ldr	w23, [x8]
Lloh17:
	adrp	x0, l_.str.1@PAGE
Lloh18:
	add	x0, x0, l_.str.1@PAGEOFF
	bl	_H2O_STRLIT
	mov	x4, x0
	mov	x0, x21
	mov	x1, x22
	mov	x2, x23
	mov	x3, #0
	bl	_h2o_add_header
Lloh19:
	adrp	x0, l_.str.2@PAGE
Lloh20:
	add	x0, x0, l_.str.2@PAGEOFF
	bl	_H2O_STRLIT
	mov	x23, x0
	add	x0, sp, #11
	bl	_strlen
	mov	x6, x0
	add	x5, sp, #11
	mov	x0, x21
	mov	x1, x22
	mov	x2, x23
	mov	w3, #0
	mov	x4, #0
	bl	_h2o_add_header_by_str
Lloh21:
	adrp	x8, _on_complete@GOTPAGE
Lloh22:
	ldr	x8, [x8, _on_complete@GOTPAGEOFF]
Lloh23:
	ldr	w3, [x8]
	mov	x0, x20
	mov	x1, #0
	mov	w2, #0
	mov	x4, x19
	bl	_h2o_http1_upgrade
	ldr	x8, [sp, #40]
Lloh24:
	adrp	x9, ___stack_chk_guard@GOTPAGE
Lloh25:
	ldr	x9, [x9, ___stack_chk_guard@GOTPAGEOFF]
Lloh26:
	ldr	x9, [x9]
	cmp	x9, x8
	b.ne	LBB0_2
; %bb.1:
	mov	x0, x19
	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
	add	sp, sp, #112
	ret
LBB0_2:
	bl	___stack_chk_fail
	.loh AdrpLdrGotLdr	Lloh24, Lloh25, Lloh26
	.loh AdrpLdrGotLdr	Lloh21, Lloh22, Lloh23
	.loh AdrpAdd	Lloh19, Lloh20
	.loh AdrpAdd	Lloh17, Lloh18
	.loh AdrpLdrGotLdr	Lloh14, Lloh15, Lloh16
	.loh AdrpAdd	Lloh12, Lloh13
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.cfi_endproc
                                        ; -- End function
	.comm	_recv_callback,4,2              ; @recv_callback
	.comm	_send_callback,4,2              ; @send_callback
	.comm	_on_msg_callback,4,2            ; @on_msg_callback
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Switching Protocols"

	.comm	_H2O_TOKEN_UPGRADE,4,2          ; @H2O_TOKEN_UPGRADE
l_.str.1:                               ; @.str.1
	.asciz	"websocket"

l_.str.2:                               ; @.str.2
	.asciz	"sec-websocket-accept"

	.comm	_on_complete,4,2                ; @on_complete
.subsections_via_symbols
