	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_plat_video_loop_prepare        ## -- Begin function plat_video_loop_prepare
	.p2align	4, 0x90
_plat_video_loop_prepare:               ## @plat_video_loop_prepare
	.cfi_startproc
## %bb.0:
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset %rbp, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register %rbp
	pushq	%r14
	pushq	%rbx
	.cfi_offset %rbx, -32
	.cfi_offset %r14, -24
	movq	_g_screen_width@GOTPCREL(%rip), %r14
	movl	(%r14), %edi
	movq	_g_screen_height@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	xorl	%edx, %edx
	callq	_plat_sdl_change_video_mode
	movq	_plat_sdl_overlay@GOTPCREL(%rip), %rax
	cmpq	$0, (%rax)
	movq	_shadow_fb@GOTPCREL(%rip), %rax
	jne	LBB0_5
## %bb.1:
	movq	_plat_sdl_gl_active@GOTPCREL(%rip), %rcx
	cmpq	$0, (%rcx)
	jne	LBB0_5
## %bb.2:
	movq	_plat_sdl_screen@GOTPCREL(%rip), %rbx
	movq	(%rbx), %rdi
	callq	_SDL_MUSTLOCK
	testq	%rax, %rax
	je	LBB0_4
## %bb.3:
	movq	(%rbx), %rdi
	callq	_SDL_LockSurface
LBB0_4:
	movq	(%rbx), %rax
LBB0_5:
	movl	(%rax), %edi
	movq	_g_screen_ptr@GOTPCREL(%rip), %rax
	movl	%edi, (%rax)
	movl	(%r14), %esi
	addl	%esi, %esi
	popq	%rbx
	popq	%r14
	popq	%rbp
	jmp	_PicoDrawSetOutBuf              ## TAILCALL
	.cfi_endproc
                                        ## -- End function
	.comm	_g_screen_width,4,2             ## @g_screen_width
	.comm	_g_screen_height,4,2            ## @g_screen_height
	.comm	_plat_sdl_overlay,8,3           ## @plat_sdl_overlay
	.comm	_plat_sdl_gl_active,8,3         ## @plat_sdl_gl_active
	.comm	_shadow_fb,4,2                  ## @shadow_fb
	.comm	_g_screen_ptr,4,2               ## @g_screen_ptr
	.comm	_plat_sdl_screen,8,3            ## @plat_sdl_screen
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_plat_video_loop_prepare        ; -- Begin function plat_video_loop_prepare
	.p2align	2
_plat_video_loop_prepare:               ; @plat_video_loop_prepare
	.cfi_startproc
; %bb.0:
	stp	x20, x19, [sp, #-32]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 32
	stp	x29, x30, [sp, #16]             ; 16-byte Folded Spill
	add	x29, sp, #16
	.cfi_def_cfa w29, 16
	.cfi_offset w30, -8
	.cfi_offset w29, -16
	.cfi_offset w19, -24
	.cfi_offset w20, -32
Lloh0:
	adrp	x19, _g_screen_width@GOTPAGE
Lloh1:
	ldr	x19, [x19, _g_screen_width@GOTPAGEOFF]
	ldr	w0, [x19]
Lloh2:
	adrp	x8, _g_screen_height@GOTPAGE
Lloh3:
	ldr	x8, [x8, _g_screen_height@GOTPAGEOFF]
Lloh4:
	ldr	w1, [x8]
	mov	w2, #0
	bl	_plat_sdl_change_video_mode
Lloh5:
	adrp	x8, _plat_sdl_overlay@GOTPAGE
Lloh6:
	ldr	x8, [x8, _plat_sdl_overlay@GOTPAGEOFF]
Lloh7:
	ldr	x8, [x8]
Lloh8:
	adrp	x9, _plat_sdl_gl_active@GOTPAGE
Lloh9:
	ldr	x9, [x9, _plat_sdl_gl_active@GOTPAGEOFF]
Lloh10:
	ldr	x9, [x9]
	cmp	x8, #0
	ccmp	x9, #0, #0, eq
	b.eq	LBB0_2
; %bb.1:
Lloh11:
	adrp	x8, _shadow_fb@GOTPAGE
Lloh12:
	ldr	x8, [x8, _shadow_fb@GOTPAGEOFF]
	b	LBB0_5
LBB0_2:
Lloh13:
	adrp	x20, _plat_sdl_screen@GOTPAGE
Lloh14:
	ldr	x20, [x20, _plat_sdl_screen@GOTPAGEOFF]
	ldr	x0, [x20]
	bl	_SDL_MUSTLOCK
	cbz	x0, LBB0_4
; %bb.3:
	ldr	x0, [x20]
	bl	_SDL_LockSurface
LBB0_4:
	ldr	x8, [x20]
LBB0_5:
Lloh15:
	adrp	x9, _g_screen_ptr@GOTPAGE
Lloh16:
	ldr	x9, [x9, _g_screen_ptr@GOTPAGEOFF]
	ldr	w0, [x8]
Lloh17:
	str	w0, [x9]
	ldr	w8, [x19]
	lsl	w1, w8, #1
	ldp	x29, x30, [sp, #16]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp], #32             ; 16-byte Folded Reload
	b	_PicoDrawSetOutBuf
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGot	Lloh11, Lloh12
	.loh AdrpLdrGot	Lloh13, Lloh14
	.loh AdrpLdrGotStr	Lloh15, Lloh16, Lloh17
	.cfi_endproc
                                        ; -- End function
	.comm	_g_screen_width,4,2             ; @g_screen_width
	.comm	_g_screen_height,4,2            ; @g_screen_height
	.comm	_plat_sdl_overlay,8,3           ; @plat_sdl_overlay
	.comm	_plat_sdl_gl_active,8,3         ; @plat_sdl_gl_active
	.comm	_shadow_fb,4,2                  ; @shadow_fb
	.comm	_g_screen_ptr,4,2               ; @g_screen_ptr
	.comm	_plat_sdl_screen,8,3            ; @plat_sdl_screen
.subsections_via_symbols
