	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function mtk_jpeg_calc_dst_size
_mtk_jpeg_calc_dst_size:                ## @mtk_jpeg_calc_dst_size
	.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
	subq	$72, %rsp
	.cfi_offset %rbx, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdi, %r14
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	%rax, -32(%rbp)
	movq	$0, -96(%rbp)
	movq	(%rdi), %rax
	movq	%rax, -88(%rbp)
	movq	%rax, -80(%rbp)
	cmpq	$0, 8(%rdi)
	je	LBB0_1
## %bb.2:
	movl	$1, %ebx
	xorl	%ecx, %ecx
	movq	_MTK_JPEG_DCTSIZE@GOTPCREL(%rip), %r15
	.p2align	4, 0x90
LBB0_3:                                 ## =>This Inner Loop Header: Depth=1
	movslq	16(%r14), %rax
	movslq	(%r15), %rsi
	imulq	%rsi, %rax
	movq	24(%r14), %rdx
	movq	32(%r14), %r8
	movslq	-4(%rdx,%rbx,4), %rdi
	imulq	%rax, %rdi
                                        ## kill: def $cl killed $cl killed $rcx
	shrq	%cl, %rdi
	movq	%rdi, -8(%r8,%rbx,8)
                                        ## kill: def $esi killed $esi killed $rsi
	callq	_mtk_jpeg_align
	movq	32(%r14), %rcx
	movq	%rax, -8(%rcx,%rbx,8)
	cmpq	$1, %rbx
	jne	LBB0_4
## %bb.5:                               ##   in Loop: Header=BB0_3 Depth=1
	movq	(%rcx), %rdi
	movl	$32, %esi
	jmp	LBB0_6
	.p2align	4, 0x90
LBB0_4:                                 ##   in Loop: Header=BB0_3 Depth=1
	movq	%rax, %rdi
	movl	$16, %esi
LBB0_6:                                 ##   in Loop: Header=BB0_3 Depth=1
	callq	_mtk_jpeg_align
	movq	40(%r14), %rcx
	movq	%rax, -8(%rcx,%rbx,8)
	movslq	(%r15), %rax
	movq	48(%r14), %rdx
	movslq	-4(%rdx,%rbx,4), %rdx
	imulq	%rax, %rdx
	movq	%rdx, -72(%rbp,%rbx,8)
	cmpq	8(%r14), %rbx
	jae	LBB0_9
## %bb.7:                               ##   in Loop: Header=BB0_3 Depth=1
	movq	-96(%rbp,%rbx,8), %rcx
	incq	%rbx
	cmpq	$3, %rcx
	jbe	LBB0_3
## %bb.8:
	movl	$-1, %eax
	jmp	LBB0_16
LBB0_1:
	movq	40(%r14), %rcx
                                        ## implicit-def: $rdi
	jmp	LBB0_10
LBB0_9:
	movq	-64(%rbp), %rdi
LBB0_10:
	movq	(%rcx), %rax
	movq	%rax, 56(%r14)
	movq	72(%r14), %rax
	imulq	%rdi, %rax
	movq	%rax, 64(%r14)
	movq	_MTK_JPEG_COMP_MAX@GOTPCREL(%rip), %r8
	cmpq	$0, (%r8)
	je	LBB0_11
## %bb.12:
	movq	80(%r14), %rsi
	movq	88(%r14), %rax
	movq	(%rcx), %rbx
	movq	%rbx, (%rsi)
	imulq	%rbx, %rdi
	imulq	72(%r14), %rdi
	movq	%rdi, (%rax)
	cmpq	$2, (%r8)
	jb	LBB0_15
## %bb.13:
	movl	$1, %edi
	.p2align	4, 0x90
LBB0_14:                                ## =>This Inner Loop Header: Depth=1
	movq	(%rcx,%rdi,8), %rbx
	movq	-64(%rbp,%rdi,8), %rdx
	imulq	%rbx, %rdx
	movq	%rbx, (%rsi,%rdi,8)
	imulq	72(%r14), %rdx
	movq	%rdx, (%rax,%rdi,8)
	incq	%rdi
	cmpq	(%r8), %rdi
	jb	LBB0_14
	jmp	LBB0_15
LBB0_11:
	movq	88(%r14), %rax
LBB0_15:
	movq	(%rax), %rcx
	movq	%rcx, 96(%r14)
	movq	8(%rax), %rax
	movq	%rax, 104(%r14)
	leaq	(%rcx,%rax,2), %rax
	movq	%rax, 112(%r14)
	xorl	%eax, %eax
LBB0_16:
	movq	___stack_chk_guard@GOTPCREL(%rip), %rcx
	movq	(%rcx), %rcx
	cmpq	-32(%rbp), %rcx
	jne	LBB0_18
## %bb.17:
	addq	$72, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_18:
	callq	___stack_chk_fail
	.cfi_endproc
                                        ## -- End function
	.comm	_MTK_JPEG_DCTSIZE,4,2           ## @MTK_JPEG_DCTSIZE
	.comm	_MTK_JPEG_COMP_MAX,8,3          ## @MTK_JPEG_COMP_MAX
	.no_dead_strip	_mtk_jpeg_calc_dst_size
