	.file	"extr_vmdvideo.c_lz_unpack.c"
	.intel_syntax noprefix
	.text
	.p2align 4
	.type	lz_unpack, @function
lz_unpack:
.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
	.cfi_offset 15, -24
	.cfi_offset 14, -32
	movsx	r14, ecx
	push	r13
	push	r12
	push	rbx
	sub	rsp, 72
	.cfi_offset 13, -40
	.cfi_offset 12, -48
	.cfi_offset 3, -56
	mov	QWORD PTR -112[rbp], rdx
	mov	rbx, rsp
	mov	rax, QWORD PTR fs:40
	mov	QWORD PTR -56[rbp], rax
	xor	eax, eax
	movsx	rax, DWORD PTR QUEUE_SIZE[rip]
	add	rax, 15
	mov	rdx, rax
	and	rax, -4096
	sub	rbx, rax
	and	rdx, -16
	mov	rax, rbx
	cmp	rsp, rax
	je	.L3
.L48:
	sub	rsp, 4096
	or	QWORD PTR 4088[rsp], 0
	cmp	rsp, rax
	jne	.L48
.L3:
	and	edx, 4095
	sub	rsp, rdx
	test	rdx, rdx
	jne	.L49
.L4:
	lea	rbx, -60[rbp]
	mov	edx, esi
	mov	rsi, rdi
	mov	r12, rsp
	mov	rdi, rbx
	call	bytestream2_init@PLT
	mov	rdi, rbx
	call	bytestream2_get_le32@PLT
	mov	edx, DWORD PTR QUEUE_SIZE[rip]
	mov	rdi, rsp
	mov	esi, 32
	mov	DWORD PTR -68[rbp], eax
	call	memset@PLT
	mov	rdi, rbx
	call	bytestream2_get_bytes_left@PLT
	cmp	eax, 3
	jg	.L5
.L19:
	mov	eax, DWORD PTR AVERROR_INVALIDDATA[rip]
.L1:
	mov	rsi, QWORD PTR -56[rbp]
	xor	rsi, QWORD PTR fs:40
	jne	.L50
	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
.L5:
	.cfi_restore_state
	mov	rdi, rbx
	mov	r13d, 4078
	call	bytestream2_peek_le32@PLT
	mov	DWORD PTR -100[rbp], 100
	cmp	eax, 1450709556
	je	.L51
.L7:
	mov	edx, DWORD PTR -68[rbp]
	test	edx, edx
	je	.L30
	mov	r15, QWORD PTR -112[rbp]
	add	r14, r15
	mov	QWORD PTR -80[rbp], r14
	mov	r14d, r13d
	.p2align 4,,10
	.p2align 3
.L25:
	mov	rdi, rbx
	call	bytestream2_get_bytes_left@PLT
	test	eax, eax
	jle	.L46
	mov	rdi, rbx
	call	bytestream2_get_byteu@PLT
	mov	r13d, eax
	cmp	al, -1
	jne	.L29
	cmp	DWORD PTR -68[rbp], 8
	jbe	.L29
	mov	rax, QWORD PTR -80[rbp]
	sub	rax, r15
	cmp	rax, 7
	jle	.L19
	mov	rdi, rbx
	call	bytestream2_get_bytes_left@PLT
	cmp	eax, 7
	jle	.L19
	lea	r13, 8[r15]
	.p2align 4,,10
	.p2align 3
.L11:
	mov	rdi, rbx
	add	r15, 1
	call	bytestream2_get_byteu@PLT
	lea	edx, 1[r14]
	mov	BYTE PTR -1[r15], al
	and	edx, DWORD PTR QUEUE_MASK[rip]
	mov	BYTE PTR [r12+r14], al
	mov	r14d, edx
	cmp	r13, r15
	jne	.L11
	sub	DWORD PTR -68[rbp], 8
	jmp	.L25
	.p2align 4,,10
	.p2align 3
.L29:
	mov	rax, rbx
	mov	DWORD PTR -72[rbp], 8
	mov	ebx, r14d
	mov	r14, rax
	jmp	.L8
	.p2align 4,,10
	.p2align 3
.L53:
	test	rcx, rcx
	jle	.L19
	mov	rdi, r14
	call	bytestream2_get_bytes_left@PLT
	test	eax, eax
	jle	.L19
	mov	rdi, r14
	add	r15, 1
	shr	r13b
	call	bytestream2_get_byteu@PLT
	lea	ecx, 1[rbx]
	sub	DWORD PTR -68[rbp], 1
	mov	edx, ebx
	mov	BYTE PTR -1[r15], al
	and	ecx, DWORD PTR QUEUE_MASK[rip]
	sub	DWORD PTR -72[rbp], 1
	mov	ebx, ecx
	mov	BYTE PTR [r12+rdx], al
	je	.L52
.L23:
	mov	ecx, DWORD PTR -68[rbp]
	test	ecx, ecx
	je	.L46
