	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_pemu_finalize_frame            ## -- Begin function pemu_finalize_frame
	.p2align	4, 0x90
_pemu_finalize_frame:                   ## @pemu_finalize_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
	movq	%rsi, %rbx
	movq	%rdi, %r14
	movq	_currentConfig@GOTPCREL(%rip), %rax
	movl	(%rax), %r12d
	movq	_PicoAHW@GOTPCREL(%rip), %r15
	movq	_PAHW_32X@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	testl	%eax, (%r15)
	jne	LBB0_10
## %bb.1:
	xorl	%eax, %eax
	callq	_get_renderer
	movq	_RT_8BIT_FAST@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jne	LBB0_7
## %bb.2:
	movq	_Pico@GOTPCREL(%rip), %r13
	cmpq	$0, (%r13)
	je	LBB0_4
## %bb.3:
	movq	$0, (%r13)
	movl	$1, %edi
	callq	_make_local_pal
	movq	_localPal@GOTPCREL(%rip), %rcx
	movl	(%rcx), %edi
	movl	%eax, %esi
	callq	_gp2x_video_setpalette
LBB0_4:
	movq	_PAHW_SVP@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	testl	%eax, (%r15)
	je	LBB0_6
## %bb.5:
	movq	_PicoDraw2FB@GOTPCREL(%rip), %rax
	movl	$75768, %edi                    ## imm = 0x127F8
	addq	(%rax), %rdi
	movl	$-522133280, %esi               ## imm = 0xE0E0E0E0
	movl	$328, %edx                      ## imm = 0x148
	callq	_memset32
LBB0_6:
	movq	_g_screen_ptr@GOTPCREL(%rip), %rax
	movq	_PicoDraw2FB@GOTPCREL(%rip), %rcx
	movl	$2624, %esi                     ## imm = 0xA40
	addq	(%rcx), %rsi
	movl	(%rax), %edi
	movq	8(%r13), %rax
	movl	48(%rax), %edx
	notl	%edx
	andl	$1, %edx
	movq	_PicoOpt@GOTPCREL(%rip), %r8
	movq	_POPT_DIS_32C_BORDER@GOTPCREL(%rip), %rcx
	movl	(%rcx), %eax
	xorl	%ecx, %ecx
	andl	(%r8), %eax
	sete	%cl
	callq	_vidcpyM2
	jmp	LBB0_10
LBB0_7:
	xorl	%eax, %eax
	callq	_get_renderer
	movq	_RT_8BIT_ACC@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jne	LBB0_10
## %bb.8:
	movq	_Pico@GOTPCREL(%rip), %rax
	cmpq	$0, (%rax)
	je	LBB0_10
## %bb.9:
	movq	$0, (%rax)
	xorl	%edi, %edi
	callq	_make_local_pal
	movq	_localPal@GOTPCREL(%rip), %rcx
	movl	(%rcx), %edi
	movl	%eax, %esi
	callq	_gp2x_video_setpalette
LBB0_10:
	testq	%rbx, %rbx
	je	LBB0_12
## %bb.11:
	movq	_osd_y@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movl	$4, %edi
	movq	%rbx, %rdx
	callq	_osd_text
LBB0_12:
	movq	_EOPT_SHOW_FPS@GOTPCREL(%rip), %rax
	testl	%r12d, (%rax)
	je	LBB0_14
## %bb.13:
	movq	_osd_fps_x@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movq	_osd_y@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r14, %rdx
	callq	_osd_text
LBB0_14:
	movl	(%r15), %eax
	movq	_PAHW_MCD@GOTPCREL(%rip), %rcx
	testl	%eax, (%rcx)
	je	LBB0_17
## %bb.15:
	movq	_EOPT_EN_CD_LEDS@GOTPCREL(%rip), %rcx
	testl	%r12d, (%rcx)
	je	LBB0_17
## %bb.16:
	xorl	%eax, %eax
	callq	_draw_cd_leds
	movl	(%r15), %eax
