	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function vid_reset_mode
_vid_reset_mode:                        ## @vid_reset_mode
	.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
	callq	_get_renderer
	movl	%eax, %r14d
	movq	_POPT_ALT_RENDERER@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, %edx
	notl	%edx
	movq	_PicoOpt@GOTPCREL(%rip), %rsi
	movl	(%rsi), %ecx
	andl	%ecx, %edx
	movl	%edx, (%rsi)
	movq	_emu_scan_begin@GOTPCREL(%rip), %rdx
	movq	$0, (%rdx)
	movq	_emu_scan_end@GOTPCREL(%rip), %rdx
	movq	$0, (%rdx)
	cmpl	$128, %r14d
	je	LBB0_4
## %bb.1:
	cmpl	$130, %r14d
	je	LBB0_7
## %bb.2:
	cmpl	$129, %r14d
	jne	LBB0_5
## %bb.3:
	movq	_PDF_8BIT@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	xorl	%esi, %esi
	callq	_PicoDrawSetOutFormat
	movq	_g_screen_ptr@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movq	_g_screen_width@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	callq	_PicoDrawSetOutBuf
	movl	$8, %r13d
	jmp	LBB0_6
LBB0_4:
	orl	%eax, %ecx
	movl	%ecx, (%rsi)
	movq	_PDF_NONE@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	xorl	%esi, %esi
	callq	_PicoDrawSetOutFormat
	movq	_vidcpy_m2@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movq	_vidcpyM2@GOTPCREL(%rip), %rcx
	movl	%eax, (%rcx)
	movl	$8, %r13d
	jmp	LBB0_6
LBB0_7:
	movq	_PDF_RGB555@GOTPCREL(%rip), %rbx
	movl	(%rbx), %edi
	xorl	%esi, %esi
	callq	_PicoDrawSetOutFormat
	movq	_g_screen_ptr@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movq	_g_screen_width@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	addl	%esi, %esi
	callq	_PicoDrawSetOutBuf
	movq	_PicoAHW@GOTPCREL(%rip), %rax
	movq	_PAHW_32X@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	testl	%ecx, (%rax)
	je	LBB0_11
## %bb.8:
	movq	_currentConfig@GOTPCREL(%rip), %rax
	movq	_EOPT_WIZ_TEAR_FIX@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	movl	$1, %esi
	testl	%ecx, (%rax)
	jne	LBB0_10
	jmp	LBB0_9
LBB0_5:
	leaq	L_str(%rip), %rdi
	callq	_puts
	movl	$16, %r13d
LBB0_6:
	movq	_PicoAHW@GOTPCREL(%rip), %rax
	movq	_PAHW_32X@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	testl	%ecx, (%rax)
	je	LBB0_12
LBB0_9:
	xorl	%esi, %esi
	movq	_PDF_NONE@GOTPCREL(%rip), %rbx
LBB0_10:
	movl	(%rbx), %edi
	callq	_PicoDrawSetOutFormat
	movq	_g_screen_ptr@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movq	_g_screen_width@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	addl	%esi, %esi
	callq	_PicoDrawSetOutBuf
LBB0_11:
	movl	$16, %r13d
LBB0_12:
	movq	_currentConfig@GOTPCREL(%rip), %r15
	movq	_EOPT_WIZ_TEAR_FIX@GOTPCREL(%rip), %r12
	movl	(%r12), %eax
	testl	%eax, (%r15)
	movq	_emu_scan_begin@GOTPCREL(%rip), %rdx
	movq	_emu_scan_end@GOTPCREL(%rip), %rsi
	je	LBB0_21
## %bb.13:
	movq	_PicoAHW@GOTPCREL(%rip), %rax
	movq	_PAHW_32X@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	testl	%ecx, (%rax)
	jne	LBB0_15
## %bb.14:
	cmpl	$130, %r14d
	je	LBB0_15
## %bb.17:
	cmpl	$128, %r14d
	je	LBB0_20
## %bb.18:
	cmpl	$129, %r14d
	jne	LBB0_21
## %bb.19:
	movq	_EmuScanBegin8_rot@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	%rax, (%rdx)
	movq	_EmuScanEnd8_rot@GOTPCREL(%rip), %rax
	jmp	LBB0_16
LBB0_15:
	movq	_EmuScanBegin16_rot@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	%rax, (%rdx)
	movq	_EmuScanEnd16_rot@GOTPCREL(%rip), %rax
