	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function video_end
_video_end:                             ## @video_end
	.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
	movq	(%rdi), %rbx
	movq	8(%rbx), %r15
	leaq	L_.str(%rip), %rdi
	movq	%rbx, %rsi
	movq	%r14, %rdx
	callq	_DEB_EE
	movl	(%r15), %eax
	movq	_STATUS_CAPTURE@GOTPCREL(%rip), %rcx
	notl	%eax
	testl	%eax, (%rcx)
	jne	LBB0_1
## %bb.2:
	cmpq	%r14, 16(%r15)
	je	LBB0_4
## %bb.3:
	leaq	L_.str.2(%rip), %rdi
	callq	_DEB_S
	movq	_EBUSY@GOTPCREL(%rip), %rax
	xorl	%ebx, %ebx
	subl	(%rax), %ebx
	jmp	LBB0_11
LBB0_1:
	leaq	L_.str.1(%rip), %rdi
	callq	_DEB_S
	xorl	%ebx, %ebx
LBB0_11:
	movl	%ebx, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_4:
	leaq	32(%r15), %rax
	movq	%rax, -48(%rbp)                 ## 8-byte Spill
	movl	24(%r15), %esi
	movq	%rbx, %rdi
	callq	_saa7146_format_by_fourcc
	movq	%rax, %r13
	xorl	%edi, %edi
	testq	%rax, %rax
	sete	%dil
	callq	_BUG_ON
	movq	_FORMAT_IS_PLANAR@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movq	_RESOURCE_DMA1_HPS@GOTPCREL(%rip), %rcx
	movl	(%rcx), %r12d
	testl	%eax, (%r13)
	je	LBB0_6
## %bb.5:
	movq	_RESOURCE_DMA2_CLP@GOTPCREL(%rip), %rax
	orl	(%rax), %r12d
	movq	_RESOURCE_DMA3_BRS@GOTPCREL(%rip), %rax
	orl	(%rax), %r12d
	movq	_MASK_22@GOTPCREL(%rip), %rax
	movq	_MASK_21@GOTPCREL(%rip), %rcx
	movl	(%rcx), %r13d
	orl	(%rax), %r13d
	movq	_MASK_20@GOTPCREL(%rip), %rax
	orl	(%rax), %r13d
	jmp	LBB0_7
LBB0_6:
	movq	_MASK_22@GOTPCREL(%rip), %rax
	movl	(%rax), %r13d
LBB0_7:
	movq	%rbx, %rdi
	callq	_spin_lock_irqsave
	movq	_MC1@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	_MASK_28@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	%rbx, %rdi
	callq	_saa7146_write
	movq	_MASK_27@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%rbx, %rdi
	callq	_SAA7146_IER_DISABLE
	movq	_MC1@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%rbx, %rdi
	movl	%r13d, %edx
	callq	_saa7146_write
	movq	-48(%rbp), %rsi                 ## 8-byte Reload
	cmpq	$0, (%rsi)
	je	LBB0_9
## %bb.8:
	movq	_VIDEOBUF_DONE@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	%rbx, %rdi
	callq	_saa7146_buffer_finish
LBB0_9:
	movq	%rbx, %rdi
	callq	_spin_unlock_irqrestore
	movq	$0, 16(%r15)
	movl	$0, (%r15)
	movq	%r14, %rdi
	movl	%r12d, %esi
	callq	_saa7146_res_free
	movq	8(%r15), %rdi
	xorl	%ebx, %ebx
	testq	%rdi, %rdi
	je	LBB0_11
## %bb.10:
	callq	_saa7146_start_preview
	movq	$0, 8(%r15)
	jmp	LBB0_11
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"dev:%p, fh:%p\n"

	.comm	_STATUS_CAPTURE,4,2             ## @STATUS_CAPTURE
L_.str.1:                               ## @.str.1
	.asciz	"not capturing\n"

L_.str.2:                               ## @.str.2
	.asciz	"capturing, but in another open\n"

	.comm	_EBUSY,4,2                      ## @EBUSY
	.comm	_FORMAT_IS_PLANAR,4,2           ## @FORMAT_IS_PLANAR
	.comm	_RESOURCE_DMA1_HPS,4,2          ## @RESOURCE_DMA1_HPS
	.comm	_RESOURCE_DMA2_CLP,4,2          ## @RESOURCE_DMA2_CLP
	.comm	_RESOURCE_DMA3_BRS,4,2          ## @RESOURCE_DMA3_BRS
	.comm	_MASK_22,4,2                    ## @MASK_22
	.comm	_MASK_21,4,2                    ## @MASK_21
	.comm	_MASK_20,4,2                    ## @MASK_20
	.comm	_MC1,4,2                        ## @MC1
	.comm	_MASK_28,4,2                    ## @MASK_28
	.comm	_MASK_27,4,2                    ## @MASK_27
	.comm	_VIDEOBUF_DONE,4,2              ## @VIDEOBUF_DONE
	.no_dead_strip	_video_end
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function video_end
_video_end:                             ; @video_end
	.cfi_startproc
