	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.section	__TEXT,__literal16,16byte_literals
	.p2align	4                               ## -- Begin function lodepng_auto_choose_color
LCPI0_0:
	.long	1                               ## 0x1
	.long	1                               ## 0x1
	.long	1                               ## 0x1
	.long	1                               ## 0x1
	.section	__TEXT,__text,regular,pure_instructions
	.globl	_lodepng_auto_choose_color
	.p2align	4, 0x90
_lodepng_auto_choose_color:             ## @lodepng_auto_choose_color
	.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	$104, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%r9, %r13
	movq	_LAC_AUTO_NO_NIBBLES@GOTPCREL(%rip), %rax
	cmpq	%r9, (%rax)
	sete	-43(%rbp)                       ## 1-byte Folded Spill
	movq	_LAC_AUTO_NO_NIBBLES_NO_PALETTE@GOTPCREL(%rip), %rax
	cmpq	%r9, (%rax)
	sete	%r9b
	movq	_LAC_AUTO_NO_PALETTE@GOTPCREL(%rip), %rax
	cmpq	%r13, (%rax)
	sete	%r10b
	movq	_LAC_ALPHA@GOTPCREL(%rip), %r15
	cmpq	%r13, (%r15)
	jne	LBB0_3
## %bb.1:
	movq	(%rdi), %r14
	movq	_LCT_RGBA@GOTPCREL(%rip), %rax
	cmpq	(%rax), %r14
	je	LBB0_3
## %bb.2:
	xorl	%eax, %eax
	movq	_LCT_GREY_ALPHA@GOTPCREL(%rip), %rbx
	cmpq	(%rbx), %r14
	jne	LBB0_74
LBB0_3:
	movl	%ecx, %r12d
	movl	%edx, %ebx
	movq	%rsi, -64(%rbp)                 ## 8-byte Spill
	movb	%r10b, -42(%rbp)                ## 1-byte Spill
	movb	%r9b, -41(%rbp)                 ## 1-byte Spill
	movq	%rdi, -56(%rbp)                 ## 8-byte Spill
	leaq	-144(%rbp), %rdi
	movq	%r8, %rsi
	movq	%r8, %r14
	callq	_color_profile_init
	cmpq	%r13, (%r15)
	jne	LBB0_5
## %bb.4:
	movaps	LCPI0_0(%rip), %xmm0            ## xmm0 = [1,1,1,1]
	movaps	%xmm0, -144(%rbp)
LBB0_5:
	imull	%ebx, %r12d
	leaq	-144(%rbp), %rdi
	movq	-64(%rbp), %rsi                 ## 8-byte Reload
	movl	%r12d, %edx
	movq	%r14, -64(%rbp)                 ## 8-byte Spill
	movq	%r14, %rcx
	xorl	%r8d, %r8d
	callq	_get_color_profile
	movl	%eax, %r14d
	movq	_LAC_ALPHA@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	testl	%r14d, %r14d
	jne	LBB0_10
## %bb.6:
	cmpq	%r13, %rax
	jne	LBB0_10
## %bb.7:
	xorl	%r14d, %r14d
	cmpq	$0, -80(%rbp)
	jne	LBB0_53
## %bb.8:
	movq	-56(%rbp), %rdi                 ## 8-byte Reload
	movq	(%rdi), %rax
	movq	_LCT_RGBA@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jne	LBB0_16
## %bb.9:
	movq	_LCT_RGB@GOTPCREL(%rip), %rax
	jmp	LBB0_17
LBB0_10:
	testl	%r14d, %r14d
	jne	LBB0_53
## %bb.11:
	cmpq	%r13, %rax
	je	LBB0_53
## %bb.12:
	movq	-56(%rbp), %rdi                 ## 8-byte Reload
	movq	$0, 32(%rdi)
	cmpq	$0, -72(%rbp)
	je	LBB0_19
## %bb.13:
	movl	$16, 8(%rdi)
	cmpq	$0, -80(%rbp)
	movq	-88(%rbp), %rax
	je	LBB0_34
