	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function cx18_setup_vbi_fmt
_cx18_setup_vbi_fmt:                    ## @cx18_setup_vbi_fmt
	.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	_V4L2_CAP_SLICED_VBI_CAPTURE@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	testl	%eax, (%rdi)
	je	LBB0_1
## %bb.3:
	movl	%edx, %ebx
	movl	%esi, %r14d
	movq	%rdi, %r15
	addq	$40, %rdi
	callq	_atomic_read
	testq	%rax, %rax
	jle	LBB0_5
## %bb.4:
	movq	_EBUSY@GOTPCREL(%rip), %rax
	jmp	LBB0_2
LBB0_1:
	movq	_EINVAL@GOTPCREL(%rip), %rax
LBB0_2:
	xorl	%ebx, %ebx
	subl	(%rax), %ebx
LBB0_24:
	movl	%ebx, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_5:
	movq	_V4L2_MPEG_STREAM_VBI_FMT_IVTV@GOTPCREL(%rip), %rax
	cmpl	%r14d, (%rax)
	jne	LBB0_9
## %bb.6:
	movq	_V4L2_MPEG_STREAM_TYPE_MPEG2_PS@GOTPCREL(%rip), %rax
	cmpl	%ebx, (%rax)
	je	LBB0_10
## %bb.7:
	movq	_V4L2_MPEG_STREAM_TYPE_MPEG2_DVD@GOTPCREL(%rip), %rax
	cmpl	%ebx, (%rax)
	je	LBB0_10
## %bb.8:
	movq	_V4L2_MPEG_STREAM_TYPE_MPEG2_SVCD@GOTPCREL(%rip), %rax
	cmpl	%ebx, (%rax)
	je	LBB0_10
LBB0_9:
	movq	_V4L2_MPEG_STREAM_VBI_FMT_NONE@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, 8(%r15)
	leaq	L_.str(%rip), %rdi
	callq	_CX18_DEBUG_INFO
	xorl	%ebx, %ebx
	jmp	LBB0_24
LBB0_10:
	movq	24(%r15), %rax
	cmpq	$0, (%rax)
	jne	LBB0_19
## %bb.11:
	movq	_CX18_VBI_FRAMES@GOTPCREL(%rip), %rax
	cmpl	$0, (%rax)
	jle	LBB0_19
## %bb.12:
	xorl	%ebx, %ebx
	movq	_CX18_SLICED_MPEG_DATA_BUFSZ@GOTPCREL(%rip), %r13
	movq	_GFP_KERNEL@GOTPCREL(%rip), %r12
	.p2align	4, 0x90
LBB0_13:                                ## =>This Inner Loop Header: Depth=1
	movl	(%r13), %edi
	movl	(%r12), %esi
	callq	_kmalloc
	movq	24(%r15), %rcx
	movq	%rax, (%rcx,%rbx,8)
	movq	24(%r15), %rax
	cmpq	$0, (%rax,%rbx,8)
	je	LBB0_14
## %bb.18:                              ##   in Loop: Header=BB0_13 Depth=1
	incq	%rbx
	movq	_CX18_VBI_FRAMES@GOTPCREL(%rip), %rax
	movslq	(%rax), %rax
	cmpq	%rax, %rbx
	jl	LBB0_13
LBB0_19:
	movl	%r14d, 8(%r15)
	leaq	L_.str.2(%rip), %rdi
	callq	_CX18_DEBUG_INFO
	movq	16(%r15), %rdi
	callq	_cx18_get_service_set
	xorl	%ebx, %ebx
	testq	%rax, %rax
	jne	LBB0_24
## %bb.20:
	cmpq	$0, 32(%r15)
	jne	LBB0_21
## %bb.22:
	movq	_V4L2_SLICED_WSS_625@GOTPCREL(%rip), %rax
	jmp	LBB0_23
LBB0_14:
	testl	%ebx, %ebx
	je	LBB0_17
## %bb.15:
	movq	-8(%rax,%rbx,8), %rdi
	callq	_kfree
	movq	24(%r15), %rax
	movq	$0, -8(%rax,%rbx,8)
	cmpq	$2, %rbx
	jb	LBB0_17
LBB0_16:                                ## =>This Inner Loop Header: Depth=1
	movq	24(%r15), %rax
	movq	-16(%rax,%rbx,8), %rdi
	callq	_kfree
	movq	24(%r15), %rax
	movq	$0, -16(%rax,%rbx,8)
	decq	%rbx
	cmpq	$1, %rbx
	jg	LBB0_16
LBB0_17:
	movq	_V4L2_MPEG_STREAM_VBI_FMT_NONE@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, 8(%r15)
	leaq	L_.str.1(%rip), %rdi
	callq	_CX18_WARN
	movq	_ENOMEM@GOTPCREL(%rip), %rax
	jmp	LBB0_2
