	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_emul_poll                      ## -- Begin function emul_poll
	.p2align	4, 0x90
_emul_poll:                             ## @emul_poll
	.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	$40, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movl	%edx, %r15d
	movl	%esi, %r14d
	movq	%rdi, %rbx
	leaq	-48(%rbp), %rdi
	callq	_FD_ZERO
	leaq	-44(%rbp), %rdi
	callq	_FD_ZERO
	movl	%r14d, %r13d
	testl	%r14d, %r14d
	movl	%r14d, -52(%rbp)                ## 4-byte Spill
	movl	%r15d, -56(%rbp)                ## 4-byte Spill
	jle	LBB0_1
## %bb.2:
	leaq	(,%r13,4), %rax
	leaq	(%rax,%rax,2), %r12
	movl	$-1, %r15d
	xorl	%r14d, %r14d
	jmp	LBB0_3
	.p2align	4, 0x90
LBB0_7:                                 ##   in Loop: Header=BB0_3 Depth=1
	movl	8(%rbx,%r14), %eax
	cmpl	%r15d, %eax
	cmovgl	%eax, %r15d
	addq	$12, %r14
	cmpq	%r14, %r12
	je	LBB0_8
LBB0_3:                                 ## =>This Inner Loop Header: Depth=1
	movl	$0, (%rbx,%r14)
	movl	4(%rbx,%r14), %eax
	movq	_POLLIN@GOTPCREL(%rip), %rcx
	testl	%eax, (%rcx)
	je	LBB0_5
## %bb.4:                               ##   in Loop: Header=BB0_3 Depth=1
	movl	8(%rbx,%r14), %edi
	leaq	-48(%rbp), %rsi
	callq	_FD_SET
	movl	4(%rbx,%r14), %eax
LBB0_5:                                 ##   in Loop: Header=BB0_3 Depth=1
	movq	_POLLOUT@GOTPCREL(%rip), %rcx
	testl	%eax, (%rcx)
	je	LBB0_7
## %bb.6:                               ##   in Loop: Header=BB0_3 Depth=1
	movl	8(%rbx,%r14), %edi
	leaq	-44(%rbp), %rsi
	callq	_FD_SET
	jmp	LBB0_7
LBB0_1:
	movl	$-1, %r15d
LBB0_8:
	movq	_FD_SETSIZE@GOTPCREL(%rip), %rax
	cmpl	(%rax), %r15d
	jl	LBB0_10
## %bb.9:
	leaq	L_.str(%rip), %rdi
	callq	_Punt
LBB0_10:
	movl	-56(%rbp), %ecx                 ## 4-byte Reload
	testl	%ecx, %ecx
	js	LBB0_11
## %bb.12:
	imull	$1000, %ecx, %eax               ## imm = 0x3E8
	movl	%ecx, %ecx
	imulq	$274877907, %rcx, %rcx          ## imm = 0x10624DD3
	shrq	$38, %rcx
	movq	%rcx, -72(%rbp)
	cltq
	imulq	$1125899907, %rax, %rcx         ## imm = 0x431BDE83
	movq	%rcx, %rdx
	shrq	$63, %rdx
	sarq	$50, %rcx
	addl	%edx, %ecx
	imull	$1000000, %ecx, %ecx            ## imm = 0xF4240
	subl	%ecx, %eax
	cltq
	movq	%rax, -64(%rbp)
	leaq	-72(%rbp), %r8
	jmp	LBB0_13
LBB0_11:
	xorl	%r8d, %r8d
LBB0_13:
	incl	%r15d
	leaq	-48(%rbp), %rsi
	leaq	-44(%rbp), %rdx
	movl	%r15d, %edi
	xorl	%ecx, %ecx
	callq	_select
	movl	%eax, %r15d
	sarl	$31, %r15d
	andl	%eax, %r15d
	testl	%eax, %eax
	jle	LBB0_22
## %bb.14:
	cmpl	$0, -52(%rbp)                   ## 4-byte Folded Reload
	jle	LBB0_22
