	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function ws_write_fifo_cache
_ws_write_fifo_cache:                   ## @ws_write_fifo_cache
	.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	%rdi, %r14
	movq	8(%rdi), %rbx
	movl	(%rdi), %edi
	movl	(%rbx), %edx
	movl	4(%rbx), %esi
	callq	_write
	movl	%eax, %r15d
	cmpl	$-1, %eax
	jne	LBB0_3
## %bb.1:
	movq	_errno@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	_EPIPE@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jne	LBB0_3
## %bb.2:
	movl	(%r14), %edi
	callq	_close
	movq	%r14, %rdi
	callq	_ws_openfifo_out
	jmp	LBB0_6
LBB0_3:
	movl	(%rbx), %edx
	movl	4(%rbx), %edi
	movl	%r15d, %esi
	callq	_chop_nchars
	testq	%rax, %rax
	je	LBB0_4
## %bb.5:
	subl	%r15d, (%rbx)
	jmp	LBB0_6
LBB0_4:
	movq	%r14, %rdi
	callq	_clear_fifo_queue
LBB0_6:
	movl	%r15d, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_errno,8,3                      ## @errno
	.comm	_EPIPE,8,3                      ## @EPIPE
	.no_dead_strip	_ws_write_fifo_cache
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function ws_write_fifo_cache
_ws_write_fifo_cache:                   ; @ws_write_fifo_cache
	.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, x0
	ldr	x21, [x0, #8]
	ldr	w0, [x0]
	ldp	w2, w1, [x21]
	bl	_write
	mov	x19, x0
	cmn	w0, #1
	b.ne	LBB0_3
; %bb.1:
Lloh0:
	adrp	x8, _errno@GOTPAGE
Lloh1:
	ldr	x8, [x8, _errno@GOTPAGEOFF]
Lloh2:
	ldr	x8, [x8]
Lloh3:
	adrp	x9, _EPIPE@GOTPAGE
Lloh4:
	ldr	x9, [x9, _EPIPE@GOTPAGEOFF]
Lloh5:
	ldr	x9, [x9]
	cmp	x8, x9
	b.ne	LBB0_3
; %bb.2:
	ldr	w0, [x20]
	bl	_close
	mov	x0, x20
	bl	_ws_openfifo_out
	b	LBB0_6
LBB0_3:
	ldp	w2, w0, [x21]
	mov	x1, x19
	bl	_chop_nchars
	cbz	x0, LBB0_5
; %bb.4:
	ldr	w8, [x21]
	sub	w8, w8, w19
	str	w8, [x21]
	b	LBB0_6
LBB0_5:
	mov	x0, x20
	bl	_clear_fifo_queue
LBB0_6:
	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	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.cfi_endproc
                                        ; -- End function
	.comm	_errno,8,3                      ; @errno
	.comm	_EPIPE,8,3                      ; @EPIPE
	.no_dead_strip	_ws_write_fifo_cache
.subsections_via_symbols
