	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_ws_read_headers                ## -- Begin function ws_read_headers
	.p2align	4, 0x90
_ws_read_headers:                       ## @ws_read_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, %rbx
	movq	(%rdi), %r15
	leaq	-56(%rbp), %rsi
	leaq	-48(%rbp), %rdx
	callq	_ws_read_http_header
	testq	%rax, %rax
	jne	LBB0_2
## %bb.1:
	movq	-56(%rbp), %r14
	testq	%r14, %r14
	je	LBB0_2
## %bb.3:
	xorl	%r12d, %r12d
	xorl	%r13d, %r13d
	.p2align	4, 0x90
LBB0_4:                                 ## =>This Inner Loop Header: Depth=1
	movq	%r14, %rdi
	leaq	L_.str(%rip), %rsi
	callq	_strcasecmp
	testl	%eax, %eax
	je	LBB0_5
## %bb.6:                               ##   in Loop: Header=BB0_4 Depth=1
	movq	%r14, %rdi
	leaq	L_.str.1(%rip), %rsi
	callq	_strcasecmp
	testl	%eax, %eax
	je	LBB0_7
## %bb.8:                               ##   in Loop: Header=BB0_4 Depth=1
	movq	%r14, %rdi
	leaq	L_.str.3(%rip), %rsi
	callq	_strcasecmp
	testl	%eax, %eax
	je	LBB0_9
## %bb.10:                              ##   in Loop: Header=BB0_4 Depth=1
	movq	%r14, %rdi
	leaq	L_.str.4(%rip), %rsi
	callq	_strcasecmp
	testl	%eax, %eax
	je	LBB0_11
## %bb.12:                              ##   in Loop: Header=BB0_4 Depth=1
	movq	%r14, %rdi
	leaq	L_.str.5(%rip), %rsi
	callq	_strcasecmp
	testl	%eax, %eax
	je	LBB0_13
## %bb.14:                              ##   in Loop: Header=BB0_4 Depth=1
	movq	%r14, %rdi
	leaq	L_.str.6(%rip), %rsi
	callq	_strcasecmp
	testl	%eax, %eax
	jne	LBB0_18
## %bb.15:                              ##   in Loop: Header=BB0_4 Depth=1
	movq	16(%r15), %rdi
	callq	_free
	movq	-48(%rbp), %r14
	movq	%r14, %rdi
	movl	$58, %esi
	callq	_strrchr
	testq	%rax, %rax
	je	LBB0_17
## %bb.16:                              ##   in Loop: Header=BB0_4 Depth=1
	movb	$0, (%rax)
	movq	-48(%rbp), %r14
LBB0_17:                                ##   in Loop: Header=BB0_4 Depth=1
	movq	%r14, %rdi
	callq	_strdup
	movq	%rax, 16(%r15)
	jmp	LBB0_18
	.p2align	4, 0x90
LBB0_5:                                 ##   in Loop: Header=BB0_4 Depth=1
	movq	-48(%rbp), %rdi
	leaq	L_.str.1(%rip), %rsi
	callq	_strcasestr
	xorl	%r12d, %r12d
	testq	%rax, %rax
	setne	%r12b
	jmp	LBB0_18
	.p2align	4, 0x90
LBB0_7:                                 ##   in Loop: Header=BB0_4 Depth=1
	movq	-48(%rbp), %rdi
	leaq	L_.str.2(%rip), %rsi
	callq	_strcasecmp
	xorl	%r13d, %r13d
	testl	%eax, %eax
	sete	%r13b
	jmp	LBB0_18
LBB0_9:                                 ##   in Loop: Header=BB0_4 Depth=1
	movq	(%r15), %rdi
	callq	_free
	movq	-48(%rbp), %rdi
	callq	_strdup
	movq	%rax, (%r15)
	jmp	LBB0_18
LBB0_11:                                ##   in Loop: Header=BB0_4 Depth=1
	movq	-48(%rbp), %rdi
	xorl	%esi, %esi
	xorl	%edx, %edx
	callq	_strtol
	movl	%eax, 28(%r15)
	jmp	LBB0_18
LBB0_13:                                ##   in Loop: Header=BB0_4 Depth=1
	movq	8(%r15), %rdi
	callq	_free
	movq	-48(%rbp), %rdi
	callq	_strdup
	movq	%rax, 8(%r15)
	.p2align	4, 0x90
