	.file	"extr_vp8l_enc.c_StoreImageToBitMask.c"
	.intel_syntax noprefix
	.text
	.p2align 4
	.type	StoreImageToBitMask, @function
StoreImageToBitMask:
.LFB0:
	.cfi_startproc
	endbr64
	push	r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	mov	r15, rdi
	push	r14
	.cfi_def_cfa_offset 24
	.cfi_offset 14, -24
	push	r13
	.cfi_def_cfa_offset 32
	.cfi_offset 13, -32
	push	r12
	.cfi_def_cfa_offset 40
	.cfi_offset 12, -40
	mov	r12d, esi
	push	rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	mov	rbp, rcx
	push	rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	sub	rsp, 120
	.cfi_def_cfa_offset 176
	mov	DWORD PTR 72[rsp], edx
	mov	QWORD PTR 32[rsp], r8
	mov	QWORD PTR 40[rsp], r9
	mov	rax, QWORD PTR fs:40
	mov	QWORD PTR 104[rsp], rax
	xor	eax, eax
	mov	DWORD PTR 48[rsp], 0
	mov	DWORD PTR 52[rsp], 1
	test	edx, edx
	je	.L2
	mov	esi, edx
	mov	edi, r12d
	mov	ebx, edx
	call	VP8LSubSampleSize@PLT
	mov	ecx, ebx
	mov	DWORD PTR 52[rsp], eax
	mov	eax, -1
	sal	eax, cl
	mov	DWORD PTR 48[rsp], eax
.L2:
	mov	rax, QWORD PTR 32[rsp]
	mov	rcx, QWORD PTR 40[rsp]
	mov	rdi, rbp
	xor	r14d, r14d
	xor	ebp, ebp
	xor	ebx, ebx
	mov	r13d, r14d
	mov	eax, DWORD PTR [rax]
	lea	eax, [rax+rax*4]
	cdqe
	lea	rax, [rcx+rax*4]
	mov	QWORD PTR 8[rsp], rax
	call	VP8LRefsCursorInit@PLT
	mov	DWORD PTR 28[rsp], 0
	mov	QWORD PTR 96[rsp], rax
	lea	rax, 96[rsp]
	mov	QWORD PTR 16[rsp], rax
	mov	rdi, QWORD PTR 16[rsp]
	call	VP8LRefsCursorOk@PLT
	test	rax, rax
	je	.L22
	.p2align 4,,10
	.p2align 3
.L12:
	mov	eax, DWORD PTR 48[rsp]
	mov	r14, QWORD PTR 96[rsp]
	mov	edx, eax
	and	eax, ebp
	mov	DWORD PTR 24[rsp], eax
	and	edx, ebx
	cmp	edx, DWORD PTR 28[rsp]
	je	.L23
.L4:
	mov	edi, DWORD PTR 72[rsp]
	mov	eax, ebp
	mov	esi, ebx
	mov	DWORD PTR 28[rsp], edx
	mov	ecx, edi
	sar	eax, cl
	imul	eax, DWORD PTR 52[rsp]
	sar	esi, cl
	mov	rcx, QWORD PTR 32[rsp]
	add	eax, esi
	cdqe
	mov	eax, DWORD PTR [rcx+rax*4]
	mov	rcx, QWORD PTR 40[rsp]
	lea	eax, [rax+rax*4]
	cdqe
	lea	rax, [rcx+rax*4]
	mov	QWORD PTR 8[rsp], rax
.L5:
	mov	rdi, r14
	call	PixOrCopyIsLiteral@PLT
	test	rax, rax
	jne	.L24
	mov	rdi, r14
	call	PixOrCopyIsCacheIdx@PLT
	mov	rdi, r14
	test	rax, rax
	je	.L9
	call	PixOrCopyCacheIdx@PLT
	mov	edx, DWORD PTR NUM_LENGTH_CODES[rip]
	mov	rsi, QWORD PTR 8[rsp]
	mov	rdi, r15
	lea	edx, 256[rdx+rax]
	call	WriteHuffmanCode@PLT
.L7:
	mov	rdi, r14
	call	PixOrCopyLength@PLT
	add	ebx, eax
	cmp	r12d, ebx
	jg	.L10
	.p2align 4,,10
	.p2align 3
.L11:
	sub	ebx, r12d
	add	ebp, 1
	cmp	r12d, ebx
	jle	.L11
.L10:
	mov	rdi, QWORD PTR 16[rsp]
	call	VP8LRefsCursorNext@PLT
	mov	rdi, QWORD PTR 16[rsp]
	mov	r13d, DWORD PTR 24[rsp]
	call	VP8LRefsCursorOk@PLT
	test	rax, rax
	jne	.L12
.L22:
	cmp	QWORD PTR [r15], 0
	mov	eax, DWORD PTR VP8_ENC_OK[rip]
	je	.L1
	mov	eax, DWORD PTR VP8_ENC_ERROR_OUT_OF_MEMORY[rip]
