	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function vdec_buf_done
_vdec_buf_done:                         ## @vdec_buf_done
	.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	$24, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movl	%r9d, %r15d
	movq	%rdi, %r12
	movq	_VB2_BUF_STATE_DONE@GOTPCREL(%rip), %rax
	movq	_HFI_BUFFER_INPUT@GOTPCREL(%rip), %rdi
	cmpl	%esi, (%rdi)
	movl	%r8d, -56(%rbp)                 ## 4-byte Spill
	movl	%ecx, -52(%rbp)                 ## 4-byte Spill
	jne	LBB0_1
## %bb.2:
	movq	_V4L2_BUF_TYPE_VIDEO_OUTPUT_MPLANE@GOTPCREL(%rip), %rcx
	jmp	LBB0_3
LBB0_1:
	movq	_V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE@GOTPCREL(%rip), %rcx
LBB0_3:
	movl	(%rax), %r14d
	movl	(%rcx), %r13d
	movq	%r12, %rdi
	movl	%r13d, %esi
	callq	_venus_helper_find_buf
	testq	%rax, %rax
	je	LBB0_15
## %bb.4:
	movq	%rax, %rbx
	movl	24(%rbp), %esi
	movl	%r15d, (%rax)
	movq	_V4L2_FIELD_NONE@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, 32(%rbx)
	movq	%rbx, %r15
	addq	$16, %r15
	movq	_V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE@GOTPCREL(%rip), %rax
	cmpl	(%rax), %r13d
	jne	LBB0_9
## %bb.5:
	movq	%r15, %rdi
	xorl	%esi, %esi
	movl	-52(%rbp), %edx                 ## 4-byte Reload
	callq	_vb2_set_plane_payload
	movl	24(%rbp), %esi
	movq	24(%rbx), %rax
	movl	-56(%rbp), %ecx                 ## 4-byte Reload
	movl	%ecx, (%rax)
	movq	_NSEC_PER_USEC@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	imull	%esi, %eax
	movl	%eax, 16(%rbx)
	movslq	16(%r12), %rax
	leal	1(%rax), %ecx
	movl	%ecx, 16(%r12)
	movq	%rax, 8(%rbx)
	movq	_V4L2_BUF_FLAG_LAST@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	testl	%eax, (%rbx)
	movl	16(%rbp), %r13d
	je	LBB0_10
## %bb.6:
	movq	_V4L2_EVENT_EOS@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, -48(%rbp)
	leaq	12(%r12), %rdi
	leaq	-48(%rbp), %rsi
	callq	_v4l2_event_queue_fh
	movq	(%r12), %rax
	movq	_VENUS_DEC_STATE_DRAIN@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jne	LBB0_8
## %bb.7:
	movq	_VENUS_DEC_STATE_STOPPED@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	%rax, (%r12)
LBB0_8:
	movl	24(%rbp), %esi
	jmp	LBB0_10
LBB0_9:
	movslq	8(%r12), %rax
	leal	1(%rax), %ecx
	movl	%ecx, 8(%r12)
	movq	%rax, 8(%rbx)
	movl	16(%rbp), %r13d
LBB0_10:
	movq	%r12, %rdi
	movq	%rbx, %rdx
	callq	_venus_helper_get_ts_metadata
	movq	_HFI_BUFFERFLAG_READONLY@GOTPCREL(%rip), %rax
	testl	%r13d, (%rax)
	je	LBB0_12
## %bb.11:
	movq	%rbx, %rdi
	callq	_venus_helper_acquire_buf_ref
LBB0_12:
	movq	_HFI_BUFFERFLAG_DATACORRUPT@GOTPCREL(%rip), %rax
	testl	%r13d, (%rax)
	movq	_VB2_BUF_STATE_ERROR@GOTPCREL(%rip), %rax
	movl	(%rax), %r12d
	cmovnel	%r12d, %r14d
	movq	_HFI_BUFFERFLAG_DROP_FRAME@GOTPCREL(%rip), %rax
	testl	%r13d, (%rax)
	je	LBB0_14