LBB0_21:
	movq	_V4L2_SLICED_CAPTION_525@GOTPCREL(%rip), %rax
LBB0_23:
	movl	(%rax), %eax
	movq	16(%r15), %rdi
	movl	%eax, (%rdi)
	movl	4(%r15), %esi
	callq	_cx18_expand_service_set
	jmp	LBB0_24
	.cfi_endproc
                                        ## -- End function
	.comm	_V4L2_CAP_SLICED_VBI_CAPTURE,4,2 ## @V4L2_CAP_SLICED_VBI_CAPTURE
	.comm	_EINVAL,4,2                     ## @EINVAL
	.comm	_EBUSY,4,2                      ## @EBUSY
	.comm	_V4L2_MPEG_STREAM_VBI_FMT_IVTV,4,2 ## @V4L2_MPEG_STREAM_VBI_FMT_IVTV
	.comm	_V4L2_MPEG_STREAM_TYPE_MPEG2_PS,4,2 ## @V4L2_MPEG_STREAM_TYPE_MPEG2_PS
	.comm	_V4L2_MPEG_STREAM_TYPE_MPEG2_DVD,4,2 ## @V4L2_MPEG_STREAM_TYPE_MPEG2_DVD
	.comm	_V4L2_MPEG_STREAM_TYPE_MPEG2_SVCD,4,2 ## @V4L2_MPEG_STREAM_TYPE_MPEG2_SVCD
	.comm	_V4L2_MPEG_STREAM_VBI_FMT_NONE,8,3 ## @V4L2_MPEG_STREAM_VBI_FMT_NONE
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"disabled insertion of sliced VBI data into the MPEG stream\n"

	.comm	_CX18_VBI_FRAMES,4,2            ## @CX18_VBI_FRAMES
	.comm	_CX18_SLICED_MPEG_DATA_BUFSZ,4,2 ## @CX18_SLICED_MPEG_DATA_BUFSZ
	.comm	_GFP_KERNEL,4,2                 ## @GFP_KERNEL
L_.str.1:                               ## @.str.1
	.asciz	"Unable to allocate buffers for sliced VBI data insertion\n"

	.comm	_ENOMEM,4,2                     ## @ENOMEM
L_.str.2:                               ## @.str.2
	.asciz	"enabled insertion of sliced VBI data into the MPEG PS,when sliced VBI is enabled\n"

	.comm	_V4L2_SLICED_CAPTION_525,4,2    ## @V4L2_SLICED_CAPTION_525
	.comm	_V4L2_SLICED_WSS_625,4,2        ## @V4L2_SLICED_WSS_625
	.no_dead_strip	_cx18_setup_vbi_fmt
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function cx18_setup_vbi_fmt
_cx18_setup_vbi_fmt:                    ; @cx18_setup_vbi_fmt
	.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
	ldr	w8, [x0]
Lloh0:
	adrp	x9, _V4L2_CAP_SLICED_VBI_CAPTURE@GOTPAGE
Lloh1:
	ldr	x9, [x9, _V4L2_CAP_SLICED_VBI_CAPTURE@GOTPAGEOFF]
Lloh2:
	ldr	w9, [x9]
	tst	w9, w8
	b.eq	LBB0_3
; %bb.1:
	mov	x21, x2
	mov	x20, x1
	mov	x19, x0
	add	x0, x0, #40
	bl	_atomic_read
	cmp	x0, #1
	b.lt	LBB0_5
; %bb.2:
Lloh3:
	adrp	x8, _EBUSY@GOTPAGE
Lloh4:
	ldr	x8, [x8, _EBUSY@GOTPAGEOFF]
	b	LBB0_4
LBB0_3:
Lloh5:
	adrp	x8, _EINVAL@GOTPAGE
Lloh6:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
LBB0_4:
	ldr	w8, [x8]
	neg	w0, w8
	b	LBB0_15
LBB0_5:
Lloh7:
	adrp	x8, _V4L2_MPEG_STREAM_VBI_FMT_IVTV@GOTPAGE
Lloh8:
	ldr	x8, [x8, _V4L2_MPEG_STREAM_VBI_FMT_IVTV@GOTPAGEOFF]
Lloh9:
	ldr	w8, [x8]
	cmp	w8, w20
	b.ne	LBB0_13
; %bb.6:
Lloh10:
	adrp	x8, _V4L2_MPEG_STREAM_TYPE_MPEG2_PS@GOTPAGE
Lloh11:
	ldr	x8, [x8, _V4L2_MPEG_STREAM_TYPE_MPEG2_PS@GOTPAGEOFF]
