	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function fd_event
_fd_event:                              ## @fd_event
	.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
	movq	%rsi, %rbx
	testl	%edi, %edi
	je	LBB0_1
LBB0_9:
	movq	_SERIAL_ERROR@GOTPCREL(%rip), %rax
LBB0_10:
	movq	(%rax), %rax
	movq	%rax, (%rbx)
	jmp	LBB0_11
LBB0_1:
	cmpq	$0, (%rbx)
	je	LBB0_2
LBB0_11:
	movl	8(%rbx), %esi
	movq	%rbx, %rdi
	callq	*16(%rbx)
	movq	%rbx, %rdi
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_reschedule                     ## TAILCALL
LBB0_2:
	movq	_BUFSIZ@GOTPCREL(%rip), %r14
	movq	_errno@GOTPCREL(%rip), %r15
	movq	_EINTR@GOTPCREL(%rip), %r12
	.p2align	4, 0x90
LBB0_3:                                 ## =>This Inner Loop Header: Depth=1
	movl	24(%rbx), %esi
	movl	32(%rbx), %edi
	movl	(%r14), %edx
	callq	_read
	cmpl	$-1, %eax
	jne	LBB0_5
## %bb.4:                               ##   in Loop: Header=BB0_3 Depth=1
	movq	(%r12), %rcx
	cmpq	%rcx, (%r15)
	je	LBB0_3
LBB0_5:
	testl	%eax, %eax
	je	LBB0_6
## %bb.7:
	jle	LBB0_9
## %bb.8:
	movl	%eax, %eax
	movq	%rax, (%rbx)
	movl	24(%rbx), %eax
	movl	%eax, 28(%rbx)
	jmp	LBB0_11
LBB0_6:
	movq	_SERIAL_EOF@GOTPCREL(%rip), %rax
	jmp	LBB0_10
	.cfi_endproc
                                        ## -- End function
	.comm	_SERIAL_ERROR,8,3               ## @SERIAL_ERROR
	.comm	_BUFSIZ,4,2                     ## @BUFSIZ
	.comm	_errno,8,3                      ## @errno
	.comm	_EINTR,8,3                      ## @EINTR
	.comm	_SERIAL_EOF,8,3                 ## @SERIAL_EOF
	.no_dead_strip	_fd_event
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function fd_event
_fd_event:                              ; @fd_event
	.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	x19, x1
	cbz	w0, LBB0_3
LBB0_1:
Lloh0:
	adrp	x8, _SERIAL_ERROR@GOTPAGE
Lloh1:
	ldr	x8, [x8, _SERIAL_ERROR@GOTPAGEOFF]
LBB0_2:
	ldr	x8, [x8]
	str	x8, [x19]
	b	LBB0_4
LBB0_3:
	ldr	x8, [x19]
	cbz	x8, LBB0_5
LBB0_4:
	ldr	x8, [x19, #16]
	ldr	w1, [x19, #8]
	mov	x0, x19
	blr	x8
	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
	b	_reschedule
LBB0_5:
Lloh2:
	adrp	x20, _BUFSIZ@GOTPAGE
Lloh3:
	ldr	x20, [x20, _BUFSIZ@GOTPAGEOFF]
Lloh4:
	adrp	x21, _errno@GOTPAGE
Lloh5:
	ldr	x21, [x21, _errno@GOTPAGEOFF]
Lloh6:
	adrp	x22, _EINTR@GOTPAGE
Lloh7:
	ldr	x22, [x22, _EINTR@GOTPAGEOFF]
LBB0_6:                                 ; =>This Inner Loop Header: Depth=1
	ldr	w0, [x19, #32]
	ldr	w1, [x19, #24]
	ldr	w2, [x20]
	bl	_read
	ldr	x8, [x21]
	ldr	x9, [x22]
	cmn	w0, #1
	ccmp	x8, x9, #0, eq
	b.eq	LBB0_6
; %bb.7:
	cbz	w0, LBB0_10
; %bb.8:
	cmp	w0, #1
	b.lt	LBB0_1
; %bb.9:
	mov	w8, w0
	str	x8, [x19]
	ldr	w8, [x19, #24]
	str	w8, [x19, #28]
	b	LBB0_4
LBB0_10:
Lloh8:
	adrp	x8, _SERIAL_EOF@GOTPAGE
Lloh9:
	ldr	x8, [x8, _SERIAL_EOF@GOTPAGEOFF]
	b	LBB0_2
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGot	Lloh6, Lloh7
	.loh AdrpLdrGot	Lloh4, Lloh5
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpLdrGot	Lloh8, Lloh9
	.cfi_endproc
                                        ; -- End function
	.comm	_SERIAL_ERROR,8,3               ; @SERIAL_ERROR
	.comm	_BUFSIZ,4,2                     ; @BUFSIZ
	.comm	_errno,8,3                      ; @errno
	.comm	_EINTR,8,3                      ; @EINTR
	.comm	_SERIAL_EOF,8,3                 ; @SERIAL_EOF
	.no_dead_strip	_fd_event
.subsections_via_symbols