## %bb.14:
	testq	%rax, %rax
	jne	LBB0_15
LBB0_38:
	movq	_LCT_GREY_ALPHA@GOTPCREL(%rip), %rax
	jmp	LBB0_39
LBB0_16:
	movq	_LCT_GREY@GOTPCREL(%rip), %rax
LBB0_17:
	movq	(%rax), %rax
	movq	%rax, (%rdi)
	cmpq	$0, -96(%rbp)
	je	LBB0_53
## %bb.18:
	movl	-128(%rbp), %esi
	movl	-124(%rbp), %edx
	movl	-120(%rbp), %ecx
	movl	8(%rdi), %r8d
	jmp	LBB0_52
LBB0_19:
	xorl	%r8d, %r8d
	movb	-42(%rbp), %al                  ## 1-byte Reload
	orb	-41(%rbp), %al                  ## 1-byte Folded Reload
	movl	-116(%rbp), %ecx
	jne	LBB0_22
## %bb.20:
	cmpl	$256, %ecx                      ## imm = 0x100
	ja	LBB0_22
## %bb.21:
	leal	(%rcx,%rcx), %eax
	cmpl	%r12d, %eax
	setb	%r8b
LBB0_22:
	movl	$1, %r14d
	cmpl	$3, %ecx
	jb	LBB0_25
## %bb.23:
	movl	$2, %r14d
	cmpl	$5, %ecx
	jb	LBB0_25
## %bb.24:
	xorl	%edx, %edx
	cmpl	$17, %ecx
	setae	%dl
	leal	4(,%rdx,4), %r14d
LBB0_25:
	movq	-88(%rbp), %rcx
	movq	-80(%rbp), %rdx
	movq	%rcx, %rsi
	orq	%rdx, %rsi
	sete	%bl
	movl	%r8d, %eax
	orb	%bl, %al
	cmpb	$1, %al
	jne	LBB0_36
## %bb.26:
	testb	%r8b, %r8b
	je	LBB0_43
## %bb.27:
	testb	%bl, %bl
	je	LBB0_29
## %bb.28:
	movl	-112(%rbp), %r8d
	cmpl	%r14d, %r8d
	jbe	LBB0_44
LBB0_29:
	movq	-104(%rbp), %r15
	callq	_lodepng_palette_clear
	cmpl	$0, -116(%rbp)
	je	LBB0_75
## %bb.30:
	movl	$3, %ebx
	xorl	%r12d, %r12d
	movq	-56(%rbp), %rdi                 ## 8-byte Reload
LBB0_31:                                ## =>This Inner Loop Header: Depth=1
	leal	-3(%rbx), %eax
	movzbl	(%r15,%rax), %esi
	leal	-2(%rbx), %eax
	movzbl	(%r15,%rax), %edx
	leal	-1(%rbx), %eax
	movzbl	(%r15,%rax), %ecx
	movl	%ebx, %eax
	movzbl	(%r15,%rax), %r8d
	callq	_lodepng_palette_add
	testl	%eax, %eax
	jne	LBB0_76
## %bb.32:                              ##   in Loop: Header=BB0_31 Depth=1
	incq	%r12
	movl	-116(%rbp), %eax
	addl	$4, %ebx
	cmpq	%rax, %r12
	movq	-56(%rbp), %rdi                 ## 8-byte Reload
	jb	LBB0_31
## %bb.33:
	xorl	%ecx, %ecx
	jmp	LBB0_78
LBB0_34:
	testq	%rax, %rax
	jne	LBB0_40
## %bb.35:
	movq	_LCT_GREY@GOTPCREL(%rip), %rax
	jmp	LBB0_41
LBB0_36:
	movl	$8, 8(%rdi)
	testq	%rdx, %rdx
	je	LBB0_46
## %bb.37:
	testq	%rcx, %rcx
	je	LBB0_38
LBB0_15:
	movq	_LCT_RGBA@GOTPCREL(%rip), %rax
LBB0_39:
	movq	(%rax), %rax
	movq	%rax, (%rdi)
	xorl	%r14d, %r14d
	jmp	LBB0_53
