	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_epoll_insert                   ## -- Begin function epoll_insert
	.p2align	4, 0x90
_epoll_insert:                          ## @epoll_insert
	.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
	movl	%edi, %r14d
	testl	%esi, %esi
	je	LBB0_11
## %bb.1:
	movl	%esi, %r15d
	testl	%r14d, %r14d
	setns	%al
	movq	_MAX_EVENTS@GOTPCREL(%rip), %rcx
	cmpl	%r14d, (%rcx)
	setg	%cl
	andb	%al, %cl
	movzbl	%cl, %edi
	callq	_assert
	movq	_Events@GOTPCREL(%rip), %rax
	movq	(%rax), %r13
	movslq	%r14d, %rax
	leaq	(%rax,%rax,2), %r12
	cmpl	%eax, (%r13,%r12,8)
	je	LBB0_3
## %bb.2:
	leaq	(,%r12,8), %rbx
	addq	%r13, %rbx
	movq	%rbx, %rdi
	xorl	%esi, %esi
	movl	$24, %edx
	callq	_memset
	movl	%r14d, (%rbx)
LBB0_3:
	movq	_EVT_NEW@GOTPCREL(%rip), %rsi
	movq	_EVT_NOHUP@GOTPCREL(%rip), %rcx
	movq	_EVT_LEVEL@GOTPCREL(%rip), %rdx
	movq	_EVT_RWX@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	orl	(%rdx), %eax
	movl	(%rsi), %ebx
	orl	%eax, %ebx
	orl	(%rcx), %ebx
	andl	%r15d, %ebx
	movq	$0, 16(%r13,%r12,8)
	movl	4(%r13,%r12,8), %ecx
	movq	_EVT_IN_EPOLL@GOTPCREL(%rip), %rdx
	movl	(%rdx), %edx
	movl	%edx, %esi
	orl	%eax, %esi
	andl	%ecx, %esi
	addl	%ebx, %edx
	cmpl	%edx, %esi
	je	LBB0_10
## %bb.4:
	leaq	4(,%r12,8), %r15
	addq	%r13, %r15
	movl	%ebx, %edx
	xorl	%ecx, %edx
	andl	%eax, %edx
	xorl	%ecx, %edx
	movl	%edx, (%r15)
	movl	%ebx, %edi
	callq	_epoll_conv_flags
	movq	_EVT_NEW@GOTPCREL(%rip), %rcx
	movq	_EVT_IN_EPOLL@GOTPCREL(%rip), %rdi
	cmpl	8(%r13,%r12,8), %eax
	jne	LBB0_7
## %bb.5:
	testl	%ebx, (%rcx)
	je	LBB0_6
LBB0_7:
	movl	%eax, -48(%rbp)
	movl	%r14d, -44(%rbp)
	movq	_epoll_fd@GOTPCREL(%rip), %rcx
	movl	(%rcx), %edx
	movl	(%rdi), %ecx
	andl	(%r15), %ecx
	movq	_EPOLL_CTL_MOD@GOTPCREL(%rip), %rbx
	movq	_EPOLL_CTL_ADD@GOTPCREL(%rip), %r13
	movq	%rbx, %rcx
	cmoveq	%r13, %rcx
	movl	(%rcx), %ecx
	movl	%eax, (%rsp)
	leaq	L_.str(%rip), %rsi
	movq	%rdi, %r12
	movl	$1, %edi
	movl	%r14d, %r8d
	movl	%r14d, %r9d
	callq	_vkprintf
	movl	(%r12), %eax
	andl	(%r15), %eax
	movq	_epoll_fd@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	cmoveq	%r13, %rbx
	movl	(%rbx), %esi
	leaq	-48(%rbp), %rcx
	movl	%r14d, %edx
	callq	_epoll_ctl
	testq	%rax, %rax
	js	LBB0_8
LBB0_9:
	movq	_EVT_IN_EPOLL@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	orl	%eax, (%r15)
LBB0_10:
	xorl	%eax, %eax
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_11:
	movl	%r14d, %edi
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_epoll_remove                   ## TAILCALL
LBB0_6:
	movl	(%rdi), %ecx
	testl	%ecx, (%r15)
	jne	LBB0_10
	jmp	LBB0_7
