	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function read_chunk
_read_chunk:                            ## @read_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	%r12
	pushq	%rbx
	subq	$32, %rsp
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdi, %rbx
	movq	(%rdi), %r15
	movq	8(%rdi), %r14
	testq	%r14, %r14
	jne	LBB0_2
## %bb.1:
	movq	_UNEXPECTED_ERROR_CODE@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	leaq	L_.str(%rip), %rdx
	movq	%rbx, %rdi
	callq	_stop
LBB0_2:
	movq	24(%rbx), %rax
	cmpl	$3, (%rax)
	jl	LBB0_4
## %bb.3:
	movq	_stderr@GOTPCREL(%rip), %r12
	movl	(%r12), %esi
	leaq	L_.str.1(%rip), %rdi
	callq	_fputs
	movl	(%r12), %esi
	movq	%r14, %rdi
	callq	_type_name
	movl	(%r12), %edi
	leaq	L_.str.2(%rip), %rsi
	movq	%r15, %rdx
	callq	_fprintf
LBB0_4:
	movq	%r14, %rdi
	callq	_crc_init_4
	movl	%eax, 20(%rbx)
	movq	%rbx, %rdi
	movq	%r15, %rsi
	callq	_crc_read_many
	testq	%rax, %rax
	je	LBB0_13
## %bb.5:
	leaq	-56(%rbp), %rsi
	movq	%rbx, %rdi
	callq	_read_4
	cmpl	$4, %eax
	jne	LBB0_13
## %bb.6:
	movq	_png_IEND@GOTPCREL(%rip), %rax
	cmpq	(%rax), %r14
	jne	LBB0_7
## %bb.12:
	movq	-56(%rbp), %rsi
	movq	%rbx, %rdi
	xorl	%edx, %edx
	xorl	%ecx, %ecx
	callq	_process_chunk
	jmp	LBB0_14
LBB0_7:
	leaq	-48(%rbp), %rsi
	movq	%rbx, %rdi
	callq	_read_4
	cmpl	$4, %eax
	jne	LBB0_13
## %bb.8:
	cmpq	$2147483647, -48(%rbp)          ## imm = 0x7FFFFFFF
	jg	LBB0_13
## %bb.9:
	leaq	-40(%rbp), %rsi
	movq	%rbx, %rdi
	callq	_read_4
	cmpl	$4, %eax
	jne	LBB0_13
## %bb.10:
	movq	-40(%rbp), %rdi
	callq	_chunk_type_valid
	testq	%rax, %rax
	je	LBB0_13
## %bb.11:
	addl	$-8, 16(%rbx)
	movq	-56(%rbp), %rsi
	movq	-48(%rbp), %rdx
	movq	-40(%rbp), %rcx
	movq	%rbx, %rdi
	callq	_process_chunk
	jmp	LBB0_14
LBB0_13:
	movq	%rbx, %rdi
	callq	_sync_stream
LBB0_14:
	addq	$32, %rsp
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_UNEXPECTED_ERROR_CODE,4,2      ## @UNEXPECTED_ERROR_CODE
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"read beyond IEND"

L_.str.1:                               ## @.str.1
	.asciz	"   "

	.comm	_stderr,4,2                     ## @stderr
