	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function cx18_dvb_start_feed
_cx18_dvb_start_feed:                   ## @cx18_dvb_start_feed
	.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	8(%rdi), %r12
	movq	8(%r12), %r14
	testq	%r14, %r14
	je	LBB0_1
## %bb.2:
	movq	16(%r14), %r15
	movl	(%rdi), %edx
	movl	4(%rdi), %esi
	leaq	L_.str(%rip), %rdi
	xorl	%eax, %eax
	callq	_CX18_DEBUG_INFO
	movq	%r15, %rdi
	callq	_mutex_lock
	movq	%r15, %rdi
	callq	_cx18_init_on_first_open
	movl	%eax, %ebx
	movq	%r15, %rdi
	callq	_mutex_unlock
	testl	%ebx, %ebx
	je	LBB0_4
## %bb.3:
	leaq	L_.str.1(%rip), %rdi
	callq	_CX18_ERR
	jmp	LBB0_13
LBB0_4:
	movq	8(%r15), %rax
	movl	$-130, %ecx
	addl	(%rax), %ecx
	cmpl	$2, %ecx
	ja	LBB0_6
## %bb.5:
	movq	_CX18_REG_DMUX_NUM_PORT_0_CONTROL@GOTPCREL(%rip), %rbx
	movl	(%rbx), %esi
	movq	%r15, %rdi
	callq	_cx18_read_reg
	orl	$5185536, %eax                  ## imm = 0x4F2000
	movl	(%rbx), %edx
	movq	%r15, %rdi
	movl	%eax, %esi
	callq	_cx18_write_reg
LBB0_6:
	cmpl	$0, (%r12)
	je	LBB0_1
## %bb.7:
	movq	(%r14), %rdi
	addq	$8, %rdi
	callq	_mutex_lock
	movq	(%r14), %rdi
	movq	(%rdi), %rax
	leaq	1(%rax), %rcx
	movq	%rcx, (%rdi)
	xorl	%ebx, %ebx
	testq	%rax, %rax
	jne	LBB0_12
## %bb.8:
	leaq	L_.str.2(%rip), %rdi
	xorl	%eax, %eax
	callq	_CX18_DEBUG_INFO
	movq	%r15, %rdi
	callq	_mutex_lock
	movq	_CX18_F_S_STREAMING@GOTPCREL(%rip), %r13
	movl	(%r13), %edi
	leaq	8(%r14), %r12
	movq	%r12, %rsi
	callq	_set_bit
	movq	%r14, %rdi
	callq	_cx18_start_v4l2_encode_stream
	movl	%eax, %ebx
	testl	%eax, %eax
	jns	LBB0_11
## %bb.9:
	leaq	L_.str.3(%rip), %rdi
	xorl	%eax, %eax
	callq	_CX18_DEBUG_INFO
	movq	(%r14), %rax
	decq	(%rax)
	jne	LBB0_11
## %bb.10:
	movl	(%r13), %edi
	movq	%r12, %rsi
	callq	_clear_bit
LBB0_11:
	movq	%r15, %rdi
	callq	_mutex_unlock
	movq	(%r14), %rdi
LBB0_12:
	addq	$8, %rdi
	callq	_mutex_unlock
	jmp	LBB0_13
LBB0_1:
	movq	_EINVAL@GOTPCREL(%rip), %rax
	xorl	%ebx, %ebx
	subl	(%rax), %ebx
LBB0_13:
	movl	%ebx, %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
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Start feed: pid = 0x%x index = %d\n"

L_.str.1:                               ## @.str.1
	.asciz	"Failed to initialize firmware starting DVB feed\n"

	.comm	_CX18_REG_DMUX_NUM_PORT_0_CONTROL,4,2 ## @CX18_REG_DMUX_NUM_PORT_0_CONTROL
L_.str.2:                               ## @.str.2
	.asciz	"Starting Transport DMA\n"

	.comm	_CX18_F_S_STREAMING,4,2         ## @CX18_F_S_STREAMING
