	.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, %r12
	movq	%rdi, %r8
	movq	_currentConfig@GOTPCREL(%rip), %r15
	movq	(%r15), %rax
	movq	_RT_16BIT@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	je	LBB0_8
## %bb.1:
	movq	_PicoAHW@GOTPCREL(%rip), %rax
	movq	_PAHW_32X@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	testl	%ecx, (%rax)
	jne	LBB0_8
## %bb.2:
	movq	_g_screen_ptr@GOTPCREL(%rip), %rax
	movq	_g_screen_width@GOTPCREL(%rip), %rcx
	movslq	(%rcx), %r13
	shlq	$4, %r13
	addq	(%rax), %r13
	movq	_PicoDraw2FB@GOTPCREL(%rip), %rax
	movl	$2632, %ebx                     ## imm = 0xA48
	movq	_HighPal@GOTPCREL(%rip), %rcx
	movq	(%rcx), %r14
	movq	_Pico@GOTPCREL(%rip), %rcx
	addq	(%rax), %rbx
	cmpq	$0, (%rcx)
	je	LBB0_4
## %bb.3:
	xorl	%eax, %eax
	movq	%r8, -48(%rbp)                  ## 8-byte Spill
	callq	_PicoDrawUpdateHighPal
	movq	-48(%rbp), %r8                  ## 8-byte Reload
LBB0_4:
	xorl	%eax, %eax
	.p2align	4, 0x90
LBB0_5:                                 ## =>This Loop Header: Depth=1
                                        ##     Child Loop BB0_6 Depth 2
	addq	$8, %rbx
	xorl	%ecx, %ecx
	.p2align	4, 0x90
LBB0_6:                                 ##   Parent Loop BB0_5 Depth=1
                                        ## =>  This Inner Loop Header: Depth=2
	movzbl	-8(%rbx), %edx
	movzwl	(%r14,%rdx,2), %edx
	movw	%dx, (%r13,%rcx)
	movzbl	-7(%rbx), %edx
	movzwl	(%r14,%rdx,2), %edx
	movw	%dx, 2(%r13,%rcx)
	movzbl	-6(%rbx), %edx
	movzwl	(%r14,%rdx,2), %edx
	movw	%dx, 4(%r13,%rcx)
	movzbl	-5(%rbx), %edx
	movzwl	(%r14,%rdx,2), %edx
	movw	%dx, 6(%r13,%rcx)
	movzbl	-4(%rbx), %edx
	movzwl	(%r14,%rdx,2), %edx
	movw	%dx, 8(%r13,%rcx)
	addq	$10, %rcx
	addq	$5, %rbx
	cmpl	$640, %ecx                      ## imm = 0x280
	jne	LBB0_6
## %bb.7:                               ##   in Loop: Header=BB0_5 Depth=1
	incl	%eax
	addq	%rcx, %r13
	cmpl	$224, %eax
	jne	LBB0_5
LBB0_8:
	testq	%r12, %r12
	je	LBB0_10
## %bb.9:
	movq	_g_screen_height@GOTPCREL(%rip), %rax
	movq	(%rax), %rsi
	addq	$-8, %rsi
	movl	$4, %edi
	movq	%r12, %rdx
	movq	%r8, %rbx
	callq	_emu_osd_text16
	movq	%rbx, %r8
LBB0_10:
	movq	_EOPT_SHOW_FPS@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	testl	%eax, 8(%r15)
	je	LBB0_12
## %bb.11:
	movq	_g_screen_width@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	addl	$-60, %edi
	movq	_g_screen_height@GOTPCREL(%rip), %rax
	movq	(%rax), %rsi
	addq	$-8, %rsi
	movq	%r8, %rdx
	callq	_emu_osd_text16
LBB0_12:
	movq	_PicoAHW@GOTPCREL(%rip), %rax
	movq	_PAHW_MCD@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	testl	%ecx, (%rax)
	je	LBB0_14
## %bb.13:
	movq	_EOPT_EN_CD_LEDS@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	testl	%eax, 8(%r15)
	je	LBB0_14
## %bb.15:
	xorl	%eax, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_draw_cd_leds                   ## TAILCALL
