	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function viv_read_header
_viv_read_header:                       ## @viv_read_header
	.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	$792, %rsp                      ## imm = 0x318
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdi, %r12
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	%rax, -48(%rbp)
	movq	(%rdi), %rbx
	movq	8(%rdi), %r15
	movq	%rbx, %rdi
	movl	$9, %esi
	callq	_avio_skip
	movq	%rbx, %rdi
	callq	_avio_tell
	movq	%rax, %r14
	movq	%rbx, %rdi
	callq	_ffio_read_varlen
	movl	%eax, %r13d
	movq	%rbx, %rdi
	callq	_avio_r8
	cmpl	$1, %eax
	jne	LBB0_1
## %bb.3:
	addl	%r14d, %r13d
	movq	%rbx, %rdi
	callq	_avio_r8
	movl	%eax, -804(%rbp)
	movq	_SEEK_CUR@GOTPCREL(%rip), %rcx
	movl	(%rcx), %edx
	movq	%rbx, %rdi
	movl	%eax, %esi
	callq	_avio_seek
	leaq	-800(%rbp), %r14
	movq	%rbx, %rdi
	movq	%r14, %rsi
	movl	$187, %edx
	callq	_avio_read
	movq	%r14, %rdi
	callq	_decode_key
	movl	%eax, %r14d
	movq	%r15, -824(%rbp)                ## 8-byte Spill
	movl	%eax, (%r15)
	movq	%rbx, %rdi
	callq	_avio_rl32
	movq	%rbx, %rdi
	callq	_avio_tell
	movq	%rax, %r15
	cmpl	%r15d, %r13d
	jle	LBB0_15
## %bb.4:
	movl	%r14d, -816(%rbp)               ## 4-byte Spill
	movq	%r12, -832(%rbp)                ## 8-byte Spill
	xorl	%r14d, %r14d
	movl	$0, -812(%rbp)                  ## 4-byte Folded Spill
	jmp	LBB0_5
	.p2align	4, 0x90
LBB0_10:                                ##   in Loop: Header=BB0_5 Depth=1
	addl	%r15d, %r12d
	movq	_SEEK_SET@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	%rbx, %rdi
	movl	%r12d, %esi
	callq	_avio_seek
	movq	%rbx, %rdi
	callq	_avio_tell
	movq	%rax, %r15
	cmpl	%r15d, %r13d
	jle	LBB0_11
LBB0_5:                                 ## =>This Inner Loop Header: Depth=1
	movq	%rbx, %rdi
	callq	_ffio_read_varlen
	movl	%eax, %r12d
	movq	%rbx, %rdi
	callq	_avio_feof
	testq	%rax, %rax
	jne	LBB0_7
## %bb.6:                               ##   in Loop: Header=BB0_5 Depth=1
	testl	%r12d, %r12d
	jle	LBB0_7
## %bb.8:                               ##   in Loop: Header=BB0_5 Depth=1
	movq	%rbx, %rdi
	callq	_avio_r8
	cmpl	$22, %eax
	jne	LBB0_10
## %bb.9:                               ##   in Loop: Header=BB0_5 Depth=1
	movq	%rbx, %rdi
	leaq	-800(%rbp), %r14
	movq	%r14, %rsi
	movl	$187, %edx
	callq	_avio_read
	movq	%r14, %rdi
	callq	_decode_key
	movl	%eax, -812(%rbp)                ## 4-byte Spill
	movq	%rbx, %rdi
	callq	_avio_rl32
	movl	%eax, %r14d
	jmp	LBB0_10
LBB0_1:
	movq	_AV_LOG_ERROR@GOTPCREL(%rip), %rcx
	movl	(%rcx), %esi
	leaq	L_.str(%rip), %rdx
	movq	%r12, %rdi
	movl	%eax, %ecx
	callq	_av_log
	movq	_EINVAL@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	cmpq	-48(%rbp), %rax
	jne	LBB0_25
## %bb.2:
	addq	$792, %rsp                      ## imm = 0x318
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_AVERROR                        ## TAILCALL
LBB0_7:
	movq	_AVERROR_INVALIDDATA@GOTPCREL(%rip), %rax
	movl	(%rax), %r14d
	jmp	LBB0_23