LBB0_16:
	movq	(%rax), %rax
	movq	%rax, (%rsi)
	jmp	LBB0_21
LBB0_20:
	movq	_vidcpy_m2_rot@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movq	_vidcpyM2@GOTPCREL(%rip), %rcx
	movl	%eax, (%rcx)
LBB0_21:
	movq	(%rdx), %rdi
	movq	(%rsi), %rsi
	callq	_PicoDrawSetCallbacks
	xorl	%eax, %eax
	callq	_is_16bit_mode
	movl	(%r12), %ecx
	andl	(%r15), %ecx
	testq	%rax, %rax
	movq	_osd_text16_rot@GOTPCREL(%rip), %rax
	cmoveq	_osd_text8_rot@GOTPCREL(%rip), %rax
	movq	_emu_osd_text16@GOTPCREL(%rip), %rdx
	cmoveq	_osd_text8@GOTPCREL(%rip), %rdx
	testl	%ecx, %ecx
	cmovneq	%rax, %rdx
	movl	(%rdx), %eax
	movq	_osd_text@GOTPCREL(%rip), %rcx
	movl	%eax, (%rcx)
	xorl	%eax, %eax
	callq	_gp2x_video_wait_vsync
	xorl	%eax, %eax
	callq	_is_16bit_mode
	testq	%rax, %rax
	je	LBB0_22
## %bb.23:
	xorl	%edi, %edi
	xorl	%esi, %esi
	movl	$153600, %edx                   ## imm = 0x25800
	jmp	LBB0_24
LBB0_22:
	movq	_localPal@GOTPCREL(%rip), %rax
	movq	(%rax), %rdi
	movl	$49152, 768(%rdi)               ## imm = 0xC000
	movl	$12582912, 832(%rdi)            ## imm = 0xC00000
	movl	$0, 896(%rdi)
	movl	$16777215, 960(%rdi)            ## imm = 0xFFFFFF
	movl	$256, %esi                      ## imm = 0x100
	callq	_gp2x_video_setpalette
	xorl	%edi, %edi
	movl	$224, %esi
	movl	$76800, %edx                    ## imm = 0x12C00
LBB0_24:
	callq	_gp2x_memset_all_buffers
	movl	(%r12), %eax
	andl	(%r15), %eax
	movl	%r13d, %edi
	negl	%edi
	testl	%eax, %eax
	cmovel	%r13d, %edi
	movq	_Pico@GOTPCREL(%rip), %rbx
	movl	4(%rbx), %esi
	callq	_gp2x_video_changemode
	movl	$1, (%rbx)
	movq	_POPT_EN_SOFTSCALE@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, %edx
	notl	%edx
	movq	_PicoOpt@GOTPCREL(%rip), %rdi
	movl	(%rdi), %ecx
	andl	%ecx, %edx
	movl	%edx, (%rdi)
	movq	8(%r15), %rdx
	movq	_EOPT_SCALE_SW@GOTPCREL(%rip), %rsi
	cmpq	(%rsi), %rdx
	jne	LBB0_26
## %bb.25:
	orl	%eax, %ecx
	movl	%ecx, (%rdi)
LBB0_26:
	movq	_PicoAHW@GOTPCREL(%rip), %rax
	movq	_PAHW_SMS@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	andl	(%rax), %ecx
	jne	LBB0_27
## %bb.28:
	movq	_make_local_pal_md@GOTPCREL(%rip), %rax
	jmp	LBB0_29
LBB0_27:
	movq	_make_local_pal_sms@GOTPCREL(%rip), %rax