LBB0_18:                                ##   in Loop: Header=BB0_4 Depth=1
	movq	-56(%rbp), %rdi
	callq	_free
	movq	-48(%rbp), %rdi
	callq	_free
	movq	%rbx, %rdi
	leaq	-56(%rbp), %rsi
	leaq	-48(%rbp), %rdx
	callq	_ws_read_http_header
	testq	%rax, %rax
	jne	LBB0_20
## %bb.19:                              ##   in Loop: Header=BB0_4 Depth=1
	movq	-56(%rbp), %r14
	testq	%r14, %r14
	jne	LBB0_4
LBB0_20:
	xorl	%eax, %eax
	testl	%r12d, %r12d
	je	LBB0_23
## %bb.21:
	testl	%r13d, %r13d
	je	LBB0_23
## %bb.22:
	xorl	%eax, %eax
	cmpq	$0, 8(%r15)
	setne	%al
	jmp	LBB0_23
LBB0_2:
	xorl	%eax, %eax
LBB0_23:
	movl	%eax, 24(%r15)
	movq	_WS_SUCCESS@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Connection"

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

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

L_.str.3:                               ## @.str.3
	.asciz	"Sec-WebSocket-Protocol"

L_.str.4:                               ## @.str.4
	.asciz	"Sec-WebSocket-Version"

L_.str.5:                               ## @.str.5
	.asciz	"Sec-WebSocket-Key"

L_.str.6:                               ## @.str.6
	.asciz	"Host"

	.comm	_WS_SUCCESS,4,2                 ## @WS_SUCCESS
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_ws_read_headers                ; -- Begin function ws_read_headers
	.p2align	2
