	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.section	__TEXT,__literal8,8byte_literals
	.p2align	3                               ## -- Begin function waitForEvent
LCPI0_0:
	.quad	0x412e848000000000              ## double 1.0E+6
LCPI0_1:
	.quad	0x0000000000000000              ## double 0
	.section	__TEXT,__text,regular,pure_instructions
	.p2align	4, 0x90
_waitForEvent:                          ## @waitForEvent
	.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
	movq	%rdi, %rbx
	movq	__glfw@GOTPCREL(%rip), %rax
	movl	4(%rax), %edi
	callq	_ConnectionNumber
	movl	%eax, %r15d
	movl	%eax, -52(%rbp)                 ## 4-byte Spill
	incl	%r15d
	leaq	-56(%rbp), %r12
	.p2align	4, 0x90
LBB0_1:                                 ## =>This Inner Loop Header: Depth=1
	movq	%r12, %rdi
	callq	_FD_ZERO
	movl	-52(%rbp), %edi                 ## 4-byte Reload
	movq	%r12, %rsi
	callq	_FD_SET
	testq	%rbx, %rbx
	je	LBB0_6
## %bb.2:                               ##   in Loop: Header=BB0_1 Depth=1
	movsd	(%rbx), %xmm0                   ## xmm0 = mem[0],zero
	cvttsd2si	%xmm0, %rax
	xorps	%xmm1, %xmm1
	cvtsi2sd	%rax, %xmm1
	subsd	%xmm1, %xmm0
	mulsd	LCPI0_0(%rip), %xmm0
	cvttsd2si	%xmm0, %rcx
	movq	%rax, -72(%rbp)
	movq	%rcx, -64(%rbp)
	xorl	%eax, %eax
	callq	__glfwPlatformGetTimerValue
	movsd	%xmm0, -48(%rbp)                ## 8-byte Spill
	movl	%r15d, %edi
	movq	%r12, %rsi
	xorl	%edx, %edx
	xorl	%ecx, %ecx
	leaq	-72(%rbp), %r8
	callq	_select
	movl	%eax, %r13d
	movq	_errno@GOTPCREL(%rip), %rax
	movl	(%rax), %r14d
	xorl	%eax, %eax
	callq	__glfwPlatformGetTimerValue
	subsd	-48(%rbp), %xmm0                ## 8-byte Folded Reload
	movsd	%xmm0, -48(%rbp)                ## 8-byte Spill
	xorl	%eax, %eax
	callq	__glfwPlatformGetTimerFrequency
	xorps	%xmm0, %xmm0
	cvtsi2sd	%rax, %xmm0
	movsd	-48(%rbp), %xmm1                ## 8-byte Reload
                                        ## xmm1 = mem[0],zero
	divsd	%xmm0, %xmm1
	movsd	(%rbx), %xmm0                   ## xmm0 = mem[0],zero
	subsd	%xmm1, %xmm0
	movsd	%xmm0, (%rbx)
	testl	%r13d, %r13d
	jg	LBB0_8
## %bb.3:                               ##   in Loop: Header=BB0_1 Depth=1
	notl	%r13d
	movq	_EINTR@GOTPCREL(%rip), %rax
	xorl	(%rax), %r14d
	orl	%r13d, %r14d
	je	LBB0_5
## %bb.4:                               ##   in Loop: Header=BB0_1 Depth=1
	xorpd	%xmm1, %xmm1
	ucomisd	%xmm0, %xmm1
	jb	LBB0_1
	jmp	LBB0_5
	.p2align	4, 0x90
LBB0_6:                                 ##   in Loop: Header=BB0_1 Depth=1
	movl	%r15d, %edi
	movq	%r12, %rsi
	xorl	%edx, %edx
	xorl	%ecx, %ecx
	xorl	%r8d, %r8d
	callq	_select
	cmpl	$-1, %eax
	jne	LBB0_8
## %bb.7:                               ##   in Loop: Header=BB0_1 Depth=1
	movq	_errno@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movq	_EINTR@GOTPCREL(%rip), %rcx
	cmpl	(%rcx), %eax
	je	LBB0_1
LBB0_8:
	movq	_GLFW_TRUE@GOTPCREL(%rip), %rax
	jmp	LBB0_9
LBB0_5:
	movq	_GLFW_FALSE@GOTPCREL(%rip), %rax
