	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function ivtv_setup_v4l2_decode_stream
_ivtv_setup_v4l2_decode_stream:         ## @ivtv_setup_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
	subq	$24, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdi, %r12
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	%rax, -48(%rbp)
	movq	_CX2341X_MBOX_MAX_DATA@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	shlq	$2, %rax
	callq	____chkstk_darwin
	addq	$15, %rax
	andq	$-16, %rax
	subq	%rax, %rsp
	movq	%rsp, %r14
	cmpq	$0, 8(%r12)
	je	LBB0_1
## %bb.2:
	movq	16(%r12), %rbx
	leaq	L_.str(%rip), %rdi
	xorl	%r15d, %r15d
	xorl	%eax, %eax
	callq	_IVTV_DEBUG_INFO
	movl	(%rbx), %eax
	movl	%eax, -52(%rbp)                 ## 4-byte Spill
	movl	4(%rbx), %eax
	movl	%eax, -56(%rbp)                 ## 4-byte Spill
	movq	_CX2341X_DEC_SET_AUDIO_MODE@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movl	28(%rbx), %ecx
	movl	24(%rbx), %r8d
	movq	%rbx, %rdi
	movl	$2, %edx
	xorl	%eax, %eax
	callq	_ivtv_vapi
	movq	_CX2341X_DEC_SET_DISPLAY_BUFFERS@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movl	$1, %r13d
	movq	%rbx, %rdi
	movl	$1, %edx
	xorl	%ecx, %ecx
	xorl	%eax, %eax
	callq	_ivtv_vapi
	movq	_CX2341X_DEC_SET_PREBUFFERING@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%rbx, %rdi
	movl	$1, %edx
	movl	$1, %ecx
	xorl	%eax, %eax
	callq	_ivtv_vapi
	movq	_CX2341X_DEC_EXTRACT_VBI@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	%rbx, %rdi
	movq	%r14, %rsi
	movl	$1, %ecx
	movl	$1, %r8d
	callq	_ivtv_vapi_result
	movl	(%r14), %esi
	movl	%esi, 20(%rbx)
	movl	4(%r14), %edx
	leaq	L_.str.1(%rip), %rdi
	xorl	%eax, %eax
	callq	_IVTV_DEBUG_INFO
	cmpl	$128, (%r12)
	jne	LBB0_3
## %bb.4:
	movl	16(%rbx), %eax
	movq	_OUT_PASSTHROUGH@GOTPCREL(%rip), %rcx
	cmpl	(%rcx), %eax
	movl	-56(%rbp), %r14d                ## 4-byte Reload
	movl	-52(%rbp), %r12d                ## 4-byte Reload
	je	LBB0_6
## %bb.5:
	cmpl	$0, 12(%rbx)
	movl	$480, %eax                      ## imm = 0x1E0
	movl	$576, %r14d                     ## imm = 0x240
	cmovel	%eax, %r14d
	movl	$720, %r12d                     ## imm = 0x2D0
	movl	$2, %r13d
LBB0_6:
	leaq	L_.str.2(%rip), %rdi
	movl	%r13d, %esi
	xorl	%eax, %eax
	callq	_IVTV_DEBUG_INFO
	movl	%r13d, %r15d
	jmp	LBB0_7
LBB0_1:
	movq	_EINVAL@GOTPCREL(%rip), %rcx
	xorl	%eax, %eax
	subl	(%rcx), %eax
	jmp	LBB0_10
LBB0_3:
	movl	-56(%rbp), %r14d                ## 4-byte Reload
	movl	-52(%rbp), %r12d                ## 4-byte Reload
LBB0_7:
	movq	_CX2341X_DEC_SET_DECODER_SOURCE@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movl	8(%rbx), %r10d
	subq	$8, %rsp
	movq	%rbx, %rdi
	movl	$4, %edx
	movl	%r15d, %ecx
	movl	%r12d, %r8d
	movl	%r14d, %r9d
	xorl	%eax, %eax
	pushq	%r10
	callq	_ivtv_vapi
	addq	$16, %rsp
	testq	%rax, %rax
	je	LBB0_9
