	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_png_do_invert                  ## -- Begin function png_do_invert
	.p2align	4, 0x90
_png_do_invert:                         ## @png_do_invert
	.cfi_startproc
## %bb.0:
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset %rbp, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register %rbp
	pushq	%r14
	pushq	%rbx
	.cfi_offset %rbx, -32
	.cfi_offset %r14, -24
	movq	%rsi, %rbx
	movq	%rdi, %r14
	leaq	L_.str(%rip), %rsi
	movl	$1, %edi
	callq	_png_debug
	movq	(%r14), %rax
	movq	_PNG_COLOR_TYPE_GRAY@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jne	LBB0_14
## %bb.1:
	movq	8(%r14), %rax
	testq	%rax, %rax
	jle	LBB0_31
## %bb.2:
	cmpq	$4, %rax
	jae	LBB0_4
## %bb.3:
	xorl	%ecx, %ecx
	jmp	LBB0_12
LBB0_14:
	movq	_PNG_COLOR_TYPE_GRAY_ALPHA@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jne	LBB0_31
## %bb.15:
	movl	16(%r14), %eax
	cmpl	$16, %eax
	je	LBB0_24
## %bb.16:
	cmpl	$8, %eax
	jne	LBB0_31
## %bb.17:
	movq	8(%r14), %rdx
	testq	%rdx, %rdx
	jle	LBB0_31
## %bb.18:
	decq	%rdx
	movq	%rdx, %rcx
	shrq	%rcx
	incq	%rcx
	movl	%ecx, %eax
	andl	$3, %eax
	cmpq	$6, %rdx
	jb	LBB0_21
## %bb.19:
	andq	$-4, %rcx
	.p2align	4, 0x90
LBB0_20:                                ## =>This Inner Loop Header: Depth=1
	notq	(%rbx)
	notq	16(%rbx)
	notq	32(%rbx)
	notq	48(%rbx)
	addq	$64, %rbx
	addq	$-4, %rcx
	jne	LBB0_20
LBB0_21:
	testq	%rax, %rax
	je	LBB0_31
## %bb.22:
	shlq	$4, %rax
	xorl	%ecx, %ecx
	.p2align	4, 0x90
LBB0_23:                                ## =>This Inner Loop Header: Depth=1
	notq	(%rbx,%rcx)
	addq	$16, %rcx
	cmpq	%rcx, %rax
	jne	LBB0_23
	jmp	LBB0_31
LBB0_4:
	movq	%rax, %rcx
	andq	$-4, %rcx
	leaq	-4(%rcx), %rsi
	movq	%rsi, %rdx
	shrq	$2, %rdx
	incq	%rdx
	testq	%rsi, %rsi
	je	LBB0_5
## %bb.6:
	movabsq	$9223372036854775804, %rdi      ## imm = 0x7FFFFFFFFFFFFFFC
	orq	$2, %rdi
	andq	%rdx, %rdi
	xorl	%esi, %esi
	pcmpeqd	%xmm0, %xmm0
	.p2align	4, 0x90
LBB0_7:                                 ## =>This Inner Loop Header: Depth=1
	movdqu	(%rbx,%rsi,8), %xmm1
	movdqu	16(%rbx,%rsi,8), %xmm2
	movdqu	32(%rbx,%rsi,8), %xmm3
	movdqu	48(%rbx,%rsi,8), %xmm4
	pxor	%xmm0, %xmm1
	pxor	%xmm0, %xmm2
	movdqu	%xmm1, (%rbx,%rsi,8)
	movdqu	%xmm2, 16(%rbx,%rsi,8)
	pxor	%xmm0, %xmm3
	pxor	%xmm0, %xmm4
	movdqu	%xmm3, 32(%rbx,%rsi,8)
	movdqu	%xmm4, 48(%rbx,%rsi,8)
	addq	$8, %rsi
	addq	$-2, %rdi
	jne	LBB0_7
## %bb.8:
	testb	$1, %dl
	je	LBB0_10
LBB0_9:
	movdqu	(%rbx,%rsi,8), %xmm0
	movdqu	16(%rbx,%rsi,8), %xmm1
	pcmpeqd	%xmm2, %xmm2
	pxor	%xmm2, %xmm0
	pxor	%xmm2, %xmm1
	movdqu	%xmm0, (%rbx,%rsi,8)
	movdqu	%xmm1, 16(%rbx,%rsi,8)
LBB0_10:
	cmpq	%rcx, %rax
	je	LBB0_31
## %bb.11:
	leaq	(%rbx,%rcx,8), %rbx