LBB0_29:
	movl	(%rax), %eax
	movq	_make_local_pal@GOTPCREL(%rip), %rcx
	movl	%eax, (%rcx)
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_POPT_ALT_RENDERER,4,2          ## @POPT_ALT_RENDERER
	.comm	_PicoOpt,4,2                    ## @PicoOpt
	.comm	_emu_scan_begin,8,3             ## @emu_scan_begin
	.comm	_emu_scan_end,8,3               ## @emu_scan_end
	.comm	_PDF_RGB555,4,2                 ## @PDF_RGB555
	.comm	_g_screen_ptr,4,2               ## @g_screen_ptr
	.comm	_g_screen_width,4,2             ## @g_screen_width
	.comm	_PDF_8BIT,4,2                   ## @PDF_8BIT
	.comm	_PDF_NONE,4,2                   ## @PDF_NONE
	.comm	_vidcpy_m2,4,2                  ## @vidcpy_m2
	.comm	_vidcpyM2,4,2                   ## @vidcpyM2
	.comm	_PicoAHW,4,2                    ## @PicoAHW
	.comm	_PAHW_32X,4,2                   ## @PAHW_32X
	.comm	_currentConfig,16,3             ## @currentConfig
	.comm	_EOPT_WIZ_TEAR_FIX,4,2          ## @EOPT_WIZ_TEAR_FIX
	.comm	_EmuScanBegin16_rot,8,3         ## @EmuScanBegin16_rot
	.comm	_EmuScanEnd16_rot,8,3           ## @EmuScanEnd16_rot
	.comm	_EmuScanBegin8_rot,8,3          ## @EmuScanBegin8_rot
	.comm	_EmuScanEnd8_rot,8,3            ## @EmuScanEnd8_rot
	.comm	_vidcpy_m2_rot,4,2              ## @vidcpy_m2_rot
	.comm	_osd_text16_rot,4,2             ## @osd_text16_rot
	.comm	_emu_osd_text16,4,2             ## @emu_osd_text16
	.comm	_osd_text,4,2                   ## @osd_text
	.comm	_osd_text8_rot,4,2              ## @osd_text8_rot
	.comm	_osd_text8,4,2                  ## @osd_text8
	.comm	_localPal,8,3                   ## @localPal
	.comm	_Pico,8,2                       ## @Pico
	.comm	_POPT_EN_SOFTSCALE,4,2          ## @POPT_EN_SOFTSCALE
	.comm	_EOPT_SCALE_SW,8,3              ## @EOPT_SCALE_SW
	.comm	_PAHW_SMS,4,2                   ## @PAHW_SMS
	.comm	_make_local_pal_sms,4,2         ## @make_local_pal_sms
	.comm	_make_local_pal_md,4,2          ## @make_local_pal_md
	.comm	_make_local_pal,4,2             ## @make_local_pal
	.section	__TEXT,__cstring,cstring_literals
L_str:                                  ## @str
	.asciz	"bad renderer"

	.no_dead_strip	_vid_reset_mode
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function vid_reset_mode
_vid_reset_mode:                        ; @vid_reset_mode
	.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
	bl	_get_renderer
	mov	x19, x0
Lloh0:
	adrp	x8, _POPT_ALT_RENDERER@GOTPAGE
Lloh1:
	ldr	x8, [x8, _POPT_ALT_RENDERER@GOTPAGEOFF]
Lloh2:
	ldr	w8, [x8]
Lloh3:
	adrp	x20, _PicoOpt@GOTPAGE
Lloh4:
	ldr	x20, [x20, _PicoOpt@GOTPAGEOFF]
	ldr	w9, [x20]
	bic	w10, w9, w8
Lloh5:
	adrp	x24, _emu_scan_begin@GOTPAGE
Lloh6:
	ldr	x24, [x24, _emu_scan_begin@GOTPAGEOFF]
	str	w10, [x20]
	str	xzr, [x24]
Lloh7:
	adrp	x25, _emu_scan_end@GOTPAGE
Lloh8:
	ldr	x25, [x25, _emu_scan_end@GOTPAGEOFF]
Lloh9:
	adrp	x22, _currentConfig@GOTPAGE
Lloh10:
	ldr	x22, [x22, _currentConfig@GOTPAGEOFF]
	str	xzr, [x25]
Lloh11:
	adrp	x23, _EOPT_WIZ_TEAR_FIX@GOTPAGE
Lloh12:
	ldr	x23, [x23, _EOPT_WIZ_TEAR_FIX@GOTPAGEOFF]
Lloh13:
	adrp	x21, _PicoAHW@GOTPAGE
Lloh14:
	ldr	x21, [x21, _PicoAHW@GOTPAGEOFF]
	cmp	w0, #128
	b.eq	LBB0_4
; %bb.1:
	cmp	w19, #130
	b.eq	LBB0_5
; %bb.2:
	cmp	w19, #129
	b.ne	LBB0_8
; %bb.3:
Lloh15:
	adrp	x8, _PDF_8BIT@GOTPAGE
Lloh16:
	ldr	x8, [x8, _PDF_8BIT@GOTPAGEOFF]
Lloh17:
	ldr	w0, [x8]
	mov	w1, #0
	bl	_PicoDrawSetOutFormat
