	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_png_do_strip_channel           ## -- Begin function png_do_strip_channel
	.p2align	4, 0x90
_png_do_strip_channel:                  ## @png_do_strip_channel
	.cfi_startproc
## %bb.0:
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset %rbp, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register %rbp
	movl	(%rdi), %r8d
	movl	4(%rdi), %eax
	leaq	(%rsi,%r8,8), %r10
	cmpl	$4, %eax
	je	LBB0_12
## %bb.1:
	cmpl	$2, %eax
	jne	LBB0_24
## %bb.2:
	movl	8(%rdi), %r8d
	cmpl	$16, %r8d
	je	LBB0_7
## %bb.3:
	cmpl	$8, %r8d
	jne	LBB0_24
## %bb.4:
	leaq	8(%rsi), %r9
	testl	%edx, %edx
	movq	%rsi, %rax
	cmoveq	%r9, %rax
	leaq	16(%rsi), %rdx
	cmovneq	%r9, %rdx
	cmpq	%r10, %rdx
	jae	LBB0_10
	.p2align	4, 0x90
LBB0_6:                                 ## =>This Inner Loop Header: Depth=1
	movq	(%rdx), %rcx
	movq	%rcx, (%rax)
	addq	$8, %rax
	addq	$16, %rdx
	cmpq	%r10, %rdx
	jb	LBB0_6
LBB0_10:
	movl	%r8d, 12(%rdi)
	movl	$1, 4(%rdi)
	movq	16(%rdi), %rcx
	movq	_PNG_COLOR_TYPE_GRAY_ALPHA@GOTPCREL(%rip), %rdx
	cmpq	(%rdx), %rcx
	jne	LBB0_23
## %bb.11:
	leaq	16(%rdi), %rcx
	movq	_PNG_COLOR_TYPE_GRAY@GOTPCREL(%rip), %rdx
	jmp	LBB0_22
LBB0_12:
	movl	8(%rdi), %eax
	cmpl	$16, %eax
	je	LBB0_17
## %bb.13:
	cmpl	$8, %eax
	jne	LBB0_24
## %bb.14:
	leaq	24(%rsi), %rax
	xorl	%ecx, %ecx
	testl	%edx, %edx
	cmovneq	%rsi, %rax
	sete	%cl
	leaq	(%rcx,%rcx,2), %rdx
	incq	%rdx
	movl	$24, %r9d
	cmpq	%r8, %rdx
	jae	LBB0_20
## %bb.15:
	leaq	(%rsi,%rdx,8), %rdx
	.p2align	4, 0x90
LBB0_16:                                ## =>This Inner Loop Header: Depth=1
	movq	(%rdx), %rcx
	movq	%rcx, (%rax)
	movq	8(%rdx), %rcx
	movq	%rcx, 8(%rax)
	movq	16(%rdx), %rcx
	movq	%rcx, 16(%rax)
	addq	$24, %rax
	addq	$32, %rdx
	cmpq	%r10, %rdx
	jb	LBB0_16
	jmp	LBB0_20
LBB0_7:
	leaq	16(%rsi), %rcx
	testl	%edx, %edx
	movq	%rsi, %rax
	cmoveq	%rcx, %rax
	leaq	32(%rsi), %rdx
	cmovneq	%rcx, %rdx
	cmpq	%r10, %rdx
	jae	LBB0_10
	.p2align	4, 0x90
LBB0_8:                                 ## =>This Inner Loop Header: Depth=1
	movq	(%rdx), %rcx
	movq	%rcx, (%rax)
	movq	8(%rdx), %rcx
	movq	%rcx, 8(%rax)
	addq	$16, %rax
	addq	$32, %rdx
	cmpq	%r10, %rdx
	jb	LBB0_8
	jmp	LBB0_10
LBB0_17:
	leaq	48(%rsi), %rax
	testl	%edx, %edx
	cmovneq	%rsi, %rax
	movl	$8, %ecx
	movl	$2, %edx
	cmoveq	%rcx, %rdx
	movl	$48, %r9d
	cmpq	%r8, %rdx
	jae	LBB0_20
## %bb.18:
	leaq	(%rsi,%rdx,8), %rdx
	.p2align	4, 0x90
