	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_ivtv_start_v4l2_decode_stream  ## -- Begin function ivtv_start_v4l2_decode_stream
	.p2align	4, 0x90
_ivtv_start_v4l2_decode_stream:         ## @ivtv_start_v4l2_decode_stream
	.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
	cmpq	$0, 8(%rdi)
	je	LBB0_1
## %bb.2:
	movl	%esi, %r15d
	movq	%rdi, %rbx
	movq	16(%rdi), %r14
	movq	_IVTV_F_S_STREAMING@GOTPCREL(%rip), %r13
	movl	(%r13), %edi
	movq	%rbx, %rsi
	callq	_test_and_set_bit
	xorl	%r12d, %r12d
	testq	%rax, %rax
	jne	LBB0_6
## %bb.3:
	movl	4(%rbx), %esi
	leaq	L_.str(%rip), %rdi
	movl	%r15d, %edx
	callq	_IVTV_DEBUG_INFO
	movq	%rbx, %rdi
	callq	_ivtv_setup_v4l2_decode_stream
	testl	%eax, %eax
	js	LBB0_4
## %bb.5:
	movq	_CX2341X_DEC_SET_DMA_BLOCK_SIZE@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	xorl	%r12d, %r12d
	movq	%r14, %rdi
	movl	$1, %edx
	movl	$65536, %ecx                    ## imm = 0x10000
	xorl	%eax, %eax
	callq	_ivtv_vapi
	movq	_IVTV_F_S_STREAMOFF@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movq	%rbx, %rsi
	callq	_clear_bit
	movq	8(%r14), %rax
	movq	_IVTV_MBOX_DMA_END@GOTPCREL(%rip), %rbx
	movq	(%rbx), %rcx
	movq	(%rax,%rcx,8), %rsi
	xorl	%edi, %edi
	callq	_writel
	movq	8(%r14), %rax
	movq	(%rbx), %rcx
	movq	(%rax,%rcx,8), %rsi
	addq	$4, %rsi
	xorl	%edi, %edi
	callq	_writel
	movq	8(%r14), %rax
	movq	(%rbx), %rcx
	movq	(%rax,%rcx,8), %rsi
	addq	$8, %rsi
	xorl	%edi, %edi
	callq	_writel
	movq	8(%r14), %rax
	movq	(%rbx), %rcx
	movq	(%rax,%rcx,8), %rsi
	addq	$12, %rsi
	xorl	%edi, %edi
	callq	_writel
	movq	8(%r14), %rax
	movq	_IVTV_MBOX_DMA@GOTPCREL(%rip), %rbx
	movq	(%rbx), %rcx
	movq	(%rax,%rcx,8), %rsi
	xorl	%edi, %edi
	callq	_writel
	movq	8(%r14), %rax
	movq	(%rbx), %rcx
	movq	(%rax,%rcx,8), %rsi
	addq	$4, %rsi
	xorl	%edi, %edi
	callq	_writel
	movq	8(%r14), %rax
	movq	(%rbx), %rcx
	movq	(%rax,%rcx,8), %rsi
	addq	$8, %rsi
	xorl	%edi, %edi
	callq	_writel
	movq	8(%r14), %rax
	movq	(%rbx), %rcx
	movq	(%rax,%rcx,8), %rsi
	addq	$12, %rsi
	xorl	%edi, %edi
	callq	_writel
	movq	_CX2341X_DEC_SET_EVENT_NOTIFICATION@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	_IVTV_IRQ_DEC_AUD_MODE_CHG@GOTPCREL(%rip), %rax
	movl	(%rax), %r9d
	movl	$-1, (%rsp)
	movq	%r14, %rdi
	movl	$4, %edx
	xorl	%ecx, %ecx
	movl	$1, %r8d
	xorl	%eax, %eax
	callq	_ivtv_vapi
	movq	_CX2341X_DEC_START_PLAYBACK@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r14, %rdi
	movl	$2, %edx
	movl	%r15d, %ecx
	xorl	%r8d, %r8d
	xorl	%eax, %eax
	callq	_ivtv_vapi
	movl	$10, %edi
	xorl	%esi, %esi
	callq	_ivtv_msleep_timeout
	movq	_IVTV_IRQ_MASK_DECODE@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r14, %rdi
	callq	_ivtv_clear_irq_mask
	movl	4(%r14), %esi
	leaq	L_.str.1(%rip), %rdi
	callq	_IVTV_DEBUG_IRQ
	movq	%r14, %rdi
	callq	_atomic_inc
	jmp	LBB0_6
