	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function gp2x_video_setpalette_
_gp2x_video_setpalette_:                ## @gp2x_video_setpalette_
	.cfi_startproc
## %bb.0:
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset %rbp, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register %rbp
	movq	_memregs@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movw	$0, 10584(%rax)
	testl	%esi, %esi
	je	LBB0_8
## %bb.1:
	movl	%esi, %ecx
	addl	%esi, %esi
	leal	(%rcx,%rcx), %r8d
	decl	%r8d
	movl	%esi, %r9d
	andl	$6, %r9d
	je	LBB0_5
## %bb.2:
	xorl	%ecx, %ecx
	.p2align	4, 0x90
LBB0_3:                                 ## =>This Inner Loop Header: Depth=1
	movzwl	(%rdi), %edx
	addq	$2, %rdi
	movw	%dx, 10586(%rax)
	incl	%ecx
	cmpl	%ecx, %r9d
	jne	LBB0_3
## %bb.4:
	subl	%ecx, %esi
LBB0_5:
	cmpl	$7, %r8d
	jb	LBB0_8
## %bb.6:
	movl	%esi, %ecx
	xorl	%edx, %edx
	.p2align	4, 0x90
LBB0_7:                                 ## =>This Inner Loop Header: Depth=1
	movzwl	(%rdi,%rdx,2), %esi
	movw	%si, 10586(%rax)
	movzwl	2(%rdi,%rdx,2), %esi
	movw	%si, 10586(%rax)
	movzwl	4(%rdi,%rdx,2), %esi
	movw	%si, 10586(%rax)
	movzwl	6(%rdi,%rdx,2), %esi
	movw	%si, 10586(%rax)
	movzwl	8(%rdi,%rdx,2), %esi
	movw	%si, 10586(%rax)
	movzwl	10(%rdi,%rdx,2), %esi
	movw	%si, 10586(%rax)
	movzwl	12(%rdi,%rdx,2), %esi
	movw	%si, 10586(%rax)
	movzwl	14(%rdi,%rdx,2), %esi
	movw	%si, 10586(%rax)
	addq	$8, %rdx
	cmpl	%edx, %ecx
	jne	LBB0_7
LBB0_8:
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_memregs,8,3                    ## @memregs
	.no_dead_strip	_gp2x_video_setpalette_
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function gp2x_video_setpalette_
_gp2x_video_setpalette_:                ; @gp2x_video_setpalette_
	.cfi_startproc
; %bb.0:
Lloh0:
	adrp	x8, _memregs@GOTPAGE
Lloh1:
	ldr	x8, [x8, _memregs@GOTPAGEOFF]
Lloh2:
	ldr	x8, [x8]
	mov	w9, #10584
	add	x8, x8, x9
	strh	wzr, [x8]
	cbz	w1, LBB0_3
; %bb.1:
	neg	w9, w1, lsl #1
LBB0_2:                                 ; =>This Inner Loop Header: Depth=1
	ldrh	w10, [x0], #2
	strh	w10, [x8, #2]
	adds	w9, w9, #1
	b.lo	LBB0_2
LBB0_3:
	ret
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.cfi_endproc
                                        ; -- End function
	.comm	_memregs,8,3                    ; @memregs
	.no_dead_strip	_gp2x_video_setpalette_
.subsections_via_symbols
