	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function ws_read_header
_ws_read_header:                        ## @ws_read_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	%rbx
	pushq	%rax
	.cfi_offset %rbx, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rsi, %rbx
	movq	%rdi, %r14
	movslq	%edx, %rsi
	addq	(%rbx), %rsi
	movl	%ecx, %edx
	callq	_read_socket
	movl	%eax, %r15d
	testl	%eax, %eax
	jle	LBB0_1
## %bb.3:
	movslq	8(%rbx), %rax
	movslq	%r15d, %rcx
	addq	%rax, %rcx
	movl	%ecx, 8(%rbx)
	movq	(%rbx), %rax
	movb	$0, (%rax,%rcx)
	jmp	LBB0_4
LBB0_1:
	movq	_WS_CLOSE@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	testl	%eax, (%r14)
	je	LBB0_4
## %bb.2:
	movq	_WS_CLOSE_UNEXPECTED@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	leaq	L_.str(%rip), %rdx
	movq	%r14, %rdi
	callq	_ws_error
LBB0_4:
	movl	%r15d, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_WS_CLOSE,4,2                   ## @WS_CLOSE
	.comm	_WS_CLOSE_UNEXPECTED,4,2        ## @WS_CLOSE_UNEXPECTED
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Unable to read header"

	.no_dead_strip	_ws_read_header
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function ws_read_header
_ws_read_header:                        ; @ws_read_header
	.cfi_startproc
; %bb.0:
	stp	x22, x21, [sp, #-48]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 48
	stp	x20, x19, [sp, #16]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #32]             ; 16-byte Folded Spill
	add	x29, sp, #32
	.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
	mov	x21, x1
	mov	x20, x0
	ldr	x8, [x1]
	add	x1, x8, w2, sxtw
	mov	x2, x3
	bl	_read_socket
	mov	x19, x0
	cmp	w0, #0
	b.le	LBB0_2
; %bb.1:
	ldrsw	x8, [x21, #8]
	add	x8, x8, w19, sxtw
	str	w8, [x21, #8]
	ldr	x9, [x21]
	strb	wzr, [x9, x8]
	b	LBB0_4
LBB0_2:
	ldr	w8, [x20]
Lloh0:
	adrp	x9, _WS_CLOSE@GOTPAGE
Lloh1:
	ldr	x9, [x9, _WS_CLOSE@GOTPAGEOFF]
Lloh2:
	ldr	w9, [x9]
	tst	w9, w8
	b.eq	LBB0_4
; %bb.3:
Lloh3:
	adrp	x8, _WS_CLOSE_UNEXPECTED@GOTPAGE
Lloh4:
	ldr	x8, [x8, _WS_CLOSE_UNEXPECTED@GOTPAGEOFF]
Lloh5:
	ldr	w1, [x8]
Lloh6:
	adrp	x2, l_.str@PAGE
Lloh7:
	add	x2, x2, l_.str@PAGEOFF
	mov	x0, x20
	bl	_ws_error
LBB0_4:
	mov	x0, x19
	ldp	x29, x30, [sp, #32]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #16]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp], #48             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpAdd	Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.cfi_endproc
                                        ; -- End function
	.comm	_WS_CLOSE,4,2                   ; @WS_CLOSE
	.comm	_WS_CLOSE_UNEXPECTED,4,2        ; @WS_CLOSE_UNEXPECTED
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Unable to read header"

	.no_dead_strip	_ws_read_header
.subsections_via_symbols