Lloh18:
	adrp	x8, _g_screen_ptr@GOTPAGE
Lloh19:
	ldr	x8, [x8, _g_screen_ptr@GOTPAGEOFF]
Lloh20:
	ldr	w0, [x8]
Lloh21:
	adrp	x8, _g_screen_width@GOTPAGE
Lloh22:
	ldr	x8, [x8, _g_screen_width@GOTPAGEOFF]
Lloh23:
	ldr	w1, [x8]
	bl	_PicoDrawSetOutBuf
	mov	w26, #8
	b	LBB0_9
LBB0_4:
	orr	w8, w9, w8
	str	w8, [x20]
Lloh24:
	adrp	x8, _PDF_NONE@GOTPAGE
Lloh25:
	ldr	x8, [x8, _PDF_NONE@GOTPAGEOFF]
Lloh26:
	ldr	w0, [x8]
	mov	w1, #0
	bl	_PicoDrawSetOutFormat
Lloh27:
	adrp	x8, _vidcpy_m2@GOTPAGE
Lloh28:
	ldr	x8, [x8, _vidcpy_m2@GOTPAGEOFF]
Lloh29:
	ldr	w8, [x8]
Lloh30:
	adrp	x9, _vidcpyM2@GOTPAGE
Lloh31:
	ldr	x9, [x9, _vidcpyM2@GOTPAGEOFF]
Lloh32:
	str	w8, [x9]
	mov	w26, #8
	b	LBB0_9
LBB0_5:
Lloh33:
	adrp	x8, _PDF_RGB555@GOTPAGE
Lloh34:
	ldr	x8, [x8, _PDF_RGB555@GOTPAGEOFF]
Lloh35:
	ldr	w0, [x8]
	mov	w1, #0
	bl	_PicoDrawSetOutFormat
Lloh36:
	adrp	x8, _g_screen_ptr@GOTPAGE
Lloh37:
	ldr	x8, [x8, _g_screen_ptr@GOTPAGEOFF]
Lloh38:
	ldr	w0, [x8]
Lloh39:
	adrp	x8, _g_screen_width@GOTPAGE
Lloh40:
	ldr	x8, [x8, _g_screen_width@GOTPAGEOFF]
Lloh41:
	ldr	w8, [x8]
	lsl	w1, w8, #1
	bl	_PicoDrawSetOutBuf
	ldr	w8, [x21]
Lloh42:
	adrp	x9, _PAHW_32X@GOTPAGE
Lloh43:
	ldr	x9, [x9, _PAHW_32X@GOTPAGEOFF]
Lloh44:
	ldr	w9, [x9]
	tst	w9, w8
	b.eq	LBB0_12
; %bb.6:
	ldr	w8, [x22]
	ldr	w9, [x23]
	tst	w9, w8
	b.eq	LBB0_10
; %bb.7:
	mov	w1, #1
Lloh45:
	adrp	x8, _PDF_RGB555@GOTPAGE
Lloh46:
	ldr	x8, [x8, _PDF_RGB555@GOTPAGEOFF]
	b	LBB0_11
LBB0_8:
Lloh47:
	adrp	x0, l_str@PAGE
Lloh48:
	add	x0, x0, l_str@PAGEOFF
	bl	_puts
	mov	w26, #16
LBB0_9:
	ldr	w8, [x21]
Lloh49:
	adrp	x9, _PAHW_32X@GOTPAGE
Lloh50:
	ldr	x9, [x9, _PAHW_32X@GOTPAGEOFF]
Lloh51:
	ldr	w9, [x9]
	tst	w9, w8
	b.eq	LBB0_13
LBB0_10:
	mov	w1, #0
Lloh52:
	adrp	x8, _PDF_NONE@GOTPAGE
Lloh53:
	ldr	x8, [x8, _PDF_NONE@GOTPAGEOFF]
LBB0_11:
	ldr	w0, [x8]
	bl	_PicoDrawSetOutFormat
Lloh54:
	adrp	x8, _g_screen_ptr@GOTPAGE
Lloh55:
	ldr	x8, [x8, _g_screen_ptr@GOTPAGEOFF]
Lloh56:
	ldr	w0, [x8]
Lloh57:
	adrp	x8, _g_screen_width@GOTPAGE
Lloh58:
	ldr	x8, [x8, _g_screen_width@GOTPAGEOFF]
