	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function readChunk_PLTE
_readChunk_PLTE:                        ## @readChunk_PLTE
	.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	%r12
	pushq	%rbx
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdx, %r15
	movq	%rsi, %r14
	movq	%rdi, %r12
	movq	(%rdi), %rdi
	testq	%rdi, %rdi
	je	LBB0_2
## %bb.1:
	callq	_lodepng_free
LBB0_2:
	movabsq	$-6148914691236517205, %rcx     ## imm = 0xAAAAAAAAAAAAAAAB
	movq	%r15, %rax
	mulq	%rcx
	shrq	%rdx
	movq	%rdx, 8(%r12)
	leal	(,%rdx,4), %edi
	callq	_lodepng_malloc
	movq	%rax, (%r12)
	movq	8(%r12), %rdx
	testq	%rax, %rax
	je	LBB0_3
## %bb.5:
	movq	%rax, %r8
	movl	$38, %eax
	cmpq	$256, %rdx                      ## imm = 0x100
	ja	LBB0_11
## %bb.6:
	xorl	%eax, %eax
	testq	%rdx, %rdx
	je	LBB0_11
## %bb.7:
	movl	$3, %edx
	movl	$1, %esi
	movl	$1, %r9d
	.p2align	4, 0x90
LBB0_8:                                 ## =>This Inner Loop Header: Depth=1
	leal	-1(%rsi), %ecx
	movzbl	(%r14,%rcx), %ecx
	leal	-3(%rdx), %edi
	movb	%cl, (%r8,%rdi)
	leal	1(%rsi), %r8d
	movl	%esi, %edi
	movzbl	(%r14,%rdi), %ebx
	movq	(%r12), %rdi
	leal	-2(%rdx), %ecx
	movb	%bl, (%rdi,%rcx)
	movzbl	(%r14,%r8), %ecx
	movq	(%r12), %rdi
	leal	-1(%rdx), %ebx
	movb	%cl, (%rdi,%rbx)
	movq	(%r12), %rcx
	movl	%edx, %edi
	movb	$-1, (%rcx,%rdi)
	movl	%r9d, %ecx
	cmpq	%rcx, 8(%r12)
	jbe	LBB0_11
## %bb.9:                               ##   in Loop: Header=BB0_8 Depth=1
	movq	(%r12), %r8
	incl	%r9d
	addl	$4, %edx
	addl	$3, %esi
	jmp	LBB0_8
LBB0_3:
	testq	%rdx, %rdx
	je	LBB0_4
## %bb.10:
	movq	$0, 8(%r12)
	movl	$83, %eax
	jmp	LBB0_11
LBB0_4:
	xorl	%eax, %eax
LBB0_11:
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.no_dead_strip	_readChunk_PLTE
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function readChunk_PLTE
_readChunk_PLTE:                        ; @readChunk_PLTE
	.cfi_startproc
; %bb.0:
	stp	x22, x21, [sp, #-48]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 48
	stp	x20, x19, [sp, #16]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #32]             ; 16-byte Folded Spill
	add	x29, sp, #32
	.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
	mov	x21, x2
	mov	x20, x1
	mov	x19, x0
	ldr	x0, [x0]
	cbz	x0, LBB0_2
; %bb.1:
	bl	_lodepng_free
LBB0_2:
	mov	x8, #-6148914691236517206
	movk	x8, #43691
	umulh	x8, x21, x8
	lsr	x8, x8, #1
	str	x8, [x19, #8]
	lsl	w0, w8, #2
	bl	_lodepng_malloc
	str	x0, [x19]
	ldr	x8, [x19, #8]
	cbz	x0, LBB0_5
; %bb.3:
	cmp	x8, #256
	b.ls	LBB0_7
; %bb.4:
	mov	w0, #38
	b	LBB0_12
LBB0_5:
	cbz	x8, LBB0_11
; %bb.6:
	str	xzr, [x19, #8]
	mov	w0, #83
	b	LBB0_12
LBB0_7:
	cbz	x8, LBB0_11
; %bb.8:
	mov	w8, #3
	mov	w9, #1
	mov	w10, #255
	mov	w11, #1
LBB0_9:                                 ; =>This Inner Loop Header: Depth=1
	sub	w12, w9, #1
	ldrb	w12, [x20, w12, uxtw]
	sub	w13, w8, #3
	strb	w12, [x0, w13, uxtw]
	add	w12, w9, #1
	ldrb	w13, [x20, w9, uxtw]
	ldr	x14, [x19]
	sub	w15, w8, #2
	strb	w13, [x14, w15, uxtw]
	ldrb	w12, [x20, w12, uxtw]
	ldr	x13, [x19]
	sub	w14, w8, #1
	strb	w12, [x13, w14, uxtw]
	ldr	x12, [x19]
	strb	w10, [x12, w8, uxtw]
	ldr	x12, [x19, #8]
	cmp	x12, w11, uxtw
	b.ls	LBB0_11
; %bb.10:                               ;   in Loop: Header=BB0_9 Depth=1
	ldr	x0, [x19]
	add	w11, w11, #1
	add	w8, w8, #4
	add	w9, w9, #3
	b	LBB0_9
LBB0_11:
	mov	w0, #0
LBB0_12:
	ldp	x29, x30, [sp, #32]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #16]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp], #48             ; 16-byte Folded Reload
	ret
	.cfi_endproc
                                        ; -- End function
	.no_dead_strip	_readChunk_PLTE
.subsections_via_symbols
