	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_plat_wait_event                ## -- Begin function plat_wait_event
	.p2align	4, 0x90
_plat_wait_event:                       ## @plat_wait_event
	.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	%esi, %r14d
	movq	%rdi, %r15
	xorl	%ebx, %ebx
	testl	%edx, %edx
	js	LBB0_1
## %bb.2:
	movl	%edx, %eax
	imulq	$274877907, %rax, %rax          ## imm = 0x10624DD3
	shrq	$38, %rax
	movl	%eax, -56(%rbp)
	imull	$1000, %eax, %eax               ## imm = 0x3E8
	subl	%eax, %edx
	imull	$1000, %edx, %eax               ## imm = 0x3E8
	movl	%eax, -52(%rbp)
	leaq	-56(%rbp), %r12
	jmp	LBB0_3
LBB0_1:
	xorl	%r12d, %r12d
LBB0_3:
	leaq	-44(%rbp), %rdi
	callq	_FD_ZERO
	testl	%r14d, %r14d
	jle	LBB0_7
## %bb.4:
	movq	%r12, -64(%rbp)                 ## 8-byte Spill
	movl	%r14d, -48(%rbp)                ## 4-byte Spill
	movl	%r14d, %r12d
	movl	$-1, %ebx
	xorl	%r14d, %r14d
	leaq	-44(%rbp), %r13
	.p2align	4, 0x90
LBB0_5:                                 ## =>This Inner Loop Header: Depth=1
	movl	(%r15,%r14,4), %edi
	cmpl	%ebx, %edi
	cmovgl	%edi, %ebx
	movq	%r13, %rsi
	callq	_FD_SET
	incq	%r14
	cmpq	%r14, %r12
	jne	LBB0_5
## %bb.6:
	incl	%ebx
	movl	-48(%rbp), %r14d                ## 4-byte Reload
	movq	-64(%rbp), %r12                 ## 8-byte Reload
LBB0_7:
	leaq	-44(%rbp), %rsi
	movl	%ebx, %edi
	xorl	%edx, %edx
	xorl	%ecx, %ecx
	movq	%r12, %r8
	callq	_select
	movl	$-1, %r12d
	testl	%eax, %eax
	je	LBB0_14
## %bb.8:
	cmpl	$-1, %eax
	je	LBB0_15
## %bb.9:
	testl	%r14d, %r14d
	jle	LBB0_14
## %bb.10:
	movl	%r14d, %r13d
	movl	$-1, %r12d
	xorl	%ebx, %ebx
	leaq	-44(%rbp), %r14
	jmp	LBB0_11
	.p2align	4, 0x90
LBB0_13:                                ##   in Loop: Header=BB0_11 Depth=1
	incq	%rbx
	cmpq	%rbx, %r13
	je	LBB0_14
LBB0_11:                                ## =>This Inner Loop Header: Depth=1
	movl	(%r15,%rbx,4), %edi
	movq	%r14, %rsi
	callq	_FD_ISSET
	testq	%rax, %rax
	je	LBB0_13
## %bb.12:                              ##   in Loop: Header=BB0_11 Depth=1
	movl	(%r15,%rbx,4), %r12d
	jmp	LBB0_13
LBB0_15:
	callq	_plat_wait_event.cold.1
LBB0_14:
	movl	%r12d, %eax
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.p2align	4, 0x90                         ## -- Begin function plat_wait_event.cold.1
_plat_wait_event.cold.1:                ## @plat_wait_event.cold.1
	.cfi_startproc
## %bb.0:
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset %rbp, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register %rbp
	leaq	L_.str(%rip), %rdi
	callq	_perror
	pushq	$1
	popq	%rdi
	callq	_sleep
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"plat_wait_event: select failed"

.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_plat_wait_event                ; -- Begin function plat_wait_event
	.p2align	2
_plat_wait_event:                       ; @plat_wait_event
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #80
	.cfi_def_cfa_offset 80
	stp	x24, x23, [sp, #16]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #32]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #48]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #64]             ; 16-byte Folded Spill
	add	x29, sp, #64
	.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	x20, x1
	mov	x19, x0
	tbnz	w2, #31, LBB0_2
; %bb.1:
	mov	w8, #19923
	movk	w8, #4194, lsl #16
	umull	x8, w2, w8
	lsr	x8, x8, #38
	mov	w9, #1000
	msub	w10, w8, w9, w2
	mul	w9, w10, w9
	stp	w8, w9, [sp, #8]
	add	x21, sp, #8
	b	LBB0_3
LBB0_2:
	mov	x21, #0
LBB0_3:
	add	x0, sp, #4
	bl	_FD_ZERO
	cmp	w20, #1
	b.lt	LBB0_7
; %bb.4:
	mov	w22, w20
	mov	w23, #-1
	mov	x24, x19
LBB0_5:                                 ; =>This Inner Loop Header: Depth=1
	ldr	w0, [x24], #4
	cmp	w0, w23
	csel	w23, w0, w23, gt
	add	x1, sp, #4
	bl	_FD_SET
	subs	x22, x22, #1
	b.ne	LBB0_5
; %bb.6:
	add	w0, w23, #1
	b	LBB0_8
LBB0_7:
	mov	w0, #0
LBB0_8:
	add	x1, sp, #4
	mov	x2, #0
	mov	x3, #0
	mov	x4, x21
	bl	_select
	cbz	w0, LBB0_16
; %bb.9:
	cmn	w0, #1
	b.eq	LBB0_15
; %bb.10:
	cmp	w20, #1
	b.lt	LBB0_16
; %bb.11:
	mov	w21, w20
	mov	w20, #-1
	b	LBB0_13
LBB0_12:                                ;   in Loop: Header=BB0_13 Depth=1
	add	x19, x19, #4
	subs	x21, x21, #1
	b.eq	LBB0_17
LBB0_13:                                ; =>This Inner Loop Header: Depth=1
	ldr	w0, [x19]
	add	x1, sp, #4
	bl	_FD_ISSET
	cbz	x0, LBB0_12
; %bb.14:                               ;   in Loop: Header=BB0_13 Depth=1
	ldr	w20, [x19]
	b	LBB0_12
LBB0_15:
	bl	_plat_wait_event.cold.1
LBB0_16:
	mov	w20, #-1
LBB0_17:
	mov	x0, x20
	ldp	x29, x30, [sp, #64]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #48]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #32]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #80
	ret
	.cfi_endproc
                                        ; -- End function
	.p2align	2                               ; -- Begin function plat_wait_event.cold.1
_plat_wait_event.cold.1:                ; @plat_wait_event.cold.1
	.cfi_startproc
; %bb.0:
	stp	x29, x30, [sp, #-16]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 16
	mov	x29, sp
	.cfi_def_cfa w29, 16
	.cfi_offset w30, -8
	.cfi_offset w29, -16
Lloh0:
	adrp	x0, l_.str@PAGE
Lloh1:
	add	x0, x0, l_.str@PAGEOFF
	bl	_perror
	mov	w0, #1
	bl	_sleep
	ldp	x29, x30, [sp], #16             ; 16-byte Folded Reload
	ret
	.loh AdrpAdd	Lloh0, Lloh1
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"plat_wait_event: select failed"

.subsections_via_symbols
