	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function vdec_decoder_cmd
_vdec_decoder_cmd:                      ## @vdec_decoder_cmd
	.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
	subq	$16, %rsp
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdx, %r12
	movq	%rsi, %r14
	movq	%rdi, %rbx
	callq	_to_inst
	movq	%rax, %r15
	xorps	%xmm0, %xmm0
	movaps	%xmm0, -48(%rbp)
	movq	%rbx, %rdi
	movq	%r14, %rsi
	movq	%r12, %rdx
	callq	_v4l2_m2m_ioctl_try_decoder_cmd
	movl	%eax, %ebx
	testl	%eax, %eax
	jne	LBB0_9
## %bb.1:
	leaq	8(%r15), %r14
	movq	%r14, %rdi
	callq	_mutex_lock
	movq	(%r12), %rax
	movq	_V4L2_DEC_CMD_STOP@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jne	LBB0_7
## %bb.2:
	cmpq	$0, 24(%r15)
	je	LBB0_7
## %bb.3:
	cmpq	$0, 16(%r15)
	je	LBB0_7
## %bb.4:
	movq	_HFI_BUFFER_INPUT@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, -40(%rbp)
	movq	_HFI_BUFFERFLAG_EOS@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, -44(%rbp)
	movl	$-559042560, -48(%rbp)          ## imm = 0xDEADB000
	leaq	-48(%rbp), %rsi
	movq	%r15, %rdi
	callq	_hfi_session_process_buf
	movl	%eax, %ebx
	testl	%eax, %eax
	jne	LBB0_8
## %bb.5:
	movq	(%r15), %rax
	movq	_VENUS_DEC_STATE_DECODING@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jne	LBB0_7
## %bb.6:
	movq	_VENUS_DEC_STATE_DRAIN@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	%rax, (%r15)
LBB0_7:
	xorl	%ebx, %ebx
LBB0_8:
	movq	%r14, %rdi
	callq	_mutex_unlock
LBB0_9:
	movl	%ebx, %eax
	addq	$16, %rsp
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_V4L2_DEC_CMD_STOP,8,3          ## @V4L2_DEC_CMD_STOP
	.comm	_HFI_BUFFER_INPUT,4,2           ## @HFI_BUFFER_INPUT
	.comm	_HFI_BUFFERFLAG_EOS,4,2         ## @HFI_BUFFERFLAG_EOS
	.comm	_VENUS_DEC_STATE_DECODING,8,3   ## @VENUS_DEC_STATE_DECODING
	.comm	_VENUS_DEC_STATE_DRAIN,8,3      ## @VENUS_DEC_STATE_DRAIN
	.no_dead_strip	_vdec_decoder_cmd
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function vdec_decoder_cmd
_vdec_decoder_cmd:                      ; @vdec_decoder_cmd
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #64
	.cfi_def_cfa_offset 64
	stp	x22, x21, [sp, #16]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #32]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #48]             ; 16-byte Folded Spill
	add	x29, sp, #48
	.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	x22, x2
	mov	x19, x1
	mov	x21, x0
	bl	_to_inst
	mov	x20, x0
	stp	xzr, xzr, [sp]
	mov	x0, x21
	mov	x1, x19
	mov	x2, x22
	bl	_v4l2_m2m_ioctl_try_decoder_cmd
	mov	x21, x0
	cbnz	w0, LBB0_9
; %bb.1:
	add	x19, x20, #8
	mov	x0, x19
	bl	_mutex_lock
	ldr	x8, [x22]
Lloh0:
	adrp	x9, _V4L2_DEC_CMD_STOP@GOTPAGE
Lloh1:
	ldr	x9, [x9, _V4L2_DEC_CMD_STOP@GOTPAGEOFF]
Lloh2:
	ldr	x9, [x9]
	cmp	x8, x9
	b.ne	LBB0_7
; %bb.2:
	ldr	x8, [x20, #24]
	cbz	x8, LBB0_7
; %bb.3:
	ldr	x8, [x20, #16]
	cbz	x8, LBB0_7
; %bb.4:
Lloh3:
	adrp	x8, _HFI_BUFFER_INPUT@GOTPAGE
Lloh4:
	ldr	x8, [x8, _HFI_BUFFER_INPUT@GOTPAGEOFF]
Lloh5:
	ldr	w8, [x8]
	str	w8, [sp, #8]
Lloh6:
	adrp	x8, _HFI_BUFFERFLAG_EOS@GOTPAGE
Lloh7:
	ldr	x8, [x8, _HFI_BUFFERFLAG_EOS@GOTPAGEOFF]
Lloh8:
	ldr	w8, [x8]
	mov	w9, #45056
	movk	w9, #57005, lsl #16
	stp	w9, w8, [sp]
	mov	x1, sp
	mov	x0, x20
	bl	_hfi_session_process_buf
	mov	x21, x0
	cbnz	w0, LBB0_8
; %bb.5:
	ldr	x8, [x20]
Lloh9:
	adrp	x9, _VENUS_DEC_STATE_DECODING@GOTPAGE
Lloh10:
	ldr	x9, [x9, _VENUS_DEC_STATE_DECODING@GOTPAGEOFF]
Lloh11:
	ldr	x9, [x9]
	cmp	x8, x9
	b.ne	LBB0_7
; %bb.6:
	mov	w21, #0
Lloh12:
	adrp	x8, _VENUS_DEC_STATE_DRAIN@GOTPAGE
Lloh13:
	ldr	x8, [x8, _VENUS_DEC_STATE_DRAIN@GOTPAGEOFF]
Lloh14:
	ldr	x8, [x8]
	str	x8, [x20]
	b	LBB0_8
LBB0_7:
	mov	w21, #0
LBB0_8:
	mov	x0, x19
	bl	_mutex_unlock
LBB0_9:
	mov	x0, x21
	ldp	x29, x30, [sp, #48]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #32]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #64
	ret
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.cfi_endproc
                                        ; -- End function
	.comm	_V4L2_DEC_CMD_STOP,8,3          ; @V4L2_DEC_CMD_STOP
	.comm	_HFI_BUFFER_INPUT,4,2           ; @HFI_BUFFER_INPUT
	.comm	_HFI_BUFFERFLAG_EOS,4,2         ; @HFI_BUFFERFLAG_EOS
	.comm	_VENUS_DEC_STATE_DECODING,8,3   ; @VENUS_DEC_STATE_DECODING
	.comm	_VENUS_DEC_STATE_DRAIN,8,3      ; @VENUS_DEC_STATE_DRAIN
	.no_dead_strip	_vdec_decoder_cmd
.subsections_via_symbols
