	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_fifo_read                      ## -- Begin function fifo_read
	.p2align	4, 0x90
_fifo_read:                             ## @fifo_read
	.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
	pushq	%rax
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movl	%ecx, %ebx
	movq	%rdx, %r14
	movq	%rsi, %r12
	movq	%rdi, %r13
	callq	_fifo_size
	movl	$1, %ecx
	cmpq	%r14, %rax
	jb	LBB0_11
## %bb.1:
	movq	(%r13), %rcx
	movq	_FIFO_LAST@GOTPCREL(%rip), %rax
	movl	%ebx, -44(%rbp)                 ## 4-byte Spill
	testl	%ebx, (%rax)
	je	LBB0_2
## %bb.3:
	movq	%rcx, %rax
	subq	%r14, %rax
	addq	8(%r13), %rax
	movq	16(%r13), %r15
	movq	%rax, %rdx
	orq	%r15, %rdx
	shrq	$32, %rdx
	je	LBB0_4
## %bb.5:
	xorl	%edx, %edx
	divq	%r15
	movq	%rdx, %rbx
	jmp	LBB0_6
LBB0_2:
	movq	16(%r13), %r15
	movq	%rcx, %rbx
	jmp	LBB0_6
LBB0_4:
                                        ## kill: def $eax killed $eax killed $rax
	xorl	%edx, %edx
	divl	%r15d
	movl	%edx, %ebx
LBB0_6:
	subq	%rcx, %r15
	cmpq	%r14, %r15
	cmovaeq	%r14, %r15
	leaq	(,%rbx,4), %rsi
	addq	24(%r13), %rsi
	movq	%r12, %rdi
	movq	%r15, %rdx
	callq	_memcpy
	addq	%r15, %r12
	movq	24(%r13), %rsi
	movq	%r14, %rdx
	subq	%r15, %rdx
	movq	%r12, %rdi
	callq	_memcpy
	movq	_FIFO_PEEK@GOTPCREL(%rip), %rax
	xorl	%ecx, %ecx
	movl	-44(%rbp), %edx                 ## 4-byte Reload
	testl	%edx, (%rax)
	jne	LBB0_11
## %bb.7:
	addq	%r14, %rbx
	movq	16(%r13), %rsi
	movq	%rbx, %rax
	orq	%rsi, %rax
	shrq	$32, %rax
	je	LBB0_8
## %bb.9:
	movq	%rbx, %rax
	xorl	%edx, %edx
	divq	%rsi
	jmp	LBB0_10
LBB0_8:
	movl	%ebx, %eax
	xorl	%edx, %edx
	divl	%esi
                                        ## kill: def $edx killed $edx def $rdx
LBB0_10:
	movq	%rdx, (%r13)
	subq	%r14, 8(%r13)
LBB0_11:
	movl	%ecx, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_FIFO_LAST,4,2                  ## @FIFO_LAST
	.comm	_FIFO_PEEK,4,2                  ## @FIFO_PEEK
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_fifo_read                      ; -- Begin function fifo_read
	.p2align	2
_fifo_read:                             ; @fifo_read
	.cfi_startproc
; %bb.0:
	stp	x24, x23, [sp, #-64]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 64
	stp	x22, x21, [sp, #16]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #32]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #48]             ; 16-byte Folded Spill
	add	x29, sp, #48
	.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
	mov	x21, x3
	mov	x19, x2
	mov	x22, x1
	mov	x20, x0
	bl	_fifo_size
	cmp	x0, x19
	b.hs	LBB0_2
; %bb.1:
	mov	w0, #1
	b	LBB0_8
LBB0_2:
	ldr	x8, [x20]
Lloh0:
	adrp	x9, _FIFO_LAST@GOTPAGE
Lloh1:
	ldr	x9, [x9, _FIFO_LAST@GOTPAGEOFF]
Lloh2:
	ldr	w9, [x9]
	tst	w9, w21
	b.eq	LBB0_4
; %bb.3:
	ldp	x10, x9, [x20, #8]
	sub	x11, x8, x19
	add	x10, x11, x10
	udiv	x11, x10, x9
	msub	x24, x11, x9, x10
	b	LBB0_5
LBB0_4:
	ldr	x9, [x20, #16]
	mov	x24, x8
LBB0_5:
	sub	x8, x9, x8
	cmp	x8, x19
	csel	x23, x8, x19, lo
	ldr	x8, [x20, #24]
	add	x1, x8, x24, lsl #2
	mov	x0, x22
	mov	x2, x23
	bl	_memcpy
	add	x0, x22, x23
	ldr	x1, [x20, #24]
	sub	x2, x19, x23
	bl	_memcpy
Lloh3:
	adrp	x8, _FIFO_PEEK@GOTPAGE
Lloh4:
	ldr	x8, [x8, _FIFO_PEEK@GOTPAGEOFF]
Lloh5:
	ldr	w8, [x8]
	tst	w8, w21
	b.eq	LBB0_7
; %bb.6:
	mov	w0, #0
	b	LBB0_8
LBB0_7:
	mov	w0, #0
	add	x8, x24, x19
	ldp	x10, x9, [x20, #8]
	udiv	x11, x8, x9
	msub	x8, x11, x9, x8
	sub	x9, x10, x19
	stp	x8, x9, [x20]
LBB0_8:
	ldp	x29, x30, [sp, #48]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #32]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #16]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp], #64             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.cfi_endproc
                                        ; -- End function
	.comm	_FIFO_LAST,4,2                  ; @FIFO_LAST
	.comm	_FIFO_PEEK,4,2                  ; @FIFO_PEEK
.subsections_via_symbols
