	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function cdg_load_palette
_cdg_load_palette:                      ## @cdg_load_palette
	.cfi_startproc
## %bb.0:
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset %rbp, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register %rbp
	pushq	%rbx
	.cfi_offset %rbx, -24
	xorl	%r10d, %r10d
	testl	%edx, %edx
	sete	%r10b
	shlq	$5, %r10
	movq	(%rdi), %r9
	movq	8(%rdi), %r8
	movq	8(%r8), %rcx
	movq	8(%rcx), %r11
	addq	%r11, %r10
	xorl	%ecx, %ecx
	.p2align	4, 0x90
LBB0_1:                                 ## =>This Inner Loop Header: Depth=1
	movl	(%rsi,%rcx,8), %edx
	movl	4(%rsi,%rcx,8), %eax
	movl	%edx, %edi
	shll	$6, %edi
	movl	%eax, %ebx
	andl	$48, %ebx
	orl	%edi, %ebx
	shrl	$2, %edx
	andl	$15, %edx
	shrl	$4, %ebx
	andl	$15, %ebx
	andl	$15, %eax
	movl	%eax, %edi
	shll	$4, %edi
	orl	%eax, %edi
	imull	$1114112, %edx, %eax            ## imm = 0x110000
	imull	$4352, %ebx, %edx               ## imm = 0x1100
	orl	%eax, %edx
	leal	(%rdx,%rdi), %eax
	addl	$-16777216, %eax                ## imm = 0xFF000000
	movl	%eax, (%r10,%rcx,4)
	movb	$0, 3(%r11,%r9,4)
	incq	%rcx
	cmpq	$8, %rcx
	jne	LBB0_1
## %bb.2:
	movl	$1, (%r8)
	popq	%rbx
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.no_dead_strip	_cdg_load_palette
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function cdg_load_palette
_cdg_load_palette:                      ; @cdg_load_palette
	.cfi_startproc