LBB0_12:
	subq	%rcx, %rax
	xorl	%ecx, %ecx
	.p2align	4, 0x90
LBB0_13:                                ## =>This Inner Loop Header: Depth=1
	notq	(%rbx,%rcx,8)
	incq	%rcx
	cmpq	%rcx, %rax
	jne	LBB0_13
LBB0_31:
	popq	%rbx
	popq	%r14
	popq	%rbp
	retq
LBB0_24:
	movq	8(%r14), %rdx
	testq	%rdx, %rdx
	jle	LBB0_31
## %bb.25:
	decq	%rdx
	movq	%rdx, %rcx
	shrq	$2, %rcx
	incq	%rcx
	movl	%ecx, %eax
	andl	$3, %eax
	cmpq	$12, %rdx
	jb	LBB0_28
## %bb.26:
	andq	$-4, %rcx
	pcmpeqd	%xmm0, %xmm0
	.p2align	4, 0x90
LBB0_27:                                ## =>This Inner Loop Header: Depth=1
	movdqu	(%rbx), %xmm1
	movdqu	32(%rbx), %xmm2
	movdqu	64(%rbx), %xmm3
	movdqu	96(%rbx), %xmm4
	pxor	%xmm0, %xmm1
	movdqu	%xmm1, (%rbx)
	pxor	%xmm0, %xmm2
	movdqu	%xmm2, 32(%rbx)
	pxor	%xmm0, %xmm3
	movdqu	%xmm3, 64(%rbx)
	pxor	%xmm0, %xmm4
	movdqu	%xmm4, 96(%rbx)
	subq	$-128, %rbx
	addq	$-4, %rcx
	jne	LBB0_27
LBB0_28:
	testq	%rax, %rax
	je	LBB0_31
## %bb.29:
	shlq	$5, %rax
	xorl	%ecx, %ecx
	pcmpeqd	%xmm0, %xmm0
	.p2align	4, 0x90
LBB0_30:                                ## =>This Inner Loop Header: Depth=1
	movdqu	(%rbx,%rcx), %xmm1
	pxor	%xmm0, %xmm1
	movdqu	%xmm1, (%rbx,%rcx)
	addq	$32, %rcx
	cmpq	%rcx, %rax
	jne	LBB0_30
	jmp	LBB0_31
LBB0_5:
	xorl	%esi, %esi
	testb	$1, %dl
	jne	LBB0_9
	jmp	LBB0_10
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"in png_do_invert\n"

	.comm	_PNG_COLOR_TYPE_GRAY,8,3        ## @PNG_COLOR_TYPE_GRAY
	.comm	_PNG_COLOR_TYPE_GRAY_ALPHA,8,3  ## @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_invert                  ; -- Begin function png_do_invert
	.p2align	2
_png_do_invert:                         ; @png_do_invert
	.cfi_startproc
