	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function colormap_insert
_colormap_insert:                       ## @colormap_insert
	.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	$56, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%r9, %r12
	movq	%rcx, %rbx
	movq	%rdx, %r13
	movq	%rsi, %r14
	movq	%rdi, %r15
	leaq	-44(%rbp), %rcx
	movq	%rsi, %rdi
	movq	%rbx, %rsi
	movl	%r8d, -48(%rbp)                 ## 4-byte Spill
	movl	%r8d, %edx
	movq	%r9, %r8
	callq	_get_next_color
	testl	%eax, %eax
	js	LBB0_1
## %bb.2:
	movl	(%r13), %edx
	leal	1(%rdx), %ecx
	movl	%ecx, (%r13)
	movl	%eax, %r8d
	movl	(%rbx,%r8,4), %ecx
	movq	%rdx, -80(%rbp)                 ## 8-byte Spill
	movslq	%edx, %rsi
	movl	-44(%rbp), %edi
	movq	%r13, %rdx
	movq	%rbx, %r10
	leaq	(%rsi,%rsi,2), %r13
	movl	%edi, (%r15,%r13,8)
	movl	%eax, 4(%r15,%r13,8)
	movl	%ecx, %eax
	movzbl	%ch, %esi
	movzbl	%cl, %edi
	shrl	$24, %ecx
	movq	8(%r15,%r13,8), %rbx
	movl	%ecx, (%rbx)
	shrl	$16, %eax
	movzbl	%al, %eax
	movl	%eax, 4(%rbx)
	movl	%esi, 8(%rbx)
	movl	%edi, 12(%rbx)
	movl	$1, (%r14,%r8,4)
	movups	(%r12), %xmm0
	movaps	%xmm0, -64(%rbp)
	movups	(%r12), %xmm0
	movaps	%xmm0, -96(%rbp)
	movslq	-44(%rbp), %rax
	movl	(%rbx,%rax,4), %ecx
	movq	-96(%rbp), %rsi
	movl	%ecx, -4(%rsi,%rax,4)
	movslq	-44(%rbp), %rax
	movl	(%rbx,%rax,4), %ecx
	incl	%ecx
	movq	-56(%rbp), %r12
	movl	%ecx, -4(%r12,%rax,4)
	leaq	-96(%rbp), %r9
	movq	%r15, %rdi
	movq	%r14, %rsi
	movq	%rdx, %rbx
	movq	%r10, -72(%rbp)                 ## 8-byte Spill
	movq	%r10, %rcx
	movl	-48(%rbp), %r8d                 ## 4-byte Reload
	callq	_colormap_insert
	movl	%eax, %edi
	movslq	-44(%rbp), %rcx
	movl	-4(%r12,%rcx,4), %edx
	movq	-64(%rbp), %rsi
	movl	$-1, %eax
	cmpl	-4(%rsi,%rcx,4), %edx
	jg	LBB0_4
## %bb.3:
	leaq	-64(%rbp), %r9
	movl	%edi, %r12d
	movq	%r15, %rdi
	movq	%r14, %rsi
	movq	%rbx, %rdx
	movq	-72(%rbp), %rcx                 ## 8-byte Reload
	movl	-48(%rbp), %r8d                 ## 4-byte Reload
	callq	_colormap_insert
	movl	%r12d, %edi
LBB0_4:
	movl	%edi, 16(%r15,%r13,8)
	movl	%eax, 20(%r15,%r13,8)
	movq	-80(%rbp), %rax                 ## 8-byte Reload
	jmp	LBB0_5
LBB0_1:
	movl	$-1, %eax
LBB0_5:
                                        ## kill: def $eax killed $eax killed $rax
	addq	$56, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.no_dead_strip	_colormap_insert
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.section	__TEXT,__literal8,8byte_literals
	.p2align	3                               ; -- Begin function colormap_insert
