	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function disp_palette
_disp_palette:                          ## @disp_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	%r15
	pushq	%r14
	pushq	%r13
	pushq	%r12
	pushq	%rbx
	subq	$72, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	(%rdi), %rax
	movq	8(%rdi), %rcx
	movq	(%rcx), %r11
	movl	(%rax), %eax
	sarl	$2, %eax
	movq	8(%rsi), %rcx
	movq	8(%rcx), %rcx
	movslq	%eax, %r9
	movslq	%edx, %r10
	movl	%r10d, %edi
	movq	%r9, %rax
	imulq	%r10, %rax
	movl	%edi, %ebx
	andl	$-8, %ebx
	movq	%rbx, -208(%rbp)                ## 8-byte Spill
	addq	$-8, %rbx
	movq	%rbx, -200(%rbp)                ## 8-byte Spill
	movq	%rbx, %rsi
	shrq	$3, %rsi
	incq	%rsi
	movq	%rsi, %rbx
	movq	%rsi, -192(%rbp)                ## 8-byte Spill
	andq	$-2, %rsi
	movq	%rsi, -184(%rbp)                ## 8-byte Spill
	movl	%edi, %r8d
	andl	$3, %r8d
	leaq	48(%r11), %r14
	movq	%rax, -88(%rbp)                 ## 8-byte Spill
	leaq	(,%rax,4), %rax
	movq	%rax, -80(%rbp)                 ## 8-byte Spill
	movq	%r10, -120(%rbp)                ## 8-byte Spill
	leaq	(,%r10,4), %rax
	movq	%rax, -168(%rbp)                ## 8-byte Spill
	movq	%r9, -72(%rbp)                  ## 8-byte Spill
	leaq	(,%r9,4), %r13
	xorl	%ebx, %ebx
	movq	%r11, %rax
	jmp	LBB0_2
	.p2align	4, 0x90
LBB0_1:                                 ##   in Loop: Header=BB0_2 Depth=1
	movq	-104(%rbp), %rbx                ## 8-byte Reload
	incq	%rbx
	movq	-112(%rbp), %r14                ## 8-byte Reload
	movq	-80(%rbp), %r9                  ## 8-byte Reload
	addq	%r9, %r14
	movq	-96(%rbp), %rax                 ## 8-byte Reload
	addq	%r9, %rax
	cmpq	$16, %rbx
	je	LBB0_24
LBB0_2:                                 ## =>This Loop Header: Depth=1
                                        ##     Child Loop BB0_4 Depth 2
                                        ##       Child Loop BB0_7 Depth 3
                                        ##         Child Loop BB0_14 Depth 4
                                        ##         Child Loop BB0_20 Depth 4
                                        ##         Child Loop BB0_22 Depth 4
	movq	-88(%rbp), %r9                  ## 8-byte Reload
	imulq	%rbx, %r9
	movq	%r9, -160(%rbp)                 ## 8-byte Spill
	leaq	(%r9,%rdi), %rsi
	movq	%rsi, -152(%rbp)                ## 8-byte Spill
	movq	%rbx, %rsi
	shlq	$4, %rsi
	movq	%rsi, -144(%rbp)                ## 8-byte Spill
	incq	%rsi
	movq	%rsi, -136(%rbp)                ## 8-byte Spill
	movq	%rbx, -104(%rbp)                ## 8-byte Spill
	imulq	-72(%rbp), %rbx                 ## 8-byte Folded Reload
	movq	%rbx, -128(%rbp)                ## 8-byte Spill
	movq	%rax, -96(%rbp)                 ## 8-byte Spill
	movq	%rax, -64(%rbp)                 ## 8-byte Spill
	movq	%r14, -112(%rbp)                ## 8-byte Spill
	movq	%r14, -56(%rbp)                 ## 8-byte Spill
	xorl	%eax, %eax
	movq	%rax, -48(%rbp)                 ## 8-byte Spill
	jmp	LBB0_4
	.p2align	4, 0x90
LBB0_3:                                 ##   in Loop: Header=BB0_4 Depth=2
	movq	-48(%rbp), %rsi                 ## 8-byte Reload
	incq	%rsi
	movq	-168(%rbp), %rax                ## 8-byte Reload
	addq	%rax, -56(%rbp)                 ## 8-byte Folded Spill
	addq	%rax, -64(%rbp)                 ## 8-byte Folded Spill
	movq	%rsi, %rax
	movq	%rsi, -48(%rbp)                 ## 8-byte Spill
	cmpq	$16, %rsi
	je	LBB0_1
