	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_png_do_dither                  ## -- Begin function png_do_dither
	.p2align	4, 0x90
_png_do_dither:                         ## @png_do_dither
	.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	$24, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rcx, %r13
	movq	%rdx, %r12
	movq	%rsi, %r15
	movq	%rdi, %rbx
	movq	(%rdi), %r14
	leaq	L_.str(%rip), %rsi
	movl	$1, %edi
	callq	_png_debug
	movq	8(%rbx), %rax
	testq	%r12, %r12
	je	LBB0_6
## %bb.1:
	movq	_PNG_COLOR_TYPE_RGB@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jne	LBB0_6
## %bb.2:
	cmpl	$8, 16(%rbx)
	jne	LBB0_6
## %bb.3:
	movq	%rbx, -64(%rbp)                 ## 8-byte Spill
	testq	%r14, %r14
	jle	LBB0_12
## %bb.4:
	movq	%r12, %r10
	movq	_PNG_DITHER_RED_BITS@GOTPCREL(%rip), %rax
	movl	(%rax), %ecx
	movl	$8, %r11d
	movl	$8, %eax
	subl	%ecx, %eax
	movl	%eax, -52(%rbp)                 ## 4-byte Spill
	movl	$-1, %eax
                                        ## kill: def $cl killed $cl killed $ecx
	shll	%cl, %eax
	movl	$-1, %r13d
	notl	%eax
	movl	%eax, -48(%rbp)                 ## 4-byte Spill
	movq	_PNG_DITHER_GREEN_BITS@GOTPCREL(%rip), %rax
	movl	(%rax), %ecx
	movq	_PNG_DITHER_BLUE_BITS@GOTPCREL(%rip), %rax
	movl	(%rax), %r9d
	leal	(%r9,%rcx), %eax
	movl	%eax, -44(%rbp)                 ## 4-byte Spill
	movl	$8, %eax
	movl	$-1, %edi
	shll	%cl, %edi
	subl	%ecx, %eax
	movl	%r9d, %ecx
	shll	%cl, %r13d
	notl	%edi
	subl	%r9d, %r11d
	notl	%r13d
	xorl	%edx, %edx
	movq	%r15, %rbx
	.p2align	4, 0x90
LBB0_5:                                 ## =>This Inner Loop Header: Depth=1
	movl	(%rbx), %r8d
	movl	8(%rbx), %r12d
	movl	-52(%rbp), %ecx                 ## 4-byte Reload
                                        ## kill: def $cl killed $cl killed $ecx
	sarl	%cl, %r8d
	andl	-48(%rbp), %r8d                 ## 4-byte Folded Reload
	movl	-44(%rbp), %ecx                 ## 4-byte Reload
                                        ## kill: def $cl killed $cl killed $ecx
	shll	%cl, %r8d
	movl	%eax, %ecx
	sarl	%cl, %r12d
	andl	%edi, %r12d
	movl	%r9d, %ecx
	shll	%cl, %r12d
	orl	%r8d, %r12d
	movl	16(%rbx), %esi
	movl	%r11d, %ecx
	sarl	%cl, %esi
	andl	%r13d, %esi
	orl	%r12d, %esi
	movslq	%esi, %rcx
	movq	(%r10,%rcx,8), %rcx
	movq	%rcx, (%r15,%rdx,8)
	incq	%rdx
	addq	$24, %rbx
	cmpq	%rdx, %r14
	jne	LBB0_5
	jmp	LBB0_12
LBB0_6:
	testq	%r12, %r12
	je	LBB0_13
## %bb.7:
	movq	_PNG_COLOR_TYPE_RGB_ALPHA@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jne	LBB0_13
## %bb.8:
	cmpl	$8, 16(%rbx)
	jne	LBB0_13
## %bb.9:
	movq	%rbx, -64(%rbp)                 ## 8-byte Spill
	testq	%r14, %r14
	jle	LBB0_12
## %bb.10:
	movq	%r12, %r10
	movq	_PNG_DITHER_RED_BITS@GOTPCREL(%rip), %rax
	movl	(%rax), %ecx
	movl	$8, %r11d
	movl	$8, %eax
	subl	%ecx, %eax
	movl	%eax, -52(%rbp)                 ## 4-byte Spill
	movl	$-1, %eax
                                        ## kill: def $cl killed $cl killed $ecx
	shll	%cl, %eax
	movl	$-1, %r13d
	notl	%eax
	movl	%eax, -48(%rbp)                 ## 4-byte Spill
	movq	_PNG_DITHER_GREEN_BITS@GOTPCREL(%rip), %rax
	movl	(%rax), %ecx
	movq	_PNG_DITHER_BLUE_BITS@GOTPCREL(%rip), %rax
	movl	(%rax), %r12d
	leal	(%r12,%rcx), %eax
	movl	%eax, -44(%rbp)                 ## 4-byte Spill
	movl	$8, %eax
	movl	$-1, %edi
	shll	%cl, %edi
	subl	%ecx, %eax
	movl	%r12d, %ecx
	shll	%cl, %r13d
	notl	%edi
	subl	%r12d, %r11d
	notl	%r13d
	xorl	%edx, %edx
	movq	%r14, %rbx
	.p2align	4, 0x90
