	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function smacker_read_packet
_smacker_read_packet:                   ## @smacker_read_packet
	.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
	pushq	%rax
	movl	$6184, %eax                     ## imm = 0x1828
	callq	____chkstk_darwin
	subq	%rax, %rsp
	popq	%rax
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rsi, %r14
	movq	%rdi, %r12
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	%rax, -48(%rbp)
	movq	8(%rdi), %rbx
	movl	(%rdi), %edi
	callq	_avio_feof
	testq	%rax, %rax
	jne	LBB0_8
## %bb.1:
	movq	(%rbx), %rax
	cmpq	8(%rbx), %rax
	jae	LBB0_8
## %bb.2:
	movl	16(%rbx), %eax
	testl	%eax, %eax
	js	LBB0_12
## %bb.3:
	movq	64(%rbx), %rcx
	cmpq	$0, (%rcx,%rax,8)
	js	LBB0_44
## %bb.4:
	movq	48(%rbx), %rcx
	cmpq	$0, (%rcx,%rax,8)
	je	LBB0_44
## %bb.5:
	movq	56(%rbx), %rcx
	movl	(%rcx,%rax,8), %esi
	movq	%r14, %rdi
	callq	_av_new_packet
	testq	%rax, %rax
	je	LBB0_39
## %bb.6:
	movq	_ENOMEM@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	cmpq	-48(%rbp), %rax
	jne	LBB0_49
## %bb.7:
	addq	$6184, %rsp                     ## imm = 0x1828
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_AVERROR                        ## TAILCALL
LBB0_8:
	movq	_AVERROR_EOF@GOTPCREL(%rip), %rax
LBB0_9:
	movl	(%rax), %eax
LBB0_10:
	movq	___stack_chk_guard@GOTPCREL(%rip), %rcx
	movq	(%rcx), %rcx
	cmpq	-48(%rbp), %rcx
	jne	LBB0_49
## %bb.11:
	addq	$6184, %rsp                     ## imm = 0x1828
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_12:
	movl	(%r12), %edi
	movl	20(%rbx), %esi
	xorl	%edx, %edx
	callq	_avio_seek
	movq	(%rbx), %rax
	movq	24(%rbx), %rcx
	movl	(%rcx,%rax,4), %r13d
	andl	$-4, %r13d
	movq	32(%rbx), %rcx
	movl	(%rcx,%rax,4), %r15d
	movq	_SMACKER_PAL@GOTPCREL(%rip), %rax
	testl	%r15d, (%rax)
	movq	%rbx, -6208(%rbp)               ## 8-byte Spill
	je	LBB0_25
## %bb.13:
	movq	40(%rbx), %rbx
	leaq	-6192(%rbp), %rdi
	movq	%rbx, %rsi
	movl	$768, %edx                      ## imm = 0x300
	callq	_memcpy
	movl	(%r12), %edi
	callq	_avio_r8
	movq	%r13, %rcx
	movl	%eax, %r13d
	shll	$2, %r13d
	subl	%r13d, %ecx
	movq	%rcx, -6216(%rbp)               ## 8-byte Spill
	jl	LBB0_44
## %bb.14:
	movq	%r14, -6224(%rbp)               ## 8-byte Spill
	movl	(%r12), %edi
	callq	_avio_tell
                                        ## kill: def $eax killed $eax def $rax
	addl	%r13d, %eax
	decl	%eax
	movl	%eax, -6200(%rbp)               ## 4-byte Spill
	xorl	%r14d, %r14d
	jmp	LBB0_17
	.p2align	4, 0x90
LBB0_15:                                ##   in Loop: Header=BB0_17 Depth=1
	andl	$127, %r13d
	leal	(%r14,%r13), %ecx
	incl	%ecx
	leal	3(%r13,%r13,2), %eax
	leaq	(%rbx,%rax,8), %rbx
LBB0_16:                                ##   in Loop: Header=BB0_17 Depth=1
	movl	%ecx, %r14d
	cmpl	$256, %ecx                      ## imm = 0x100
	jge	LBB0_26
LBB0_17:                                ## =>This Loop Header: Depth=1
                                        ##     Child Loop BB0_22 Depth 2
	movl	(%r12), %edi
	callq	_avio_r8
	movl	%eax, %r13d
	testb	$-128, %r13b
	jne	LBB0_15
