	.file	"extr_vividas.c_viv_read_header.c"
	.intel_syntax noprefix
	.text
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"number of tracks %d is not 1\n"
	.text
	.p2align 4
	.type	viv_read_header, @function
viv_read_header:
.LFB0:
	.cfi_startproc
	endbr64
	push	r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	mov	esi, 9
	push	r14
	.cfi_def_cfa_offset 24
	.cfi_offset 14, -24
	mov	r14, rdi
	push	r13
	.cfi_def_cfa_offset 32
	.cfi_offset 13, -32
	push	r12
	.cfi_def_cfa_offset 40
	.cfi_offset 12, -40
	push	rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	push	rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	sub	rsp, 824
	.cfi_def_cfa_offset 880
	mov	rbp, QWORD PTR [rdi]
	mov	rax, QWORD PTR fs:40
	mov	QWORD PTR 808[rsp], rax
	xor	eax, eax
	mov	rax, QWORD PTR 8[rdi]
	mov	rdi, rbp
	mov	QWORD PTR 8[rsp], rax
	call	avio_skip@PLT
	mov	rdi, rbp
	call	avio_tell@PLT
	mov	rdi, rbp
	mov	rbx, rax
	call	ffio_read_varlen@PLT
	mov	rdi, rbp
	mov	r13d, eax
	call	avio_r8@PLT
	cmp	eax, 1
	je	.L2
	mov	esi, DWORD PTR AV_LOG_ERROR[rip]
	mov	ecx, eax
	lea	rdx, .LC0[rip]
	mov	rdi, r14
	call	av_log@PLT
	mov	edi, DWORD PTR EINVAL[rip]
	call	AVERROR@PLT
	mov	r15d, eax
.L1:
	mov	rax, QWORD PTR 808[rsp]
	xor	rax, QWORD PTR fs:40
	jne	.L22
	add	rsp, 824
	.cfi_remember_state
	.cfi_def_cfa_offset 56
	mov	eax, r15d
	pop	rbx
	.cfi_def_cfa_offset 48
	pop	rbp
	.cfi_def_cfa_offset 40
	pop	r12
	.cfi_def_cfa_offset 32
	pop	r13
	.cfi_def_cfa_offset 24
	pop	r14
	.cfi_def_cfa_offset 16
	pop	r15
	.cfi_def_cfa_offset 8
	ret
	.p2align 4,,10
	.p2align 3
.L2:
	.cfi_restore_state
	mov	rdi, rbp
	lea	r15, 48[rsp]
	add	r13d, ebx
	call	avio_r8@PLT
	mov	edx, DWORD PTR SEEK_CUR[rip]
	mov	rdi, rbp
	mov	esi, eax
	mov	DWORD PTR 44[rsp], eax
	call	avio_seek@PLT
	mov	edx, 187
	mov	rsi, r15
	mov	rdi, rbp
	call	avio_read@PLT
	mov	rdi, r15
	call	decode_key@PLT
	mov	rcx, QWORD PTR 8[rsp]
	mov	rdi, rbp
	mov	DWORD PTR 28[rsp], eax
	mov	DWORD PTR [rcx], eax
	call	avio_rl32@PLT
	mov	DWORD PTR 24[rsp], 0
	mov	DWORD PTR 20[rsp], 0
	jmp	.L8
	.p2align 4,,10
	.p2align 3
.L7:
	mov	edx, DWORD PTR SEEK_SET[rip]
	lea	esi, [rbx+r12]
	mov	rdi, rbp
	call	avio_seek@PLT
.L8:
	mov	rdi, rbp
	call	avio_tell@PLT
	mov	r12, rax
	cmp	r13d, eax
	jle	.L4
	mov	rdi, rbp
	call	ffio_read_varlen@PLT
	mov	rdi, rbp
	mov	ebx, eax
	call	avio_feof@PLT
	test	ebx, ebx
	jle	.L15
	test	rax, rax
	jne	.L15
	mov	rdi, rbp
	call	avio_r8@PLT
	cmp	eax, 22
	jne	.L7
	mov	edx, 187
	mov	rsi, r15
	mov	rdi, rbp
	call	avio_read@PLT
	mov	rdi, r15
	call	decode_key@PLT
	mov	rdi, rbp
	mov	DWORD PTR 24[rsp], eax
	call	avio_rl32@PLT
	mov	DWORD PTR 20[rsp], eax
	jmp	.L7
	.p2align 4,,10
	.p2align 3
.L15:
	mov	r15d, DWORD PTR AVERROR_INVALIDDATA[rip]
	jmp	.L1
	.p2align 4,,10
	.p2align 3
.L4:
	mov	eax, DWORD PTR 20[rsp]
	test	eax, eax
	jne	.L18
	lea	r12, 40[rsp]
	lea	r13, 44[rsp]
