	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function png_do_shift
_png_do_shift:                          ## @png_do_shift
	.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
	subq	$56, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdx, %r14
	movq	%rsi, %r12
	movq	%rdi, %r15
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	%rax, -48(%rbp)
	leaq	L_.str(%rip), %rsi
	movl	$1, %edi
	callq	_png_debug
	movl	(%r15), %eax
	movq	_PNG_COLOR_TYPE_PALETTE@GOTPCREL(%rip), %rcx
	cmpl	(%rcx), %eax
	jne	LBB0_1
LBB0_26:
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	cmpq	-48(%rbp), %rax
	jne	LBB0_28
## %bb.27:
	addq	$56, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_1:
	movq	_PNG_COLOR_MASK_COLOR@GOTPCREL(%rip), %rcx
	movl	4(%r15), %r9d
	testl	%eax, (%rcx)
	je	LBB0_3
## %bb.2:
	movl	(%r14), %r13d
	movl	4(%r14), %ecx
	movl	%r9d, %edx
	subl	%ecx, %edx
	movl	%edx, -60(%rbp)
	movl	%ecx, -76(%rbp)
	movl	8(%r14), %ecx
	movl	%r9d, %edx
	subl	%ecx, %edx
	movl	%edx, -56(%rbp)
	movl	%ecx, -72(%rbp)
	movl	$3, -88(%rbp)                   ## 4-byte Folded Spill
	jmp	LBB0_4
LBB0_3:
	movl	12(%r14), %r13d
	movl	$1, -88(%rbp)                   ## 4-byte Folded Spill
LBB0_4:
	movl	%r9d, %ecx
	subl	%r13d, %ecx
	movl	%ecx, -64(%rbp)
	movl	%r13d, -80(%rbp)
	movq	_PNG_COLOR_MASK_ALPHA@GOTPCREL(%rip), %rcx
	testl	%eax, (%rcx)
	je	LBB0_6
## %bb.5:
	movl	16(%r14), %eax
	movl	%r9d, %ecx
	subl	%eax, %ecx
	movl	-88(%rbp), %esi                 ## 4-byte Reload
	movl	%esi, %edx
	movl	%ecx, -64(%rbp,%rdx,4)
	movl	%eax, -80(%rbp,%rdx,4)
	incl	%esi
	movl	%esi, -88(%rbp)                 ## 4-byte Spill
LBB0_6:
	cmpl	$7, %r9d
	jg	LBB0_13
## %bb.7:
	movq	8(%r15), %rdi
	movl	12(%r14), %eax
	movl	%eax, %ecx
	xorl	$1, %ecx
	movl	%r9d, %edx
	xorl	$2, %edx
	movl	%r9d, %esi
	xorl	$4, %esi
	xorl	$3, %eax
	orl	%esi, %eax
	movl	$17, %eax
	movl	$255, %esi
	cmovel	%eax, %esi
	orl	%ecx, %edx
	movl	$85, %r14d
	cmovnel	%esi, %r14d
	movq	%rdi, -88(%rbp)                 ## 8-byte Spill
	testq	%rdi, %rdi
	jle	LBB0_26
## %bb.8:
	movl	%r13d, %r15d
	negl	%r15d
	movl	%r13d, %eax
	subl	%r9d, %eax
	movl	%eax, -92(%rbp)                 ## 4-byte Spill
	xorl	%r11d, %r11d
	jmp	LBB0_9
	.p2align	4, 0x90
LBB0_12:                                ##   in Loop: Header=BB0_9 Depth=1
	movzbl	%sil, %eax
	movl	%eax, (%r12)
	incq	%r11
	addq	$4, %r12
	cmpq	-88(%rbp), %r11                 ## 8-byte Folded Reload
	je	LBB0_26
LBB0_9:                                 ## =>This Loop Header: Depth=1
                                        ##     Child Loop BB0_11 Depth 2
	movl	$0, %esi
	testl	%r9d, %r9d
	jle	LBB0_12
## %bb.10:                              ##   in Loop: Header=BB0_9 Depth=1
	movl	(%r12), %r8d
	xorl	%esi, %esi
	movl	-92(%rbp), %eax                 ## 4-byte Reload
	movl	%r9d, %edi
	.p2align	4, 0x90
LBB0_11:                                ##   Parent Loop BB0_9 Depth=1
                                        ## =>  This Inner Loop Header: Depth=2
	leal	(%r15,%rdi), %edx
	movl	%r8d, %ebx
	movl	%edx, %ecx
	shll	%cl, %ebx
	movl	%r8d, %r10d
	movl	%eax, %ecx
	shrl	%cl, %r10d
	andl	%r14d, %r10d
	testl	%edx, %edx
	cmovgl	%ebx, %r10d
	orl	%r10d, %esi
	subl	%r13d, %edi
	addl	%r13d, %eax
	testl	%edi, %edi
	jg	LBB0_11
	jmp	LBB0_12