LBB0_9:
	movl	(%rax), %eax
	addq	$40, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	__glfw,8,2                      ## @_glfw
	.comm	_errno,4,2                      ## @errno
	.comm	_GLFW_TRUE,4,2                  ## @GLFW_TRUE
	.comm	_EINTR,4,2                      ## @EINTR
	.comm	_GLFW_FALSE,4,2                 ## @GLFW_FALSE
	.no_dead_strip	_waitForEvent
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function waitForEvent
_waitForEvent:                          ; @waitForEvent
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #144
	.cfi_def_cfa_offset 144
	stp	d9, d8, [sp, #32]               ; 16-byte Folded Spill
	stp	x28, x27, [sp, #48]             ; 16-byte Folded Spill
	stp	x26, x25, [sp, #64]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #80]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #96]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #112]            ; 16-byte Folded Spill
	stp	x29, x30, [sp, #128]            ; 16-byte Folded Spill
	add	x29, sp, #128
	.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
	.cfi_offset b8, -104
	.cfi_offset b9, -112
	mov	x19, x0
Lloh0:
	adrp	x8, __glfw@GOTPAGE
Lloh1:
	ldr	x8, [x8, __glfw@GOTPAGEOFF]
Lloh2:
	ldr	w0, [x8, #4]
	bl	_ConnectionNumber
	mov	x20, x0
	add	w21, w0, #1
Lloh3:
	adrp	x24, _errno@GOTPAGE
Lloh4:
	ldr	x24, [x24, _errno@GOTPAGEOFF]
Lloh5:
	adrp	x26, _EINTR@GOTPAGE
Lloh6:
	ldr	x26, [x26, _EINTR@GOTPAGEOFF]
	mov	x27, #145685290680320
	movk	x27, #16686, lsl #48
	mov	w28, #-1
Lloh7:
	adrp	x23, _GLFW_FALSE@GOTPAGE
Lloh8:
	ldr	x23, [x23, _GLFW_FALSE@GOTPAGEOFF]
LBB0_1:                                 ; =>This Inner Loop Header: Depth=1
	add	x0, sp, #28
	bl	_FD_ZERO
	add	x1, sp, #28
	mov	x0, x20
	bl	_FD_SET
	cbz	x19, LBB0_5
; %bb.2:                                ;   in Loop: Header=BB0_1 Depth=1
	ldr	d0, [x19]
	fcvtzs	x8, d0
	fcvtzs	d1, d0
	scvtf	d1, d1
	fsub	d0, d0, d1
	fmov	d1, x27
	fmul	d0, d0, d1
	fcvtzs	x9, d0
	stp	x8, x9, [sp, #8]
	bl	__glfwPlatformGetTimerValue
	fmov	d8, d0
	add	x1, sp, #28
	add	x4, sp, #8
	mov	x0, x21
	mov	x2, #0
	mov	x3, #0
	bl	_select
	mov	x22, x0
	ldr	w25, [x24]
	bl	__glfwPlatformGetTimerValue
	fsub	d8, d0, d8
	bl	__glfwPlatformGetTimerFrequency
	scvtf	d0, x0
	fdiv	d0, d8, d0
	ldr	d1, [x19]
	fsub	d0, d1, d0
	str	d0, [x19]
	cmp	w22, #0
	b.gt	LBB0_8
; %bb.3:                                ;   in Loop: Header=BB0_1 Depth=1
	ldr	w8, [x26]
	cmp	w25, w8
	ccmp	w22, w28, #0, eq
	b.eq	LBB0_9
; %bb.4:                                ;   in Loop: Header=BB0_1 Depth=1
	fcmp	d0, #0.0
	b.hi	LBB0_1
	b	LBB0_9
LBB0_5:                                 ;   in Loop: Header=BB0_1 Depth=1
	add	x1, sp, #28
	mov	x0, x21
	mov	x2, #0
	mov	x3, #0
	mov	x4, #0
	bl	_select
	cmn	w0, #1
	b.ne	LBB0_7
; %bb.6:                                ;   in Loop: Header=BB0_1 Depth=1
	ldr	w8, [x24]
	ldr	w9, [x26]
	cmp	w8, w9
	b.eq	LBB0_1
LBB0_7:
Lloh9:
	adrp	x8, _GLFW_TRUE@GOTPAGE
Lloh10:
	ldr	x8, [x8, _GLFW_TRUE@GOTPAGEOFF]
Lloh11:
	ldr	w0, [x8]
	b	LBB0_10
LBB0_8:
Lloh12:
	adrp	x23, _GLFW_TRUE@GOTPAGE
Lloh13:
	ldr	x23, [x23, _GLFW_TRUE@GOTPAGEOFF]
LBB0_9:
	ldr	w0, [x23]
LBB0_10:
	ldp	x29, x30, [sp, #128]            ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #112]            ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #96]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #80]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #64]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp, #48]             ; 16-byte Folded Reload
	ldp	d9, d8, [sp, #32]               ; 16-byte Folded Reload
	add	sp, sp, #144
	ret
	.loh AdrpLdrGot	Lloh7, Lloh8
	.loh AdrpLdrGot	Lloh5, Lloh6
	.loh AdrpLdrGot	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGot	Lloh12, Lloh13
	.cfi_endproc
                                        ; -- End function
	.comm	__glfw,8,2                      ; @_glfw
	.comm	_errno,4,2                      ; @errno
	.comm	_GLFW_TRUE,4,2                  ; @GLFW_TRUE
	.comm	_EINTR,4,2                      ; @EINTR
	.comm	_GLFW_FALSE,4,2                 ; @GLFW_FALSE
	.no_dead_strip	_waitForEvent
.subsections_via_symbols
