	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function mtk_jpeg_qbuf
_mtk_jpeg_qbuf:                         ## @mtk_jpeg_qbuf
	.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	%r12
	pushq	%rbx
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdx, %rbx
	movq	%rdi, %r14
	movq	(%rdi), %r12
	movq	%rsi, %rdi
	callq	_mtk_jpeg_fh_to_ctx
	movq	%rax, %r15
	movl	16(%rbx), %esi
	movq	_V4L2_BUF_TYPE_VIDEO_OUTPUT_MPLANE@GOTPCREL(%rip), %rax
	cmpl	(%rax), %esi
	jne	LBB0_6
## %bb.1:
	movl	(%r12), %edi
	callq	_v4l2_m2m_get_vq
	movq	(%rbx), %rsi
	cmpq	(%rax), %rsi
	jge	LBB0_7
## %bb.2:
	movq	%rax, %rdi
	callq	_vb2_get_buffer
	movq	%rax, %rdi
	callq	_mtk_jpeg_vb2_to_srcbuf
	movq	8(%rbx), %rcx
	cmpq	$0, (%rcx)
	jne	LBB0_3
## %bb.4:
	movq	_MTK_JPEG_BUF_FLAGS_LAST_FRAME@GOTPCREL(%rip), %rcx
	jmp	LBB0_5
LBB0_7:
	movq	(%r15), %rax
	movl	(%rax), %edi
	leaq	L_.str(%rip), %rsi
	callq	_dev_err
	movq	_EINVAL@GOTPCREL(%rip), %rcx
	xorl	%eax, %eax
	subl	(%rcx), %eax
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_3:
	movq	_MTK_JPEG_BUF_FLAGS_INIT@GOTPCREL(%rip), %rcx
LBB0_5:
	movl	(%rcx), %ecx
	movl	%ecx, (%rax)
LBB0_6:
	movl	(%r12), %esi
	movq	%r14, %rdi
	movq	%rbx, %rdx
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_v4l2_m2m_qbuf                  ## TAILCALL
	.cfi_endproc
                                        ## -- End function
	.comm	_V4L2_BUF_TYPE_VIDEO_OUTPUT_MPLANE,4,2 ## @V4L2_BUF_TYPE_VIDEO_OUTPUT_MPLANE
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"buffer index out of range\n"

	.comm	_EINVAL,4,2                     ## @EINVAL
	.comm	_MTK_JPEG_BUF_FLAGS_LAST_FRAME,4,2 ## @MTK_JPEG_BUF_FLAGS_LAST_FRAME
	.comm	_MTK_JPEG_BUF_FLAGS_INIT,4,2    ## @MTK_JPEG_BUF_FLAGS_INIT
	.no_dead_strip	_mtk_jpeg_qbuf
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function mtk_jpeg_qbuf
_mtk_jpeg_qbuf:                         ; @mtk_jpeg_qbuf
	.cfi_startproc
; %bb.0:
	stp	x22, x21, [sp, #-48]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 48
	stp	x20, x19, [sp, #16]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #32]             ; 16-byte Folded Spill
	add	x29, sp, #32
	.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
	mov	x19, x2
	mov	x20, x0
	ldr	x22, [x0]
	mov	x0, x1
	bl	_mtk_jpeg_fh_to_ctx
	ldr	w1, [x19, #16]
Lloh0:
	adrp	x8, _V4L2_BUF_TYPE_VIDEO_OUTPUT_MPLANE@GOTPAGE
Lloh1:
	ldr	x8, [x8, _V4L2_BUF_TYPE_VIDEO_OUTPUT_MPLANE@GOTPAGEOFF]
Lloh2:
	ldr	w8, [x8]
	cmp	w1, w8
	b.ne	LBB0_3
; %bb.1:
	mov	x21, x0
	ldr	w0, [x22]
	bl	_v4l2_m2m_get_vq
	ldr	x1, [x19]
	ldr	x8, [x0]
	cmp	x1, x8
	b.ge	LBB0_4
; %bb.2:
	bl	_vb2_get_buffer
	bl	_mtk_jpeg_vb2_to_srcbuf
	ldr	x8, [x19, #8]
	ldr	x8, [x8]
Lloh3:
	adrp	x9, _MTK_JPEG_BUF_FLAGS_LAST_FRAME@GOTPAGE
Lloh4:
	ldr	x9, [x9, _MTK_JPEG_BUF_FLAGS_LAST_FRAME@GOTPAGEOFF]
Lloh5:
	adrp	x10, _MTK_JPEG_BUF_FLAGS_INIT@GOTPAGE
Lloh6:
	ldr	x10, [x10, _MTK_JPEG_BUF_FLAGS_INIT@GOTPAGEOFF]
	cmp	x8, #0
	csel	x8, x9, x10, eq
	ldr	w8, [x8]
	str	w8, [x0]
LBB0_3:
	ldr	w1, [x22]
	mov	x0, x20
	mov	x2, x19
	ldp	x29, x30, [sp, #32]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #16]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp], #48             ; 16-byte Folded Reload
	b	_v4l2_m2m_qbuf
LBB0_4:
	ldr	x8, [x21]
	ldr	w0, [x8]
Lloh7:
	adrp	x1, l_.str@PAGE
Lloh8:
	add	x1, x1, l_.str@PAGEOFF
	bl	_dev_err
Lloh9:
	adrp	x8, _EINVAL@GOTPAGE
Lloh10:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
Lloh11:
	ldr	w8, [x8]
	neg	w0, w8
	ldp	x29, x30, [sp, #32]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #16]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp], #48             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGot	Lloh5, Lloh6
	.loh AdrpLdrGot	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpAdd	Lloh7, Lloh8
	.cfi_endproc
                                        ; -- End function
	.comm	_V4L2_BUF_TYPE_VIDEO_OUTPUT_MPLANE,4,2 ; @V4L2_BUF_TYPE_VIDEO_OUTPUT_MPLANE
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"buffer index out of range\n"

	.comm	_EINVAL,4,2                     ; @EINVAL
	.comm	_MTK_JPEG_BUF_FLAGS_LAST_FRAME,4,2 ; @MTK_JPEG_BUF_FLAGS_LAST_FRAME
	.comm	_MTK_JPEG_BUF_FLAGS_INIT,4,2    ; @MTK_JPEG_BUF_FLAGS_INIT
	.no_dead_strip	_mtk_jpeg_qbuf
.subsections_via_symbols