## %bb.18:                              ##   in Loop: Header=BB0_17 Depth=1
	testb	$64, %r13b
	jne	LBB0_20
## %bb.19:                              ##   in Loop: Header=BB0_17 Depth=1
	movq	_smk_pal@GOTPCREL(%rip), %rdx
	movq	(%rdx), %rax
	movslq	%r13d, %rcx
	movq	(%rax,%rcx,8), %rax
	movq	%rax, (%rbx)
	movq	(%rdx), %r13
	movl	(%r12), %edi
	callq	_avio_r8
                                        ## kill: def $eax killed $eax def $rax
	andl	$63, %eax
	movq	(%r13,%rax,8), %rax
	movq	%rax, 8(%rbx)
	movq	_smk_pal@GOTPCREL(%rip), %rax
	movq	(%rax), %r13
	movl	(%r12), %edi
	callq	_avio_r8
                                        ## kill: def $eax killed $eax def $rax
	andl	$63, %eax
	movq	(%r13,%rax,8), %rax
	movq	%rax, 16(%rbx)
	addq	$24, %rbx
	incl	%r14d
	movl	%r14d, %ecx
	jmp	LBB0_16
LBB0_20:                                ##   in Loop: Header=BB0_17 Depth=1
	movl	(%r12), %edi
	callq	_avio_r8
                                        ## kill: def $eax killed $eax def $rax
	movl	%r13d, %r8d
	andl	$63, %r8d
	leal	(%rax,%r8), %ecx
	incl	%ecx
	cmpl	$257, %ecx                      ## imm = 0x101
	jge	LBB0_43
## %bb.21:                              ##   in Loop: Header=BB0_17 Depth=1
	leal	(%rax,%rax,2), %eax
	cltq
	leaq	-6176(%rbp), %rcx
	leaq	(%rcx,%rax,8), %rax
	andl	$63, %r13d
	shlq	$3, %r13
	leaq	(,%r13,2), %rsi
	addq	%r13, %rsi
	xorl	%edx, %edx
	.p2align	4, 0x90
LBB0_22:                                ##   Parent Loop BB0_17 Depth=1
                                        ## =>  This Inner Loop Header: Depth=2
	movq	-16(%rax,%rdx), %rcx
	movq	%rcx, (%rbx,%rdx)
	movq	-8(%rax,%rdx), %rcx
	movq	%rcx, 8(%rbx,%rdx)
	movq	(%rax,%rdx), %rcx
	movq	%rcx, 16(%rbx,%rdx)
	leal	1(%r14), %ecx
	movl	%edx, %edi
	addq	$24, %rdx
	cmpl	%edi, %esi
	je	LBB0_24
## %bb.23:                              ##   in Loop: Header=BB0_22 Depth=2
	cmpl	$255, %r14d
	movl	%ecx, %r14d
	jl	LBB0_22
LBB0_24:                                ##   in Loop: Header=BB0_17 Depth=1
	addq	%rdx, %rbx
	jmp	LBB0_16
LBB0_25:
	movq	%r14, -6224(%rbp)               ## 8-byte Spill
	xorl	%eax, %eax
	jmp	LBB0_27
LBB0_26:
	movl	(%r12), %edi
	movl	-6200(%rbp), %esi               ## 4-byte Reload
	xorl	%edx, %edx
	callq	_avio_seek
	movl	$1, %eax
	movq	-6208(%rbp), %rbx               ## 8-byte Reload
	movq	-6216(%rbp), %r13               ## 8-byte Reload
LBB0_27:
	movq	%rax, -6200(%rbp)               ## 8-byte Spill
	movl	$-1, 16(%rbx)
	xorl	%r14d, %r14d
	jmp	LBB0_29
	.p2align	4, 0x90
LBB0_28:                                ##   in Loop: Header=BB0_29 Depth=1
	sarl	%r15d
	incq	%r14
	cmpq	$7, %r14
	je	LBB0_35
LBB0_29:                                ## =>This Inner Loop Header: Depth=1
	testb	$2, %r15b
	je	LBB0_28
## %bb.30:                              ##   in Loop: Header=BB0_29 Depth=1
	movl	(%r12), %edi
	callq	_avio_rl32
	movq	%rax, %rbx
	addq	$-4, %rbx
	je	LBB0_41
