	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_vdec_if_decode                 ## -- Begin function vdec_if_decode
	.p2align	4, 0x90
_vdec_if_decode:                        ## @vdec_if_decode
	.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	%rcx, %r14
	movq	%rdx, %r15
	movq	%rsi, %rbx
	movq	%rdi, %r12
	testq	%rsi, %rsi
	je	LBB0_4
## %bb.1:
	testb	$63, (%rbx)
	je	LBB0_4
## %bb.2:
	leaq	L_.str(%rip), %rdi
	jmp	LBB0_3
LBB0_4:
	testq	%r15, %r15
	je	LBB0_8
## %bb.5:
	movzwl	4(%r15), %eax
	testl	$511, %eax                      ## imm = 0x1FF
	jne	LBB0_7
## %bb.6:
	movzwl	(%r15), %eax
	testl	$511, %eax                      ## imm = 0x1FF
	je	LBB0_8
LBB0_7:
	leaq	L_.str.1(%rip), %rdi
LBB0_3:
	callq	_mtk_v4l2_err
	movq	_EINVAL@GOTPCREL(%rip), %rcx
LBB0_10:
	xorl	%eax, %eax
	subl	(%rcx), %eax
LBB0_12:
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_8:
	cmpl	$0, 8(%r12)
	je	LBB0_9
## %bb.11:
	movq	%r12, %rdi
	callq	_mtk_vdec_lock
	movq	(%r12), %rdi
	movq	%r12, %rsi
	callq	_mtk_vcodec_set_curr_ctx
	movq	(%r12), %rdi
	callq	_mtk_vcodec_dec_clock_on
	movq	(%r12), %rax
	movl	4(%rax), %edi
	callq	_enable_irq
	movq	16(%r12), %rax
	movl	8(%r12), %edi
	movq	%rbx, %rsi
	movq	%r15, %rdx
	movq	%r14, %rcx
	callq	*(%rax)
	movl	%eax, %ebx
	movq	(%r12), %rax
	movl	4(%rax), %edi
	callq	_disable_irq
	movq	(%r12), %rdi
	callq	_mtk_vcodec_dec_clock_off
	movq	(%r12), %rdi
	xorl	%esi, %esi
	callq	_mtk_vcodec_set_curr_ctx
	movq	%r12, %rdi
	callq	_mtk_vdec_unlock
	movl	%ebx, %eax
	jmp	LBB0_12
LBB0_9:
	movq	_EIO@GOTPCREL(%rip), %rcx
	jmp	LBB0_10
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"bs dma_addr should 64 byte align"

	.comm	_EINVAL,4,2                     ## @EINVAL
L_.str.1:                               ## @.str.1
	.asciz	"frame buffer dma_addr should 512 byte align"

	.comm	_EIO,4,2                        ## @EIO
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_vdec_if_decode                 ; -- Begin function vdec_if_decode
	.p2align	2
_vdec_if_decode:                        ; @vdec_if_decode
	.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	x20, x3
	mov	x21, x2
	mov	x22, x1
	mov	x19, x0
	cbz	x1, LBB0_3
; %bb.1:
	ldrb	w8, [x22]
	tst	w8, #0x3f
	b.eq	LBB0_3
; %bb.2:
Lloh0:
	adrp	x0, l_.str@PAGE
Lloh1:
	add	x0, x0, l_.str@PAGEOFF
	b	LBB0_7
LBB0_3:
	cbz	x21, LBB0_10
; %bb.4:
	ldrh	w8, [x21, #4]
	tst	w8, #0x1ff
	b.ne	LBB0_6
; %bb.5:
	ldrh	w8, [x21]
	tst	w8, #0x1ff
	b.eq	LBB0_10
LBB0_6:
Lloh2:
	adrp	x0, l_.str.1@PAGE
Lloh3:
	add	x0, x0, l_.str.1@PAGEOFF
LBB0_7:
	bl	_mtk_v4l2_err
Lloh4:
	adrp	x8, _EINVAL@GOTPAGE
Lloh5:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
LBB0_8:
	ldr	w8, [x8]
	neg	w0, w8
LBB0_9:
	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
LBB0_10:
	ldr	w8, [x19, #8]
	cbz	w8, LBB0_12
; %bb.11:
	mov	x0, x19
	bl	_mtk_vdec_lock
	ldr	x0, [x19]
	mov	x1, x19
	bl	_mtk_vcodec_set_curr_ctx
	ldr	x0, [x19]
	bl	_mtk_vcodec_dec_clock_on
	ldr	x8, [x19]
	ldr	w0, [x8, #4]
	bl	_enable_irq
	ldr	x8, [x19, #16]
	ldr	x8, [x8]
	ldr	w0, [x19, #8]
	mov	x1, x22
	mov	x2, x21
	mov	x3, x20
	blr	x8
	mov	x20, x0
	ldr	x8, [x19]
	ldr	w0, [x8, #4]
	bl	_disable_irq
	ldr	x0, [x19]
	bl	_mtk_vcodec_dec_clock_off
	ldr	x0, [x19]
	mov	x1, #0
	bl	_mtk_vcodec_set_curr_ctx
	mov	x0, x19
	bl	_mtk_vdec_unlock
	mov	x0, x20
	b	LBB0_9
LBB0_12:
Lloh6:
	adrp	x8, _EIO@GOTPAGE
Lloh7:
	ldr	x8, [x8, _EIO@GOTPAGEOFF]
	b	LBB0_8
	.loh AdrpAdd	Lloh0, Lloh1
	.loh AdrpAdd	Lloh2, Lloh3
	.loh AdrpLdrGot	Lloh4, Lloh5
	.loh AdrpLdrGot	Lloh6, Lloh7
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"bs dma_addr should 64 byte align"

	.comm	_EINVAL,4,2                     ; @EINVAL
l_.str.1:                               ; @.str.1
	.asciz	"frame buffer dma_addr should 512 byte align"

	.comm	_EIO,4,2                        ; @EIO
.subsections_via_symbols
