	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_png_do_unpack                  ## -- Begin function png_do_unpack
	.p2align	4, 0x90
_png_do_unpack:                         ## @png_do_unpack
	.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
	movl	(%r14), %eax
	cmpl	$7, %eax
	jg	LBB0_26
## %bb.1:
	movl	4(%r14), %r8d
	cmpl	$4, %eax
	je	LBB0_18
## %bb.2:
	cmpl	$2, %eax
	je	LBB0_11
## %bb.3:
	cmpl	$1, %eax
	jne	LBB0_25
## %bb.4:
	testl	%r8d, %r8d
	jle	LBB0_25
## %bb.5:
	movl	%r8d, %eax
	negl	%eax
	andl	$7, %eax
	leaq	(%rbx,%r8,4), %rdi
	leal	-1(%r8), %ecx
	movl	%ecx, %edx
	shrl	$3, %edx
	leaq	(%rbx,%rdx,4), %rsi
	testl	%ecx, %ecx
	je	LBB0_6
## %bb.7:
	movl	%r8d, %r10d
	andl	$-2, %r10d
	xorl	%r9d, %r9d
	movq	%rsi, %rcx
	.p2align	4, 0x90
LBB0_8:                                 ## =>This Inner Loop Header: Depth=1
	movl	(%rsi), %ebx
	xorl	%edx, %edx
	btl	%eax, %ebx
	setb	%dl
	movl	%edx, -4(%rdi)
	leal	1(%rax), %edx
	xorl	%ebx, %ebx
	cmpl	$7, %eax
	sete	%bl
	cmovel	%r9d, %edx
	shlq	$2, %rbx
	subq	%rbx, %rcx
	negq	%rbx
	leaq	-8(%rdi), %r11
	movl	(%rsi,%rbx), %eax
	xorl	%esi, %esi
	btl	%edx, %eax
	setb	%sil
	movl	%esi, -8(%rdi)
	leal	1(%rdx), %eax
	xorl	%esi, %esi
	cmpl	$7, %edx
	cmovel	%r9d, %eax
	sete	%sil
	shlq	$2, %rsi
	subq	%rsi, %rcx
	movq	%r11, %rdi
	movq	%rcx, %rsi
	addl	$-2, %r10d
	jne	LBB0_8
## %bb.9:
	testb	$1, %r8b
	jne	LBB0_10
	jmp	LBB0_25
LBB0_18:
	testl	%r8d, %r8d
	jle	LBB0_25
## %bb.19:
	leal	(,%r8,4), %ecx
	andl	$4, %ecx
	leaq	(%rbx,%r8,4), %r9
	leal	-1(%r8), %eax
	movl	%eax, %edx
	shrl	%edx
	leaq	(%rbx,%rdx,4), %rbx
	testl	%eax, %eax
	je	LBB0_20
## %bb.21:
	movl	%r8d, %edx
	andl	$-2, %edx
	movq	%rbx, %rdi
	.p2align	4, 0x90
LBB0_22:                                ## =>This Inner Loop Header: Depth=1
	movl	(%rbx), %eax
	sarl	%cl, %eax
	andl	$15, %eax
	movl	%eax, -4(%r9)
	xorl	%esi, %esi
	xorl	%eax, %eax
	cmpl	$4, %ecx
	setne	%sil
	sete	%al
	leaq	(,%rax,4), %rcx
	subq	%rcx, %rdi
	negq	%rcx
	movl	(%rbx,%rcx), %ebx
	leal	(,%rsi,4), %ecx
                                        ## kill: def $cl killed $cl killed $ecx
	sarl	%cl, %ebx
	andl	$15, %ebx
	movl	%ebx, -8(%r9)
	addq	$-8, %r9
	shlq	$2, %rsi
	subq	%rsi, %rdi
	shll	$2, %eax
	movl	%eax, %ecx
	movq	%rdi, %rbx
	addl	$-2, %edx
	jne	LBB0_22
## %bb.23:
	testb	$1, %r8b
	jne	LBB0_24
	jmp	LBB0_25
LBB0_11:
	testl	%r8d, %r8d
	jle	LBB0_25
## %bb.12:
	leal	(%r8,%r8), %ecx
	addl	$6, %ecx
	notl	%ecx
	andl	$6, %ecx
	leaq	(%rbx,%r8,4), %r10
	leal	-1(%r8), %eax
	movl	%eax, %edx
	andl	$-4, %edx
	addq	%rbx, %rdx
	testl	%eax, %eax
	je	LBB0_13
## %bb.14:
	movl	%r8d, %ebx
	andl	$-2, %ebx
	xorl	%r9d, %r9d
	movq	%rdx, %rdi
	.p2align	4, 0x90
LBB0_15:                                ## =>This Inner Loop Header: Depth=1
	movl	(%rdx), %eax
	sarl	%cl, %eax
	andl	$3, %eax
	movl	%eax, -4(%r10)
	leal	2(%rcx), %eax
	xorl	%esi, %esi
	cmpl	$6, %ecx
	cmovel	%r9d, %eax
	sete	%sil
	shlq	$2, %rsi
	subq	%rsi, %rdi
	negq	%rsi
	movl	(%rdx,%rsi), %edx
	movl	%eax, %ecx
	sarl	%cl, %edx
	andl	$3, %edx
	movl	%edx, -8(%r10)
	addq	$-8, %r10
	leal	2(%rax), %ecx
	xorl	%edx, %edx
	cmpl	$6, %eax
	cmovel	%r9d, %ecx
	sete	%dl
	shlq	$2, %rdx
	subq	%rdx, %rdi
	movq	%rdi, %rdx
	addl	$-2, %ebx
	jne	LBB0_15