## %bb.8:
	leaq	L_.str.3(%rip), %rdi
	callq	_IVTV_DEBUG_WARN
LBB0_9:
	movl	$10, %edi
	xorl	%esi, %esi
	callq	_ivtv_msleep_timeout
	leaq	L_.str.4(%rip), %rsi
	movq	%rbx, %rdi
	callq	_ivtv_firmware_check
LBB0_10:
	movq	___stack_chk_guard@GOTPCREL(%rip), %rcx
	movq	(%rcx), %rcx
	cmpq	-48(%rbp), %rcx
	jne	LBB0_12
## %bb.11:
	leaq	-40(%rbp), %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_12:
	callq	___stack_chk_fail
	.cfi_endproc
                                        ## -- End function
	.comm	_CX2341X_MBOX_MAX_DATA,4,2      ## @CX2341X_MBOX_MAX_DATA
	.comm	_EINVAL,4,2                     ## @EINVAL
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Setting some initial decoder settings\n"

	.comm	_CX2341X_DEC_SET_AUDIO_MODE,4,2 ## @CX2341X_DEC_SET_AUDIO_MODE
	.comm	_CX2341X_DEC_SET_DISPLAY_BUFFERS,4,2 ## @CX2341X_DEC_SET_DISPLAY_BUFFERS
	.comm	_CX2341X_DEC_SET_PREBUFFERING,4,2 ## @CX2341X_DEC_SET_PREBUFFERING
	.comm	_CX2341X_DEC_EXTRACT_VBI,4,2    ## @CX2341X_DEC_EXTRACT_VBI
L_.str.1:                               ## @.str.1
	.asciz	"Decoder VBI RE-Insert start 0x%08x size 0x%08x\n"

	.comm	_OUT_PASSTHROUGH,4,2            ## @OUT_PASSTHROUGH
L_.str.2:                               ## @.str.2
	.asciz	"Setup DEC YUV Stream data[0] = %d\n"

	.comm	_CX2341X_DEC_SET_DECODER_SOURCE,4,2 ## @CX2341X_DEC_SET_DECODER_SOURCE
L_.str.3:                               ## @.str.3
	.asciz	"Couldn't initialize decoder source\n"

L_.str.4:                               ## @.str.4
	.asciz	"ivtv_setup_v4l2_decode_stream"

	.no_dead_strip	_ivtv_setup_v4l2_decode_stream
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function ivtv_setup_v4l2_decode_stream
_ivtv_setup_v4l2_decode_stream:         ; @ivtv_setup_v4l2_decode_stream
	.cfi_startproc
