	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_lodepng_convert                ## -- Begin function lodepng_convert
	.p2align	4, 0x90
_lodepng_convert:                       ## @lodepng_convert
	.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
	movl	%r9d, %r12d
	movl	%r8d, -56(%rbp)                 ## 4-byte Spill
	movq	%rcx, %rbx
	movq	%rdx, %r13
	movq	%rsi, %r14
	movq	%rdi, %r15
	movq	%rdx, %rdi
	movq	%rcx, %rsi
	callq	_lodepng_color_mode_equal
	testq	%rax, %rax
	je	LBB0_6
## %bb.1:
	movl	-56(%rbp), %edi                 ## 4-byte Reload
	movl	%r12d, %esi
	movq	%rbx, %rdx
	callq	_lodepng_get_raw_size
	testq	%rax, %rax
	je	LBB0_18
## %bb.2:
	xorl	%ecx, %ecx
	cmpq	$8, %rax
	jb	LBB0_35
## %bb.3:
	movq	%r15, %rdx
	subq	%r14, %rdx
	cmpq	$32, %rdx
	jb	LBB0_35
## %bb.4:
	cmpq	$32, %rax
	jae	LBB0_22
## %bb.5:
	xorl	%ecx, %ecx
	jmp	LBB0_32
LBB0_6:
	movq	%rbx, -80(%rbp)                 ## 8-byte Spill
	imull	-56(%rbp), %r12d                ## 4-byte Folded Reload
	movq	%r12, -56(%rbp)                 ## 8-byte Spill
	movq	(%r13), %rax
	movq	_LCT_PALETTE@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	movq	%r13, %r12
	jne	LBB0_10
## %bb.7:
	movb	8(%r12), %cl
	movl	$1, %eax
	shll	%cl, %eax
	movslq	%eax, %r13
	movq	16(%r12), %rax
	cmpq	%r13, %rax
	cmovbq	%rax, %r13
	leaq	-60(%rbp), %rdi
	callq	_color_tree_init
	testq	%r13, %r13
	je	LBB0_10
## %bb.8:
	xorl	%ebx, %ebx
	.p2align	4, 0x90
LBB0_9:                                 ## =>This Inner Loop Header: Depth=1
	movq	24(%r12), %rax
	movzbl	(%rax,%rbx,4), %esi
	movzbl	1(%rax,%rbx,4), %edx
	movzbl	2(%rax,%rbx,4), %ecx
	movzbl	3(%rax,%rbx,4), %r8d
	leaq	-60(%rbp), %rdi
	movq	%rbx, %r9
	callq	_color_tree_add
	incq	%rbx
	cmpq	%rbx, %r13
	jne	LBB0_9
LBB0_10:
	movq	-80(%rbp), %rax                 ## 8-byte Reload
	cmpl	$16, 8(%rax)
	movl	8(%r12), %ecx
	jne	LBB0_19
## %bb.11:
	cmpl	$16, %ecx
	jne	LBB0_19
## %bb.12:
	cmpq	$0, -56(%rbp)                   ## 8-byte Folded Reload
	je	LBB0_50
## %bb.13:
	xorl	%ebx, %ebx
	.p2align	4, 0x90
LBB0_14:                                ## =>This Inner Loop Header: Depth=1
	movw	$0, -48(%rbp)
	movw	$0, -46(%rbp)
	movw	$0, -44(%rbp)
	movw	$0, -42(%rbp)
	subq	$8, %rsp
	leaq	-48(%rbp), %rdi
	leaq	-46(%rbp), %rsi
	leaq	-44(%rbp), %rdx
	leaq	-42(%rbp), %rcx
	movq	%r14, %r8
	movq	%rbx, %r9
	pushq	%rax
	callq	_getPixelColorRGBA16
	addq	$16, %rsp
	testl	%eax, %eax
	jne	LBB0_24
## %bb.15:                              ##   in Loop: Header=BB0_14 Depth=1
	movzwl	-48(%rbp), %ecx
	movzwl	-46(%rbp), %r8d
	movzwl	-44(%rbp), %r9d
	movzwl	-42(%rbp), %eax
	subq	$8, %rsp
	movq	%r15, %rdi
	movq	%rbx, %rsi
	movq	%r12, %rdx
	pushq	%rax
	callq	_rgba16ToPixel
	addq	$16, %rsp
	testl	%eax, %eax
	jne	LBB0_24