LBB0_1:
	movq	_EINVAL@GOTPCREL(%rip), %rax
	xorl	%r12d, %r12d
	subl	(%rax), %r12d
	jmp	LBB0_6
LBB0_4:
	movl	%eax, %r12d
	movl	(%r13), %edi
	movq	%rbx, %rsi
	callq	_clear_bit
LBB0_6:
	movl	%r12d, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_EINVAL,4,2                     ## @EINVAL
	.comm	_IVTV_F_S_STREAMING,4,2         ## @IVTV_F_S_STREAMING
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Starting decode stream %s (gop_offset %d)\n"

	.comm	_CX2341X_DEC_SET_DMA_BLOCK_SIZE,4,2 ## @CX2341X_DEC_SET_DMA_BLOCK_SIZE
	.comm	_IVTV_F_S_STREAMOFF,4,2         ## @IVTV_F_S_STREAMOFF
	.comm	_IVTV_MBOX_DMA_END,8,3          ## @IVTV_MBOX_DMA_END
	.comm	_IVTV_MBOX_DMA,8,3              ## @IVTV_MBOX_DMA
	.comm	_CX2341X_DEC_SET_EVENT_NOTIFICATION,4,2 ## @CX2341X_DEC_SET_EVENT_NOTIFICATION
	.comm	_IVTV_IRQ_DEC_AUD_MODE_CHG,4,2  ## @IVTV_IRQ_DEC_AUD_MODE_CHG
	.comm	_CX2341X_DEC_START_PLAYBACK,4,2 ## @CX2341X_DEC_START_PLAYBACK
	.comm	_IVTV_IRQ_MASK_DECODE,4,2       ## @IVTV_IRQ_MASK_DECODE
L_.str.1:                               ## @.str.1
	.asciz	"IRQ Mask is now: 0x%08x\n"

.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_ivtv_start_v4l2_decode_stream  ; -- Begin function ivtv_start_v4l2_decode_stream
	.p2align	2
