	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.section	__TEXT,__literal8,8byte_literals
	.p2align	3                               ## -- Begin function refresh_loop_wait_event
LCPI0_0:
	.quad	0x412e848000000000              ## double 1.0E+6
LCPI0_1:
	.quad	0x0000000000000000              ## double 0
	.section	__TEXT,__text,regular,pure_instructions
	.p2align	4, 0x90
_refresh_loop_wait_event:               ## @refresh_loop_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
	pushq	%rax
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rsi, %r14
	movq	%rdi, %rbx
	movq	$0, -48(%rbp)
	xorl	%eax, %eax
	callq	_SDL_PumpEvents
	movq	_SDL_GETEVENT@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	_SDL_FIRSTEVENT@GOTPCREL(%rip), %rax
	movl	(%rax), %ecx
	movq	_SDL_LASTEVENT@GOTPCREL(%rip), %rax
	movl	(%rax), %r8d
	movq	%r14, %rdi
	movl	$1, %esi
	callq	_SDL_PeepEvents
	testl	%eax, %eax
	je	LBB0_1
LBB0_12:
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_1:
	movq	_cursor_hidden@GOTPCREL(%rip), %r12
	movq	_REFRESH_RATE@GOTPCREL(%rip), %r13
	movq	_SHOW_MODE_NONE@GOTPCREL(%rip), %r15
	jmp	LBB0_2
	.p2align	4, 0x90
LBB0_10:                                ##   in Loop: Header=BB0_2 Depth=1
	movq	%rbx, %rdi
	leaq	-48(%rbp), %rsi
	callq	_video_refresh
LBB0_11:                                ##   in Loop: Header=BB0_2 Depth=1
	xorl	%eax, %eax
	callq	_SDL_PumpEvents
	movq	_SDL_GETEVENT@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	_SDL_FIRSTEVENT@GOTPCREL(%rip), %rax
	movl	(%rax), %ecx
	movq	_SDL_LASTEVENT@GOTPCREL(%rip), %rax
	movl	(%rax), %r8d
	movq	%r14, %rdi
	movl	$1, %esi
	callq	_SDL_PeepEvents
	testl	%eax, %eax
	jne	LBB0_12
LBB0_2:                                 ## =>This Inner Loop Header: Depth=1
	cmpl	$0, (%r12)
	jne	LBB0_5
## %bb.3:                               ##   in Loop: Header=BB0_2 Depth=1
	xorl	%eax, %eax
	callq	_av_gettime_relative
	movq	_cursor_last_shown@GOTPCREL(%rip), %rcx
	subq	(%rcx), %rax
	movq	_CURSOR_HIDE_DELAY@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jle	LBB0_5
## %bb.4:                               ##   in Loop: Header=BB0_2 Depth=1
	xorl	%edi, %edi
	callq	_SDL_ShowCursor
	movl	$1, (%r12)
	.p2align	4, 0x90
LBB0_5:                                 ##   in Loop: Header=BB0_2 Depth=1
	movsd	-48(%rbp), %xmm0                ## xmm0 = mem[0],zero
	ucomisd	LCPI0_1(%rip), %xmm0
	jbe	LBB0_7
## %bb.6:                               ##   in Loop: Header=BB0_2 Depth=1
	mulsd	LCPI0_0(%rip), %xmm0
	cvttsd2si	%xmm0, %edi
	callq	_av_usleep
LBB0_7:                                 ##   in Loop: Header=BB0_2 Depth=1
	movsd	(%r13), %xmm0                   ## xmm0 = mem[0],zero
	movsd	%xmm0, -48(%rbp)
	movq	(%rbx), %rax
	cmpq	(%r15), %rax
	je	LBB0_11
## %bb.8:                               ##   in Loop: Header=BB0_2 Depth=1
	cmpl	$0, 16(%rbx)
	je	LBB0_10
