	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function mtk_jpeg_calc_dma_group
_mtk_jpeg_calc_dma_group:               ## @mtk_jpeg_calc_dma_group
	.cfi_startproc
## %bb.0:
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset %rbp, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register %rbp
	movl	(%rdi), %eax
	movq	_MTK_JPEG_COLOR_444@GOTPCREL(%rip), %rcx
	cmpl	(%rcx), %eax
	jne	LBB0_2
## %bb.1:
	movq	8(%rdi), %rdx
	movq	_V4L2_PIX_FMT_YUV422M@GOTPCREL(%rip), %rsi
	movl	$4, %ecx
	cmpq	(%rsi), %rdx
	je	LBB0_7
LBB0_2:
	movq	_MTK_JPEG_COLOR_422V@GOTPCREL(%rip), %rcx
	cmpl	(%rcx), %eax
	jne	LBB0_4
## %bb.3:
	movq	8(%rdi), %rdx
	movq	_V4L2_PIX_FMT_YUV420M@GOTPCREL(%rip), %rsi
	movl	$4, %ecx
	cmpq	(%rsi), %rdx
	je	LBB0_7
LBB0_4:
	movq	_MTK_JPEG_COLOR_422X2@GOTPCREL(%rip), %rcx
	cmpl	(%rcx), %eax
	jne	LBB0_6
## %bb.5:
	movq	8(%rdi), %rdx
	movq	_V4L2_PIX_FMT_YUV422M@GOTPCREL(%rip), %rsi
	movl	$2, %ecx
	cmpq	(%rsi), %rdx
	je	LBB0_7
LBB0_6:
	movq	_MTK_JPEG_COLOR_400@GOTPCREL(%rip), %rcx
	cmpl	(%rcx), %eax
	sete	%cl
	testw	%ax, %ax
	sete	%al
	orb	%cl, %al
	movzbl	%al, %ecx
	addl	$3, %ecx
LBB0_7:
	movl	$1, %esi
                                        ## kill: def $cl killed $cl killed $ecx
	shll	%cl, %esi
	movl	%esi, 16(%rdi)
	movl	24(%rdi), %eax
	cltd
	idivl	%esi
	movl	%eax, 20(%rdi)
	movl	%edx, 28(%rdi)
	testl	%edx, %edx
	je	LBB0_9
## %bb.8:
	incl	%eax
	movl	%eax, 20(%rdi)
	popq	%rbp
	retq
LBB0_9:
	movl	%esi, 28(%rdi)
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_MTK_JPEG_COLOR_444,4,2         ## @MTK_JPEG_COLOR_444
	.comm	_V4L2_PIX_FMT_YUV422M,8,3       ## @V4L2_PIX_FMT_YUV422M
	.comm	_MTK_JPEG_COLOR_422V,4,2        ## @MTK_JPEG_COLOR_422V
	.comm	_V4L2_PIX_FMT_YUV420M,8,3       ## @V4L2_PIX_FMT_YUV420M
	.comm	_MTK_JPEG_COLOR_422X2,4,2       ## @MTK_JPEG_COLOR_422X2
	.comm	_MTK_JPEG_COLOR_400,4,2         ## @MTK_JPEG_COLOR_400
	.no_dead_strip	_mtk_jpeg_calc_dma_group
.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_dma_group
_mtk_jpeg_calc_dma_group:               ; @mtk_jpeg_calc_dma_group
	.cfi_startproc
; %bb.0:
	ldr	w8, [x0]
Lloh0:
	adrp	x9, _MTK_JPEG_COLOR_444@GOTPAGE
Lloh1:
	ldr	x9, [x9, _MTK_JPEG_COLOR_444@GOTPAGEOFF]
Lloh2:
	ldr	w9, [x9]
	cmp	w8, w9
	b.ne	LBB0_2
