	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_png_do_gray_to_rgb             ## -- Begin function png_do_gray_to_rgb
	.p2align	4, 0x90
_png_do_gray_to_rgb:                    ## @png_do_gray_to_rgb
	.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	%rbx
	pushq	%rax
	.cfi_offset %rbx, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rsi, %rbx
	movq	%rdi, %r15
	movq	(%rdi), %r14
	leaq	L_.str(%rip), %rsi
	movl	$1, %edi
	callq	_png_debug
	movl	8(%r15), %eax
	cmpl	$8, %eax
	jl	LBB0_30
## %bb.1:
	movl	12(%r15), %r8d
	movq	_PNG_COLOR_MASK_COLOR@GOTPCREL(%rip), %rcx
	movl	(%rcx), %r9d
	testl	%r8d, %r9d
	jne	LBB0_30
## %bb.2:
	movq	_PNG_COLOR_TYPE_GRAY@GOTPCREL(%rip), %rcx
	cmpl	(%rcx), %r8d
	jne	LBB0_18
## %bb.3:
	cmpl	$8, %eax
	jne	LBB0_12
## %bb.4:
	testq	%r14, %r14
	jle	LBB0_29
## %bb.5:
	movslq	%r14d, %rsi
	leal	(%rsi,%rsi), %ecx
	movslq	%ecx, %rcx
	cmpq	$1, %r14
	jne	LBB0_7
## %bb.6:
	leaq	(%rbx,%rsi,8), %rdi
	leaq	(%rbx,%rsi,8), %rsi
	addq	$-8, %rsi
	leaq	(%rdi,%rcx,8), %rcx
	addq	$-8, %rcx
	jmp	LBB0_10
LBB0_18:
	movq	_PNG_COLOR_TYPE_GRAY_ALPHA@GOTPCREL(%rip), %rcx
	cmpl	(%rcx), %r8d
	jne	LBB0_29
## %bb.19:
	cmpl	$8, %eax
	jne	LBB0_26
## %bb.20:
	testq	%r14, %r14
	jle	LBB0_29
## %bb.21:
	leal	(%r14,%r14), %ecx
	movslq	%ecx, %rcx
	leaq	(%rbx,%rcx,8), %rdx
	leaq	(%rbx,%rcx,8), %rdi
	addq	$-8, %rdi
	leaq	(%rdx,%rcx,8), %rsi
	addq	$-8, %rsi
	cmpq	$1, %r14
	je	LBB0_24
## %bb.22:
	movq	%r14, %rbx
	andq	$-2, %rbx
	.p2align	4, 0x90
LBB0_23:                                ## =>This Inner Loop Header: Depth=1
	movq	(%rdi), %rcx
	movq	%rcx, (%rsi)
	movq	-8(%rdi), %rcx
	movq	%rcx, -8(%rsi)
	movq	-8(%rdi), %rcx
	movq	%rcx, -16(%rsi)
	movq	-8(%rdi), %rcx
	movq	%rcx, -24(%rsi)
	movq	-16(%rdi), %rcx
	movq	%rcx, -32(%rsi)
	movq	-24(%rdi), %rcx
	movq	%rcx, -40(%rsi)
	movq	-24(%rdi), %rcx
	movq	%rcx, -48(%rsi)
	movq	-24(%rdi), %rcx
	addq	$-32, %rdi
	movq	%rcx, -56(%rsi)
	addq	$-64, %rsi
	addq	$-2, %rbx
	jne	LBB0_23
LBB0_24:
	testb	$1, %r14b
	je	LBB0_29
## %bb.25:
	movq	(%rdi), %rcx
	movq	%rcx, (%rsi)
	movq	-8(%rdi), %rcx
	movq	%rcx, -8(%rsi)
	movq	-8(%rdi), %rcx
	movq	%rcx, -16(%rsi)
	movq	-8(%rdi), %rcx
	movq	%rcx, -24(%rsi)
	jmp	LBB0_29
LBB0_12:
	testq	%r14, %r14
	jle	LBB0_29
## %bb.13:
	leal	(%r14,%r14), %ecx
	movslq	%ecx, %rcx
	leaq	(%rbx,%rcx,8), %rdx
	leaq	(%rbx,%rcx,8), %rsi
	addq	$-8, %rsi
	leal	(,%r14,4), %ecx
	movslq	%ecx, %rcx
	leaq	(%rdx,%rcx,8), %rdi
	addq	$-8, %rdi
	cmpq	$1, %r14
	je	LBB0_16
