	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_plat_video_flip                ## -- Begin function plat_video_flip
	.p2align	4, 0x90
_plat_video_flip:                       ## @plat_video_flip
	.cfi_startproc
## %bb.0:
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset %rbp, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register %rbp
	pushq	%rbx
	subq	$24, %rsp
	.cfi_offset %rbx, -24
	movq	_plat_sdl_overlay@GOTPCREL(%rip), %rbx
	movq	(%rbx), %rdi
	testq	%rdi, %rdi
	je	LBB0_1
## %bb.5:
	movq	$0, -24(%rbp)
	movq	_plat_sdl_screen@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movl	8(%rax), %ecx
	movl	%ecx, -16(%rbp)
	movl	4(%rax), %eax
	movl	%eax, -12(%rbp)
	callq	_SDL_LockYUVOverlay
	movq	(%rbx), %rax
	movq	(%rax), %rax
	movl	(%rax), %edi
	movq	_shadow_fb@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	_g_screen_width@GOTPCREL(%rip), %rax
	movq	_g_screen_height@GOTPCREL(%rip), %rcx
	movl	(%rcx), %edx
	imull	(%rax), %edx
	callq	_rgb565_to_uyvy
	movq	(%rbx), %rdi
	callq	_SDL_UnlockYUVOverlay
	movq	(%rbx), %rdi
	leaq	-24(%rbp), %rsi
	callq	_SDL_DisplayYUVOverlay
	addq	$24, %rsp
	popq	%rbx
	popq	%rbp
	retq
LBB0_1:
	movq	_plat_sdl_gl_active@GOTPCREL(%rip), %rax
	cmpq	$0, (%rax)
	je	LBB0_2
## %bb.6:
	movq	_shadow_fb@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movq	_g_screen_width@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	_g_screen_height@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	addq	$24, %rsp
	popq	%rbx
	popq	%rbp
	jmp	_gl_flip                        ## TAILCALL
LBB0_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_UnlockSurface
LBB0_4:
	movq	(%rbx), %rdi
	callq	_SDL_Flip
	movq	(%rbx), %rax
	movl	(%rax), %edi
	movq	_g_screen_ptr@GOTPCREL(%rip), %rax
	movl	%edi, (%rax)
	movq	_g_screen_width@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	addl	%esi, %esi
	addq	$24, %rsp
	popq	%rbx
	popq	%rbp
	jmp	_PicoDrawSetOutBuf              ## TAILCALL
	.cfi_endproc
                                        ## -- End function
	.comm	_plat_sdl_overlay,8,3           ## @plat_sdl_overlay
	.comm	_plat_sdl_screen,8,3            ## @plat_sdl_screen
	.comm	_shadow_fb,4,2                  ## @shadow_fb
	.comm	_g_screen_width,4,2             ## @g_screen_width
	.comm	_g_screen_height,4,2            ## @g_screen_height
	.comm	_plat_sdl_gl_active,8,3         ## @plat_sdl_gl_active
	.comm	_g_screen_ptr,4,2               ## @g_screen_ptr
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_plat_video_flip                ; -- Begin function plat_video_flip
	.p2align	2