LBB0_11:
	testl	%r14d, %r14d
	movq	-832(%rbp), %r12                ## 8-byte Reload
	movl	-816(%rbp), %r14d               ## 4-byte Reload
	je	LBB0_15
## %bb.12:
	movl	-812(%rbp), %edx                ## 4-byte Reload
	movl	%edx, -808(%rbp)
	leaq	-804(%rbp), %rsi
	leaq	-808(%rbp), %rcx
	movq	%rbx, %rdi
	xorl	%r8d, %r8d
	callq	_read_vblock
	testq	%rax, %rax
	je	LBB0_13
## %bb.14:
	movq	%rax, %rdi
	callq	_av_free
LBB0_15:
	movl	%r14d, -808(%rbp)
	leaq	-804(%rbp), %rsi
	leaq	-808(%rbp), %rcx
	movq	%rbx, %rdi
	movl	%r14d, %edx
	xorl	%r8d, %r8d
	callq	_read_vblock
	testq	%rax, %rax
	je	LBB0_13
## %bb.16:
	movq	%rax, %r15
	movl	%r14d, %r13d
	movl	-804(%rbp), %ecx
	movq	-824(%rbp), %rdi                ## 8-byte Reload
	movq	%r12, %rsi
	movq	%rax, %rdx
	callq	_track_header
	movl	%eax, %r14d
	movq	%r15, %rdi
	callq	_av_free
	testl	%r14d, %r14d
	js	LBB0_23
## %bb.17:
	movl	-804(%rbp), %r8d
	leaq	-804(%rbp), %rsi
	leaq	-808(%rbp), %rcx
	movq	%rbx, %rdi
	movl	%r13d, %edx
	callq	_read_vblock
	testq	%rax, %rax
	je	LBB0_13
## %bb.18:
	movq	%rax, %r15
	movl	-804(%rbp), %ecx
	movq	-824(%rbp), %r13                ## 8-byte Reload
	movq	%r13, %rdi
	movq	%r12, %rsi
	movq	%rax, %rdx
	callq	_track_index
	movl	%eax, %r14d
	movq	%r15, %rdi
	callq	_av_free
	testl	%r14d, %r14d
	js	LBB0_23
## %bb.19:
	movq	%rbx, %rdi
	callq	_avio_tell
	movq	%rax, 32(%r13)
	cmpq	$0, 8(%r13)
	jle	LBB0_21
## %bb.20:
	movl	$0, 16(%r13)
	movq	24(%r13), %rax
	movl	(%rax), %edx
	movq	%r12, %rdi
	movq	%r13, %rsi
	callq	_load_sb_block
	jmp	LBB0_22
LBB0_13:
	movq	_EIO@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	callq	_AVERROR
	movl	%eax, %r14d
	jmp	LBB0_23
LBB0_21:
	movl	$-1, 16(%r13)
LBB0_22:
	xorl	%r14d, %r14d
LBB0_23:
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	cmpq	-48(%rbp), %rax
	jne	LBB0_25
## %bb.24:
	movl	%r14d, %eax
	addq	$792, %rsp                      ## imm = 0x318
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_25:
	callq	___stack_chk_fail
	.cfi_endproc
                                        ## -- End function
	.comm	_AV_LOG_ERROR,4,2               ## @AV_LOG_ERROR
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"number of tracks %d is not 1\n"

	.comm	_EINVAL,4,2                     ## @EINVAL
	.comm	_SEEK_CUR,4,2                   ## @SEEK_CUR
	.comm	_AVERROR_INVALIDDATA,4,2        ## @AVERROR_INVALIDDATA
	.comm	_SEEK_SET,4,2                   ## @SEEK_SET
	.comm	_EIO,4,2                        ## @EIO
	.no_dead_strip	_viv_read_header
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function viv_read_header
_viv_read_header:                       ; @viv_read_header
	.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
	sub	sp, sp, #784
	mov	x19, x0
Lloh0:
	adrp	x8, ___stack_chk_guard@GOTPAGE