Lloh59:
	ldr	w8, [x8]
	lsl	w1, w8, #1
	bl	_PicoDrawSetOutBuf
LBB0_12:
	mov	w26, #16
LBB0_13:
	ldr	w8, [x22]
	ldr	w9, [x23]
	tst	w9, w8
	b.eq	LBB0_22
; %bb.14:
	ldr	w8, [x21]
Lloh60:
	adrp	x9, _PAHW_32X@GOTPAGE
Lloh61:
	ldr	x9, [x9, _PAHW_32X@GOTPAGEOFF]
Lloh62:
	ldr	w9, [x9]
	tst	w9, w8
	b.ne	LBB0_19
; %bb.15:
	cmp	w19, #130
	b.eq	LBB0_19
; %bb.16:
	cmp	w19, #128
	b.eq	LBB0_21
; %bb.17:
	cmp	w19, #129
	b.ne	LBB0_22
; %bb.18:
Lloh63:
	adrp	x8, _EmuScanBegin8_rot@GOTPAGE
Lloh64:
	ldr	x8, [x8, _EmuScanBegin8_rot@GOTPAGEOFF]
Lloh65:
	ldr	x8, [x8]
	str	x8, [x24]
Lloh66:
	adrp	x8, _EmuScanEnd8_rot@GOTPAGE
Lloh67:
	ldr	x8, [x8, _EmuScanEnd8_rot@GOTPAGEOFF]
	b	LBB0_20
LBB0_19:
Lloh68:
	adrp	x8, _EmuScanBegin16_rot@GOTPAGE
Lloh69:
	ldr	x8, [x8, _EmuScanBegin16_rot@GOTPAGEOFF]
Lloh70:
	ldr	x8, [x8]
	str	x8, [x24]
Lloh71:
	adrp	x8, _EmuScanEnd16_rot@GOTPAGE
Lloh72:
	ldr	x8, [x8, _EmuScanEnd16_rot@GOTPAGEOFF]
LBB0_20:
	ldr	x8, [x8]
	str	x8, [x25]
	b	LBB0_22
LBB0_21:
Lloh73:
	adrp	x8, _vidcpy_m2_rot@GOTPAGE
Lloh74:
	ldr	x8, [x8, _vidcpy_m2_rot@GOTPAGEOFF]
Lloh75:
	ldr	w8, [x8]
Lloh76:
	adrp	x9, _vidcpyM2@GOTPAGE
Lloh77:
	ldr	x9, [x9, _vidcpyM2@GOTPAGEOFF]
Lloh78:
	str	w8, [x9]
LBB0_22:
	ldr	x0, [x24]
	ldr	x1, [x25]
	bl	_PicoDrawSetCallbacks
	bl	_is_16bit_mode
	ldr	w8, [x22]
	ldr	w9, [x23]
Lloh79:
	adrp	x10, _osd_text8_rot@GOTPAGE
Lloh80:
	ldr	x10, [x10, _osd_text8_rot@GOTPAGEOFF]
Lloh81:
	adrp	x11, _osd_text16_rot@GOTPAGE
Lloh82:
	ldr	x11, [x11, _osd_text16_rot@GOTPAGEOFF]
	cmp	x0, #0
	csel	x10, x10, x11, eq
Lloh83:
	adrp	x11, _osd_text8@GOTPAGE
Lloh84:
	ldr	x11, [x11, _osd_text8@GOTPAGEOFF]
Lloh85:
	adrp	x12, _emu_osd_text16@GOTPAGE
Lloh86:
	ldr	x12, [x12, _emu_osd_text16@GOTPAGEOFF]
	csel	x11, x11, x12, eq
	tst	w9, w8
	csel	x8, x11, x10, eq
	ldr	w8, [x8]
Lloh87:
	adrp	x9, _osd_text@GOTPAGE
Lloh88:
	ldr	x9, [x9, _osd_text@GOTPAGEOFF]
Lloh89:
	str	w8, [x9]
	bl	_gp2x_video_wait_vsync
	bl	_is_16bit_mode
	cbz	x0, LBB0_24
; %bb.23:
	mov	w0, #0
	mov	w1, #0
	mov	w2, #22528
	movk	w2, #2, lsl #16
	b	LBB0_25
LBB0_24:
Lloh90:
	adrp	x8, _localPal@GOTPAGE
Lloh91:
	ldr	x8, [x8, _localPal@GOTPAGEOFF]
