	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function ivtv_vbi_setup
_ivtv_vbi_setup:                        ## @ivtv_vbi_setup
	.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, %r12
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	%rax, -48(%rbp)
	callq	_ivtv_raw_vbi
	movl	%eax, %r15d
	movq	_CX2341X_MBOX_MAX_DATA@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	shlq	$3, %rax
	callq	____chkstk_darwin
	addq	$15, %rax
	andq	$-16, %rax
	subq	%rax, %rsp
	movq	%rsp, %r14
	movq	_CX2341X_ENC_SET_VBI_LINE@GOTPCREL(%rip), %r13
	movl	(%r13), %esi
	movq	%r12, %rdi
	movl	$5, %edx
	movl	$65535, %ecx                    ## imm = 0xFFFF
	xorl	%r8d, %r8d
	xorl	%r9d, %r9d
	pushq	$0
	pushq	$0
	callq	_ivtv_vapi
	addq	$16, %rsp
	movl	56(%r12), %edi
	movq	_vbi@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	testl	%r15d, %r15d
	je	LBB0_2
## %bb.1:
	movq	_s_raw_fmt@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	leaq	52(%r12), %rcx
	callq	_v4l2_subdev_call
	movl	16(%r12), %edi
	addl	%edi, %edi
	jmp	LBB0_5
LBB0_2:
	movq	_s_sliced_fmt@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	leaq	48(%r12), %rcx
	callq	_v4l2_subdev_call
	cmpq	$0, 8(%r12)
	je	LBB0_3
## %bb.4:
	movq	_IVTV_HW_CX25840@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	xorl	%ecx, %ecx
	testl	%eax, (%r12)
	setne	%cl
	leal	(%rcx,%rcx), %edi
	addl	$24, %edi
	jmp	LBB0_5
LBB0_3:
	movl	$38, %edi
LBB0_5:
	xorl	%eax, %eax
	testl	%r15d, %r15d
	sete	%al
	movslq	24(%r12,%rax,4), %r9
	movl	%r9d, %ecx
	imull	%edi, %ecx
	movl	%r15d, %eax
	orl	$48386, %eax                    ## imm = 0xBD02
	movl	%ecx, 20(%r12)
	movslq	%eax, %rsi
	movq	%rsi, (%r14)
	movq	$1, 8(%r14)
	testl	%r15d, %r15d
	je	LBB0_6
## %bb.8:
	movq	$4, 16(%r14)
	movq	_IVTV_HW_CX25840@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	testl	%eax, (%r12)
	je	LBB0_10
## %bb.9:
	movq	$543170656, 24(%r14)            ## imm = 0x20602060
	movl	$4, %ecx
	movl	$812658800, %ebx                ## imm = 0x30703070
	jmp	LBB0_12
LBB0_6:
	movl	$2699075808, %ebx               ## imm = 0xA0E0A0E0
	movl	24(%r12), %eax
	cltd
	idivl	%ecx
	shll	$2, %eax
	movslq	%eax, %rcx
	movq	%rcx, 16(%r14)
	movq	_IVTV_HW_CX25840@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	testl	%eax, (%r12)
	je	LBB0_11
## %bb.7:
	leaq	269488144(%rbx), %rax
	movq	%rax, 24(%r14)
	jmp	LBB0_12
LBB0_10:
	movq	$623207010, 24(%r14)            ## imm = 0x25256262
	movl	$4, %ecx
	movl	$947879807, %ebx                ## imm = 0x387F7F7F
	jmp	LBB0_12
LBB0_11:
	leaq	181095436(%rbx), %rax
	movq	%rax, 24(%r14)
	addq	$370233617, %rbx                ## imm = 0x16115111
LBB0_12:
	movq	%rbx, 32(%r14)
	movslq	%edi, %r8
	movq	%r8, 40(%r14)
	movq	%r9, 48(%r14)
	leaq	L_.str(%rip), %rdi
	movl	$1, %edx
                                        ## kill: def $ecx killed $ecx killed $rcx
	xorl	%eax, %eax
	callq	_IVTV_DEBUG_INFO
	movq	_CX2341X_ENC_SET_VBI_CONFIG@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r12, %rdi
	movl	$7, %edx
	movq	%r14, %rcx
	callq	_ivtv_api
	movq	16(%r14), %rsi
	movq	%rsi, 40(%r12)
	movl	(%r14), %eax
	testl	%eax, %eax
	movl	$1, %ecx
	cmovnel	%eax, %ecx
	movl	%ecx, 32(%r12)
	movq	8(%r14), %rdx
	leaq	L_.str.1(%rip), %rdi
	xorl	%eax, %eax
	callq	_IVTV_DEBUG_INFO
	movl	$-8, %ebx
	.p2align	4, 0x90
