	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function vdec_start_capture
_vdec_start_capture:                    ## @vdec_start_capture
	.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	%rbx
	pushq	%rax
	.cfi_offset %rbx, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	xorl	%ebx, %ebx
	cmpl	$0, 32(%rdi)
	je	LBB0_15
## %bb.1:
	movq	%rdi, %r14
	movq	(%rdi), %rax
	movq	_VENUS_DEC_STATE_DECODING@GOTPCREL(%rip), %r15
	cmpq	(%r15), %rax
	jne	LBB0_4
## %bb.2:
	cmpl	$0, 8(%r14)
	jne	LBB0_5
## %bb.3:
	movq	%r14, %rdi
	callq	_venus_helper_queue_dpb_bufs
	movq	%r14, %rdi
	callq	_venus_helper_process_initial_cap_bufs
	movl	$1, 12(%r14)
	xorl	%ebx, %ebx
	jmp	LBB0_15
LBB0_4:
	movq	_VENUS_DEC_STATE_STOPPED@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jne	LBB0_15
LBB0_5:
	movq	_HFI_FLUSH_OUTPUT@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r14, %rdi
	callq	_hfi_session_flush
	movl	%eax, %ebx
	testl	%eax, %eax
	jne	LBB0_15
## %bb.6:
	movq	%r14, %rdi
	callq	_vdec_output_conf
	movl	%eax, %ebx
	testl	%eax, %eax
	jne	LBB0_15
## %bb.7:
	movl	28(%r14), %esi
	movq	_VB2_MAX_FRAME@GOTPCREL(%rip), %rax
	movl	(%rax), %ecx
	movq	%r14, %rdi
	movl	%ecx, %edx
	callq	_venus_helper_set_num_bufs
	movl	%eax, %ebx
	testl	%eax, %eax
	jne	LBB0_15
## %bb.8:
	movq	%r14, %rdi
	callq	_venus_helper_intbufs_realloc
	movl	%eax, %ebx
	testl	%eax, %eax
	jne	LBB0_15
## %bb.9:
	movq	%r14, %rdi
	callq	_venus_helper_alloc_dpb_bufs
	movl	%eax, %ebx
	testl	%eax, %eax
	jne	LBB0_15
## %bb.10:
	movq	%r14, %rdi
	callq	_venus_helper_queue_dpb_bufs
	movl	%eax, %ebx
	testl	%eax, %eax
	jne	LBB0_14
## %bb.11:
	movq	%r14, %rdi
	callq	_venus_helper_process_initial_cap_bufs
	movl	%eax, %ebx
	testl	%eax, %eax
	jne	LBB0_14
## %bb.12:
	movl	24(%r14), %edi
	callq	_venus_helper_load_scale_clocks
	movq	%r14, %rdi
	callq	_hfi_session_continue
	movl	%eax, %ebx
	testl	%eax, %eax
	je	LBB0_13
LBB0_14:
	movq	%r14, %rdi
	callq	_venus_helper_free_dpb_bufs
LBB0_15:
	movl	%ebx, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_13:
	movq	(%r15), %rax
	movq	%rax, (%r14)
	movq	$0, 16(%r14)
	movabsq	$4294967296, %rax               ## imm = 0x100000000
	movq	%rax, 8(%r14)
	xorl	%ebx, %ebx
	jmp	LBB0_15
	.cfi_endproc
                                        ## -- End function
	.comm	_VENUS_DEC_STATE_DECODING,8,3   ## @VENUS_DEC_STATE_DECODING
	.comm	_VENUS_DEC_STATE_STOPPED,8,3    ## @VENUS_DEC_STATE_STOPPED
	.comm	_HFI_FLUSH_OUTPUT,4,2           ## @HFI_FLUSH_OUTPUT
	.comm	_VB2_MAX_FRAME,4,2              ## @VB2_MAX_FRAME
	.no_dead_strip	_vdec_start_capture
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.section	__TEXT,__literal8,8byte_literals
	.p2align	3                               ; -- Begin function vdec_start_capture
lCPI0_0:
	.long	0                               ; 0x0
	.long	1                               ; 0x1
	.section	__TEXT,__text,regular,pure_instructions
	.p2align	2
