	.file	"extr_redspark.c_redspark_read_header.c"
	.intel_syntax noprefix
	.text
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"Invalid sample rate: %d\n"
	.text
	.p2align 4
	.type	redspark_read_header, @function
redspark_read_header:
.LFB0:
	.cfi_startproc
	endbr64
	push	rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	mov	rbp, rsp
	.cfi_def_cfa_register 6
	push	r15
	push	r14
	push	r13
	push	r12
	push	rbx
	sub	rsp, 56
	.cfi_offset 15, -24
	.cfi_offset 14, -32
	.cfi_offset 13, -40
	.cfi_offset 12, -48
	.cfi_offset 3, -56
	mov	rax, QWORD PTR [rdi]
	mov	r13, QWORD PTR 8[rdi]
	mov	QWORD PTR -88[rbp], rdi
	mov	rcx, QWORD PTR fs:40
	mov	QWORD PTR -56[rbp], rcx
	xor	ecx, ecx
	mov	QWORD PTR -96[rbp], rax
	movsx	rax, DWORD PTR HEADER_SIZE[rip]
	mov	rcx, rsp
	lea	rax, 15[0+rax*4]
	mov	rdx, rax
	and	rax, -4096
	sub	rcx, rax
	and	rdx, -16
	mov	rax, rcx
	cmp	rsp, rax
	je	.L3
.L27:
	sub	rsp, 4096
	or	QWORD PTR 4088[rsp], 0
	cmp	rsp, rax
	jne	.L27
.L3:
	and	edx, 4095
	sub	rsp, rdx
	test	rdx, rdx
	jne	.L28
.L4:
	mov	rdi, QWORD PTR -88[rbp]
	xor	esi, esi
	mov	QWORD PTR -72[rbp], rsp
	call	avformat_new_stream@PLT
	mov	QWORD PTR -80[rbp], rax
	test	rax, rax
	je	.L29
	mov	rax, QWORD PTR -80[rbp]
	mov	rdi, r13
	mov	r14, QWORD PTR 8[rax]
	call	avio_rb32@PLT
	mov	r15, QWORD PTR -72[rbp]
	mov	esi, 1382376531
	xor	eax, 1382376531
	mov	r12d, eax
	mov	rdi, r15
	call	AV_WB32@PLT
	mov	esi, 11
	mov	edi, r12d
	call	rol@PLT
	mov	r8d, DWORD PTR HEADER_SIZE[rip]
	mov	ebx, eax
	cmp	r8d, 4
	jle	.L7
	lea	r12, 16[r15]
	mov	r15d, 4
	.p2align 4,,10
	.p2align 3
.L8:
	mov	esi, 3
	mov	edi, ebx
	add	r15d, 4
	call	rol@PLT
	mov	rdi, r13
	add	ebx, eax
	call	avio_rb32@PLT
	mov	rdi, r12
	add	r12, 16
	xor	eax, ebx
	mov	esi, eax
	call	AV_WB32@PLT
	mov	r8d, DWORD PTR HEADER_SIZE[rip]
	cmp	r8d, r15d
	jg	.L8
.L7:
	mov	eax, DWORD PTR AV_CODEC_ID_ADPCM_THP[rip]
	lea	rbx, -60[rbp]
	mov	rsi, QWORD PTR -72[rbp]
	mov	edx, r8d
	mov	rdi, rbx
	mov	DWORD PTR 20[r14], eax
	mov	eax, DWORD PTR AVMEDIA_TYPE_AUDIO[rip]
	mov	DWORD PTR 16[r14], eax
	call	bytestream2_init@PLT
	mov	edx, DWORD PTR SEEK_SET[rip]
	mov	esi, 60
	mov	rdi, rbx
	call	bytestream2_seek@PLT
	mov	rdi, rbx
	call	bytestream2_get_be32u@PLT
	mov	DWORD PTR [r14], eax
	mov	ecx, eax
	lea	eax, -1[rax]
	cmp	eax, 95999
	ja	.L30
	mov	rdi, rbx
	call	bytestream2_get_be32u@PLT
	mov	rcx, QWORD PTR -80[rbp]
	mov	esi, 10
	mov	rdi, rbx
	imul	eax, eax, 14
	mov	DWORD PTR [rcx], eax
	mov	rax, QWORD PTR -96[rbp]
	mov	QWORD PTR [rax], 0
	call	bytestream2_skipu@PLT
	mov	rdi, rbx
	call	bytestream2_get_byteu@PLT
	mov	DWORD PTR 4[r14], eax
	test	eax, eax
	je	.L25
	mov	rdi, rbx
	lea	r12d, 0[0+rax*8]
	call	bytestream2_get_byteu@PLT
	mov	esi, DWORD PTR 4[r14]
	mov	r8d, eax
	lea	eax, 84[r12]
	add	r12d, 100
	test	r8d, r8d
	cmove	r12d, eax
	imul	eax, esi, 46
	add	eax, r12d
	cmp	eax, DWORD PTR HEADER_SIZE[rip]
	jle	.L13