.L8:
	mov	rcx, QWORD PTR -80[rbp]
	sub	rcx, r15
	test	r13b, 1
	jne	.L53
	mov	rdi, r14
	mov	QWORD PTR -96[rbp], rcx
	call	bytestream2_get_byte@PLT
	mov	rdi, r14
	mov	DWORD PTR -88[rbp], eax
	call	bytestream2_peek_byte@PLT
	mov	r8d, DWORD PTR -88[rbp]
	mov	rdi, r14
	sal	eax, 4
	and	eax, 3840
	or	r8d, eax
	mov	DWORD PTR -88[rbp], r8d
	call	bytestream2_get_byte@PLT
	mov	r8d, DWORD PTR -88[rbp]
	mov	rcx, QWORD PTR -96[rbp]
	and	eax, 15
	lea	r9d, 3[rax]
	cmp	r9d, DWORD PTR -100[rbp]
	je	.L54
	mov	eax, r9d
	cmp	rcx, rax
	jl	.L19
.L20:
	mov	ecx, DWORD PTR QUEUE_MASK[rip]
	xor	edi, edi
	mov	eax, ecx
	.p2align 4,,10
	.p2align 3
.L22:
	lea	ecx, [r8+rdi]
	lea	edx, 1[rbx]
	and	ecx, eax
	movzx	eax, BYTE PTR [r12+rcx]
	mov	BYTE PTR [r15+rdi], al
	add	rdi, 1
	mov	BYTE PTR [r12+rbx], al
	mov	eax, DWORD PTR QUEUE_MASK[rip]
	and	edx, eax
	mov	ebx, edx
	cmp	r9d, edi
	ja	.L22
	lea	eax, -1[r9]
	mov	esi, 1
	add	rax, 1
	test	r9d, r9d
	cmove	rax, rsi
	add	r15, rax
.L21:
	sub	DWORD PTR -68[rbp], r9d
	shr	r13b
	sub	DWORD PTR -72[rbp], 1
	jne	.L23
	.p2align 4,,10
	.p2align 3
.L52:
	mov	rax, r14
	mov	r14d, ebx
	mov	rbx, rax
	mov	eax, DWORD PTR -68[rbp]
	test	eax, eax
	jne	.L25
	.p2align 4,,10
	.p2align 3
.L46:
	mov	eax, r15d
	sub	eax, DWORD PTR -112[rbp]
	jmp	.L1
	.p2align 4,,10
	.p2align 3
.L54:
	mov	rdi, r14
	mov	QWORD PTR -88[rbp], rcx
	mov	DWORD PTR -96[rbp], r8d
	call	bytestream2_get_byte@PLT
	mov	rcx, QWORD PTR -88[rbp]
	add	eax, 18
	mov	r9, rax
	cmp	rax, rcx
	jg	.L19
	mov	r8d, DWORD PTR -96[rbp]
	test	eax, eax
	je	.L21
	jmp	.L20
	.p2align 4,,10
	.p2align 3
.L49:
	or	QWORD PTR -8[rsp+rdx], 0
	jmp	.L4
.L51:
	mov	esi, 4
	mov	rdi, rbx
	mov	r13d, 273
	call	bytestream2_skipu@PLT
	mov	DWORD PTR -100[rbp], 18
	jmp	.L7
.L30:
	xor	eax, eax
	jmp	.L1
.L50:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE0:
	.size	lz_unpack, .-lz_unpack
	.comm	QUEUE_SIZE,4,4
	.comm	QUEUE_MASK,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_vmdvideo.c_lz_unpack.c"
	.text
	.section	.rodata.cst4,"aM",%progbits,4
	.align	2
.LC0:
	.word	__stack_chk_guard
	.text
	.align	2
	.syntax unified
	.arm
	.fpu softvfp
	.type	lz_unpack, %function
