	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function clearVRAMIfNeeded
_clearVRAMIfNeeded:                     ## @clearVRAMIfNeeded
	.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
	pushq	%rax
	.cfi_offset %rbx, -24
	movq	%rdi, %rbx
	movl	(%rdi), %edi
	testq	%rsi, %rsi
	je	LBB0_4
## %bb.1:
	testl	%edi, %edi
	jne	LBB0_4
## %bb.2:
	movq	_RETRO_HW_FRAME_BUFFER_VALID@GOTPCREL(%rip), %rax
	cmpq	%rsi, (%rax)
	je	LBB0_4
## %bb.3:
	movl	16(%rbx), %eax
	movl	20(%rbx), %edi
	movl	%edx, %esi
	movl	%ecx, %edx
	movl	%eax, %ecx
	callq	_texture_need_prepare
	xorl	%edi, %edi
	orl	(%rbx), %eax
	setne	%dil
	movl	%edi, (%rbx)
LBB0_4:
	testl	%edi, %edi
	je	LBB0_6
## %bb.5:
	movl	12(%rbx), %edi
	callq	_gsKit_vram_clear
	movabsq	$4294967297, %rax               ## imm = 0x100000001
	movq	%rax, 4(%rbx)
LBB0_6:
	addq	$8, %rsp
	popq	%rbx
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_RETRO_HW_FRAME_BUFFER_VALID,8,3 ## @RETRO_HW_FRAME_BUFFER_VALID
	.no_dead_strip	_clearVRAMIfNeeded
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function clearVRAMIfNeeded
_clearVRAMIfNeeded:                     ; @clearVRAMIfNeeded
	.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
	mov	x19, x0
	ldr	w8, [x0]
	cbz	x1, LBB0_3
; %bb.1:
Lloh0:
	adrp	x9, _RETRO_HW_FRAME_BUFFER_VALID@GOTPAGE
Lloh1:
	ldr	x9, [x9, _RETRO_HW_FRAME_BUFFER_VALID@GOTPAGEOFF]
Lloh2:
	ldr	x9, [x9]
	cmp	w8, #0
	ccmp	x9, x1, #4, eq
	b.eq	LBB0_3
; %bb.2:
	ldp	w8, w0, [x19, #16]
	mov	x1, x2
	mov	x2, x3
	mov	x3, x8
	bl	_texture_need_prepare
	ldr	w8, [x19]
	orr	w8, w8, w0
	cmp	w8, #0
	cset	w8, ne
	str	w8, [x19]
LBB0_3:
	cbz	w8, LBB0_5
; %bb.4:
	ldr	w0, [x19, #12]
	bl	_gsKit_vram_clear
	movi.2s	v0, #1
	stur	d0, [x19, #4]
LBB0_5:
	ldp	x29, x30, [sp, #16]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp], #32             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.cfi_endproc
                                        ; -- End function
	.comm	_RETRO_HW_FRAME_BUFFER_VALID,8,3 ; @RETRO_HW_FRAME_BUFFER_VALID
	.no_dead_strip	_clearVRAMIfNeeded
.subsections_via_symbols