.L25:
	mov	eax, DWORD PTR AVERROR_INVALIDDATA[rip]
.L1:
	mov	rdx, QWORD PTR -56[rbp]
	xor	rdx, QWORD PTR fs:40
	jne	.L31
	lea	rsp, -40[rbp]
	pop	rbx
	pop	r12
	pop	r13
	pop	r14
	pop	r15
	pop	rbp
	.cfi_remember_state
	.cfi_def_cfa 7, 8
	ret
	.p2align 4,,10
	.p2align 3
.L30:
	.cfi_restore_state
	mov	esi, DWORD PTR AV_LOG_ERROR[rip]
	mov	rdi, QWORD PTR -88[rbp]
	lea	rdx, .LC0[rip]
	call	av_log@PLT
	mov	eax, DWORD PTR AVERROR_INVALIDDATA[rip]
	jmp	.L1
	.p2align 4,,10
	.p2align 3
.L28:
	or	QWORD PTR -8[rsp+rdx], 0
	jmp	.L4
	.p2align 4,,10
	.p2align 3
.L13:
	sal	esi, 5
	mov	rdi, r14
	call	ff_alloc_extradata@PLT
	test	rax, rax
	jne	.L25
	mov	edx, DWORD PTR SEEK_SET[rip]
	mov	esi, r12d
	mov	rdi, rbx
	call	bytestream2_seek@PLT
	mov	eax, DWORD PTR 4[r14]
	test	eax, eax
	jle	.L15
	xor	r12d, r12d
	jmp	.L17
	.p2align 4,,10
	.p2align 3
.L16:
	mov	esi, 14
	mov	rdi, rbx
	add	r12, 1
	call	bytestream2_skipu@PLT
	cmp	DWORD PTR 4[r14], r12d
	jle	.L15
.L17:
	mov	rsi, r12
	mov	edx, 32
	mov	rdi, rbx
	sal	rsi, 5
	add	rsi, QWORD PTR 8[r14]
	call	bytestream2_get_bufferu@PLT
	cmp	eax, 32
	je	.L16
	jmp	.L25
.L29:
	mov	edi, DWORD PTR ENOMEM[rip]
	call	AVERROR@PLT
	jmp	.L1
.L15:
	mov	ecx, DWORD PTR [r14]
	mov	rdi, QWORD PTR -80[rbp]
	mov	edx, 1
	mov	esi, 64
	call	avpriv_set_pts_info@PLT
	xor	eax, eax
	jmp	.L1
.L31:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE0:
	.size	redspark_read_header, .-redspark_read_header
	.comm	SEEK_SET,4,4
	.comm	HEADER_SIZE,4,4
	.comm	ENOMEM,4,4
	.comm	AV_LOG_ERROR,4,4
	.comm	AV_CODEC_ID_ADPCM_THP,4,4
	.comm	AVMEDIA_TYPE_AUDIO,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_redspark.c_redspark_read_header.c"
	.text
	.section	.rodata.str1.4,"aMS",%progbits,1
	.align	2
.LC0:
	.ascii	"Invalid sample rate: %d\012\000"
	.section	.rodata.cst4,"aM",%progbits,4
	.align	2
.LC1:
	.word	__stack_chk_guard
	.text
	.align	2
	.syntax unified
	.arm
	.fpu softvfp
	.type	redspark_read_header, %function