## %bb.31:                              ##   in Loop: Header=BB0_29 Depth=1
	movslq	%r13d, %rcx
	cmpq	%rcx, %rax
	jg	LBB0_41
## %bb.32:                              ##   in Loop: Header=BB0_29 Depth=1
	movl	%r15d, -6216(%rbp)              ## 4-byte Spill
	movq	%r12, %r15
	movq	%r13, %r12
	movq	-6208(%rbp), %r13               ## 8-byte Reload
	movslq	16(%r13), %rax
	leaq	1(%rax), %rcx
	movl	%ecx, 16(%r13)
	leaq	8(,%rax,8), %rdi
	addq	48(%r13), %rdi
	movq	%rbx, %rsi
	callq	_av_reallocp
	movq	56(%r13), %rdx
	movslq	16(%r13), %rcx
	testl	%eax, %eax
	js	LBB0_42
## %bb.33:                              ##   in Loop: Header=BB0_29 Depth=1
	movq	%rbx, (%rdx,%rcx,8)
	movl	(%r15), %edi
	movq	48(%r13), %rax
	movq	(%rax,%rcx,8), %rsi
	movl	%ebx, %edx
	callq	_avio_read
	cltq
	cmpq	%rax, %rbx
	jne	LBB0_47
## %bb.34:                              ##   in Loop: Header=BB0_29 Depth=1
	subl	%ebx, %r12d
	addl	$-4, %r12d
	movq	64(%r13), %rax
	movq	72(%r13), %rcx
	movq	(%rcx,%r14,8), %rcx
	movslq	16(%r13), %rdx
	movq	%r12, %r13
	movq	%rcx, (%rax,%rdx,8)
	movq	%r15, %r12
	movl	-6216(%rbp), %r15d              ## 4-byte Reload
	jmp	LBB0_28
LBB0_35:
	testl	%r13d, %r13d
	js	LBB0_44
## %bb.36:
	movq	_INT_MAX@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, %ecx
	shrl	$31, %ecx
	addl	%eax, %ecx
	sarl	%ecx
	cmpl	%ecx, %r13d
	jge	LBB0_44
## %bb.37:
	leal	769(%r13), %r14d
	movq	-6224(%rbp), %rbx               ## 8-byte Reload
	movq	%rbx, %rdi
	movl	%r14d, %esi
	callq	_av_new_packet
	testq	%rax, %rax
	je	LBB0_45
## %bb.38:
	movq	_ENOMEM@GOTPCREL(%rip), %rax
	jmp	LBB0_48
LBB0_39:
	movq	(%r14), %rdi
	movslq	16(%rbx), %rax
	movq	48(%rbx), %rcx
	movq	56(%rbx), %rdx
	movq	(%rcx,%rax,8), %rsi
	movl	(%rdx,%rax,8), %edx
	callq	_memcpy
	movq	56(%rbx), %rax
	movslq	16(%rbx), %rcx
	movl	(%rax,%rcx,8), %eax
	movl	%eax, 24(%r14)
	movq	64(%rbx), %rax
	movq	(%rax,%rcx,8), %rax
	movq	%rax, 8(%r14)
	movq	88(%rbx), %rax
	movq	(%rax,%rcx,8), %rax
	movq	%rax, 16(%r14)
	movq	(%r14), %rdi
	callq	_AV_RL32
	movq	88(%rbx), %rcx
	movslq	16(%rbx), %rdx
	addq	%rax, (%rcx,%rdx,8)
	leal	-1(%rdx), %eax
	movl	%eax, 16(%rbx)
LBB0_40:
	xorl	%eax, %eax
	jmp	LBB0_10
LBB0_41:
	movq	_AV_LOG_ERROR@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	leaq	L_.str.1(%rip), %rdx
	movq	%r12, %rdi
	xorl	%eax, %eax
	callq	_av_log
	jmp	LBB0_44
LBB0_42:
	movq	$0, (%rdx,%rcx,8)
	jmp	LBB0_10
LBB0_43:
	incl	%r8d
	movq	_AV_LOG_ERROR@GOTPCREL(%rip), %rcx
	movl	(%rcx), %esi
	leaq	L_.str(%rip), %rdx
	movq	%r12, %rdi
	movl	%eax, %ecx
                                        ## kill: def $r8d killed $r8d killed $r8
	xorl	%eax, %eax
	callq	_av_log
