	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_eloop_register_read_sock       ## -- Begin function eloop_register_read_sock
	.p2align	4, 0x90
_eloop_register_read_sock:              ## @eloop_register_read_sock
	.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
	pushq	%rax
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rcx, %r15
	movq	%rdx, %r12
	movl	%esi, %ebx
	movl	%edi, %r14d
	xorl	%eax, %eax
	callq	_eloop_prepare_handles
	movl	$-1, %r13d
	testq	%rax, %rax
	jne	LBB0_11
## %bb.1:
	movl	%ebx, -44(%rbp)                 ## 4-byte Spill
	movq	%r15, %rbx
	xorl	%eax, %eax
	callq	_WSACreateEvent
	movq	%rax, %r15
	movq	_WSA_INVALID_EVENT@GOTPCREL(%rip), %rax
	cmpq	(%rax), %r15
	jne	LBB0_3
## %bb.2:
	xorl	%eax, %eax
	callq	_WSAGetLastError
	leaq	L_.str(%rip), %rdi
	movl	%eax, %esi
	callq	_printf
	jmp	LBB0_11
LBB0_3:
	movq	_FD_READ@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movl	%r14d, %edi
	movq	%r15, %rsi
	callq	_WSAEventSelect
	testq	%rax, %rax
	je	LBB0_5
## %bb.4:
	xorl	%eax, %eax
	callq	_WSAGetLastError
	leaq	L_.str.1(%rip), %rdi
	movl	%eax, %esi
	callq	_printf
LBB0_7:
	movq	%r15, %rdi
	callq	_WSACloseEvent
	jmp	LBB0_11
LBB0_5:
	movq	_eloop@GOTPCREL(%rip), %rax
	movq	16(%rax), %rdi
	movl	(%rax), %esi
	incl	%esi
	movl	$40, %edx
	callq	_os_realloc_array
	testq	%rax, %rax
	je	LBB0_6
## %bb.8:
	movq	_eloop@GOTPCREL(%rip), %rdi
	movslq	(%rdi), %rcx
	leaq	(%rcx,%rcx,4), %rdx
	movl	%r14d, (%rax,%rdx,8)
	movq	%r12, 32(%rax,%rdx,8)
	movq	%rbx, 24(%rax,%rdx,8)
	movl	-44(%rbp), %esi                 ## 4-byte Reload
	movl	%esi, 16(%rax,%rdx,8)
	movq	%r15, 8(%rax,%rdx,8)
	incl	%ecx
	movl	%ecx, (%rdi)
	movq	%rax, 16(%rdi)
	cmpl	%r14d, 4(%rdi)
	jge	LBB0_10
## %bb.9:
	movl	%r14d, 4(%rdi)
LBB0_10:
	movl	$1, 8(%rdi)
	xorl	%r13d, %r13d
LBB0_11:
	movl	%r13d, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_6:
	movl	%r14d, %edi
	movq	%r15, %rsi
	xorl	%edx, %edx
	callq	_WSAEventSelect
	jmp	LBB0_7
	.cfi_endproc
                                        ## -- End function
	.comm	_WSA_INVALID_EVENT,8,3          ## @WSA_INVALID_EVENT
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"WSACreateEvent() failed: %d\n"

	.comm	_FD_READ,4,2                    ## @FD_READ
L_.str.1:                               ## @.str.1
	.asciz	"WSAEventSelect() failed: %d\n"

	.comm	_eloop,24,3                     ## @eloop
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_eloop_register_read_sock       ; -- Begin function eloop_register_read_sock
	.p2align	2
_eloop_register_read_sock:              ; @eloop_register_read_sock
	.cfi_startproc
; %bb.0:
	stp	x24, x23, [sp, #-64]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 64
	stp	x22, x21, [sp, #16]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #32]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #48]             ; 16-byte Folded Spill
	add	x29, sp, #48
	.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
	mov	x21, x3
	mov	x23, x2
	mov	x22, x1
	mov	x20, x0
	bl	_eloop_prepare_handles
	cbz	x0, LBB0_2
; %bb.1:
	mov	w0, #-1
	b	LBB0_11
LBB0_2:
	bl	_WSACreateEvent
Lloh0:
	adrp	x8, _WSA_INVALID_EVENT@GOTPAGE
Lloh1:
	ldr	x8, [x8, _WSA_INVALID_EVENT@GOTPAGEOFF]
Lloh2:
	ldr	x8, [x8]
	cmp	x0, x8
	b.ne	LBB0_4
; %bb.3:
	bl	_WSAGetLastError
	mov	x1, x0
Lloh3:
	adrp	x0, l_.str@PAGE
Lloh4:
	add	x0, x0, l_.str@PAGEOFF
	bl	_printf
	mov	w0, #-1
	b	LBB0_11
LBB0_4:
	mov	x19, x0
Lloh5:
	adrp	x8, _FD_READ@GOTPAGE
Lloh6:
	ldr	x8, [x8, _FD_READ@GOTPAGEOFF]
Lloh7:
	ldr	w2, [x8]
	mov	x0, x20
	mov	x1, x19
	bl	_WSAEventSelect
	cbz	x0, LBB0_7
; %bb.5:
	bl	_WSAGetLastError
	mov	x1, x0
Lloh8:
	adrp	x0, l_.str.1@PAGE
Lloh9:
	add	x0, x0, l_.str.1@PAGEOFF
	bl	_printf
LBB0_6:
	mov	x0, x19
	bl	_WSACloseEvent
	mov	w0, #-1
	b	LBB0_11
LBB0_7:
Lloh10:
	adrp	x24, _eloop@GOTPAGE
Lloh11:
	ldr	x24, [x24, _eloop@GOTPAGEOFF]
	ldr	x0, [x24, #16]
	ldr	w8, [x24]
	add	w1, w8, #1
	mov	w2, #40
	bl	_os_realloc_array
	cbz	x0, LBB0_12
; %bb.8:
	mov	w8, #40
	ldp	w9, w10, [x24]
                                        ; kill: def $w9 killed $w9 def $x9
	sxtw	x9, w9
	madd	x8, x9, x8, x0
	str	w20, [x8]
	stp	x21, x23, [x8, #24]
	str	w22, [x8, #16]
	str	x19, [x8, #8]
	add	w8, w9, #1
	str	w8, [x24]
	str	x0, [x24, #16]
	cmp	w10, w20
	b.ge	LBB0_10
; %bb.9:
	str	w20, [x24, #4]
LBB0_10:
	mov	w0, #0
	mov	w8, #1
	str	w8, [x24, #8]
LBB0_11:
	ldp	x29, x30, [sp, #48]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #32]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #16]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp], #64             ; 16-byte Folded Reload
	ret
LBB0_12:
	mov	x0, x20
	mov	x1, x19
	mov	w2, #0
	bl	_WSAEventSelect
	b	LBB0_6
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpAdd	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpAdd	Lloh8, Lloh9
	.loh AdrpLdrGot	Lloh10, Lloh11
	.cfi_endproc
                                        ; -- End function
	.comm	_WSA_INVALID_EVENT,8,3          ; @WSA_INVALID_EVENT
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"WSACreateEvent() failed: %d\n"

	.comm	_FD_READ,4,2                    ; @FD_READ
l_.str.1:                               ; @.str.1
	.asciz	"WSAEventSelect() failed: %d\n"

	.comm	_eloop,24,3                     ; @eloop
.subsections_via_symbols