redspark_read_header:
	@ args = 0, pretend = 0, frame = 24
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{r4, r5, r6, r7, r8, r9, r10, fp, lr}
	add	fp, sp, #32
	sub	sp, sp, #28
	ldr	r6, .L24
	ldr	ip, .L24+4
	ldr	r3, [r6]
	str	r0, [fp, #-56]
	lsl	r3, r3, #2
	add	r3, r3, #7
	bic	r3, r3, #7
	sub	sp, sp, r3
	mov	r1, #0
	ldm	r0, {r3, r7}
	ldr	ip, [ip]
	str	ip, [fp, #-40]
	mov	ip,#0
	str	r3, [fp, #-52]
	bl	avformat_new_stream
	subs	r3, r0, #0
	str	r3, [fp, #-48]
	beq	.L21
	ldr	r3, [fp, #-48]
	mov	r0, r7
	ldr	r8, [r3, #4]
	bl	avio_rb32
	mov	r10, sp
	mov	r4, r0
	ldr	r1, .L24+8
	mov	r0, r10
	eor	r4, r4, r1
	bl	AV_WB32
	mov	r0, r4
	mov	r1, #11
	bl	rol
	ldr	r2, [r6]
	mov	r4, r0
	cmp	r2, #4
	ble	.L4
	mov	r9, #4
	add	r5, r10, #16
.L5:
	mov	r1, #3
	mov	r0, r4
	bl	rol
	mov	r2, r0
	mov	r0, r7
	add	r4, r4, r2
	bl	avio_rb32
	mov	r1, r0
	mov	r0, r5
	eor	r1, r1, r4
	bl	AV_WB32
	ldr	r2, [r6]
	add	r9, r9, #4
	cmp	r2, r9
	add	r5, r5, #16
	bgt	.L5
.L4:
	ldr	r1, .L24+12
	ldr	r3, .L24+16
	ldr	r0, [r1]
	ldr	r3, [r3]
	ldr	r4, .L24+20
	str	r3, [r8, #12]
	mov	r1, r10
	str	r0, [r8, #16]
	sub	r0, fp, #44
	bl	bytestream2_init
	mov	r1, #60
	ldr	r2, [r4]
	sub	r0, fp, #44
	bl	bytestream2_seek
	sub	r0, fp, #44
	bl	bytestream2_get_be32u
	ldr	r2, .L24+24
	sub	r1, r0, #1
	cmp	r1, r2
	str	r0, [r8]
	bcs	.L22
	sub	r0, fp, #44
	bl	bytestream2_get_be32u
	mov	r3, #0
	ldr	r2, [fp, #-48]
	rsb	r0, r0, r0, lsl #3
	lsl	r0, r0, #1
	str	r0, [r2]
	ldr	r2, [fp, #-52]
	mov	r1, #10
	str	r3, [r2]
	sub	r0, fp, #44
	bl	bytestream2_skipu
	sub	r0, fp, #44
	bl	bytestream2_get_byteu
	cmp	r0, #0
	mov	r3, r0
	str	r0, [r8, #4]
	bne	.L7
.L19:
	ldr	r3, .L24+28
	ldr	r6, [r3]
.L1:
	ldr	r3, .L24+4
	ldr	r2, [r3]
	ldr	r3, [fp, #-40]
	eors	r2, r3, r2
	mov	r3, #0
	bne	.L23
	mov	r0, r6
	sub	sp, fp, #32
	@ sp needed
	pop	{r4, r5, r6, r7, r8, r9, r10, fp, pc}
.L7:
	sub	r0, fp, #44
	lsl	r5, r3, #3
	bl	bytestream2_get_byteu
	ldr	r1, [r8, #4]
	cmp	r0, #0
	add	r3, r1, r1, lsl #1
	addeq	r5, r5, #84
	addne	r5, r5, #100
	ldr	r2, [r6]
	rsb	r3, r1, r3, lsl #3
	add	r3, r5, r3, lsl #1
	cmp	r3, r2
	bgt	.L19
	mov	r0, r8
	lsl	r1, r1, #5
	bl	ff_alloc_extradata
	subs	r6, r0, #0
	bne	.L19
	mov	r1, r5
	ldr	r2, [r4]
	sub	r0, fp, #44
	bl	bytestream2_seek
	ldr	r3, [r8, #4]
	cmp	r3, #0
	ble	.L12
	mov	r4, r6
	b	.L14
.L13:
	mov	r1, #14
	sub	r0, fp, #44
	bl	bytestream2_skipu
	ldr	r3, [r8, #4]
	add	r4, r4, #1
	cmp	r3, r4
	ble	.L12
.L14:
	ldr	r1, [r8, #8]
	mov	r2, #32
	add	r1, r1, r4, lsl #5
	sub	r0, fp, #44
	bl	bytestream2_get_bufferu
	cmp	r0, #32
	beq	.L13
	b	.L19
.L22:
	ldr	r2, .L24+32
	mov	r3, r0
	ldr	r1, [r2]
	ldr	r0, [fp, #-56]
	ldr	r2, .L24+36
	bl	av_log
	ldr	r3, .L24+28
	ldr	r6, [r3]
	b	.L1
.L21:
	ldr	r3, .L24+40
	ldr	r0, [r3]
	bl	AVERROR
	mov	r6, r0
	b	.L1
.L12:
	mov	r2, #1
	mov	r1, #64
	ldr	r3, [r8]
	ldr	r0, [fp, #-48]
	bl	avpriv_set_pts_info
	b	.L1
.L23:
	bl	__stack_chk_fail
.L25:
	.align	2
.L24:
	.word	HEADER_SIZE
	.word	.LC1
	.word	1382376531
	.word	AV_CODEC_ID_ADPCM_THP
	.word	AVMEDIA_TYPE_AUDIO
	.word	SEEK_SET
	.word	96000
	.word	AVERROR_INVALIDDATA
	.word	AV_LOG_ERROR
	.word	.LC0
	.word	ENOMEM
	.size	redspark_read_header, .-redspark_read_header
	.comm	SEEK_SET,4,4
	.comm	HEADER_SIZE,4,4
	.comm	ENOMEM,4,4
	.comm	AV_LOG_ERROR,4,4
	.comm	AV_CODEC_ID_ADPCM_THP,4,4
	.comm	AVMEDIA_TYPE_AUDIO,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
