	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_event_add                      ## -- Begin function event_add
	.p2align	4, 0x90
_event_add:                             ## @event_add
	.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	%rsi, %r12
	movq	%rdi, %rbx
	movq	40(%rdi), %r15
	movq	(%r15), %r13
	movq	8(%r15), %r14
	movslq	12(%rdi), %rdi
	callq	_event_debug
	movq	_EVLIST_ALL@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	notl	%eax
	xorl	%edi, %edi
	andl	4(%rbx), %eax
	sete	%dil
	callq	_assert
	testq	%r12, %r12
	je	LBB0_10
## %bb.1:
	movl	4(%rbx), %eax
	movq	_EVLIST_TIMEOUT@GOTPCREL(%rip), %rcx
	movl	(%rcx), %edx
	testl	%eax, %edx
	je	LBB0_3
## %bb.2:
	movq	%r15, %rdi
	movq	%rbx, %rsi
	callq	_event_queue_remove
	movl	4(%rbx), %eax
LBB0_3:
	movq	%r13, -48(%rbp)                 ## 8-byte Spill
	movq	_EVLIST_ACTIVE@GOTPCREL(%rip), %rcx
	movl	(%rcx), %edx
	testl	%eax, %edx
	je	LBB0_9
## %bb.4:
	movq	_EV_TIMEOUT@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	testl	%eax, 8(%rbx)
	je	LBB0_9
## %bb.5:
	cmpq	$0, 32(%rbx)
	je	LBB0_8
## %bb.6:
	movq	24(%rbx), %rax
	testq	%rax, %rax
	je	LBB0_8
## %bb.7:
	movq	$0, (%rax)
LBB0_8:
	movq	%r15, %rdi
	movq	%rbx, %rsi
	callq	_event_queue_remove
LBB0_9:
	leaq	-56(%rbp), %r13
	movq	%r13, %rdi
	callq	_gettime
	leaq	16(%rbx), %rdx
	movq	%r13, %rdi
	movq	%r12, %rsi
	callq	_timeradd
	movslq	12(%rbx), %rdi
	callq	_event_debug
	movq	_EVLIST_TIMEOUT@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	%r15, %rdi
	movq	%rbx, %rsi
	callq	_event_queue_insert
	movq	-48(%rbp), %r13                 ## 8-byte Reload
LBB0_10:
	movl	(%rbx), %ecx
	movq	_EV_READ@GOTPCREL(%rip), %rax
	movq	_EV_WRITE@GOTPCREL(%rip), %rdx
	movl	(%rdx), %edx
	orl	(%rax), %edx
	testl	%ecx, %edx
	je	LBB0_12
## %bb.11:
	movq	_EVLIST_INSERTED@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	_EVLIST_ACTIVE@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	orl	%edx, %eax
	testl	%eax, 4(%rbx)
	je	LBB0_14
LBB0_12:
	movq	_EV_SIGNAL@GOTPCREL(%rip), %rdx
	xorl	%eax, %eax
	testl	%ecx, (%rdx)
	je	LBB0_15
## %bb.13:
	movq	_EVLIST_SIGNAL@GOTPCREL(%rip), %rcx
	movl	(%rcx), %edx
	testl	%edx, 4(%rbx)
	jne	LBB0_15
LBB0_14:
	movq	%r15, %rdi
	movq	%rbx, %rsi
	callq	_event_queue_insert
	movq	%r13, %rdi
	movq	%rbx, %rsi
	callq	*(%r14)
LBB0_15:
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_EV_READ,4,2                    ## @EV_READ
	.comm	_EV_WRITE,4,2                   ## @EV_WRITE
	.comm	_EVLIST_ALL,4,2                 ## @EVLIST_ALL
	.comm	_EVLIST_TIMEOUT,4,2             ## @EVLIST_TIMEOUT
	.comm	_EVLIST_ACTIVE,4,2              ## @EVLIST_ACTIVE
	.comm	_EV_TIMEOUT,4,2                 ## @EV_TIMEOUT
	.comm	_EVLIST_INSERTED,4,2            ## @EVLIST_INSERTED
	.comm	_EV_SIGNAL,4,2                  ## @EV_SIGNAL
	.comm	_EVLIST_SIGNAL,4,2              ## @EVLIST_SIGNAL
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_event_add                      ; -- Begin function event_add
	.p2align	2
