	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function fifo_read
_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	%rbx
	subq	$264, %rsp                      ## imm = 0x108
	.cfi_offset %rbx, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdx, %r14
	movl	%esi, %ecx
	movq	%rdi, %rbx
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	%rax, -32(%rbp)
	movq	_stderr@GOTPCREL(%rip), %r15
	movl	(%r15), %edi
	leaq	L_.str(%rip), %rsi
	movl	%ebx, %edx
	movq	%r14, %r8
	xorl	%eax, %eax
	callq	_fprintf
	leaq	-288(%rbp), %rsi
	movq	%rbx, %rdi
	movl	$254, %edx
	callq	_read
	testl	%eax, %eax
	jle	LBB0_1
## %bb.7:
	movl	%eax, %eax
	movb	$0, -288(%rbp,%rax)
	movq	_stdout@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	leaq	L_.str.3(%rip), %rsi
	leaq	-288(%rbp), %rdx
	xorl	%eax, %eax
	callq	_fprintf
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	cmpq	-32(%rbp), %rax
	jne	LBB0_9
## %bb.8:
	addq	$264, %rsp                      ## imm = 0x108
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_1:
	je	LBB0_4
## %bb.2:
	cmpl	$-1, %eax
	jne	LBB0_5
## %bb.3:
	leaq	L_.str.1(%rip), %rdi
	callq	_perror
	jmp	LBB0_5
LBB0_4:
	movl	(%r15), %edi
	leaq	L_.str.2(%rip), %rsi
	xorl	%eax, %eax
	callq	_fprintf
LBB0_5:
	movq	%r14, %rdi
	callq	_event_del
	movq	%r14, %rdi
	callq	_event_get_base
	movq	___stack_chk_guard@GOTPCREL(%rip), %rcx
	movq	(%rcx), %rcx
	cmpq	-32(%rbp), %rcx
	jne	LBB0_9
## %bb.6:
	movl	%eax, %edi
	addq	$264, %rsp                      ## imm = 0x108
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_event_base_loopbreak           ## TAILCALL
LBB0_9:
	callq	___stack_chk_fail
	.cfi_endproc
                                        ## -- End function
	.comm	_stderr,4,2                     ## @stderr
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"fifo_read called with fd: %d, event: %d, arg: %p\n"

L_.str.1:                               ## @.str.1
	.asciz	"read"

L_.str.2:                               ## @.str.2
	.asciz	"Connection closed\n"

	.comm	_stdout,4,2                     ## @stdout
L_.str.3:                               ## @.str.3
	.asciz	"Read: %s\n"

	.no_dead_strip	_fifo_read
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function fifo_read
_fifo_read:                             ; @fifo_read
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #352
	.cfi_def_cfa_offset 352
	stp	x28, x27, [sp, #288]            ; 16-byte Folded Spill
	stp	x22, x21, [sp, #304]            ; 16-byte Folded Spill
	stp	x20, x19, [sp, #320]            ; 16-byte Folded Spill
	stp	x29, x30, [sp, #336]            ; 16-byte Folded Spill
	add	x29, sp, #336
	.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 w27, -56
	.cfi_offset w28, -64
	mov	x19, x2
                                        ; kill: def $w1 killed $w1 def $x1
	mov	x20, x0
Lloh0:
	adrp	x8, ___stack_chk_guard@GOTPAGE
Lloh1:
	ldr	x8, [x8, ___stack_chk_guard@GOTPAGEOFF]
Lloh2:
	ldr	x8, [x8]
	stur	x8, [x29, #-56]
Lloh3:
	adrp	x21, _stderr@GOTPAGE
Lloh4:
	ldr	x21, [x21, _stderr@GOTPAGEOFF]
	ldr	w0, [x21]
	sxtw	x8, w1
	stp	x8, x2, [sp, #8]
	str	x20, [sp]
Lloh5:
	adrp	x1, l_.str@PAGE
Lloh6:
	add	x1, x1, l_.str@PAGEOFF
	bl	_fprintf
	add	x22, sp, #25
	add	x1, sp, #25
	mov	x0, x20
	mov	w2, #254
	bl	_read
	cmp	w0, #0
	b.le	LBB0_3
; %bb.1:
	strb	wzr, [x22, w0, uxtw]
Lloh7:
	adrp	x8, _stdout@GOTPAGE
Lloh8:
	ldr	x8, [x8, _stdout@GOTPAGEOFF]
Lloh9:
	ldr	w0, [x8]
	str	x22, [sp]
Lloh10:
	adrp	x1, l_.str.3@PAGE
Lloh11:
	add	x1, x1, l_.str.3@PAGEOFF
	bl	_fprintf
	ldur	x8, [x29, #-56]
Lloh12:
	adrp	x9, ___stack_chk_guard@GOTPAGE
Lloh13:
	ldr	x9, [x9, ___stack_chk_guard@GOTPAGEOFF]
Lloh14:
	ldr	x9, [x9]
	cmp	x9, x8
	b.ne	LBB0_9
; %bb.2:
	ldp	x29, x30, [sp, #336]            ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #320]            ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #304]            ; 16-byte Folded Reload
	ldp	x28, x27, [sp, #288]            ; 16-byte Folded Reload
	add	sp, sp, #352
	ret
LBB0_3:
	cbz	w0, LBB0_6
; %bb.4:
	cmn	w0, #1
	b.ne	LBB0_7
; %bb.5:
Lloh15:
	adrp	x0, l_.str.1@PAGE
Lloh16:
	add	x0, x0, l_.str.1@PAGEOFF
	bl	_perror
	b	LBB0_7
LBB0_6:
	ldr	w0, [x21]
Lloh17:
	adrp	x1, l_.str.2@PAGE
Lloh18:
	add	x1, x1, l_.str.2@PAGEOFF
	bl	_fprintf
LBB0_7:
	mov	x0, x19
	bl	_event_del
	mov	x0, x19
	bl	_event_get_base
	ldur	x8, [x29, #-56]
Lloh19:
	adrp	x9, ___stack_chk_guard@GOTPAGE
Lloh20:
	ldr	x9, [x9, ___stack_chk_guard@GOTPAGEOFF]
Lloh21:
	ldr	x9, [x9]
	cmp	x9, x8
	b.ne	LBB0_9
; %bb.8:
	ldp	x29, x30, [sp, #336]            ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #320]            ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #304]            ; 16-byte Folded Reload
	ldp	x28, x27, [sp, #288]            ; 16-byte Folded Reload
	add	sp, sp, #352
	b	_event_base_loopbreak
LBB0_9:
	bl	___stack_chk_fail
	.loh AdrpAdd	Lloh5, Lloh6
	.loh AdrpLdrGot	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.loh AdrpAdd	Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh7, Lloh8, Lloh9
	.loh AdrpAdd	Lloh15, Lloh16
	.loh AdrpAdd	Lloh17, Lloh18
	.loh AdrpLdrGotLdr	Lloh19, Lloh20, Lloh21
	.cfi_endproc
                                        ; -- End function
	.comm	_stderr,4,2                     ; @stderr
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"fifo_read called with fd: %d, event: %d, arg: %p\n"

l_.str.1:                               ; @.str.1
	.asciz	"read"

l_.str.2:                               ; @.str.2
	.asciz	"Connection closed\n"

	.comm	_stdout,4,2                     ; @stdout
l_.str.3:                               ; @.str.3
	.asciz	"Read: %s\n"

	.no_dead_strip	_fifo_read
.subsections_via_symbols