LBB0_13:                                ## =>This Inner Loop Header: Depth=1
	xorl	%eax, %eax
	cmpl	$12, %ebx
	setb	%al
	leal	4(%rbx), %ecx
	xorl	%edx, %edx
	cmpl	$18, %ecx
	setb	%dl
	cmpq	$0, 8(%r12)
	cmovnel	%eax, %edx
	movzbl	%dl, %r14d
	movl	(%r13), %esi
	leal	9(%rbx), %r15d
	movq	%r12, %rdi
	movl	$5, %edx
	movl	%r15d, %ecx
	movl	%r14d, %r8d
	xorl	%r9d, %r9d
	pushq	$0
	pushq	$0
	callq	_ivtv_vapi
	addq	$16, %rsp
	movl	(%r13), %esi
	orl	$-2147483648, %r15d             ## imm = 0x80000000
	movq	%r12, %rdi
	movl	$5, %edx
	movl	%r15d, %ecx
	movl	%r14d, %r8d
	xorl	%r9d, %r9d
	pushq	$0
	pushq	$0
	callq	_ivtv_vapi
	addq	$16, %rsp
	incl	%ebx
	cmpl	$15, %ebx
	jne	LBB0_13
## %bb.14:
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	cmpq	-48(%rbp), %rax
	jne	LBB0_16
## %bb.15:
	leaq	-40(%rbp), %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_16:
	callq	___stack_chk_fail
	.cfi_endproc
                                        ## -- End function
	.comm	_CX2341X_MBOX_MAX_DATA,4,2      ## @CX2341X_MBOX_MAX_DATA
	.comm	_CX2341X_ENC_SET_VBI_LINE,4,2   ## @CX2341X_ENC_SET_VBI_LINE
	.comm	_vbi,4,2                        ## @vbi
	.comm	_s_raw_fmt,4,2                  ## @s_raw_fmt
	.comm	_s_sliced_fmt,4,2               ## @s_sliced_fmt
	.comm	_IVTV_HW_CX25840,4,2            ## @IVTV_HW_CX25840
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Setup VBI API header 0x%08x pkts %d buffs %d ln %d sz %d\n"

	.comm	_CX2341X_ENC_SET_VBI_CONFIG,4,2 ## @CX2341X_ENC_SET_VBI_CONFIG
L_.str.1:                               ## @.str.1
	.asciz	"Setup VBI start 0x%08x frames %d fpi %d\n"

	.no_dead_strip	_ivtv_vbi_setup
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function ivtv_vbi_setup
_ivtv_vbi_setup:                        ; @ivtv_vbi_setup
	.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	x19, x0
Lloh0:
	adrp	x8, ___stack_chk_guard@GOTPAGE
Lloh1:
	ldr	x8, [x8, ___stack_chk_guard@GOTPAGEOFF]