; %bb.0:
	stp	x26, x25, [sp, #-80]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 80
	stp	x24, x23, [sp, #16]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #32]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #48]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #64]             ; 16-byte Folded Spill
	add	x29, sp, #64
	.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
	mov	x19, x0
	ldr	x20, [x0]
	ldr	x24, [x20, #8]
Lloh0:
	adrp	x0, l_.str@PAGE
Lloh1:
	add	x0, x0, l_.str@PAGEOFF
	mov	x1, x20
	mov	x2, x19
	bl	_DEB_EE
	mov	x21, x24
	ldr	w8, [x21], #32
Lloh2:
	adrp	x9, _STATUS_CAPTURE@GOTPAGE
Lloh3:
	ldr	x9, [x9, _STATUS_CAPTURE@GOTPAGEOFF]
Lloh4:
	ldr	w9, [x9]
	bics	wzr, w9, w8
	b.ne	LBB0_3
; %bb.1:
	ldr	x8, [x24, #16]
	cmp	x8, x19
	b.eq	LBB0_5
; %bb.2:
Lloh5:
	adrp	x0, l_.str.2@PAGE
Lloh6:
	add	x0, x0, l_.str.2@PAGEOFF
	bl	_DEB_S
Lloh7:
	adrp	x8, _EBUSY@GOTPAGE
Lloh8:
	ldr	x8, [x8, _EBUSY@GOTPAGEOFF]
Lloh9:
	ldr	w8, [x8]
	neg	w0, w8
	b	LBB0_4
LBB0_3:
Lloh10:
	adrp	x0, l_.str.1@PAGE
Lloh11:
	add	x0, x0, l_.str.1@PAGEOFF
	bl	_DEB_S
	mov	w0, #0
LBB0_4:
	ldp	x29, x30, [sp, #64]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #48]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #32]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #16]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp], #80             ; 16-byte Folded Reload
	ret
LBB0_5:
	ldr	w1, [x24, #24]
	mov	x0, x20
	bl	_saa7146_format_by_fourcc
	mov	x22, x0
	cmp	x0, #0
	cset	w0, eq
	bl	_BUG_ON
Lloh12:
	adrp	x8, _FORMAT_IS_PLANAR@GOTPAGE
Lloh13:
	ldr	x8, [x8, _FORMAT_IS_PLANAR@GOTPAGEOFF]
	ldr	w9, [x22]
Lloh14:
	ldr	w8, [x8]
Lloh15:
	adrp	x10, _RESOURCE_DMA1_HPS@GOTPAGE
Lloh16:
	ldr	x10, [x10, _RESOURCE_DMA1_HPS@GOTPAGEOFF]
Lloh17:
	ldr	w22, [x10]
	tst	w8, w9
	b.eq	LBB0_7
; %bb.6:
Lloh18:
	adrp	x8, _RESOURCE_DMA2_CLP@GOTPAGE
Lloh19:
	ldr	x8, [x8, _RESOURCE_DMA2_CLP@GOTPAGEOFF]
Lloh20:
	ldr	w8, [x8]
	orr	w8, w8, w22
Lloh21:
	adrp	x9, _RESOURCE_DMA3_BRS@GOTPAGE
Lloh22:
	ldr	x9, [x9, _RESOURCE_DMA3_BRS@GOTPAGEOFF]
Lloh23:
	ldr	w9, [x9]
	orr	w22, w8, w9
Lloh24:
	adrp	x8, _MASK_22@GOTPAGE
Lloh25:
	ldr	x8, [x8, _MASK_22@GOTPAGEOFF]
Lloh26:
	ldr	w8, [x8]
Lloh27:
	adrp	x9, _MASK_21@GOTPAGE
Lloh28:
	ldr	x9, [x9, _MASK_21@GOTPAGEOFF]
Lloh29:
	ldr	w9, [x9]
	orr	w8, w9, w8
Lloh30:
	adrp	x9, _MASK_20@GOTPAGE
Lloh31:
	ldr	x9, [x9, _MASK_20@GOTPAGEOFF]
Lloh32:
	ldr	w9, [x9]
	orr	w23, w8, w9
	b	LBB0_8
LBB0_7:
Lloh33:
	adrp	x8, _MASK_22@GOTPAGE
Lloh34:
	ldr	x8, [x8, _MASK_22@GOTPAGEOFF]
Lloh35:
	ldr	w23, [x8]
LBB0_8:
	mov	x0, x20
	bl	_spin_lock_irqsave
Lloh36:
	adrp	x25, _MC1@GOTPAGE
Lloh37:
	ldr	x25, [x25, _MC1@GOTPAGEOFF]
	ldr	w1, [x25]
Lloh38:
	adrp	x8, _MASK_28@GOTPAGE
Lloh39:
	ldr	x8, [x8, _MASK_28@GOTPAGEOFF]
Lloh40:
	ldr	w2, [x8]
	mov	x0, x20
	bl	_saa7146_write
Lloh41:
	adrp	x8, _MASK_27@GOTPAGE
Lloh42:
	ldr	x8, [x8, _MASK_27@GOTPAGEOFF]
Lloh43:
	ldr	w1, [x8]
	mov	x0, x20
	bl	_SAA7146_IER_DISABLE
	ldr	w1, [x25]
	mov	x0, x20
	mov	x2, x23
	bl	_saa7146_write
	ldr	x8, [x21]
	cbz	x8, LBB0_10
; %bb.9:
Lloh44:
	adrp	x8, _VIDEOBUF_DONE@GOTPAGE
Lloh45:
	ldr	x8, [x8, _VIDEOBUF_DONE@GOTPAGEOFF]
Lloh46:
	ldr	w2, [x8]
	mov	x0, x20
	mov	x1, x21
	bl	_saa7146_buffer_finish
LBB0_10:
	mov	x0, x20
	bl	_spin_unlock_irqrestore
	str	xzr, [x24, #16]
	str	wzr, [x24]
	mov	x0, x19
	mov	x1, x22
	bl	_saa7146_res_free
	ldr	x0, [x24, #8]
	cbz	x0, LBB0_4
; %bb.11:
	bl	_saa7146_start_preview
	mov	w0, #0
	str	xzr, [x24, #8]
	b	LBB0_4
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpAdd	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh7, Lloh8, Lloh9
	.loh AdrpAdd	Lloh5, Lloh6
	.loh AdrpAdd	Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh15, Lloh16, Lloh17
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh30, Lloh31, Lloh32
	.loh AdrpLdrGotLdr	Lloh27, Lloh28, Lloh29
	.loh AdrpLdrGotLdr	Lloh24, Lloh25, Lloh26
	.loh AdrpLdrGotLdr	Lloh21, Lloh22, Lloh23
	.loh AdrpLdrGotLdr	Lloh18, Lloh19, Lloh20
	.loh AdrpLdrGotLdr	Lloh33, Lloh34, Lloh35
	.loh AdrpLdrGotLdr	Lloh41, Lloh42, Lloh43
	.loh AdrpLdrGotLdr	Lloh38, Lloh39, Lloh40
	.loh AdrpLdrGot	Lloh36, Lloh37
	.loh AdrpLdrGotLdr	Lloh44, Lloh45, Lloh46
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"dev:%p, fh:%p\n"

	.comm	_STATUS_CAPTURE,4,2             ; @STATUS_CAPTURE
l_.str.1:                               ; @.str.1
	.asciz	"not capturing\n"

l_.str.2:                               ; @.str.2
	.asciz	"capturing, but in another open\n"

	.comm	_EBUSY,4,2                      ; @EBUSY
	.comm	_FORMAT_IS_PLANAR,4,2           ; @FORMAT_IS_PLANAR
	.comm	_RESOURCE_DMA1_HPS,4,2          ; @RESOURCE_DMA1_HPS
	.comm	_RESOURCE_DMA2_CLP,4,2          ; @RESOURCE_DMA2_CLP
	.comm	_RESOURCE_DMA3_BRS,4,2          ; @RESOURCE_DMA3_BRS
	.comm	_MASK_22,4,2                    ; @MASK_22
	.comm	_MASK_21,4,2                    ; @MASK_21
	.comm	_MASK_20,4,2                    ; @MASK_20
	.comm	_MC1,4,2                        ; @MC1
	.comm	_MASK_28,4,2                    ; @MASK_28
	.comm	_MASK_27,4,2                    ; @MASK_27
	.comm	_VIDEOBUF_DONE,4,2              ; @VIDEOBUF_DONE
	.no_dead_strip	_video_end
.subsections_via_symbols