lCPI0_0:
	.long	4294967280                      ; 0xfffffff0
	.long	4294967288                      ; 0xfffffff8
	.section	__TEXT,__text,regular,pure_instructions
	.p2align	2
_colormap_insert:                       ; @colormap_insert
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #144
	.cfi_def_cfa_offset 144
	stp	x28, x27, [sp, #48]             ; 16-byte Folded Spill
	stp	x26, x25, [sp, #64]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #80]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #96]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #112]            ; 16-byte Folded Spill
	stp	x29, x30, [sp, #128]            ; 16-byte Folded Spill
	add	x29, sp, #128
	.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	x25, x5
	mov	x21, x4
	mov	x22, x3
	mov	x23, x2
	mov	x24, x1
	mov	x19, x0
	add	x3, sp, #44
	mov	x0, x1
	mov	x1, x22
	mov	x2, x4
	mov	x4, x5
	bl	_get_next_color
	tbnz	w0, #31, LBB0_3
; %bb.1:
	ldr	w20, [x23]
	add	w8, w20, #1
	str	w8, [x23]
	mov	w8, w0
	lsl	x8, x8, #2
	ldr	w9, [x22, x8]
	ldr	w10, [sp, #44]
	mov	w11, #24
	smaddl	x11, w20, w11, x19
	stp	w10, w0, [x11]
	lsr	w10, w9, #24
	ldr	x11, [x11, #8]
	str	w10, [x11]
	dup.2s	v0, w9
Lloh0:
	adrp	x10, lCPI0_0@PAGE
Lloh1:
	ldr	d1, [x10, lCPI0_0@PAGEOFF]
	ushl.2s	v0, v0, v1
	movi	d1, #0x0000ff000000ff
	and.8b	v0, v0, v1
	stur	d0, [x11, #4]
	and	w9, w9, #0xff
	str	w9, [x11, #12]
	mov	w9, #1
	str	w9, [x24, x8]
	ldr	q0, [x25]
	stp	q0, q0, [sp]
	ldrsw	x8, [sp, #44]
	lsl	x8, x8, #2
	ldr	w9, [x11, x8]
	sxtw	x26, w20
	ldr	x10, [sp, #16]
	add	x8, x8, x10
	stur	w9, [x8, #-4]
	ldrsw	x8, [sp, #44]
	lsl	x8, x8, #2
	ldr	w9, [x11, x8]
	add	w9, w9, #1
	ldr	x27, [sp, #8]
	add	x8, x8, x27
	stur	w9, [x8, #-4]
	add	x5, sp, #16
	mov	x0, x19
	mov	x1, x24
	mov	x2, x23
	mov	x3, x22
	mov	x4, x21
	bl	_colormap_insert
	mov	x25, x0
	ldrsw	x8, [sp, #44]
	lsl	x8, x8, #2
	sub	x8, x8, #4
	ldr	w9, [x27, x8]
	ldr	x10, [sp]
	ldr	w8, [x10, x8]
	cmp	w9, w8
	b.le	LBB0_4
; %bb.2:
	mov	w0, #-1
	b	LBB0_5
LBB0_3:
	mov	w20, #-1
	b	LBB0_6
LBB0_4:
	mov	x5, sp
	mov	x0, x19
	mov	x1, x24
	mov	x2, x23
	mov	x3, x22
	mov	x4, x21
	bl	_colormap_insert
LBB0_5:
	mov	w8, #24
	madd	x8, x26, x8, x19
	stp	w25, w0, [x8, #16]
LBB0_6:
	mov	x0, x20
	ldp	x29, x30, [sp, #128]            ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #112]            ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #96]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #80]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #64]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp, #48]             ; 16-byte Folded Reload
	add	sp, sp, #144
	ret
	.loh AdrpLdr	Lloh0, Lloh1
	.cfi_endproc
                                        ; -- End function
	.no_dead_strip	_colormap_insert
.subsections_via_symbols