LBB0_40:
	movq	_LCT_RGB@GOTPCREL(%rip), %rax
LBB0_41:
	movq	(%rax), %rax
	movq	%rax, (%rdi)
	xorl	%r14d, %r14d
	cmpq	$0, -96(%rbp)
	je	LBB0_53
## %bb.42:
	movl	-128(%rbp), %esi
	movl	-124(%rbp), %edx
	movl	-120(%rbp), %ecx
	movl	$16, %r8d
	jmp	LBB0_52
LBB0_43:
	movl	-112(%rbp), %r8d
LBB0_44:
	movl	-128(%rbp), %ecx
	movq	_LCT_GREY@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	%rax, (%rdi)
	movl	%r8d, 8(%rdi)
	xorl	%r14d, %r14d
	cmpq	$0, -96(%rbp)
	je	LBB0_53
## %bb.45:
	movl	%ecx, %esi
	movl	%ecx, %edx
	jmp	LBB0_52
LBB0_46:
	testq	%rcx, %rcx
	jne	LBB0_49
## %bb.47:
	movq	_LCT_GREY@GOTPCREL(%rip), %rax
	jmp	LBB0_50
LBB0_49:
	movq	_LCT_RGB@GOTPCREL(%rip), %rax
LBB0_50:
	movq	(%rax), %rax
	movq	%rax, (%rdi)
	xorl	%r14d, %r14d
	cmpq	$0, -96(%rbp)
	je	LBB0_53
## %bb.51:
	movl	-128(%rbp), %esi
	movl	-124(%rbp), %edx
	movl	-120(%rbp), %ecx
	movl	$8, %r8d
LBB0_52:
	callq	_setColorKeyFrom16bit
LBB0_53:
	movl	%r14d, %r15d
	movb	-43(%rbp), %r14b                ## 1-byte Reload
	orb	-41(%rbp), %r14b                ## 1-byte Folded Reload
	leaq	-144(%rbp), %rdi
	callq	_color_profile_cleanup
	movq	-56(%rbp), %r10                 ## 8-byte Reload
	movq	(%r10), %rax
	movq	_LCT_PALETTE@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	movq	-64(%rbp), %rax                 ## 8-byte Reload
	jne	LBB0_70
## %bb.54:
	movq	16(%rax), %rdx
	cmpq	16(%r10), %rdx
	jne	LBB0_70
## %bb.55:
	testq	%rdx, %rdx
	je	LBB0_70
## %bb.56:
	shlq	$2, %rdx
	movq	24(%rax), %rax
	movq	24(%r10), %rcx
	cmpq	$2, %rdx
	movl	$1, %r8d
	cmovaeq	%rdx, %r8
	xorl	%esi, %esi
	cmpq	$8, %r8
	jb	LBB0_66
## %bb.57:
	movq	%rcx, %rdx
	subq	%rax, %rdx
	cmpq	$32, %rdx
	jb	LBB0_66
## %bb.58:
	movq	%r8, %rsi
	andq	$-8, %rsi
	leaq	-8(%rsi), %rdx
	movq	%rdx, %rdi
	shrq	$3, %rdi
	incq	%rdi
	movl	%edi, %r9d
	andl	$3, %r9d
	cmpq	$24, %rdx
	jae	LBB0_60
## %bb.59:
	xorl	%edx, %edx
	jmp	LBB0_62
LBB0_60:
	andq	$-4, %rdi
	xorl	%edx, %edx
	.p2align	4, 0x90