LBB0_17:
	movq	_PAHW_PICO@GOTPCREL(%rip), %rcx
	testl	%eax, (%rcx)
	je	LBB0_18
## %bb.19:
	xorl	%eax, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_draw_pico_ptr                  ## TAILCALL
LBB0_18:
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_currentConfig,4,2              ## @currentConfig
	.comm	_PicoAHW,4,2                    ## @PicoAHW
	.comm	_PAHW_32X,4,2                   ## @PAHW_32X
	.comm	_RT_8BIT_FAST,8,3               ## @RT_8BIT_FAST
	.comm	_Pico,16,3                      ## @Pico
	.comm	_localPal,4,2                   ## @localPal
	.comm	_PAHW_SVP,4,2                   ## @PAHW_SVP
	.comm	_PicoDraw2FB,8,3                ## @PicoDraw2FB
	.comm	_g_screen_ptr,4,2               ## @g_screen_ptr
	.comm	_PicoOpt,4,2                    ## @PicoOpt
	.comm	_POPT_DIS_32C_BORDER,4,2        ## @POPT_DIS_32C_BORDER
	.comm	_RT_8BIT_ACC,8,3                ## @RT_8BIT_ACC
	.comm	_osd_y,4,2                      ## @osd_y
	.comm	_EOPT_SHOW_FPS,4,2              ## @EOPT_SHOW_FPS
	.comm	_osd_fps_x,4,2                  ## @osd_fps_x
	.comm	_PAHW_MCD,4,2                   ## @PAHW_MCD
	.comm	_EOPT_EN_CD_LEDS,4,2            ## @EOPT_EN_CD_LEDS
	.comm	_PAHW_PICO,4,2                  ## @PAHW_PICO
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_pemu_finalize_frame            ; -- Begin function pemu_finalize_frame
	.p2align	2
_pemu_finalize_frame:                   ; @pemu_finalize_frame
	.cfi_startproc