_ivtv_start_v4l2_decode_stream:         ; @ivtv_start_v4l2_decode_stream
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #96
	.cfi_def_cfa_offset 96
	stp	x24, x23, [sp, #32]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #48]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #64]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #80]             ; 16-byte Folded Spill
	add	x29, sp, #80
	.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
	ldr	x8, [x0, #8]
	cbz	x8, LBB0_5
; %bb.1:
	mov	x20, x1
	mov	x21, x0
	ldr	x19, [x0, #16]
Lloh0:
	adrp	x23, _IVTV_F_S_STREAMING@GOTPAGE
Lloh1:
	ldr	x23, [x23, _IVTV_F_S_STREAMING@GOTPAGEOFF]
	ldr	w0, [x23]
	mov	x1, x21
	bl	_test_and_set_bit
	cbnz	x0, LBB0_4
; %bb.2:
	ldr	w1, [x21, #4]
Lloh2:
	adrp	x0, l_.str@PAGE
Lloh3:
	add	x0, x0, l_.str@PAGEOFF
	mov	x2, x20
	bl	_IVTV_DEBUG_INFO
	mov	x0, x21
	bl	_ivtv_setup_v4l2_decode_stream
	tbnz	w0, #31, LBB0_6
; %bb.3:
Lloh4:
	adrp	x8, _CX2341X_DEC_SET_DMA_BLOCK_SIZE@GOTPAGE
Lloh5:
	ldr	x8, [x8, _CX2341X_DEC_SET_DMA_BLOCK_SIZE@GOTPAGEOFF]
Lloh6:
	ldr	w1, [x8]
	mov	w22, #1
	mov	x0, x19
	mov	w2, #1
	mov	w3, #65536
	bl	_ivtv_vapi
Lloh7:
	adrp	x8, _IVTV_F_S_STREAMOFF@GOTPAGE
Lloh8:
	ldr	x8, [x8, _IVTV_F_S_STREAMOFF@GOTPAGEOFF]
Lloh9:
	ldr	w0, [x8]
	mov	x1, x21
	bl	_clear_bit
	ldr	x8, [x19, #8]
Lloh10:
	adrp	x21, _IVTV_MBOX_DMA_END@GOTPAGE
Lloh11:
	ldr	x21, [x21, _IVTV_MBOX_DMA_END@GOTPAGEOFF]
	ldr	x9, [x21]
	ldr	x1, [x8, x9, lsl #3]
	mov	w0, #0
	bl	_writel
	ldr	x8, [x19, #8]
	ldr	x9, [x21]
	ldr	x8, [x8, x9, lsl #3]
	add	x1, x8, #4
	mov	w0, #0
	bl	_writel
	ldr	x8, [x19, #8]
	ldr	x9, [x21]
	ldr	x8, [x8, x9, lsl #3]
	add	x1, x8, #8
	mov	w0, #0
	bl	_writel
	ldr	x8, [x19, #8]
	ldr	x9, [x21]
	ldr	x8, [x8, x9, lsl #3]
	add	x1, x8, #12
	mov	w0, #0
	bl	_writel
	ldr	x8, [x19, #8]
Lloh12:
	adrp	x21, _IVTV_MBOX_DMA@GOTPAGE
Lloh13:
	ldr	x21, [x21, _IVTV_MBOX_DMA@GOTPAGEOFF]
	ldr	x9, [x21]
	ldr	x1, [x8, x9, lsl #3]
	mov	w0, #0
	bl	_writel
	ldr	x8, [x19, #8]
	ldr	x9, [x21]
	ldr	x8, [x8, x9, lsl #3]
	add	x1, x8, #4
	mov	w0, #0
	bl	_writel
	ldr	x8, [x19, #8]
	ldr	x9, [x21]
	ldr	x8, [x8, x9, lsl #3]
	add	x1, x8, #8
	mov	w0, #0
	bl	_writel
	ldr	x8, [x19, #8]
	ldr	x9, [x21]
	ldr	x8, [x8, x9, lsl #3]
	add	x1, x8, #12
	mov	w0, #0
	bl	_writel
Lloh14:
	adrp	x8, _CX2341X_DEC_SET_EVENT_NOTIFICATION@GOTPAGE
Lloh15:
	ldr	x8, [x8, _CX2341X_DEC_SET_EVENT_NOTIFICATION@GOTPAGEOFF]
Lloh16:
	ldr	w1, [x8]
Lloh17:
	adrp	x8, _IVTV_IRQ_DEC_AUD_MODE_CHG@GOTPAGE
Lloh18:
	ldr	x8, [x8, _IVTV_IRQ_DEC_AUD_MODE_CHG@GOTPAGEOFF]
Lloh19:
	ldr	w8, [x8]
	mov	w9, #-1
	stp	x8, x9, [sp, #8]
	str	x22, [sp]
	mov	x0, x19
	mov	w2, #4
	mov	w3, #0
	bl	_ivtv_vapi
Lloh20:
	adrp	x8, _CX2341X_DEC_START_PLAYBACK@GOTPAGE
Lloh21:
	ldr	x8, [x8, _CX2341X_DEC_START_PLAYBACK@GOTPAGEOFF]
Lloh22:
	ldr	w1, [x8]
	str	xzr, [sp]
	mov	x0, x19
	mov	w2, #2
	mov	x3, x20
	bl	_ivtv_vapi
	mov	w0, #10
	mov	w1, #0
	bl	_ivtv_msleep_timeout
Lloh23:
	adrp	x8, _IVTV_IRQ_MASK_DECODE@GOTPAGE
Lloh24:
	ldr	x8, [x8, _IVTV_IRQ_MASK_DECODE@GOTPAGEOFF]
Lloh25:
	ldr	w1, [x8]
	mov	x0, x19
	bl	_ivtv_clear_irq_mask
	ldr	w1, [x19, #4]
Lloh26:
	adrp	x0, l_.str.1@PAGE
Lloh27:
	add	x0, x0, l_.str.1@PAGEOFF
	bl	_IVTV_DEBUG_IRQ
	mov	x0, x19
	bl	_atomic_inc
LBB0_4:
	mov	w22, #0
	b	LBB0_7
LBB0_5:
Lloh28:
	adrp	x8, _EINVAL@GOTPAGE
Lloh29:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
Lloh30:
	ldr	w8, [x8]
	neg	w22, w8
	b	LBB0_7
LBB0_6:
	mov	x22, x0
	ldr	w0, [x23]
	mov	x1, x21
	bl	_clear_bit
LBB0_7:
	mov	x0, x22
	ldp	x29, x30, [sp, #80]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #64]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #48]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #32]             ; 16-byte Folded Reload
	add	sp, sp, #96
	ret
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpAdd	Lloh2, Lloh3
	.loh AdrpAdd	Lloh26, Lloh27
	.loh AdrpLdrGotLdr	Lloh23, Lloh24, Lloh25
	.loh AdrpLdrGotLdr	Lloh20, Lloh21, Lloh22
	.loh AdrpLdrGotLdr	Lloh17, Lloh18, Lloh19
	.loh AdrpLdrGotLdr	Lloh14, Lloh15, Lloh16
	.loh AdrpLdrGot	Lloh12, Lloh13
	.loh AdrpLdrGot	Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh7, Lloh8, Lloh9
	.loh AdrpLdrGotLdr	Lloh4, Lloh5, Lloh6
	.loh AdrpLdrGotLdr	Lloh28, Lloh29, Lloh30
	.cfi_endproc
                                        ; -- End function
	.comm	_EINVAL,4,2                     ; @EINVAL
	.comm	_IVTV_F_S_STREAMING,4,2         ; @IVTV_F_S_STREAMING
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Starting decode stream %s (gop_offset %d)\n"

	.comm	_CX2341X_DEC_SET_DMA_BLOCK_SIZE,4,2 ; @CX2341X_DEC_SET_DMA_BLOCK_SIZE
	.comm	_IVTV_F_S_STREAMOFF,4,2         ; @IVTV_F_S_STREAMOFF
	.comm	_IVTV_MBOX_DMA_END,8,3          ; @IVTV_MBOX_DMA_END
	.comm	_IVTV_MBOX_DMA,8,3              ; @IVTV_MBOX_DMA
	.comm	_CX2341X_DEC_SET_EVENT_NOTIFICATION,4,2 ; @CX2341X_DEC_SET_EVENT_NOTIFICATION
	.comm	_IVTV_IRQ_DEC_AUD_MODE_CHG,4,2  ; @IVTV_IRQ_DEC_AUD_MODE_CHG
	.comm	_CX2341X_DEC_START_PLAYBACK,4,2 ; @CX2341X_DEC_START_PLAYBACK
	.comm	_IVTV_IRQ_MASK_DECODE,4,2       ; @IVTV_IRQ_MASK_DECODE
l_.str.1:                               ; @.str.1
	.asciz	"IRQ Mask is now: 0x%08x\n"

.subsections_via_symbols
