	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function mtk_jpeg_device_run
_mtk_jpeg_device_run:                   ## @mtk_jpeg_device_run
	.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	%r13
	pushq	%r12
	pushq	%rbx
	subq	$40, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdi, %r15
	movq	8(%rdi), %r12
	movq	_VB2_BUF_STATE_ERROR@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, -60(%rbp)                 ## 4-byte Spill
	movl	(%rdi), %edi
	callq	_v4l2_m2m_next_src_buf
	movq	%rax, %rbx
	movl	(%r15), %edi
	callq	_v4l2_m2m_next_dst_buf
	movq	%rax, %r14
	movq	%rbx, -72(%rbp)                 ## 8-byte Spill
	movq	%rbx, %rdi
	callq	_mtk_jpeg_vb2_to_srcbuf
	movq	%rax, %r13
	movq	_MTK_JPEG_BUF_FLAGS_LAST_FRAME@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	testl	%eax, (%r13)
	je	LBB0_6
## %bb.1:
	cmpl	$0, (%r14)
	jle	LBB0_4
## %bb.2:
	xorl	%ebx, %ebx
	.p2align	4, 0x90
LBB0_3:                                 ## =>This Inner Loop Header: Depth=1
	movq	%r14, %rdi
	movl	%ebx, %esi
	xorl	%edx, %edx
	callq	_vb2_set_plane_payload
	incl	%ebx
	cmpl	(%r14), %ebx
	jl	LBB0_3
LBB0_4:
	movq	_VB2_BUF_STATE_DONE@GOTPCREL(%rip), %rax
	movl	(%rax), %ebx
LBB0_5:
	movl	(%r15), %edi
	callq	_v4l2_m2m_src_buf_remove
	movl	(%r15), %edi
	callq	_v4l2_m2m_dst_buf_remove
	movq	-72(%rbp), %rdi                 ## 8-byte Reload
	movl	%ebx, %esi
	callq	_v4l2_m2m_buf_done
	movq	%r14, %rdi
	movl	%ebx, %esi
	callq	_v4l2_m2m_buf_done
	movl	(%r12), %edi
	movl	(%r15), %esi
	callq	_v4l2_m2m_job_finish
LBB0_9:
	addq	$40, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_6:
	movl	-60(%rbp), %ebx                 ## 4-byte Reload
	addq	$4, %r13
	movq	%r15, %rdi
	movq	%r13, %rsi
	callq	_mtk_jpeg_check_resolution_change
	testq	%rax, %rax
	je	LBB0_7
## %bb.10:
	movq	%r15, %rdi
	callq	_mtk_jpeg_queue_src_chg_event
	movq	_MTK_JPEG_SOURCE_CHANGE@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, 4(%r15)
	movl	(%r12), %edi
	movl	(%r15), %esi
	addq	$40, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_v4l2_m2m_job_finish            ## TAILCALL
LBB0_7:
	leaq	-56(%rbp), %rdx
	movq	%r15, %rdi
	movq	-72(%rbp), %rsi                 ## 8-byte Reload
	callq	_mtk_jpeg_set_dec_src
	leaq	-48(%rbp), %rcx
	movq	%r15, %rdi
	movq	%r13, %rsi
	movq	%r14, %rdx
	callq	_mtk_jpeg_set_dec_dst
	testq	%rax, %rax
	jne	LBB0_5
