	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function sync_stream
_sync_stream:                           ## @sync_stream
	.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	%rdi, %r14
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	%rax, -48(%rbp)
	movq	_STREAM_ERROR@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	orl	%eax, 24(%rdi)
	movq	16(%rdi), %rax
	cmpq	$0, (%rax)
	je	LBB0_2
## %bb.1:
	movq	_stderr@GOTPCREL(%rip), %rbx
	movl	(%rbx), %esi
	leaq	L_.str(%rip), %rdi
	callq	_fputs
	movl	(%r14), %edi
	movl	(%rbx), %esi
	callq	_type_name
	movl	(%rbx), %esi
	movl	$10, %edi
	callq	_putc
LBB0_2:
	leaq	12(%r14), %rsi
	movq	%r14, %rdi
	callq	_file_setpos
	movl	$8, 4(%r14)
	leaq	-84(%rbp), %rsi
	movq	%r14, %rdi
	callq	_read_4
	cmpl	$4, %eax
	jne	LBB0_15
## %bb.3:
	movl	(%r14), %edi
	movl	%edi, -92(%rbp)                 ## 4-byte Spill
	callq	_crc_init_4
	movl	%eax, %r15d
	xorl	%r12d, %r12d
	movl	-84(%rbp), %esi
	xorl	%r13d, %r13d
	xorl	%edx, %edx
	jmp	LBB0_4
	.p2align	4, 0x90
LBB0_18:                                ##   in Loop: Header=BB0_4 Depth=1
	incl	%r13d
	movl	%r13d, %eax
	andl	$7, %eax
	movl	-80(%rbp,%rax,4), %ebx
LBB0_19:                                ##   in Loop: Header=BB0_4 Depth=1
	movsbl	-81(%rbp), %esi
	movl	%r15d, %edi
	callq	_crc_one_byte
	movl	%eax, %r15d
	movl	-84(%rbp), %esi
	shll	$8, %esi
	addl	%ebx, %esi
	movl	%esi, -84(%rbp)
	movl	-96(%rbp), %edx                 ## 4-byte Reload
	incl	%edx
LBB0_4:                                 ## =>This Loop Header: Depth=1
                                        ##     Child Loop BB0_7 Depth 2
	movl	%r15d, %eax
	notl	%eax
	cmpl	%eax, %esi
	movl	%edx, -96(%rbp)                 ## 4-byte Spill
	jne	LBB0_13
## %bb.5:                               ##   in Loop: Header=BB0_4 Depth=1
	movl	-92(%rbp), %eax                 ## 4-byte Reload
	movq	_png_IEND@GOTPCREL(%rip), %rcx
	cmpl	(%rcx), %eax
	je	LBB0_21
## %bb.6:                               ##   in Loop: Header=BB0_4 Depth=1
	leal	8(%r13), %ebx
	cmpl	%ebx, %r12d
	jae	LBB0_10
	.p2align	4, 0x90
LBB0_7:                                 ##   Parent Loop BB0_4 Depth=1
                                        ## =>  This Inner Loop Header: Depth=2
	movq	%r14, %rdi
	callq	_read_byte
	movq	_EOF@GOTPCREL(%rip), %rcx
	cmpl	(%rcx), %eax
	je	LBB0_15
## %bb.8:                               ##   in Loop: Header=BB0_7 Depth=2
	leal	1(%r12), %ecx
	andl	$7, %r12d
	movl	%eax, -80(%rbp,%r12,4)
	movl	%ecx, %r12d
	cmpl	%ecx, %ebx
	jne	LBB0_7
## %bb.9:                               ##   in Loop: Header=BB0_4 Depth=1
	movl	%ebx, %r12d
LBB0_10:                                ##   in Loop: Header=BB0_4 Depth=1
	movl	%r13d, %eax
	andl	$-8, %eax
	subl	%eax, %r12d
	andl	$7, %r13d
	leaq	-80(%rbp), %rbx
	movq	%rbx, %rdi
	movl	%r13d, %esi
	callq	_get32
	cmpl	$2147483647, %eax               ## imm = 0x7FFFFFFF
	je	LBB0_13
## %bb.11:                              ##   in Loop: Header=BB0_4 Depth=1
	movl	%eax, -88(%rbp)                 ## 4-byte Spill
	leal	4(%r13), %esi
	movq	%rbx, %rdi
	callq	_get32
	movl	%eax, %ebx
	movl	%eax, %edi
	callq	_chunk_type_valid
	testq	%rax, %rax
	jne	LBB0_12
LBB0_13:                                ##   in Loop: Header=BB0_4 Depth=1
	cmpl	%r13d, %r12d
	ja	LBB0_18