LBB0_11:                                ## =>This Inner Loop Header: Depth=1
	movl	(%r15,%rdx,4), %esi
	movl	-52(%rbp), %ecx                 ## 4-byte Reload
                                        ## kill: def $cl killed $cl killed $ecx
	sarl	%cl, %esi
	andl	-48(%rbp), %esi                 ## 4-byte Folded Reload
	movl	-44(%rbp), %ecx                 ## 4-byte Reload
                                        ## kill: def $cl killed $cl killed $ecx
	shll	%cl, %esi
	movl	8(%r15,%rdx,4), %r8d
	movl	%eax, %ecx
	sarl	%cl, %r8d
	andl	%edi, %r8d
	movl	%r12d, %ecx
	shll	%cl, %r8d
	movl	16(%r15,%rdx,4), %r9d
	movl	%r11d, %ecx
	sarl	%cl, %r9d
	orl	%esi, %r8d
	andl	%r13d, %r9d
	orl	%r8d, %r9d
	movslq	%r9d, %rcx
	movq	(%r10,%rcx,8), %rcx
	movq	%rcx, (%r15,%rdx)
	addq	$8, %rdx
	decq	%rbx
	jne	LBB0_11
LBB0_12:
	movq	_PNG_COLOR_TYPE_PALETTE@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	-64(%rbp), %rbx                 ## 8-byte Reload
	movq	%rax, 8(%rbx)
	movabsq	$34359738369, %rax              ## imm = 0x800000001
	movq	%rax, 20(%rbx)
	movl	$8, %edi
	movq	%r14, %rsi
	callq	_PNG_ROWBYTES
	movq	%rax, 32(%rbx)
	jmp	LBB0_23
LBB0_13:
	testq	%r13, %r13
	je	LBB0_23
## %bb.14:
	movq	_PNG_COLOR_TYPE_PALETTE@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jne	LBB0_23
## %bb.15:
	cmpl	$8, 16(%rbx)
	jne	LBB0_23
## %bb.16:
	testq	%r14, %r14
	jle	LBB0_23
## %bb.17:
	leaq	-1(%r14), %rcx
	movl	%r14d, %eax
	andl	$3, %eax
	cmpq	$3, %rcx
	jb	LBB0_20
## %bb.18:
	andq	$-4, %r14
	.p2align	4, 0x90
LBB0_19:                                ## =>This Inner Loop Header: Depth=1
	movq	(%r15), %rcx
	movq	8(%r15), %rdx
	movq	(%r13,%rcx,8), %rcx
	movq	%rcx, (%r15)
	movq	(%r13,%rdx,8), %rcx
	movq	%rcx, 8(%r15)
	movq	16(%r15), %rcx
	movq	(%r13,%rcx,8), %rcx
	movq	%rcx, 16(%r15)
	movq	24(%r15), %rcx
	movq	(%r13,%rcx,8), %rcx
	movq	%rcx, 24(%r15)
	addq	$32, %r15
	addq	$-4, %r14
	jne	LBB0_19
LBB0_20:
	testq	%rax, %rax
	je	LBB0_23
## %bb.21:
	xorl	%ecx, %ecx
	.p2align	4, 0x90
LBB0_22:                                ## =>This Inner Loop Header: Depth=1
	movq	(%r15,%rcx,8), %rdx
	movq	(%r13,%rdx,8), %rdx
	movq	%rdx, (%r15,%rcx,8)
	incq	%rcx
	cmpq	%rcx, %rax
	jne	LBB0_22
LBB0_23:
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"in png_do_dither\n"

	.comm	_PNG_COLOR_TYPE_RGB,8,3         ## @PNG_COLOR_TYPE_RGB
	.comm	_PNG_DITHER_RED_BITS,4,2        ## @PNG_DITHER_RED_BITS
	.comm	_PNG_DITHER_GREEN_BITS,4,2      ## @PNG_DITHER_GREEN_BITS
	.comm	_PNG_DITHER_BLUE_BITS,4,2       ## @PNG_DITHER_BLUE_BITS
	.comm	_PNG_COLOR_TYPE_PALETTE,8,3     ## @PNG_COLOR_TYPE_PALETTE
	.comm	_PNG_COLOR_TYPE_RGB_ALPHA,8,3   ## @PNG_COLOR_TYPE_RGB_ALPHA