L_.str.3:                               ## @.str.3
	.asciz	"Failed to start Transport DMA\n"

	.no_dead_strip	_cx18_dvb_start_feed
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function cx18_dvb_start_feed
_cx18_dvb_start_feed:                   ; @cx18_dvb_start_feed
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #80
	.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
	ldr	x22, [x0, #8]
	ldr	x19, [x22, #8]
	cbz	x19, LBB0_8
; %bb.1:
	ldr	x20, [x19, #16]
	ldp	w9, w8, [x0]
	stp	x8, x9, [sp]
Lloh0:
	adrp	x0, l_.str@PAGE
Lloh1:
	add	x0, x0, l_.str@PAGEOFF
	bl	_CX18_DEBUG_INFO
	mov	x0, x20
	bl	_mutex_lock
	mov	x0, x20
	bl	_cx18_init_on_first_open
	mov	x21, x0
	mov	x0, x20
	bl	_mutex_unlock
	cbz	w21, LBB0_3
; %bb.2:
Lloh2:
	adrp	x0, l_.str.1@PAGE
Lloh3:
	add	x0, x0, l_.str.1@PAGEOFF
	bl	_CX18_ERR
	b	LBB0_14
LBB0_3:
	ldr	x8, [x20, #8]
	ldr	w8, [x8]
	sub	w8, w8, #130
	cmp	w8, #2
	b.hi	LBB0_5
; %bb.4:
Lloh4:
	adrp	x21, _CX18_REG_DMUX_NUM_PORT_0_CONTROL@GOTPAGE
Lloh5:
	ldr	x21, [x21, _CX18_REG_DMUX_NUM_PORT_0_CONTROL@GOTPAGEOFF]
	ldr	w1, [x21]
	mov	x0, x20
	bl	_cx18_read_reg
	mov	w8, #8192
	movk	w8, #79, lsl #16
	orr	w1, w0, w8
	ldr	w2, [x21]
	mov	x0, x20
	bl	_cx18_write_reg
LBB0_5:
	ldr	w8, [x22]
	cbz	w8, LBB0_8
; %bb.6:
	ldr	x8, [x19]
	add	x0, x8, #8
	bl	_mutex_lock
	ldr	x8, [x19]
	ldr	x9, [x8]
	add	x10, x9, #1
	str	x10, [x8]
	cbz	x9, LBB0_9
; %bb.7:
	mov	w21, #0
	b	LBB0_13
LBB0_8:
Lloh6:
	adrp	x8, _EINVAL@GOTPAGE
Lloh7:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
Lloh8:
	ldr	w8, [x8]
	neg	w21, w8
	b	LBB0_14
LBB0_9:
Lloh9:
	adrp	x0, l_.str.2@PAGE
Lloh10:
	add	x0, x0, l_.str.2@PAGEOFF
	bl	_CX18_DEBUG_INFO
	mov	x0, x20
	bl	_mutex_lock
Lloh11:
	adrp	x23, _CX18_F_S_STREAMING@GOTPAGE
Lloh12:
	ldr	x23, [x23, _CX18_F_S_STREAMING@GOTPAGEOFF]
	ldr	w0, [x23]
	add	x22, x19, #8
	mov	x1, x22
	bl	_set_bit
	mov	x0, x19
	bl	_cx18_start_v4l2_encode_stream
	mov	x21, x0
	tbz	w0, #31, LBB0_12
; %bb.10:
Lloh13:
	adrp	x0, l_.str.3@PAGE
Lloh14:
	add	x0, x0, l_.str.3@PAGEOFF
	bl	_CX18_DEBUG_INFO
	ldr	x8, [x19]
	ldr	x9, [x8]
	subs	x9, x9, #1
	str	x9, [x8]
	b.ne	LBB0_12
; %bb.11:
	ldr	w0, [x23]
	mov	x1, x22
	bl	_clear_bit
LBB0_12:
	mov	x0, x20
	bl	_mutex_unlock
	ldr	x8, [x19]
LBB0_13:
	add	x0, x8, #8
	bl	_mutex_unlock
LBB0_14:
	mov	x0, x21
	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
	add	sp, sp, #80
	ret
	.loh AdrpAdd	Lloh0, Lloh1
	.loh AdrpAdd	Lloh2, Lloh3
	.loh AdrpLdrGot	Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGot	Lloh11, Lloh12
	.loh AdrpAdd	Lloh9, Lloh10
	.loh AdrpAdd	Lloh13, Lloh14
	.cfi_endproc
                                        ; -- End function
	.comm	_EINVAL,4,2                     ; @EINVAL
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Start feed: pid = 0x%x index = %d\n"

l_.str.1:                               ; @.str.1
	.asciz	"Failed to initialize firmware starting DVB feed\n"

	.comm	_CX18_REG_DMUX_NUM_PORT_0_CONTROL,4,2 ; @CX18_REG_DMUX_NUM_PORT_0_CONTROL
l_.str.2:                               ; @.str.2
	.asciz	"Starting Transport DMA\n"

	.comm	_CX18_F_S_STREAMING,4,2         ; @CX18_F_S_STREAMING
l_.str.3:                               ; @.str.3
	.asciz	"Failed to start Transport DMA\n"

	.no_dead_strip	_cx18_dvb_start_feed
.subsections_via_symbols