## %bb.16:                              ##   in Loop: Header=BB0_14 Depth=1
	incq	%rbx
	cmpq	%rbx, -56(%rbp)                 ## 8-byte Folded Reload
	movq	-80(%rbp), %rax                 ## 8-byte Reload
	jne	LBB0_14
	jmp	LBB0_50
LBB0_18:
	xorl	%r13d, %r13d
	jmp	LBB0_53
LBB0_19:
	cmpl	$8, %ecx
	jne	LBB0_42
## %bb.20:
	movq	(%r12), %rdx
	movq	_LCT_RGBA@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rdx
	jne	LBB0_39
## %bb.21:
	movq	%r15, %rdi
	movq	-56(%rbp), %rsi                 ## 8-byte Reload
	movl	$1, %edx
	jmp	LBB0_41
LBB0_22:
	movq	%rax, %rcx
	andq	$-32, %rcx
	leaq	-32(%rcx), %rdi
	movq	%rdi, %rsi
	shrq	$5, %rsi
	incq	%rsi
	movl	%esi, %edx
	andl	$3, %edx
	cmpq	$96, %rdi
	jae	LBB0_25
## %bb.23:
	xorl	%edi, %edi
	jmp	LBB0_27
LBB0_24:
	movl	%eax, %r13d
	jmp	LBB0_51
LBB0_25:
	andq	$-4, %rsi
	xorl	%edi, %edi
	.p2align	4, 0x90
LBB0_26:                                ## =>This Inner Loop Header: Depth=1
	movups	(%r14,%rdi), %xmm0
	movups	16(%r14,%rdi), %xmm1
	movups	%xmm0, (%r15,%rdi)
	movups	%xmm1, 16(%r15,%rdi)
	movups	32(%r14,%rdi), %xmm0
	movups	48(%r14,%rdi), %xmm1
	movups	%xmm0, 32(%r15,%rdi)
	movups	%xmm1, 48(%r15,%rdi)
	movups	64(%r14,%rdi), %xmm0
	movups	80(%r14,%rdi), %xmm1
	movups	%xmm0, 64(%r15,%rdi)
	movups	%xmm1, 80(%r15,%rdi)
	movups	96(%r14,%rdi), %xmm0
	movups	112(%r14,%rdi), %xmm1
	movups	%xmm0, 96(%r15,%rdi)
	movups	%xmm1, 112(%r15,%rdi)
	subq	$-128, %rdi
	addq	$-4, %rsi
	jne	LBB0_26
LBB0_27:
	testq	%rdx, %rdx
	je	LBB0_30
## %bb.28:
	leaq	(%r15,%rdi), %rsi
	addq	$16, %rsi
	addq	%r14, %rdi
	addq	$16, %rdi
	shlq	$5, %rdx
	xorl	%ebx, %ebx
	.p2align	4, 0x90
LBB0_29:                                ## =>This Inner Loop Header: Depth=1
	movups	-16(%rdi,%rbx), %xmm0
	movups	(%rdi,%rbx), %xmm1
	movups	%xmm0, -16(%rsi,%rbx)
	movups	%xmm1, (%rsi,%rbx)
	addq	$32, %rbx
	cmpq	%rbx, %rdx
	jne	LBB0_29
LBB0_30:
	xorl	%r13d, %r13d
	cmpq	%rcx, %rax
	je	LBB0_53
## %bb.31:
	testb	$24, %al
	je	LBB0_35
LBB0_32:
	movq	%rcx, %rdx
	movq	%rax, %rcx
	andq	$-8, %rcx
	.p2align	4, 0x90
LBB0_33:                                ## =>This Inner Loop Header: Depth=1
	movq	(%r14,%rdx), %rsi
	movq	%rsi, (%r15,%rdx)
	addq	$8, %rdx
	cmpq	%rdx, %rcx
	jne	LBB0_33
## %bb.34:
	xorl	%r13d, %r13d
	cmpq	%rcx, %rax
	je	LBB0_53
LBB0_35:
	movq	%rcx, %rdx
	notq	%rdx
	addq	%rax, %rdx
	movq	%rax, %rsi
	andq	$3, %rsi
	je	LBB0_37
	.p2align	4, 0x90