; %bb.0:
	stp	x24, x23, [sp, #-64]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 64
	stp	x22, x21, [sp, #16]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #32]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #48]             ; 16-byte Folded Spill
	add	x29, sp, #48
	.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
	mov	x20, x1
	mov	x19, x0
Lloh0:
	adrp	x8, _currentConfig@GOTPAGE
Lloh1:
	ldr	x8, [x8, _currentConfig@GOTPAGEOFF]
Lloh2:
	adrp	x21, _PicoAHW@GOTPAGE
Lloh3:
	ldr	x21, [x21, _PicoAHW@GOTPAGEOFF]
Lloh4:
	ldr	w22, [x8]
	ldr	w8, [x21]
Lloh5:
	adrp	x9, _PAHW_32X@GOTPAGE
Lloh6:
	ldr	x9, [x9, _PAHW_32X@GOTPAGEOFF]
Lloh7:
	ldr	w9, [x9]
	tst	w9, w8
	b.ne	LBB0_9
; %bb.1:
	bl	_get_renderer
Lloh8:
	adrp	x8, _RT_8BIT_FAST@GOTPAGE
Lloh9:
	ldr	x8, [x8, _RT_8BIT_FAST@GOTPAGEOFF]
Lloh10:
	ldr	x8, [x8]
	cmp	x0, x8
	b.ne	LBB0_7
; %bb.2:
Lloh11:
	adrp	x23, _Pico@GOTPAGE
Lloh12:
	ldr	x23, [x23, _Pico@GOTPAGEOFF]
	ldr	x8, [x23]
	cbz	x8, LBB0_4
; %bb.3:
	str	xzr, [x23]
	mov	w0, #1
	bl	_make_local_pal
	mov	x1, x0
Lloh13:
	adrp	x8, _localPal@GOTPAGE
Lloh14:
	ldr	x8, [x8, _localPal@GOTPAGEOFF]
Lloh15:
	ldr	w0, [x8]
	bl	_gp2x_video_setpalette
LBB0_4:
	ldr	w8, [x21]
Lloh16:
	adrp	x9, _PAHW_SVP@GOTPAGE
Lloh17:
	ldr	x9, [x9, _PAHW_SVP@GOTPAGEOFF]
Lloh18:
	ldr	w9, [x9]
Lloh19:
	adrp	x24, _PicoDraw2FB@GOTPAGE
Lloh20:
	ldr	x24, [x24, _PicoDraw2FB@GOTPAGEOFF]
	tst	w9, w8
	b.eq	LBB0_6
; %bb.5:
	ldr	x8, [x24]
	add	x8, x8, #18, lsl #12            ; =73728
	add	x0, x8, #2040
	mov	w1, #-522133280
	mov	w2, #328
	bl	_memset32
LBB0_6:
Lloh21:
	adrp	x8, _g_screen_ptr@GOTPAGE
Lloh22:
	ldr	x8, [x8, _g_screen_ptr@GOTPAGEOFF]
Lloh23:
	ldr	w0, [x8]
	ldr	x8, [x24]
	add	x1, x8, #2624
	ldr	x8, [x23, #8]
	ldr	w8, [x8, #48]
	mvn	w8, w8
	and	w2, w8, #0x1
Lloh24:
	adrp	x8, _PicoOpt@GOTPAGE
Lloh25:
	ldr	x8, [x8, _PicoOpt@GOTPAGEOFF]
Lloh26:
	ldr	w8, [x8]
Lloh27:
	adrp	x9, _POPT_DIS_32C_BORDER@GOTPAGE
Lloh28:
	ldr	x9, [x9, _POPT_DIS_32C_BORDER@GOTPAGEOFF]
Lloh29:
	ldr	w9, [x9]
	tst	w9, w8
	cset	w3, eq
	bl	_vidcpyM2
	b	LBB0_9
LBB0_7:
	bl	_get_renderer
Lloh30:
	adrp	x8, _RT_8BIT_ACC@GOTPAGE
Lloh31:
	ldr	x8, [x8, _RT_8BIT_ACC@GOTPAGEOFF]
Lloh32:
	ldr	x9, [x8]
Lloh33:
	adrp	x8, _Pico@GOTPAGE
Lloh34:
	ldr	x8, [x8, _Pico@GOTPAGEOFF]
	ldr	x10, [x8]
	cmp	x0, x9
	ccmp	x10, #0, #4, eq
	b.eq	LBB0_9
; %bb.8:
	str	xzr, [x8]
	mov	w0, #0
	bl	_make_local_pal
	mov	x1, x0
Lloh35:
	adrp	x8, _localPal@GOTPAGE
Lloh36:
	ldr	x8, [x8, _localPal@GOTPAGEOFF]
Lloh37:
	ldr	w0, [x8]
	bl	_gp2x_video_setpalette
LBB0_9:
Lloh38:
	adrp	x23, _osd_y@GOTPAGE
Lloh39:
	ldr	x23, [x23, _osd_y@GOTPAGEOFF]
	cbz	x20, LBB0_11
; %bb.10:
	ldr	w1, [x23]
	mov	w0, #4
	mov	x2, x20
	bl	_osd_text
LBB0_11:
Lloh40:
	adrp	x8, _EOPT_SHOW_FPS@GOTPAGE
Lloh41:
	ldr	x8, [x8, _EOPT_SHOW_FPS@GOTPAGEOFF]
Lloh42:
	ldr	w8, [x8]
	tst	w8, w22
	b.eq	LBB0_13
; %bb.12:
Lloh43:
	adrp	x8, _osd_fps_x@GOTPAGE
Lloh44:
	ldr	x8, [x8, _osd_fps_x@GOTPAGEOFF]
Lloh45:
	ldr	w0, [x8]
	ldr	w1, [x23]
	mov	x2, x19
	bl	_osd_text
LBB0_13:
	ldr	w8, [x21]
Lloh46:
	adrp	x9, _PAHW_MCD@GOTPAGE
Lloh47:
	ldr	x9, [x9, _PAHW_MCD@GOTPAGEOFF]
Lloh48:
	ldr	w9, [x9]
	tst	w9, w8
	b.eq	LBB0_16
; %bb.14:
Lloh49:
	adrp	x9, _EOPT_EN_CD_LEDS@GOTPAGE
Lloh50:
	ldr	x9, [x9, _EOPT_EN_CD_LEDS@GOTPAGEOFF]
Lloh51:
	ldr	w9, [x9]
	tst	w9, w22
	b.eq	LBB0_16
; %bb.15:
	bl	_draw_cd_leds
	ldr	w8, [x21]
LBB0_16:
Lloh52:
	adrp	x9, _PAHW_PICO@GOTPAGE
Lloh53:
	ldr	x9, [x9, _PAHW_PICO@GOTPAGEOFF]
Lloh54:
	ldr	w9, [x9]
	tst	w9, w8
	b.eq	LBB0_18
; %bb.17:
	ldp	x29, x30, [sp, #48]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #32]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #16]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp], #64             ; 16-byte Folded Reload
	b	_draw_pico_ptr
LBB0_18:
	ldp	x29, x30, [sp, #48]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #32]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #16]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp], #64             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh4
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpLdrGot	Lloh11, Lloh12
	.loh AdrpLdrGotLdr	Lloh13, Lloh14, Lloh15
	.loh AdrpLdrGot	Lloh19, Lloh20
	.loh AdrpLdrGotLdr	Lloh16, Lloh17, Lloh18
	.loh AdrpLdrGotLdr	Lloh27, Lloh28, Lloh29
	.loh AdrpLdrGotLdr	Lloh24, Lloh25, Lloh26
	.loh AdrpLdrGotLdr	Lloh21, Lloh22, Lloh23
	.loh AdrpLdrGot	Lloh33, Lloh34
	.loh AdrpLdrGotLdr	Lloh30, Lloh31, Lloh32
	.loh AdrpLdrGotLdr	Lloh35, Lloh36, Lloh37
	.loh AdrpLdrGot	Lloh38, Lloh39
	.loh AdrpLdrGotLdr	Lloh40, Lloh41, Lloh42
	.loh AdrpLdrGotLdr	Lloh43, Lloh44, Lloh45
	.loh AdrpLdrGotLdr	Lloh46, Lloh47, Lloh48
	.loh AdrpLdrGotLdr	Lloh49, Lloh50, Lloh51
	.loh AdrpLdrGotLdr	Lloh52, Lloh53, Lloh54
	.cfi_endproc
                                        ; -- End function
	.comm	_currentConfig,4,2              ; @currentConfig
	.comm	_PicoAHW,4,2                    ; @PicoAHW
	.comm	_PAHW_32X,4,2                   ; @PAHW_32X
	.comm	_RT_8BIT_FAST,8,3               ; @RT_8BIT_FAST
	.comm	_Pico,16,3                      ; @Pico
	.comm	_localPal,4,2                   ; @localPal
	.comm	_PAHW_SVP,4,2                   ; @PAHW_SVP
	.comm	_PicoDraw2FB,8,3                ; @PicoDraw2FB
	.comm	_g_screen_ptr,4,2               ; @g_screen_ptr
	.comm	_PicoOpt,4,2                    ; @PicoOpt
	.comm	_POPT_DIS_32C_BORDER,4,2        ; @POPT_DIS_32C_BORDER
	.comm	_RT_8BIT_ACC,8,3                ; @RT_8BIT_ACC
	.comm	_osd_y,4,2                      ; @osd_y
	.comm	_EOPT_SHOW_FPS,4,2              ; @EOPT_SHOW_FPS
	.comm	_osd_fps_x,4,2                  ; @osd_fps_x
	.comm	_PAHW_MCD,4,2                   ; @PAHW_MCD
	.comm	_EOPT_EN_CD_LEDS,4,2            ; @EOPT_EN_CD_LEDS
	.comm	_PAHW_PICO,4,2                  ; @PAHW_PICO
.subsections_via_symbols
