	.file	"extr_flashsv2enc.c_encode_all_blocks.c"
	.intel_syntax noprefix
	.text
	.p2align 4
	.type	encode_all_blocks, @function
encode_all_blocks:
.LFB0:
	.cfi_startproc
	endbr64
	push	r14
	.cfi_def_cfa_offset 16
	.cfi_offset 14, -16
	push	r13
	.cfi_def_cfa_offset 24
	.cfi_offset 13, -24
	mov	r13d, esi
	push	r12
	.cfi_def_cfa_offset 32
	.cfi_offset 12, -32
	xor	r12d, r12d
	push	rbp
	.cfi_def_cfa_offset 40
	.cfi_offset 6, -40
	push	rbx
	.cfi_def_cfa_offset 48
	.cfi_offset 3, -48
	mov	eax, DWORD PTR [rdi]
	mov	rbx, rdi
	mov	edx, DWORD PTR 4[rdi]
	test	eax, eax
	jle	.L3
.L2:
	xor	ebp, ebp
	test	edx, edx
	jg	.L12
	jmp	.L13
	.p2align 4,,10
	.p2align 3
.L24:
	mov	rax, QWORD PTR 16[r14]
	mov	QWORD PTR [r14], 0
	mov	QWORD PTR 8[r14], rax
.L6:
	mov	edx, DWORD PTR 8[rbx]
	mov	eax, DWORD PTR 12[rbx]
	sub	rsp, 8
	.cfi_def_cfa_offset 56
	mov	esi, DWORD PTR 16[rbx]
	mov	r8d, DWORD PTR 44[rbx]
	push	r13
	.cfi_def_cfa_offset 64
	imul	eax, edx
	mov	rdi, QWORD PTR 56[rbx]
	lea	r9d, [rdx+rdx*2]
	mov	rdx, r14
	imul	esi, ebp
	push	r8
	.cfi_def_cfa_offset 72
	mov	r8d, DWORD PTR 48[rbx]
	imul	eax, r12d
	push	r8
	.cfi_def_cfa_offset 80
	lea	esi, [rsi+rsi*2]
	movsx	rsi, esi
	lea	eax, [rax+rax*2]
	cdqe
	add	rax, rsi
	lea	rsi, 52[rbx]
	lea	r8, [rdi+rax*4]
	mov	rdi, rbx
	call	encode_block@PLT
	add	rsp, 32
	.cfi_def_cfa_offset 48
	cmp	QWORD PTR 40[r14], 0
	je	.L10
	add	DWORD PTR 40[rbx], 1
.L10:
	mov	rdx, QWORD PTR 32[r14]
	add	DWORD PTR 36[rbx], edx
	mov	rdx, QWORD PTR 24[r14]
	add	DWORD PTR 32[rbx], edx
	test	eax, eax
	jne	.L1
	mov	edx, DWORD PTR 4[rbx]
	add	ebp, 1
	cmp	edx, ebp
	jle	.L23
.L12:
	mov	eax, edx
	mov	r14, QWORD PTR 80[rbx]
	imul	eax, r12d
	add	eax, ebp
	cdqe
	lea	rcx, 0[0+rax*8]
	sub	rcx, rax
	xor	eax, eax
	sal	rcx, 3
	add	r14, rcx
	add	rcx, QWORD PTR 72[rbx]
	cmp	QWORD PTR 64[rbx], 0
	je	.L4
	mov	eax, DWORD PTR COLORSPACE_15_7[rip]
.L4:
	mov	DWORD PTR 48[r14], eax
	test	r13d, r13d
	jne	.L24
	cmp	QWORD PTR 40[r14], 0
	je	.L25
	cmp	QWORD PTR [r14], 0
	jne	.L9
	mov	rdi, QWORD PTR 16[r14]
	cmp	QWORD PTR 8[r14], rdi
	je	.L6
.L9:
	or	eax, DWORD PTR HAS_DIFF_BLOCKS[rip]
	mov	DWORD PTR 48[r14], eax
	jmp	.L6
	.p2align 4,,10
	.p2align 3
.L25:
	add	ebp, 1
	mov	QWORD PTR [r14], 0
	mov	QWORD PTR 8[r14], 0
	mov	QWORD PTR 32[r14], 0
	cmp	edx, ebp
	jg	.L12
	.p2align 4,,10
	.p2align 3
.L23:
	mov	eax, DWORD PTR [rbx]
.L13:
	add	r12d, 1
	cmp	eax, r12d
	jg	.L2
.L3:
	mov	ecx, DWORD PTR 8[rbx]
	imul	ecx, DWORD PTR 24[rbx]
	imul	edx, eax
	add	DWORD PTR 28[rbx], edx
	xor	eax, eax
	lea	ecx, [rcx+rcx*2]
	add	DWORD PTR 20[rbx], ecx
