	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.section	__TEXT,__literal16,16byte_literals
	.p2align	4                               ## -- Begin function png_setup_avg_row
LCPI0_0:
	.byte	255                             ## 0xff
	.byte	0                               ## 0x0
	.byte	0                               ## 0x0
	.byte	0                               ## 0x0
	.byte	255                             ## 0xff
	.byte	0                               ## 0x0
	.byte	0                               ## 0x0
	.byte	0                               ## 0x0
	.byte	0                               ## 0x0
	.byte	0                               ## 0x0
	.byte	0                               ## 0x0
	.byte	0                               ## 0x0
	.byte	0                               ## 0x0
	.byte	0                               ## 0x0
	.byte	0                               ## 0x0
	.byte	0                               ## 0x0
LCPI0_1:
	.long	128                             ## 0x80
	.long	128                             ## 0x80
	.space	4
	.space	4
LCPI0_2:
	.long	256                             ## 0x100
	.long	256                             ## 0x100
	.space	4
	.space	4
	.section	__TEXT,__text,regular,pure_instructions
	.p2align	4, 0x90
_png_setup_avg_row:                     ## @png_setup_avg_row
	.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
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	_PNG_FILTER_VALUE_AVG@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movq	16(%rdi), %r14
	movl	%eax, (%r14)
	movq	(%rdi), %r15
	movq	8(%rdi), %rbx
	leaq	4(%r14), %r8
	leaq	4(%rbx), %r10
	leaq	4(%r15), %r13
	testq	%rsi, %rsi
	je	LBB0_1
## %bb.2:
	cmpq	$4, %rsi
	jae	LBB0_4
## %bb.3:
	xorl	%eax, %eax
	jmp	LBB0_5
LBB0_1:
	xorl	%eax, %eax
	movq	%r13, %r12
	jmp	LBB0_13
LBB0_4:
	leaq	4(%r14), %r11
	movq	%r11, %rdi
	subq	%r15, %rdi
	addq	$-4, %rdi
	xorl	%eax, %eax
	cmpq	$16, %rdi
	jb	LBB0_5
## %bb.6:
	subq	%rbx, %r11
	addq	$-4, %r11
	cmpq	$16, %r11
	jb	LBB0_5
## %bb.7:
	movq	%rsi, %r11
	andq	$-4, %r11
	leaq	(,%r11,4), %r12
	addq	%r13, %r12
	leaq	(%r10,%r11,4), %r10
	leaq	(%r8,%r11,4), %r8
	pxor	%xmm2, %xmm2
	xorl	%eax, %eax
	movdqa	LCPI0_0(%rip), %xmm8            ## xmm8 = [255,0,0,0,255,0,0,0,0,0,0,0,0,0,0,0]
	movdqa	LCPI0_1(%rip), %xmm9            ## xmm9 = <128,128,u,u>
	movdqa	LCPI0_2(%rip), %xmm10           ## xmm10 = <256,256,u,u>
	pxor	%xmm3, %xmm3
	.p2align	4, 0x90
LBB0_8:                                 ## =>This Inner Loop Header: Depth=1
	movq	4(%r15,%rax,4), %xmm4           ## xmm4 = mem[0],zero
	movq	12(%r15,%rax,4), %xmm7          ## xmm7 = mem[0],zero
	movq	4(%rbx,%rax,4), %xmm5           ## xmm5 = mem[0],zero
	movq	12(%rbx,%rax,4), %xmm1          ## xmm1 = mem[0],zero
	movdqa	%xmm5, %xmm0
	psrld	$31, %xmm0
	paddd	%xmm5, %xmm0
	psrld	$1, %xmm0
	psubd	%xmm0, %xmm4
	movdqa	%xmm1, %xmm0
	psrld	$31, %xmm0
	paddd	%xmm1, %xmm0
	psrld	$1, %xmm0
	psubd	%xmm0, %xmm7
	pand	%xmm8, %xmm4
	pand	%xmm8, %xmm7
	movdqa	%xmm4, %xmm0
	punpcklqdq	%xmm7, %xmm0            ## xmm0 = xmm0[0],xmm7[0]
	movdqu	%xmm0, 4(%r14,%rax,4)
	movdqa	%xmm4, %xmm0
	pmaxud	%xmm9, %xmm0
	pcmpeqd	%xmm4, %xmm0
	movdqa	%xmm7, %xmm1
	pmaxud	%xmm9, %xmm1
	pcmpeqd	%xmm7, %xmm1
	movdqa	%xmm10, %xmm5
	psubd	%xmm4, %xmm5
	movdqa	%xmm10, %xmm6
	psubd	%xmm7, %xmm6
	blendvps	%xmm0, %xmm5, %xmm4
	movdqa	%xmm1, %xmm0
	blendvps	%xmm0, %xmm6, %xmm7
	pmovzxdq	%xmm4, %xmm0                    ## xmm0 = xmm4[0],zero,xmm4[1],zero
	paddq	%xmm0, %xmm2
	pmovzxdq	%xmm7, %xmm0                    ## xmm0 = xmm7[0],zero,xmm7[1],zero
	paddq	%xmm0, %xmm3
	addq	$4, %rax
	cmpq	%rax, %r11
	jne	LBB0_8
## %bb.9:
	paddq	%xmm2, %xmm3
	pshufd	$238, %xmm3, %xmm0              ## xmm0 = xmm3[2,3,2,3]
	paddq	%xmm3, %xmm0
	movq	%xmm0, %rax
	cmpq	%rsi, %r11
	jne	LBB0_10
	jmp	LBB0_13
