	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function make_local_pal_md
_make_local_pal_md:                     ## @make_local_pal_md
	.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	%rbx
	pushq	%rax
	.cfi_offset %rbx, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movl	%edi, %ebx
	movq	_localPal@GOTPCREL(%rip), %r14
	movq	(%r14), %rdi
	movq	_Pico@GOTPCREL(%rip), %r15
	movq	(%r15), %rsi
	callq	_bgr444_to_rgb32
	movl	$64, %eax
	testl	%ebx, %ebx
	jne	LBB0_7
## %bb.1:
	movq	8(%r15), %rax
	testb	$8, 48(%rax)
	jne	LBB0_2
## %bb.3:
	movq	_rendstatus@GOTPCREL(%rip), %rcx
	movq	_PDRAW_SONIC_MODE@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	(%r14), %rax
	testl	%edx, (%rcx)
	je	LBB0_5
## %bb.4:
	addq	$256, %rax                      ## imm = 0x100
	movq	_HighPal@GOTPCREL(%rip), %rbx
	movq	(%rbx), %rsi
	movq	%rax, %rdi
	callq	_bgr444_to_rgb32
	movl	$512, %edi                      ## imm = 0x200
	addq	(%r14), %rdi
	movq	(%rbx), %rsi
	addq	$64, %rsi
	callq	_bgr444_to_rgb32
	jmp	LBB0_6
LBB0_2:
	movq	(%r14), %rdi
	movq	(%r15), %rsi
	callq	_bgr444_to_rgb32_sh
	movq	(%r14), %rax
	movl	$49152, 768(%rax)               ## imm = 0xC000
	movl	$12582912, 832(%rax)            ## imm = 0xC00000
	movl	$0, 896(%rax)
	movl	$16777215, 960(%rax)            ## imm = 0xFFFFFF
	movl	$256, %eax                      ## imm = 0x100
	jmp	LBB0_7
LBB0_5:
	leaq	512(%rax), %rdi
	movq	%rax, %rsi
	movl	$64, %edx
	callq	_memcpy32
LBB0_6:
	movl	$192, %eax
LBB0_7:
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_localPal,8,3                   ## @localPal
	.comm	_Pico,16,3                      ## @Pico
	.comm	_rendstatus,4,2                 ## @rendstatus
	.comm	_PDRAW_SONIC_MODE,4,2           ## @PDRAW_SONIC_MODE
	.comm	_HighPal,8,3                    ## @HighPal
	.no_dead_strip	_make_local_pal_md
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function make_local_pal_md
_make_local_pal_md:                     ; @make_local_pal_md
	.cfi_startproc
; %bb.0:
	stp	x22, x21, [sp, #-48]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 48
	stp	x20, x19, [sp, #16]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #32]             ; 16-byte Folded Spill
	add	x29, sp, #32
	.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
	mov	x19, x0
Lloh0:
	adrp	x20, _localPal@GOTPAGE
Lloh1:
	ldr	x20, [x20, _localPal@GOTPAGEOFF]
	ldr	x0, [x20]
Lloh2:
	adrp	x21, _Pico@GOTPAGE
Lloh3:
	ldr	x21, [x21, _Pico@GOTPAGEOFF]
	ldr	x1, [x21]
	bl	_bgr444_to_rgb32
	cbz	w19, LBB0_2
; %bb.1:
	mov	w0, #64
	b	LBB0_8
LBB0_2:
	ldr	x8, [x21, #8]
	ldrb	w8, [x8, #48]
	tbnz	w8, #3, LBB0_5
; %bb.3:
Lloh4:
	adrp	x8, _rendstatus@GOTPAGE
Lloh5:
	ldr	x8, [x8, _rendstatus@GOTPAGEOFF]
Lloh6:
	ldr	w8, [x8]
Lloh7:
	adrp	x9, _PDRAW_SONIC_MODE@GOTPAGE
Lloh8:
	ldr	x9, [x9, _PDRAW_SONIC_MODE@GOTPAGEOFF]
Lloh9:
	ldr	w9, [x9]
	ldr	x1, [x20]
	tst	w9, w8
	b.eq	LBB0_6
; %bb.4:
	add	x0, x1, #256
Lloh10:
	adrp	x19, _HighPal@GOTPAGE
Lloh11:
	ldr	x19, [x19, _HighPal@GOTPAGEOFF]
	ldr	x1, [x19]
	bl	_bgr444_to_rgb32
	ldr	x8, [x20]
	add	x0, x8, #512
	ldr	x8, [x19]
	add	x1, x8, #64
	bl	_bgr444_to_rgb32
	b	LBB0_7
LBB0_5:
	ldr	x0, [x20]
	ldr	x1, [x21]
	bl	_bgr444_to_rgb32_sh
	ldr	x8, [x20]
	mov	w9, #49152
	str	w9, [x8, #768]
	mov	w9, #12582912
	str	w9, [x8, #832]
	str	wzr, [x8, #896]
	mov	w9, #16777215
	str	w9, [x8, #960]
	mov	w0, #256
	b	LBB0_8
LBB0_6:
	add	x0, x1, #512
	mov	w2, #64
	bl	_memcpy32
LBB0_7:
	mov	w0, #192
LBB0_8:
	ldp	x29, x30, [sp, #32]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #16]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp], #48             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh7, Lloh8, Lloh9
	.loh AdrpLdrGotLdr	Lloh4, Lloh5, Lloh6
	.loh AdrpLdrGot	Lloh10, Lloh11
	.cfi_endproc
                                        ; -- End function
	.comm	_localPal,8,3                   ; @localPal
	.comm	_Pico,16,3                      ; @Pico
	.comm	_rendstatus,4,2                 ; @rendstatus
	.comm	_PDRAW_SONIC_MODE,4,2           ; @PDRAW_SONIC_MODE
	.comm	_HighPal,8,3                    ; @HighPal
	.no_dead_strip	_make_local_pal_md
.subsections_via_symbols