Lloh92:
	ldr	x0, [x8]
	mov	w8, #49152
	str	w8, [x0, #768]
	mov	w8, #12582912
	str	w8, [x0, #832]
	str	wzr, [x0, #896]
	mov	w8, #16777215
	str	w8, [x0, #960]
	mov	w1, #256
	bl	_gp2x_video_setpalette
	mov	w0, #0
	mov	w1, #224
	mov	w2, #11264
	movk	w2, #1, lsl #16
LBB0_25:
	bl	_gp2x_memset_all_buffers
	ldr	w8, [x22]
	ldr	w9, [x23]
	tst	w9, w8
	cneg	w0, w26, ne
Lloh93:
	adrp	x19, _Pico@GOTPAGE
Lloh94:
	ldr	x19, [x19, _Pico@GOTPAGEOFF]
	ldr	w1, [x19, #4]
	bl	_gp2x_video_changemode
	mov	w8, #1
	str	w8, [x19]
Lloh95:
	adrp	x8, _POPT_EN_SOFTSCALE@GOTPAGE
Lloh96:
	ldr	x8, [x8, _POPT_EN_SOFTSCALE@GOTPAGEOFF]
Lloh97:
	ldr	w8, [x8]
	ldr	w9, [x20]
	bic	w10, w9, w8
	str	w10, [x20]
	ldr	x10, [x22, #8]
Lloh98:
	adrp	x11, _EOPT_SCALE_SW@GOTPAGE
Lloh99:
	ldr	x11, [x11, _EOPT_SCALE_SW@GOTPAGEOFF]
Lloh100:
	ldr	x11, [x11]
	cmp	x10, x11
	b.ne	LBB0_27
; %bb.26:
	orr	w8, w9, w8
	str	w8, [x20]
LBB0_27:
Lloh101:
	adrp	x8, _PAHW_SMS@GOTPAGE
Lloh102:
	ldr	x8, [x8, _PAHW_SMS@GOTPAGEOFF]
	ldr	w9, [x21]
Lloh103:
	ldr	w8, [x8]
Lloh104:
	adrp	x10, _make_local_pal_sms@GOTPAGE
Lloh105:
	ldr	x10, [x10, _make_local_pal_sms@GOTPAGEOFF]
Lloh106:
	adrp	x11, _make_local_pal_md@GOTPAGE
Lloh107:
	ldr	x11, [x11, _make_local_pal_md@GOTPAGEOFF]
	tst	w8, w9
	csel	x8, x11, x10, eq
	ldr	w8, [x8]
Lloh108:
	adrp	x9, _make_local_pal@GOTPAGE
Lloh109:
	ldr	x9, [x9, _make_local_pal@GOTPAGEOFF]
Lloh110:
	str	w8, [x9]
	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	Lloh13, Lloh14
	.loh AdrpLdrGot	Lloh11, Lloh12
	.loh AdrpLdrGot	Lloh9, Lloh10
	.loh AdrpLdrGot	Lloh7, Lloh8
	.loh AdrpLdrGot	Lloh5, Lloh6
	.loh AdrpLdrGot	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh21, Lloh22, Lloh23
	.loh AdrpLdrGotLdr	Lloh18, Lloh19, Lloh20
	.loh AdrpLdrGotLdr	Lloh15, Lloh16, Lloh17
	.loh AdrpLdrGotStr	Lloh30, Lloh31, Lloh32
	.loh AdrpLdrGotLdr	Lloh27, Lloh28, Lloh29
	.loh AdrpLdrGotLdr	Lloh24, Lloh25, Lloh26
	.loh AdrpLdrGotLdr	Lloh42, Lloh43, Lloh44
	.loh AdrpLdrGotLdr	Lloh39, Lloh40, Lloh41
	.loh AdrpLdrGotLdr	Lloh36, Lloh37, Lloh38
	.loh AdrpLdrGotLdr	Lloh33, Lloh34, Lloh35
	.loh AdrpLdrGot	Lloh45, Lloh46
	.loh AdrpAdd	Lloh47, Lloh48
	.loh AdrpLdrGotLdr	Lloh49, Lloh50, Lloh51
	.loh AdrpLdrGot	Lloh52, Lloh53
	.loh AdrpLdrGotLdr	Lloh57, Lloh58, Lloh59
	.loh AdrpLdrGotLdr	Lloh54, Lloh55, Lloh56
	.loh AdrpLdrGotLdr	Lloh60, Lloh61, Lloh62
	.loh AdrpLdrGot	Lloh66, Lloh67
	.loh AdrpLdrGotLdr	Lloh63, Lloh64, Lloh65
	.loh AdrpLdrGot	Lloh71, Lloh72
	.loh AdrpLdrGotLdr	Lloh68, Lloh69, Lloh70
	.loh AdrpLdrGotStr	Lloh76, Lloh77, Lloh78
	.loh AdrpLdrGotLdr	Lloh73, Lloh74, Lloh75
	.loh AdrpLdrGotStr	Lloh87, Lloh88, Lloh89
	.loh AdrpLdrGot	Lloh85, Lloh86
	.loh AdrpLdrGot	Lloh83, Lloh84
	.loh AdrpLdrGot	Lloh81, Lloh82
	.loh AdrpLdrGot	Lloh79, Lloh80
	.loh AdrpLdrGotLdr	Lloh90, Lloh91, Lloh92
	.loh AdrpLdrGotLdr	Lloh98, Lloh99, Lloh100
	.loh AdrpLdrGotLdr	Lloh95, Lloh96, Lloh97
	.loh AdrpLdrGot	Lloh93, Lloh94
	.loh AdrpLdrGotStr	Lloh108, Lloh109, Lloh110
	.loh AdrpLdrGot	Lloh106, Lloh107
	.loh AdrpLdrGot	Lloh104, Lloh105
	.loh AdrpLdrGotLdr	Lloh101, Lloh102, Lloh103
	.cfi_endproc
                                        ; -- End function
	.comm	_POPT_ALT_RENDERER,4,2          ; @POPT_ALT_RENDERER
	.comm	_PicoOpt,4,2                    ; @PicoOpt
	.comm	_emu_scan_begin,8,3             ; @emu_scan_begin
	.comm	_emu_scan_end,8,3               ; @emu_scan_end
	.comm	_PDF_RGB555,4,2                 ; @PDF_RGB555
	.comm	_g_screen_ptr,4,2               ; @g_screen_ptr
	.comm	_g_screen_width,4,2             ; @g_screen_width
	.comm	_PDF_8BIT,4,2                   ; @PDF_8BIT
	.comm	_PDF_NONE,4,2                   ; @PDF_NONE
	.comm	_vidcpy_m2,4,2                  ; @vidcpy_m2
	.comm	_vidcpyM2,4,2                   ; @vidcpyM2
	.comm	_PicoAHW,4,2                    ; @PicoAHW
	.comm	_PAHW_32X,4,2                   ; @PAHW_32X
	.comm	_currentConfig,16,3             ; @currentConfig
	.comm	_EOPT_WIZ_TEAR_FIX,4,2          ; @EOPT_WIZ_TEAR_FIX
	.comm	_EmuScanBegin16_rot,8,3         ; @EmuScanBegin16_rot
	.comm	_EmuScanEnd16_rot,8,3           ; @EmuScanEnd16_rot
	.comm	_EmuScanBegin8_rot,8,3          ; @EmuScanBegin8_rot
	.comm	_EmuScanEnd8_rot,8,3            ; @EmuScanEnd8_rot
	.comm	_vidcpy_m2_rot,4,2              ; @vidcpy_m2_rot
	.comm	_osd_text16_rot,4,2             ; @osd_text16_rot
	.comm	_emu_osd_text16,4,2             ; @emu_osd_text16
	.comm	_osd_text,4,2                   ; @osd_text
	.comm	_osd_text8_rot,4,2              ; @osd_text8_rot
	.comm	_osd_text8,4,2                  ; @osd_text8
	.comm	_localPal,8,3                   ; @localPal
	.comm	_Pico,8,2                       ; @Pico
	.comm	_POPT_EN_SOFTSCALE,4,2          ; @POPT_EN_SOFTSCALE
	.comm	_EOPT_SCALE_SW,8,3              ; @EOPT_SCALE_SW
	.comm	_PAHW_SMS,4,2                   ; @PAHW_SMS
	.comm	_make_local_pal_sms,4,2         ; @make_local_pal_sms
	.comm	_make_local_pal_md,4,2          ; @make_local_pal_md
	.comm	_make_local_pal,4,2             ; @make_local_pal
	.section	__TEXT,__cstring,cstring_literals
l_str:                                  ; @str
	.asciz	"bad renderer"

	.no_dead_strip	_vid_reset_mode
.subsections_via_symbols
