	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function ws_write_fifo_data
_ws_write_fifo_data:                    ## @ws_write_fifo_data
	.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	%r12
	pushq	%rbx
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movl	%edx, %r15d
	movq	%rsi, %r12
	movq	%rdi, %r14
	movl	(%rdi), %edi
	callq	_write
	movl	%eax, %ebx
	cmpl	$-1, %eax
	je	LBB0_1
## %bb.3:
	cmpl	%r15d, %ebx
	jl	LBB0_7
	jmp	LBB0_8
LBB0_1:
	movq	_errno@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	_EPIPE@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jne	LBB0_4
## %bb.2:
	movl	(%r14), %edi
	callq	_close
	movq	%r14, %rdi
	callq	_ws_openfifo_out
	jmp	LBB0_8
LBB0_4:
	testl	%r15d, %r15d
	js	LBB0_5
LBB0_7:
	movq	%r14, %rdi
	movq	%r12, %rsi
	movl	%r15d, %edx
	movl	%ebx, %ecx
	callq	_ws_queue_fifobuf
LBB0_8:
	movl	%ebx, %eax
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_5:
	movq	_EAGAIN@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	je	LBB0_7
## %bb.6:
	movq	_EWOULDBLOCK@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jne	LBB0_8
	jmp	LBB0_7
	.cfi_endproc
                                        ## -- End function
	.comm	_errno,8,3                      ## @errno
	.comm	_EPIPE,8,3                      ## @EPIPE
	.comm	_EAGAIN,8,3                     ## @EAGAIN
	.comm	_EWOULDBLOCK,8,3                ## @EWOULDBLOCK
	.no_dead_strip	_ws_write_fifo_data
.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_data
_ws_write_fifo_data:                    ; @ws_write_fifo_data
	.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, x2
	mov	x22, x1
	mov	x20, x0
	ldr	w0, [x0]
	bl	_write
	mov	x19, x0
	cmn	w0, #1
	b.eq	LBB0_2
; %bb.1:
	cmp	w19, w21
	b.lt	LBB0_6
	b	LBB0_7
LBB0_2:
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_4
; %bb.3:
	ldr	w0, [x20]
	bl	_close
	mov	x0, x20
	bl	_ws_openfifo_out
	b	LBB0_7
LBB0_4:
	tbz	w21, #31, LBB0_6
; %bb.5:
Lloh6:
	adrp	x9, _EAGAIN@GOTPAGE
Lloh7:
	ldr	x9, [x9, _EAGAIN@GOTPAGEOFF]
Lloh8:
	ldr	x9, [x9]
Lloh9:
	adrp	x10, _EWOULDBLOCK@GOTPAGE
Lloh10:
	ldr	x10, [x10, _EWOULDBLOCK@GOTPAGEOFF]
Lloh11:
	ldr	x10, [x10]
	cmp	x8, x9
	ccmp	x8, x10, #4, ne
	b.ne	LBB0_7
LBB0_6:
	mov	x0, x20
	mov	x1, x22
	mov	x2, x21
	mov	x3, x19
	bl	_ws_queue_fifobuf
LBB0_7:
	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
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.cfi_endproc
                                        ; -- End function
	.comm	_errno,8,3                      ; @errno
	.comm	_EPIPE,8,3                      ; @EPIPE
	.comm	_EAGAIN,8,3                     ; @EAGAIN
	.comm	_EWOULDBLOCK,8,3                ; @EWOULDBLOCK
	.no_dead_strip	_ws_write_fifo_data
.subsections_via_symbols