.L1:
	pop	rbx
	.cfi_def_cfa_offset 40
	pop	rbp
	.cfi_def_cfa_offset 32
	pop	r12
	.cfi_def_cfa_offset 24
	pop	r13
	.cfi_def_cfa_offset 16
	pop	r14
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE0:
	.size	encode_all_blocks, .-encode_all_blocks
	.comm	HAS_DIFF_BLOCKS,4,4
	.comm	COLORSPACE_15_7,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_flashsv2enc.c_encode_all_blocks.c"
	.text
	.align	2
	.syntax unified
	.arm
	.fpu softvfp
	.type	encode_all_blocks, %function
encode_all_blocks:
	@ args = 0, pretend = 0, frame = 0
	@ frame_needed = 0, uses_anonymous_args = 0
	push	{r4, r5, r6, r7, r8, r9, r10, fp, lr}
	ldr	r3, [r0]
	mov	r4, r0
	cmp	r3, #0
	ldr	ip, [r0, #4]
	sub	sp, sp, #28
	ble	.L3
	mov	r7, r1
	mov	r8, #0
	ldr	r9, .L27
	ldr	r10, .L27+4
.L2:
	cmp	ip, #0
	movgt	r6, #0
	addgt	fp, r4, #52
	bgt	.L12
	b	.L13
.L26:
	mov	ip, #0
	ldr	r1, [r5, #8]
	str	ip, [r0, r2, lsl #2]
	str	r1, [r5, #4]
.L6:
	ldr	r2, [r4, #8]
	ldr	r1, [r4, #12]
	ldr	r0, [r4, #16]
	mul	r1, r2, r1
	mul	r0, r6, r0
	mul	r1, r8, r1
	ldr	lr, [r4, #56]
	add	r1, r1, r1, lsl #1
	add	r0, r0, r0, lsl #1
	ldr	ip, [r4, #44]
	add	r0, r1, r0
	ldr	r1, [r4, #48]
	add	r0, lr, r0, lsl #2
	add	r2, r2, r2, lsl #1
	stm	sp, {r0, r2}
	str	ip, [sp, #12]
	mov	r2, r5
	str	r1, [sp, #8]
	mov	r0, r4
	mov	r1, fp
	str	r7, [sp, #16]
	bl	encode_block
	ldr	r3, [r5, #20]
	ldr	ip, [r5, #16]
	cmp	r3, #0
	ldrne	r3, [r4, #40]
	ldr	r1, [r5, #12]
	addne	r3, r3, #1
	ldr	r2, [r4, #36]
	strne	r3, [r4, #40]
	ldr	r3, [r4, #32]
	add	r2, r2, ip
	add	r3, r3, r1
	cmp	r0, #0
	str	r2, [r4, #36]
	str	r3, [r4, #32]
	bne	.L1
	ldr	ip, [r4, #4]
.L8:
	add	r6, r6, #1
	cmp	ip, r6
	ble	.L25
.L12:
	mla	r2, r8, ip, r6
	ldr	r1, [r4, #60]
	ldr	r0, [r4, #68]
	cmp	r1, #0
	ldr	r3, [r4, #64]
	ldrne	r1, [r9]
	rsb	r2, r2, r2, lsl #3
	add	r5, r0, r2, lsl #2
	cmp	r7, #0
	add	r3, r3, r2, lsl #2
	str	r1, [r5, #24]
	bne	.L26
	ldr	lr, [r5, #20]
	cmp	lr, #0
	streq	r7, [r0, r2, lsl #2]
	streq	r7, [r5, #4]
	streq	r7, [r5, #16]
	beq	.L8
	ldr	r2, [r0, r2, lsl #2]
	cmp	r2, #0
	bne	.L9
	ldmib	r5, {r0, r2}
	cmp	r0, r2
	beq	.L6
.L9:
	ldr	r2, [r10]
	orr	r1, r2, r1
	str	r1, [r5, #24]
	b	.L6
.L25:
	ldr	r3, [r4]
.L13:
	add	r8, r8, #1
	cmp	r3, r8
	bgt	.L2
.L3:
	mov	r0, #0
	ldr	r1, [r4, #24]
	ldr	r2, [r4, #8]
	ldr	lr, [r4, #28]
	mul	r2, r1, r2
	mla	r3, ip, r3, lr
	ldr	r1, [r4, #20]
	add	r2, r2, r2, lsl #1
	add	r2, r1, r2
	str	r2, [r4, #20]
	str	r3, [r4, #28]
.L1:
	add	sp, sp, #28
	@ sp needed
	pop	{r4, r5, r6, r7, r8, r9, r10, fp, pc}
.L28:
	.align	2
.L27:
	.word	COLORSPACE_15_7
	.word	HAS_DIFF_BLOCKS
	.size	encode_all_blocks, .-encode_all_blocks
	.comm	HAS_DIFF_BLOCKS,4,4
	.comm	COLORSPACE_15_7,4,4
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