## %bb.9:                               ##   in Loop: Header=BB0_2 Depth=1
	cmpq	$0, 8(%rbx)
	jne	LBB0_10
	jmp	LBB0_11
	.cfi_endproc
                                        ## -- End function
	.comm	_SDL_GETEVENT,4,2               ## @SDL_GETEVENT
	.comm	_SDL_FIRSTEVENT,4,2             ## @SDL_FIRSTEVENT
	.comm	_SDL_LASTEVENT,4,2              ## @SDL_LASTEVENT
	.comm	_cursor_hidden,4,2              ## @cursor_hidden
	.comm	_cursor_last_shown,8,3          ## @cursor_last_shown
	.comm	_CURSOR_HIDE_DELAY,8,3          ## @CURSOR_HIDE_DELAY
	.comm	_REFRESH_RATE,8,3               ## @REFRESH_RATE
	.comm	_SHOW_MODE_NONE,8,3             ## @SHOW_MODE_NONE
	.no_dead_strip	_refresh_loop_wait_event
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function refresh_loop_wait_event
_refresh_loop_wait_event:               ; @refresh_loop_wait_event
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #112
	.cfi_def_cfa_offset 112
	stp	x28, x27, [sp, #16]             ; 16-byte Folded Spill
	stp	x26, x25, [sp, #32]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #48]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #64]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #80]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #96]             ; 16-byte Folded Spill
	add	x29, sp, #96
	.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	x19, x1
	mov	x20, x0
	str	xzr, [sp, #8]
	bl	_SDL_PumpEvents
Lloh0:
	adrp	x21, _SDL_GETEVENT@GOTPAGE
Lloh1:
	ldr	x21, [x21, _SDL_GETEVENT@GOTPAGEOFF]
	ldr	w2, [x21]
Lloh2:
	adrp	x22, _SDL_FIRSTEVENT@GOTPAGE
Lloh3:
	ldr	x22, [x22, _SDL_FIRSTEVENT@GOTPAGEOFF]
	ldr	w3, [x22]
Lloh4:
	adrp	x23, _SDL_LASTEVENT@GOTPAGE
Lloh5:
	ldr	x23, [x23, _SDL_LASTEVENT@GOTPAGEOFF]
	ldr	w4, [x23]
	mov	x0, x19
	mov	w1, #1
	bl	_SDL_PeepEvents
	cbz	w0, LBB0_2
LBB0_1:
	ldp	x29, x30, [sp, #96]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #80]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #64]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #48]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #32]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #112
	ret
LBB0_2:
Lloh6:
	adrp	x25, _cursor_hidden@GOTPAGE
Lloh7:
	ldr	x25, [x25, _cursor_hidden@GOTPAGEOFF]
Lloh8:
	adrp	x27, _CURSOR_HIDE_DELAY@GOTPAGE
Lloh9:
	ldr	x27, [x27, _CURSOR_HIDE_DELAY@GOTPAGEOFF]
	mov	x28, #145685290680320
	movk	x28, #16686, lsl #48
Lloh10:
	adrp	x24, _REFRESH_RATE@GOTPAGE
Lloh11:
	ldr	x24, [x24, _REFRESH_RATE@GOTPAGEOFF]
Lloh12:
	adrp	x26, _SHOW_MODE_NONE@GOTPAGE
Lloh13:
	ldr	x26, [x26, _SHOW_MODE_NONE@GOTPAGEOFF]
	b	LBB0_5
LBB0_3:                                 ;   in Loop: Header=BB0_5 Depth=1
	add	x1, sp, #8
	mov	x0, x20
	bl	_video_refresh
LBB0_4:                                 ;   in Loop: Header=BB0_5 Depth=1
	bl	_SDL_PumpEvents
	ldr	w2, [x21]
	ldr	w3, [x22]
	ldr	w4, [x23]
	mov	x0, x19
	mov	w1, #1
	bl	_SDL_PeepEvents
	cbnz	w0, LBB0_1
LBB0_5:                                 ; =>This Inner Loop Header: Depth=1
	ldr	w8, [x25]
	cbnz	w8, LBB0_8
; %bb.6:                                ;   in Loop: Header=BB0_5 Depth=1
	bl	_av_gettime_relative
Lloh14:
	adrp	x8, _cursor_last_shown@GOTPAGE
Lloh15:
	ldr	x8, [x8, _cursor_last_shown@GOTPAGEOFF]
Lloh16:
	ldr	x8, [x8]
	ldr	x9, [x27]
	sub	x8, x0, x8
	cmp	x8, x9
	b.le	LBB0_8
; %bb.7:                                ;   in Loop: Header=BB0_5 Depth=1
	mov	w0, #0
	bl	_SDL_ShowCursor
	mov	w8, #1
	str	w8, [x25]
LBB0_8:                                 ;   in Loop: Header=BB0_5 Depth=1
	ldr	d0, [sp, #8]
	fcmp	d0, #0.0
	b.le	LBB0_10
; %bb.9:                                ;   in Loop: Header=BB0_5 Depth=1
	fmov	d1, x28
	fmul	d0, d0, d1
	fcvtzs	w0, d0
	bl	_av_usleep
LBB0_10:                                ;   in Loop: Header=BB0_5 Depth=1
	ldr	d0, [x24]
	str	d0, [sp, #8]
	ldr	x8, [x20]
	ldr	x9, [x26]
	cmp	x8, x9
	b.eq	LBB0_4
; %bb.11:                               ;   in Loop: Header=BB0_5 Depth=1
	ldr	w8, [x20, #16]
	cbz	w8, LBB0_3
; %bb.12:                               ;   in Loop: Header=BB0_5 Depth=1
	ldr	x8, [x20, #8]
	cbnz	x8, LBB0_3
	b	LBB0_4
	.loh AdrpLdrGot	Lloh4, Lloh5
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGot	Lloh12, Lloh13
	.loh AdrpLdrGot	Lloh10, Lloh11
	.loh AdrpLdrGot	Lloh8, Lloh9
	.loh AdrpLdrGot	Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh14, Lloh15, Lloh16
	.cfi_endproc
                                        ; -- End function
	.comm	_SDL_GETEVENT,4,2               ; @SDL_GETEVENT
	.comm	_SDL_FIRSTEVENT,4,2             ; @SDL_FIRSTEVENT
	.comm	_SDL_LASTEVENT,4,2              ; @SDL_LASTEVENT
	.comm	_cursor_hidden,4,2              ; @cursor_hidden
	.comm	_cursor_last_shown,8,3          ; @cursor_last_shown
	.comm	_CURSOR_HIDE_DELAY,8,3          ; @CURSOR_HIDE_DELAY
	.comm	_REFRESH_RATE,8,3               ; @REFRESH_RATE
	.comm	_SHOW_MODE_NONE,8,3             ; @SHOW_MODE_NONE
	.no_dead_strip	_refresh_loop_wait_event
.subsections_via_symbols