LBB0_36:                                ## =>This Inner Loop Header: Depth=1
	movzbl	(%r14,%rcx), %ebx
	movb	%bl, (%r15,%rcx)
	incq	%rcx
	decq	%rsi
	jne	LBB0_36
LBB0_37:
	xorl	%r13d, %r13d
	cmpq	$3, %rdx
	jb	LBB0_53
	.p2align	4, 0x90
LBB0_38:                                ## =>This Inner Loop Header: Depth=1
	movzbl	(%r14,%rcx), %edx
	movb	%dl, (%r15,%rcx)
	movzbl	1(%r14,%rcx), %edx
	movb	%dl, 1(%r15,%rcx)
	movzbl	2(%r14,%rcx), %edx
	movb	%dl, 2(%r15,%rcx)
	movzbl	3(%r14,%rcx), %edx
	movb	%dl, 3(%r15,%rcx)
	addq	$4, %rcx
	cmpq	%rcx, %rax
	jne	LBB0_38
	jmp	LBB0_53
LBB0_39:
	movq	_LCT_RGB@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rdx
	jne	LBB0_42
## %bb.40:
	movq	%r15, %rdi
	movq	-56(%rbp), %rsi                 ## 8-byte Reload
	xorl	%edx, %edx
LBB0_41:
	movq	%r14, %rcx
	movq	%rax, %r8
	movl	16(%rbp), %r9d
                                        ## kill: def $r9d killed $r9d killed $r9
	callq	_getPixelColorsRGBA8
	movl	%eax, %r13d
	jmp	LBB0_51
LBB0_42:
	movb	$0, -48(%rbp)
	movb	$0, -46(%rbp)
	movb	$0, -44(%rbp)
	movb	$0, -42(%rbp)
	cmpq	$0, -56(%rbp)                   ## 8-byte Folded Reload
	je	LBB0_50
## %bb.43:
	movq	%r12, -72(%rbp)                 ## 8-byte Spill
	xorl	%r12d, %r12d
	.p2align	4, 0x90
LBB0_44:                                ## =>This Inner Loop Header: Depth=1
	leaq	-48(%rbp), %rdi
	leaq	-46(%rbp), %rsi
	leaq	-44(%rbp), %rdx
	leaq	-42(%rbp), %rcx
	movq	%r14, %r8
	movq	%r12, %r9
	movl	16(%rbp), %ebx
	pushq	%rbx
	pushq	%rax
	callq	_getPixelColorRGBA8
	addq	$16, %rsp
	testl	%eax, %eax
	jne	LBB0_48
## %bb.45:                              ##   in Loop: Header=BB0_44 Depth=1
	movzbl	-48(%rbp), %r8d
	movzbl	-46(%rbp), %r9d
	movzbl	-44(%rbp), %eax
	movzbl	-42(%rbp), %ebx
	movq	%r15, %rdi
	movq	%r12, %rsi
	movq	-72(%rbp), %rdx                 ## 8-byte Reload
	leaq	-60(%rbp), %rcx
	pushq	%rbx
	pushq	%rax
	callq	_rgba8ToPixel
	addq	$16, %rsp
	testl	%eax, %eax
	jne	LBB0_48
## %bb.46:                              ##   in Loop: Header=BB0_44 Depth=1
	incq	%r12
	cmpq	%r12, -56(%rbp)                 ## 8-byte Folded Reload
	movq	-80(%rbp), %rax                 ## 8-byte Reload
	jne	LBB0_44
## %bb.47:
	xorl	%r13d, %r13d
	jmp	LBB0_49
LBB0_50:
	xorl	%r13d, %r13d
	jmp	LBB0_51
LBB0_48:
	movl	%eax, %r13d
LBB0_49:
	movq	-72(%rbp), %r12                 ## 8-byte Reload
LBB0_51:
	movq	_LCT_PALETTE@GOTPCREL(%rip), %rcx
	movq	(%r12), %rax
	cmpq	(%rcx), %rax
	jne	LBB0_53
## %bb.52:
	leaq	-60(%rbp), %rdi
	callq	_color_tree_cleanup
LBB0_53:
	movl	%r13d, %eax
	addq	$40, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_LCT_PALETTE,8,3                ## @LCT_PALETTE
	.comm	_LCT_RGBA,8,3                   ## @LCT_RGBA
	.comm	_LCT_RGB,8,3                    ## @LCT_RGB
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_lodepng_convert                ; -- Begin function lodepng_convert
	.p2align	2