Lloh12:
	ldr	w8, [x8]
Lloh13:
	adrp	x9, _V4L2_MPEG_STREAM_TYPE_MPEG2_DVD@GOTPAGE
Lloh14:
	ldr	x9, [x9, _V4L2_MPEG_STREAM_TYPE_MPEG2_DVD@GOTPAGEOFF]
Lloh15:
	ldr	w9, [x9]
Lloh16:
	adrp	x10, _V4L2_MPEG_STREAM_TYPE_MPEG2_SVCD@GOTPAGE
Lloh17:
	ldr	x10, [x10, _V4L2_MPEG_STREAM_TYPE_MPEG2_SVCD@GOTPAGEOFF]
Lloh18:
	ldr	w10, [x10]
	cmp	w8, w21
	ccmp	w9, w21, #4, ne
	ccmp	w10, w21, #4, ne
	b.ne	LBB0_13
; %bb.7:
	ldr	x8, [x19, #24]
	ldr	x8, [x8]
Lloh19:
	adrp	x22, _CX18_VBI_FRAMES@GOTPAGE
Lloh20:
	ldr	x22, [x22, _CX18_VBI_FRAMES@GOTPAGEOFF]
	ldr	w9, [x22]
	cmp	x8, #0
	ccmp	w9, #1, #8, eq
	b.lt	LBB0_11
; %bb.8:
	mov	x21, #0
Lloh21:
	adrp	x23, _CX18_SLICED_MPEG_DATA_BUFSZ@GOTPAGE
Lloh22:
	ldr	x23, [x23, _CX18_SLICED_MPEG_DATA_BUFSZ@GOTPAGEOFF]
Lloh23:
	adrp	x24, _GFP_KERNEL@GOTPAGE
Lloh24:
	ldr	x24, [x24, _GFP_KERNEL@GOTPAGEOFF]
LBB0_9:                                 ; =>This Inner Loop Header: Depth=1
	ldr	w0, [x23]
	ldr	w1, [x24]
	bl	_kmalloc
	ldr	x8, [x19, #24]
	lsl	x25, x21, #3
	str	x0, [x8, x25]
	ldr	x8, [x19, #24]
	ldr	x9, [x8, x25]
	cbz	x9, LBB0_16
; %bb.10:                               ;   in Loop: Header=BB0_9 Depth=1
	add	x21, x21, #1
	ldrsw	x8, [x22]
	cmp	x21, x8
	b.lt	LBB0_9
LBB0_11:
	str	w20, [x19, #8]
Lloh25:
	adrp	x0, l_.str.2@PAGE
Lloh26:
	add	x0, x0, l_.str.2@PAGEOFF
	bl	_CX18_DEBUG_INFO
	ldr	x0, [x19, #16]
	bl	_cx18_get_service_set
	cbnz	x0, LBB0_14
; %bb.12:
	ldr	x8, [x19, #32]
Lloh27:
	adrp	x9, _V4L2_SLICED_WSS_625@GOTPAGE
Lloh28:
	ldr	x9, [x9, _V4L2_SLICED_WSS_625@GOTPAGEOFF]
Lloh29:
	adrp	x10, _V4L2_SLICED_CAPTION_525@GOTPAGE
Lloh30:
	ldr	x10, [x10, _V4L2_SLICED_CAPTION_525@GOTPAGEOFF]
	cmp	x8, #0
	csel	x8, x9, x10, eq
	ldr	w8, [x8]
	ldr	x0, [x19, #16]
	str	w8, [x0]
	ldr	w1, [x19, #4]
	bl	_cx18_expand_service_set
	b	LBB0_14
LBB0_13:
Lloh31:
	adrp	x8, _V4L2_MPEG_STREAM_VBI_FMT_NONE@GOTPAGE
Lloh32:
	ldr	x8, [x8, _V4L2_MPEG_STREAM_VBI_FMT_NONE@GOTPAGEOFF]
Lloh33:
	ldr	x8, [x8]
	str	w8, [x19, #8]
Lloh34:
	adrp	x0, l_.str@PAGE
Lloh35:
	add	x0, x0, l_.str@PAGEOFF
	bl	_CX18_DEBUG_INFO
LBB0_14:
	mov	w0, #0
LBB0_15:
	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_16:
	cbz	w21, LBB0_20
; %bb.17:
	add	x8, x8, x25
	ldur	x0, [x8, #-8]
	bl	_kfree
	ldr	x8, [x19, #24]
	add	x8, x8, x25
	stur	xzr, [x8, #-8]
	cmp	x21, #2
	b.lo	LBB0_20
; %bb.18:
	sub	x20, x21, #2
LBB0_19:                                ; =>This Inner Loop Header: Depth=1
	ldr	x8, [x19, #24]
	lsl	x21, x20, #3
	ldr	x0, [x8, x21]
	bl	_kfree
	ldr	x8, [x19, #24]
	str	xzr, [x8, x21]
	add	x8, x20, #1
	sub	x20, x20, #1
	cmp	x8, #1
	b.gt	LBB0_19
LBB0_20:
Lloh36:
	adrp	x8, _V4L2_MPEG_STREAM_VBI_FMT_NONE@GOTPAGE
Lloh37:
	ldr	x8, [x8, _V4L2_MPEG_STREAM_VBI_FMT_NONE@GOTPAGEOFF]
Lloh38:
	ldr	x8, [x8]
	str	w8, [x19, #8]
Lloh39:
	adrp	x0, l_.str.1@PAGE
Lloh40:
	add	x0, x0, l_.str.1@PAGEOFF
	bl	_CX18_WARN
Lloh41:
	adrp	x8, _ENOMEM@GOTPAGE
Lloh42:
	ldr	x8, [x8, _ENOMEM@GOTPAGEOFF]
	b	LBB0_4
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGot	Lloh3, Lloh4
	.loh AdrpLdrGot	Lloh5, Lloh6
	.loh AdrpLdrGotLdr	Lloh7, Lloh8, Lloh9
	.loh AdrpLdrGotLdr	Lloh16, Lloh17, Lloh18
	.loh AdrpLdrGotLdr	Lloh13, Lloh14, Lloh15
	.loh AdrpLdrGotLdr	Lloh10, Lloh11, Lloh12
	.loh AdrpLdrGot	Lloh19, Lloh20
	.loh AdrpLdrGot	Lloh23, Lloh24
	.loh AdrpLdrGot	Lloh21, Lloh22
	.loh AdrpAdd	Lloh25, Lloh26
	.loh AdrpLdrGot	Lloh29, Lloh30
	.loh AdrpLdrGot	Lloh27, Lloh28
	.loh AdrpAdd	Lloh34, Lloh35
	.loh AdrpLdrGotLdr	Lloh31, Lloh32, Lloh33
	.loh AdrpLdrGot	Lloh41, Lloh42
	.loh AdrpAdd	Lloh39, Lloh40
	.loh AdrpLdrGotLdr	Lloh36, Lloh37, Lloh38
	.cfi_endproc
                                        ; -- End function
	.comm	_V4L2_CAP_SLICED_VBI_CAPTURE,4,2 ; @V4L2_CAP_SLICED_VBI_CAPTURE
	.comm	_EINVAL,4,2                     ; @EINVAL
	.comm	_EBUSY,4,2                      ; @EBUSY
	.comm	_V4L2_MPEG_STREAM_VBI_FMT_IVTV,4,2 ; @V4L2_MPEG_STREAM_VBI_FMT_IVTV
	.comm	_V4L2_MPEG_STREAM_TYPE_MPEG2_PS,4,2 ; @V4L2_MPEG_STREAM_TYPE_MPEG2_PS
	.comm	_V4L2_MPEG_STREAM_TYPE_MPEG2_DVD,4,2 ; @V4L2_MPEG_STREAM_TYPE_MPEG2_DVD
	.comm	_V4L2_MPEG_STREAM_TYPE_MPEG2_SVCD,4,2 ; @V4L2_MPEG_STREAM_TYPE_MPEG2_SVCD
	.comm	_V4L2_MPEG_STREAM_VBI_FMT_NONE,8,3 ; @V4L2_MPEG_STREAM_VBI_FMT_NONE
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"disabled insertion of sliced VBI data into the MPEG stream\n"

	.comm	_CX18_VBI_FRAMES,4,2            ; @CX18_VBI_FRAMES
	.comm	_CX18_SLICED_MPEG_DATA_BUFSZ,4,2 ; @CX18_SLICED_MPEG_DATA_BUFSZ
	.comm	_GFP_KERNEL,4,2                 ; @GFP_KERNEL
l_.str.1:                               ; @.str.1
	.asciz	"Unable to allocate buffers for sliced VBI data insertion\n"

	.comm	_ENOMEM,4,2                     ; @ENOMEM
l_.str.2:                               ; @.str.2
	.asciz	"enabled insertion of sliced VBI data into the MPEG PS,when sliced VBI is enabled\n"

	.comm	_V4L2_SLICED_CAPTION_525,4,2    ; @V4L2_SLICED_CAPTION_525
	.comm	_V4L2_SLICED_WSS_625,4,2        ; @V4L2_SLICED_WSS_625
	.no_dead_strip	_cx18_setup_vbi_fmt
.subsections_via_symbols