LBB0_44:
	movq	_AVERROR_INVALIDDATA@GOTPCREL(%rip), %rax
	jmp	LBB0_9
LBB0_45:
	movq	-6208(%rbp), %r15               ## 8-byte Reload
	movq	(%r15), %rax
	movq	24(%r15), %rcx
	movl	(%rcx,%rax,4), %eax
	andl	$1, %eax
	movq	-6200(%rbp), %rcx               ## 8-byte Reload
	leal	(%rcx,%rax,2), %eax
	movq	(%rbx), %rdi
	movl	%eax, (%rdi)
	addq	$4, %rdi
	movq	40(%r15), %rsi
	movl	$768, %edx                      ## imm = 0x300
	callq	_memcpy
	movl	(%r12), %edi
	movl	$3076, %esi                     ## imm = 0xC04
	addq	(%rbx), %rsi
	movl	%r13d, %edx
	callq	_avio_read
	cmpl	%r13d, %eax
	jne	LBB0_47
## %bb.46:
	movq	80(%r15), %rax
	movq	%rax, 8(%rbx)
	movq	(%r15), %rax
	movq	%rax, 16(%rbx)
	movl	%r14d, 24(%rbx)
	incq	%rax
	movq	%rax, (%r15)
	movl	(%r12), %edi
	callq	_avio_tell
	movl	%eax, 20(%r15)
	jmp	LBB0_40
LBB0_47:
	movq	_EIO@GOTPCREL(%rip), %rax
LBB0_48:
	movl	(%rax), %edi
	callq	_AVERROR
	jmp	LBB0_10
LBB0_49:
	callq	___stack_chk_fail
	.cfi_endproc
                                        ## -- End function
	.comm	_AVERROR_EOF,4,2                ## @AVERROR_EOF
	.comm	_SMACKER_PAL,4,2                ## @SMACKER_PAL
	.comm	_AVERROR_INVALIDDATA,4,2        ## @AVERROR_INVALIDDATA
	.comm	_AV_LOG_ERROR,4,2               ## @AV_LOG_ERROR
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Invalid palette update, offset=%d length=%d extends beyond palette size\n"

	.comm	_smk_pal,8,3                    ## @smk_pal
L_.str.1:                               ## @.str.1
	.asciz	"Invalid audio part size\n"

	.comm	_EIO,4,2                        ## @EIO
	.comm	_INT_MAX,4,2                    ## @INT_MAX
	.comm	_ENOMEM,4,2                     ## @ENOMEM
	.no_dead_strip	_smacker_read_packet
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function smacker_read_packet
_smacker_read_packet:                   ; @smacker_read_packet
	.cfi_startproc
