	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function hva_start_streaming
_hva_start_streaming:                   ## @hva_start_streaming
	.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
	pushq	%rax
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdi, %r14
	callq	_vb2_get_drv_priv
	movq	%rax, %rbx
	movq	%rax, %rdi
	callq	_ctx_to_hdev
	movq	%rax, %r12
	movq	%rbx, %rdi
	callq	_ctx_to_dev
	movq	%rax, %r15
	movl	28(%rbx), %r13d
	movq	(%r14), %rdi
	callq	_to_type_str
	leaq	L_.str(%rip), %rsi
	movq	%r15, %rdi
	movl	%r13d, %edx
	movl	%eax, %ecx
	callq	_dev_dbg
	movq	(%r14), %rdi
	callq	_V4L2_TYPE_IS_OUTPUT
	movq	8(%rbx), %rdi
	testq	%rax, %rax
	je	LBB0_2
## %bb.1:
	addq	$4, %rdi
LBB0_2:
	callq	_vb2_start_streaming_called
	testl	%eax, %eax
	je	LBB0_3
## %bb.5:
	movq	_HVA_MAX_INSTANCES@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	testq	%rax, %rax
	je	LBB0_9
## %bb.6:
	movq	8(%r12), %rdx
	xorl	%ecx, %ecx
	.p2align	4, 0x90
LBB0_7:                                 ## =>This Inner Loop Header: Depth=1
	cmpq	$0, (%rdx,%rcx,8)
	je	LBB0_19
## %bb.8:                               ##   in Loop: Header=BB0_7 Depth=1
	incq	%rcx
	cmpq	%rcx, %rax
	jne	LBB0_7
LBB0_9:
	movl	28(%rbx), %edx
	leaq	L_.str.1(%rip), %rsi
	movq	%r15, %rdi
	callq	_dev_err
	movq	_ENOMEM@GOTPCREL(%rip), %rax
	xorl	%r15d, %r15d
	subl	(%rax), %r15d
LBB0_10:
	movq	(%r14), %rax
	movq	_V4L2_BUF_TYPE_VIDEO_OUTPUT@GOTPCREL(%rip), %rcx
	movq	8(%rbx), %rdi
	cmpq	(%rcx), %rax
	jne	LBB0_14
## %bb.11:
	callq	_v4l2_m2m_src_buf_remove
	testq	%rax, %rax
	je	LBB0_17
## %bb.12:
	movq	_VB2_BUF_STATE_QUEUED@GOTPCREL(%rip), %r14
	.p2align	4, 0x90
LBB0_13:                                ## =>This Inner Loop Header: Depth=1
	movl	(%r14), %esi
	movq	%rax, %rdi
	callq	_v4l2_m2m_buf_done
	movq	8(%rbx), %rdi
	callq	_v4l2_m2m_src_buf_remove
	testq	%rax, %rax
	jne	LBB0_13
	jmp	LBB0_17
LBB0_3:
	xorl	%r15d, %r15d
	jmp	LBB0_18
LBB0_14:
	callq	_v4l2_m2m_dst_buf_remove
	testq	%rax, %rax
	je	LBB0_17
## %bb.15:
	movq	_VB2_BUF_STATE_QUEUED@GOTPCREL(%rip), %r14
	.p2align	4, 0x90
LBB0_16:                                ## =>This Inner Loop Header: Depth=1
	movl	(%r14), %esi
	movq	%rax, %rdi
	callq	_v4l2_m2m_buf_done
	movq	8(%rbx), %rdi
	callq	_v4l2_m2m_dst_buf_remove
	testq	%rax, %rax
	jne	LBB0_16
LBB0_17:
	incl	4(%rbx)
	jmp	LBB0_18
LBB0_19:
	movq	%rbx, (%rdx,%rcx,8)
	movl	%ecx, (%rbx)
	incl	(%r12)
	xorl	%r15d, %r15d
	cmpl	$0, 16(%rbx)
	jne	LBB0_18
## %bb.20:
	movq	%rbx, %rcx
	addq	$16, %rcx
	movl	20(%rbx), %edx
	movl	24(%rbx), %esi
	movq	%rbx, %rdi
	callq	_hva_open_encoder
	testl	%eax, %eax
	js	LBB0_21
LBB0_18:
	movl	%r15d, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_21:
	movq	8(%r12), %rcx
	movl	(%rbx), %edx
	movq	$0, (%rcx,%rdx,8)
	decl	(%r12)
	movl	%eax, %r15d
	jmp	LBB0_10
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"%s %s start streaming\n"

	.comm	_HVA_MAX_INSTANCES,4,2          ## @HVA_MAX_INSTANCES
L_.str.1:                               ## @.str.1
	.asciz	"%s maximum instances reached\n"

	.comm	_ENOMEM,4,2                     ## @ENOMEM
	.comm	_V4L2_BUF_TYPE_VIDEO_OUTPUT,8,3 ## @V4L2_BUF_TYPE_VIDEO_OUTPUT
	.comm	_VB2_BUF_STATE_QUEUED,4,2       ## @VB2_BUF_STATE_QUEUED
	.no_dead_strip	_hva_start_streaming
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function hva_start_streaming
_hva_start_streaming:                   ; @hva_start_streaming
	.cfi_startproc
