	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function ps2_gfx_frame
_ps2_gfx_frame:                         ## @ps2_gfx_frame
	.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
	xorl	%eax, %eax
	testl	%edx, %edx
	je	LBB0_21
## %bb.1:
	movl	%ecx, %r12d
	testl	%ecx, %ecx
	je	LBB0_21
## %bb.2:
	movl	%r9d, %r14d
	movl	%edx, %r15d
	movq	%rsi, %rbx
	movq	%rdi, %r13
	movl	%r12d, %ecx
	callq	_clearVRAMIfNeeded
	movl	16(%r13), %edi
	movq	_GS_BLACK@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	callq	_gsKit_clear
	testq	%rbx, %rbx
	je	LBB0_10
## %bb.3:
	movq	_RETRO_HW_FRAME_BUFFER_VALID@GOTPCREL(%rip), %rax
	cmpq	%rbx, (%rax)
	je	LBB0_5
## %bb.4:
	movl	72(%r13), %r8d
	movq	_GS_PSM_CT32@GOTPCREL(%rip), %rax
	cmpl	(%rax), %r8d
	sete	%cl
	incb	%cl
	shrl	%cl, %r14d
	movq	48(%r13), %rdi
	movl	68(%r13), %r9d
	movl	$1, (%rsp)
	movq	%rbx, %rsi
	movl	%r14d, %edx
	movl	%r12d, %ecx
	callq	_transfer_texture
	subl	%r15d, %r14d
	xorl	%ebx, %ebx
	jmp	LBB0_7
LBB0_5:
	movl	56(%r13), %ebx
	movl	64(%r13), %r14d
	movl	$0, 56(%r13)
	cmpl	$0, 60(%r13)
	je	LBB0_7
## %bb.6:
	movl	$0, 60(%r13)
LBB0_7:
	cmpq	$0, 24(%r13)
	je	LBB0_9
## %bb.8:
	movl	16(%r13), %edi
	movq	48(%r13), %rsi
	callq	_vram_alloc
LBB0_9:
	movl	16(%r13), %edi
	movq	48(%r13), %rsi
	movl	%ebx, %edx
	callq	_ps2_texture_upload
	movq	48(%r13), %rsi
	movl	16(%r13), %edi
	movl	40(%r13), %ecx
	movl	$1, %edx
	movl	%r14d, %r8d
	callq	_prim_texture
LBB0_10:
	movq	24(%rbp), %r15
	movq	16(%rbp), %r14
	cmpq	$0, 32(%r13)
	je	LBB0_16
## %bb.11:
	movq	8(%r13), %rsi
	cmpl	$0, 4(%rsi)
	je	LBB0_18
## %bb.12:
	cmpl	$0, (%rsi)
	je	LBB0_18
## %bb.13:
	cmpq	$0, 24(%r13)
	je	LBB0_15
## %bb.14:
	movl	16(%r13), %edi
	callq	_vram_alloc
	movq	8(%r13), %rsi
LBB0_15:
	movl	16(%r13), %edi
	callq	_gsKit_texture_upload
	movl	16(%r13), %edi
	movq	8(%r13), %rsi
	movl	(%r13), %ecx
	movq	_empty_ps2_insets@GOTPCREL(%rip), %rax
	movl	(%rax), %r8d
	movl	$2, %edx
	callq	_prim_texture
	jmp	LBB0_18
LBB0_16:
	cmpq	$0, 16(%r15)
	je	LBB0_18
## %bb.17:
	leaq	8(%r15), %rcx
	movq	(%r15), %rdx
	movq	%r15, %rdi
	xorl	%esi, %esi
	callq	_font_driver_render_msg
LBB0_18:
	movq	%r14, %rdi
	callq	_string_is_empty
	testl	%eax, %eax
	jne	LBB0_20
## %bb.19:
	movq	%r15, %rdi
	xorl	%esi, %esi
	movq	%r14, %rdx
	xorl	%ecx, %ecx
	callq	_font_driver_render_msg
LBB0_20:
	movq	%r13, %rdi
	callq	_refreshScreen
	movl	$1, %eax
LBB0_21:
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_GS_BLACK,4,2                   ## @GS_BLACK
	.comm	_empty_ps2_insets,4,2           ## @empty_ps2_insets
	.comm	_RETRO_HW_FRAME_BUFFER_VALID,8,3 ## @RETRO_HW_FRAME_BUFFER_VALID
	.comm	_GS_PSM_CT32,4,2                ## @GS_PSM_CT32
	.no_dead_strip	_ps2_gfx_frame
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function ps2_gfx_frame
_ps2_gfx_frame:                         ; @ps2_gfx_frame
	.cfi_startproc