LBB0_19:                                ## =>This Inner Loop Header: Depth=1
	movq	(%rdx), %rcx
	movq	%rcx, (%rax)
	movq	8(%rdx), %rcx
	movq	%rcx, 8(%rax)
	movq	16(%rdx), %rcx
	movq	%rcx, 16(%rax)
	movq	24(%rdx), %rcx
	movq	%rcx, 24(%rax)
	movq	32(%rdx), %rcx
	movq	%rcx, 32(%rax)
	movq	40(%rdx), %rcx
	movq	%rcx, 40(%rax)
	addq	$48, %rax
	addq	$64, %rdx
	cmpq	%r10, %rdx
	jb	LBB0_19
LBB0_20:
	movl	%r9d, 12(%rdi)
	movl	$3, 4(%rdi)
	movq	16(%rdi), %rcx
	movq	_PNG_COLOR_TYPE_RGB_ALPHA@GOTPCREL(%rip), %rdx
	cmpq	(%rdx), %rcx
	jne	LBB0_23
## %bb.21:
	leaq	16(%rdi), %rcx
	movq	_PNG_COLOR_TYPE_RGB@GOTPCREL(%rip), %rdx
LBB0_22:
	movq	(%rdx), %rdx
	movq	%rdx, (%rcx)
LBB0_23:
	subq	%rsi, %rax
	shrq	$3, %rax
	movl	%eax, (%rdi)
LBB0_24:
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_PNG_COLOR_TYPE_GRAY_ALPHA,8,3  ## @PNG_COLOR_TYPE_GRAY_ALPHA
	.comm	_PNG_COLOR_TYPE_GRAY,8,3        ## @PNG_COLOR_TYPE_GRAY
	.comm	_PNG_COLOR_TYPE_RGB_ALPHA,8,3   ## @PNG_COLOR_TYPE_RGB_ALPHA
	.comm	_PNG_COLOR_TYPE_RGB,8,3         ## @PNG_COLOR_TYPE_RGB
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_png_do_strip_channel           ; -- Begin function png_do_strip_channel
	.p2align	2
_png_do_strip_channel:                  ; @png_do_strip_channel
	.cfi_startproc
; %bb.0:
	ldp	w10, w8, [x0]
	add	x9, x1, x10, lsl #3
	cmp	w8, #4
	b.eq	LBB0_7
; %bb.1:
	cmp	w8, #2
	b.ne	LBB0_27