## %bb.14:                              ##   in Loop: Header=BB0_4 Depth=1
	movq	%r14, %rdi
	callq	_read_byte
	movl	%eax, %ebx
	movq	_EOF@GOTPCREL(%rip), %rax
	cmpl	(%rax), %ebx
	jne	LBB0_19
LBB0_15:
	movq	_READ_ERROR_CODE@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	leaq	L_.str.1(%rip), %rdx
	movq	%r14, %rdi
	callq	_stop
LBB0_16:
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	cmpq	-48(%rbp), %rax
	jne	LBB0_17
## %bb.20:
	addq	$56, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_21:
	movl	%edx, 8(%r14)
	movq	%r14, %rdi
	xorl	%edx, %edx
	xorl	%ecx, %ecx
	callq	_process_chunk
	jmp	LBB0_16
LBB0_12:
	addl	$-8, 4(%r14)
	movl	-84(%rbp), %esi
	movq	%r14, %rdi
	movl	-88(%rbp), %edx                 ## 4-byte Reload
	movl	%ebx, %ecx
	callq	_process_chunk
	jmp	LBB0_16
LBB0_17:
	callq	___stack_chk_fail
	.cfi_endproc
                                        ## -- End function
	.comm	_STREAM_ERROR,4,2               ## @STREAM_ERROR
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	" SYNC "

	.comm	_stderr,4,2                     ## @stderr
	.comm	_png_IEND,4,2                   ## @png_IEND
	.comm	_EOF,4,2                        ## @EOF
	.comm	_READ_ERROR_CODE,4,2            ## @READ_ERROR_CODE