LBB0_61:                                ## =>This Inner Loop Header: Depth=1
	movups	(%rax,%rdx,4), %xmm0
	movups	16(%rax,%rdx,4), %xmm1
	movups	%xmm0, (%rcx,%rdx,4)
	movups	%xmm1, 16(%rcx,%rdx,4)
	movups	32(%rax,%rdx,4), %xmm0
	movups	48(%rax,%rdx,4), %xmm1
	movups	%xmm0, 32(%rcx,%rdx,4)
	movups	%xmm1, 48(%rcx,%rdx,4)
	movups	64(%rax,%rdx,4), %xmm0
	movups	80(%rax,%rdx,4), %xmm1
	movups	%xmm0, 64(%rcx,%rdx,4)
	movups	%xmm1, 80(%rcx,%rdx,4)
	movups	96(%rax,%rdx,4), %xmm0
	movups	112(%rax,%rdx,4), %xmm1
	movups	%xmm0, 96(%rcx,%rdx,4)
	movups	%xmm1, 112(%rcx,%rdx,4)
	addq	$32, %rdx
	addq	$-4, %rdi
	jne	LBB0_61
LBB0_62:
	testq	%r9, %r9
	je	LBB0_65
## %bb.63:
	leaq	(%rcx,%rdx,4), %rdi
	addq	$16, %rdi
	leaq	(%rax,%rdx,4), %rdx
	addq	$16, %rdx
	shlq	$5, %r9
	xorl	%ebx, %ebx
	.p2align	4, 0x90
LBB0_64:                                ## =>This Inner Loop Header: Depth=1
	movups	-16(%rdx,%rbx), %xmm0
	movups	(%rdx,%rbx), %xmm1
	movups	%xmm0, -16(%rdi,%rbx)
	movups	%xmm1, (%rdi,%rbx)
	addq	$32, %rbx
	cmpq	%rbx, %r9
	jne	LBB0_64
LBB0_65:
	cmpq	%rsi, %r8
	je	LBB0_70
LBB0_66:
	movq	%rsi, %rdx
	notq	%rdx
	addq	%r8, %rdx
	movq	%r8, %rdi
	andq	$1, %rdi
	je	LBB0_68
	.p2align	4, 0x90
LBB0_67:                                ## =>This Inner Loop Header: Depth=1
	movl	(%rax,%rsi,4), %ebx
	movl	%ebx, (%rcx,%rsi,4)
	incq	%rsi
	decq	%rdi
	jne	LBB0_67
LBB0_68:
	cmpq	$3, %rdx
	jb	LBB0_70
	.p2align	4, 0x90
LBB0_69:                                ## =>This Inner Loop Header: Depth=1
	movl	(%rax,%rsi,4), %edx
	movl	%edx, (%rcx,%rsi,4)
	movl	4(%rax,%rsi,4), %edx
	movl	%edx, 4(%rcx,%rsi,4)
	movl	8(%rax,%rsi,4), %edx
	movl	%edx, 8(%rcx,%rsi,4)
	movl	12(%rax,%rsi,4), %edx
	movl	%edx, 12(%rcx,%rsi,4)
	addq	$4, %rsi
	cmpq	%rsi, %r8
	jne	LBB0_69
LBB0_70:
	testb	%r14b, %r14b
	je	LBB0_73
## %bb.71:
	cmpl	$7, 8(%r10)
	jg	LBB0_73
## %bb.72:
	movl	$8, 8(%r10)
LBB0_73:
	movl	%r15d, %eax
LBB0_74:
	addq	$104, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_75:
	xorl	%ecx, %ecx
	jmp	LBB0_77
LBB0_76:
	movl	%eax, %ecx
LBB0_77:
	movq	-56(%rbp), %rdi                 ## 8-byte Reload
LBB0_78:
	movq	_LCT_PALETTE@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	%rax, (%rdi)
	movl	%r14d, 8(%rdi)
	movl	%ecx, %r14d
	jmp	LBB0_53
	.cfi_endproc
                                        ## -- End function
	.comm	_LAC_AUTO_NO_NIBBLES,8,3        ## @LAC_AUTO_NO_NIBBLES
	.comm	_LAC_AUTO_NO_NIBBLES_NO_PALETTE,8,3 ## @LAC_AUTO_NO_NIBBLES_NO_PALETTE
	.comm	_LAC_AUTO_NO_PALETTE,8,3        ## @LAC_AUTO_NO_PALETTE
	.comm	_LAC_ALPHA,8,3                  ## @LAC_ALPHA
	.comm	_LCT_RGBA,8,3                   ## @LCT_RGBA
	.comm	_LCT_GREY_ALPHA,8,3             ## @LCT_GREY_ALPHA
	.comm	_LCT_RGB,8,3                    ## @LCT_RGB
	.comm	_LCT_GREY,8,3                   ## @LCT_GREY
	.comm	_LCT_PALETTE,8,3                ## @LCT_PALETTE
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_lodepng_auto_choose_color      ; -- Begin function lodepng_auto_choose_color
	.p2align	2