; %bb.0:
	stp	x24, x23, [sp, #-64]!           ; 16-byte Folded Spill
	.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
	.cfi_offset w23, -56
	.cfi_offset w24, -64
	mov	x20, x0
	bl	_vb2_get_drv_priv
	mov	x19, x0
	bl	_ctx_to_hdev
	mov	x21, x0
	mov	x0, x19
	bl	_ctx_to_dev
	mov	x22, x0
	ldr	w23, [x19, #28]
	ldr	x0, [x20]
	bl	_to_type_str
	mov	x3, x0
Lloh0:
	adrp	x1, l_.str@PAGE
Lloh1:
	add	x1, x1, l_.str@PAGEOFF
	mov	x0, x22
	mov	x2, x23
	bl	_dev_dbg
	ldr	x0, [x20]
	bl	_V4L2_TYPE_IS_OUTPUT
	mov	x8, x0
	ldr	x0, [x19, #8]
	cbz	x8, LBB0_2
; %bb.1:
	add	x0, x0, #4
LBB0_2:
	bl	_vb2_start_streaming_called
	cbz	w0, LBB0_18
; %bb.3:
Lloh2:
	adrp	x8, _HVA_MAX_INSTANCES@GOTPAGE
Lloh3:
	ldr	x8, [x8, _HVA_MAX_INSTANCES@GOTPAGEOFF]
Lloh4:
	ldr	w8, [x8]
	cbz	w8, LBB0_7
; %bb.4:
	mov	x9, #0
	ldr	x10, [x21, #8]
LBB0_5:                                 ; =>This Inner Loop Header: Depth=1
	ldr	x11, [x10, x9, lsl #3]
	cbz	x11, LBB0_16
; %bb.6:                                ;   in Loop: Header=BB0_5 Depth=1
	add	x9, x9, #1
	cmp	x8, x9
	b.ne	LBB0_5
LBB0_7:
	ldr	w2, [x19, #28]
Lloh5:
	adrp	x1, l_.str.1@PAGE
Lloh6:
	add	x1, x1, l_.str.1@PAGEOFF
	mov	x0, x22
	bl	_dev_err
Lloh7:
	adrp	x8, _ENOMEM@GOTPAGE
Lloh8:
	ldr	x8, [x8, _ENOMEM@GOTPAGEOFF]
Lloh9:
	ldr	w8, [x8]
	neg	w22, w8
LBB0_8:
	ldr	x8, [x20]
Lloh10:
	adrp	x9, _V4L2_BUF_TYPE_VIDEO_OUTPUT@GOTPAGE
Lloh11:
	ldr	x9, [x9, _V4L2_BUF_TYPE_VIDEO_OUTPUT@GOTPAGEOFF]
Lloh12:
	ldr	x9, [x9]
	ldr	x0, [x19, #8]
	cmp	x8, x9
	b.ne	LBB0_12
; %bb.9:
	bl	_v4l2_m2m_src_buf_remove
	cbz	x0, LBB0_15
; %bb.10:
Lloh13:
	adrp	x20, _VB2_BUF_STATE_QUEUED@GOTPAGE
Lloh14:
	ldr	x20, [x20, _VB2_BUF_STATE_QUEUED@GOTPAGEOFF]
LBB0_11:                                ; =>This Inner Loop Header: Depth=1
	ldr	w1, [x20]
	bl	_v4l2_m2m_buf_done
	ldr	x0, [x19, #8]
	bl	_v4l2_m2m_src_buf_remove
	cbnz	x0, LBB0_11
	b	LBB0_15
LBB0_12:
	bl	_v4l2_m2m_dst_buf_remove
	cbz	x0, LBB0_15
; %bb.13:
Lloh15:
	adrp	x20, _VB2_BUF_STATE_QUEUED@GOTPAGE
Lloh16:
	ldr	x20, [x20, _VB2_BUF_STATE_QUEUED@GOTPAGEOFF]
LBB0_14:                                ; =>This Inner Loop Header: Depth=1
	ldr	w1, [x20]
	bl	_v4l2_m2m_buf_done
	ldr	x0, [x19, #8]
	bl	_v4l2_m2m_dst_buf_remove
	cbnz	x0, LBB0_14
LBB0_15:
	ldr	w8, [x19, #4]
	add	w8, w8, #1
	str	w8, [x19, #4]
	b	LBB0_19
LBB0_16:
	str	x19, [x10, x9, lsl #3]
	str	w9, [x19]
	ldr	w8, [x21]
	add	w8, w8, #1
	str	w8, [x21]
	mov	x3, x19
	ldr	w8, [x3, #16]!
	cbnz	w8, LBB0_18
; %bb.17:
	ldp	w2, w1, [x19, #20]
	mov	x0, x19
	bl	_hva_open_encoder
	tbnz	w0, #31, LBB0_20
LBB0_18:
	mov	w22, #0
LBB0_19:
	mov	x0, x22
	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
	ldp	x24, x23, [sp], #64             ; 16-byte Folded Reload
	ret
LBB0_20:
	mov	x22, x0
	ldr	x8, [x21, #8]
	ldr	w9, [x19]
	str	xzr, [x8, x9, lsl #3]
	ldr	w8, [x21]
	sub	w8, w8, #1
	str	w8, [x21]
	b	LBB0_8
	.loh AdrpAdd	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh7, Lloh8, Lloh9
	.loh AdrpAdd	Lloh5, Lloh6
	.loh AdrpLdrGotLdr	Lloh10, Lloh11, Lloh12
	.loh AdrpLdrGot	Lloh13, Lloh14
	.loh AdrpLdrGot	Lloh15, Lloh16
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"%s %s start streaming\n"

	.comm	_HVA_MAX_INSTANCES,4,2          ; @HVA_MAX_INSTANCES
l_.str.1:                               ; @.str.1
	.asciz	"%s maximum instances reached\n"

	.comm	_ENOMEM,4,2                     ; @ENOMEM
	.comm	_V4L2_BUF_TYPE_VIDEO_OUTPUT,8,3 ; @V4L2_BUF_TYPE_VIDEO_OUTPUT
	.comm	_VB2_BUF_STATE_QUEUED,4,2       ; @VB2_BUF_STATE_QUEUED
	.no_dead_strip	_hva_start_streaming
.subsections_via_symbols