L_.str.1:                               ## @.str.1
	.asciz	"damaged PNG stream"

	.no_dead_strip	_sync_stream
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function sync_stream
_sync_stream:                           ; @sync_stream
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #144
	.cfi_def_cfa_offset 144
	stp	x28, x27, [sp, #48]             ; 16-byte Folded Spill
	stp	x26, x25, [sp, #64]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #80]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #96]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #112]            ; 16-byte Folded Spill
	stp	x29, x30, [sp, #128]            ; 16-byte Folded Spill
	add	x29, sp, #128
	.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
	.cfi_offset w27, -88
	.cfi_offset w28, -96
	mov	x19, 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	x8, _STREAM_ERROR@GOTPAGE
Lloh4:
	ldr	x8, [x8, _STREAM_ERROR@GOTPAGEOFF]
Lloh5:
	ldr	w8, [x8]
	ldr	w9, [x0, #24]
	orr	w8, w9, w8
	str	w8, [x0, #24]
	ldr	x8, [x0, #16]
	ldr	x8, [x8]
	cbz	x8, LBB0_2
; %bb.1:
Lloh6:
	adrp	x20, _stderr@GOTPAGE
Lloh7:
	ldr	x20, [x20, _stderr@GOTPAGEOFF]
	ldr	w1, [x20]
Lloh8:
	adrp	x0, l_.str@PAGE
Lloh9:
	add	x0, x0, l_.str@PAGEOFF
	bl	_fputs
	ldr	w0, [x19]
	ldr	w1, [x20]
	bl	_type_name
	ldr	w1, [x20]
	mov	w0, #10
	bl	_putc
LBB0_2:
	add	x1, x19, #12
	mov	x0, x19
	bl	_file_setpos
	mov	w8, #8
	str	w8, [x19, #4]
	add	x1, sp, #4
	mov	x0, x19
	bl	_read_4
	cmp	w0, #4
	b.ne	LBB0_16
; %bb.3:
	ldr	w20, [x19]
	mov	x0, x20
	bl	_crc_init_4
	mov	x22, x0
	mov	w26, #0
	mov	w21, #0
	mov	w25, #0
	ldr	w1, [sp, #4]
Lloh10:
	adrp	x28, _EOF@GOTPAGE
Lloh11:
	ldr	x28, [x28, _EOF@GOTPAGEOFF]
	add	x27, sp, #8
	b	LBB0_6
LBB0_4:                                 ;   in Loop: Header=BB0_6 Depth=1
	add	w21, w21, #1
	and	w8, w21, #0x7
	ldr	w23, [x27, w8, uxtw #2]
LBB0_5:                                 ;   in Loop: Header=BB0_6 Depth=1
	ldrsb	w1, [sp, #7]
	mov	x0, x22
	bl	_crc_one_byte
	mov	x22, x0
	ldr	w8, [sp, #4]
	add	w1, w23, w8, lsl #8
	str	w1, [sp, #4]
	add	w25, w25, #1
LBB0_6:                                 ; =>This Loop Header: Depth=1
                                        ;     Child Loop BB0_9 Depth 2
	mvn	w8, w22
	cmp	w1, w8
	b.ne	LBB0_14
; %bb.7:                                ;   in Loop: Header=BB0_6 Depth=1
Lloh12:
	adrp	x8, _png_IEND@GOTPAGE
Lloh13:
	ldr	x8, [x8, _png_IEND@GOTPAGEOFF]
Lloh14:
	ldr	w8, [x8]
	cmp	w20, w8
	b.eq	LBB0_19
; %bb.8:                                ;   in Loop: Header=BB0_6 Depth=1
	add	w23, w21, #8
	cmp	w26, w23
	b.hs	LBB0_12
LBB0_9:                                 ;   Parent Loop BB0_6 Depth=1
                                        ; =>  This Inner Loop Header: Depth=2
	mov	x0, x19
	bl	_read_byte
	ldr	w8, [x28]
	cmp	w0, w8
	b.eq	LBB0_16
; %bb.10:                               ;   in Loop: Header=BB0_9 Depth=2
	and	w8, w26, #0x7
	add	w9, w26, #1
	str	w0, [x27, w8, uxtw #2]
	mov	x26, x9
	cmp	w23, w9
	b.ne	LBB0_9
; %bb.11:                               ;   in Loop: Header=BB0_6 Depth=1
	mov	x26, x23
LBB0_12:                                ;   in Loop: Header=BB0_6 Depth=1
	and	w8, w21, #0xfffffff8
	sub	w26, w26, w8
	and	w21, w21, #0x7
	add	x0, sp, #8
	mov	x1, x21
	bl	_get32
	mov	w8, #2147483647
	cmp	w0, w8
	b.eq	LBB0_14
; %bb.13:                               ;   in Loop: Header=BB0_6 Depth=1
	mov	x23, x0
	add	w1, w21, #4
	add	x0, sp, #8
	bl	_get32
	mov	x24, x0
	bl	_chunk_type_valid
	cbnz	x0, LBB0_20
LBB0_14:                                ;   in Loop: Header=BB0_6 Depth=1
	cmp	w26, w21
	b.hi	LBB0_4
; %bb.15:                               ;   in Loop: Header=BB0_6 Depth=1
	mov	x0, x19
	bl	_read_byte
	mov	x23, x0
	ldr	w8, [x28]
	cmp	w0, w8
	b.ne	LBB0_5
LBB0_16:
Lloh15:
	adrp	x8, _READ_ERROR_CODE@GOTPAGE
Lloh16:
	ldr	x8, [x8, _READ_ERROR_CODE@GOTPAGEOFF]
Lloh17:
	ldr	w1, [x8]
Lloh18:
	adrp	x2, l_.str.1@PAGE
Lloh19:
	add	x2, x2, l_.str.1@PAGEOFF
	mov	x0, x19
	bl	_stop
LBB0_17:
	ldr	x8, [sp, #40]
Lloh20:
	adrp	x9, ___stack_chk_guard@GOTPAGE
Lloh21:
	ldr	x9, [x9, ___stack_chk_guard@GOTPAGEOFF]
Lloh22:
	ldr	x9, [x9]
	cmp	x9, x8
	b.ne	LBB0_22
; %bb.18:
	ldp	x29, x30, [sp, #128]            ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #112]            ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #96]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #80]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #64]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp, #48]             ; 16-byte Folded Reload
	add	sp, sp, #144
	ret
LBB0_19:
	str	w25, [x19, #8]
	mov	x0, x19
	mov	w2, #0
	mov	w3, #0
	b	LBB0_21
LBB0_20:
	ldr	w8, [x19, #4]
	sub	w8, w8, #8
	str	w8, [x19, #4]
	ldr	w1, [sp, #4]
	mov	x0, x19
	mov	x2, x23
	mov	x3, x24
LBB0_21:
	bl	_process_chunk
	b	LBB0_17
LBB0_22:
	bl	___stack_chk_fail
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpAdd	Lloh8, Lloh9
	.loh AdrpLdrGot	Lloh6, Lloh7
	.loh AdrpLdrGot	Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.loh AdrpAdd	Lloh18, Lloh19
	.loh AdrpLdrGotLdr	Lloh15, Lloh16, Lloh17
	.loh AdrpLdrGotLdr	Lloh20, Lloh21, Lloh22
	.cfi_endproc
                                        ; -- End function
	.comm	_STREAM_ERROR,4,2               ; @STREAM_ERROR
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	" SYNC "

	.comm	_stderr,4,2                     ; @stderr
	.comm	_png_IEND,4,2                   ; @png_IEND
	.comm	_EOF,4,2                        ; @EOF
	.comm	_READ_ERROR_CODE,4,2            ; @READ_ERROR_CODE
l_.str.1:                               ; @.str.1
	.asciz	"damaged PNG stream"

	.no_dead_strip	_sync_stream
.subsections_via_symbols