; %bb.0:
	stp	x26, x25, [sp, #-80]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 80
	stp	x24, x23, [sp, #16]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #32]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #48]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #64]             ; 16-byte Folded Spill
	add	x29, sp, #64
	.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
	mov	x19, x0
	mov	w0, #0
	cbz	w2, LBB0_21
; %bb.1:
	mov	x23, x3
	cbz	w3, LBB0_21
; %bb.2:
	mov	x21, x7
	mov	x20, x6
	mov	x24, x5
	mov	x22, x2
	mov	x25, x1
	mov	x0, x19
	mov	x3, x23
	bl	_clearVRAMIfNeeded
	ldr	w0, [x19, #16]
Lloh0:
	adrp	x8, _GS_BLACK@GOTPAGE
Lloh1:
	ldr	x8, [x8, _GS_BLACK@GOTPAGEOFF]
Lloh2:
	ldr	w1, [x8]
	bl	_gsKit_clear
	cbz	x25, LBB0_10
; %bb.3:
Lloh3:
	adrp	x8, _RETRO_HW_FRAME_BUFFER_VALID@GOTPAGE
Lloh4:
	ldr	x8, [x8, _RETRO_HW_FRAME_BUFFER_VALID@GOTPAGEOFF]
Lloh5:
	ldr	x8, [x8]
	cmp	x8, x25
	b.eq	LBB0_5
; %bb.4:
Lloh6:
	adrp	x8, _GS_PSM_CT32@GOTPAGE
Lloh7:
	ldr	x8, [x8, _GS_PSM_CT32@GOTPAGEOFF]
Lloh8:
	ldr	w8, [x8]
	ldp	w5, w4, [x19, #68]
	cmp	w4, w8
	mov	w8, #1
	cinc	w8, w8, eq
	lsr	w24, w24, w8
	ldr	x0, [x19, #48]
	mov	x1, x25
	mov	x2, x24
	mov	x3, x23
	mov	w6, #1
	bl	_transfer_texture
	mov	w23, #0
	sub	w22, w24, w22
	b	LBB0_7
LBB0_5:
	ldp	w23, w8, [x19, #56]
	str	wzr, [x19, #56]
	ldr	w22, [x19, #64]
	cbz	w8, LBB0_7
; %bb.6:
	str	wzr, [x19, #60]
LBB0_7:
	ldr	x8, [x19, #24]
	cbz	x8, LBB0_9
; %bb.8:
	ldr	w0, [x19, #16]
	ldr	x1, [x19, #48]
	bl	_vram_alloc
LBB0_9:
	ldr	w0, [x19, #16]
	ldr	x1, [x19, #48]
	mov	x2, x23
	bl	_ps2_texture_upload
	ldr	w0, [x19, #16]
	ldr	x1, [x19, #48]
	mov	w4, w22
	ldr	w3, [x19, #40]
	mov	w2, #1
	bl	_prim_texture
LBB0_10:
	ldr	x8, [x19, #32]
	cbz	x8, LBB0_16
; %bb.11:
	ldr	x1, [x19, #8]
	ldr	w8, [x1, #4]
	cbz	w8, LBB0_18
; %bb.12:
	ldr	w8, [x1]
	cbz	w8, LBB0_18
; %bb.13:
	ldr	x8, [x19, #24]
	cbz	x8, LBB0_15
; %bb.14:
	ldr	w0, [x19, #16]
	bl	_vram_alloc
	ldr	x1, [x19, #8]
LBB0_15:
	ldr	w0, [x19, #16]
	bl	_gsKit_texture_upload
	ldr	w0, [x19, #16]
	ldr	x1, [x19, #8]
	ldr	w3, [x19]
Lloh9:
	adrp	x8, _empty_ps2_insets@GOTPAGE
Lloh10:
	ldr	x8, [x8, _empty_ps2_insets@GOTPAGEOFF]
Lloh11:
	ldr	w4, [x8]
	mov	w2, #2
	bl	_prim_texture
	b	LBB0_18
LBB0_16:
	ldr	x8, [x21, #16]
	cbz	x8, LBB0_18
; %bb.17:
	mov	x3, x21
	ldr	x2, [x3], #8
	mov	x0, x21
	mov	x1, #0
	bl	_font_driver_render_msg
LBB0_18:
	mov	x0, x20
	bl	_string_is_empty
	cbnz	w0, LBB0_20
; %bb.19:
	mov	x0, x21
	mov	x1, #0
	mov	x2, x20
	mov	x3, #0
	bl	_font_driver_render_msg
LBB0_20:
	mov	x0, x19
	bl	_refreshScreen
	mov	w0, #1
LBB0_21:
	ldp	x29, x30, [sp, #64]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #48]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #32]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #16]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp], #80             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.cfi_endproc
                                        ; -- End function
	.comm	_GS_BLACK,4,2                   ; @GS_BLACK
	.comm	_empty_ps2_insets,4,2           ; @empty_ps2_insets
	.comm	_RETRO_HW_FRAME_BUFFER_VALID,8,3 ; @RETRO_HW_FRAME_BUFFER_VALID
	.comm	_GS_PSM_CT32,4,2                ; @GS_PSM_CT32
	.no_dead_strip	_ps2_gfx_frame
.subsections_via_symbols