LBB0_8:
	leaq	L_.str.1(%rip), %rdi
	callq	_perror
	jmp	LBB0_9
	.cfi_endproc
                                        ## -- End function
	.comm	_MAX_EVENTS,4,2                 ## @MAX_EVENTS
	.comm	_Events,8,3                     ## @Events
	.comm	_EVT_NEW,4,2                    ## @EVT_NEW
	.comm	_EVT_NOHUP,4,2                  ## @EVT_NOHUP
	.comm	_EVT_LEVEL,4,2                  ## @EVT_LEVEL
	.comm	_EVT_RWX,4,2                    ## @EVT_RWX
	.comm	_EVT_IN_EPOLL,4,2               ## @EVT_IN_EPOLL
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"epoll_ctl(%d,%d,%d,%d,%08x)\n"

	.comm	_epoll_fd,4,2                   ## @epoll_fd
	.comm	_EPOLL_CTL_MOD,4,2              ## @EPOLL_CTL_MOD
	.comm	_EPOLL_CTL_ADD,4,2              ## @EPOLL_CTL_ADD
L_.str.1:                               ## @.str.1
	.asciz	"epoll_ctl()"

.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_epoll_insert                   ; -- Begin function epoll_insert
	.p2align	2
_epoll_insert:                          ; @epoll_insert
	.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	x19, x0
	cbz	w1, LBB0_9
; %bb.1:
	mov	x20, x1
	cmp	w19, #0
Lloh0:
	adrp	x8, _MAX_EVENTS@GOTPAGE
Lloh1:
	ldr	x8, [x8, _MAX_EVENTS@GOTPAGEOFF]
Lloh2:
	ldr	w8, [x8]
	ccmp	w8, w19, #4, ge
	cset	w0, gt
	bl	_assert
Lloh3:
	adrp	x8, _Events@GOTPAGE
Lloh4:
	ldr	x8, [x8, _Events@GOTPAGEOFF]
Lloh5:
	ldr	x23, [x8]
	sxtw	x24, w19
	mov	w8, #24
	smaddl	x21, w19, w8, x23
	ldr	w8, [x21]
	cmp	w8, w19
	b.eq	LBB0_3
; %bb.2:
	mov	x0, x21
	mov	w1, #0
	mov	w2, #24
	bl	_memset
	str	w19, [x21]
LBB0_3:
Lloh6:
	adrp	x25, _EVT_NEW@GOTPAGE
Lloh7:
	ldr	x25, [x25, _EVT_NEW@GOTPAGEOFF]
Lloh8:
	adrp	x8, _EVT_NOHUP@GOTPAGE
Lloh9:
	ldr	x8, [x8, _EVT_NOHUP@GOTPAGEOFF]
	ldr	w9, [x25]
Lloh10:
	ldr	w10, [x8]
Lloh11:
	adrp	x8, _EVT_LEVEL@GOTPAGE
Lloh12:
	ldr	x8, [x8, _EVT_LEVEL@GOTPAGEOFF]
Lloh13:
	adrp	x11, _EVT_RWX@GOTPAGE
Lloh14:
	ldr	x11, [x11, _EVT_RWX@GOTPAGEOFF]
Lloh15:
	ldr	w8, [x8]