; %bb.0:
	stp	x20, x19, [sp, #-32]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 32
	stp	x29, x30, [sp, #16]             ; 16-byte Folded Spill
	add	x29, sp, #16
	.cfi_def_cfa w29, 16
	.cfi_offset w30, -8
	.cfi_offset w29, -16
	.cfi_offset w19, -24
	.cfi_offset w20, -32
	mov	x19, x1
	mov	x20, x0
Lloh0:
	adrp	x1, l_.str@PAGE
Lloh1:
	add	x1, x1, l_.str@PAGEOFF
	mov	w0, #1
	bl	_png_debug
	ldr	x8, [x20]
Lloh2:
	adrp	x9, _PNG_COLOR_TYPE_GRAY@GOTPAGE
Lloh3:
	ldr	x9, [x9, _PNG_COLOR_TYPE_GRAY@GOTPAGEOFF]
Lloh4:
	ldr	x9, [x9]
	cmp	x8, x9
	b.ne	LBB0_4
; %bb.1:
	ldr	x9, [x20, #8]
	cmp	x9, #1
	b.lt	LBB0_15
; %bb.2:
	cmp	x9, #8
	b.hs	LBB0_10
; %bb.3:
	mov	x10, #0
	mov	x8, x19
	b	LBB0_13
LBB0_4:
Lloh5:
	adrp	x9, _PNG_COLOR_TYPE_GRAY_ALPHA@GOTPAGE
Lloh6:
	ldr	x9, [x9, _PNG_COLOR_TYPE_GRAY_ALPHA@GOTPAGEOFF]
Lloh7:
	ldr	x9, [x9]
	cmp	x8, x9
	b.ne	LBB0_15
; %bb.5:
	ldr	w8, [x20, #16]
	cmp	w8, #16
	b.eq	LBB0_16
; %bb.6:
	cmp	w8, #8
	b.ne	LBB0_15
; %bb.7:
	ldr	x8, [x20, #8]
	subs	x9, x8, #1
	b.lt	LBB0_15
; %bb.8:
	cmp	x9, #6
	b.hs	LBB0_19
; %bb.9:
	mov	x9, #0
	mov	x10, x19
	b	LBB0_22
LBB0_10:
	and	x10, x9, #0xfffffffffffffff8
	add	x8, x19, x10, lsl #3
	add	x11, x19, #32
	mov	x12, x10
LBB0_11:                                ; =>This Inner Loop Header: Depth=1
	ldp	q0, q1, [x11, #-32]
	ldp	q2, q3, [x11]
	mvn.16b	v0, v0
	mvn.16b	v1, v1
	mvn.16b	v2, v2
	mvn.16b	v3, v3
	stp	q0, q1, [x11, #-32]
	stp	q2, q3, [x11], #64
	subs	x12, x12, #8
	b.ne	LBB0_11
; %bb.12:
	cmp	x9, x10
	b.eq	LBB0_15
LBB0_13:
	sub	x9, x9, x10
LBB0_14:                                ; =>This Inner Loop Header: Depth=1
	ldr	x10, [x8]
	mvn	x10, x10
	str	x10, [x8], #8
	subs	x9, x9, #1
	b.ne	LBB0_14
LBB0_15:
	ldp	x29, x30, [sp, #16]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp], #32             ; 16-byte Folded Reload
	ret
LBB0_16:
	ldr	x8, [x20, #8]
	subs	x9, x8, #1
	b.lt	LBB0_15
; %bb.17:
	cmp	x9, #4
	b.hs	LBB0_23
; %bb.18:
	mov	x9, #0
	mov	x10, x19
	b	LBB0_26
LBB0_19:
	lsr	x9, x9, #1
	add	x11, x9, #1
	and	x12, x11, #0xfffffffffffffffc
	lsl	x9, x12, #1
	add	x10, x19, x12, lsl #4
	add	x13, x19, #32
	mov	x14, x12
LBB0_20:                                ; =>This Inner Loop Header: Depth=1
	ldur	x15, [x13, #-32]
	ldur	x16, [x13, #-16]
	ldr	x17, [x13]
	ldr	x0, [x13, #16]
	mvn	x15, x15
	mvn	x16, x16
	mvn	x17, x17
	mvn	x0, x0
	stur	x15, [x13, #-32]
	stur	x16, [x13, #-16]
	str	x17, [x13]
	str	x0, [x13, #16]
	add	x13, x13, #64
	subs	x14, x14, #4
	b.ne	LBB0_20
; %bb.21:
	cmp	x11, x12
	b.eq	LBB0_15
LBB0_22:                                ; =>This Inner Loop Header: Depth=1
	ldr	x11, [x10]
	mvn	x11, x11
	str	x11, [x10], #16
	add	x9, x9, #2
	cmp	x9, x8
	b.lt	LBB0_22
	b	LBB0_15
LBB0_23:
	lsr	x9, x9, #2
	add	x11, x9, #1
	and	x12, x11, #0x7ffffffffffffffe
	lsl	x9, x12, #2
	add	x10, x19, x12, lsl #5
	add	x13, x19, #32
	mov	x14, x12
LBB0_24:                                ; =>This Inner Loop Header: Depth=1
	ldur	q0, [x13, #-32]
	mvn.16b	v0, v0
	stur	q0, [x13, #-32]
	ldr	q0, [x13]
	mvn.16b	v0, v0
	str	q0, [x13], #64
	subs	x14, x14, #2
	b.ne	LBB0_24
; %bb.25:
	cmp	x11, x12
	b.eq	LBB0_15
LBB0_26:                                ; =>This Inner Loop Header: Depth=1
	ldr	q0, [x10]
	mvn.16b	v0, v0
	str	q0, [x10], #32
	add	x9, x9, #4
	cmp	x9, x8
	b.lt	LBB0_26
	b	LBB0_15
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpAdd	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"in png_do_invert\n"

	.comm	_PNG_COLOR_TYPE_GRAY,8,3        ; @PNG_COLOR_TYPE_GRAY
	.comm	_PNG_COLOR_TYPE_GRAY_ALPHA,8,3  ; @PNG_COLOR_TYPE_GRAY_ALPHA
.subsections_via_symbols
