	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_ws_read_http_header            ## -- Begin function ws_read_http_header
	.p2align	4, 0x90
_ws_read_http_header:                   ## @ws_read_http_header
	.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	%rdx, %r14
	movq	%rdi, %rbx
	movq	8(%rdi), %r15
	movq	(%r15), %rax
	movq	(%rax), %r12
	movq	8(%rax), %rdx
	subq	%r12, %rdx
	movq	%rsi, -56(%rbp)                 ## 8-byte Spill
	movq	$0, (%rsi)
	movq	$0, (%r14)
	leaq	L_.str(%rip), %rsi
	movq	%r12, %rdi
	callq	_strnstr
	testq	%rax, %rax
	je	LBB0_1
## %bb.3:
	movq	%rax, %r13
	cmpq	%rax, %r12
	jae	LBB0_16
## %bb.4:
	cmpb	$32, (%r12)
	jne	LBB0_5
## %bb.17:
	movq	(%rbx), %rax
	leaq	L_.str.2(%rip), %rsi
	jmp	LBB0_2
LBB0_1:
	movq	(%rbx), %rax
	leaq	L_.str.1(%rip), %rsi
LBB0_2:
	movq	%rbx, %rdi
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	jmpq	*%rax                           ## TAILCALL
LBB0_5:
	movq	%r13, %rax
	leaq	1(%r12), %rcx
	.p2align	4, 0x90
LBB0_6:                                 ## =>This Inner Loop Header: Depth=1
	cmpq	%r13, %rcx
	jae	LBB0_7
## %bb.8:                               ##   in Loop: Header=BB0_6 Depth=1
	leaq	1(%rcx), %rsi
	cmpb	$58, (%rcx)
	movq	%rsi, %rcx
	jne	LBB0_6
## %bb.9:
	decq	%rsi
	jmp	LBB0_10
LBB0_7:
	movq	%rax, %rsi
LBB0_10:
	movq	%r14, -48(%rbp)                 ## 8-byte Spill
	movl	%esi, %edx
	notl	%edx
	addl	%eax, %edx
	leaq	1(%rsi), %rdi
	.p2align	4, 0x90
LBB0_11:                                ## =>This Inner Loop Header: Depth=1
	movl	%edx, %ecx
	movq	%rdi, %rbx
	cmpq	%r13, %rdi
	jae	LBB0_13
## %bb.12:                              ##   in Loop: Header=BB0_11 Depth=1
	leal	-1(%rcx), %edx
	leaq	1(%rbx), %rdi
	cmpb	$32, (%rbx)
	je	LBB0_11
	jmp	LBB0_13
	.p2align	4, 0x90
LBB0_14:                                ##   in Loop: Header=BB0_13 Depth=1
	cmpb	$32, -1(%rax)
	leaq	-1(%rax), %rax
	leal	-1(%r14), %ecx
	jne	LBB0_15
LBB0_13:                                ## =>This Inner Loop Header: Depth=1
	movl	%ecx, %r14d
	cmpq	%rbx, %rax
	ja	LBB0_14
LBB0_15:
	subl	%r12d, %esi
	movq	%r12, %rdi
                                        ## kill: def $esi killed $esi killed $rsi
	callq	_strndup
	movq	-56(%rbp), %rcx                 ## 8-byte Reload
	movq	%rax, (%rcx)
	movq	%rbx, %rdi
	movl	%r14d, %esi
	callq	_strndup
	movq	-48(%rbp), %rcx                 ## 8-byte Reload
	movq	%rax, (%rcx)
LBB0_16:
	addq	$2, %r13
	movq	(%r15), %rax
	movq	%r13, (%rax)
	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	"\r\n"

L_.str.1:                               ## @.str.1
	.asciz	"Missing \\r\\n"

L_.str.2:                               ## @.str.2
	.asciz	"TODO header continuation"

	.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_http_header            ; -- Begin function ws_read_http_header
	.p2align	2
_ws_read_http_header:                   ; @ws_read_http_header
	.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
	mov	x19, x2
	mov	x20, x1
	mov	x23, x0
	ldr	x25, [x0, #8]
	ldr	x8, [x25]
	ldp	x22, x8, [x8]
	sub	x2, x8, x22
	str	xzr, [x1]
	str	xzr, [x19]
Lloh0:
	adrp	x1, l_.str@PAGE
Lloh1:
	add	x1, x1, l_.str@PAGEOFF
	mov	x0, x22
	bl	_strnstr
	cbz	x0, LBB0_4
; %bb.1:
	mov	x21, x0
	cmp	x22, x0
	b.hs	LBB0_17
; %bb.2:
	ldrb	w8, [x22]
	cmp	w8, #32
	b.ne	LBB0_6
; %bb.3:
	ldr	x2, [x23]
Lloh2:
	adrp	x1, l_.str.2@PAGE
Lloh3:
	add	x1, x1, l_.str.2@PAGEOFF
	b	LBB0_5
LBB0_4:
	ldr	x2, [x23]
Lloh4:
	adrp	x1, l_.str.1@PAGE
Lloh5:
	add	x1, x1, l_.str.1@PAGEOFF
LBB0_5:
	mov	x0, x23
	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
	br	x2
LBB0_6:
	mov	x8, x21
	add	x9, x22, #1
LBB0_7:                                 ; =>This Inner Loop Header: Depth=1
	cmp	x9, x21
	b.hs	LBB0_10
; %bb.8:                                ;   in Loop: Header=BB0_7 Depth=1
	ldrb	w10, [x9], #1
	cmp	w10, #58
	b.ne	LBB0_7
; %bb.9:
	sub	x9, x9, #1
	b	LBB0_11
LBB0_10:
	mov	x9, x8
LBB0_11:
	mvn	w10, w9
	add	w12, w10, w8
	add	x11, x9, #1
LBB0_12:                                ; =>This Inner Loop Header: Depth=1
	mov	x10, x12
	mov	x23, x11
	cmp	x11, x21
	b.hs	LBB0_15
; %bb.13:                               ;   in Loop: Header=BB0_12 Depth=1
	mov	x11, x23
	ldrb	w13, [x11], #1
	sub	w12, w10, #1
	cmp	w13, #32
	b.eq	LBB0_12
	b	LBB0_15
LBB0_14:                                ;   in Loop: Header=BB0_15 Depth=1
	ldrb	w11, [x8, #-1]!
	sub	w10, w24, #1
	cmp	w11, #32
	b.ne	LBB0_16
LBB0_15:                                ; =>This Inner Loop Header: Depth=1
	mov	x24, x10
	cmp	x8, x23
	b.hi	LBB0_14
LBB0_16:
	sub	w1, w9, w22
	mov	x0, x22
	bl	_strndup
	str	x0, [x20]
	mov	x0, x23
	mov	x1, x24
	bl	_strndup
	str	x0, [x19]
LBB0_17:
	add	x8, x21, #2
	ldr	x9, [x25]
	str	x8, [x9]
Lloh6:
	adrp	x8, _WS_SUCCESS@GOTPAGE
Lloh7:
	ldr	x8, [x8, _WS_SUCCESS@GOTPAGEOFF]
Lloh8:
	ldr	w0, [x8]
	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
	.loh AdrpAdd	Lloh0, Lloh1
	.loh AdrpAdd	Lloh2, Lloh3
	.loh AdrpAdd	Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"\r\n"

l_.str.1:                               ; @.str.1
	.asciz	"Missing \\r\\n"

l_.str.2:                               ; @.str.2
	.asciz	"TODO header continuation"

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