	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function aspeed_video_stop_streaming
_aspeed_video_stop_streaming:           ## @aspeed_video_stop_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	%rbx
	pushq	%rax
	.cfi_offset %rbx, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	callq	_vb2_get_drv_priv
	movq	%rax, %r14
	movq	_VIDEO_STREAMING@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	leaq	4(%r14), %rbx
	movq	%rbx, %rsi
	callq	_clear_bit
	movl	8(%r14), %r15d
	movq	_VIDEO_FRAME_INPRG@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movq	%rbx, %rsi
	callq	_test_bit
	xorl	%esi, %esi
	testl	%eax, %eax
	sete	%sil
	movq	_STOP_TIMEOUT@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movl	%r15d, %edi
	callq	_wait_event_timeout
	testl	%eax, %eax
	jne	LBB0_2
## %bb.1:
	movl	(%r14), %edi
	leaq	L_.str(%rip), %rsi
	callq	_dev_dbg
	movq	%r14, %rdi
	callq	_aspeed_video_off
	movq	%r14, %rdi
	callq	_aspeed_video_on
	movq	%r14, %rdi
	callq	_aspeed_video_init_regs
	movq	%r14, %rdi
	callq	_aspeed_video_get_resolution
LBB0_2:
	movq	_VB2_BUF_STATE_ERROR@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r14, %rdi
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_aspeed_video_bufs_done         ## TAILCALL
	.cfi_endproc
                                        ## -- End function
	.comm	_VIDEO_STREAMING,4,2            ## @VIDEO_STREAMING
	.comm	_VIDEO_FRAME_INPRG,4,2          ## @VIDEO_FRAME_INPRG
	.comm	_STOP_TIMEOUT,4,2               ## @STOP_TIMEOUT
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Timed out when stopping streaming\n"

	.comm	_VB2_BUF_STATE_ERROR,4,2        ## @VB2_BUF_STATE_ERROR
	.no_dead_strip	_aspeed_video_stop_streaming
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function aspeed_video_stop_streaming
_aspeed_video_stop_streaming:           ; @aspeed_video_stop_streaming
	.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
	bl	_vb2_get_drv_priv
	mov	x19, x0
Lloh0:
	adrp	x8, _VIDEO_STREAMING@GOTPAGE
Lloh1:
	ldr	x8, [x8, _VIDEO_STREAMING@GOTPAGEOFF]
Lloh2:
	ldr	w0, [x8]
	add	x20, x19, #4
	mov	x1, x20
	bl	_clear_bit
	ldr	w21, [x19, #8]
Lloh3:
	adrp	x8, _VIDEO_FRAME_INPRG@GOTPAGE
Lloh4:
	ldr	x8, [x8, _VIDEO_FRAME_INPRG@GOTPAGEOFF]
Lloh5:
	ldr	w0, [x8]
	mov	x1, x20
	bl	_test_bit
	cmp	w0, #0
	cset	w1, eq
Lloh6:
	adrp	x8, _STOP_TIMEOUT@GOTPAGE
Lloh7:
	ldr	x8, [x8, _STOP_TIMEOUT@GOTPAGEOFF]
Lloh8:
	ldr	w2, [x8]
	mov	x0, x21
	bl	_wait_event_timeout
	cbnz	w0, LBB0_2
; %bb.1:
	ldr	w0, [x19]
Lloh9:
	adrp	x1, l_.str@PAGE
Lloh10:
	add	x1, x1, l_.str@PAGEOFF
	bl	_dev_dbg
	mov	x0, x19
	bl	_aspeed_video_off
	mov	x0, x19
	bl	_aspeed_video_on
	mov	x0, x19
	bl	_aspeed_video_init_regs
	mov	x0, x19
	bl	_aspeed_video_get_resolution
LBB0_2:
Lloh11:
	adrp	x8, _VB2_BUF_STATE_ERROR@GOTPAGE
Lloh12:
	ldr	x8, [x8, _VB2_BUF_STATE_ERROR@GOTPAGEOFF]
Lloh13:
	ldr	w1, [x8]
	mov	x0, x19
	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
	b	_aspeed_video_bufs_done
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpAdd	Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.cfi_endproc
                                        ; -- End function
	.comm	_VIDEO_STREAMING,4,2            ; @VIDEO_STREAMING
	.comm	_VIDEO_FRAME_INPRG,4,2          ; @VIDEO_FRAME_INPRG
	.comm	_STOP_TIMEOUT,4,2               ; @STOP_TIMEOUT
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Timed out when stopping streaming\n"

	.comm	_VB2_BUF_STATE_ERROR,4,2        ; @VB2_BUF_STATE_ERROR
	.no_dead_strip	_aspeed_video_stop_streaming
.subsections_via_symbols