LBB0_5:
	movq	%r13, %r12
	xorl	%r11d, %r11d
LBB0_10:
	movq	%r13, -48(%rbp)                 ## 8-byte Spill
	movq	%rsi, %r14
	subq	%r11, %r14
	xorl	%r9d, %r9d
	xorl	%r11d, %r11d
	.p2align	4, 0x90
LBB0_11:                                ## =>This Inner Loop Header: Depth=1
	movl	(%r12,%r9,4), %r13d
	movl	(%r10,%r9,4), %r15d
	movl	%r15d, %ebx
	shrl	$31, %ebx
	addl	%r15d, %ebx
	shrl	%ebx
	subl	%ebx, %r13d
	movzbl	%r13b, %ebx
	movl	%ebx, (%r8,%r9,4)
	movl	$256, %edi                      ## imm = 0x100
	subl	%ebx, %edi
	cmpl	$128, %ebx
	cmovbl	%ebx, %edi
	addq	%rdi, %rax
	addq	$-4, %r11
	incq	%r9
	cmpq	%r9, %r14
	jne	LBB0_11
## %bb.12:
	subq	%r11, %r12
	subq	%r11, %r10
	subq	%r11, %r8
	movq	-48(%rbp), %r13                 ## 8-byte Reload
LBB0_13:
	cmpq	%rdx, %rsi
	jae	LBB0_17
## %bb.14:
	incq	%rsi
	xorl	%edi, %edi
	.p2align	4, 0x90
LBB0_15:                                ## =>This Inner Loop Header: Depth=1
	movq	%rax, %r9
	movl	(%r12,%rdi,4), %r11d
	movl	(%r13,%rdi,4), %eax
	addl	(%r10,%rdi,4), %eax
	movl	%eax, %ebx
	shrl	$31, %ebx
	addl	%eax, %ebx
	shrl	%ebx
	subl	%ebx, %r11d
	movzbl	%r11b, %ebx
	movl	%ebx, (%r8,%rdi,4)
	movl	$256, %eax                      ## imm = 0x100
	subl	%ebx, %eax
	cmpl	$128, %ebx
	cmovbl	%ebx, %eax
	addq	%r9, %rax
	cmpq	%rcx, %rax
	ja	LBB0_17
## %bb.16:                              ##   in Loop: Header=BB0_15 Depth=1
	leaq	(%rsi,%rdi), %rbx
	incq	%rdi
	cmpq	%rdx, %rbx
	jb	LBB0_15
LBB0_17:
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_PNG_FILTER_VALUE_AVG,4,2       ## @PNG_FILTER_VALUE_AVG
	.no_dead_strip	_png_setup_avg_row
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function png_setup_avg_row
_png_setup_avg_row:                     ; @png_setup_avg_row
	.cfi_startproc
; %bb.0:
Lloh0:
	adrp	x8, _PNG_FILTER_VALUE_AVG@GOTPAGE
Lloh1:
	ldr	x8, [x8, _PNG_FILTER_VALUE_AVG@GOTPAGEOFF]
Lloh2:
	ldr	w9, [x8]
	ldr	x8, [x0, #16]
	str	w9, [x8], #4
	ldp	x10, x9, [x0]
	add	x9, x9, #4
	add	x10, x10, #4
	cbz	x1, LBB0_4
; %bb.1:
	mov	x12, #0
	mov	x0, #0
	mov	w11, #256
	mov	x13, x1
LBB0_2:                                 ; =>This Inner Loop Header: Depth=1
	ldr	w14, [x10, x12]
	ldr	w15, [x9, x12]
	cmp	w15, #0
	cinc	w15, w15, lt
	sub	w14, w14, w15, lsr #1
	and	w14, w14, #0xff
	str	w14, [x8, x12]
	sub	w15, w11, w14
	cmp	w14, #128
	csel	w14, w14, w15, lo
	add	x0, x0, x14
	add	x12, x12, #4
	subs	x13, x13, #1
	b.ne	LBB0_2
; %bb.3:
	add	x11, x10, x12
	add	x9, x9, x12
	add	x8, x8, x12
	cmp	x1, x2
	b.lo	LBB0_5
	b	LBB0_7
LBB0_4:
	mov	x0, #0
	mov	x11, x10
	cmp	x1, x2
	b.hs	LBB0_7
LBB0_5:
	add	x12, x1, #1
	mov	w13, #256
LBB0_6:                                 ; =>This Inner Loop Header: Depth=1
	ldr	w14, [x11], #4
	ldr	w15, [x9], #4
	ldr	w16, [x10], #4
	add	w15, w16, w15
	cmp	w15, #0
	cinc	w15, w15, lt
	sub	w14, w14, w15, lsr #1
	and	w14, w14, #0xff
	str	w14, [x8], #4
	sub	w15, w13, w14
	cmp	w14, #128
	csel	w14, w14, w15, lo
	add	x0, x0, x14
	cmp	x0, x3
	ccmp	x12, x2, #2, ls
	add	x12, x12, #1
	b.lo	LBB0_6
LBB0_7:
	ret
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.cfi_endproc
                                        ; -- End function
	.comm	_PNG_FILTER_VALUE_AVG,4,2       ; @PNG_FILTER_VALUE_AVG
	.no_dead_strip	_png_setup_avg_row
.subsections_via_symbols