.L1:
	mov	rcx, QWORD PTR 104[rsp]
	xor	rcx, QWORD PTR fs:40
	jne	.L25
	add	rsp, 120
	.cfi_remember_state
	.cfi_def_cfa_offset 56
	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
.L24:
	.cfi_restore_state
	lea	rcx, order.1994[rip]
	mov	r13, QWORD PTR 8[rsp]
	mov	DWORD PTR 56[rsp], ebx
	mov	esi, 1
	mov	rbx, r14
	mov	r14, rcx
.L8:
	mov	rdi, rbx
	add	r14, 4
	call	PixOrCopyLiteral@PLT
	mov	rsi, r13
	mov	rdi, r15
	add	r13, 4
	mov	edx, eax
	call	WriteHuffmanCode@PLT
	lea	rax, order.1994[rip+16]
	cmp	r14, rax
	je	.L19
	mov	esi, DWORD PTR [r14]
	jmp	.L8
	.p2align 4,,10
	.p2align 3
.L19:
	mov	r14, rbx
	mov	ebx, DWORD PTR 56[rsp]
	jmp	.L7
	.p2align 4,,10
	.p2align 3
.L23:
	cmp	r13d, eax
	jne	.L4
	jmp	.L5
	.p2align 4,,10
	.p2align 3
.L9:
	call	PixOrCopyDistance@PLT
	lea	r13, 92[rsp]
	lea	r11, 84[rsp]
	mov	edi, DWORD PTR [r14]
	lea	r10, 88[rsp]
	mov	rcx, r11
	mov	rsi, r13
	mov	QWORD PTR 64[rsp], r11
	mov	rdx, r10
	mov	QWORD PTR 56[rsp], r10
	mov	DWORD PTR 76[rsp], eax
	call	VP8LPrefixEncode@PLT
	mov	eax, DWORD PTR 92[rsp]
	mov	ecx, DWORD PTR 84[rsp]
	mov	rdi, r15
	mov	r8d, DWORD PTR 88[rsp]
	mov	rsi, QWORD PTR 8[rsp]
	lea	edx, 256[rax]
	call	WriteHuffmanCodeWithExtraBits@PLT
	mov	r11, QWORD PTR 64[rsp]
	mov	r10, QWORD PTR 56[rsp]
	mov	rsi, r13
	mov	r9d, DWORD PTR 76[rsp]
	mov	rdx, r10
	mov	rcx, r11
	mov	edi, r9d
	call	VP8LPrefixEncode@PLT
	mov	rax, QWORD PTR 8[rsp]
	mov	edx, DWORD PTR 92[rsp]
	mov	rdi, r15
	lea	rsi, 16[rax]
	call	WriteHuffmanCode@PLT
	mov	edx, DWORD PTR 88[rsp]
	mov	esi, DWORD PTR 84[rsp]
	mov	rdi, r15
	call	VP8LPutBits@PLT
	jmp	.L7
.L25:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE0:
	.size	StoreImageToBitMask, .-StoreImageToBitMask
	.section	.rodata
	.align 16
	.type	order.1994, @object
	.size	order.1994, 16
order.1994:
	.long	1
	.long	2
	.long	0
	.long	3
	.comm	VP8_ENC_OK,4,4
	.comm	VP8_ENC_ERROR_OUT_OF_MEMORY,4,4
	.comm	NUM_LENGTH_CODES,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_vp8l_enc.c_StoreImageToBitMask.c"
	.text
	.section	.rodata.cst4,"aM",%progbits,4
	.align	2
.LC0:
	.word	__stack_chk_guard
	.text
	.align	2
	.syntax unified
	.arm
	.fpu softvfp
	.type	StoreImageToBitMask, %function
