	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function ws_get_frm_payload
_ws_get_frm_payload:                    ## @ws_get_frm_payload
	.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, %r14
	movq	%rdi, %r15
	movq	(%rdi), %rax
	testq	%rax, %rax
	je	LBB0_1
## %bb.2:
	cmpq	$0, 24(%rax)
	jne	LBB0_7
	jmp	LBB0_3
LBB0_1:
	xorl	%eax, %eax
	callq	_new_wsmessage
	movq	%rax, (%r15)
	cmpq	$0, 24(%rax)
	jne	LBB0_7
LBB0_3:
	movq	8(%r15), %rcx
	movl	(%rcx), %edi
	testl	%edi, %edi
	je	LBB0_7
## %bb.4:
	movl	$1, %esi
	callq	_xcalloc
	movq	(%r15), %rcx
	movq	%rax, 24(%rcx)
	jmp	LBB0_5
LBB0_7:
	cmpl	$0, (%rax)
	je	LBB0_8
LBB0_5:
	movq	(%r15), %rsi
	movq	8(%r15), %rcx
	movl	(%rsi), %eax
	movl	(%rcx), %ebx
	subl	%eax, %ebx
	jle	LBB0_6
## %bb.11:
	movq	8(%rsi), %rdx
	movq	%r15, %rdi
	movl	%ebx, %ecx
	callq	_ws_read_payload
	testl	%eax, %eax
	js	LBB0_15
## %bb.12:
	cmpl	%ebx, %eax
	jne	LBB0_16
## %bb.13:
	movq	(%r15), %rsi
	movl	(%rsi), %eax
	jmp	LBB0_14
LBB0_6:
	xorl	%ebx, %ebx
LBB0_14:
	movq	8(%rsi), %rcx
	cltq
	subq	%rax, %rcx
	movq	%rcx, 16(%rsi)
	movq	%r15, %rdi
	movq	%r14, %rsi
	callq	_ws_manage_payload_opcode
	movq	%r15, %rdi
	callq	_ws_free_frame
	movl	%ebx, %eax
LBB0_15:
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_8:
	movq	8(%r15), %rdi
	cmpl	$0, (%rdi)
	je	LBB0_5
## %bb.9:
	movq	%rax, %rsi
	callq	_ws_realloc_frm_payload
	cmpl	$1, %eax
	jne	LBB0_5
## %bb.10:
	movq	_WS_ERR@GOTPCREL(%rip), %rax
	movq	_WS_CLOSE@GOTPCREL(%rip), %rcx
	movl	(%rcx), %esi
	orl	(%rax), %esi
	movq	%r15, %rdi
	xorl	%edx, %edx
	jmp	LBB0_17
LBB0_16:
	movq	_WS_READING@GOTPCREL(%rip), %rcx
	movl	(%rcx), %esi
	movq	%r15, %rdi
	movl	%eax, %edx
LBB0_17:
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_ws_set_status                  ## TAILCALL
	.cfi_endproc
                                        ## -- End function
	.comm	_WS_ERR,4,2                     ## @WS_ERR
	.comm	_WS_CLOSE,4,2                   ## @WS_CLOSE
	.comm	_WS_READING,4,2                 ## @WS_READING
	.no_dead_strip	_ws_get_frm_payload
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function ws_get_frm_payload
_ws_get_frm_payload:                    ; @ws_get_frm_payload
	.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	x20, x1
	mov	x19, x0
	ldr	x1, [x0]
	cbz	x1, LBB0_2
; %bb.1:
	ldr	x8, [x1, #24]
	cbnz	x8, LBB0_5
	b	LBB0_3
LBB0_2:
	bl	_new_wsmessage
	mov	x1, x0
	str	x0, [x19]
	ldr	x8, [x1, #24]
	cbnz	x8, LBB0_5
LBB0_3:
	ldr	x8, [x19, #8]
	ldr	w0, [x8]
	cbz	w0, LBB0_5
; %bb.4:
	mov	w1, #1
	bl	_xcalloc
	ldr	x8, [x19]
	str	x0, [x8, #24]
	b	LBB0_6
LBB0_5:
	ldr	w8, [x1]
	cbz	w8, LBB0_13
LBB0_6:
	ldp	x1, x9, [x19]
	ldr	w8, [x1]
	ldr	w9, [x9]
	sub	w21, w9, w8
	cmp	w21, #1
	b.lt	LBB0_10
; %bb.7:
	ldr	x2, [x1, #8]
	mov	x0, x19
	mov	x3, x21
	bl	_ws_read_payload
	mov	x2, x0
	tbnz	w0, #31, LBB0_12
; %bb.8:
	cmp	w2, w21
	b.ne	LBB0_16
; %bb.9:
	ldr	x1, [x19]
	ldr	w8, [x1]
	b	LBB0_11
LBB0_10:
	mov	w21, #0
LBB0_11:
	ldr	x9, [x1, #8]
	sub	x8, x9, w8, sxtw
	str	x8, [x1, #16]
	mov	x0, x19
	mov	x1, x20
	bl	_ws_manage_payload_opcode
	mov	x0, x19
	bl	_ws_free_frame
	mov	x2, x21
LBB0_12:
	mov	x0, x2
	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
LBB0_13:
	ldr	x0, [x19, #8]
	ldr	w8, [x0]
	cbz	w8, LBB0_6
; %bb.14:
	bl	_ws_realloc_frm_payload
	cmp	w0, #1
	b.ne	LBB0_6
; %bb.15:
Lloh0:
	adrp	x8, _WS_ERR@GOTPAGE
Lloh1:
	ldr	x8, [x8, _WS_ERR@GOTPAGEOFF]
Lloh2:
	adrp	x9, _WS_CLOSE@GOTPAGE
Lloh3:
	ldr	x9, [x9, _WS_CLOSE@GOTPAGEOFF]
Lloh4:
	ldr	w8, [x8]
Lloh5:
	ldr	w9, [x9]
	orr	w1, w9, w8
	mov	x0, x19
	mov	w2, #0
	b	LBB0_17
LBB0_16:
Lloh6:
	adrp	x8, _WS_READING@GOTPAGE
Lloh7:
	ldr	x8, [x8, _WS_READING@GOTPAGEOFF]
Lloh8:
	ldr	w1, [x8]
	mov	x0, x19
LBB0_17:
	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
	b	_ws_set_status
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh4
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.cfi_endproc
                                        ; -- End function
	.comm	_WS_ERR,4,2                     ; @WS_ERR
	.comm	_WS_CLOSE,4,2                   ; @WS_CLOSE
	.comm	_WS_READING,4,2                 ; @WS_READING
	.no_dead_strip	_ws_get_frm_payload
.subsections_via_symbols