## %bb.14:
	movq	%r14, %rbx
	andq	$-2, %rbx
	.p2align	4, 0x90
LBB0_15:                                ## =>This Inner Loop Header: Depth=1
	movq	(%rsi), %rcx
	movq	%rcx, (%rdi)
	movq	-8(%rsi), %rcx
	movq	%rcx, -8(%rdi)
	movq	(%rsi), %rcx
	movq	%rcx, -16(%rdi)
	movq	-8(%rsi), %rcx
	movq	%rcx, -24(%rdi)
	movq	(%rsi), %rcx
	movq	%rcx, -32(%rdi)
	movq	-8(%rsi), %rcx
	movq	%rcx, -40(%rdi)
	movq	-16(%rsi), %rcx
	movq	%rcx, -48(%rdi)
	movq	-24(%rsi), %rcx
	movq	%rcx, -56(%rdi)
	movq	-16(%rsi), %rcx
	movq	%rcx, -64(%rdi)
	movq	-24(%rsi), %rcx
	movq	%rcx, -72(%rdi)
	movq	-16(%rsi), %rcx
	movq	%rcx, -80(%rdi)
	movq	-24(%rsi), %rcx
	addq	$-32, %rsi
	movq	%rcx, -88(%rdi)
	addq	$-96, %rdi
	addq	$-2, %rbx
	jne	LBB0_15
LBB0_16:
	testb	$1, %r14b
	je	LBB0_29
## %bb.17:
	movq	(%rsi), %rcx
	movq	%rcx, (%rdi)
	movq	-8(%rsi), %rcx
	movq	%rcx, -8(%rdi)
	movq	(%rsi), %rcx
	movq	%rcx, -16(%rdi)
	movq	-8(%rsi), %rcx
	movq	%rcx, -24(%rdi)
	movq	(%rsi), %rcx
	movq	%rcx, -32(%rdi)
	movq	-8(%rsi), %rcx
	movq	%rcx, -40(%rdi)
	jmp	LBB0_29
LBB0_26:
	testq	%r14, %r14
	jle	LBB0_29
## %bb.27:
	leal	(,%r14,4), %ecx
	movslq	%ecx, %rcx
	shlq	$3, %rcx
	movq	%r14, %rsi
	.p2align	4, 0x90
LBB0_28:                                ## =>This Inner Loop Header: Depth=1
	movq	-8(%rbx,%rcx), %rdx
	movq	%rdx, -8(%rbx,%rcx,2)
	movq	-16(%rbx,%rcx), %rdx
	movq	%rdx, -16(%rbx,%rcx,2)
	movq	-24(%rbx,%rcx), %rdx
	movq	%rdx, -24(%rbx,%rcx,2)
	movq	-32(%rbx,%rcx), %rdx
	movq	%rdx, -32(%rbx,%rcx,2)
	movq	-24(%rbx,%rcx), %rdx
	movq	%rdx, -40(%rbx,%rcx,2)
	movq	-32(%rbx,%rcx), %rdx
	movq	%rdx, -48(%rbx,%rcx,2)
	movq	-24(%rbx,%rcx), %rdx
	movq	%rdx, -56(%rbx,%rcx,2)
	movq	-32(%rbx,%rcx), %rdx
	movq	%rdx, -64(%rbx,%rcx,2)
	addq	$-32, %rcx
	decq	%rsi
	jne	LBB0_28
	jmp	LBB0_29
LBB0_7:
	movq	%r14, %rdi
	andq	$-2, %rdi
	leaq	(%rbx,%rcx,8), %rcx
	addq	$-8, %rcx
	addq	$-8, %rbx
	.p2align	4, 0x90
LBB0_8:                                 ## =>This Inner Loop Header: Depth=1
	movq	(%rbx,%rsi,8), %rdx
	movq	%rdx, (%rcx,%rsi,8)
	movq	(%rbx,%rsi,8), %rdx
	movq	%rdx, -8(%rcx,%rsi,8)
	movq	(%rbx,%rsi,8), %rdx
	movq	%rdx, -16(%rcx,%rsi,8)
	movq	-8(%rbx,%rsi,8), %rdx
	movq	%rdx, -24(%rcx,%rsi,8)
	movq	-8(%rbx,%rsi,8), %rdx
	movq	%rdx, -32(%rcx,%rsi,8)
	movq	-8(%rbx,%rsi,8), %rdx
	movq	%rdx, -40(%rcx,%rsi,8)
	addq	$-48, %rcx
	addq	$-16, %rbx
	addq	$-2, %rdi
	jne	LBB0_8