_lodepng_convert:                       ; @lodepng_convert
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #112
	.cfi_def_cfa_offset 112
	stp	x28, x27, [sp, #16]             ; 16-byte Folded Spill
	stp	x26, x25, [sp, #32]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #48]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #64]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #80]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #96]             ; 16-byte Folded Spill
	add	x29, sp, #96
	.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	x24, x6
	mov	x23, x5
	mov	x25, x4
	mov	x22, x3
	mov	x21, x2
	mov	x19, x1
	mov	x20, x0
	mov	x0, x2
	mov	x1, x3
	bl	_lodepng_color_mode_equal
	cbz	x0, LBB0_6
; %bb.1:
	mov	x0, x25
	mov	x1, x23
	mov	x2, x22
	bl	_lodepng_get_raw_size
	cbz	x0, LBB0_28
; %bb.2:
	mov	x8, #0
	cmp	x0, #8
	b.lo	LBB0_26
; %bb.3:
	sub	x9, x20, x19
	cmp	x9, #64
	b.lo	LBB0_26
; %bb.4:
	cmp	x0, #64
	b.hs	LBB0_19
; %bb.5:
	mov	x8, #0
	b	LBB0_23
LBB0_6:
	mul	w23, w23, w25
	ldr	x8, [x21]
Lloh0:
	adrp	x27, _LCT_PALETTE@GOTPAGE
Lloh1:
	ldr	x27, [x27, _LCT_PALETTE@GOTPAGEOFF]
	ldr	x9, [x27]
	cmp	x8, x9
	b.ne	LBB0_10
; %bb.7:
	ldr	w8, [x21, #8]
	mov	w9, #1
	lsl	w8, w9, w8
	sxtw	x8, w8
	ldr	x9, [x21, #16]
	cmp	x9, x8
	csel	x26, x9, x8, lo
	add	x0, sp, #12
	bl	_color_tree_init
	cbz	x26, LBB0_10
; %bb.8:
	mov	x28, #0
	mov	x25, #0
LBB0_9:                                 ; =>This Inner Loop Header: Depth=1
	ldr	x8, [x21, #24]
	add	x8, x8, x28
	ldrb	w1, [x8]
	ldrb	w2, [x8, #1]
	ldrb	w3, [x8, #2]
	ldrb	w4, [x8, #3]
	add	x0, sp, #12
	mov	x5, x25
	bl	_color_tree_add
	add	x25, x25, #1
	add	x28, x28, #4
	cmp	x26, x25
	b.ne	LBB0_9
LBB0_10:
	ldr	w9, [x22, #8]
	ldr	w8, [x21, #8]
	cmp	w9, #16
	ccmp	w8, #16, #0, eq
	b.eq	LBB0_14
; %bb.11:
	cmp	w8, #8
	b.ne	LBB0_33
; %bb.12:
	ldr	x8, [x21]
Lloh2:
	adrp	x9, _LCT_RGBA@GOTPAGE
Lloh3:
	ldr	x9, [x9, _LCT_RGBA@GOTPAGEOFF]
Lloh4:
	ldr	x9, [x9]
	cmp	x8, x9
	b.ne	LBB0_29
; %bb.13:
	mov	x0, x20
	mov	x1, x23
	mov	w2, #1
	b	LBB0_31
LBB0_14:
	cbz	w23, LBB0_38
; %bb.15:
	mov	x24, #0
LBB0_16:                                ; =>This Inner Loop Header: Depth=1
	stp	wzr, wzr, [sp, #4]
	add	x0, sp, #10
	add	x1, sp, #8
	add	x2, sp, #6
	add	x3, sp, #4
	mov	x4, x19
	mov	x5, x24
	mov	x6, x22
	bl	_getPixelColorRGBA16
	cbnz	w0, LBB0_32
; %bb.17:                               ;   in Loop: Header=BB0_16 Depth=1
	ldrh	w3, [sp, #10]
	ldrh	w4, [sp, #8]
	ldrh	w5, [sp, #6]
	ldrh	w6, [sp, #4]
	mov	x0, x20
	mov	x1, x24
	mov	x2, x21
	bl	_rgba16ToPixel
	cbnz	w0, LBB0_32
; %bb.18:                               ;   in Loop: Header=BB0_16 Depth=1
	add	x24, x24, #1
	cmp	x23, x24
	b.ne	LBB0_16
	b	LBB0_38
LBB0_19:
	and	x8, x0, #0xffffffffffffffc0
	add	x9, x19, #32
	add	x10, x20, #32
	mov	x11, x8
LBB0_20:                                ; =>This Inner Loop Header: Depth=1
	ldp	q0, q1, [x9, #-32]
	ldp	q2, q3, [x9], #64
	stp	q0, q1, [x10, #-32]
	stp	q2, q3, [x10], #64
	subs	x11, x11, #64
	b.ne	LBB0_20
; %bb.21:
	cmp	x0, x8
	b.eq	LBB0_28
; %bb.22:
	tst	x0, #0x38
	b.eq	LBB0_26
LBB0_23:
	mov	x11, x8
	and	x8, x0, #0xfffffffffffffff8
	add	x9, x19, x11
	add	x10, x20, x11
	sub	x11, x11, x8
LBB0_24:                                ; =>This Inner Loop Header: Depth=1
	ldr	d0, [x9], #8
	str	d0, [x10], #8
	adds	x11, x11, #8
	b.ne	LBB0_24
; %bb.25:
	cmp	x0, x8
	b.eq	LBB0_28
LBB0_26:
	sub	x9, x0, x8
	add	x10, x20, x8
	add	x8, x19, x8
LBB0_27:                                ; =>This Inner Loop Header: Depth=1
	ldrb	w11, [x8], #1
	strb	w11, [x10], #1
	subs	x9, x9, #1
	b.ne	LBB0_27
LBB0_28:
	mov	w25, #0
	b	LBB0_41
LBB0_29:
Lloh5:
	adrp	x9, _LCT_RGB@GOTPAGE
Lloh6:
	ldr	x9, [x9, _LCT_RGB@GOTPAGEOFF]
Lloh7:
	ldr	x9, [x9]
	cmp	x8, x9
	b.ne	LBB0_33
; %bb.30:
	mov	x0, x20
	mov	x1, x23
	mov	w2, #0
LBB0_31:
	mov	x3, x19
	mov	x4, x22
	mov	x5, x24
	bl	_getPixelColorsRGBA8
LBB0_32:
	mov	x25, x0
	b	LBB0_39
LBB0_33:
	strb	wzr, [sp, #10]
	strb	wzr, [sp, #8]
	strb	wzr, [sp, #6]
	strb	wzr, [sp, #4]
	cbz	w23, LBB0_38
; %bb.34:
	mov	x26, #0
LBB0_35:                                ; =>This Inner Loop Header: Depth=1
	add	x0, sp, #10
	add	x1, sp, #8
	add	x2, sp, #6
	add	x3, sp, #4
	mov	x4, x19
	mov	x5, x26
	mov	x6, x22
	mov	x7, x24
	bl	_getPixelColorRGBA8
	cbnz	w0, LBB0_32
; %bb.36:                               ;   in Loop: Header=BB0_35 Depth=1
	ldrb	w4, [sp, #10]
	ldrb	w5, [sp, #8]
	ldrb	w6, [sp, #6]
	ldrb	w7, [sp, #4]
	add	x3, sp, #12
	mov	x0, x20
	mov	x1, x26
	mov	x2, x21
	bl	_rgba8ToPixel
	cbnz	w0, LBB0_32
; %bb.37:                               ;   in Loop: Header=BB0_35 Depth=1
	add	x26, x26, #1
	cmp	x23, x26
	b.ne	LBB0_35
LBB0_38:
	mov	w25, #0
LBB0_39:
	ldr	x8, [x21]
	ldr	x9, [x27]
	cmp	x8, x9
	b.ne	LBB0_41
; %bb.40:
	add	x0, sp, #12
	bl	_color_tree_cleanup
LBB0_41:
	mov	x0, x25
	ldp	x29, x30, [sp, #96]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #80]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #64]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #48]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #32]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #112
	ret
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.cfi_endproc
                                        ; -- End function
	.comm	_LCT_PALETTE,8,3                ; @LCT_PALETTE
	.comm	_LCT_RGBA,8,3                   ; @LCT_RGBA
	.comm	_LCT_RGB,8,3                    ; @LCT_RGB
.subsections_via_symbols