lz_unpack:
	@ args = 0, pretend = 0, frame = 32
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{r4, r5, r6, r7, r8, r9, r10, fp, lr}
	add	fp, sp, #32
	sub	sp, sp, #36
	mov	r4, r2
	mov	ip, r1
	ldr	r5, .L40
	mov	r1, r0
	ldr	r2, [r5]
	str	r4, [fp, #-60]
	add	r0, r2, #7
	bic	r0, r0, #7
	mov	r4, r3
	ldr	r3, .L40+4
	sub	sp, sp, r0
	mov	r2, ip
	sub	r0, fp, #44
	ldr	r3, [r3]
	str	r3, [fp, #-40]
	mov	r3,#0
	bl	bytestream2_init
	sub	r0, fp, #44
	bl	bytestream2_get_le32
	mov	r1, #32
	ldr	r2, [r5]
	mov	r9, r0
	mov	r0, sp
	bl	memset
	sub	r0, fp, #44
	bl	bytestream2_get_bytes_left
	cmp	r0, #3
	bgt	.L2
.L16:
	ldr	r3, .L40+8
	ldr	r0, [r3]
.L1:
	ldr	r3, .L40+4
	ldr	r2, [r3]
	ldr	r3, [fp, #-40]
	eors	r2, r3, r2
	mov	r3, #0
	bne	.L35
	sub	sp, fp, #32
	@ sp needed
	pop	{r4, r5, r6, r7, r8, r9, r10, fp, pc}
.L2:
	sub	r0, fp, #44
	bl	bytestream2_peek_le32
	ldr	r3, .L40+12
	mov	r6, sp
	cmp	r0, r3
	beq	.L36
	mov	r3, #100
	ldr	r5, .L40+16
	str	r3, [fp, #-64]
.L4:
	cmp	r9, #0
	beq	.L27
	ldr	r3, [fp, #-60]
	ldr	r7, .L40+20
	add	r2, r3, r4
	mov	r4, r3
	str	r2, [fp, #-52]
.L22:
	sub	r0, fp, #44
	bl	bytestream2_get_bytes_left
	cmp	r0, #0
	ble	.L33
	sub	r0, fp, #44
	bl	bytestream2_get_byteu
	and	r10, r0, #255
	sub	r3, r10, #255
	clz	r3, r3
	cmp	r9, #8
	lsr	r3, r3, #5
	movls	r3, #0
	cmp	r3, #0
	beq	.L26
	ldr	r3, [fp, #-52]
	sub	r3, r3, r4
	cmp	r3, #7
	ble	.L16
	sub	r0, fp, #44
	bl	bytestream2_get_bytes_left
	cmp	r0, #7
	ble	.L16
	add	r8, r4, #8
.L8:
	sub	r0, fp, #44
	bl	bytestream2_get_byteu
	and	r0, r0, #255
	strb	r0, [r4], #1
	ldr	r3, [r7]
	add	r2, r5, #1
	cmp	r4, r8
	strb	r0, [r6, r5]
	and	r5, r2, r3
	bne	.L8
	sub	r9, r9, #8
	b	.L22
.L26:
	mov	r3, #8
	str	r3, [fp, #-48]
	b	.L5
.L38:
	cmp	r3, #0
	ble	.L16
	sub	r0, fp, #44
	bl	bytestream2_get_bytes_left
	cmp	r0, #0
	ble	.L16
	sub	r0, fp, #44
	bl	bytestream2_get_byteu
	and	r0, r0, #255
	strb	r0, [r4], #1
	ldr	r3, [r7]
	add	r2, r5, #1
	strb	r0, [r6, r5]
	sub	r9, r9, #1
	and	r5, r2, r3
.L14:
	ldr	r3, [fp, #-48]
	lsr	r10, r10, #1
	subs	r3, r3, #1
	str	r3, [fp, #-48]
	beq	.L37
	cmp	r9, #0
	beq	.L33
.L5:
	ldr	r3, [fp, #-52]
	tst	r10, #1
	sub	r3, r3, r4
	bne	.L38
	sub	r0, fp, #44
	str	r3, [fp, #-56]
	bl	bytestream2_get_byte
	mov	r8, r0
	sub	r0, fp, #44
	bl	bytestream2_peek_byte
	lsl	r2, r0, #4
	and	r2, r2, #3840
	sub	r0, fp, #44
	orr	r8, r2, r8
	bl	bytestream2_get_byte
	ldr	r3, [fp, #-64]
	and	r0, r0, #15
	add	r0, r0, #3
	cmp	r0, r3
	ldr	r3, [fp, #-56]
	beq	.L39
	cmp	r3, r0
	bcc	.L16
.L17:
	mov	r1, r4
	mov	r2, #0
	ldr	r3, [r7]
	sub	r8, r8, r4
.L19:
	add	ip, r1, r8
	and	r3, r3, ip
	ldrb	ip, [r6, r3]	@ zero_extendqisi2
	add	r2, r2, #1
	strb	ip, [r1], #1
	ldr	r3, [r7]
	add	lr, r5, #1
	cmp	r2, r0
	strb	ip, [r6, r5]
	and	r5, r3, lr
	bcc	.L19
	cmp	r0, #0
	movne	r3, r0
	moveq	r3, #1
	add	r4, r4, r3
.L18:
	sub	r9, r9, r0
	b	.L14
.L37:
	cmp	r9, #0
	bne	.L22
.L33:
	ldr	r3, [fp, #-60]
	sub	r0, r4, r3
	b	.L1
.L39:
	sub	r0, fp, #44
	bl	bytestream2_get_byte
	ldr	r3, [fp, #-56]
	add	r0, r0, #18
	cmp	r3, r0
	bcc	.L16
	cmp	r0, #0
	beq	.L18
	b	.L17
.L36:
	mov	r1, #4
	sub	r0, fp, #44
	bl	bytestream2_skipu
	mov	r3, #18
	ldr	r5, .L40+24
	str	r3, [fp, #-64]
	b	.L4
.L27:
	mov	r0, r9
	b	.L1
.L35:
	bl	__stack_chk_fail
.L41:
	.align	2
.L40:
	.word	QUEUE_SIZE
	.word	.LC0
	.word	AVERROR_INVALIDDATA
	.word	1450709556
	.word	4078
	.word	QUEUE_MASK
	.word	273
	.size	lz_unpack, .-lz_unpack
	.comm	QUEUE_SIZE,4,4
	.comm	QUEUE_MASK,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
