	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_epoll_remove                   ## -- Begin function epoll_remove
	.p2align	4, 0x90
_epoll_remove:                          ## @epoll_remove
	.cfi_startproc
## %bb.0:
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset %rbp, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register %rbp
	pushq	%rbx
	pushq	%rax
	.cfi_offset %rbx, -24
	movl	%edi, %ebx
	testl	%edi, %edi
	setns	%al
	movq	_MAX_EVENTS@GOTPCREL(%rip), %rcx
	cmpl	%edi, (%rcx)
	setg	%cl
	andb	%al, %cl
	movzbl	%cl, %edi
	callq	_assert
	movq	_Events@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movslq	%ebx, %rdx
	movl	$-1, %ebx
	cmpl	%edx, (%rax,%rdx,8)
	jne	LBB0_5
## %bb.1:
	movl	4(%rax,%rdx,8), %ecx
	movq	_EVT_IN_EPOLL@GOTPCREL(%rip), %rsi
	movl	(%rsi), %esi
	testl	%ecx, %esi
	je	LBB0_2
## %bb.3:
	notl	%esi
	andl	%esi, %ecx
	movl	%ecx, 4(%rax,%rdx,8)
	movq	_epoll_fd@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movq	_EPOLL_CTL_DEL@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	xorl	%ebx, %ebx
                                        ## kill: def $edx killed $edx killed $rdx
	xorl	%ecx, %ecx
	callq	_epoll_ctl
	testq	%rax, %rax
	jns	LBB0_5
## %bb.4:
	leaq	L_.str(%rip), %rdi
	callq	_perror
	jmp	LBB0_5
LBB0_2:
	xorl	%ebx, %ebx
LBB0_5:
	movl	%ebx, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_MAX_EVENTS,4,2                 ## @MAX_EVENTS
	.comm	_Events,8,3                     ## @Events
	.comm	_EVT_IN_EPOLL,4,2               ## @EVT_IN_EPOLL
	.comm	_epoll_fd,4,2                   ## @epoll_fd
	.comm	_EPOLL_CTL_DEL,4,2              ## @EPOLL_CTL_DEL
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"epoll_ctl()"

.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_epoll_remove                   ; -- Begin function epoll_remove
	.p2align	2
_epoll_remove:                          ; @epoll_remove
	.cfi_startproc
; %bb.0:
	stp	x20, x19, [sp, #-32]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 32
	stp	x29, x30, [sp, #16]             ; 16-byte Folded Spill
	add	x29, sp, #16
	.cfi_def_cfa w29, 16
	.cfi_offset w30, -8
	.cfi_offset w29, -16
	.cfi_offset w19, -24
	.cfi_offset w20, -32
	mov	x19, x0
	cmp	w0, #0
Lloh0:
	adrp	x8, _MAX_EVENTS@GOTPAGE
Lloh1:
	ldr	x8, [x8, _MAX_EVENTS@GOTPAGEOFF]
Lloh2:
	ldr	w8, [x8]
	ccmp	w8, w0, #4, ge
	cset	w0, gt
	bl	_assert
Lloh3:
	adrp	x8, _Events@GOTPAGE
Lloh4:
	ldr	x8, [x8, _Events@GOTPAGEOFF]
Lloh5:
	ldr	x8, [x8]
	sbfiz	x9, x19, #3, #32
	ldr	w9, [x8, x9]
	cmp	w9, w19
	b.ne	LBB0_5
; %bb.1:
	sxtw	x9, w19
	add	x8, x8, x9, lsl #3
	ldr	w9, [x8, #4]!
Lloh6:
	adrp	x10, _EVT_IN_EPOLL@GOTPAGE
Lloh7:
	ldr	x10, [x10, _EVT_IN_EPOLL@GOTPAGEOFF]
Lloh8:
	ldr	w10, [x10]
	tst	w10, w9
	b.eq	LBB0_4
; %bb.2:
	bic	w9, w9, w10
	str	w9, [x8]
Lloh9:
	adrp	x8, _epoll_fd@GOTPAGE
Lloh10:
	ldr	x8, [x8, _epoll_fd@GOTPAGEOFF]
Lloh11:
	ldr	w0, [x8]
Lloh12:
	adrp	x8, _EPOLL_CTL_DEL@GOTPAGE
Lloh13:
	ldr	x8, [x8, _EPOLL_CTL_DEL@GOTPAGEOFF]
Lloh14:
	ldr	w1, [x8]
	mov	x2, x19
	mov	w3, #0
	bl	_epoll_ctl
	mov	x8, x0
	mov	w0, #0
	tbz	x8, #63, LBB0_6
; %bb.3:
Lloh15:
	adrp	x0, l_.str@PAGE
Lloh16:
	add	x0, x0, l_.str@PAGEOFF
	bl	_perror
LBB0_4:
	mov	w0, #0
	b	LBB0_6
LBB0_5:
	mov	w0, #-1
LBB0_6:
	ldp	x29, x30, [sp, #16]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp], #32             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpAdd	Lloh15, Lloh16
	.cfi_endproc
                                        ; -- End function
	.comm	_MAX_EVENTS,4,2                 ; @MAX_EVENTS
	.comm	_Events,8,3                     ; @Events
	.comm	_EVT_IN_EPOLL,4,2               ; @EVT_IN_EPOLL
	.comm	_epoll_fd,4,2                   ; @epoll_fd
	.comm	_EPOLL_CTL_DEL,4,2              ; @EPOLL_CTL_DEL
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"epoll_ctl()"

.subsections_via_symbols