## %bb.9:
	leaq	(%rcx,%rsi,8), %rcx
	leaq	(%rbx,%rsi,8), %rsi
LBB0_10:
	testb	$1, %r14b
	je	LBB0_29
## %bb.11:
	movq	(%rsi), %rdx
	movq	%rdx, (%rcx)
	movq	(%rsi), %rdx
	movq	%rdx, -8(%rcx)
	movq	(%rsi), %rdx
	movq	%rdx, -16(%rcx)
LBB0_29:
	movl	16(%r15), %ecx
	addl	$2, %ecx
	movl	%ecx, 16(%r15)
	orl	%r8d, %r9d
	movl	%r9d, 12(%r15)
	imull	%eax, %ecx
	movslq	%ecx, %rdi
	movq	%rdi, 24(%r15)
	movq	%r14, %rsi
	callq	_PNG_ROWBYTES
	movl	%eax, 32(%r15)
LBB0_30:
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"in png_do_gray_to_rgb\n"

	.comm	_PNG_COLOR_MASK_COLOR,4,2       ## @PNG_COLOR_MASK_COLOR
	.comm	_PNG_COLOR_TYPE_GRAY,4,2        ## @PNG_COLOR_TYPE_GRAY
	.comm	_PNG_COLOR_TYPE_GRAY_ALPHA,4,2  ## @PNG_COLOR_TYPE_GRAY_ALPHA
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_png_do_gray_to_rgb             ; -- Begin function png_do_gray_to_rgb
	.p2align	2
_png_do_gray_to_rgb:                    ; @png_do_gray_to_rgb
	.cfi_startproc