StoreImageToBitMask:
	@ args = 8, pretend = 0, frame = 56
	@ frame_needed = 0, uses_anonymous_args = 0
	push	{r4, r5, r6, r7, r8, r9, r10, fp, lr}
	cmp	r2, #0
	sub	sp, sp, #68
	mov	r4, r3
	ldr	r3, .L26
	str	r2, [sp, #24]
	ldr	r3, [r3]
	str	r3, [sp, #60]
	mov	r3,#0
	ldr	r3, [sp, #104]
	mov	r9, r0
	str	r3, [sp, #28]
	ldr	r3, [sp, #108]
	mov	r6, r1
	str	r3, [sp, #32]
	bne	.L21
	ldr	r3, [sp, #24]
	str	r3, [sp, #20]
	mov	r3, #1
	str	r3, [sp, #36]
.L2:
	ldr	r3, [sp, #28]
	mov	r0, r4
	ldr	r2, [r3]
	ldr	r3, [sp, #32]
	add	r2, r2, r2, lsl #2
	add	fp, r3, r2, lsl #2
	bl	VP8LRefsCursorInit
	mov	r8, #0
	str	r0, [sp, #44]
	add	r0, sp, #44
	str	r8, [sp, #16]
	bl	VP8LRefsCursorOk
	cmp	r0, #0
	mov	r5, r8
	mov	r4, r8
	beq	.L22
.L12:
	ldr	r2, [sp, #20]
	ldr	r1, [sp, #16]
	and	r3, r4, r2
	cmp	r3, r1
	and	r2, r5, r2
	ldr	r7, [sp, #44]
	str	r2, [sp, #12]
	beq	.L23
.L4:
	ldr	r2, [sp, #24]
	ldr	r1, [sp, #36]
	str	r3, [sp, #16]
	asr	r3, r5, r2
	asr	r2, r4, r2
	mla	r1, r3, r1, r2
	ldr	r2, [sp, #28]
	ldr	r3, [sp, #32]
	ldr	fp, [r2, r1, lsl #2]
	add	fp, fp, fp, lsl #2
	add	fp, r3, fp, lsl #2
.L5:
	mov	r0, r7
	bl	PixOrCopyIsLiteral
	cmp	r0, #0
	bne	.L24
	mov	r0, r7
	bl	PixOrCopyIsCacheIdx
	cmp	r0, #0
	mov	r0, r7
	beq	.L9
	bl	PixOrCopyCacheIdx
	ldr	r3, .L26+4
	mov	r1, fp
	ldr	r3, [r3]
	add	r3, r3, #256
	add	r2, r3, r0
	mov	r0, r9
	bl	WriteHuffmanCode
.L7:
	mov	r0, r7
	bl	PixOrCopyLength
	add	r4, r4, r0
	cmp	r6, r4
	bgt	.L10
.L11:
	sub	r4, r4, r6
	cmp	r6, r4
	add	r5, r5, #1
	ble	.L11
.L10:
	add	r0, sp, #44
	ldr	r8, [sp, #12]
	bl	VP8LRefsCursorNext
	add	r0, sp, #44
	bl	VP8LRefsCursorOk
	cmp	r0, #0
	bne	.L12
.L22:
	ldr	r3, [r9]
	cmp	r3, #0
	ldrne	r3, .L26+8
	ldreq	r3, .L26+12
	ldr	r0, [r3]
	ldr	r3, .L26
	ldr	r2, [r3]
	ldr	r3, [sp, #60]
	eors	r2, r3, r2
	mov	r3, #0
	bne	.L25
	add	sp, sp, #68
	@ sp needed
	pop	{r4, r5, r6, r7, r8, r9, r10, fp, pc}
.L24:
	mov	r8, fp
	mov	r1, #1
	ldr	r10, .L26+16
.L8:
	mov	r0, r7
	bl	PixOrCopyLiteral
	mov	r1, r8
	mov	r2, r0
	mov	r0, r9
	bl	WriteHuffmanCode
	ldr	r3, .L26+20
	add	r8, r8, #4
	cmp	r3, r10
	beq	.L7
	ldr	r1, [r10], #4
	b	.L8
.L23:
	cmp	r8, r2
	bne	.L4
	b	.L5
.L9:
	bl	PixOrCopyDistance
	mov	r8, r0
	add	r1, sp, #56
	add	r3, sp, #48
	add	r2, sp, #52
	ldr	r0, [r7]
	bl	VP8LPrefixEncode
	ldr	r3, [sp, #52]
	ldr	r2, [sp, #56]
	mov	r1, fp
	str	r3, [sp]
	mov	r0, r9
	ldr	r3, [sp, #48]
	add	r2, r2, #256
	bl	WriteHuffmanCodeWithExtraBits
	add	r3, sp, #48
	add	r2, sp, #52
	add	r1, sp, #56
	mov	r0, r8
	bl	VP8LPrefixEncode
	ldr	r2, [sp, #56]
	add	r1, fp, #16
	mov	r0, r9
	bl	WriteHuffmanCode
	mov	r0, r9
	ldr	r2, [sp, #52]
	ldr	r1, [sp, #48]
	bl	VP8LPutBits
	b	.L7
.L21:
	ldr	r5, [sp, #24]
	mov	r0, r6
	mov	r1, r5
	bl	VP8LSubSampleSize
	mvn	r3, #0
	lsl	r3, r3, r5
	str	r0, [sp, #36]
	str	r3, [sp, #20]
	b	.L2
.L25:
	bl	__stack_chk_fail
.L27:
	.align	2
.L26:
	.word	.LC0
	.word	NUM_LENGTH_CODES
	.word	VP8_ENC_ERROR_OUT_OF_MEMORY
	.word	VP8_ENC_OK
	.word	.LANCHOR0+4
	.word	.LANCHOR0+16
	.size	StoreImageToBitMask, .-StoreImageToBitMask
	.comm	VP8_ENC_OK,4,4
	.comm	VP8_ENC_ERROR_OUT_OF_MEMORY,4,4
	.comm	NUM_LENGTH_CODES,4,4
	.section	.rodata
	.align	2
	.set	.LANCHOR0,. + 0
	.type	order.4278, %object
	.size	order.4278, 16
order.4278:
	.word	1
	.word	2
	.word	0
	.word	3
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