LBB0_14:
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_currentConfig,16,3             ## @currentConfig
	.comm	_RT_16BIT,8,3                   ## @RT_16BIT
	.comm	_PicoAHW,4,2                    ## @PicoAHW
	.comm	_PAHW_32X,4,2                   ## @PAHW_32X
	.comm	_g_screen_ptr,8,3               ## @g_screen_ptr
	.comm	_g_screen_width,4,2             ## @g_screen_width
	.comm	_PicoDraw2FB,8,3                ## @PicoDraw2FB
	.comm	_HighPal,8,3                    ## @HighPal
	.comm	_Pico,8,3                       ## @Pico
	.comm	_EOPT_SHOW_FPS,4,2              ## @EOPT_SHOW_FPS
	.comm	_g_screen_height,8,3            ## @g_screen_height
	.comm	_PAHW_MCD,4,2                   ## @PAHW_MCD
	.comm	_EOPT_EN_CD_LEDS,4,2            ## @EOPT_EN_CD_LEDS
.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	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	x20, x1
	mov	x19, x0
Lloh0:
	adrp	x21, _currentConfig@GOTPAGE
Lloh1:
	ldr	x21, [x21, _currentConfig@GOTPAGEOFF]
	ldr	x8, [x21]
Lloh2:
	adrp	x9, _RT_16BIT@GOTPAGE
Lloh3:
	ldr	x9, [x9, _RT_16BIT@GOTPAGEOFF]
Lloh4:
	ldr	x9, [x9]
Lloh5:
	adrp	x22, _PicoAHW@GOTPAGE
Lloh6:
	ldr	x22, [x22, _PicoAHW@GOTPAGEOFF]
	cmp	x8, x9
	b.eq	LBB0_8
; %bb.1:
	ldr	w8, [x22]
Lloh7:
	adrp	x9, _PAHW_32X@GOTPAGE
Lloh8:
	ldr	x9, [x9, _PAHW_32X@GOTPAGEOFF]
Lloh9:
	ldr	w9, [x9]
	tst	w9, w8
	b.ne	LBB0_8
; %bb.2:
Lloh10:
	adrp	x8, _g_screen_ptr@GOTPAGE
Lloh11:
	ldr	x8, [x8, _g_screen_ptr@GOTPAGEOFF]
Lloh12:
	ldr	x8, [x8]
Lloh13:
	adrp	x9, _g_screen_width@GOTPAGE
Lloh14:
	ldr	x9, [x9, _g_screen_width@GOTPAGEOFF]
Lloh15:
	ldrsw	x9, [x9]
	add	x23, x8, x9, lsl #4
Lloh16:
	adrp	x8, _PicoDraw2FB@GOTPAGE
Lloh17:
	ldr	x8, [x8, _PicoDraw2FB@GOTPAGEOFF]
Lloh18:
	ldr	x8, [x8]
	add	x24, x8, #2632
Lloh19:
	adrp	x8, _HighPal@GOTPAGE
Lloh20:
	ldr	x8, [x8, _HighPal@GOTPAGEOFF]
Lloh21:
	ldr	x25, [x8]
Lloh22:
	adrp	x8, _Pico@GOTPAGE
Lloh23:
	ldr	x8, [x8, _Pico@GOTPAGEOFF]
Lloh24:
	ldr	x8, [x8]
	cbz	x8, LBB0_4
; %bb.3:
	bl	_PicoDrawUpdateHighPal
LBB0_4:
	mov	w8, #0
LBB0_5:                                 ; =>This Loop Header: Depth=1
                                        ;     Child Loop BB0_6 Depth 2
	mov	x9, #0
	add	x24, x24, #8
