	.file	"extr_mtk_jpeg_hw.c_mtk_jpeg_calc_mcu.c"
	.intel_syntax noprefix
	.text
	.p2align 4
	.type	mtk_jpeg_calc_mcu, @function
mtk_jpeg_calc_mcu:
.LFB0:
	.cfi_startproc
	endbr64
	mov	rsi, QWORD PTR [rdi]
	mov	r8, QWORD PTR 8[rdi]
	mov	r10d, 1
	mov	edx, r10d
	mov	eax, DWORD PTR [rsi]
	lea	ecx, 2[rax]
	mov	eax, DWORD PTR [r8]
	mov	DWORD PTR 40[rdi], 0
	sal	edx, cl
	lea	r11d, 2[rax]
	mov	eax, DWORD PTR 20[rdi]
	lea	r9d, -1[rax+rdx]
	mov	edx, DWORD PTR 28[rdi]
	add	eax, 7
	sar	r9d, cl
	mov	ecx, r11d
	sar	eax, 3
	sal	r10d, cl
	mov	DWORD PTR 16[rdi], r9d
	lea	r10d, -1[rdx+r10]
	add	edx, 7
	sar	edx, 3
	sar	r10d, cl
	imul	eax, edx
	mov	DWORD PTR 24[rdi], r10d
	imul	r9d, r10d
	mov	DWORD PTR 36[rdi], eax
	mov	eax, DWORD PTR MTK_JPEG_COMP_MAX[rip]
	mov	DWORD PTR 32[rdi], r9d
	test	eax, eax
	jle	.L7
	mov	rcx, QWORD PTR 48[rdi]
	xor	eax, eax
	.p2align 4,,10
	.p2align 3
.L6:
	mov	DWORD PTR [rcx+rax*4], 0
	cmp	DWORD PTR 56[rdi], eax
	jle	.L5
	mov	edx, DWORD PTR [rsi+rax*4]
	imul	edx, DWORD PTR [r8+rax*4]
	mov	DWORD PTR [rcx+rax*4], edx
	add	DWORD PTR 40[rdi], edx
.L5:
	add	rax, 1
	cmp	DWORD PTR MTK_JPEG_COMP_MAX[rip], eax
	jg	.L6
.L7:
	mov	r9d, DWORD PTR MTK_JPEG_BLOCK_MAX[rip]
	mov	DWORD PTR 60[rdi], 0
	test	r9d, r9d
	jle	.L16
	push	rbx
	.cfi_def_cfa_offset 16
	.cfi_offset 3, -16
	mov	r10d, DWORD PTR 40[rdi]
	xor	esi, esi
	xor	r11d, r11d
	xor	r8d, r8d
	xor	eax, eax
	mov	ebx, 7
	jmp	.L10
	.p2align 4,,10
	.p2align 3
.L17:
	cmp	DWORD PTR 56[rdi], r8d
	jle	.L8
	mov	edx, r8d
	add	r11d, 1
	and	edx, 3
	add	edx, 4
	sal	edx, cl
	mov	rcx, QWORD PTR 48[rdi]
	or	edx, esi
	mov	DWORD PTR 60[rdi], edx
	movsx	rdx, r8d
	cmp	DWORD PTR [rcx+rdx*4], r11d
	jne	.L9
	add	r8d, 1
	xor	r11d, r11d
.L9:
	add	eax, 1
	cmp	eax, r9d
	je	.L1
.L18:
	mov	esi, DWORD PTR 60[rdi]
.L10:
	lea	ecx, [rax+rax*2]
	cmp	r10d, eax
	jg	.L17
.L8:
	mov	edx, ebx
	add	eax, 1
	sal	edx, cl
	or	edx, esi
	mov	DWORD PTR 60[rdi], edx
	cmp	eax, r9d
	jne	.L18
.L1:
	pop	rbx
	.cfi_def_cfa_offset 8
	ret
	.p2align 4,,10
	.p2align 3
.L16:
	.cfi_restore 3
	ret
	.cfi_endproc