_lodepng_auto_choose_color:             ; @lodepng_auto_choose_color
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #176
	.cfi_def_cfa_offset 176
	stp	x28, x27, [sp, #80]             ; 16-byte Folded Spill
	stp	x26, x25, [sp, #96]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #112]            ; 16-byte Folded Spill
	stp	x22, x21, [sp, #128]            ; 16-byte Folded Spill
	stp	x20, x19, [sp, #144]            ; 16-byte Folded Spill
	stp	x29, x30, [sp, #160]            ; 16-byte Folded Spill
	add	x29, sp, #160
	.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	x22, x5
	mov	x20, x4
	mov	x23, x3
	mov	x24, x2
	mov	x21, x1
	mov	x19, x0
Lloh0:
	adrp	x8, _LAC_AUTO_NO_NIBBLES@GOTPAGE
Lloh1:
	ldr	x8, [x8, _LAC_AUTO_NO_NIBBLES@GOTPAGEOFF]
Lloh2:
	ldr	x8, [x8]
	cmp	x8, x5
	cset	w25, eq
Lloh3:
	adrp	x8, _LAC_AUTO_NO_NIBBLES_NO_PALETTE@GOTPAGE
Lloh4:
	ldr	x8, [x8, _LAC_AUTO_NO_NIBBLES_NO_PALETTE@GOTPAGEOFF]
Lloh5:
	ldr	x8, [x8]
	cmp	x8, x5
	cset	w26, eq
Lloh6:
	adrp	x8, _LAC_AUTO_NO_PALETTE@GOTPAGE
Lloh7:
	ldr	x8, [x8, _LAC_AUTO_NO_PALETTE@GOTPAGEOFF]
Lloh8:
	ldr	x8, [x8]
	cmp	x8, x5
	cset	w27, eq
Lloh9:
	adrp	x28, _LAC_ALPHA@GOTPAGE
Lloh10:
	ldr	x28, [x28, _LAC_ALPHA@GOTPAGEOFF]
	ldr	x8, [x28]
	cmp	x8, x5
	b.ne	LBB0_2
; %bb.1:
	ldr	x8, [x19]
Lloh11:
	adrp	x9, _LCT_RGBA@GOTPAGE
Lloh12:
	ldr	x9, [x9, _LCT_RGBA@GOTPAGEOFF]
Lloh13:
	ldr	x9, [x9]
Lloh14:
	adrp	x10, _LCT_GREY_ALPHA@GOTPAGE
Lloh15:
	ldr	x10, [x10, _LCT_GREY_ALPHA@GOTPAGEOFF]
Lloh16:
	ldr	x10, [x10]
	cmp	x8, x9
	ccmp	x8, x10, #4, ne
	b.ne	LBB0_14
LBB0_2:
	mov	x0, sp
	mov	x1, x20
	bl	_color_profile_init
	ldr	x8, [x28]
	cmp	x8, x22
	b.ne	LBB0_4
; %bb.3:
	movi.4s	v0, #1
	str	q0, [sp]
LBB0_4:
	mul	w23, w23, w24
	mov	x0, sp
	mov	x1, x21
	mov	x2, x23
	mov	x3, x20
	mov	w4, #0
	bl	_get_color_profile
	mov	x21, x0
	ldr	x8, [x28]
Lloh17:
	adrp	x24, _LCT_PALETTE@GOTPAGE
Lloh18:
	ldr	x24, [x24, _LCT_PALETTE@GOTPAGEOFF]
	cbnz	w0, LBB0_9
; %bb.5:
	cmp	x8, x22
	b.ne	LBB0_9
; %bb.6:
	ldr	x8, [sp, #64]
	cbnz	x8, LBB0_43
; %bb.7:
	ldr	x8, [x19]
Lloh19:
	adrp	x9, _LCT_RGBA@GOTPAGE
Lloh20:
	ldr	x9, [x9, _LCT_RGBA@GOTPAGEOFF]
Lloh21:
	adrp	x10, _LCT_RGB@GOTPAGE
Lloh22:
	ldr	x10, [x10, _LCT_RGB@GOTPAGEOFF]
Lloh23:
	adrp	x11, _LCT_GREY@GOTPAGE
Lloh24:
	ldr	x11, [x11, _LCT_GREY@GOTPAGEOFF]
Lloh25:
	ldr	x9, [x9]
	cmp	x8, x9
	csel	x8, x10, x11, eq
	ldr	x8, [x8]
	str	x8, [x19]
	ldr	x8, [sp, #48]
	cbz	x8, LBB0_43
; %bb.8:
	ldp	w1, w2, [sp, #16]
	ldr	w3, [sp, #24]
	ldr	w4, [x19, #8]
	mov	x0, x19
	b	LBB0_42
LBB0_9:
	cbnz	w21, LBB0_44
; %bb.10:
	cmp	x8, x22
	b.eq	LBB0_44
; %bb.11:
	str	xzr, [x19, #32]
	ldr	x8, [sp, #72]
	cbz	x8, LBB0_15
; %bb.12:
	mov	w8, #16
	str	w8, [x19, #8]
	ldp	x8, x9, [sp, #56]
	cbz	x9, LBB0_20
; %bb.13:
	mov	w21, #0
Lloh26:
	adrp	x9, _LCT_RGBA@GOTPAGE
Lloh27:
	ldr	x9, [x9, _LCT_RGBA@GOTPAGEOFF]
Lloh28:
	adrp	x10, _LCT_GREY_ALPHA@GOTPAGE
Lloh29:
	ldr	x10, [x10, _LCT_GREY_ALPHA@GOTPAGEOFF]
	cmp	x8, #0
	csel	x8, x10, x9, eq
	b	LBB0_36
LBB0_14:
	mov	w21, #0
	b	LBB0_57
LBB0_15:
	orr	w10, w27, w26
	ldr	w9, [sp, #28]
	tbnz	w10, #0, LBB0_18
; %bb.16:
	cmp	w9, #256
	b.hi	LBB0_18
; %bb.17:
	cmp	w23, w9, lsl #1
	cset	w8, hi
LBB0_18:
	cmp	w9, #3
	b.hs	LBB0_22
; %bb.19:
	mov	w22, #1
	b	LBB0_25
LBB0_20:
Lloh30:
	adrp	x9, _LCT_RGB@GOTPAGE
Lloh31:
	ldr	x9, [x9, _LCT_RGB@GOTPAGEOFF]
Lloh32:
	adrp	x10, _LCT_GREY@GOTPAGE
Lloh33:
	ldr	x10, [x10, _LCT_GREY@GOTPAGEOFF]
	cmp	x8, #0
	csel	x8, x10, x9, eq
	ldr	x8, [x8]
	str	x8, [x19]
	ldr	x8, [sp, #48]
	cbz	x8, LBB0_43
; %bb.21:
	ldp	w1, w2, [sp, #16]
	ldr	w3, [sp, #24]
	mov	x0, x19
	mov	w4, #16
	b	LBB0_42
LBB0_22:
	cmp	w9, #5
	b.hs	LBB0_24
; %bb.23:
	mov	w22, #2
	b	LBB0_25
LBB0_24:
	mov	w10, #8
	mov	w11, #4
	cmp	w9, #17
	csel	w22, w11, w10, lo
LBB0_25:
	ldp	x9, x10, [sp, #56]
	orr	x11, x9, x10
	cmp	x11, #0
	cset	w11, eq
	orr	w12, w8, w11
	cmp	w12, #1
	b.ne	LBB0_34
; %bb.26:
	tbz	w8, #0, LBB0_37
; %bb.27:
	cbz	w11, LBB0_29
; %bb.28:
	ldr	w4, [sp, #32]
	cmp	w4, w22
	b.ls	LBB0_38
LBB0_29:
	ldr	x23, [sp, #40]
	mov	x0, x19
	bl	_lodepng_palette_clear
	ldr	w8, [sp, #28]
	cbz	w8, LBB0_33
; %bb.30:
	mov	x27, #0
	mov	w28, #3
LBB0_31:                                ; =>This Inner Loop Header: Depth=1
	sub	w8, w28, #3
	ldrb	w1, [x23, w8, uxtw]
	sub	w8, w28, #2
	ldrb	w2, [x23, w8, uxtw]
	sub	w8, w28, #1
	ldrb	w3, [x23, w8, uxtw]
	ldrb	w4, [x23, w28, uxtw]
	mov	x0, x19
	bl	_lodepng_palette_add
	cbnz	w0, LBB0_58
; %bb.32:                               ;   in Loop: Header=BB0_31 Depth=1
	add	x27, x27, #1
	ldr	w8, [sp, #28]
	add	w28, w28, #4
	cmp	x27, x8
	b.lo	LBB0_31
LBB0_33:
	mov	w21, #0
	b	LBB0_59
LBB0_34:
	mov	w8, #8
	str	w8, [x19, #8]
	cbz	x10, LBB0_40
; %bb.35:
	mov	w21, #0
Lloh34:
	adrp	x8, _LCT_RGBA@GOTPAGE
Lloh35:
	ldr	x8, [x8, _LCT_RGBA@GOTPAGEOFF]
Lloh36:
	adrp	x10, _LCT_GREY_ALPHA@GOTPAGE
Lloh37:
	ldr	x10, [x10, _LCT_GREY_ALPHA@GOTPAGEOFF]
	cmp	x9, #0
	csel	x8, x10, x8, eq
LBB0_36:
	ldr	x8, [x8]
	str	x8, [x19]
	b	LBB0_44
LBB0_37:
	ldr	w4, [sp, #32]
LBB0_38:
	ldr	w1, [sp, #16]
Lloh38:
	adrp	x8, _LCT_GREY@GOTPAGE
Lloh39:
	ldr	x8, [x8, _LCT_GREY@GOTPAGEOFF]
Lloh40:
	ldr	x8, [x8]
	str	x8, [x19]
	str	w4, [x19, #8]
	ldr	x8, [sp, #48]
	cbz	x8, LBB0_43
; %bb.39:
	mov	x0, x19
	mov	x2, x1
	mov	x3, x1
	b	LBB0_42
LBB0_40:
Lloh41:
	adrp	x8, _LCT_RGB@GOTPAGE
Lloh42:
	ldr	x8, [x8, _LCT_RGB@GOTPAGEOFF]
Lloh43:
	adrp	x10, _LCT_GREY@GOTPAGE
Lloh44:
	ldr	x10, [x10, _LCT_GREY@GOTPAGEOFF]
	cmp	x9, #0
	csel	x8, x10, x8, eq
	ldr	x8, [x8]
	str	x8, [x19]
	ldr	x8, [sp, #48]
	cbz	x8, LBB0_43
; %bb.41:
	ldp	w1, w2, [sp, #16]
	ldr	w3, [sp, #24]
	mov	x0, x19
	mov	w4, #8
LBB0_42:
	bl	_setColorKeyFrom16bit
LBB0_43:
	mov	w21, #0
LBB0_44:
	orr	w22, w25, w26
	mov	x0, sp
	bl	_color_profile_cleanup
	ldr	x8, [x19]
	ldr	x9, [x24]
	cmp	x8, x9
	b.ne	LBB0_54
; %bb.45:
	ldr	x8, [x20, #16]
	ldr	x9, [x19, #16]
	cmp	x8, x9
	b.ne	LBB0_54
; %bb.46:
	cbz	x8, LBB0_54
; %bb.47:
	mov	x9, #0
	lsl	x11, x8, #2
	ldr	x8, [x20, #24]
	ldr	x10, [x19, #24]
	cmp	x11, #1
	csinc	x11, x11, xzr, hi
	cmp	x11, #16
	b.lo	LBB0_52
; %bb.48:
	sub	x12, x10, x8
	cmp	x12, #64
	b.lo	LBB0_52
; %bb.49:
	and	x9, x11, #0xfffffffffffffff0
	add	x12, x10, #32
	add	x13, x8, #32
	mov	x14, x9
LBB0_50:                                ; =>This Inner Loop Header: Depth=1
	ldp	q0, q1, [x13, #-32]
	ldp	q2, q3, [x13], #64
	stp	q0, q1, [x12, #-32]
	stp	q2, q3, [x12], #64
	subs	x14, x14, #16
	b.ne	LBB0_50
; %bb.51:
	cmp	x11, x9
	b.eq	LBB0_54
LBB0_52:
	sub	x11, x11, x9
	lsl	x12, x9, #2
	add	x9, x10, x12
	add	x8, x8, x12
LBB0_53:                                ; =>This Inner Loop Header: Depth=1
	ldr	w10, [x8], #4
	str	w10, [x9], #4
	subs	x11, x11, #1
	b.ne	LBB0_53
LBB0_54:
	cbz	w22, LBB0_57
; %bb.55:
	ldr	w8, [x19, #8]
	cmp	w8, #7
	b.gt	LBB0_57
; %bb.56:
	mov	w8, #8
	str	w8, [x19, #8]
LBB0_57:
	mov	x0, x21
	ldp	x29, x30, [sp, #160]            ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #144]            ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #128]            ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #112]            ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #96]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp, #80]             ; 16-byte Folded Reload
	add	sp, sp, #176
	ret
LBB0_58:
	mov	x21, x0
LBB0_59:
	ldr	x8, [x24]
	str	x8, [x19]
	str	w22, [x19, #8]
	b	LBB0_44
	.loh AdrpLdrGot	Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh14, Lloh15, Lloh16
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.loh AdrpLdrGot	Lloh17, Lloh18
	.loh AdrpLdrGot	Lloh23, Lloh24
	.loh AdrpLdrGot	Lloh21, Lloh22
	.loh AdrpLdrGotLdr	Lloh19, Lloh20, Lloh25
	.loh AdrpLdrGot	Lloh28, Lloh29
	.loh AdrpLdrGot	Lloh26, Lloh27
	.loh AdrpLdrGot	Lloh32, Lloh33
	.loh AdrpLdrGot	Lloh30, Lloh31
	.loh AdrpLdrGot	Lloh36, Lloh37
	.loh AdrpLdrGot	Lloh34, Lloh35
	.loh AdrpLdrGotLdr	Lloh38, Lloh39, Lloh40
	.loh AdrpLdrGot	Lloh43, Lloh44
	.loh AdrpLdrGot	Lloh41, Lloh42
	.cfi_endproc
                                        ; -- End function
	.comm	_LAC_AUTO_NO_NIBBLES,8,3        ; @LAC_AUTO_NO_NIBBLES
	.comm	_LAC_AUTO_NO_NIBBLES_NO_PALETTE,8,3 ; @LAC_AUTO_NO_NIBBLES_NO_PALETTE
	.comm	_LAC_AUTO_NO_PALETTE,8,3        ; @LAC_AUTO_NO_PALETTE
	.comm	_LAC_ALPHA,8,3                  ; @LAC_ALPHA
	.comm	_LCT_RGBA,8,3                   ; @LCT_RGBA
	.comm	_LCT_GREY_ALPHA,8,3             ; @LCT_GREY_ALPHA
	.comm	_LCT_RGB,8,3                    ; @LCT_RGB
	.comm	_LCT_GREY,8,3                   ; @LCT_GREY
	.comm	_LCT_PALETTE,8,3                ; @LCT_PALETTE
.subsections_via_symbols