.L9:
	mov	eax, DWORD PTR 28[rsp]
	xor	r8d, r8d
	mov	rcx, r12
	mov	rsi, r13
	mov	rdi, rbp
	mov	edx, eax
	mov	DWORD PTR 40[rsp], eax
	call	read_vblock@PLT
	mov	rbx, rax
	test	rax, rax
	je	.L20
	mov	rdi, QWORD PTR 8[rsp]
	mov	ecx, DWORD PTR 44[rsp]
	mov	rdx, rax
	mov	rsi, r14
	call	track_header@PLT
	mov	rdi, rbx
	mov	r15d, eax
	call	av_free@PLT
	test	r15d, r15d
	js	.L1
	mov	r8d, DWORD PTR 44[rsp]
	mov	edx, DWORD PTR 28[rsp]
	mov	rcx, r12
	mov	rsi, r13
	mov	rdi, rbp
	call	read_vblock@PLT
	mov	r12, rax
	test	rax, rax
	je	.L20
	mov	rbx, QWORD PTR 8[rsp]
	mov	ecx, DWORD PTR 44[rsp]
	mov	rdx, rax
	mov	rsi, r14
	mov	rdi, rbx
	call	track_index@PLT
	mov	rdi, r12
	mov	r15d, eax
	call	av_free@PLT
	test	r15d, r15d
	js	.L1
	mov	rdi, rbp
	call	avio_tell@PLT
	cmp	QWORD PTR 8[rbx], 0
	mov	rsi, rbx
	mov	QWORD PTR 32[rbx], rax
	jg	.L23
	mov	rax, QWORD PTR 8[rsp]
	xor	r15d, r15d
	mov	DWORD PTR 16[rax], -1
	jmp	.L1
	.p2align 4,,10
	.p2align 3
.L18:
	mov	edx, DWORD PTR 24[rsp]
	lea	r12, 40[rsp]
	mov	rdi, rbp
	xor	r8d, r8d
	lea	r13, 44[rsp]
	mov	rcx, r12
	mov	rsi, r13
	mov	DWORD PTR 40[rsp], edx
	call	read_vblock@PLT
	mov	rdi, rax
	test	rax, rax
	je	.L20
	call	av_free@PLT
	jmp	.L9
	.p2align 4,,10
	.p2align 3
.L20:
	mov	edi, DWORD PTR EIO[rip]
	call	AVERROR@PLT
	mov	r15d, eax
	jmp	.L1
.L23:
	mov	rax, QWORD PTR 24[rbx]
	mov	DWORD PTR 16[rbx], 0
	mov	rdi, r14
	xor	r15d, r15d
	mov	edx, DWORD PTR [rax]
	call	load_sb_block@PLT
	jmp	.L1
.L22:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE0:
	.size	viv_read_header, .-viv_read_header
	.comm	SEEK_SET,4,4
	.comm	SEEK_CUR,4,4
	.comm	EIO,4,4
	.comm	EINVAL,4,4
	.comm	AV_LOG_ERROR,4,4
	.comm	AVERROR_INVALIDDATA,4,4
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",@progbits
	.section	.note.gnu.property,"a"
	.align 8
	.long	 1f - 0f
	.long	 4f - 1f
	.long	 5
0:
	.string	 "GNU"
1:
	.align 8
	.long	 0xc0000002
	.long	 3f - 2f
2:
	.long	 0x3
3:
	.align 8
4:

	.arch armv5t
	.eabi_attribute 20, 1
	.eabi_attribute 21, 1
	.eabi_attribute 23, 3
	.eabi_attribute 24, 1
	.eabi_attribute 25, 1
	.eabi_attribute 26, 2
	.eabi_attribute 30, 2
	.eabi_attribute 34, 0
	.eabi_attribute 18, 4
	.file	"extr_vividas.c_viv_read_header.c"
	.text
	.section	.rodata.str1.4,"aMS",%progbits,1
	.align	2
.LC0:
	.ascii	"number of tracks %d is not 1\012\000"
	.section	.rodata.cst4,"aM",%progbits,4
	.align	2
.LC1:
	.word	__stack_chk_guard
	.text
	.align	2
	.syntax unified
	.arm
	.fpu softvfp
	.type	viv_read_header, %function