LBB0_13:
	movl	16(%r15), %r13d
	imull	-88(%rbp), %r13d                ## 4-byte Folded Reload
	cmpl	$8, %r9d
	jne	LBB0_20
## %bb.14:
	testl	%r13d, %r13d
	je	LBB0_26
## %bb.15:
	xorl	%r8d, %r8d
	jmp	LBB0_16
	.p2align	4, 0x90
LBB0_19:                                ##   in Loop: Header=BB0_16 Depth=1
	movzbl	%bl, %eax
	movl	%eax, (%r12)
	incl	%r8d
	addq	$4, %r12
	cmpl	%r13d, %r8d
	je	LBB0_26
LBB0_16:                                ## =>This Loop Header: Depth=1
                                        ##     Child Loop BB0_18 Depth 2
	movl	%r8d, %eax
	xorl	%edx, %edx
	divl	-88(%rbp)                       ## 4-byte Folded Reload
                                        ## kill: def $edx killed $edx def $rdx
	movl	-64(%rbp,%rdx,4), %r11d
	movl	-80(%rbp,%rdx,4), %r9d
	movl	%r9d, %eax
	negl	%eax
	movl	$0, %ebx
	cmpl	%eax, %r11d
	jle	LBB0_19
## %bb.17:                              ##   in Loop: Header=BB0_16 Depth=1
	movl	(%r12), %r10d
	movl	%r11d, %edx
	negl	%edx
	xorl	%ebx, %ebx
	movl	%r11d, %eax
	.p2align	4, 0x90
LBB0_18:                                ##   Parent Loop BB0_16 Depth=1
                                        ## =>  This Inner Loop Header: Depth=2
	movl	%r10d, %esi
	movl	%r11d, %ecx
	shll	%cl, %esi
	movl	%r10d, %edi
	movl	%edx, %ecx
	shrl	%cl, %edi
	testl	%r11d, %r11d
	cmovgl	%esi, %edi
	orl	%edi, %ebx
	subl	%r9d, %eax
	addl	%r9d, %edx
	testl	%r11d, %r11d
	movl	%eax, %r11d
	jg	LBB0_18
	jmp	LBB0_19
LBB0_20:
	testl	%r13d, %r13d
	je	LBB0_26
## %bb.21:
	xorl	%r14d, %r14d
	jmp	LBB0_22
	.p2align	4, 0x90
LBB0_25:                                ##   in Loop: Header=BB0_22 Depth=1
	movzbl	%bh, %eax
	movl	%eax, (%r12)
	movzbl	%bl, %eax
	movl	%eax, 4(%r12)
	addq	$8, %r12
	incl	%r14d
	cmpl	%r13d, %r14d
	je	LBB0_26
LBB0_22:                                ## =>This Loop Header: Depth=1
                                        ##     Child Loop BB0_24 Depth 2
	movl	%r14d, %eax
	xorl	%edx, %edx
	divl	-88(%rbp)                       ## 4-byte Folded Reload
	movl	%edx, %r15d
	movq	%r12, %rdi
	callq	_png_get_uint_16
	movl	-64(%rbp,%r15,4), %edi
	movl	-80(%rbp,%r15,4), %r8d
	movl	%r8d, %ecx
	negl	%ecx
	movl	$0, %ebx
	cmpl	%ecx, %edi
	jle	LBB0_25
## %bb.23:                              ##   in Loop: Header=BB0_22 Depth=1
	movl	%eax, %r9d
	movl	%edi, %esi
	negl	%esi
	xorl	%ebx, %ebx
	movl	%edi, %edx
	.p2align	4, 0x90
LBB0_24:                                ##   Parent Loop BB0_22 Depth=1
                                        ## =>  This Inner Loop Header: Depth=2
	movl	%ebx, %r10d
	movl	%r9d, %ebx
	movl	%edi, %ecx
	shll	%cl, %ebx
	movl	%r9d, %eax
	movl	%esi, %ecx
	shrl	%cl, %eax
	testl	%edi, %edi
	cmovgl	%ebx, %eax
	movl	%r10d, %ebx
	orl	%eax, %ebx
	subl	%r8d, %edx
	addl	%r8d, %esi
	testl	%edi, %edi
	movl	%edx, %edi
	jg	LBB0_24
	jmp	LBB0_25