## %bb.15:
	xorl	%r15d, %r15d
	leaq	-48(%rbp), %r14
	leaq	-44(%rbp), %r12
	jmp	LBB0_16
	.p2align	4, 0x90
LBB0_20:                                ##   in Loop: Header=BB0_16 Depth=1
	movl	(%rbx), %eax
	movq	_POLLOUT@GOTPCREL(%rip), %rcx
	orl	(%rcx), %eax
	movl	%eax, (%rbx)
LBB0_21:                                ##   in Loop: Header=BB0_16 Depth=1
	cmpl	$1, %eax
	sbbl	$-1, %r15d
	addq	$12, %rbx
	decq	%r13
	je	LBB0_22
LBB0_16:                                ## =>This Inner Loop Header: Depth=1
	movl	8(%rbx), %edi
	movq	%r14, %rsi
	callq	_FD_ISSET
	testq	%rax, %rax
	je	LBB0_18
## %bb.17:                              ##   in Loop: Header=BB0_16 Depth=1
	movq	_POLLIN@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	orl	%eax, (%rbx)
LBB0_18:                                ##   in Loop: Header=BB0_16 Depth=1
	movl	8(%rbx), %edi
	movq	%r12, %rsi
	callq	_FD_ISSET
	testq	%rax, %rax
	jne	LBB0_20
## %bb.19:                              ##   in Loop: Header=BB0_16 Depth=1
	movl	(%rbx), %eax
	jmp	LBB0_21
LBB0_22:
	movl	%r15d, %eax
	addq	$40, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_POLLIN,4,2                     ## @POLLIN
	.comm	_POLLOUT,4,2                    ## @POLLOUT
	.comm	_FD_SETSIZE,4,2                 ## @FD_SETSIZE
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Ran out of fd_set slots; recompile with a larger FD_SETSIZE."

.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_emul_poll                      ; -- Begin function emul_poll
	.p2align	2
