	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_read_fifo                      ## -- Begin function read_fifo
	.p2align	4, 0x90
_read_fifo:                             ## @read_fifo
	.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
	subq	$24, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rcx, %r14
	movq	%rdi, %r12
	movl	%esi, -44(%rbp)
	movl	%edx, -60(%rbp)
	movl	(%rdi), %r15d
	movl	$0, -56(%rbp)
	movl	$0, -52(%rbp)
	movl	$0, -48(%rbp)
	leaq	-44(%rbp), %rbx
	movq	%rbx, %rdi
	callq	_FD_ZERO
	leaq	-60(%rbp), %r13
	movq	%r13, %rdi
	callq	_FD_ZERO
	movq	8(%r12), %rax
	movl	(%rax), %edi
	movq	%rbx, %rsi
	callq	_FD_SET
	movl	%r15d, %edi
	movq	%rbx, %rsi
	callq	_FD_SET
	movq	8(%r12), %rax
	movl	(%rax), %esi
	movl	%r15d, %edi
	callq	_MAX
                                        ## kill: def $eax killed $eax def $rax
	leal	1(%rax), %edi
	movq	%rbx, %rsi
	movq	%r13, %rdx
	xorl	%ecx, %ecx
	xorl	%r8d, %r8d
	callq	_select
	cmpl	$-1, %eax
	jne	LBB0_3
## %bb.1:
	movq	_errno@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	cmpl	$128, %edi
	je	LBB0_3
## %bb.2:
	callq	_strerror
	leaq	L_.str(%rip), %rdi
	movl	%eax, %esi
	callq	_FATAL
LBB0_3:
	movq	8(%r12), %rax
	movl	(%rax), %edi
	leaq	-44(%rbp), %rsi
	callq	_FD_ISSET
	movq	%rax, %rcx
	movl	$1, %eax
	testq	%rcx, %rcx
	jne	LBB0_16
## %bb.4:
	leaq	-44(%rbp), %rsi
	movl	%r15d, %edi
	callq	_FD_ISSET
	testq	%rax, %rax
	je	LBB0_5
## %bb.6:
	movl	16(%r12), %ecx
	movq	_HDR_SIZE@GOTPCREL(%rip), %rax
	movl	(%rax), %ebx
	subl	%ecx, %ebx
	jle	LBB0_9
## %bb.7:
	leaq	16(%r12), %rdx
	movq	24(%r12), %rsi
	movl	%r15d, %edi
	movl	%ebx, %r8d
	callq	_ws_read_fifo
	movl	%eax, %ecx
	xorl	%eax, %eax
	testl	%ecx, %ecx
	js	LBB0_16
## %bb.8:
	cmpl	%ebx, %ecx
	jne	LBB0_16
LBB0_9:
	movq	24(%r12), %r13
	leaq	-56(%rbp), %rsi
	movq	%r13, %rdi
	callq	_unpack_uint32
	movslq	%eax, %rbx
	addq	%r13, %rbx
	leaq	-52(%rbp), %rsi
	movq	%rbx, %rdi
	callq	_unpack_uint32
	movslq	%eax, %rdi
	addq	%rbx, %rdi
	leaq	-48(%rbp), %rsi
	callq	_unpack_uint32
	movq	32(%r12), %rdx
	testq	%rdx, %rdx
	jne	LBB0_11
## %bb.10:
	movl	$1, %edi
	movl	$24, %esi
	callq	_xcalloc
	movq	%rax, 32(%r12)
	movl	-52(%rbp), %ecx
	movl	%ecx, (%rax)
	movl	-48(%rbp), %edi
	movl	%edi, 4(%rax)
	movl	$1, %esi
	callq	_xcalloc
	movq	32(%r12), %rcx
	movq	%rax, 8(%rcx)
	movq	32(%r12), %rdx
LBB0_11:
	movl	4(%rdx), %ebx
	movl	16(%rdx), %ecx
	subl	%ecx, %ebx
	jle	LBB0_14
## %bb.12:
	movq	8(%rdx), %rsi
	addq	$16, %rdx
	movl	%r15d, %edi
	movl	%ebx, %r8d
	callq	_ws_read_fifo
	movl	%eax, %ecx
	xorl	%eax, %eax
	testl	%ecx, %ecx
	js	LBB0_16
## %bb.13:
	cmpl	%ebx, %ecx
	jne	LBB0_16
LBB0_14:
	movq	%r12, %rdi
	callq	_clear_fifo_packet
	movl	-56(%rbp), %edi
	callq	*%r14
	jmp	LBB0_15
LBB0_5:
	leaq	L_.str.1(%rip), %rdi
	callq	_LOG
LBB0_15:
	xorl	%eax, %eax
LBB0_16:
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_errno,4,2                      ## @errno
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Unable to select: %s."

L_.str.1:                               ## @.str.1
	.asciz	"No file descriptor set on read_message()\n"

	.comm	_HDR_SIZE,4,2                   ## @HDR_SIZE
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_read_fifo                      ; -- Begin function read_fifo
	.p2align	2