Lloh1:
	ldr	x8, [x8, ___stack_chk_guard@GOTPAGEOFF]
Lloh2:
	ldr	x8, [x8]
	stur	x8, [x29, #-96]
	ldp	x21, x20, [x0]
	mov	x0, x21
	mov	w1, #9
	bl	_avio_skip
	mov	x0, x21
	bl	_avio_tell
	mov	x22, x0
	mov	x0, x21
	bl	_ffio_read_varlen
	mov	x23, x0
	mov	x0, x21
	bl	_avio_r8
	cmp	w0, #1
	b.ne	LBB0_8
; %bb.1:
	add	w27, w23, w22
	mov	x0, x21
	bl	_avio_r8
	mov	x1, x0
	str	w0, [sp, #12]
Lloh3:
	adrp	x8, _SEEK_CUR@GOTPAGE
Lloh4:
	ldr	x8, [x8, _SEEK_CUR@GOTPAGEOFF]
Lloh5:
	ldr	w2, [x8]
	mov	x0, x21
	bl	_avio_seek
	add	x1, sp, #20
	mov	x0, x21
	mov	w2, #187
	bl	_avio_read
	add	x0, sp, #20
	bl	_decode_key
	mov	x22, x0
	str	w0, [x20]
	mov	x0, x21
	bl	_avio_rl32
	mov	x0, x21
	bl	_avio_tell
	cmp	w27, w0
	b.le	LBB0_14
; %bb.2:
	mov	x24, x0
	mov	w25, #0
	mov	w23, #0
Lloh6:
	adrp	x28, _SEEK_SET@GOTPAGE
Lloh7:
	ldr	x28, [x28, _SEEK_SET@GOTPAGEOFF]
	b	LBB0_4
LBB0_3:                                 ;   in Loop: Header=BB0_4 Depth=1
	add	w1, w26, w24
	ldr	w2, [x28]
	mov	x0, x21
	bl	_avio_seek
	mov	x0, x21
	bl	_avio_tell
	mov	x24, x0
	cmp	w27, w24
	b.le	LBB0_11
LBB0_4:                                 ; =>This Inner Loop Header: Depth=1
	mov	x0, x21
	bl	_ffio_read_varlen
	mov	x26, x0
	mov	x0, x21
	bl	_avio_feof
	cbnz	x0, LBB0_10
; %bb.5:                                ;   in Loop: Header=BB0_4 Depth=1
	cmp	w26, #0
	b.le	LBB0_10
; %bb.6:                                ;   in Loop: Header=BB0_4 Depth=1
	mov	x0, x21
	bl	_avio_r8
	cmp	w0, #22
	b.ne	LBB0_3
; %bb.7:                                ;   in Loop: Header=BB0_4 Depth=1
	add	x1, sp, #20
	mov	x0, x21
	mov	w2, #187
	bl	_avio_read
	add	x0, sp, #20
	bl	_decode_key
	mov	x23, x0
	mov	x0, x21
	bl	_avio_rl32
	mov	x25, x0
	b	LBB0_3
LBB0_8:
	mov	x3, x0
Lloh8:
	adrp	x8, _AV_LOG_ERROR@GOTPAGE
Lloh9:
	ldr	x8, [x8, _AV_LOG_ERROR@GOTPAGEOFF]
Lloh10:
	ldr	w1, [x8]
Lloh11:
	adrp	x2, l_.str@PAGE
Lloh12:
	add	x2, x2, l_.str@PAGEOFF
	mov	x0, x19
	bl	_av_log
Lloh13:
	adrp	x8, _EINVAL@GOTPAGE
Lloh14:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
Lloh15:
	ldr	w0, [x8]
	ldur	x8, [x29, #-96]
Lloh16:
	adrp	x9, ___stack_chk_guard@GOTPAGE
Lloh17:
	ldr	x9, [x9, ___stack_chk_guard@GOTPAGEOFF]
Lloh18:
	ldr	x9, [x9]
	cmp	x9, x8
	b.ne	LBB0_24
; %bb.9:
	add	sp, sp, #784
	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_10:
Lloh19:
	adrp	x8, _AVERROR_INVALIDDATA@GOTPAGE
Lloh20:
	ldr	x8, [x8, _AVERROR_INVALIDDATA@GOTPAGEOFF]
Lloh21:
	ldr	w23, [x8]
	b	LBB0_21
LBB0_11:
	cbz	w25, LBB0_14
; %bb.12:
	str	w23, [sp, #16]
	add	x1, sp, #12
	add	x3, sp, #16
	mov	x0, x21
	mov	x2, x23
	mov	w4, #0
	bl	_read_vblock
	cbz	x0, LBB0_20
; %bb.13:
	bl	_av_free
LBB0_14:
	str	w22, [sp, #16]
	add	x1, sp, #12
	add	x3, sp, #16
	mov	x0, x21
	mov	x2, x22
	mov	w4, #0
	bl	_read_vblock
	cbz	x0, LBB0_20
; %bb.15:
	mov	x24, x0
	ldr	w3, [sp, #12]
	mov	x0, x20
	mov	x1, x19
	mov	x2, x24
	bl	_track_header
	mov	x23, x0
	mov	x0, x24
	bl	_av_free
	tbnz	w23, #31, LBB0_21
; %bb.16:
	ldr	w4, [sp, #12]
	add	x1, sp, #12
	add	x3, sp, #16
	mov	x0, x21
	mov	x2, x22
	bl	_read_vblock
	cbz	x0, LBB0_20
; %bb.17:
	mov	x22, x0
	ldr	w3, [sp, #12]
	mov	x0, x20
	mov	x1, x19
	mov	x2, x22
	bl	_track_index
	mov	x23, x0
	mov	x0, x22
	bl	_av_free
	tbnz	w23, #31, LBB0_21
; %bb.18:
	mov	x0, x21
	bl	_avio_tell
	str	x0, [x20, #32]
	ldr	x8, [x20, #8]
	cmp	x8, #1
	b.lt	LBB0_23
; %bb.19:
	str	wzr, [x20, #16]
	ldr	x8, [x20, #24]
	ldr	w2, [x8]
	mov	x0, x19
	mov	x1, x20
	bl	_load_sb_block
	mov	w23, #0
	b	LBB0_21
LBB0_20:
Lloh22:
	adrp	x8, _EIO@GOTPAGE
Lloh23:
	ldr	x8, [x8, _EIO@GOTPAGEOFF]
Lloh24:
	ldr	w0, [x8]
	bl	_AVERROR
	mov	x23, x0
LBB0_21:
	ldur	x8, [x29, #-96]
Lloh25:
	adrp	x9, ___stack_chk_guard@GOTPAGE
Lloh26:
	ldr	x9, [x9, ___stack_chk_guard@GOTPAGEOFF]
Lloh27:
	ldr	x9, [x9]
	cmp	x9, x8
	b.ne	LBB0_24
; %bb.22:
	mov	x0, x23
	add	sp, sp, #784
	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_23:
	mov	w23, #0
	mov	w8, #-1
	str	w8, [x20, #16]
	b	LBB0_21
LBB0_24:
	bl	___stack_chk_fail
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGot	Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh16, Lloh17, Lloh18
	.loh AdrpLdrGotLdr	Lloh13, Lloh14, Lloh15
	.loh AdrpAdd	Lloh11, Lloh12
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh19, Lloh20, Lloh21
	.loh AdrpLdrGotLdr	Lloh22, Lloh23, Lloh24
	.loh AdrpLdrGotLdr	Lloh25, Lloh26, Lloh27
	.cfi_endproc
                                        ; -- End function
	.comm	_AV_LOG_ERROR,4,2               ; @AV_LOG_ERROR
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"number of tracks %d is not 1\n"

	.comm	_EINVAL,4,2                     ; @EINVAL
	.comm	_SEEK_CUR,4,2                   ; @SEEK_CUR
	.comm	_AVERROR_INVALIDDATA,4,2        ; @AVERROR_INVALIDDATA
	.comm	_SEEK_SET,4,2                   ; @SEEK_SET
	.comm	_EIO,4,2                        ; @EIO
	.no_dead_strip	_viv_read_header
.subsections_via_symbols