.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 png_do_dither
lCPI0_0:
	.long	1                               ; 0x1
	.long	8                               ; 0x8
	.section	__TEXT,__text,regular,pure_instructions
	.globl	_png_do_dither
	.p2align	2
_png_do_dither:                         ; @png_do_dither
	.cfi_startproc
; %bb.0:
	stp	x24, x23, [sp, #-64]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 64
	stp	x22, x21, [sp, #16]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #32]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #48]             ; 16-byte Folded Spill
	add	x29, sp, #48
	.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
	mov	x23, x3
	mov	x22, x2
	mov	x20, x1
	mov	x21, x0
	ldr	x19, [x0]
Lloh0:
	adrp	x1, l_.str@PAGE
Lloh1:
	add	x1, x1, l_.str@PAGEOFF
	mov	w0, #1
	bl	_png_debug
	ldr	x8, [x21, #8]
	cbz	x22, LBB0_6
; %bb.1:
Lloh2:
	adrp	x9, _PNG_COLOR_TYPE_RGB@GOTPAGE
Lloh3:
	ldr	x9, [x9, _PNG_COLOR_TYPE_RGB@GOTPAGEOFF]
Lloh4:
	ldr	x9, [x9]
	cmp	x8, x9
	b.ne	LBB0_6
; %bb.2:
	ldr	w9, [x21, #16]
	cmp	w9, #8
	b.ne	LBB0_6
; %bb.3:
	cmp	x19, #1
	b.lt	LBB0_12
; %bb.4:
Lloh5:
	adrp	x8, _PNG_DITHER_RED_BITS@GOTPAGE
Lloh6:
	ldr	x8, [x8, _PNG_DITHER_RED_BITS@GOTPAGEOFF]
Lloh7:
	ldr	w9, [x8]
	mov	w14, #8
	sub	w8, w14, w9
	mov	w15, #-1
	lsl	w9, w15, w9
	mvn	w9, w9
Lloh8:
	adrp	x10, _PNG_DITHER_GREEN_BITS@GOTPAGE
Lloh9:
	ldr	x10, [x10, _PNG_DITHER_GREEN_BITS@GOTPAGEOFF]
Lloh10:
	ldr	w13, [x10]
Lloh11:
	adrp	x10, _PNG_DITHER_BLUE_BITS@GOTPAGE
Lloh12:
	ldr	x10, [x10, _PNG_DITHER_BLUE_BITS@GOTPAGEOFF]
Lloh13:
	ldr	w10, [x10]
	add	w11, w10, w13
	sub	w12, w14, w13
	lsl	w13, w15, w13
	mvn	w13, w13
	sub	w14, w14, w10
	lsl	w15, w15, w10
	mvn	w15, w15
	mov	x16, x19
	mov	x17, x20
LBB0_5:                                 ; =>This Inner Loop Header: Depth=1
	ldr	w0, [x20]
	ldr	w1, [x20, #8]
	ldr	w2, [x20, #16]
	asr	w0, w0, w8
	and	w0, w0, w9
	lsl	w0, w0, w11
	asr	w1, w1, w12
	and	w1, w1, w13
	lsl	w1, w1, w10
	orr	w0, w1, w0
	asr	w1, w2, w14
	and	w1, w1, w15
	orr	w0, w0, w1
	ldr	x0, [x22, w0, sxtw #3]
	str	x0, [x17], #8
	add	x20, x20, #24
	subs	x16, x16, #1
	b.ne	LBB0_5
	b	LBB0_12
LBB0_6:
	cbz	x22, LBB0_13
; %bb.7:
Lloh14:
	adrp	x9, _PNG_COLOR_TYPE_RGB_ALPHA@GOTPAGE
Lloh15:
	ldr	x9, [x9, _PNG_COLOR_TYPE_RGB_ALPHA@GOTPAGEOFF]
Lloh16:
	ldr	x9, [x9]
	cmp	x8, x9
	b.ne	LBB0_13
; %bb.8:
	ldr	w9, [x21, #16]
	cmp	w9, #8
	b.ne	LBB0_13
; %bb.9:
	cmp	x19, #1
	b.lt	LBB0_12
; %bb.10:
Lloh17:
	adrp	x8, _PNG_DITHER_RED_BITS@GOTPAGE
Lloh18:
	ldr	x8, [x8, _PNG_DITHER_RED_BITS@GOTPAGEOFF]
Lloh19:
	ldr	w9, [x8]
	mov	w14, #8
	sub	w8, w14, w9
	mov	w15, #-1
	lsl	w9, w15, w9
	mvn	w9, w9
Lloh20:
	adrp	x10, _PNG_DITHER_GREEN_BITS@GOTPAGE
Lloh21:
	ldr	x10, [x10, _PNG_DITHER_GREEN_BITS@GOTPAGEOFF]
Lloh22:
	ldr	w13, [x10]
Lloh23:
	adrp	x10, _PNG_DITHER_BLUE_BITS@GOTPAGE
Lloh24:
	ldr	x10, [x10, _PNG_DITHER_BLUE_BITS@GOTPAGEOFF]
Lloh25:
	ldr	w10, [x10]
	add	w11, w10, w13
	sub	w12, w14, w13
	lsl	w13, w15, w13
	mvn	w13, w13
	sub	w14, w14, w10
	lsl	w15, w15, w10
	mvn	w15, w15
	mov	x16, x19
	mov	x17, x20
LBB0_11:                                ; =>This Inner Loop Header: Depth=1
	ldr	w0, [x20]
	ldr	w1, [x20, #8]
	ldr	w2, [x20, #16]
	asr	w0, w0, w8
	and	w0, w0, w9
	lsl	w0, w0, w11
	asr	w1, w1, w12
	and	w1, w1, w13
	lsl	w1, w1, w10
	orr	w0, w1, w0
	asr	w1, w2, w14
	and	w1, w1, w15
	orr	w0, w0, w1
	ldr	x0, [x22, w0, sxtw #3]
	str	x0, [x17], #8
	add	x20, x20, #32
	subs	x16, x16, #1
	b.ne	LBB0_11
LBB0_12:
Lloh26:
	adrp	x8, _PNG_COLOR_TYPE_PALETTE@GOTPAGE
Lloh27:
	ldr	x8, [x8, _PNG_COLOR_TYPE_PALETTE@GOTPAGEOFF]
Lloh28:
	ldr	x8, [x8]
	str	x8, [x21, #8]
Lloh29:
	adrp	x8, lCPI0_0@PAGE
Lloh30:
	ldr	d0, [x8, lCPI0_0@PAGEOFF]
	stur	d0, [x21, #20]
	mov	w0, #8
	mov	x1, x19
	bl	_PNG_ROWBYTES
	str	x0, [x21, #32]
	b	LBB0_18
LBB0_13:
	cbz	x23, LBB0_18
; %bb.14:
Lloh31:
	adrp	x9, _PNG_COLOR_TYPE_PALETTE@GOTPAGE
Lloh32:
	ldr	x9, [x9, _PNG_COLOR_TYPE_PALETTE@GOTPAGEOFF]
Lloh33:
	ldr	x9, [x9]
	cmp	x8, x9
	b.ne	LBB0_18
; %bb.15:
	ldr	w8, [x21, #16]
	cmp	w8, #8
	b.ne	LBB0_18
; %bb.16:
	cmp	x19, #1
	b.lt	LBB0_18
LBB0_17:                                ; =>This Inner Loop Header: Depth=1
	ldr	x8, [x20]
	ldr	x8, [x23, x8, lsl #3]
	str	x8, [x20], #8
	subs	x19, x19, #1
	b.ne	LBB0_17
LBB0_18:
	ldp	x29, x30, [sp, #48]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #32]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #16]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp], #64             ; 16-byte Folded Reload
	ret
	.loh AdrpAdd	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh14, Lloh15, Lloh16
	.loh AdrpLdrGotLdr	Lloh23, Lloh24, Lloh25
	.loh AdrpLdrGotLdr	Lloh20, Lloh21, Lloh22
	.loh AdrpLdrGotLdr	Lloh17, Lloh18, Lloh19
	.loh AdrpLdr	Lloh29, Lloh30
	.loh AdrpLdrGotLdr	Lloh26, Lloh27, Lloh28
	.loh AdrpLdrGotLdr	Lloh31, Lloh32, Lloh33
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"in png_do_dither\n"

	.comm	_PNG_COLOR_TYPE_RGB,8,3         ; @PNG_COLOR_TYPE_RGB
	.comm	_PNG_DITHER_RED_BITS,4,2        ; @PNG_DITHER_RED_BITS
	.comm	_PNG_DITHER_GREEN_BITS,4,2      ; @PNG_DITHER_GREEN_BITS
	.comm	_PNG_DITHER_BLUE_BITS,4,2       ; @PNG_DITHER_BLUE_BITS
	.comm	_PNG_COLOR_TYPE_PALETTE,8,3     ; @PNG_COLOR_TYPE_PALETTE
	.comm	_PNG_COLOR_TYPE_RGB_ALPHA,8,3   ; @PNG_COLOR_TYPE_RGB_ALPHA
.subsections_via_symbols