LBB0_4:                                 ##   Parent Loop BB0_2 Depth=1
                                        ## =>  This Loop Header: Depth=2
                                        ##       Child Loop BB0_7 Depth 3
                                        ##         Child Loop BB0_14 Depth 4
                                        ##         Child Loop BB0_20 Depth 4
                                        ##         Child Loop BB0_22 Depth 4
	testl	%edx, %edx
	jle	LBB0_3
## %bb.5:                               ##   in Loop: Header=BB0_4 Depth=2
	movq	-48(%rbp), %rbx                 ## 8-byte Reload
	movq	%rbx, %rsi
	movq	-120(%rbp), %r9                 ## 8-byte Reload
	imulq	%r9, %rsi
	movq	-160(%rbp), %rax                ## 8-byte Reload
	addq	%rsi, %rax
	movq	%rax, -240(%rbp)                ## 8-byte Spill
	addq	-152(%rbp), %rsi                ## 8-byte Folded Reload
	movq	%rsi, -224(%rbp)                ## 8-byte Spill
	movq	-144(%rbp), %rax                ## 8-byte Reload
	leaq	(%rax,%rbx), %r15
	movq	-136(%rbp), %rax                ## 8-byte Reload
	addq	%rbx, %rax
	leaq	(%rcx,%r15,4), %rsi
	movq	%rsi, -216(%rbp)                ## 8-byte Spill
	leaq	(%rcx,%rax,4), %rax
	movq	%rax, -232(%rbp)                ## 8-byte Spill
	movq	-128(%rbp), %rax                ## 8-byte Reload
	addq	%rbx, %rax
	imulq	%r9, %rax
	movq	%rax, -176(%rbp)                ## 8-byte Spill
	movq	-64(%rbp), %r10                 ## 8-byte Reload
	movq	-56(%rbp), %rsi                 ## 8-byte Reload
	xorl	%r12d, %r12d
	jmp	LBB0_7
	.p2align	4, 0x90
LBB0_6:                                 ##   in Loop: Header=BB0_7 Depth=3
	incq	%r12
	addq	%r13, %rsi
	addq	%r13, %r10
	cmpq	%rdi, %r12
	je	LBB0_3
LBB0_7:                                 ##   Parent Loop BB0_2 Depth=1
                                        ##     Parent Loop BB0_4 Depth=2
                                        ## =>    This Loop Header: Depth=3
                                        ##         Child Loop BB0_14 Depth 4
                                        ##         Child Loop BB0_20 Depth 4
                                        ##         Child Loop BB0_22 Depth 4
	cmpl	$8, %edx
	jb	LBB0_8
## %bb.9:                               ##   in Loop: Header=BB0_7 Depth=3
	movq	%r12, %r14
	imulq	-72(%rbp), %r14                 ## 8-byte Folded Reload
	movq	-240(%rbp), %rax                ## 8-byte Reload
	addq	%r14, %rax
	leaq	(%r11,%rax,4), %rax
	cmpq	-232(%rbp), %rax                ## 8-byte Folded Reload
	jae	LBB0_12
## %bb.10:                              ##   in Loop: Header=BB0_7 Depth=3
	movq	-224(%rbp), %rax                ## 8-byte Reload
	addq	%r14, %rax
	leaq	(%r11,%rax,4), %rax
	cmpq	%rax, -216(%rbp)                ## 8-byte Folded Reload
	jae	LBB0_12
LBB0_8:                                 ##   in Loop: Header=BB0_7 Depth=3
	xorl	%r14d, %r14d
LBB0_18:                                ##   in Loop: Header=BB0_7 Depth=3
	movq	%r14, %rax
	notq	%rax
	addq	%rdi, %rax
	testq	%r8, %r8
	je	LBB0_21
## %bb.19:                              ##   in Loop: Header=BB0_7 Depth=3
	movq	%r8, %rbx
	.p2align	4, 0x90
LBB0_20:                                ##   Parent Loop BB0_2 Depth=1
                                        ##     Parent Loop BB0_4 Depth=2
                                        ##       Parent Loop BB0_7 Depth=3
                                        ## =>      This Inner Loop Header: Depth=4
	movl	(%rcx,%r15,4), %r9d
	movl	%r9d, (%r10,%r14,4)
	incq	%r14
	decq	%rbx
	jne	LBB0_20
LBB0_21:                                ##   in Loop: Header=BB0_7 Depth=3
	cmpq	$3, %rax
	jb	LBB0_6
	.p2align	4, 0x90