_read_fifo:                             ; @read_fifo
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #80
	.cfi_def_cfa_offset 80
	stp	x22, x21, [sp, #32]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #48]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #64]             ; 16-byte Folded Spill
	add	x29, sp, #64
	.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	x19, x3
	mov	x20, x0
	stp	w2, w1, [sp, #24]
	ldr	w21, [x0]
	str	xzr, [sp, #16]
	str	wzr, [sp, #12]
	add	x0, sp, #28
	bl	_FD_ZERO
	add	x0, sp, #24
	bl	_FD_ZERO
	ldr	x8, [x20, #8]
	ldr	w0, [x8]
	add	x1, sp, #28
	bl	_FD_SET
	add	x1, sp, #28
	mov	x0, x21
	bl	_FD_SET
	ldr	x8, [x20, #8]
	ldr	w1, [x8]
	mov	x0, x21
	bl	_MAX
	add	w0, w0, #1
	add	x1, sp, #28
	add	x2, sp, #24
	mov	x3, #0
	mov	x4, #0
	bl	_select
	cmn	w0, #1
	b.ne	LBB0_3
; %bb.1:
Lloh0:
	adrp	x8, _errno@GOTPAGE
Lloh1:
	ldr	x8, [x8, _errno@GOTPAGEOFF]
Lloh2:
	ldr	w0, [x8]
	cmp	w0, #128
	b.eq	LBB0_3
; %bb.2:
	bl	_strerror
	mov	x1, x0
Lloh3:
	adrp	x0, l_.str@PAGE
Lloh4:
	add	x0, x0, l_.str@PAGEOFF
	bl	_FATAL
LBB0_3:
	ldr	x8, [x20, #8]
	ldr	w0, [x8]
	add	x1, sp, #28
	bl	_FD_ISSET
	cbz	x0, LBB0_5
; %bb.4:
	mov	w0, #1
	b	LBB0_17
LBB0_5:
	add	x1, sp, #28
	mov	x0, x21
	bl	_FD_ISSET
	cbz	x0, LBB0_15
; %bb.6:
	mov	x2, x20
	ldr	w3, [x2, #16]!
Lloh5:
	adrp	x8, _HDR_SIZE@GOTPAGE
Lloh6:
	ldr	x8, [x8, _HDR_SIZE@GOTPAGEOFF]
Lloh7:
	ldr	w8, [x8]
	sub	w22, w8, w3
	cmp	w22, #1
	b.lt	LBB0_9
; %bb.7:
	ldr	x1, [x20, #24]
	mov	x0, x21
	mov	x4, x22
	bl	_ws_read_fifo
	mov	x8, x0
	mov	w0, #0
	tbnz	w8, #31, LBB0_17
; %bb.8:
	cmp	w8, w22
	b.ne	LBB0_17
LBB0_9:
	ldr	x22, [x20, #24]
	add	x1, sp, #20
	mov	x0, x22
	bl	_unpack_uint32
	add	x22, x22, w0, sxtw
	add	x1, sp, #16
	mov	x0, x22
	bl	_unpack_uint32
	add	x0, x22, w0, sxtw
	add	x1, sp, #12
	bl	_unpack_uint32
	ldr	x8, [x20, #32]
	cbnz	x8, LBB0_11
; %bb.10:
	mov	w0, #1
	mov	w1, #24
	bl	_xcalloc
	str	x0, [x20, #32]
	ldr	w8, [sp, #16]
	str	w8, [x0]
	ldr	w8, [sp, #12]
	str	w8, [x0, #4]
	mov	x0, x8
	mov	w1, #1
	bl	_xcalloc
	ldr	x8, [x20, #32]
	str	x0, [x8, #8]
	ldr	x8, [x20, #32]
LBB0_11:
	mov	x2, x8
	ldr	w3, [x2, #16]!
	ldur	w9, [x2, #-12]
	sub	w22, w9, w3
	cmp	w22, #1
	b.lt	LBB0_14
; %bb.12:
	ldr	x1, [x8, #8]
	mov	x0, x21
	mov	x4, x22
	bl	_ws_read_fifo
	mov	x8, x0
	mov	w0, #0
	tbnz	w8, #31, LBB0_17
; %bb.13:
	cmp	w8, w22
	b.ne	LBB0_17
LBB0_14:
	mov	x0, x20
	bl	_clear_fifo_packet
	ldr	w0, [sp, #20]
	blr	x19
	b	LBB0_16
LBB0_15:
Lloh8:
	adrp	x0, l_.str.1@PAGE
Lloh9:
	add	x0, x0, l_.str.1@PAGEOFF
	bl	_LOG
LBB0_16:
	mov	w0, #0
LBB0_17:
	ldp	x29, x30, [sp, #64]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #48]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #32]             ; 16-byte Folded Reload
	add	sp, sp, #80
	ret
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpAdd	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpAdd	Lloh8, Lloh9
	.cfi_endproc
                                        ; -- End function
	.comm	_errno,4,2                      ; @errno
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Unable to select: %s."

l_.str.1:                               ; @.str.1
	.asciz	"No file descriptor set on read_message()\n"

	.comm	_HDR_SIZE,4,2                   ; @HDR_SIZE
.subsections_via_symbols