L_.str.2:                               ## @.str.2
	.asciz	" %lu\n"

	.comm	_png_IEND,8,3                   ## @png_IEND
	.no_dead_strip	_read_chunk
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function read_chunk
_read_chunk:                            ; @read_chunk
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #80
	.cfi_def_cfa_offset 80
	stp	x22, x21, [sp, #32]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #48]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #64]             ; 16-byte Folded Spill
	add	x29, sp, #64
	.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	x19, x0
	ldp	x21, x20, [x0]
	cbnz	x20, LBB0_2
; %bb.1:
Lloh0:
	adrp	x8, _UNEXPECTED_ERROR_CODE@GOTPAGE
Lloh1:
	ldr	x8, [x8, _UNEXPECTED_ERROR_CODE@GOTPAGEOFF]
Lloh2:
	ldr	w1, [x8]
Lloh3:
	adrp	x2, l_.str@PAGE
Lloh4:
	add	x2, x2, l_.str@PAGEOFF
	mov	x0, x19
	bl	_stop
LBB0_2:
	ldr	x8, [x19, #24]
	ldr	w8, [x8]
	cmp	w8, #3
	b.lt	LBB0_4
; %bb.3:
Lloh5:
	adrp	x22, _stderr@GOTPAGE
Lloh6:
	ldr	x22, [x22, _stderr@GOTPAGEOFF]
	ldr	w1, [x22]
Lloh7:
	adrp	x0, l_.str.1@PAGE
Lloh8:
	add	x0, x0, l_.str.1@PAGEOFF
	bl	_fputs
	ldr	w1, [x22]
	mov	x0, x20
	bl	_type_name
	ldr	w0, [x22]
Lloh9:
	adrp	x1, l_.str.2@PAGE
Lloh10:
	add	x1, x1, l_.str.2@PAGEOFF
	mov	x2, x21
	bl	_fprintf
LBB0_4:
	mov	x0, x20
	bl	_crc_init_4
	str	w0, [x19, #20]
	mov	x0, x19
	mov	x1, x21
	bl	_crc_read_many
	cbz	x0, LBB0_13
; %bb.5:
	add	x1, sp, #24
	mov	x0, x19
	bl	_read_4
	cmp	w0, #4
	b.ne	LBB0_13
; %bb.6:
Lloh11:
	adrp	x8, _png_IEND@GOTPAGE
Lloh12:
	ldr	x8, [x8, _png_IEND@GOTPAGEOFF]
Lloh13:
	ldr	x8, [x8]
	cmp	x20, x8
	b.ne	LBB0_8
; %bb.7:
	ldr	x1, [sp, #24]
	mov	x0, x19
	mov	x2, #0
	mov	x3, #0
	bl	_process_chunk
	b	LBB0_14
LBB0_8:
	add	x1, sp, #16
	mov	x0, x19
	bl	_read_4
	cmp	w0, #4
	b.ne	LBB0_13
; %bb.9:
	ldr	x8, [sp, #16]
	mov	w9, #2147483647
	cmp	x8, x9
	b.gt	LBB0_13
; %bb.10:
	add	x1, sp, #8
	mov	x0, x19
	bl	_read_4
	cmp	w0, #4
	b.ne	LBB0_13
; %bb.11:
	ldr	x0, [sp, #8]
	bl	_chunk_type_valid
	cbz	x0, LBB0_13
; %bb.12:
	ldr	w8, [x19, #16]
	sub	w8, w8, #8
	str	w8, [x19, #16]
	ldp	x2, x1, [sp, #16]
	ldr	x3, [sp, #8]
	mov	x0, x19
	bl	_process_chunk
	b	LBB0_14
LBB0_13:
	mov	x0, x19
	bl	_sync_stream
LBB0_14:
	ldp	x29, x30, [sp, #64]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #48]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #32]             ; 16-byte Folded Reload
	add	sp, sp, #80
	ret
	.loh AdrpAdd	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpAdd	Lloh9, Lloh10
	.loh AdrpAdd	Lloh7, Lloh8
	.loh AdrpLdrGot	Lloh5, Lloh6
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.cfi_endproc
                                        ; -- End function
	.comm	_UNEXPECTED_ERROR_CODE,4,2      ; @UNEXPECTED_ERROR_CODE
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"read beyond IEND"

l_.str.1:                               ; @.str.1
	.asciz	"   "

	.comm	_stderr,4,2                     ; @stderr
l_.str.2:                               ; @.str.2
	.asciz	" %lu\n"

	.comm	_png_IEND,8,3                   ; @png_IEND
	.no_dead_strip	_read_chunk
.subsections_via_symbols