; %bb.0:
	stp	x22, x21, [sp, #-48]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 48
	stp	x20, x19, [sp, #16]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #32]             ; 16-byte Folded Spill
	add	x29, sp, #32
	.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
	mov	x21, x1
	mov	x19, x0
	ldr	x20, [x0]
Lloh0:
	adrp	x1, l_.str@PAGE
Lloh1:
	add	x1, x1, l_.str@PAGEOFF
	mov	w0, #1
	bl	_png_debug
	ldr	w8, [x19, #8]
	cmp	w8, #8
	b.lt	LBB0_19
; %bb.1:
	ldr	w9, [x19, #12]
Lloh2:
	adrp	x10, _PNG_COLOR_MASK_COLOR@GOTPAGE
Lloh3:
	ldr	x10, [x10, _PNG_COLOR_MASK_COLOR@GOTPAGEOFF]
Lloh4:
	ldr	w10, [x10]
	tst	w10, w9
	b.ne	LBB0_19
; %bb.2:
Lloh5:
	adrp	x11, _PNG_COLOR_TYPE_GRAY@GOTPAGE
Lloh6:
	ldr	x11, [x11, _PNG_COLOR_TYPE_GRAY@GOTPAGEOFF]
Lloh7:
	ldr	w11, [x11]
	cmp	w9, w11
	b.ne	LBB0_7
; %bb.3:
	cmp	w8, #8
	b.ne	LBB0_12
; %bb.4:
	cmp	x20, #1
	b.lt	LBB0_18
; %bb.5:
	lsl	x11, x20, #32
	add	x11, x21, x11, asr #29
	sub	x11, x11, #8
	lsl	w12, w20, #1
	add	x12, x11, w12, sxtw #3
	mov	x13, x20
LBB0_6:                                 ; =>This Inner Loop Header: Depth=1
	ldr	x14, [x11]
	str	x14, [x12]
	ldr	x14, [x11]
	stur	x14, [x12, #-8]
	ldr	x14, [x11], #-8
	stur	x14, [x12, #-16]
	sub	x12, x12, #24
	sub	x13, x13, #1
	cbnz	x13, LBB0_6
	b	LBB0_18
LBB0_7:
Lloh8:
	adrp	x11, _PNG_COLOR_TYPE_GRAY_ALPHA@GOTPAGE
Lloh9:
	ldr	x11, [x11, _PNG_COLOR_TYPE_GRAY_ALPHA@GOTPAGEOFF]
Lloh10:
	ldr	w11, [x11]
	cmp	w9, w11
	b.ne	LBB0_18
; %bb.8:
	cmp	w8, #8
	b.ne	LBB0_15
; %bb.9:
	cmp	x20, #1
	b.lt	LBB0_18
; %bb.10:
	lsl	w11, w20, #1
	sbfiz	x12, x11, #3, #32
	add	x11, x21, x12
	sub	x11, x11, #8
	add	x12, x11, x12
	mov	x13, x20
LBB0_11:                                ; =>This Inner Loop Header: Depth=1
	ldr	x14, [x11]
	str	x14, [x12]
	ldur	x14, [x11, #-8]
	stur	x14, [x12, #-8]
	ldur	x14, [x11, #-8]
	stur	x14, [x12, #-16]
	ldur	x14, [x11, #-8]
	stur	x14, [x12, #-24]
	sub	x11, x11, #16
	sub	x12, x12, #32
	sub	x13, x13, #1
	cbnz	x13, LBB0_11
	b	LBB0_18
LBB0_12:
	cmp	x20, #1
	b.lt	LBB0_18
; %bb.13:
	sxtw	x12, w20
	add	x11, x21, w20, sxtw #4
	sub	x11, x11, #8
	add	x12, x11, x12, lsl #5
	mov	x13, x20
LBB0_14:                                ; =>This Inner Loop Header: Depth=1
	ldr	x14, [x11]
	str	x14, [x12]
	ldur	x14, [x11, #-8]
	stur	x14, [x12, #-8]
	ldr	x14, [x11]
	stur	x14, [x12, #-16]
	ldur	x14, [x11, #-8]
	stur	x14, [x12, #-24]
	ldr	x14, [x11]
	stur	x14, [x12, #-32]
	ldur	x14, [x11, #-8]
	stur	x14, [x12, #-40]
	sub	x11, x11, #16
	sub	x12, x12, #48
	sub	x13, x13, #1
	cbnz	x13, LBB0_14
	b	LBB0_18
LBB0_15:
	cmp	x20, #1
	b.lt	LBB0_18
; %bb.16:
	lsl	w11, w20, #2
	sbfiz	x12, x11, #3, #32
	add	x11, x21, x12
	sub	x11, x11, #8
	add	x12, x11, x12
	mov	x13, x20
LBB0_17:                                ; =>This Inner Loop Header: Depth=1
	ldr	x14, [x11]
	str	x14, [x12]
	ldur	x14, [x11, #-8]
	stur	x14, [x12, #-8]
	ldur	x14, [x11, #-16]
	stur	x14, [x12, #-16]
	ldur	x14, [x11, #-24]
	stur	x14, [x12, #-24]
	ldur	x14, [x11, #-16]
	stur	x14, [x12, #-32]
	ldur	x14, [x11, #-24]
	stur	x14, [x12, #-40]
	ldur	x14, [x11, #-16]
	stur	x14, [x12, #-48]
	ldur	x14, [x11, #-24]
	stur	x14, [x12, #-56]
	sub	x11, x11, #32
	sub	x12, x12, #64
	sub	x13, x13, #1
	cbnz	x13, LBB0_17
LBB0_18:
	ldr	w11, [x19, #16]
	add	w11, w11, #2
	orr	w9, w10, w9
	stp	w9, w11, [x19, #12]
	mul	w8, w11, w8
	sxtw	x0, w8
	str	x0, [x19, #24]
	mov	x1, x20
	bl	_PNG_ROWBYTES
	str	w0, [x19, #32]
LBB0_19:
	ldp	x29, x30, [sp, #32]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #16]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp], #48             ; 16-byte Folded Reload
	ret
	.loh AdrpAdd	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"in png_do_gray_to_rgb\n"

	.comm	_PNG_COLOR_MASK_COLOR,4,2       ; @PNG_COLOR_MASK_COLOR
	.comm	_PNG_COLOR_TYPE_GRAY,4,2        ; @PNG_COLOR_TYPE_GRAY
	.comm	_PNG_COLOR_TYPE_GRAY_ALPHA,4,2  ; @PNG_COLOR_TYPE_GRAY_ALPHA
.subsections_via_symbols