LBB0_22:                                ##   Parent Loop BB0_2 Depth=1
                                        ##     Parent Loop BB0_4 Depth=2
                                        ##       Parent Loop BB0_7 Depth=3
                                        ## =>      This Inner Loop Header: Depth=4
	movl	(%rcx,%r15,4), %eax
	movl	%eax, (%r10,%r14,4)
	movl	(%rcx,%r15,4), %eax
	movl	%eax, 4(%r10,%r14,4)
	movl	(%rcx,%r15,4), %eax
	movl	%eax, 8(%r10,%r14,4)
	movl	(%rcx,%r15,4), %eax
	movl	%eax, 12(%r10,%r14,4)
	addq	$4, %r14
	cmpq	%r14, %rdi
	jne	LBB0_22
	jmp	LBB0_6
	.p2align	4, 0x90
LBB0_12:                                ##   in Loop: Header=BB0_7 Depth=3
	cmpq	$0, -200(%rbp)                  ## 8-byte Folded Reload
	je	LBB0_23
## %bb.13:                              ##   in Loop: Header=BB0_7 Depth=3
	movd	(%rcx,%r15,4), %xmm0            ## xmm0 = mem[0],zero,zero,zero
	pshufd	$0, %xmm0, %xmm0                ## xmm0 = xmm0[0,0,0,0]
	movq	-184(%rbp), %rax                ## 8-byte Reload
	xorl	%ebx, %ebx
	.p2align	4, 0x90
LBB0_14:                                ##   Parent Loop BB0_2 Depth=1
                                        ##     Parent Loop BB0_4 Depth=2
                                        ##       Parent Loop BB0_7 Depth=3
                                        ## =>      This Inner Loop Header: Depth=4
	movdqu	%xmm0, -48(%rsi,%rbx,4)
	movdqu	%xmm0, -32(%rsi,%rbx,4)
	movdqu	%xmm0, -16(%rsi,%rbx,4)
	movdqu	%xmm0, (%rsi,%rbx,4)
	addq	$16, %rbx
	addq	$-2, %rax
	jne	LBB0_14
## %bb.15:                              ##   in Loop: Header=BB0_7 Depth=3
	testb	$1, -192(%rbp)                  ## 1-byte Folded Reload
	je	LBB0_17
LBB0_16:                                ##   in Loop: Header=BB0_7 Depth=3
	addq	-176(%rbp), %r14                ## 8-byte Folded Reload
	movd	(%rcx,%r15,4), %xmm0            ## xmm0 = mem[0],zero,zero,zero
	pshufd	$0, %xmm0, %xmm0                ## xmm0 = xmm0[0,0,0,0]
	addq	%rbx, %r14
	movdqu	%xmm0, (%r11,%r14,4)
	movdqu	%xmm0, 16(%r11,%r14,4)
LBB0_17:                                ##   in Loop: Header=BB0_7 Depth=3
	movq	-208(%rbp), %rax                ## 8-byte Reload
	movq	%rax, %r14
	cmpq	%rdi, %rax
	je	LBB0_6
	jmp	LBB0_18
LBB0_23:                                ##   in Loop: Header=BB0_7 Depth=3
	xorl	%ebx, %ebx
	testb	$1, -192(%rbp)                  ## 1-byte Folded Reload
	jne	LBB0_16
	jmp	LBB0_17
