	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function mtk_jpeg_calc_mcu
_mtk_jpeg_calc_mcu:                     ## @mtk_jpeg_calc_mcu
	.cfi_startproc
## %bb.0:
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset %rbp, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register %rbp
	pushq	%r15
	pushq	%r14
	pushq	%rbx
	.cfi_offset %rbx, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	(%rdi), %r9
	movq	8(%rdi), %r11
	movb	(%r9), %cl
	movb	(%r11), %r8b
	movl	20(%rdi), %r10d
	addb	$2, %cl
	movl	$-1, %edx
	movl	$-1, %eax
	shll	%cl, %eax
	notl	%eax
	addl	%r10d, %eax
	sarl	%cl, %eax
	addb	$2, %r8b
	movl	%r8d, %ecx
	shll	%cl, %edx
	movl	%eax, 16(%rdi)
	movl	28(%rdi), %esi
	notl	%edx
	addl	%esi, %edx
	sarl	%cl, %edx
	movl	%edx, 24(%rdi)
	imull	%eax, %edx
	movl	%edx, 32(%rdi)
	addl	$7, %r10d
	sarl	$3, %r10d
	addl	$7, %esi
	sarl	$3, %esi
	imull	%r10d, %esi
	movl	%esi, 36(%rdi)
	movl	$0, 40(%rdi)
	movq	_MTK_JPEG_COMP_MAX@GOTPCREL(%rip), %rax
	cmpl	$0, (%rax)
	jle	LBB0_5
## %bb.1:
	movq	48(%rdi), %rcx
	xorl	%edx, %edx
	jmp	LBB0_2
	.p2align	4, 0x90
LBB0_4:                                 ##   in Loop: Header=BB0_2 Depth=1
	incq	%rdx
	movslq	(%rax), %rsi
	cmpq	%rsi, %rdx
	jge	LBB0_5
LBB0_2:                                 ## =>This Inner Loop Header: Depth=1
	movl	$0, (%rcx,%rdx,4)
	movslq	56(%rdi), %rsi
	cmpq	%rsi, %rdx
	jge	LBB0_4
## %bb.3:                               ##   in Loop: Header=BB0_2 Depth=1
	movl	(%r11,%rdx,4), %esi
	imull	(%r9,%rdx,4), %esi
	movl	%esi, (%rcx,%rdx,4)
	addl	%esi, 40(%rdi)
	jmp	LBB0_4
LBB0_5:
	movl	$0, 60(%rdi)
	movq	_MTK_JPEG_BLOCK_MAX@GOTPCREL(%rip), %rax
	movl	(%rax), %r10d
	testl	%r10d, %r10d
	jle	LBB0_12
## %bb.6:
	movl	40(%rdi), %r9d
	xorl	%r8d, %r8d
	xorl	%ecx, %ecx
	xorl	%esi, %esi
	xorl	%edx, %edx
	xorl	%r11d, %r11d
	xorl	%r14d, %r14d
	jmp	LBB0_7
	.p2align	4, 0x90
LBB0_10:                                ##   in Loop: Header=BB0_7 Depth=1
	movl	$7, %eax
	shll	%cl, %eax
	orl	%eax, %esi
	movl	%esi, 60(%rdi)
LBB0_11:                                ##   in Loop: Header=BB0_7 Depth=1
	incl	%edx
	addl	$3, %ecx
	cmpl	%edx, %r10d
	je	LBB0_12
LBB0_7:                                 ## =>This Inner Loop Header: Depth=1
	cmpl	%r9d, %edx
	jge	LBB0_10
## %bb.8:                               ##   in Loop: Header=BB0_7 Depth=1
	cmpl	56(%rdi), %r14d
	jge	LBB0_10
## %bb.9:                               ##   in Loop: Header=BB0_7 Depth=1
	movl	%r14d, %ebx
	andl	$3, %ebx
	orl	$4, %ebx
	shll	%cl, %ebx
	orl	%ebx, %esi
	movl	%esi, 60(%rdi)
	incl	%r11d
	movq	48(%rdi), %r15
	movslq	%r14d, %rax
	xorl	%ebx, %ebx
	cmpl	(%r15,%rax,4), %r11d
	sete	%bl
	cmovel	%r8d, %r11d
	addl	%ebx, %r14d
	jmp	LBB0_11
LBB0_12:
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_MTK_JPEG_COMP_MAX,4,2          ## @MTK_JPEG_COMP_MAX
	.comm	_MTK_JPEG_BLOCK_MAX,4,2         ## @MTK_JPEG_BLOCK_MAX
	.no_dead_strip	_mtk_jpeg_calc_mcu
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function mtk_jpeg_calc_mcu
_mtk_jpeg_calc_mcu:                     ; @mtk_jpeg_calc_mcu
	.cfi_startproc