## %bb.8:
	leaq	4(%r12), %r14
	movq	%r14, %rdi
	callq	_spin_lock_irqsave
	movl	8(%r12), %edi
	callq	_mtk_jpeg_dec_reset
	movl	8(%r12), %edi
	leaq	-56(%rbp), %rdx
	leaq	-48(%rbp), %rcx
	movq	%r13, %rsi
	callq	_mtk_jpeg_dec_set_config
	movl	8(%r12), %edi
	callq	_mtk_jpeg_dec_start
	movq	%r14, %rdi
	callq	_spin_unlock_irqrestore
	jmp	LBB0_9
	.cfi_endproc
                                        ## -- End function
	.comm	_VB2_BUF_STATE_ERROR,4,2        ## @VB2_BUF_STATE_ERROR
	.comm	_MTK_JPEG_BUF_FLAGS_LAST_FRAME,4,2 ## @MTK_JPEG_BUF_FLAGS_LAST_FRAME
	.comm	_VB2_BUF_STATE_DONE,4,2         ## @VB2_BUF_STATE_DONE
	.comm	_MTK_JPEG_SOURCE_CHANGE,4,2     ## @MTK_JPEG_SOURCE_CHANGE
	.no_dead_strip	_mtk_jpeg_device_run
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function mtk_jpeg_device_run
_mtk_jpeg_device_run:                   ; @mtk_jpeg_device_run
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #80
	.cfi_def_cfa_offset 80
	stp	x24, x23, [sp, #16]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #32]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #48]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #64]             ; 16-byte Folded Spill
	add	x29, sp, #64
	.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
	ldr	x24, [x0, #8]
Lloh0:
	adrp	x8, _VB2_BUF_STATE_ERROR@GOTPAGE
Lloh1:
	ldr	x8, [x8, _VB2_BUF_STATE_ERROR@GOTPAGEOFF]
Lloh2:
	ldr	w22, [x8]
	ldr	w0, [x0]
	bl	_v4l2_m2m_next_src_buf
	mov	x20, x0
	ldr	w0, [x19]
	bl	_v4l2_m2m_next_dst_buf
	mov	x21, x0
	mov	x0, x20
	bl	_mtk_jpeg_vb2_to_srcbuf
	ldr	w8, [x0]
Lloh3:
	adrp	x9, _MTK_JPEG_BUF_FLAGS_LAST_FRAME@GOTPAGE
Lloh4:
	ldr	x9, [x9, _MTK_JPEG_BUF_FLAGS_LAST_FRAME@GOTPAGEOFF]
Lloh5:
	ldr	w9, [x9]
	tst	w9, w8
	b.eq	LBB0_7
; %bb.1:
	ldr	w8, [x21]
	cmp	w8, #1
	b.lt	LBB0_4
; %bb.2:
	mov	w22, #0
LBB0_3:                                 ; =>This Inner Loop Header: Depth=1
	mov	x0, x21
	mov	x1, x22
	mov	w2, #0
	bl	_vb2_set_plane_payload
	add	w22, w22, #1
	ldr	w8, [x21]
	cmp	w22, w8
	b.lt	LBB0_3
LBB0_4:
Lloh6:
	adrp	x8, _VB2_BUF_STATE_DONE@GOTPAGE
Lloh7:
	ldr	x8, [x8, _VB2_BUF_STATE_DONE@GOTPAGEOFF]
Lloh8:
	ldr	w22, [x8]
LBB0_5:
	ldr	w0, [x19]
	bl	_v4l2_m2m_src_buf_remove
	ldr	w0, [x19]
	bl	_v4l2_m2m_dst_buf_remove
	mov	x0, x20
	mov	x1, x22
	bl	_v4l2_m2m_buf_done
	mov	x0, x21
	mov	x1, x22
	bl	_v4l2_m2m_buf_done
	ldr	w0, [x24]
	ldr	w1, [x19]
	bl	_v4l2_m2m_job_finish
LBB0_6:
	ldp	x29, x30, [sp, #64]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #48]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #32]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #80
	ret
LBB0_7:
	add	x23, x0, #4
	mov	x0, x19
	mov	x1, x23
	bl	_mtk_jpeg_check_resolution_change
	cbz	x0, LBB0_9
; %bb.8:
	mov	x0, x19
	bl	_mtk_jpeg_queue_src_chg_event
Lloh9:
	adrp	x8, _MTK_JPEG_SOURCE_CHANGE@GOTPAGE
Lloh10:
	ldr	x8, [x8, _MTK_JPEG_SOURCE_CHANGE@GOTPAGEOFF]
Lloh11:
	ldr	w8, [x8]
	str	w8, [x19, #4]
	ldr	w0, [x24]
	ldr	w1, [x19]
	ldp	x29, x30, [sp, #64]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #48]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #32]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #80
	b	_v4l2_m2m_job_finish
LBB0_9:
	add	x2, sp, #8
	mov	x0, x19
	mov	x1, x20
	bl	_mtk_jpeg_set_dec_src
	mov	x3, sp
	mov	x0, x19
	mov	x1, x23
	mov	x2, x21
	bl	_mtk_jpeg_set_dec_dst
	cbnz	x0, LBB0_5
; %bb.10:
	add	x19, x24, #4
	mov	x0, x19
	bl	_spin_lock_irqsave
	ldr	w0, [x24, #8]
	bl	_mtk_jpeg_dec_reset
	ldr	w0, [x24, #8]
	add	x2, sp, #8
	mov	x3, sp
	mov	x1, x23
	bl	_mtk_jpeg_dec_set_config
	ldr	w0, [x24, #8]
	bl	_mtk_jpeg_dec_start
	mov	x0, x19
	bl	_spin_unlock_irqrestore
	b	LBB0_6
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.cfi_endproc
                                        ; -- End function
	.comm	_VB2_BUF_STATE_ERROR,4,2        ; @VB2_BUF_STATE_ERROR
	.comm	_MTK_JPEG_BUF_FLAGS_LAST_FRAME,4,2 ; @MTK_JPEG_BUF_FLAGS_LAST_FRAME
	.comm	_VB2_BUF_STATE_DONE,4,2         ; @VB2_BUF_STATE_DONE
	.comm	_MTK_JPEG_SOURCE_CHANGE,4,2     ; @MTK_JPEG_SOURCE_CHANGE
	.no_dead_strip	_mtk_jpeg_device_run
.subsections_via_symbols