Lloh2:
	ldr	x8, [x8]
	stur	x8, [x29, #-56]
	bl	_ivtv_raw_vbi
	mov	x21, x0
Lloh3:
	adrp	x8, _CX2341X_MBOX_MAX_DATA@GOTPAGE
Lloh4:
	ldr	x8, [x8, _CX2341X_MBOX_MAX_DATA@GOTPAGEOFF]
Lloh5:
	ldr	w8, [x8]
	lsl	x8, x8, #3
	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, #0xffffffff0
	sub	x20, x9, x8
	mov	sp, x20
Lloh8:
	adrp	x22, _CX2341X_ENC_SET_VBI_LINE@GOTPAGE
Lloh9:
	ldr	x22, [x22, _CX2341X_ENC_SET_VBI_LINE@GOTPAGEOFF]
	ldr	w1, [x22]
	mov	x0, x19
	mov	w2, #5
	mov	w3, #65535
	mov	w4, #0
	mov	w5, #0
	mov	w6, #0
	mov	w7, #0
	bl	_ivtv_vapi
	ldr	w0, [x19, #56]
Lloh10:
	adrp	x8, _vbi@GOTPAGE
Lloh11:
	ldr	x8, [x8, _vbi@GOTPAGEOFF]
Lloh12:
	ldr	w1, [x8]
	cbz	w21, LBB0_2
; %bb.1:
Lloh13:
	adrp	x8, _s_raw_fmt@GOTPAGE
Lloh14:
	ldr	x8, [x8, _s_raw_fmt@GOTPAGEOFF]
Lloh15:
	ldr	w2, [x8]
	add	x3, x19, #52
	bl	_v4l2_subdev_call
	ldr	w8, [x19, #16]
	lsl	w8, w8, #1
	b	LBB0_5
LBB0_2:
Lloh16:
	adrp	x8, _s_sliced_fmt@GOTPAGE
Lloh17:
	ldr	x8, [x8, _s_sliced_fmt@GOTPAGEOFF]
Lloh18:
	ldr	w2, [x8]
	add	x3, x19, #48
	bl	_v4l2_subdev_call
	ldr	x8, [x19, #8]
	cbz	x8, LBB0_4
; %bb.3:
Lloh19:
	adrp	x8, _IVTV_HW_CX25840@GOTPAGE
Lloh20:
	ldr	x8, [x8, _IVTV_HW_CX25840@GOTPAGEOFF]
	ldr	w9, [x19]
Lloh21:
	ldr	w8, [x8]
	tst	w8, w9
	mov	w8, #26
	mov	w9, #24
	csel	w8, w9, w8, eq
	b	LBB0_5
LBB0_4:
	mov	w8, #38
LBB0_5:
	cmp	w21, #0
	mov	w9, #24
	mov	w10, #28
	csel	x9, x10, x9, eq
	ldrsw	x9, [x19, x9]
	mul	w10, w9, w8
	str	w10, [x19, #20]
	mov	w11, #48386
	orr	w11, w21, w11
	sxtw	x1, w11
	mov	w11, #1
	stp	x1, x11, [x20]
	cbz	w21, LBB0_8
; %bb.6:
	mov	w10, #4
	str	x10, [x20, #16]
	ldr	w10, [x19]
Lloh22:
	adrp	x11, _IVTV_HW_CX25840@GOTPAGE
Lloh23:
	ldr	x11, [x11, _IVTV_HW_CX25840@GOTPAGEOFF]
Lloh24:
	ldr	w11, [x11]
	tst	w11, w10
	b.eq	LBB0_10
; %bb.7:
	mov	w10, #8288
	movk	w10, #8288, lsl #16
	str	x10, [x20, #24]
	mov	w3, #4
	mov	w10, #12400
	movk	w10, #12400, lsl #16
	b	LBB0_12
LBB0_8:
	ldr	w11, [x19, #24]
	sdiv	w10, w11, w10
	lsl	w10, w10, #2
	sxtw	x3, w10
	str	x3, [x20, #16]
	ldr	w10, [x19]
Lloh25:
	adrp	x11, _IVTV_HW_CX25840@GOTPAGE
Lloh26:
	ldr	x11, [x11, _IVTV_HW_CX25840@GOTPAGEOFF]
Lloh27:
	ldr	w11, [x11]
	tst	w11, w10
	b.eq	LBB0_11
; %bb.9:
	mov	w10, #45296
	movk	w10, #45296, lsl #16
	str	x10, [x20, #24]
	mov	w10, #41184
	movk	w10, #41184, lsl #16
	b	LBB0_12
LBB0_10:
	mov	w10, #25186
	movk	w10, #9509, lsl #16
	str	x10, [x20, #24]
	mov	w3, #4
	mov	w10, #32639
	movk	w10, #14463, lsl #16
	b	LBB0_12
LBB0_11:
	mov	w10, #60652
	movk	w10, #43947, lsl #16
	str	x10, [x20, #24]
	mov	w10, #61937
	movk	w10, #46833, lsl #16
LBB0_12:
	sxtw	x8, w8
	stp	x10, x8, [x20, #32]
	str	x9, [x20, #48]
	stp	x8, x9, [sp, #-16]!
Lloh28:
	adrp	x0, l_.str@PAGE
Lloh29:
	add	x0, x0, l_.str@PAGEOFF
	mov	w2, #1
                                        ; kill: def $w3 killed $w3 killed $x3
	bl	_IVTV_DEBUG_INFO
	add	sp, sp, #16
Lloh30:
	adrp	x8, _CX2341X_ENC_SET_VBI_CONFIG@GOTPAGE
Lloh31:
	ldr	x8, [x8, _CX2341X_ENC_SET_VBI_CONFIG@GOTPAGEOFF]
Lloh32:
	ldr	w1, [x8]
	mov	x0, x19
	mov	w2, #7
	mov	x3, x20
	bl	_ivtv_api
	ldp	x2, x1, [x20, #8]
	str	x1, [x19, #40]
	ldr	w8, [x20]
	cmp	w8, #0
	csinc	w3, w8, wzr, ne
	str	w3, [x19, #32]
Lloh33:
	adrp	x0, l_.str.1@PAGE
Lloh34:
	add	x0, x0, l_.str.1@PAGEOFF
	bl	_IVTV_DEBUG_INFO
	mov	w23, #-8
LBB0_13:                                ; =>This Inner Loop Header: Depth=1
	ldr	x8, [x19, #8]
	cmp	w23, #12
	cset	w9, lo
	add	w10, w23, #4
	cmp	w10, #18
	cset	w10, lo
	cmp	x8, #0
	csel	w20, w10, w9, eq
	ldr	w1, [x22]
	add	w21, w23, #9
	mov	x0, x19
	mov	w2, #5
	mov	x3, x21
	mov	x4, x20
	mov	w5, #0
	mov	w6, #0
	mov	w7, #0
	bl	_ivtv_vapi
	ldr	w1, [x22]
	orr	w3, w21, #0x80000000
	mov	x0, x19
	mov	w2, #5
	mov	x4, x20
	mov	w5, #0
	mov	w6, #0
	mov	w7, #0
	bl	_ivtv_vapi
	add	w23, w23, #1
	cmp	w23, #15
	b.ne	LBB0_13
; %bb.14:
	ldur	x8, [x29, #-56]
Lloh35:
	adrp	x9, ___stack_chk_guard@GOTPAGE
Lloh36:
	ldr	x9, [x9, ___stack_chk_guard@GOTPAGEOFF]
Lloh37:
	ldr	x9, [x9]
	cmp	x9, x8
	b.ne	LBB0_16
; %bb.15:
	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_16:
	bl	___stack_chk_fail
	.loh AdrpLdrGotLdr	Lloh10, Lloh11, Lloh12
	.loh AdrpLdrGot	Lloh8, Lloh9
	.loh AdrpLdrGot	Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh13, Lloh14, Lloh15
	.loh AdrpLdrGotLdr	Lloh16, Lloh17, Lloh18
	.loh AdrpLdrGotLdr	Lloh19, Lloh20, Lloh21
	.loh AdrpLdrGotLdr	Lloh22, Lloh23, Lloh24
	.loh AdrpLdrGotLdr	Lloh25, Lloh26, Lloh27
	.loh AdrpAdd	Lloh33, Lloh34
	.loh AdrpLdrGotLdr	Lloh30, Lloh31, Lloh32
	.loh AdrpAdd	Lloh28, Lloh29
	.loh AdrpLdrGotLdr	Lloh35, Lloh36, Lloh37
	.cfi_endproc
                                        ; -- End function
	.comm	_CX2341X_MBOX_MAX_DATA,4,2      ; @CX2341X_MBOX_MAX_DATA
	.comm	_CX2341X_ENC_SET_VBI_LINE,4,2   ; @CX2341X_ENC_SET_VBI_LINE
	.comm	_vbi,4,2                        ; @vbi
	.comm	_s_raw_fmt,4,2                  ; @s_raw_fmt
	.comm	_s_sliced_fmt,4,2               ; @s_sliced_fmt
	.comm	_IVTV_HW_CX25840,4,2            ; @IVTV_HW_CX25840
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Setup VBI API header 0x%08x pkts %d buffs %d ln %d sz %d\n"

	.comm	_CX2341X_ENC_SET_VBI_CONFIG,4,2 ; @CX2341X_ENC_SET_VBI_CONFIG
l_.str.1:                               ; @.str.1
	.asciz	"Setup VBI start 0x%08x frames %d fpi %d\n"

	.no_dead_strip	_ivtv_vbi_setup
.subsections_via_symbols