.LFE0:
	.size	mtk_jpeg_calc_mcu, .-mtk_jpeg_calc_mcu
	.comm	MTK_JPEG_COMP_MAX,4,4
	.comm	MTK_JPEG_BLOCK_MAX,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_mtk_jpeg_hw.c_mtk_jpeg_calc_mcu.c"
	.text
	.align	2
	.syntax unified
	.arm
	.fpu softvfp
	.type	mtk_jpeg_calc_mcu, %function
mtk_jpeg_calc_mcu:
	@ args = 0, pretend = 0, frame = 0
	@ frame_needed = 0, uses_anonymous_args = 0
	mov	r1, #1
	mov	r3, #0
	push	{r4, r5, r6, r7, r8, lr}
	ldm	r0, {r5, r6}
	ldr	r2, [r6]
	ldr	r7, [r5]
	ldr	ip, [r0, #12]
	ldr	lr, [r0, #20]
	add	r7, r7, #2
	add	r4, r2, #2
	add	r2, lr, r1, lsl r4
	add	r8, ip, r1, lsl r7
	add	lr, lr, #7
	sub	r1, r8, #1
	add	ip, ip, #7
	sub	r2, r2, #1
	asr	r1, r1, r7
	asr	r2, r2, r4
	asr	ip, ip, #3
	asr	r4, lr, #3
	ldr	lr, .L17
	mul	ip, r4, ip
	mul	r4, r2, r1
	ldr	r7, [lr]
	str	r1, [r0, #8]
	cmp	r7, r3
	str	r4, [r0, #24]
	str	r2, [r0, #16]
	str	ip, [r0, #28]
	str	r3, [r0, #32]
	ble	.L7
	mov	r4, r3
	ldr	r1, [r0, #36]
	sub	r1, r1, #4
.L6:
	str	r4, [r1, #4]!
	ldr	r2, [r0, #40]
	cmp	r2, r3
	ble	.L5
	ldr	ip, [r6, r3, lsl #2]
	ldr	r2, [r5, r3, lsl #2]
	mul	r2, ip, r2
	str	r2, [r1]
	ldr	ip, [r0, #32]
	add	r2, ip, r2
	str	r2, [r0, #32]
.L5:
	ldr	r2, [lr]
	add	r3, r3, #1
	cmp	r2, r3
	bgt	.L6
.L7:
	mov	r2, #0
	ldr	r3, .L17+4
	str	r2, [r0, #44]
	ldr	r4, [r3]
	cmp	r4, r2
	pople	{r4, r5, r6, r7, r8, pc}
	mov	r8, #7
	mov	r7, r2
	mov	lr, r2
	mov	r3, r2
	ldr	r5, [r0, #32]
	b	.L10
.L16:
	ldr	r6, [r0, #40]
	and	r1, lr, #3
	add	r1, r1, #4
	cmp	r6, lr
	orr	r1, r2, r1, lsl ip
	ble	.L8
	ldr	r2, [r0, #36]
	str	r1, [r0, #44]
	ldr	r2, [r2, lr, lsl #2]
	add	r7, r7, #1
	cmp	r2, r7
	moveq	r7, #0
	addeq	lr, lr, #1
.L9:
	add	r3, r3, #1
	cmp	r3, r4
	popeq	{r4, r5, r6, r7, r8, pc}
	ldr	r2, [r0, #44]
.L10:
	cmp	r5, r3
	add	ip, r3, r3, lsl #1
	bgt	.L16
.L8:
	orr	r2, r2, r8, lsl ip
	str	r2, [r0, #44]
	b	.L9
.L18:
	.align	2
.L17:
	.word	MTK_JPEG_COMP_MAX
	.word	MTK_JPEG_BLOCK_MAX
	.size	mtk_jpeg_calc_mcu, .-mtk_jpeg_calc_mcu
	.comm	MTK_JPEG_COMP_MAX,4,4
	.comm	MTK_JPEG_BLOCK_MAX,4,4
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