; %bb.1:
	ldr	x9, [x0, #8]
Lloh3:
	adrp	x10, _V4L2_PIX_FMT_YUV422M@GOTPAGE
Lloh4:
	ldr	x10, [x10, _V4L2_PIX_FMT_YUV422M@GOTPAGEOFF]
Lloh5:
	ldr	x10, [x10]
	cmp	x9, x10
	b.eq	LBB0_4
LBB0_2:
Lloh6:
	adrp	x9, _MTK_JPEG_COLOR_422V@GOTPAGE
Lloh7:
	ldr	x9, [x9, _MTK_JPEG_COLOR_422V@GOTPAGEOFF]
Lloh8:
	ldr	w9, [x9]
	cmp	w8, w9
	b.ne	LBB0_5
; %bb.3:
	ldr	x9, [x0, #8]
Lloh9:
	adrp	x10, _V4L2_PIX_FMT_YUV420M@GOTPAGE
Lloh10:
	ldr	x10, [x10, _V4L2_PIX_FMT_YUV420M@GOTPAGEOFF]
Lloh11:
	ldr	x10, [x10]
	cmp	x9, x10
	b.ne	LBB0_5
LBB0_4:
	mov	w8, #4
	b	LBB0_9
LBB0_5:
Lloh12:
	adrp	x9, _MTK_JPEG_COLOR_422X2@GOTPAGE
Lloh13:
	ldr	x9, [x9, _MTK_JPEG_COLOR_422X2@GOTPAGEOFF]
Lloh14:
	ldr	w9, [x9]
	cmp	w8, w9
	b.ne	LBB0_8
; %bb.6:
	ldr	x9, [x0, #8]
Lloh15:
	adrp	x10, _V4L2_PIX_FMT_YUV422M@GOTPAGE
Lloh16:
	ldr	x10, [x10, _V4L2_PIX_FMT_YUV422M@GOTPAGEOFF]
Lloh17:
	ldr	x10, [x10]
	cmp	x9, x10
	b.ne	LBB0_8
; %bb.7:
	mov	w8, #2
	b	LBB0_9
LBB0_8:
Lloh18:
	adrp	x9, _MTK_JPEG_COLOR_400@GOTPAGE
Lloh19:
	ldr	x9, [x9, _MTK_JPEG_COLOR_400@GOTPAGEOFF]
Lloh20:
	ldr	w9, [x9]
	cmp	w8, w9
	and	w8, w8, #0xffff
	ccmp	w8, #0, #4, ne
	mov	w8, #3
	cinc	w8, w8, eq
LBB0_9:
	mov	w9, #1
	lsl	w8, w9, w8
	ldr	w10, [x0, #24]
	sdiv	w9, w10, w8
	stp	w8, w9, [x0, #16]
	msub	w10, w9, w8, w10
	str	w10, [x0, #28]
	cbz	w10, LBB0_11
; %bb.10:
	add	w8, w9, #1
	str	w8, [x0, #20]
	ret
LBB0_11:
	str	w8, [x0, #28]
	ret
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh15, Lloh16, Lloh17
	.loh AdrpLdrGotLdr	Lloh18, Lloh19, Lloh20
	.cfi_endproc
                                        ; -- End function
	.comm	_MTK_JPEG_COLOR_444,4,2         ; @MTK_JPEG_COLOR_444
	.comm	_V4L2_PIX_FMT_YUV422M,8,3       ; @V4L2_PIX_FMT_YUV422M
	.comm	_MTK_JPEG_COLOR_422V,4,2        ; @MTK_JPEG_COLOR_422V
	.comm	_V4L2_PIX_FMT_YUV420M,8,3       ; @V4L2_PIX_FMT_YUV420M
	.comm	_MTK_JPEG_COLOR_422X2,4,2       ; @MTK_JPEG_COLOR_422X2
	.comm	_MTK_JPEG_COLOR_400,4,2         ; @MTK_JPEG_COLOR_400
	.no_dead_strip	_mtk_jpeg_calc_dma_group
.subsections_via_symbols