; %bb.0:
	stp	x28, x27, [sp, #-96]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 96
	stp	x26, x25, [sp, #16]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #32]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #48]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #64]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #80]             ; 16-byte Folded Spill
	add	x29, sp, #80
	.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	w9, #6192
Lloh0:
	adrp	x16, ___chkstk_darwin@GOTPAGE
Lloh1:
	ldr	x16, [x16, ___chkstk_darwin@GOTPAGEOFF]
	blr	x16
	sub	sp, sp, #1, lsl #12             ; =4096
	sub	sp, sp, #2096
	mov	x19, x1
	mov	x20, x0
Lloh2:
	adrp	x8, ___stack_chk_guard@GOTPAGE
Lloh3:
	ldr	x8, [x8, ___stack_chk_guard@GOTPAGEOFF]
Lloh4:
	ldr	x8, [x8]
	stur	x8, [x29, #-96]
	ldr	x25, [x0, #8]
	ldr	w0, [x0]
	bl	_avio_feof
	cbnz	x0, LBB0_8
; %bb.1:
	ldp	x8, x9, [x25]
	cmp	x8, x9
	b.hs	LBB0_8
; %bb.2:
	ldr	w8, [x25, #16]
	tbnz	w8, #31, LBB0_12
; %bb.3:
	ldr	x9, [x25, #64]
	ldr	x9, [x9, x8, lsl #3]
	tbnz	x9, #63, LBB0_48
; %bb.4:
	ldr	x9, [x25, #48]
	ldr	x9, [x9, x8, lsl #3]
	cbz	x9, LBB0_48
; %bb.5:
	ldr	x9, [x25, #56]
	ldr	x1, [x9, x8, lsl #3]
	mov	x0, x19
                                        ; kill: def $w1 killed $w1 killed $x1
	bl	_av_new_packet
	cbz	x0, LBB0_43
; %bb.6:
Lloh5:
	adrp	x8, _ENOMEM@GOTPAGE
Lloh6:
	ldr	x8, [x8, _ENOMEM@GOTPAGEOFF]
Lloh7:
	ldr	w0, [x8]
	ldur	x8, [x29, #-96]
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_53
; %bb.7:
	add	sp, sp, #1, lsl #12             ; =4096
	add	sp, sp, #2096
	ldp	x29, x30, [sp, #80]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #64]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #48]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #32]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #16]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp], #96             ; 16-byte Folded Reload
	b	_AVERROR
LBB0_8:
Lloh11:
	adrp	x8, _AVERROR_EOF@GOTPAGE
Lloh12:
	ldr	x8, [x8, _AVERROR_EOF@GOTPAGEOFF]
LBB0_9:
	ldr	w0, [x8]
LBB0_10:
	ldur	x8, [x29, #-96]
Lloh13:
	adrp	x9, ___stack_chk_guard@GOTPAGE
Lloh14:
	ldr	x9, [x9, ___stack_chk_guard@GOTPAGEOFF]
Lloh15:
	ldr	x9, [x9]
	cmp	x9, x8
	b.ne	LBB0_53
; %bb.11:
	add	sp, sp, #1, lsl #12             ; =4096
	add	sp, sp, #2096
	ldp	x29, x30, [sp, #80]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #64]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #48]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #32]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #16]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp], #96             ; 16-byte Folded Reload
	ret
LBB0_12:
	ldr	w0, [x20]
	ldr	w1, [x25, #20]
	mov	w2, #0
	bl	_avio_seek
	ldr	x8, [x25]
	lsl	x8, x8, #2
	ldp	x9, x10, [x25, #24]
	ldr	w9, [x9, x8]
	and	w21, w9, #0xfffffffc
	ldr	w26, [x10, x8]
Lloh16:
	adrp	x8, _SMACKER_PAL@GOTPAGE
Lloh17:
	ldr	x8, [x8, _SMACKER_PAL@GOTPAGEOFF]
Lloh18:
	ldr	w8, [x8]
	tst	w8, w26
	b.eq	LBB0_30
; %bb.13:
	ldr	x23, [x25, #40]
	add	x24, sp, #32
	add	x0, sp, #32
	mov	x1, x23
	mov	w2, #768
	bl	_memcpy
	ldr	w0, [x20]
	bl	_avio_r8
	lsl	w22, w0, #2
	subs	w21, w21, w22
	b.lt	LBB0_48
; %bb.14:
	ldr	w0, [x20]
	bl	_avio_tell
	mov	w28, #0
	add	w8, w22, w0
	sub	w8, w8, #1
	str	w8, [sp, #20]                   ; 4-byte Folded Spill
	add	x8, x24, #24
	str	x8, [sp, #24]                   ; 8-byte Folded Spill
	add	x22, x24, #16
Lloh19:
	adrp	x27, _smk_pal@GOTPAGE
Lloh20:
	ldr	x27, [x27, _smk_pal@GOTPAGEOFF]
	b	LBB0_17
LBB0_15:                                ;   in Loop: Header=BB0_17 Depth=1
	and	w8, w24, #0x7f
	add	w8, w8, #1
	add	w28, w8, w28
	add	w8, w8, w8, lsl #1
	add	x10, x23, w8, uxtw #3
LBB0_16:                                ;   in Loop: Header=BB0_17 Depth=1
	mov	x23, x10
	cmp	w28, #256
	b.ge	LBB0_31
LBB0_17:                                ; =>This Loop Header: Depth=1
                                        ;     Child Loop BB0_24 Depth 2
                                        ;     Child Loop BB0_28 Depth 2
	ldr	w0, [x20]
	bl	_avio_r8
	mov	x24, x0
	tbnz	w0, #7, LBB0_15
; %bb.18:                               ;   in Loop: Header=BB0_17 Depth=1
	tbnz	w24, #6, LBB0_20
; %bb.19:                               ;   in Loop: Header=BB0_17 Depth=1
	ldr	x8, [x27]
	ldr	x8, [x8, w24, sxtw #3]
	str	x8, [x23]
	ldr	x24, [x27]
	ldr	w0, [x20]
	bl	_avio_r8
	and	w8, w0, #0x3f
	ldr	x8, [x24, w8, uxtw #3]
	str	x8, [x23, #8]
	ldr	x24, [x27]
	ldr	w0, [x20]
	bl	_avio_r8
	and	w8, w0, #0x3f
	ldr	x8, [x24, w8, uxtw #3]
	add	x10, x23, #24
	str	x8, [x23, #16]
	add	w28, w28, #1
	b	LBB0_16
LBB0_20:                                ;   in Loop: Header=BB0_17 Depth=1
	ldr	w0, [x20]
	bl	_avio_r8
                                        ; kill: def $w0 killed $w0 def $x0
	and	w10, w24, #0x3f
	add	w8, w10, #1
	add	w9, w0, w8
	cmp	w9, #257
	b.ge	LBB0_46
; %bb.21:                               ;   in Loop: Header=BB0_17 Depth=1
	add	w9, w0, w0, lsl #1
	sxtw	x9, w9
	cmp	w28, #255
	mov	w11, #255
	csel	w11, w28, w11, gt
	sub	w11, w11, w28
	cmp	w11, w10
	csel	w11, w11, w10, lo
	cmp	w10, #0
	mov	w12, #1
	csinc	w11, w12, w11, eq
	cmp	w11, #2
	b.lo	LBB0_26
; %bb.22:                               ;   in Loop: Header=BB0_17 Depth=1
	cmp	w28, #255
	mov	w12, #255
	csel	w12, w28, w12, gt
	sub	w12, w12, w28
	cmp	w12, w10
	csel	w12, w12, w10, lo
	add	w12, w12, w12, lsl #1
	cmp	w10, #0
	csel	w10, wzr, w12, eq
	add	x12, x23, w10, uxtw #3
	add	x13, x12, #24
	add	x12, sp, #32
	add	x12, x12, x9, lsl #3
	add	x10, x10, x9
	ldr	x14, [sp, #24]                  ; 8-byte Folded Reload
	add	x10, x14, x10, lsl #3
	cmp	x23, x10
	ccmp	x12, x13, #2, lo
	b.lo	LBB0_26
; %bb.23:                               ;   in Loop: Header=BB0_17 Depth=1
	and	x13, x11, #0x7e
	add	x10, x13, x13, lsl #1
	add	x9, x10, x9
	add	x10, x23, x10, lsl #3
	sub	w8, w8, w13
	add	w28, w28, w13
	mov	x14, x13
LBB0_24:                                ;   Parent Loop BB0_17 Depth=1
                                        ; =>  This Inner Loop Header: Depth=2
	ldp	q0, q1, [x12]
	ldr	q2, [x12, #32]
	stp	q1, q2, [x23, #16]
	str	q0, [x23], #48
	add	x12, x12, #48
	subs	x14, x14, #2
	b.ne	LBB0_24
; %bb.25:                               ;   in Loop: Header=BB0_17 Depth=1
	cmp	x13, x11
	b.eq	LBB0_16
	b	LBB0_27
LBB0_26:                                ;   in Loop: Header=BB0_17 Depth=1
	mov	x10, x23
LBB0_27:                                ;   in Loop: Header=BB0_17 Depth=1
	sub	w8, w8, #1
	mov	x12, x10
	mov	x11, x28
	add	x9, x22, x9, lsl #3
LBB0_28:                                ;   Parent Loop BB0_17 Depth=1
                                        ; =>  This Inner Loop Header: Depth=2
	ldur	x10, [x9, #-16]
	str	x10, [x12]
	ldur	x10, [x9, #-8]
	str	x10, [x12, #8]
	ldr	x13, [x9]
	add	x10, x12, #24
	str	x13, [x12, #16]
	add	w28, w11, #1
	subs	w8, w8, #1
	b.lo	LBB0_16
; %bb.29:                               ;   in Loop: Header=BB0_28 Depth=2
	add	x9, x9, #24
	mov	x12, x10
	cmp	w11, #255
	mov	x11, x28
	b.lt	LBB0_28
	b	LBB0_16
LBB0_30:
	mov	w23, #0
	b	LBB0_32
LBB0_31:
	ldr	w0, [x20]
	ldr	w1, [sp, #20]                   ; 4-byte Folded Reload
	mov	w2, #0
	bl	_avio_seek
	mov	w23, #1
LBB0_32:
	mov	x24, #0
	mov	w8, #-1
	str	w8, [x25, #16]
	b	LBB0_34
LBB0_33:                                ;   in Loop: Header=BB0_34 Depth=1
	asr	w26, w26, #1
	add	x24, x24, #8
	cmp	x24, #56
	b.eq	LBB0_39
LBB0_34:                                ; =>This Inner Loop Header: Depth=1
	tbz	w26, #1, LBB0_33
; %bb.35:                               ;   in Loop: Header=BB0_34 Depth=1
	ldr	w0, [x20]
	bl	_avio_rl32
	sub	x22, x0, #4
	sxtw	x8, w21
	cmp	x22, #0
	ccmp	x0, x8, #0, ne
	b.gt	LBB0_44
; %bb.36:                               ;   in Loop: Header=BB0_34 Depth=1
	ldrsw	x8, [x25, #16]
	add	x8, x8, #1
	str	w8, [x25, #16]
	ldr	x9, [x25, #48]
	add	x0, x9, x8, lsl #3
	mov	x1, x22
	bl	_av_reallocp
	ldr	x8, [x25, #56]
	ldrsw	x9, [x25, #16]
	tbnz	w0, #31, LBB0_45
; %bb.37:                               ;   in Loop: Header=BB0_34 Depth=1
	lsl	x9, x9, #3
	str	x22, [x8, x9]
	ldr	w0, [x20]
	ldr	x8, [x25, #48]
	ldr	x1, [x8, x9]
	mov	x2, x22
	bl	_avio_read
	cmp	x22, w0, sxtw
	b.ne	LBB0_51
; %bb.38:                               ;   in Loop: Header=BB0_34 Depth=1
	sub	w8, w21, w22
	sub	w21, w8, #4
	ldp	x9, x8, [x25, #64]
	ldr	x8, [x8, x24]
	ldrsw	x10, [x25, #16]
	str	x8, [x9, x10, lsl #3]
	b	LBB0_33
LBB0_39:
	tbnz	w21, #31, LBB0_48
; %bb.40:
Lloh21:
	adrp	x8, _INT_MAX@GOTPAGE
Lloh22:
	ldr	x8, [x8, _INT_MAX@GOTPAGEOFF]
Lloh23:
	ldr	w8, [x8]
	cmp	w8, #0
	cinc	w8, w8, lt
	cmp	w21, w8, asr #1
	b.ge	LBB0_48
; %bb.41:
	add	w22, w21, #769
	mov	x0, x19
	mov	x1, x22
	bl	_av_new_packet
	cbz	x0, LBB0_49
; %bb.42:
Lloh24:
	adrp	x8, _ENOMEM@GOTPAGE
Lloh25:
	ldr	x8, [x8, _ENOMEM@GOTPAGEOFF]
	b	LBB0_52
LBB0_43:
	ldr	x0, [x19]
	ldrsw	x8, [x25, #16]
	lsl	x8, x8, #3
	ldp	x9, x10, [x25, #48]
	ldr	x1, [x9, x8]
	ldr	w2, [x10, x8]
	bl	_memcpy
	ldr	x8, [x25, #56]
	ldrsw	x9, [x25, #16]
	lsl	x9, x9, #3
	ldr	x8, [x8, x9]
	str	w8, [x19, #24]
	ldr	x8, [x25, #64]
	ldr	x8, [x8, x9]
	str	x8, [x19, #8]
	ldr	x8, [x25, #88]
	ldr	x8, [x8, x9]
	str	x8, [x19, #16]
	ldr	x0, [x19]
	bl	_AV_RL32
	mov	x8, x0
	mov	w0, #0
	ldr	x9, [x25, #88]
	ldrsw	x10, [x25, #16]
	lsl	x11, x10, #3
	ldr	x12, [x9, x11]
	add	x8, x12, x8
	str	x8, [x9, x11]
	sub	w8, w10, #1
	str	w8, [x25, #16]
	b	LBB0_10
LBB0_44:
Lloh26:
	adrp	x8, _AV_LOG_ERROR@GOTPAGE
Lloh27:
	ldr	x8, [x8, _AV_LOG_ERROR@GOTPAGEOFF]
Lloh28:
	ldr	w1, [x8]
Lloh29:
	adrp	x2, l_.str.1@PAGE
Lloh30:
	add	x2, x2, l_.str.1@PAGEOFF
	b	LBB0_47
LBB0_45:
	str	xzr, [x8, x9, lsl #3]
	b	LBB0_10
LBB0_46:
Lloh31:
	adrp	x9, _AV_LOG_ERROR@GOTPAGE
Lloh32:
	ldr	x9, [x9, _AV_LOG_ERROR@GOTPAGEOFF]
Lloh33:
	ldr	w1, [x9]
	stp	x0, x8, [sp]
Lloh34:
	adrp	x2, l_.str@PAGE
Lloh35:
	add	x2, x2, l_.str@PAGEOFF
LBB0_47:
	mov	x0, x20
	bl	_av_log
LBB0_48:
Lloh36:
	adrp	x8, _AVERROR_INVALIDDATA@GOTPAGE
Lloh37:
	ldr	x8, [x8, _AVERROR_INVALIDDATA@GOTPAGEOFF]
	b	LBB0_9
LBB0_49:
	ldr	x8, [x25, #24]
	ldr	x9, [x25]
	ldr	w8, [x8, x9, lsl #2]
	bfi	w23, w8, #1, #1
	ldr	x0, [x19]
	str	w23, [x0], #4
	ldr	x1, [x25, #40]
	mov	w2, #768
	bl	_memcpy
	ldr	w0, [x20]
	ldr	x8, [x19]
	add	x1, x8, #3076
	mov	x2, x21
	bl	_avio_read
	cmp	w0, w21
	b.ne	LBB0_51
; %bb.50:
	ldr	x8, [x25, #80]
	str	x8, [x19, #8]
	ldr	x8, [x25]
	str	x8, [x19, #16]
	str	w22, [x19, #24]
	add	x8, x8, #1
	str	x8, [x25]
	ldr	w0, [x20]
	bl	_avio_tell
	mov	x8, x0
	mov	w0, #0
	str	w8, [x25, #20]
	b	LBB0_10
LBB0_51:
Lloh38:
	adrp	x8, _EIO@GOTPAGE
Lloh39:
	ldr	x8, [x8, _EIO@GOTPAGEOFF]
LBB0_52:
	ldr	w0, [x8]
	bl	_AVERROR
	b	LBB0_10
LBB0_53:
	bl	___stack_chk_fail
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpLdrGot	Lloh11, Lloh12
	.loh AdrpLdrGotLdr	Lloh13, Lloh14, Lloh15
	.loh AdrpLdrGotLdr	Lloh16, Lloh17, Lloh18
	.loh AdrpLdrGot	Lloh19, Lloh20
	.loh AdrpLdrGotLdr	Lloh21, Lloh22, Lloh23
	.loh AdrpLdrGot	Lloh24, Lloh25
	.loh AdrpAdd	Lloh29, Lloh30
	.loh AdrpLdrGotLdr	Lloh26, Lloh27, Lloh28
	.loh AdrpAdd	Lloh34, Lloh35
	.loh AdrpLdrGotLdr	Lloh31, Lloh32, Lloh33
	.loh AdrpLdrGot	Lloh36, Lloh37
	.loh AdrpLdrGot	Lloh38, Lloh39
	.cfi_endproc
                                        ; -- End function
	.comm	_AVERROR_EOF,4,2                ; @AVERROR_EOF
	.comm	_SMACKER_PAL,4,2                ; @SMACKER_PAL
	.comm	_AVERROR_INVALIDDATA,4,2        ; @AVERROR_INVALIDDATA
	.comm	_AV_LOG_ERROR,4,2               ; @AV_LOG_ERROR
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Invalid palette update, offset=%d length=%d extends beyond palette size\n"

	.comm	_smk_pal,8,3                    ; @smk_pal
l_.str.1:                               ; @.str.1
	.asciz	"Invalid audio part size\n"

	.comm	_EIO,4,2                        ; @EIO
	.comm	_INT_MAX,4,2                    ; @INT_MAX
	.comm	_ENOMEM,4,2                     ; @ENOMEM
	.no_dead_strip	_smacker_read_packet
.subsections_via_symbols