_emul_poll:                             ; @emul_poll
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #128
	.cfi_def_cfa_offset 128
	stp	x28, x27, [sp, #32]             ; 16-byte Folded Spill
	stp	x26, x25, [sp, #48]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #64]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #80]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #96]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #112]            ; 16-byte Folded Spill
	add	x29, sp, #112
	.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
	.cfi_offset w27, -88
	.cfi_offset w28, -96
	mov	x21, x2
	mov	x20, x1
	mov	x19, x0
	add	x0, sp, #28
	bl	_FD_ZERO
	add	x0, sp, #24
	bl	_FD_ZERO
	mov	w22, w20
Lloh0:
	adrp	x23, _POLLIN@GOTPAGE
Lloh1:
	ldr	x23, [x23, _POLLIN@GOTPAGEOFF]
Lloh2:
	adrp	x24, _POLLOUT@GOTPAGE
Lloh3:
	ldr	x24, [x24, _POLLOUT@GOTPAGEOFF]
	cmp	w20, #1
	b.lt	LBB0_7
; %bb.1:
	add	x26, x19, #8
	mov	w25, #-1
	mov	x27, x22
	b	LBB0_3
LBB0_2:                                 ;   in Loop: Header=BB0_3 Depth=1
	ldr	w8, [x26], #12
	cmp	w8, w25
	csel	w25, w8, w25, gt
	subs	x27, x27, #1
	b.eq	LBB0_8
LBB0_3:                                 ; =>This Inner Loop Header: Depth=1
	stur	wzr, [x26, #-8]
	ldur	w8, [x26, #-4]
	ldr	w9, [x23]
	tst	w9, w8
	b.eq	LBB0_5
; %bb.4:                                ;   in Loop: Header=BB0_3 Depth=1
	ldr	w0, [x26]
	add	x1, sp, #28
	bl	_FD_SET
	ldur	w8, [x26, #-4]
LBB0_5:                                 ;   in Loop: Header=BB0_3 Depth=1
	ldr	w9, [x24]
	tst	w9, w8
	b.eq	LBB0_2
; %bb.6:                                ;   in Loop: Header=BB0_3 Depth=1
	ldr	w0, [x26]
	add	x1, sp, #24
	bl	_FD_SET
	b	LBB0_2
LBB0_7:
	mov	w25, #-1
LBB0_8:
Lloh4:
	adrp	x8, _FD_SETSIZE@GOTPAGE
Lloh5:
	ldr	x8, [x8, _FD_SETSIZE@GOTPAGEOFF]
Lloh6:
	ldr	w8, [x8]
	cmp	w25, w8
	b.lt	LBB0_10
; %bb.9:
Lloh7:
	adrp	x0, l_.str@PAGE
Lloh8:
	add	x0, x0, l_.str@PAGEOFF
	bl	_Punt
LBB0_10:
	tbnz	w21, #31, LBB0_12
; %bb.11:
	mov	w8, #1000
	mul	w8, w21, w8
	mov	w9, #56963
	movk	w9, #17179, lsl #16
	smull	x9, w8, w9
	lsr	x10, x9, #63
	asr	x9, x9, #50
	add	w9, w9, w10
	mov	w10, #16960
	movk	w10, #15, lsl #16
	msub	w8, w9, w10, w8
	mov	w9, #19923
	movk	w9, #4194, lsl #16
	umull	x9, w21, w9
	lsr	x9, x9, #38
	sxtw	x8, w8
	stp	x9, x8, [sp, #8]
	add	x4, sp, #8
	b	LBB0_13
LBB0_12:
	mov	x4, #0
LBB0_13:
	add	w0, w25, #1
	add	x1, sp, #28
	add	x2, sp, #24
	mov	w3, #0
	bl	_select
	and	w21, w0, w0, asr #31
	cmp	w0, #1
	b.lt	LBB0_22
; %bb.14:
	cmp	w20, #1
	b.lt	LBB0_22
; %bb.15:
	mov	w21, #0
	b	LBB0_18
LBB0_16:                                ;   in Loop: Header=BB0_18 Depth=1
	ldr	w8, [x24]
	ldr	w9, [x19]
	orr	w8, w9, w8
	str	w8, [x19]
LBB0_17:                                ;   in Loop: Header=BB0_18 Depth=1
	cmp	w8, #0
	cinc	w21, w21, ne
	add	x19, x19, #12
	subs	x22, x22, #1
	b.eq	LBB0_22
LBB0_18:                                ; =>This Inner Loop Header: Depth=1
	ldr	w0, [x19, #8]
	add	x1, sp, #28
	bl	_FD_ISSET
	cbz	x0, LBB0_20
; %bb.19:                               ;   in Loop: Header=BB0_18 Depth=1
	ldr	w8, [x23]
	ldr	w9, [x19]
	orr	w8, w9, w8
	str	w8, [x19]
LBB0_20:                                ;   in Loop: Header=BB0_18 Depth=1
	ldr	w0, [x19, #8]
	add	x1, sp, #24
	bl	_FD_ISSET
	cbnz	x0, LBB0_16
; %bb.21:                               ;   in Loop: Header=BB0_18 Depth=1
	ldr	w8, [x19]
	b	LBB0_17
LBB0_22:
	mov	x0, x21
	ldp	x29, x30, [sp, #112]            ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #96]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #80]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #64]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #48]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp, #32]             ; 16-byte Folded Reload
	add	sp, sp, #128
	ret
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh4, Lloh5, Lloh6
	.loh AdrpAdd	Lloh7, Lloh8
	.cfi_endproc
                                        ; -- End function
	.comm	_POLLIN,4,2                     ; @POLLIN
	.comm	_POLLOUT,4,2                    ; @POLLOUT
	.comm	_FD_SETSIZE,4,2                 ; @FD_SETSIZE
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Ran out of fd_set slots; recompile with a larger FD_SETSIZE."

.subsections_via_symbols