.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_dst_size
_mtk_jpeg_calc_dst_size:                ; @mtk_jpeg_calc_dst_size
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #128
	.cfi_def_cfa_offset 128
	stp	x24, x23, [sp, #64]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #80]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #96]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #112]            ; 16-byte Folded Spill
	add	x29, sp, #112
	.cfi_def_cfa w29, 16
	.cfi_offset w30, -8
	.cfi_offset w29, -16
	.cfi_offset w19, -24
	.cfi_offset w20, -32
	.cfi_offset w21, -40
	.cfi_offset w22, -48
	.cfi_offset w23, -56
	.cfi_offset w24, -64
	mov	x19, x0
Lloh0:
	adrp	x8, ___stack_chk_guard@GOTPAGE
Lloh1:
	ldr	x8, [x8, ___stack_chk_guard@GOTPAGEOFF]
Lloh2:
	ldr	x8, [x8]
	str	x8, [sp, #56]
	ldp	x8, x9, [x0]
	stp	xzr, x8, [sp, #8]
	str	x8, [sp, #24]
	cbz	x9, LBB0_8
; %bb.1:
	mov	x21, #0
	mov	x8, #0
	add	x9, sp, #8
	add	x20, x9, #8
Lloh3:
	adrp	x22, _MTK_JPEG_DCTSIZE@GOTPAGE
Lloh4:
	ldr	x22, [x22, _MTK_JPEG_DCTSIZE@GOTPAGEOFF]
	add	x23, sp, #32
LBB0_2:                                 ; =>This Inner Loop Header: Depth=1
	ldrsw	x9, [x19, #16]
	ldrsw	x1, [x22]
	ldp	x10, x11, [x19, #24]
	ldrsw	x10, [x10, x21, lsl #2]
	mul	x9, x1, x9
	mul	x9, x9, x10
	lsr	x0, x9, x8
	lsl	x24, x21, #3
	str	x0, [x11, x24]
                                        ; kill: def $w1 killed $w1 killed $x1
	bl	_mtk_jpeg_align
	ldr	x8, [x19, #32]
	str	x0, [x8, x24]
	cbz	x21, LBB0_4
; %bb.3:                                ;   in Loop: Header=BB0_2 Depth=1
	mov	w1, #16
	b	LBB0_5
LBB0_4:                                 ;   in Loop: Header=BB0_2 Depth=1
	ldr	x0, [x8]
	mov	w1, #32
LBB0_5:                                 ;   in Loop: Header=BB0_2 Depth=1
	bl	_mtk_jpeg_align
	ldr	x8, [x19, #40]
	str	x0, [x8, x24]
	ldrsw	x9, [x22]
	ldr	x10, [x19, #48]
	ldrsw	x10, [x10, x21, lsl #2]
	mul	x9, x10, x9
	str	x9, [x23, x24]
	add	x9, x21, #1
	ldr	x10, [x19, #8]
	cmp	x9, x10
	b.hs	LBB0_9
; %bb.6:                                ;   in Loop: Header=BB0_2 Depth=1
	ldr	x8, [x20, x21, lsl #3]
	mov	x21, x9
	cmp	x8, #3
	b.ls	LBB0_2
; %bb.7:
	mov	w0, #-1
	b	LBB0_16
LBB0_8:
	ldr	x8, [x19, #40]
                                        ; implicit-def: $x12
	b	LBB0_10
LBB0_9:
	ldr	x12, [sp, #32]
LBB0_10:
	ldr	x9, [x8]
	ldr	x10, [x19, #72]
	mul	x10, x10, x12
	stp	x9, x10, [x19, #56]
Lloh5:
	adrp	x10, _MTK_JPEG_COMP_MAX@GOTPAGE
Lloh6:
	ldr	x10, [x10, _MTK_JPEG_COMP_MAX@GOTPAGEOFF]
	ldr	x9, [x10]
	cbz	x9, LBB0_14
; %bb.11:
	ldp	x11, x9, [x19, #80]
	ldr	x13, [x8]
	str	x13, [x11]
	mul	x12, x12, x13
	ldr	x13, [x19, #72]
	mul	x12, x12, x13
	str	x12, [x9]
	ldr	x12, [x10]
	cmp	x12, #2
	b.lo	LBB0_15
; %bb.12:
	mov	w12, #1
	add	x13, sp, #32
LBB0_13:                                ; =>This Inner Loop Header: Depth=1
	lsl	x14, x12, #3
	ldr	x15, [x13, x14]
	ldr	x16, [x8, x14]
	str	x16, [x11, x14]
	mul	x15, x15, x16
	ldr	x16, [x19, #72]
	mul	x15, x15, x16
	str	x15, [x9, x14]
	add	x12, x12, #1
	ldr	x14, [x10]
	cmp	x12, x14
	b.lo	LBB0_13
	b	LBB0_15
LBB0_14:
	ldr	x9, [x19, #88]
LBB0_15:
	mov	w0, #0
	ldr	x8, [x9]
	str	x8, [x19, #96]
	ldr	x9, [x9, #8]
	add	x8, x8, x9, lsl #1
	stp	x9, x8, [x19, #104]
LBB0_16:
	ldr	x8, [sp, #56]
Lloh7:
	adrp	x9, ___stack_chk_guard@GOTPAGE
Lloh8:
	ldr	x9, [x9, ___stack_chk_guard@GOTPAGEOFF]
Lloh9:
	ldr	x9, [x9]
	cmp	x9, x8
	b.ne	LBB0_18
; %bb.17:
	ldp	x29, x30, [sp, #112]            ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #96]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #80]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #64]             ; 16-byte Folded Reload
	add	sp, sp, #128
	ret
LBB0_18:
	bl	___stack_chk_fail
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGot	Lloh3, Lloh4
	.loh AdrpLdrGot	Lloh5, Lloh6
	.loh AdrpLdrGotLdr	Lloh7, Lloh8, Lloh9
	.cfi_endproc
                                        ; -- End function
	.comm	_MTK_JPEG_DCTSIZE,4,2           ; @MTK_JPEG_DCTSIZE
	.comm	_MTK_JPEG_COMP_MAX,8,3          ; @MTK_JPEG_COMP_MAX
	.no_dead_strip	_mtk_jpeg_calc_dst_size
.subsections_via_symbols