; %bb.2:
	ldr	w10, [x0, #8]
	cmp	w10, #16
	b.eq	LBB0_13
; %bb.3:
	cmp	w10, #8
	b.ne	LBB0_27
; %bb.4:
	add	x11, x1, #8
	add	x12, x1, #16
	cmp	w2, #0
	csel	x8, x11, x1, eq
	csel	x11, x12, x11, eq
LBB0_5:                                 ; =>This Inner Loop Header: Depth=1
	cmp	x11, x9
	b.hs	LBB0_16
; %bb.6:                                ;   in Loop: Header=BB0_5 Depth=1
	ldr	x12, [x11], #16
	str	x12, [x8], #8
	b	LBB0_5
LBB0_7:
	ldr	w8, [x0, #8]
	cmp	w8, #16
	b.eq	LBB0_18
; %bb.8:
	cmp	w8, #8
	b.ne	LBB0_27
; %bb.9:
	cmp	w2, #0
	mov	w11, #24
	csel	x8, x11, xzr, eq
	add	x8, x1, x8
	mov	w12, #4
	csinc	x12, x12, xzr, eq
	cmp	x12, x10
	b.hs	LBB0_23
; %bb.10:
	add	x10, x1, x12, lsl #3
LBB0_11:                                ; =>This Inner Loop Header: Depth=1
	ldr	x11, [x10]
	str	x11, [x8]
	ldr	x11, [x10, #8]
	str	x11, [x8, #8]
	ldr	x11, [x10, #16]
	add	x12, x8, #24
	str	x11, [x8, #16]
	add	x10, x10, #32
	mov	x8, x12
	cmp	x10, x9
	b.lo	LBB0_11
; %bb.12:
	mov	w11, #24
	b	LBB0_22
LBB0_13:
	add	x11, x1, #16
	add	x12, x1, #32
	cmp	w2, #0
	csel	x8, x11, x1, eq
	csel	x11, x12, x11, eq
	cmp	x11, x9
	b.hs	LBB0_16
LBB0_14:                                ; =>This Inner Loop Header: Depth=1
	ldr	x12, [x11]
	str	x12, [x8]
	ldr	x13, [x11, #8]
	add	x12, x8, #16
	str	x13, [x8, #8]
	add	x11, x11, #32
	mov	x8, x12
	cmp	x11, x9
	b.lo	LBB0_14
; %bb.15:
	mov	x8, x12
LBB0_16:
	mov	x9, x0
	ldr	x11, [x9, #16]!
	stur	w10, [x9, #-4]
	mov	w10, #1
	stur	w10, [x9, #-12]
Lloh0:
	adrp	x10, _PNG_COLOR_TYPE_GRAY_ALPHA@GOTPAGE
Lloh1:
	ldr	x10, [x10, _PNG_COLOR_TYPE_GRAY_ALPHA@GOTPAGEOFF]
Lloh2:
	ldr	x10, [x10]
	cmp	x11, x10
	b.ne	LBB0_26
; %bb.17:
Lloh3:
	adrp	x10, _PNG_COLOR_TYPE_GRAY@GOTPAGE
Lloh4:
	ldr	x10, [x10, _PNG_COLOR_TYPE_GRAY@GOTPAGEOFF]
	b	LBB0_25
LBB0_18:
	cmp	w2, #0
	mov	w11, #48
	csel	x8, x11, xzr, eq
	add	x8, x1, x8
	mov	w12, #2
	mov	w13, #8
	csel	x12, x13, x12, eq
                                        ; kill: def $w11 killed $w11 killed $x11 def $x11
	cmp	x12, x10
	b.hs	LBB0_23
; %bb.19:
	add	x10, x1, x12, lsl #3
LBB0_20:                                ; =>This Inner Loop Header: Depth=1
	ldr	x11, [x10]
	str	x11, [x8]
	ldr	x11, [x10, #8]
	str	x11, [x8, #8]
	ldr	x11, [x10, #16]
	str	x11, [x8, #16]
	ldr	x11, [x10, #24]
	str	x11, [x8, #24]
	ldr	x11, [x10, #32]
	str	x11, [x8, #32]
	ldr	x11, [x10, #40]
	add	x12, x8, #48
	str	x11, [x8, #40]
	add	x10, x10, #64
	mov	x8, x12
	cmp	x10, x9
	b.lo	LBB0_20
; %bb.21:
	mov	w11, #48
LBB0_22:
	mov	x8, x12
LBB0_23:
	mov	x9, x0
	ldr	x10, [x9, #16]!
	stur	w11, [x9, #-4]
	mov	w11, #3
	stur	w11, [x9, #-12]
Lloh5:
	adrp	x11, _PNG_COLOR_TYPE_RGB_ALPHA@GOTPAGE
Lloh6:
	ldr	x11, [x11, _PNG_COLOR_TYPE_RGB_ALPHA@GOTPAGEOFF]
Lloh7:
	ldr	x11, [x11]
	cmp	x10, x11
	b.ne	LBB0_26
; %bb.24:
Lloh8:
	adrp	x10, _PNG_COLOR_TYPE_RGB@GOTPAGE
Lloh9:
	ldr	x10, [x10, _PNG_COLOR_TYPE_RGB@GOTPAGEOFF]
LBB0_25:
	ldr	x10, [x10]
	str	x10, [x9]
LBB0_26:
	sub	x8, x8, x1
	lsr	x8, x8, #3
	str	w8, [x0]
LBB0_27:
	ret
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGot	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpLdrGot	Lloh8, Lloh9
	.cfi_endproc
                                        ; -- End function
	.comm	_PNG_COLOR_TYPE_GRAY_ALPHA,8,3  ; @PNG_COLOR_TYPE_GRAY_ALPHA
	.comm	_PNG_COLOR_TYPE_GRAY,8,3        ; @PNG_COLOR_TYPE_GRAY
	.comm	_PNG_COLOR_TYPE_RGB_ALPHA,8,3   ; @PNG_COLOR_TYPE_RGB_ALPHA
	.comm	_PNG_COLOR_TYPE_RGB,8,3         ; @PNG_COLOR_TYPE_RGB
.subsections_via_symbols