_plat_video_flip:                       ; @plat_video_flip
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #48
	.cfi_def_cfa_offset 48
	stp	x20, x19, [sp, #16]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #32]             ; 16-byte Folded Spill
	add	x29, sp, #32
	.cfi_def_cfa w29, 16
	.cfi_offset w30, -8
	.cfi_offset w29, -16
	.cfi_offset w19, -24
	.cfi_offset w20, -32
Lloh0:
	adrp	x19, _plat_sdl_overlay@GOTPAGE
Lloh1:
	ldr	x19, [x19, _plat_sdl_overlay@GOTPAGEOFF]
	ldr	x0, [x19]
	cbz	x0, LBB0_2
; %bb.1:
	str	xzr, [sp]
Lloh2:
	adrp	x8, _plat_sdl_screen@GOTPAGE
Lloh3:
	ldr	x8, [x8, _plat_sdl_screen@GOTPAGEOFF]
Lloh4:
	ldr	x8, [x8]
	ldur	d0, [x8, #4]
	rev64.2s	v0, v0
	str	d0, [sp, #8]
	bl	_SDL_LockYUVOverlay
	ldr	x8, [x19]
	ldr	x8, [x8]
	ldr	w0, [x8]
Lloh5:
	adrp	x8, _shadow_fb@GOTPAGE
Lloh6:
	ldr	x8, [x8, _shadow_fb@GOTPAGEOFF]
Lloh7:
	adrp	x9, _g_screen_width@GOTPAGE
Lloh8:
	ldr	x9, [x9, _g_screen_width@GOTPAGEOFF]
Lloh9:
	ldr	w1, [x8]
Lloh10:
	ldr	w8, [x9]
Lloh11:
	adrp	x9, _g_screen_height@GOTPAGE
Lloh12:
	ldr	x9, [x9, _g_screen_height@GOTPAGEOFF]
Lloh13:
	ldr	w9, [x9]
	mul	w2, w9, w8
	bl	_rgb565_to_uyvy
	ldr	x0, [x19]
	bl	_SDL_UnlockYUVOverlay
	ldr	x0, [x19]
	mov	x1, sp
	bl	_SDL_DisplayYUVOverlay
	ldp	x29, x30, [sp, #32]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #48
	ret
LBB0_2:
Lloh14:
	adrp	x8, _plat_sdl_gl_active@GOTPAGE
Lloh15:
	ldr	x8, [x8, _plat_sdl_gl_active@GOTPAGEOFF]
Lloh16:
	ldr	x8, [x8]
	cbz	x8, LBB0_4
; %bb.3:
Lloh17:
	adrp	x8, _shadow_fb@GOTPAGE
Lloh18:
	ldr	x8, [x8, _shadow_fb@GOTPAGEOFF]
Lloh19:
	ldr	w0, [x8]
Lloh20:
	adrp	x8, _g_screen_width@GOTPAGE
Lloh21:
	ldr	x8, [x8, _g_screen_width@GOTPAGEOFF]
Lloh22:
	ldr	w1, [x8]
Lloh23:
	adrp	x8, _g_screen_height@GOTPAGE
Lloh24:
	ldr	x8, [x8, _g_screen_height@GOTPAGEOFF]
Lloh25:
	ldr	w2, [x8]
	ldp	x29, x30, [sp, #32]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #48
	b	_gl_flip
LBB0_4:
Lloh26:
	adrp	x19, _plat_sdl_screen@GOTPAGE
Lloh27:
	ldr	x19, [x19, _plat_sdl_screen@GOTPAGEOFF]
	ldr	x0, [x19]
	bl	_SDL_MUSTLOCK
	cbz	x0, LBB0_6
; %bb.5:
	ldr	x0, [x19]
	bl	_SDL_UnlockSurface
LBB0_6:
	ldr	x0, [x19]
	bl	_SDL_Flip
	ldr	x8, [x19]
	ldr	w0, [x8]
Lloh28:
	adrp	x8, _g_screen_ptr@GOTPAGE
Lloh29:
	ldr	x8, [x8, _g_screen_ptr@GOTPAGEOFF]
Lloh30:
	str	w0, [x8]
Lloh31:
	adrp	x8, _g_screen_width@GOTPAGE
Lloh32:
	ldr	x8, [x8, _g_screen_width@GOTPAGEOFF]
Lloh33:
	ldr	w8, [x8]
	lsl	w1, w8, #1
	ldp	x29, x30, [sp, #32]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #48
	b	_PicoDrawSetOutBuf
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.loh AdrpLdrGotLdr	Lloh7, Lloh8, Lloh10
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh9
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh14, Lloh15, Lloh16
	.loh AdrpLdrGotLdr	Lloh23, Lloh24, Lloh25
	.loh AdrpLdrGotLdr	Lloh20, Lloh21, Lloh22
	.loh AdrpLdrGotLdr	Lloh17, Lloh18, Lloh19
	.loh AdrpLdrGot	Lloh26, Lloh27
	.loh AdrpLdrGotLdr	Lloh31, Lloh32, Lloh33
	.loh AdrpLdrGotStr	Lloh28, Lloh29, Lloh30
	.cfi_endproc
                                        ; -- End function
	.comm	_plat_sdl_overlay,8,3           ; @plat_sdl_overlay
	.comm	_plat_sdl_screen,8,3            ; @plat_sdl_screen
	.comm	_shadow_fb,4,2                  ; @shadow_fb
	.comm	_g_screen_width,4,2             ; @g_screen_width
	.comm	_g_screen_height,4,2            ; @g_screen_height
	.comm	_plat_sdl_gl_active,8,3         ; @plat_sdl_gl_active
	.comm	_g_screen_ptr,4,2               ; @g_screen_ptr
.subsections_via_symbols