; %bb.0:
	stp	x24, x23, [sp, #-64]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 64
	stp	x22, x21, [sp, #16]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #32]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #48]             ; 16-byte Folded Spill
	add	x29, sp, #48
	.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
	sub	sp, sp, #16
	mov	x20, x0
Lloh0:
	adrp	x8, ___stack_chk_guard@GOTPAGE
Lloh1:
	ldr	x8, [x8, ___stack_chk_guard@GOTPAGEOFF]
Lloh2:
	ldr	x8, [x8]
	stur	x8, [x29, #-56]
Lloh3:
	adrp	x8, _CX2341X_MBOX_MAX_DATA@GOTPAGE
Lloh4:
	ldr	x8, [x8, _CX2341X_MBOX_MAX_DATA@GOTPAGEOFF]
Lloh5:
	ldr	w8, [x8]
	lsl	x8, x8, #2
	mov	x9, x8
Lloh6:
	adrp	x16, ___chkstk_darwin@GOTPAGE
Lloh7:
	ldr	x16, [x16, ___chkstk_darwin@GOTPAGEOFF]
	blr	x16
	mov	x9, sp
	add	x8, x8, #15
	and	x8, x8, #0x7fffffff0
	sub	x21, x9, x8
	mov	sp, x21
	ldr	x8, [x0, #8]
	cbz	x8, LBB0_4
; %bb.1:
	ldr	x19, [x20, #16]
Lloh8:
	adrp	x0, l_.str@PAGE
Lloh9:
	add	x0, x0, l_.str@PAGEOFF
	bl	_IVTV_DEBUG_INFO
	ldp	w22, w23, [x19]
Lloh10:
	adrp	x8, _CX2341X_DEC_SET_AUDIO_MODE@GOTPAGE
Lloh11:
	ldr	x8, [x8, _CX2341X_DEC_SET_AUDIO_MODE@GOTPAGEOFF]
Lloh12:
	ldr	w1, [x8]
	ldp	w8, w3, [x19, #24]
	str	x8, [sp, #-16]!
	mov	x0, x19
	mov	w2, #2
	bl	_ivtv_vapi
	add	sp, sp, #16
Lloh13:
	adrp	x8, _CX2341X_DEC_SET_DISPLAY_BUFFERS@GOTPAGE
Lloh14:
	ldr	x8, [x8, _CX2341X_DEC_SET_DISPLAY_BUFFERS@GOTPAGEOFF]
Lloh15:
	ldr	w1, [x8]
	mov	x0, x19
	mov	w2, #1
	mov	w3, #0
	bl	_ivtv_vapi
Lloh16:
	adrp	x8, _CX2341X_DEC_SET_PREBUFFERING@GOTPAGE
Lloh17:
	ldr	x8, [x8, _CX2341X_DEC_SET_PREBUFFERING@GOTPAGEOFF]
Lloh18:
	ldr	w1, [x8]
	mov	x0, x19
	mov	w2, #1
	mov	w3, #1
	bl	_ivtv_vapi
Lloh19:
	adrp	x8, _CX2341X_DEC_EXTRACT_VBI@GOTPAGE
Lloh20:
	ldr	x8, [x8, _CX2341X_DEC_EXTRACT_VBI@GOTPAGEOFF]
Lloh21:
	ldr	w2, [x8]
	mov	x0, x19
	mov	x1, x21
	mov	w3, #1
	mov	w4, #1
	bl	_ivtv_vapi_result
	ldp	w8, w9, [x21]
	str	w8, [x19, #20]
	stp	x8, x9, [sp, #-16]!
Lloh22:
	adrp	x0, l_.str.1@PAGE
Lloh23:
	add	x0, x0, l_.str.1@PAGEOFF
	bl	_IVTV_DEBUG_INFO
	add	sp, sp, #16
	ldr	w8, [x20]
	cmp	w8, #128
	b.ne	LBB0_5
; %bb.2:
	ldr	w8, [x19, #16]
Lloh24:
	adrp	x9, _OUT_PASSTHROUGH@GOTPAGE
Lloh25:
	ldr	x9, [x9, _OUT_PASSTHROUGH@GOTPAGEOFF]
Lloh26:
	ldr	w9, [x9]
	cmp	w8, w9
	b.ne	LBB0_6
; %bb.3:
	mov	w21, #1
	b	LBB0_7
LBB0_4:
Lloh27:
	adrp	x8, _EINVAL@GOTPAGE
Lloh28:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
Lloh29:
	ldr	w8, [x8]
	neg	w0, w8
	b	LBB0_11
LBB0_5:
	mov	w21, #0
	b	LBB0_8
LBB0_6:
	mov	w8, #576
	mov	w9, #480
	ldr	w10, [x19, #12]
	cmp	w10, #0
	csel	w23, w9, w8, eq
	mov	w22, #720
	mov	w21, #2
LBB0_7:
	str	x21, [sp, #-16]!
Lloh30:
	adrp	x0, l_.str.2@PAGE
Lloh31:
	add	x0, x0, l_.str.2@PAGEOFF
	bl	_IVTV_DEBUG_INFO
	add	sp, sp, #16
LBB0_8:
Lloh32:
	adrp	x8, _CX2341X_DEC_SET_DECODER_SOURCE@GOTPAGE
Lloh33:
	ldr	x8, [x8, _CX2341X_DEC_SET_DECODER_SOURCE@GOTPAGEOFF]
Lloh34:
	ldr	w1, [x8]
	ldr	w8, [x19, #8]
	sub	sp, sp, #32
	stp	x23, x8, [sp, #8]
	str	x22, [sp]
	mov	x0, x19
	mov	w2, #4
	mov	x3, x21
	bl	_ivtv_vapi
	add	sp, sp, #32
	cbz	x0, LBB0_10
; %bb.9:
Lloh35:
	adrp	x0, l_.str.3@PAGE
Lloh36:
	add	x0, x0, l_.str.3@PAGEOFF
	bl	_IVTV_DEBUG_WARN
LBB0_10:
	mov	w0, #10
	mov	w1, #0
	bl	_ivtv_msleep_timeout
Lloh37:
	adrp	x1, l_.str.4@PAGE
Lloh38:
	add	x1, x1, l_.str.4@PAGEOFF
	mov	x0, x19
	bl	_ivtv_firmware_check
LBB0_11:
	ldur	x8, [x29, #-56]
Lloh39:
	adrp	x9, ___stack_chk_guard@GOTPAGE
Lloh40:
	ldr	x9, [x9, ___stack_chk_guard@GOTPAGEOFF]
Lloh41:
	ldr	x9, [x9]
	cmp	x9, x8
	b.ne	LBB0_13
; %bb.12:
	sub	sp, x29, #48
	ldp	x29, x30, [sp, #48]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #32]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #16]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp], #64             ; 16-byte Folded Reload
	ret
LBB0_13:
	bl	___stack_chk_fail
	.loh AdrpLdrGot	Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpAdd	Lloh22, Lloh23
	.loh AdrpLdrGotLdr	Lloh19, Lloh20, Lloh21
	.loh AdrpLdrGotLdr	Lloh16, Lloh17, Lloh18
	.loh AdrpLdrGotLdr	Lloh13, Lloh14, Lloh15
	.loh AdrpLdrGotLdr	Lloh10, Lloh11, Lloh12
	.loh AdrpAdd	Lloh8, Lloh9
	.loh AdrpLdrGotLdr	Lloh24, Lloh25, Lloh26
	.loh AdrpLdrGotLdr	Lloh27, Lloh28, Lloh29
	.loh AdrpAdd	Lloh30, Lloh31
	.loh AdrpLdrGotLdr	Lloh32, Lloh33, Lloh34
	.loh AdrpAdd	Lloh35, Lloh36
	.loh AdrpAdd	Lloh37, Lloh38
	.loh AdrpLdrGotLdr	Lloh39, Lloh40, Lloh41
	.cfi_endproc
                                        ; -- End function
	.comm	_CX2341X_MBOX_MAX_DATA,4,2      ; @CX2341X_MBOX_MAX_DATA
	.comm	_EINVAL,4,2                     ; @EINVAL
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Setting some initial decoder settings\n"

	.comm	_CX2341X_DEC_SET_AUDIO_MODE,4,2 ; @CX2341X_DEC_SET_AUDIO_MODE
	.comm	_CX2341X_DEC_SET_DISPLAY_BUFFERS,4,2 ; @CX2341X_DEC_SET_DISPLAY_BUFFERS
	.comm	_CX2341X_DEC_SET_PREBUFFERING,4,2 ; @CX2341X_DEC_SET_PREBUFFERING
	.comm	_CX2341X_DEC_EXTRACT_VBI,4,2    ; @CX2341X_DEC_EXTRACT_VBI
l_.str.1:                               ; @.str.1
	.asciz	"Decoder VBI RE-Insert start 0x%08x size 0x%08x\n"

	.comm	_OUT_PASSTHROUGH,4,2            ; @OUT_PASSTHROUGH
l_.str.2:                               ; @.str.2
	.asciz	"Setup DEC YUV Stream data[0] = %d\n"

	.comm	_CX2341X_DEC_SET_DECODER_SOURCE,4,2 ; @CX2341X_DEC_SET_DECODER_SOURCE
l_.str.3:                               ; @.str.3
	.asciz	"Couldn't initialize decoder source\n"

l_.str.4:                               ; @.str.4
	.asciz	"ivtv_setup_v4l2_decode_stream"

	.no_dead_strip	_ivtv_setup_v4l2_decode_stream
.subsections_via_symbols