LBB0_28:
	callq	___stack_chk_fail
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"in png_do_shift"

	.comm	_PNG_COLOR_TYPE_PALETTE,4,2     ## @PNG_COLOR_TYPE_PALETTE
	.comm	_PNG_COLOR_MASK_COLOR,4,2       ## @PNG_COLOR_MASK_COLOR
	.comm	_PNG_COLOR_MASK_ALPHA,4,2       ## @PNG_COLOR_MASK_ALPHA
	.no_dead_strip	_png_do_shift
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function png_do_shift
_png_do_shift:                          ; @png_do_shift
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #128
	.cfi_def_cfa_offset 128
	stp	x26, x25, [sp, #48]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #64]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #80]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #96]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #112]            ; 16-byte Folded Spill
	add	x29, sp, #112
	.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
	.cfi_offset w23, -56
	.cfi_offset w24, -64
	.cfi_offset w25, -72
	.cfi_offset w26, -80
	mov	x20, x2
	mov	x19, x1
	mov	x21, x0
Lloh0:
	adrp	x8, ___stack_chk_guard@GOTPAGE
Lloh1:
	ldr	x8, [x8, ___stack_chk_guard@GOTPAGEOFF]
Lloh2:
	ldr	x8, [x8]
	str	x8, [sp, #40]
Lloh3:
	adrp	x1, l_.str@PAGE
Lloh4:
	add	x1, x1, l_.str@PAGEOFF
	mov	w0, #1
	bl	_png_debug
	ldr	w10, [x21]
Lloh5:
	adrp	x8, _PNG_COLOR_TYPE_PALETTE@GOTPAGE
Lloh6:
	ldr	x8, [x8, _PNG_COLOR_TYPE_PALETTE@GOTPAGEOFF]
Lloh7:
	ldr	w8, [x8]
	cmp	w10, w8
	b.ne	LBB0_3
LBB0_1:
	ldr	x8, [sp, #40]
Lloh8:
	adrp	x9, ___stack_chk_guard@GOTPAGE
Lloh9:
	ldr	x9, [x9, ___stack_chk_guard@GOTPAGEOFF]
Lloh10:
	ldr	x9, [x9]
	cmp	x9, x8
	b.ne	LBB0_29
; %bb.2:
	ldp	x29, x30, [sp, #112]            ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #96]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #80]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #64]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #48]             ; 16-byte Folded Reload
	add	sp, sp, #128
	ret
LBB0_3:
Lloh11:
	adrp	x8, _PNG_COLOR_MASK_COLOR@GOTPAGE
Lloh12:
	ldr	x8, [x8, _PNG_COLOR_MASK_COLOR@GOTPAGEOFF]
Lloh13:
	ldr	w9, [x8]
	ldr	w8, [x21, #4]
	tst	w9, w10
	b.eq	LBB0_5
; %bb.4:
	ldp	w9, w11, [x20]
	sub	w12, w8, w11
	ldr	w13, [x20, #8]
	sub	w14, w8, w13
	stp	w12, w14, [sp, #28]
	stp	w11, w13, [sp, #12]
	mov	w22, #3
	b	LBB0_6
LBB0_5:
	ldr	w9, [x20, #12]
	mov	w22, #1
LBB0_6:
	sub	w11, w8, w9
	str	w11, [sp, #24]
	str	w9, [sp, #8]
Lloh14:
	adrp	x11, _PNG_COLOR_MASK_ALPHA@GOTPAGE
Lloh15:
	ldr	x11, [x11, _PNG_COLOR_MASK_ALPHA@GOTPAGEOFF]
Lloh16:
	ldr	w11, [x11]
	tst	w11, w10
	b.eq	LBB0_8
; %bb.7:
	ldr	w10, [x20, #16]
	sub	w11, w8, w10
	mov	w12, w22
	lsl	x12, x12, #2
	add	x13, sp, #24
	str	w11, [x13, x12]
	add	x11, sp, #8
	str	w10, [x11, x12]
	add	w22, w22, #1
LBB0_8:
	cmp	w8, #7
	b.gt	LBB0_16
; %bb.9:
	ldr	x10, [x21, #8]
	ldr	w11, [x20, #12]
	cmp	w11, #3
	ccmp	w8, #4, #0, eq
	mov	w12, #255
	mov	w13, #17
	csel	w12, w13, w12, eq
	cmp	w8, #2
	ccmp	w11, #1, #0, eq
	mov	w11, #85
	csel	w11, w11, w12, eq
	cmp	x10, #1
	b.lt	LBB0_1
; %bb.10:
	mov	x12, #0
	neg	w13, w9
	sub	w14, w9, w8
	b	LBB0_13
LBB0_11:                                ;   in Loop: Header=BB0_13 Depth=1
	mov	w15, #0
LBB0_12:                                ;   in Loop: Header=BB0_13 Depth=1
	and	w15, w15, #0xff
	str	w15, [x19], #4
	add	x12, x12, #1
	cmp	x12, x10
	b.eq	LBB0_1
LBB0_13:                                ; =>This Loop Header: Depth=1
                                        ;     Child Loop BB0_15 Depth 2
	cmp	w8, #1
	b.lt	LBB0_11
; %bb.14:                               ;   in Loop: Header=BB0_13 Depth=1
	mov	w15, #0
	ldr	w16, [x19]
	mov	x17, x14
	mov	x0, x8
LBB0_15:                                ;   Parent Loop BB0_13 Depth=1
                                        ; =>  This Inner Loop Header: Depth=2
	add	w1, w13, w0
	lsl	w2, w16, w1
	lsr	w3, w16, w17
	and	w3, w3, w11
	cmp	w1, #0
	csel	w1, w2, w3, gt
	orr	w15, w1, w15
	sub	w0, w0, w9
	add	w17, w17, w9
	cmp	w0, #0
	b.gt	LBB0_15
	b	LBB0_12
LBB0_16:
	ldr	w9, [x21, #16]
	mul	w20, w9, w22
	cmp	w8, #8
	b.ne	LBB0_23
; %bb.17:
	cbz	w20, LBB0_1
; %bb.18:
	mov	w8, #0
	add	x9, sp, #24
	add	x10, sp, #8
	b	LBB0_20
LBB0_19:                                ;   in Loop: Header=BB0_20 Depth=1
	and	w11, w11, #0xff
	str	w11, [x19], #4
	add	w8, w8, #1
	cmp	w8, w20
	b.eq	LBB0_1
LBB0_20:                                ; =>This Loop Header: Depth=1
                                        ;     Child Loop BB0_22 Depth 2
	mov	w11, #0
	udiv	w12, w8, w22
	msub	w12, w12, w22, w8
	lsl	x12, x12, #2
	ldr	w13, [x9, x12]
	ldr	w12, [x10, x12]
	neg	w14, w12
	cmp	w13, w14
	b.le	LBB0_19
; %bb.21:                               ;   in Loop: Header=BB0_20 Depth=1
	mov	w11, #0
	ldr	w14, [x19]
	neg	w15, w13
LBB0_22:                                ;   Parent Loop BB0_20 Depth=1
                                        ; =>  This Inner Loop Header: Depth=2
	lsl	w16, w14, w13
	lsr	w17, w14, w15
	sub	w0, w13, w12
	cmp	w13, #0
	csel	w13, w16, w17, gt
	orr	w11, w13, w11
	add	w15, w15, w12
	mov	x13, x0
	b.gt	LBB0_22
	b	LBB0_19
LBB0_23:
	cbz	w20, LBB0_1
; %bb.24:
	mov	w21, #0
	add	x23, sp, #24
	add	x24, sp, #8
	b	LBB0_26
LBB0_25:                                ;   in Loop: Header=BB0_26 Depth=1
	ubfx	w9, w8, #8, #8
	and	w8, w8, #0xff
	stp	w9, w8, [x19], #8
	add	w21, w21, #1
	cmp	w21, w20
	b.eq	LBB0_1
LBB0_26:                                ; =>This Loop Header: Depth=1
                                        ;     Child Loop BB0_28 Depth 2
	udiv	w8, w21, w22
	msub	w25, w8, w22, w21
	mov	x0, x19
	bl	_png_get_uint_16
	mov	w8, #0
	lsl	x9, x25, #2
	ldr	w10, [x23, x9]
	ldr	w9, [x24, x9]
	neg	w11, w9
	cmp	w10, w11
	b.le	LBB0_25
; %bb.27:                               ;   in Loop: Header=BB0_26 Depth=1
	mov	w8, #0
	neg	w11, w10
LBB0_28:                                ;   Parent Loop BB0_26 Depth=1
                                        ; =>  This Inner Loop Header: Depth=2
	lsl	w12, w0, w10
	lsr	w13, w0, w11
	sub	w14, w10, w9
	cmp	w10, #0
	csel	w10, w12, w13, gt
	orr	w8, w10, w8
	add	w11, w11, w9
	mov	x10, x14
	b.gt	LBB0_28
	b	LBB0_25
LBB0_29:
	bl	___stack_chk_fail
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpAdd	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.loh AdrpLdrGotLdr	Lloh14, Lloh15, Lloh16
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"in png_do_shift"

	.comm	_PNG_COLOR_TYPE_PALETTE,4,2     ; @PNG_COLOR_TYPE_PALETTE
	.comm	_PNG_COLOR_MASK_COLOR,4,2       ; @PNG_COLOR_MASK_COLOR
	.comm	_PNG_COLOR_MASK_ALPHA,4,2       ; @PNG_COLOR_MASK_ALPHA
	.no_dead_strip	_png_do_shift
.subsections_via_symbols