## %bb.13:
	movq	%r15, %rdi
	xorl	%esi, %esi
	xorl	%edx, %edx
	callq	_vb2_set_plane_payload
	movl	$0, (%r15)
	movl	%r12d, %r14d
LBB0_14:
	movq	%rbx, %rdi
	movl	%r14d, %esi
	callq	_v4l2_m2m_buf_done
LBB0_15:
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_VB2_BUF_STATE_DONE,4,2         ## @VB2_BUF_STATE_DONE
	.comm	_HFI_BUFFER_INPUT,4,2           ## @HFI_BUFFER_INPUT
	.comm	_V4L2_BUF_TYPE_VIDEO_OUTPUT_MPLANE,4,2 ## @V4L2_BUF_TYPE_VIDEO_OUTPUT_MPLANE
	.comm	_V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE,4,2 ## @V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE
	.comm	_V4L2_FIELD_NONE,4,2            ## @V4L2_FIELD_NONE
	.comm	_NSEC_PER_USEC,4,2              ## @NSEC_PER_USEC
	.comm	_V4L2_BUF_FLAG_LAST,4,2         ## @V4L2_BUF_FLAG_LAST
	.comm	_V4L2_EVENT_EOS,4,2             ## @V4L2_EVENT_EOS
	.comm	_VENUS_DEC_STATE_DRAIN,8,3      ## @VENUS_DEC_STATE_DRAIN
	.comm	_VENUS_DEC_STATE_STOPPED,8,3    ## @VENUS_DEC_STATE_STOPPED
	.comm	_HFI_BUFFERFLAG_READONLY,4,2    ## @HFI_BUFFERFLAG_READONLY
	.comm	_HFI_BUFFERFLAG_DATACORRUPT,4,2 ## @HFI_BUFFERFLAG_DATACORRUPT
	.comm	_VB2_BUF_STATE_ERROR,4,2        ## @VB2_BUF_STATE_ERROR
	.comm	_HFI_BUFFERFLAG_DROP_FRAME,4,2  ## @HFI_BUFFERFLAG_DROP_FRAME
	.no_dead_strip	_vdec_buf_done
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function vdec_buf_done
_vdec_buf_done:                         ; @vdec_buf_done
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #112
	.cfi_def_cfa_offset 112
	stp	x28, x27, [sp, #16]             ; 16-byte Folded Spill
	stp	x26, x25, [sp, #32]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #48]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #64]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #80]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #96]             ; 16-byte Folded Spill
	add	x29, sp, #96
	.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
	.cfi_offset w25, -72
	.cfi_offset w26, -80
	.cfi_offset w27, -88
	.cfi_offset w28, -96
	mov	x22, x7
	mov	x19, x6
	mov	x21, x5
	mov	x24, x4
	mov	x25, x3
	mov	x23, x0
Lloh0:
	adrp	x8, _VB2_BUF_STATE_DONE@GOTPAGE
Lloh1:
	ldr	x8, [x8, _VB2_BUF_STATE_DONE@GOTPAGEOFF]
Lloh2:
	ldr	w27, [x8]
Lloh3:
	adrp	x8, _HFI_BUFFER_INPUT@GOTPAGE
Lloh4:
	ldr	x8, [x8, _HFI_BUFFER_INPUT@GOTPAGEOFF]
Lloh5:
	adrp	x9, _V4L2_BUF_TYPE_VIDEO_OUTPUT_MPLANE@GOTPAGE
Lloh6:
	ldr	x9, [x9, _V4L2_BUF_TYPE_VIDEO_OUTPUT_MPLANE@GOTPAGEOFF]
Lloh7:
	ldr	w8, [x8]
Lloh8:
	adrp	x28, _V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE@GOTPAGE
Lloh9:
	ldr	x28, [x28, _V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE@GOTPAGEOFF]
	cmp	w8, w1
	csel	x8, x9, x28, eq
	ldr	w26, [x8]
	mov	x1, x26
	bl	_venus_helper_find_buf
	cbz	x0, LBB0_11
; %bb.1:
	mov	x20, x0
Lloh10:
	adrp	x8, _V4L2_FIELD_NONE@GOTPAGE
Lloh11:
	ldr	x8, [x8, _V4L2_FIELD_NONE@GOTPAGEOFF]
	str	w21, [x0]
Lloh12:
	ldr	w8, [x8]
	str	w8, [x0, #32]
	add	x21, x0, #16
	ldr	w8, [x28]
	cmp	w26, w8
	b.ne	LBB0_5
; %bb.2:
	mov	x0, x21
	mov	w1, #0
	mov	x2, x25
	bl	_vb2_set_plane_payload
	ldr	x8, [x20, #24]
	str	w24, [x8]
Lloh13:
	adrp	x8, _NSEC_PER_USEC@GOTPAGE
Lloh14:
	ldr	x8, [x8, _NSEC_PER_USEC@GOTPAGEOFF]
Lloh15:
	ldr	w8, [x8]
	mul	w8, w8, w22
	str	w8, [x20, #16]
	ldrsw	x8, [x23, #16]
	add	w9, w8, #1
	str	w9, [x23, #16]
	str	x8, [x20, #8]
	ldr	w8, [x20]
Lloh16:
	adrp	x9, _V4L2_BUF_FLAG_LAST@GOTPAGE
Lloh17:
	ldr	x9, [x9, _V4L2_BUF_FLAG_LAST@GOTPAGEOFF]
Lloh18:
	ldr	w9, [x9]
	tst	w9, w8
	b.eq	LBB0_6
; %bb.3:
Lloh19:
	adrp	x8, _V4L2_EVENT_EOS@GOTPAGE
Lloh20:
	ldr	x8, [x8, _V4L2_EVENT_EOS@GOTPAGEOFF]
Lloh21:
	ldr	w8, [x8]
	str	w8, [sp, #8]
	add	x0, x23, #12
	add	x1, sp, #8
	bl	_v4l2_event_queue_fh
	ldr	x8, [x23]
Lloh22:
	adrp	x9, _VENUS_DEC_STATE_DRAIN@GOTPAGE
Lloh23:
	ldr	x9, [x9, _VENUS_DEC_STATE_DRAIN@GOTPAGEOFF]
Lloh24:
	ldr	x9, [x9]
	cmp	x8, x9
	b.ne	LBB0_6
; %bb.4:
Lloh25:
	adrp	x8, _VENUS_DEC_STATE_STOPPED@GOTPAGE
Lloh26:
	ldr	x8, [x8, _VENUS_DEC_STATE_STOPPED@GOTPAGEOFF]
Lloh27:
	ldr	x8, [x8]
	str	x8, [x23]
	b	LBB0_6
LBB0_5:
	ldrsw	x8, [x23, #8]
	add	w9, w8, #1
	str	w9, [x23, #8]
	str	x8, [x20, #8]
LBB0_6:
	mov	x0, x23
	mov	x1, x22
	mov	x2, x20
	bl	_venus_helper_get_ts_metadata
Lloh28:
	adrp	x8, _HFI_BUFFERFLAG_READONLY@GOTPAGE
Lloh29:
	ldr	x8, [x8, _HFI_BUFFERFLAG_READONLY@GOTPAGEOFF]
Lloh30:
	ldr	w8, [x8]
	tst	w8, w19
	b.eq	LBB0_8
; %bb.7:
	mov	x0, x20
	bl	_venus_helper_acquire_buf_ref
LBB0_8:
Lloh31:
	adrp	x8, _HFI_BUFFERFLAG_DATACORRUPT@GOTPAGE
Lloh32:
	ldr	x8, [x8, _HFI_BUFFERFLAG_DATACORRUPT@GOTPAGEOFF]
Lloh33:
	ldr	w8, [x8]
Lloh34:
	adrp	x9, _VB2_BUF_STATE_ERROR@GOTPAGE
Lloh35:
	ldr	x9, [x9, _VB2_BUF_STATE_ERROR@GOTPAGEOFF]
Lloh36:
	ldr	w22, [x9]
	tst	w8, w19
	csel	w1, w27, w22, eq
Lloh37:
	adrp	x8, _HFI_BUFFERFLAG_DROP_FRAME@GOTPAGE
Lloh38:
	ldr	x8, [x8, _HFI_BUFFERFLAG_DROP_FRAME@GOTPAGEOFF]
Lloh39:
	ldr	w8, [x8]
	tst	w8, w19
	b.eq	LBB0_10
; %bb.9:
	mov	x0, x21
	mov	w1, #0
	mov	w2, #0
	bl	_vb2_set_plane_payload
	str	wzr, [x21]
	mov	x1, x22
LBB0_10:
	mov	x0, x20
	bl	_v4l2_m2m_buf_done
LBB0_11:
	ldp	x29, x30, [sp, #96]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #80]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #64]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #48]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #32]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #112
	ret
	.loh AdrpLdrGot	Lloh8, Lloh9
	.loh AdrpLdrGot	Lloh5, Lloh6
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh7
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh10, Lloh11, Lloh12
	.loh AdrpLdrGotLdr	Lloh16, Lloh17, Lloh18
	.loh AdrpLdrGotLdr	Lloh13, Lloh14, Lloh15
	.loh AdrpLdrGotLdr	Lloh22, Lloh23, Lloh24
	.loh AdrpLdrGotLdr	Lloh19, Lloh20, Lloh21
	.loh AdrpLdrGotLdr	Lloh25, Lloh26, Lloh27
	.loh AdrpLdrGotLdr	Lloh28, Lloh29, Lloh30
	.loh AdrpLdrGotLdr	Lloh37, Lloh38, Lloh39
	.loh AdrpLdrGotLdr	Lloh34, Lloh35, Lloh36
	.loh AdrpLdrGotLdr	Lloh31, Lloh32, Lloh33
	.cfi_endproc
                                        ; -- End function
	.comm	_VB2_BUF_STATE_DONE,4,2         ; @VB2_BUF_STATE_DONE
	.comm	_HFI_BUFFER_INPUT,4,2           ; @HFI_BUFFER_INPUT
	.comm	_V4L2_BUF_TYPE_VIDEO_OUTPUT_MPLANE,4,2 ; @V4L2_BUF_TYPE_VIDEO_OUTPUT_MPLANE
	.comm	_V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE,4,2 ; @V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE
	.comm	_V4L2_FIELD_NONE,4,2            ; @V4L2_FIELD_NONE
	.comm	_NSEC_PER_USEC,4,2              ; @NSEC_PER_USEC
	.comm	_V4L2_BUF_FLAG_LAST,4,2         ; @V4L2_BUF_FLAG_LAST
	.comm	_V4L2_EVENT_EOS,4,2             ; @V4L2_EVENT_EOS
	.comm	_VENUS_DEC_STATE_DRAIN,8,3      ; @VENUS_DEC_STATE_DRAIN
	.comm	_VENUS_DEC_STATE_STOPPED,8,3    ; @VENUS_DEC_STATE_STOPPED
	.comm	_HFI_BUFFERFLAG_READONLY,4,2    ; @HFI_BUFFERFLAG_READONLY
	.comm	_HFI_BUFFERFLAG_DATACORRUPT,4,2 ; @HFI_BUFFERFLAG_DATACORRUPT
	.comm	_VB2_BUF_STATE_ERROR,4,2        ; @VB2_BUF_STATE_ERROR
	.comm	_HFI_BUFFERFLAG_DROP_FRAME,4,2  ; @HFI_BUFFERFLAG_DROP_FRAME
	.no_dead_strip	_vdec_buf_done
.subsections_via_symbols