viv_read_header:
	@ args = 0, pretend = 0, frame = 768
	@ frame_needed = 0, uses_anonymous_args = 0
	push	{r4, r5, r6, r7, r8, r9, r10, fp, lr}
	mov	r8, r0
	ldr	r4, [r0]
	ldr	r3, .L23
	sub	sp, sp, #780
	mov	r1, #9
	mov	r0, r4
	ldr	r3, [r3]
	str	r3, [sp, #772]
	mov	r3,#0
	ldr	fp, [r8, #4]
	bl	avio_skip
	mov	r0, r4
	bl	avio_tell
	mov	r7, r0
	mov	r0, r4
	bl	ffio_read_varlen
	mov	r5, r0
	mov	r0, r4
	bl	avio_r8
	cmp	r0, #1
	beq	.L2
	ldr	r2, .L23+4
	mov	r3, r0
	ldr	r1, [r2]
	mov	r0, r8
	ldr	r2, .L23+8
	bl	av_log
	ldr	r3, .L23+12
	ldr	r0, [r3]
	bl	AVERROR
	mov	r5, r0
.L1:
	ldr	r3, .L23
	ldr	r2, [r3]
	ldr	r3, [sp, #772]
	eors	r2, r3, r2
	mov	r3, #0
	bne	.L20
	mov	r0, r5
	add	sp, sp, #780
	@ sp needed
	pop	{r4, r5, r6, r7, r8, r9, r10, fp, pc}
.L2:
	mov	r0, r4
	bl	avio_r8
	mov	r1, r0
	ldr	r3, .L23+16
	mov	r0, r4
	ldr	r2, [r3]
	str	r1, [sp, #20]
	bl	avio_seek
	mov	r2, #187
	add	r1, sp, #24
	mov	r0, r4
	bl	avio_read
	add	r0, sp, #24
	bl	decode_key
	mov	r10, #0
	str	r0, [sp, #12]
	str	r0, [fp]
	mov	r0, r4
	bl	avio_rl32
	ldr	r9, .L23+20
	str	r10, [sp, #8]
	add	r7, r7, r5
	b	.L7
.L6:
	mov	r0, r4
	ldr	r2, [r9]
	add	r1, r5, r6
	bl	avio_seek
.L7:
	mov	r0, r4
	bl	avio_tell
	cmp	r7, r0
	mov	r5, r0
	ble	.L4
	mov	r0, r4
	bl	ffio_read_varlen
	mov	r6, r0
	mov	r0, r4
	bl	avio_feof
	subs	r0, r0, #0
	movne	r0, #1
	cmp	r6, #0
	orrle	r0, r0, #1
	cmp	r0, #0
	bne	.L21
	mov	r0, r4
	bl	avio_r8
	cmp	r0, #22
	bne	.L6
	mov	r2, #187
	add	r1, sp, #24
	mov	r0, r4
	bl	avio_read
	add	r0, sp, #24
	bl	decode_key
	mov	r10, r0
	mov	r0, r4
	bl	avio_rl32
	str	r0, [sp, #8]
	b	.L6
.L21:
	ldr	r3, .L23+24
	ldr	r5, [r3]
	b	.L1
.L4:
	ldr	r3, [sp, #8]
	cmp	r3, #0
	addeq	r7, sp, #16
	addeq	r6, sp, #20
	beq	.L8
	mov	r3, #0
	add	r7, sp, #16
	add	r6, sp, #20
	str	r3, [sp]
	mov	r2, r10
	mov	r3, r7
	mov	r1, r6
	mov	r0, r4
	str	r10, [sp, #16]
	bl	read_vblock
	cmp	r0, #0
	beq	.L18
	bl	av_free
.L8:
	mov	r9, #0
	ldr	r2, [sp, #12]
	mov	r3, r7
	mov	r1, r6
	mov	r0, r4
	str	r9, [sp]
	str	r2, [sp, #16]
	bl	read_vblock
	subs	r10, r0, #0
	beq	.L18
	mov	r2, r10
	mov	r1, r8
	ldr	r3, [sp, #20]
	mov	r0, fp
	bl	track_header
	mov	r5, r0
	mov	r0, r10
	bl	av_free
	cmp	r5, #0
	blt	.L1
	ldr	r0, [sp, #20]
	mov	r1, r6
	str	r0, [sp]
	mov	r3, r7
	mov	r0, r4
	ldr	r2, [sp, #12]
	bl	read_vblock
	subs	r6, r0, #0
	beq	.L18
	mov	r2, r6
	mov	r1, r8
	ldr	r3, [sp, #20]
	mov	r0, fp
	bl	track_index
	mov	r5, r0
	mov	r0, r6
	bl	av_free
	cmp	r5, #0
	blt	.L1
	mov	r0, r4
	bl	avio_tell
	ldr	r3, [fp, #4]
	str	r0, [fp, #16]
	cmp	r3, #0
	bgt	.L22
	mvn	r3, #0
	mov	r5, r9
	str	r3, [fp, #8]
	b	.L1
.L18:
	ldr	r3, .L23+28
	ldr	r0, [r3]
	bl	AVERROR
	mov	r5, r0
	b	.L1
.L22:
	ldr	r3, [fp, #12]
	mov	r0, r8
	mov	r1, fp
	ldr	r2, [r3]
	str	r9, [fp, #8]
	mov	r5, r9
	bl	load_sb_block
	b	.L1
.L20:
	bl	__stack_chk_fail
.L24:
	.align	2
.L23:
	.word	.LC1
	.word	AV_LOG_ERROR
	.word	.LC0
	.word	EINVAL
	.word	SEEK_CUR
	.word	SEEK_SET
	.word	AVERROR_INVALIDDATA
	.word	EIO
	.size	viv_read_header, .-viv_read_header
	.comm	SEEK_SET,4,4
	.comm	SEEK_CUR,4,4
	.comm	EIO,4,4
	.comm	EINVAL,4,4
	.comm	AV_LOG_ERROR,4,4
	.comm	AVERROR_INVALIDDATA,4,4
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