Lloh16:
	ldr	w11, [x11]
	orr	w8, w11, w8
	orr	w9, w8, w9
	orr	w9, w9, w10
	and	w20, w9, w20
	mov	w9, #24
	madd	x21, x24, x9, x23
	ldr	w9, [x21, #4]!
Lloh17:
	adrp	x22, _EVT_IN_EPOLL@GOTPAGE
Lloh18:
	ldr	x22, [x22, _EVT_IN_EPOLL@GOTPAGEOFF]
	stur	xzr, [x21, #12]
	ldr	w10, [x22]
	orr	w11, w10, w8
	and	w11, w11, w9
	add	w10, w10, w20
	cmp	w11, w10
	b.eq	LBB0_8
; %bb.4:
	bic	w9, w9, w8
	and	w8, w20, w8
	orr	w8, w9, w8
	str	w8, [x21]
	mov	x0, x20
	bl	_epoll_conv_flags
	mov	x6, x0
	mov	w8, #24
	madd	x8, x24, x8, x23
	ldr	w8, [x8, #8]
	cmp	w0, w8
	b.ne	LBB0_6
; %bb.5:
	ldr	w8, [x25]
	tst	w8, w20
	b.eq	LBB0_10
LBB0_6:
	stp	w6, w19, [sp, #8]
Lloh19:
	adrp	x20, _epoll_fd@GOTPAGE
Lloh20:
	ldr	x20, [x20, _epoll_fd@GOTPAGEOFF]
	ldr	w2, [x20]
	ldr	w8, [x21]
Lloh21:
	adrp	x23, _EPOLL_CTL_MOD@GOTPAGE
Lloh22:
	ldr	x23, [x23, _EPOLL_CTL_MOD@GOTPAGEOFF]
	ldr	w9, [x22]
Lloh23:
	adrp	x24, _EPOLL_CTL_ADD@GOTPAGE
Lloh24:
	ldr	x24, [x24, _EPOLL_CTL_ADD@GOTPAGEOFF]
	tst	w9, w8
	csel	x8, x24, x23, eq
	ldr	w3, [x8]
Lloh25:
	adrp	x1, l_.str@PAGE
Lloh26:
	add	x1, x1, l_.str@PAGEOFF
	mov	w0, #1
	mov	x4, x19
	mov	x5, x19
	bl	_vkprintf
	ldr	w0, [x20]
	ldr	w8, [x21]
	ldr	w9, [x22]
	tst	w9, w8
	csel	x8, x24, x23, eq
	ldr	w1, [x8]
	add	x3, sp, #8
	mov	x2, x19
	bl	_epoll_ctl
	tbnz	x0, #63, LBB0_11
LBB0_7:
	ldr	w8, [x22]
	ldr	w9, [x21]
	orr	w8, w9, w8
	str	w8, [x21]
LBB0_8:
	mov	w0, #0
	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
LBB0_9:
	mov	x0, x19
	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
	b	_epoll_remove
LBB0_10:
	ldr	w8, [x21]
	ldr	w9, [x22]
	tst	w9, w8
	b.ne	LBB0_8
	b	LBB0_6
LBB0_11:
Lloh27:
	adrp	x0, l_.str.1@PAGE
Lloh28:
	add	x0, x0, l_.str.1@PAGEOFF
	bl	_perror
	b	LBB0_7
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGot	Lloh17, Lloh18
	.loh AdrpLdrGotLdr	Lloh13, Lloh14, Lloh16
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh15
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpLdrGot	Lloh6, Lloh7
	.loh AdrpAdd	Lloh25, Lloh26
	.loh AdrpLdrGot	Lloh23, Lloh24
	.loh AdrpLdrGot	Lloh21, Lloh22
	.loh AdrpLdrGot	Lloh19, Lloh20
	.loh AdrpAdd	Lloh27, Lloh28
	.cfi_endproc
                                        ; -- End function
	.comm	_MAX_EVENTS,4,2                 ; @MAX_EVENTS
	.comm	_Events,8,3                     ; @Events
	.comm	_EVT_NEW,4,2                    ; @EVT_NEW
	.comm	_EVT_NOHUP,4,2                  ; @EVT_NOHUP
	.comm	_EVT_LEVEL,4,2                  ; @EVT_LEVEL
	.comm	_EVT_RWX,4,2                    ; @EVT_RWX
	.comm	_EVT_IN_EPOLL,4,2               ; @EVT_IN_EPOLL
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"epoll_ctl(%d,%d,%d,%d,%08x)\n"

	.comm	_epoll_fd,4,2                   ; @epoll_fd
	.comm	_EPOLL_CTL_MOD,4,2              ; @EPOLL_CTL_MOD
	.comm	_EPOLL_CTL_ADD,4,2              ; @EPOLL_CTL_ADD
l_.str.1:                               ; @.str.1
	.asciz	"epoll_ctl()"

.subsections_via_symbols