; %bb.0:
	ldp	x8, x9, [x0]
	ldr	w10, [x8]
	add	w10, w10, #2
	ldr	w11, [x9]
	add	w11, w11, #2
	add	x12, x0, #20
	mov	w13, #-1
	lsl	w14, w13, w10
	mvn	w14, w14
	add	x15, x0, #28
	lsl	w13, w13, w11
	ld1r.2s	{ v0 }, [x12]
	mvn	w12, w13
	movi.2s	v1, #7
	movi.2s	v2, #7
	mov.s	v2[0], w14
	add.2s	v0, v0, v2
	movi.2s	v2, #3
	movi.2s	v3, #3
	mov.s	v3[0], w10
	neg.2s	v3, v3
	sshl.2s	v0, v0, v3
	str	s0, [x0, #16]
	ld1r.2s	{ v3 }, [x15]
	mov.s	v1[0], w12
	add.2s	v1, v3, v1
	mov.s	v2[0], w11
	neg.2s	v2, v2
	sshl.2s	v1, v1, v2
	str	s1, [x0, #24]
	mul.2s	v0, v1, v0
	str	d0, [x0, #32]
	str	wzr, [x0, #40]
Lloh0:
	adrp	x10, _MTK_JPEG_COMP_MAX@GOTPAGE
Lloh1:
	ldr	x10, [x10, _MTK_JPEG_COMP_MAX@GOTPAGEOFF]
	ldr	w11, [x10]
	cmp	w11, #1
	b.lt	LBB0_5
; %bb.1:
	mov	x11, #0
	ldr	x12, [x0, #48]
	b	LBB0_3
LBB0_2:                                 ;   in Loop: Header=BB0_3 Depth=1
	add	x11, x11, #1
	ldrsw	x13, [x10]
	cmp	x11, x13
	b.ge	LBB0_5
LBB0_3:                                 ; =>This Inner Loop Header: Depth=1
	str	wzr, [x12, x11, lsl #2]
	ldrsw	x13, [x0, #56]
	cmp	x11, x13
	b.ge	LBB0_2
; %bb.4:                                ;   in Loop: Header=BB0_3 Depth=1
	lsl	x13, x11, #2
	ldr	w14, [x8, x13]
	ldr	w15, [x9, x13]
	mul	w14, w15, w14
	str	w14, [x12, x13]
	ldr	w13, [x0, #40]
	add	w13, w13, w14
	str	w13, [x0, #40]
	b	LBB0_2
LBB0_5:
	str	wzr, [x0, #60]
Lloh2:
	adrp	x8, _MTK_JPEG_BLOCK_MAX@GOTPAGE
Lloh3:
	ldr	x8, [x8, _MTK_JPEG_BLOCK_MAX@GOTPAGEOFF]
Lloh4:
	ldr	w8, [x8]
	cmp	w8, #1
	b.lt	LBB0_12
; %bb.6:
	mov	w9, #0
	mov	w10, #0
	mov	w11, #0
	mov	w12, #0
	mov	w13, #0
	ldr	w14, [x0, #40]
	mov	w15, #7
	b	LBB0_9
LBB0_7:                                 ;   in Loop: Header=BB0_9 Depth=1
	lsl	w16, w15, w9
	orr	w10, w10, w16
	str	w10, [x0, #60]
LBB0_8:                                 ;   in Loop: Header=BB0_9 Depth=1
	add	w11, w11, #1
	add	w9, w9, #3
	cmp	w8, w11
	b.eq	LBB0_12
LBB0_9:                                 ; =>This Inner Loop Header: Depth=1
	cmp	w11, w14
	b.ge	LBB0_7
; %bb.10:                               ;   in Loop: Header=BB0_9 Depth=1
	ldr	w16, [x0, #56]
	cmp	w13, w16
	b.ge	LBB0_7
; %bb.11:                               ;   in Loop: Header=BB0_9 Depth=1
	mov	w16, #4
	bfxil	w16, w13, #0, #2
	lsl	w16, w16, w9
	orr	w10, w10, w16
	str	w10, [x0, #60]
	add	w16, w12, #1
	ldr	x17, [x0, #48]
	ldr	w17, [x17, w13, sxtw #2]
	cmp	w16, w17
	cinc	w13, w13, eq
	csinc	w12, wzr, w12, eq
	b	LBB0_8
LBB0_12:
	ret
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.cfi_endproc
                                        ; -- End function
	.comm	_MTK_JPEG_COMP_MAX,4,2          ; @MTK_JPEG_COMP_MAX
	.comm	_MTK_JPEG_BLOCK_MAX,4,2         ; @MTK_JPEG_BLOCK_MAX
	.no_dead_strip	_mtk_jpeg_calc_mcu
.subsections_via_symbols