LBB0_24:
	xorl	%eax, %eax
	addq	$72, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.no_dead_strip	_disp_palette
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function disp_palette
_disp_palette:                          ; @disp_palette
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #128
	.cfi_def_cfa_offset 128
	stp	x28, x27, [sp, #32]             ; 16-byte Folded Spill
	stp	x26, x25, [sp, #48]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #64]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #80]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #96]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #112]            ; 16-byte Folded Spill
	.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
                                        ; kill: def $w2 killed $w2 def $x2
	mov	x20, #0
	mov	x9, #0
	ldp	x11, x10, [x0]
	ldr	x10, [x10]
	ldr	w11, [x11]
	asr	w14, w11, #2
	ldr	x15, [x1, #8]
	sbfx	x11, x11, #2, #30
	sxtw	x12, w2
	mov	w13, w2
	smull	x8, w14, w2
	lsl	x16, x8, #2
	stp	x16, x8, [sp, #8]               ; 16-byte Folded Spill
	ldr	x16, [x15, #8]
	and	x17, x13, #0xfffffff0
	add	x0, x10, #32
	sbfiz	x1, x2, #2, #32
	sbfiz	x3, x14, #2, #32
	b	LBB0_2
LBB0_1:                                 ;   in Loop: Header=BB0_2 Depth=1
	add	x9, x9, #1
	ldr	x8, [sp, #8]                    ; 8-byte Folded Reload
	add	x0, x0, x8
	ldp	x8, x20, [sp, #16]              ; 16-byte Folded Reload
	add	x20, x20, x8
	cmp	x9, #16
	b.eq	LBB0_15
LBB0_2:                                 ; =>This Loop Header: Depth=1
                                        ;     Child Loop BB0_4 Depth 2
                                        ;       Child Loop BB0_7 Depth 3
                                        ;         Child Loop BB0_10 Depth 4
                                        ;         Child Loop BB0_14 Depth 4
	mov	x4, #0
	mul	x5, x8, x9
	add	x6, x5, x13
	lsl	x7, x9, #4
	mov	w19, #1
	bfi	x19, x9, #4, #60
	str	x20, [sp, #24]                  ; 8-byte Folded Spill
	mov	x21, x0
	b	LBB0_4
LBB0_3:                                 ;   in Loop: Header=BB0_4 Depth=2
	add	x4, x4, #1
	add	x21, x21, x1
	add	x20, x20, x12
	cmp	x4, #16
	b.eq	LBB0_1
LBB0_4:                                 ;   Parent Loop BB0_2 Depth=1
                                        ; =>  This Loop Header: Depth=2
                                        ;       Child Loop BB0_7 Depth 3
                                        ;         Child Loop BB0_10 Depth 4
                                        ;         Child Loop BB0_14 Depth 4
	cmp	w2, #1
	b.lt	LBB0_3
; %bb.5:                                ;   in Loop: Header=BB0_4 Depth=2
	mov	x22, #0
	mul	x14, x4, x12
	add	x23, x5, x14
	add	x24, x6, x14
	add	x14, x7, x4
	add	x25, x16, x14, lsl #2
	add	x14, x19, x4
	add	x26, x16, x14, lsl #2
	add	x27, x4, x7
	mov	x28, x20
	mov	x30, x21
	b	LBB0_7
LBB0_6:                                 ;   in Loop: Header=BB0_7 Depth=3
	add	x22, x22, #1
	add	x30, x30, x3
	add	x28, x28, x11
	cmp	x22, x13
	b.eq	LBB0_3
LBB0_7:                                 ;   Parent Loop BB0_2 Depth=1
                                        ;     Parent Loop BB0_4 Depth=2
                                        ; =>    This Loop Header: Depth=3
                                        ;         Child Loop BB0_10 Depth 4
                                        ;         Child Loop BB0_14 Depth 4
	cmp	w2, #16
	b.lo	LBB0_12
; %bb.8:                                ;   in Loop: Header=BB0_7 Depth=3
	mul	x14, x22, x11
	add	x15, x24, x14
	add	x15, x10, x15, lsl #2
	add	x14, x23, x14
	add	x14, x10, x14, lsl #2
	cmp	x14, x26
	ccmp	x25, x15, #2, lo
	b.lo	LBB0_12
; %bb.9:                                ;   in Loop: Header=BB0_7 Depth=3
	add	x14, x16, x27, lsl #2
	ld1r.4s	{ v0 }, [x14]
	mov	x15, x17
	mov	x14, x30
LBB0_10:                                ;   Parent Loop BB0_2 Depth=1
                                        ;     Parent Loop BB0_4 Depth=2
                                        ;       Parent Loop BB0_7 Depth=3
                                        ; =>      This Inner Loop Header: Depth=4
	stp	q0, q0, [x14, #-32]
	stp	q0, q0, [x14], #64
	subs	x15, x15, #16
	b.ne	LBB0_10
; %bb.11:                               ;   in Loop: Header=BB0_7 Depth=3
	mov	x14, x17
	cmp	x17, x13
	b.eq	LBB0_6
	b	LBB0_13
LBB0_12:                                ;   in Loop: Header=BB0_7 Depth=3
	mov	x14, #0
LBB0_13:                                ;   in Loop: Header=BB0_7 Depth=3
	add	x15, x14, x28
	add	x15, x10, x15, lsl #2
	sub	x14, x13, x14
LBB0_14:                                ;   Parent Loop BB0_2 Depth=1
                                        ;     Parent Loop BB0_4 Depth=2
                                        ;       Parent Loop BB0_7 Depth=3
                                        ; =>      This Inner Loop Header: Depth=4
	ldr	w8, [x16, x27, lsl #2]
	str	w8, [x15], #4
	subs	x14, x14, #1
	b.ne	LBB0_14
	b	LBB0_6
LBB0_15:
	mov	w0, #0
	ldp	x29, x30, [sp, #112]            ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #96]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #80]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #64]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #48]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp, #32]             ; 16-byte Folded Reload
	add	sp, sp, #128
	ret
	.cfi_endproc
                                        ; -- End function
	.no_dead_strip	_disp_palette
.subsections_via_symbols
