	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function update_palette_index
_update_palette_index:                  ## @update_palette_index
	.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
	subq	$40, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdi, %rbx
	movl	$4, %eax
	.p2align	4, 0x90
LBB0_1:                                 ## =>This Loop Header: Depth=1
                                        ##     Child Loop BB0_2 Depth 2
                                        ##       Child Loop BB0_3 Depth 3
	movl	%eax, %ecx
	shll	$16, %ecx
	movl	%ecx, -48(%rbp)                 ## 4-byte Spill
	movq	%rax, -64(%rbp)                 ## 8-byte Spill
                                        ## kill: def $eax killed $eax killed $rax
	shll	$7, %eax
	andl	$31744, %eax                    ## imm = 0x7C00
	movl	%eax, -44(%rbp)                 ## 4-byte Spill
	movl	$4, %eax
	.p2align	4, 0x90
LBB0_2:                                 ##   Parent Loop BB0_1 Depth=1
                                        ## =>  This Loop Header: Depth=2
                                        ##       Child Loop BB0_3 Depth 3
	movl	%eax, %ecx
	shll	$8, %ecx
	orl	-48(%rbp), %ecx                 ## 4-byte Folded Reload
	movl	%ecx, -52(%rbp)                 ## 4-byte Spill
	movq	%rax, -72(%rbp)                 ## 8-byte Spill
	leal	(,%rax,4), %r15d
	andl	$992, %r15d                     ## imm = 0x3E0
	orl	-44(%rbp), %r15d                ## 4-byte Folded Reload
	movl	$-4, %r12d
	xorl	%r13d, %r13d
	.p2align	4, 0x90
LBB0_3:                                 ##   Parent Loop BB0_1 Depth=1
                                        ##     Parent Loop BB0_2 Depth=2
                                        ## =>    This Inner Loop Header: Depth=3
	addl	$8, %r12d
	movl	-52(%rbp), %esi                 ## 4-byte Reload
	orl	%r12d, %esi
	movl	%r15d, %r14d
	orl	%r13d, %r14d
	movq	%rbx, %rdi
	callq	_pixel_color7_slow
	movq	(%rbx), %rcx
	movl	%eax, (%rcx,%r14,4)
	incl	%r13d
	cmpl	$248, %r12d
	jb	LBB0_3
## %bb.4:                               ##   in Loop: Header=BB0_2 Depth=2
	movq	-72(%rbp), %rcx                 ## 8-byte Reload
	leal	8(%rcx), %eax
	cmpl	$248, %ecx
                                        ## kill: def $eax killed $eax def $rax
	jb	LBB0_2
## %bb.5:                               ##   in Loop: Header=BB0_1 Depth=1
	movq	-64(%rbp), %rcx                 ## 8-byte Reload
	leal	8(%rcx), %eax
	cmpl	$248, %ecx
                                        ## kill: def $eax killed $eax def $rax
	jb	LBB0_1
## %bb.6:
	xorl	%eax, %eax
	addq	$40, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.no_dead_strip	_update_palette_index
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function update_palette_index
_update_palette_index:                  ; @update_palette_index
	.cfi_startproc
; %bb.0:
	stp	x28, x27, [sp, #-96]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 96
	stp	x26, x25, [sp, #16]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #32]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #48]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #64]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #80]             ; 16-byte Folded Spill
	add	x29, sp, #80
	.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
	.cfi_offset w27, -88
	.cfi_offset w28, -96
	mov	x19, x0
	mov	w20, #4
LBB0_1:                                 ; =>This Loop Header: Depth=1
                                        ;     Child Loop BB0_2 Depth 2
                                        ;       Child Loop BB0_3 Depth 3
	lsl	w21, w20, #16
	lsl	w8, w20, #7
	and	w22, w8, #0x7c00
	mov	w23, #4
LBB0_2:                                 ;   Parent Loop BB0_1 Depth=1
                                        ; =>  This Loop Header: Depth=2
                                        ;       Child Loop BB0_3 Depth 3
	mov	w24, #0
	orr	w25, w21, w23, lsl #8
	lsl	w8, w23, #2
	and	w8, w8, #0x3e0
	orr	w26, w8, w22
	mov	w27, #-4
LBB0_3:                                 ;   Parent Loop BB0_1 Depth=1
                                        ;     Parent Loop BB0_2 Depth=2
                                        ; =>    This Inner Loop Header: Depth=3
	add	w27, w27, #8
	orr	w1, w25, w27
	orr	w28, w26, w24
	mov	x0, x19
	bl	_pixel_color7_slow
	ldr	x8, [x19]
	str	w0, [x8, w28, uxtw #2]
	add	w24, w24, #1
	cmp	w27, #248
	b.lo	LBB0_3
; %bb.4:                                ;   in Loop: Header=BB0_2 Depth=2
	add	w8, w23, #8
	cmp	w23, #248
	mov	x23, x8
	b.lo	LBB0_2
; %bb.5:                                ;   in Loop: Header=BB0_1 Depth=1
	add	w8, w20, #8
	cmp	w20, #248
	mov	x20, x8
	b.lo	LBB0_1
; %bb.6:
	mov	w0, #0
	ldp	x29, x30, [sp, #80]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #64]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #48]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #32]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #16]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp], #96             ; 16-byte Folded Reload
	ret
	.cfi_endproc
                                        ; -- End function
	.no_dead_strip	_update_palette_index
.subsections_via_symbols