_vdec_start_capture:                    ; @vdec_start_capture
	.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
	ldr	w8, [x0, #32]
	cbz	w8, LBB0_14
; %bb.1:
	mov	x19, x0
	ldr	x8, [x0]
Lloh0:
	adrp	x21, _VENUS_DEC_STATE_DECODING@GOTPAGE
Lloh1:
	ldr	x21, [x21, _VENUS_DEC_STATE_DECODING@GOTPAGEOFF]
	ldr	x9, [x21]
	cmp	x8, x9
	b.ne	LBB0_4
; %bb.2:
	ldr	w8, [x19, #8]
	cbnz	w8, LBB0_5
; %bb.3:
	mov	x0, x19
	bl	_venus_helper_queue_dpb_bufs
	mov	x0, x19
	bl	_venus_helper_process_initial_cap_bufs
	mov	w20, #0
	mov	w8, #1
	str	w8, [x19, #12]
	b	LBB0_15
LBB0_4:
Lloh2:
	adrp	x9, _VENUS_DEC_STATE_STOPPED@GOTPAGE
Lloh3:
	ldr	x9, [x9, _VENUS_DEC_STATE_STOPPED@GOTPAGEOFF]
Lloh4:
	ldr	x9, [x9]
	cmp	x8, x9
	b.ne	LBB0_14
LBB0_5:
Lloh5:
	adrp	x8, _HFI_FLUSH_OUTPUT@GOTPAGE
Lloh6:
	ldr	x8, [x8, _HFI_FLUSH_OUTPUT@GOTPAGEOFF]
Lloh7:
	ldr	w1, [x8]
	mov	x0, x19
	bl	_hfi_session_flush
	mov	x20, x0
	cbnz	w0, LBB0_15
; %bb.6:
	mov	x0, x19
	bl	_vdec_output_conf
	mov	x20, x0
	cbnz	w0, LBB0_15
; %bb.7:
	ldr	w1, [x19, #28]
Lloh8:
	adrp	x8, _VB2_MAX_FRAME@GOTPAGE
Lloh9:
	ldr	x8, [x8, _VB2_MAX_FRAME@GOTPAGEOFF]
Lloh10:
	ldr	w2, [x8]
	mov	x0, x19
	mov	x3, x2
	bl	_venus_helper_set_num_bufs
	mov	x20, x0
	cbnz	w0, LBB0_15
; %bb.8:
	mov	x0, x19
	bl	_venus_helper_intbufs_realloc
	mov	x20, x0
	cbnz	w0, LBB0_15
; %bb.9:
	mov	x0, x19
	bl	_venus_helper_alloc_dpb_bufs
	mov	x20, x0
	cbnz	w0, LBB0_15
; %bb.10:
	mov	x0, x19
	bl	_venus_helper_queue_dpb_bufs
	mov	x20, x0
	cbnz	w0, LBB0_13
; %bb.11:
	mov	x0, x19
	bl	_venus_helper_process_initial_cap_bufs
	mov	x20, x0
	cbnz	w0, LBB0_13
; %bb.12:
	ldr	w0, [x19, #24]
	bl	_venus_helper_load_scale_clocks
	mov	x0, x19
	bl	_hfi_session_continue
	mov	x20, x0
	cbz	w0, LBB0_16
LBB0_13:
	mov	x0, x19
	bl	_venus_helper_free_dpb_bufs
	b	LBB0_15
LBB0_14:
	mov	w20, #0
LBB0_15:
	mov	x0, x20
	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_16:
	ldr	x8, [x21]
	str	x8, [x19]
	str	xzr, [x19, #16]
Lloh11:
	adrp	x8, lCPI0_0@PAGE
Lloh12:
	ldr	d0, [x8, lCPI0_0@PAGEOFF]
	str	d0, [x19, #8]
	b	LBB0_15
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpLdr	Lloh11, Lloh12
	.cfi_endproc
                                        ; -- End function
	.comm	_VENUS_DEC_STATE_DECODING,8,3   ; @VENUS_DEC_STATE_DECODING
	.comm	_VENUS_DEC_STATE_STOPPED,8,3    ; @VENUS_DEC_STATE_STOPPED
	.comm	_HFI_FLUSH_OUTPUT,4,2           ; @HFI_FLUSH_OUTPUT
	.comm	_VB2_MAX_FRAME,4,2              ; @VB2_MAX_FRAME
	.no_dead_strip	_vdec_start_capture
.subsections_via_symbols