## %bb.16:
	testb	$1, %r8b
	jne	LBB0_17
	jmp	LBB0_25
LBB0_20:
	movl	%ecx, %eax
	movq	%rbx, %rdi
	testb	$1, %r8b
	je	LBB0_25
LBB0_24:
	movl	(%rdi), %edx
	movl	%eax, %ecx
	sarl	%cl, %edx
	andl	$15, %edx
	movl	%edx, -4(%r9)
	jmp	LBB0_25
LBB0_13:
	movq	%rdx, %rdi
	testb	$1, %r8b
	je	LBB0_25
LBB0_17:
	movl	(%rdi), %eax
                                        ## kill: def $cl killed $cl killed $rcx
	sarl	%cl, %eax
	andl	$3, %eax
	movl	%eax, -4(%r10)
	jmp	LBB0_25
LBB0_6:
	movq	%rdi, %r11
	movq	%rsi, %rcx
	testb	$1, %r8b
	je	LBB0_25
LBB0_10:
	movl	(%rcx), %ecx
	xorl	%edx, %edx
	btl	%eax, %ecx
	setb	%dl
	movl	%edx, -4(%r11)
LBB0_25:
	movl	$8, (%r14)
	movslq	8(%r14), %rax
	imull	%eax, %r8d
	shlq	$3, %rax
	movq	%rax, 16(%r14)
	movl	%r8d, 12(%r14)
LBB0_26:
	popq	%rbx
	popq	%r14
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"in png_do_unpack\n"

.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_png_do_unpack                  ; -- Begin function png_do_unpack
	.p2align	2
_png_do_unpack:                         ; @png_do_unpack
	.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	x20, x1
	mov	x19, x0
Lloh0:
	adrp	x1, l_.str@PAGE
Lloh1:
	add	x1, x1, l_.str@PAGEOFF
	mov	w0, #1
	bl	_png_debug
	ldr	w9, [x19]
	cmp	w9, #7
	b.gt	LBB0_14
; %bb.1:
	ldr	w8, [x19, #4]
	cmp	w9, #4
	b.eq	LBB0_7
; %bb.2:
	cmp	w9, #2
	b.eq	LBB0_10
; %bb.3:
	cmp	w9, #1
	b.ne	LBB0_13
; %bb.4:
	cmp	w8, #1
	b.lt	LBB0_13
; %bb.5:
	neg	w9, w8
	and	w9, w9, #0x7
	sub	w10, w8, #1
	lsr	w10, w10, #3
	add	x10, x20, w10, uxtw #2
	sub	x11, x20, #4
	mov	x12, #-4
	mov	x13, x8
LBB0_6:                                 ; =>This Inner Loop Header: Depth=1
	ldr	w14, [x10]
	lsr	w14, w14, w9
	and	w14, w14, #0x1
	str	w14, [x11, x13, lsl #2]
	cmp	w9, #7
	csel	x14, x12, xzr, eq
	add	x10, x10, x14
	csinc	w9, wzr, w9, eq
	sub	x13, x13, #1
	cbnz	w13, LBB0_6
	b	LBB0_13
LBB0_7:
	cmp	w8, #1
	b.lt	LBB0_13
; %bb.8:
	ubfiz	w11, w8, #2, #1
	sub	w9, w8, #1
	lsr	w9, w9, #1
	add	x9, x20, w9, uxtw #2
	sub	x10, x20, #4
	mov	x12, #-4
	mov	x13, x8
LBB0_9:                                 ; =>This Inner Loop Header: Depth=1
	ldr	w14, [x9]
	asr	w14, w14, w11
	cmp	w11, #4
	cset	w11, ne
	and	w14, w14, #0xf
	str	w14, [x10, x13, lsl #2]
	csel	x14, x12, xzr, eq
	add	x9, x9, x14
	lsl	w11, w11, #2
	sub	x13, x13, #1
	cbnz	w13, LBB0_9
	b	LBB0_13
LBB0_10:
	cmp	w8, #1
	b.lt	LBB0_13
; %bb.11:
	lsl	w9, w8, #1
	add	w9, w9, #6
	mvn	w9, w9
	and	w10, w9, #0x6
	sub	w9, w8, #1
	and	w9, w9, #0xfffffffc
	add	x9, x20, x9
	sub	x11, x20, #4
	mov	x12, #-4
	mov	x13, x8
LBB0_12:                                ; =>This Inner Loop Header: Depth=1
	ldr	w14, [x9]
	asr	w14, w14, w10
	and	w14, w14, #0x3
	str	w14, [x11, x13, lsl #2]
	add	w14, w10, #2
	cmp	w10, #6
	csel	w10, wzr, w14, eq
	csel	x14, x12, xzr, eq
	add	x9, x9, x14
	sub	x13, x13, #1
	cbnz	w13, LBB0_12
LBB0_13:
	mov	w9, #8
	str	w9, [x19]
	ldrsw	x9, [x19, #8]
	lsl	x10, x9, #3
	str	x10, [x19, #16]
	mul	w8, w9, w8
	str	w8, [x19, #12]
LBB0_14:
	ldp	x29, x30, [sp, #16]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp], #32             ; 16-byte Folded Reload
	ret
	.loh AdrpAdd	Lloh0, Lloh1
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"in png_do_unpack\n"

.subsections_via_symbols