; %bb.0:
	cmp	w2, #0
	cset	w11, eq
	ldp	x10, x8, [x0]
	ldr	x9, [x8, #8]
	ldr	x9, [x9, #8]
	lsl	x10, x10, #2
	ldp	w12, w13, [x1]
	and	w14, w13, #0x30
	bfi	w14, w12, #6, #26
	ubfx	w12, w12, #2, #4
	lsr	w15, w14, #4
	ubfx	w14, w14, #4, #4
	and	w13, w13, #0xf
	bfi	w13, w13, #4, #4
	bfi	w12, w12, #4, #4
	lsl	w12, w12, #16
	bfi	w15, w14, #4, #4
	bfi	w12, w15, #8, #8
	orr	w12, w12, w13
	orr	w12, w12, #0xff000000
	add	x11, x9, x11, lsl #5
	str	w12, [x11]
	ldr	w12, [x9, x10]
	and	w12, w12, #0xffffff
	str	w12, [x9, x10]
	ldp	w12, w13, [x1, #8]
	and	w14, w13, #0x30
	bfi	w14, w12, #6, #26
	ubfx	w12, w12, #2, #4
	lsr	w15, w14, #4
	ubfx	w14, w14, #4, #4
	and	w13, w13, #0xf
	bfi	w13, w13, #4, #4
	bfi	w12, w12, #4, #4
	lsl	w12, w12, #16
	bfi	w15, w14, #4, #4
	bfi	w12, w15, #8, #8
	orr	w12, w12, w13
	orr	w12, w12, #0xff000000
	str	w12, [x11, #4]
	ldr	w12, [x9, x10]
	and	w12, w12, #0xffffff
	str	w12, [x9, x10]
	ldp	w12, w13, [x1, #16]
	and	w14, w13, #0x30
	bfi	w14, w12, #6, #26
	ubfx	w12, w12, #2, #4
	lsr	w15, w14, #4
	ubfx	w14, w14, #4, #4
	and	w13, w13, #0xf
	bfi	w13, w13, #4, #4
	bfi	w12, w12, #4, #4
	lsl	w12, w12, #16
	bfi	w15, w14, #4, #4
	bfi	w12, w15, #8, #8
	orr	w12, w12, w13
	orr	w12, w12, #0xff000000
	str	w12, [x11, #8]
	ldr	w12, [x9, x10]
	and	w12, w12, #0xffffff
	str	w12, [x9, x10]
	ldp	w12, w13, [x1, #24]
	and	w14, w13, #0x30
	bfi	w14, w12, #6, #26
	ubfx	w12, w12, #2, #4
	lsr	w15, w14, #4
	ubfx	w14, w14, #4, #4
	and	w13, w13, #0xf
	bfi	w13, w13, #4, #4
	bfi	w12, w12, #4, #4
	lsl	w12, w12, #16
	bfi	w15, w14, #4, #4
	bfi	w12, w15, #8, #8
	orr	w12, w12, w13
	orr	w12, w12, #0xff000000
	str	w12, [x11, #12]
	ldr	w12, [x9, x10]
	and	w12, w12, #0xffffff
	str	w12, [x9, x10]
	ldp	w12, w13, [x1, #32]
	and	w14, w13, #0x30
	bfi	w14, w12, #6, #26
	ubfx	w12, w12, #2, #4
	lsr	w15, w14, #4
	ubfx	w14, w14, #4, #4
	and	w13, w13, #0xf
	bfi	w13, w13, #4, #4
	bfi	w12, w12, #4, #4
	lsl	w12, w12, #16
	bfi	w15, w14, #4, #4
	bfi	w12, w15, #8, #8
	orr	w12, w12, w13
	orr	w12, w12, #0xff000000
	str	w12, [x11, #16]
	ldr	w12, [x9, x10]
	and	w12, w12, #0xffffff
	str	w12, [x9, x10]
	ldp	w12, w13, [x1, #40]
	and	w14, w13, #0x30
	bfi	w14, w12, #6, #26
	ubfx	w12, w12, #2, #4
	lsr	w15, w14, #4
	ubfx	w14, w14, #4, #4
	and	w13, w13, #0xf
	bfi	w13, w13, #4, #4
	bfi	w12, w12, #4, #4
	lsl	w12, w12, #16
	bfi	w15, w14, #4, #4
	bfi	w12, w15, #8, #8
	orr	w12, w12, w13
	orr	w12, w12, #0xff000000
	str	w12, [x11, #20]
	ldr	w12, [x9, x10]
	and	w12, w12, #0xffffff
	str	w12, [x9, x10]
	ldp	w12, w13, [x1, #48]
	and	w14, w13, #0x30
	bfi	w14, w12, #6, #26
	ubfx	w12, w12, #2, #4
	lsr	w15, w14, #4
	ubfx	w14, w14, #4, #4
	and	w13, w13, #0xf
	bfi	w13, w13, #4, #4
	bfi	w12, w12, #4, #4
	lsl	w12, w12, #16
	bfi	w15, w14, #4, #4
	bfi	w12, w15, #8, #8
	orr	w12, w12, w13
	orr	w12, w12, #0xff000000
	str	w12, [x11, #24]
	ldr	w12, [x9, x10]
	and	w12, w12, #0xffffff
	str	w12, [x9, x10]
	ldp	w12, w13, [x1, #56]
	and	w14, w13, #0x30
	bfi	w14, w12, #6, #26
	ubfx	w12, w12, #2, #4
	lsr	w15, w14, #4
	ubfx	w14, w14, #4, #4
	and	w13, w13, #0xf
	bfi	w13, w13, #4, #4
	bfi	w12, w12, #4, #4
	lsl	w12, w12, #16
	bfi	w15, w14, #4, #4
	bfi	w12, w15, #8, #8
	orr	w12, w12, w13
	orr	w12, w12, #0xff000000
	str	w12, [x11, #28]
	ldr	w11, [x9, x10]
	and	w11, w11, #0xffffff
	str	w11, [x9, x10]
	mov	w9, #1
	str	w9, [x8]
	ret
	.cfi_endproc
                                        ; -- End function
	.no_dead_strip	_cdg_load_palette
.subsections_via_symbols