_ws_read_headers:                       ; @ws_read_headers
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #112
	.cfi_def_cfa_offset 112
	stp	x28, x27, [sp, #16]             ; 16-byte Folded Spill
	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
	.cfi_offset w27, -88
	.cfi_offset w28, -96
	mov	x19, x0
	ldr	x28, [x0]
	add	x1, sp, #8
	mov	x2, sp
	bl	_ws_read_http_header
	cbnz	x0, LBB0_20
; %bb.1:
	ldr	x27, [sp, #8]
	cbz	x27, LBB0_20
; %bb.2:
	mov	w25, #0
	mov	w26, #0
Lloh0:
	adrp	x20, l_.str@PAGE
Lloh1:
	add	x20, x20, l_.str@PAGEOFF
Lloh2:
	adrp	x21, l_.str.1@PAGE
Lloh3:
	add	x21, x21, l_.str.1@PAGEOFF
Lloh4:
	adrp	x22, l_.str.2@PAGE
Lloh5:
	add	x22, x22, l_.str.2@PAGEOFF
Lloh6:
	adrp	x23, l_.str.3@PAGE
Lloh7:
	add	x23, x23, l_.str.3@PAGEOFF
Lloh8:
	adrp	x24, l_.str.4@PAGE
Lloh9:
	add	x24, x24, l_.str.4@PAGEOFF
LBB0_3:                                 ; =>This Inner Loop Header: Depth=1
	mov	x0, x27
	mov	x1, x20
	bl	_strcasecmp
	cbz	w0, LBB0_12
; %bb.4:                                ;   in Loop: Header=BB0_3 Depth=1
	mov	x0, x27
	mov	x1, x21
	bl	_strcasecmp
	cbz	w0, LBB0_13
; %bb.5:                                ;   in Loop: Header=BB0_3 Depth=1
	mov	x0, x27
	mov	x1, x23
	bl	_strcasecmp
	cbz	w0, LBB0_14
; %bb.6:                                ;   in Loop: Header=BB0_3 Depth=1
	mov	x0, x27
	mov	x1, x24
	bl	_strcasecmp
	cbz	w0, LBB0_15
; %bb.7:                                ;   in Loop: Header=BB0_3 Depth=1
	mov	x0, x27
Lloh10:
	adrp	x1, l_.str.5@PAGE
Lloh11:
	add	x1, x1, l_.str.5@PAGEOFF
	bl	_strcasecmp
	cbz	w0, LBB0_16
; %bb.8:                                ;   in Loop: Header=BB0_3 Depth=1
	mov	x0, x27
Lloh12:
	adrp	x1, l_.str.6@PAGE
Lloh13:
	add	x1, x1, l_.str.6@PAGEOFF
	bl	_strcasecmp
	cbnz	w0, LBB0_17
; %bb.9:                                ;   in Loop: Header=BB0_3 Depth=1
	ldr	x0, [x28, #16]
	bl	_free
	ldr	x27, [sp]
	mov	x0, x27
	mov	w1, #58
	bl	_strrchr
	cbz	x0, LBB0_11
; %bb.10:                               ;   in Loop: Header=BB0_3 Depth=1
	strb	wzr, [x0]
	ldr	x27, [sp]
LBB0_11:                                ;   in Loop: Header=BB0_3 Depth=1
	mov	x0, x27
	bl	_strdup
	str	x0, [x28, #16]
	b	LBB0_17
LBB0_12:                                ;   in Loop: Header=BB0_3 Depth=1
	ldr	x0, [sp]
	mov	x1, x21
	bl	_strcasestr
	cmp	x0, #0
	cset	w25, ne
	b	LBB0_17
LBB0_13:                                ;   in Loop: Header=BB0_3 Depth=1
	ldr	x0, [sp]
	mov	x1, x22
	bl	_strcasecmp
	cmp	w0, #0
	cset	w26, eq
	b	LBB0_17
LBB0_14:                                ;   in Loop: Header=BB0_3 Depth=1
	ldr	x0, [x28]
	bl	_free
	ldr	x0, [sp]
	bl	_strdup
	str	x0, [x28]
	b	LBB0_17
LBB0_15:                                ;   in Loop: Header=BB0_3 Depth=1
	ldr	x0, [sp]
	mov	x1, #0
	mov	w2, #0
	bl	_strtol
	str	w0, [x28, #28]
	b	LBB0_17
LBB0_16:                                ;   in Loop: Header=BB0_3 Depth=1
	ldr	x0, [x28, #8]
	bl	_free
	ldr	x0, [sp]
	bl	_strdup
	str	x0, [x28, #8]
LBB0_17:                                ;   in Loop: Header=BB0_3 Depth=1
	ldr	x0, [sp, #8]
	bl	_free
	ldr	x0, [sp]
	bl	_free
	add	x1, sp, #8
	mov	x2, sp
	mov	x0, x19
	bl	_ws_read_http_header
	cbnz	x0, LBB0_19
; %bb.18:                               ;   in Loop: Header=BB0_3 Depth=1
	ldr	x27, [sp, #8]
	cbnz	x27, LBB0_3
LBB0_19:
	cmp	w25, #0
	ccmp	w26, #0, #4, ne
	b.ne	LBB0_21
LBB0_20:
	mov	w8, #0
	b	LBB0_22
LBB0_21:
	ldr	x8, [x28, #8]
	cmp	x8, #0
	cset	w8, ne
LBB0_22:
	str	w8, [x28, #24]
Lloh14:
	adrp	x8, _WS_SUCCESS@GOTPAGE
Lloh15:
	ldr	x8, [x8, _WS_SUCCESS@GOTPAGEOFF]
Lloh16:
	ldr	w0, [x8]
	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
	ldp	x28, x27, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #112
	ret
	.loh AdrpAdd	Lloh8, Lloh9
	.loh AdrpAdd	Lloh6, Lloh7
	.loh AdrpAdd	Lloh4, Lloh5
	.loh AdrpAdd	Lloh2, Lloh3
	.loh AdrpAdd	Lloh0, Lloh1
	.loh AdrpAdd	Lloh10, Lloh11
	.loh AdrpAdd	Lloh12, Lloh13
	.loh AdrpLdrGotLdr	Lloh14, Lloh15, Lloh16
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Connection"

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

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

l_.str.3:                               ; @.str.3
	.asciz	"Sec-WebSocket-Protocol"

l_.str.4:                               ; @.str.4
	.asciz	"Sec-WebSocket-Version"

l_.str.5:                               ; @.str.5
	.asciz	"Sec-WebSocket-Key"

l_.str.6:                               ; @.str.6
	.asciz	"Host"

	.comm	_WS_SUCCESS,4,2                 ; @WS_SUCCESS
.subsections_via_symbols
