	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function decode_plte_chunk
_decode_plte_chunk:                     ## @decode_plte_chunk
	.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	$24, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	cmpl	$768, %edx                      ## imm = 0x300
	jg	LBB0_2
## %bb.1:
	movq	%rsi, %r13
	movslq	%edx, %rax
	imulq	$1431655766, %rax, %rsi         ## imm = 0x55555556
	movq	%rsi, %rcx
	shrq	$63, %rcx
	shrq	$32, %rsi
	addl	%ecx, %esi
	leal	(%rsi,%rsi,2), %ecx
	subl	%ecx, %eax
	jne	LBB0_2
## %bb.3:
	xorl	%eax, %eax
	cmpl	$3, %edx
	jl	LBB0_7
## %bb.4:
	leaq	8(%r13), %r15
	movq	%rsi, -48(%rbp)                 ## 8-byte Spill
	movl	%esi, %eax
	movq	%rax, -56(%rbp)                 ## 8-byte Spill
	xorl	%r14d, %r14d
	.p2align	4, 0x90
LBB0_5:                                 ## =>This Inner Loop Header: Depth=1
	movq	%r15, %rdi
	callq	_bytestream2_get_byte
	movl	%eax, %r12d
	movq	%r15, %rdi
	callq	_bytestream2_get_byte
	movl	%eax, %ebx
	movq	%r15, %rdi
	callq	_bytestream2_get_byte
	shll	$16, %r12d
	shll	$8, %ebx
	orl	%r12d, %ebx
	orl	%eax, %ebx
	orl	$-16777216, %ebx                ## imm = 0xFF000000
	movq	(%r13), %rax
	movl	%ebx, (%rax,%r14,4)
	incq	%r14
	cmpq	%r14, -56(%rbp)                 ## 8-byte Folded Reload
	jne	LBB0_5
## %bb.6:
	movq	-48(%rbp), %rcx                 ## 8-byte Reload
	movl	%ecx, %eax
	cmpl	$255, %ecx
	ja	LBB0_8
LBB0_7:
	movl	%eax, %edi
	shlq	$2, %rdi
	addq	(%r13), %rdi
	movl	$255, %ecx
	subl	%eax, %ecx
	leaq	4(,%rcx,4), %rdx
	leaq	L_.memset_pattern(%rip), %rsi
	callq	_memset_pattern16
LBB0_8:
	movq	_PNG_PLTE@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	orl	%eax, 12(%r13)
	addq	$8, %r13
	movq	%r13, %rdi
	movl	$4, %esi
	callq	_bytestream2_skip
	xorl	%eax, %eax
	jmp	LBB0_9
LBB0_2:
	movq	_AVERROR_INVALIDDATA@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
LBB0_9:
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_AVERROR_INVALIDDATA,4,2        ## @AVERROR_INVALIDDATA
	.comm	_PNG_PLTE,4,2                   ## @PNG_PLTE
	.section	__TEXT,__literal16,16byte_literals
	.p2align	4                               ## @.memset_pattern
L_.memset_pattern:
	.long	4278190080                      ## 0xff000000
	.long	4278190080                      ## 0xff000000
	.long	4278190080                      ## 0xff000000
	.long	4278190080                      ## 0xff000000

	.no_dead_strip	_decode_plte_chunk
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function decode_plte_chunk
_decode_plte_chunk:                     ; @decode_plte_chunk
	.cfi_startproc
; %bb.0:
	stp	x24, x23, [sp, #-64]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 64
	stp	x22, x21, [sp, #16]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #32]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #48]             ; 16-byte Folded Spill
	add	x29, sp, #48
	.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
	cmp	w2, #768
	b.gt	LBB0_6
; %bb.1:
	mov	w8, #21846
	movk	w8, #21845, lsl #16
	smull	x8, w2, w8
	lsr	x9, x8, #63
	lsr	x8, x8, #32
	add	w23, w8, w9
	add	w8, w23, w23, lsl #1
	sub	w8, w2, w8
	cbnz	w8, LBB0_6
; %bb.2:
	mov	x19, x1
	cmp	w2, #3
	b.lt	LBB0_7
; %bb.3:
	mov	x24, #0
	add	x20, x19, #8
LBB0_4:                                 ; =>This Inner Loop Header: Depth=1
	mov	x0, x20
	bl	_bytestream2_get_byte
	mov	x21, x0
	mov	x0, x20
	bl	_bytestream2_get_byte
	mov	x22, x0
	mov	x0, x20
	bl	_bytestream2_get_byte
	lsl	w8, w21, #16
	orr	w8, w8, w22, lsl #8
	orr	w8, w8, w0
	orr	w8, w8, #0xff000000
	ldr	x9, [x19]
	str	w8, [x9, x24, lsl #2]
	add	x24, x24, #1
	cmp	x23, x24
	b.ne	LBB0_4
; %bb.5:
	cmp	w23, #255
	b.ls	LBB0_8
	b	LBB0_9
LBB0_6:
Lloh0:
	adrp	x8, _AVERROR_INVALIDDATA@GOTPAGE
Lloh1:
	ldr	x8, [x8, _AVERROR_INVALIDDATA@GOTPAGEOFF]
Lloh2:
	ldr	w0, [x8]
	b	LBB0_10
LBB0_7:
	mov	w23, #0
LBB0_8:
	ldr	x8, [x19]
	add	x0, x8, w23, uxtw #2
	mov	w8, #255
	sub	w8, w8, w23
	lsl	x8, x8, #2
	add	x2, x8, #4
Lloh3:
	adrp	x1, l_.memset_pattern@PAGE
Lloh4:
	add	x1, x1, l_.memset_pattern@PAGEOFF
	bl	_memset_pattern16
LBB0_9:
Lloh5:
	adrp	x8, _PNG_PLTE@GOTPAGE
Lloh6:
	ldr	x8, [x8, _PNG_PLTE@GOTPAGEOFF]
Lloh7:
	ldr	w8, [x8]
	ldr	w9, [x19, #12]
	orr	w8, w9, w8
	str	w8, [x19, #12]
	add	x0, x19, #8
	mov	w1, #4
	bl	_bytestream2_skip
	mov	w0, #0
LBB0_10:
	ldp	x29, x30, [sp, #48]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #32]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #16]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp], #64             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpAdd	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.cfi_endproc
                                        ; -- End function
	.comm	_AVERROR_INVALIDDATA,4,2        ; @AVERROR_INVALIDDATA
	.comm	_PNG_PLTE,4,2                   ; @PNG_PLTE
	.section	__TEXT,__literal16,16byte_literals
	.p2align	4                               ; @.memset_pattern
l_.memset_pattern:
	.long	4278190080                      ; 0xff000000
	.long	4278190080                      ; 0xff000000
	.long	4278190080                      ; 0xff000000
	.long	4278190080                      ; 0xff000000

	.no_dead_strip	_decode_plte_chunk
.subsections_via_symbols