_event_add:                             ; @event_add
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #96
	.cfi_def_cfa_offset 96
	stp	x26, x25, [sp, #16]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #32]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #48]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #64]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #80]             ; 16-byte Folded Spill
	add	x29, sp, #80
	.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
	.cfi_offset w25, -72
	.cfi_offset w26, -80
	mov	x22, x1
	mov	x19, x0
	ldr	x21, [x0, #40]
	ldp	x20, x23, [x21]
	ldrsw	x0, [x0, #12]
	bl	_event_debug
	ldr	w8, [x19, #4]
Lloh0:
	adrp	x9, _EVLIST_ALL@GOTPAGE
Lloh1:
	ldr	x9, [x9, _EVLIST_ALL@GOTPAGEOFF]
Lloh2:
	ldr	w9, [x9]
	bics	wzr, w8, w9
	cset	w0, eq
	bl	_assert
Lloh3:
	adrp	x24, _EVLIST_ACTIVE@GOTPAGE
Lloh4:
	ldr	x24, [x24, _EVLIST_ACTIVE@GOTPAGEOFF]
	cbz	x22, LBB0_10
; %bb.1:
	ldr	w8, [x19, #4]
Lloh5:
	adrp	x25, _EVLIST_TIMEOUT@GOTPAGE
Lloh6:
	ldr	x25, [x25, _EVLIST_TIMEOUT@GOTPAGEOFF]
	ldr	w2, [x25]
	tst	w2, w8
	b.eq	LBB0_3
; %bb.2:
	mov	x0, x21
	mov	x1, x19
	bl	_event_queue_remove
	ldr	w8, [x19, #4]
LBB0_3:
	ldr	w2, [x24]
	tst	w2, w8
	b.eq	LBB0_9
; %bb.4:
	ldr	w8, [x19, #8]
Lloh7:
	adrp	x9, _EV_TIMEOUT@GOTPAGE
Lloh8:
	ldr	x9, [x9, _EV_TIMEOUT@GOTPAGEOFF]
Lloh9:
	ldr	w9, [x9]
	tst	w9, w8
	b.eq	LBB0_9
; %bb.5:
	ldr	x8, [x19, #32]
	cbz	x8, LBB0_8
; %bb.6:
	ldr	x8, [x19, #24]
	cbz	x8, LBB0_8
; %bb.7:
	str	xzr, [x8]
LBB0_8:
	mov	x0, x21
	mov	x1, x19
	bl	_event_queue_remove
LBB0_9:
	add	x0, sp, #8
	bl	_gettime
	add	x2, x19, #16
	add	x0, sp, #8
	mov	x1, x22
	bl	_timeradd
	ldrsw	x0, [x19, #12]
	bl	_event_debug
	ldr	w2, [x25]
	mov	x0, x21
	mov	x1, x19
	bl	_event_queue_insert
LBB0_10:
	ldr	w8, [x19]
Lloh10:
	adrp	x9, _EV_READ@GOTPAGE
Lloh11:
	ldr	x9, [x9, _EV_READ@GOTPAGEOFF]
Lloh12:
	ldr	w9, [x9]
Lloh13:
	adrp	x10, _EV_WRITE@GOTPAGE
Lloh14:
	ldr	x10, [x10, _EV_WRITE@GOTPAGEOFF]
Lloh15:
	ldr	w10, [x10]
	orr	w9, w10, w9
	tst	w9, w8
	b.eq	LBB0_12
; %bb.11:
	ldr	w9, [x19, #4]
Lloh16:
	adrp	x10, _EVLIST_INSERTED@GOTPAGE
Lloh17:
	ldr	x10, [x10, _EVLIST_INSERTED@GOTPAGEOFF]
Lloh18:
	ldr	w2, [x10]
	ldr	w10, [x24]
	orr	w10, w10, w2
	tst	w10, w9
	b.eq	LBB0_15
LBB0_12:
Lloh19:
	adrp	x9, _EV_SIGNAL@GOTPAGE
Lloh20:
	ldr	x9, [x9, _EV_SIGNAL@GOTPAGEOFF]
Lloh21:
	ldr	w9, [x9]
	tst	w9, w8
	b.eq	LBB0_14
; %bb.13:
	ldr	w8, [x19, #4]
Lloh22:
	adrp	x9, _EVLIST_SIGNAL@GOTPAGE
Lloh23:
	ldr	x9, [x9, _EVLIST_SIGNAL@GOTPAGEOFF]
Lloh24:
	ldr	w2, [x9]
	tst	w2, w8
	b.eq	LBB0_15
LBB0_14:
	mov	w0, #0
	b	LBB0_16
LBB0_15:
	mov	x0, x21
	mov	x1, x19
	bl	_event_queue_insert
	ldr	x8, [x23]
	mov	x0, x20
	mov	x1, x19
	blr	x8
LBB0_16:
	ldp	x29, x30, [sp, #80]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #64]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #48]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #32]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #96
	ret
	.loh AdrpLdrGot	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGot	Lloh5, Lloh6
	.loh AdrpLdrGotLdr	Lloh7, Lloh8, Lloh9
	.loh AdrpLdrGotLdr	Lloh13, Lloh14, Lloh15
	.loh AdrpLdrGotLdr	Lloh10, Lloh11, Lloh12
	.loh AdrpLdrGotLdr	Lloh16, Lloh17, Lloh18
	.loh AdrpLdrGotLdr	Lloh19, Lloh20, Lloh21
	.loh AdrpLdrGotLdr	Lloh22, Lloh23, Lloh24
	.cfi_endproc
                                        ; -- End function
	.comm	_EV_READ,4,2                    ; @EV_READ
	.comm	_EV_WRITE,4,2                   ; @EV_WRITE
	.comm	_EVLIST_ALL,4,2                 ; @EVLIST_ALL
	.comm	_EVLIST_TIMEOUT,4,2             ; @EVLIST_TIMEOUT
	.comm	_EVLIST_ACTIVE,4,2              ; @EVLIST_ACTIVE
	.comm	_EV_TIMEOUT,4,2                 ; @EV_TIMEOUT
	.comm	_EVLIST_INSERTED,4,2            ; @EVLIST_INSERTED
	.comm	_EV_SIGNAL,4,2                  ; @EV_SIGNAL
	.comm	_EVLIST_SIGNAL,4,2              ; @EVLIST_SIGNAL
.subsections_via_symbols