LBB0_6:                                 ;   Parent Loop BB0_5 Depth=1
                                        ; =>  This Inner Loop Header: Depth=2
	ldurb	w10, [x24, #-8]
	ldrh	w10, [x25, x10, lsl #1]
	strh	w10, [x23, x9]
	add	x9, x9, #2
	add	x24, x24, #1
	cmp	w9, #640
	b.ne	LBB0_6
; %bb.7:                                ;   in Loop: Header=BB0_5 Depth=1
	add	w8, w8, #1
	add	x23, x23, x9
	cmp	w8, #224
	b.ne	LBB0_5
LBB0_8:
Lloh25:
	adrp	x23, _g_screen_height@GOTPAGE
Lloh26:
	ldr	x23, [x23, _g_screen_height@GOTPAGEOFF]
	cbz	x20, LBB0_10
; %bb.9:
	ldr	x8, [x23]
	sub	x1, x8, #8
	mov	w0, #4
	mov	x2, x20
	bl	_emu_osd_text16
LBB0_10:
	ldr	w8, [x21, #8]
Lloh27:
	adrp	x9, _EOPT_SHOW_FPS@GOTPAGE
Lloh28:
	ldr	x9, [x9, _EOPT_SHOW_FPS@GOTPAGEOFF]
Lloh29:
	ldr	w9, [x9]
	tst	w9, w8
	b.eq	LBB0_12
; %bb.11:
Lloh30:
	adrp	x8, _g_screen_width@GOTPAGE
Lloh31:
	ldr	x8, [x8, _g_screen_width@GOTPAGEOFF]
Lloh32:
	ldr	w8, [x8]
	sub	w0, w8, #60
	ldr	x8, [x23]
	sub	x1, x8, #8
	mov	x2, x19
	bl	_emu_osd_text16
LBB0_12:
	ldr	w8, [x22]
Lloh33:
	adrp	x9, _PAHW_MCD@GOTPAGE
Lloh34:
	ldr	x9, [x9, _PAHW_MCD@GOTPAGEOFF]
Lloh35:
	ldr	w9, [x9]
	tst	w9, w8
	b.eq	LBB0_15
; %bb.13:
	ldr	w8, [x21, #8]
Lloh36:
	adrp	x9, _EOPT_EN_CD_LEDS@GOTPAGE
Lloh37:
	ldr	x9, [x9, _EOPT_EN_CD_LEDS@GOTPAGEOFF]
Lloh38:
	ldr	w9, [x9]
	tst	w9, w8
	b.eq	LBB0_15
; %bb.14:
	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
	b	_draw_cd_leds
LBB0_15:
	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 AdrpLdrGot	Lloh5, Lloh6
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh7, Lloh8, Lloh9
	.loh AdrpLdrGotLdr	Lloh22, Lloh23, Lloh24
	.loh AdrpLdrGotLdr	Lloh19, Lloh20, Lloh21
	.loh AdrpLdrGotLdr	Lloh16, Lloh17, Lloh18
	.loh AdrpLdrGotLdr	Lloh13, Lloh14, Lloh15
	.loh AdrpLdrGotLdr	Lloh10, Lloh11, Lloh12
	.loh AdrpLdrGot	Lloh25, Lloh26
	.loh AdrpLdrGotLdr	Lloh27, Lloh28, Lloh29
	.loh AdrpLdrGotLdr	Lloh30, Lloh31, Lloh32
	.loh AdrpLdrGotLdr	Lloh33, Lloh34, Lloh35
	.loh AdrpLdrGotLdr	Lloh36, Lloh37, Lloh38
	.cfi_endproc
                                        ; -- End function
	.comm	_currentConfig,16,3             ; @currentConfig
	.comm	_RT_16BIT,8,3                   ; @RT_16BIT
	.comm	_PicoAHW,4,2                    ; @PicoAHW
	.comm	_PAHW_32X,4,2                   ; @PAHW_32X
	.comm	_g_screen_ptr,8,3               ; @g_screen_ptr
	.comm	_g_screen_width,4,2             ; @g_screen_width
	.comm	_PicoDraw2FB,8,3                ; @PicoDraw2FB
	.comm	_HighPal,8,3                    ; @HighPal
	.comm	_Pico,8,3                       ; @Pico
	.comm	_EOPT_SHOW_FPS,4,2              ; @EOPT_SHOW_FPS
	.comm	_g_screen_height,8,3            ; @g_screen_height
	.comm	_PAHW_MCD,4,2                   ; @PAHW_MCD
	.comm	_EOPT_EN_CD_LEDS,4,2            ; @EOPT_EN_CD_LEDS
.subsections_via_symbols
