	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function cx18_prep_dev
_cx18_prep_dev:                         ## @cx18_prep_dev
	.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
	movl	%esi, %r14d
	movq	%rdi, %r12
	movq	40(%rdi), %r13
	movslq	%esi, %rax
	movq	_cx18_stream_info@GOTPCREL(%rip), %rcx
	movq	(%rcx), %rdx
	leaq	(,%rax,8), %rsi
	leaq	(%rsi,%rsi,2), %rsi
	movl	(%rdx,%rsi), %r8d
	movq	_cx18_first_minor@GOTPCREL(%rip), %rdx
	movl	4(%rdi), %r15d
	addl	%r8d, %r15d
	addl	(%rdx), %r15d
	movl	(%rdi), %edx
	imulq	$88, %rax, %rbx
	movq	$0, 48(%r13,%rbx)
	movq	$0, 72(%r13,%rbx)
	movq	%rdi, 80(%r13,%rbx)
	movl	%eax, (%r13,%rbx)
	movq	(%rcx), %rdi
	movq	8(%rdi,%rsi), %rsi
	movq	%rsi, 8(%r13,%rbx)
	movq	_CX18_ENC_STREAM_TYPE_RAD@GOTPCREL(%rip), %rsi
	cmpl	%eax, (%rsi)
	jne	LBB0_2
## %bb.1:
	movq	_V4L2_CAP_RADIO@GOTPCREL(%rip), %rsi
	testl	%edx, (%rsi)
	je	LBB0_11
LBB0_2:
	movq	_CX18_ENC_STREAM_TYPE_VBI@GOTPCREL(%rip), %rsi
	cmpl	%r14d, (%rsi)
	jne	LBB0_4
## %bb.3:
	movq	_V4L2_CAP_VBI_CAPTURE@GOTPCREL(%rip), %rsi
	movq	_V4L2_CAP_SLICED_VBI_CAPTURE@GOTPCREL(%rip), %rdi
	movl	(%rdi), %edi
	orl	(%rsi), %edi
	testl	%edx, %edi
	je	LBB0_11
LBB0_4:
	movq	(%rcx), %rcx
	leaq	(%rax,%rax,2), %rdx
	movq	16(%rcx,%rdx,8), %rsi
	movq	_PCI_DMA_NONE@GOTPCREL(%rip), %rdi
	cmpq	(%rdi), %rsi
	je	LBB0_6
## %bb.5:
	movq	8(%r12), %rsi
	cmpq	$0, (%rsi,%rax,8)
	je	LBB0_12
LBB0_6:
	leaq	(%rbx,%r13), %rax
	addq	$8, %rax
	movq	%rax, -56(%rbp)                 ## 8-byte Spill
	movq	%r12, %rdi
	movl	%r14d, %esi
	movl	%r8d, -48(%rbp)                 ## 4-byte Spill
	callq	_cx18_stream_init
	movl	-48(%rbp), %edx                 ## 4-byte Reload
	movq	_CX18_ENC_STREAM_TYPE_TS@GOTPCREL(%rip), %rax
	cmpl	%r14d, (%rax)
	jne	LBB0_14
## %bb.7:
	movq	24(%r12), %rax
	movq	_CX18_HW_DVB@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	testl	%ecx, (%rax)
	je	LBB0_13
## %bb.8:
	leaq	(%rbx,%r13), %r14
	addq	$72, %r14
	movq	_GFP_KERNEL@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movl	$4, %edi
	callq	_kzalloc
	movl	-48(%rbp), %edx                 ## 4-byte Reload
	movq	%rax, (%r14)
	testq	%rax, %rax
	jne	LBB0_14
## %bb.9:
	movq	-56(%rbp), %rax                 ## 8-byte Reload
	movq	(%rax), %rsi
	leaq	L_.str.1(%rip), %rdi
	callq	_CX18_ERR
	movq	_ENOMEM@GOTPCREL(%rip), %rax
	xorl	%r14d, %r14d
	subl	(%rax), %r14d
	jmp	LBB0_19
LBB0_11:
	xorl	%r14d, %r14d
	jmp	LBB0_19
LBB0_12:
	movq	8(%rcx,%rdx,8), %rsi
	leaq	L_.str(%rip), %rdi
	callq	_CX18_INFO
	xorl	%r14d, %r14d
	jmp	LBB0_19
LBB0_13:
	movq	$0, 64(%r13,%rbx)
LBB0_14:
	xorl	%r14d, %r14d
	cmpl	$-1, %edx
	je	LBB0_19
## %bb.15:
	leaq	(%rbx,%r13), %rax
	addq	$16, %rax
	movq	%rax, -64(%rbp)                 ## 8-byte Spill
	movl	56(%r13,%rbx), %edi
	leaq	32(%r12), %rax
	movq	%rax, -48(%rbp)                 ## 8-byte Spill
	movq	32(%r12), %rcx
	movq	-56(%rbp), %rax                 ## 8-byte Reload
	movq	(%rax), %r8
	leaq	L_.str.2(%rip), %rdx
	movl	$4, %esi
	callq	_snprintf
	movq	-64(%rbp), %rdi                 ## 8-byte Reload
	movl	%r15d, (%rdi)
	movq	-48(%rbp), %rax                 ## 8-byte Reload
	movq	%rax, 32(%rdi)
	movq	_cx18_v4l2_enc_fops@GOTPCREL(%rip), %rax
	movq	%rax, 40(%r13,%rbx)
	movq	_video_device_release_empty@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, 36(%r13,%rbx)
	movq	24(%r12), %rax
	movq	8(%rax), %rax
	movq	(%rax), %rax
	movq	_CX18_CARD_INPUT_VID_TUNER@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	je	LBB0_17
## %bb.16:
	movq	_V4L2_STD_ALL@GOTPCREL(%rip), %rax
	jmp	LBB0_18
LBB0_17:
	leaq	20(%r12), %rax
LBB0_18:
	movl	(%rax), %eax
	movl	%eax, 32(%r13,%rbx)
	addq	$16, %r12
	movq	%r12, 24(%r13,%rbx)
	callq	_cx18_set_funcs
LBB0_19:
	movl	%r14d, %eax
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_cx18_stream_info,8,3           ## @cx18_stream_info
	.comm	_cx18_first_minor,4,2           ## @cx18_first_minor
	.comm	_CX18_ENC_STREAM_TYPE_RAD,4,2   ## @CX18_ENC_STREAM_TYPE_RAD
	.comm	_V4L2_CAP_RADIO,4,2             ## @V4L2_CAP_RADIO
	.comm	_CX18_ENC_STREAM_TYPE_VBI,4,2   ## @CX18_ENC_STREAM_TYPE_VBI
	.comm	_V4L2_CAP_VBI_CAPTURE,4,2       ## @V4L2_CAP_VBI_CAPTURE
	.comm	_V4L2_CAP_SLICED_VBI_CAPTURE,4,2 ## @V4L2_CAP_SLICED_VBI_CAPTURE
	.comm	_PCI_DMA_NONE,8,3               ## @PCI_DMA_NONE
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Disabled %s device\n"

	.comm	_CX18_ENC_STREAM_TYPE_TS,4,2    ## @CX18_ENC_STREAM_TYPE_TS
	.comm	_CX18_HW_DVB,4,2                ## @CX18_HW_DVB
	.comm	_GFP_KERNEL,4,2                 ## @GFP_KERNEL
L_.str.1:                               ## @.str.1
	.asciz	"Couldn't allocate cx18_dvb structure for %s\n"

	.comm	_ENOMEM,4,2                     ## @ENOMEM
L_.str.2:                               ## @.str.2
	.asciz	"%s %s"

	.comm	_cx18_v4l2_enc_fops,4,2         ## @cx18_v4l2_enc_fops
	.comm	_video_device_release_empty,4,2 ## @video_device_release_empty
	.comm	_CX18_CARD_INPUT_VID_TUNER,8,3  ## @CX18_CARD_INPUT_VID_TUNER
	.comm	_V4L2_STD_ALL,4,2               ## @V4L2_STD_ALL
	.no_dead_strip	_cx18_prep_dev
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function cx18_prep_dev
_cx18_prep_dev:                         ; @cx18_prep_dev
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #112
	.cfi_def_cfa_offset 112
	stp	x28, x27, [sp, #16]             ; 16-byte Folded Spill
	stp	x26, x25, [sp, #32]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #48]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #64]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #80]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #96]             ; 16-byte Folded Spill
	add	x29, sp, #96
	.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
	.cfi_offset w27, -88
	.cfi_offset w28, -96
	mov	x20, x1
	mov	x19, x0
	ldr	x23, [x0, #40]
	sxtw	x21, w20
Lloh0:
	adrp	x8, _cx18_stream_info@GOTPAGE
Lloh1:
	ldr	x8, [x8, _cx18_stream_info@GOTPAGEOFF]
	ldr	x9, [x8]
	add	x10, x21, w1, sxtw #1
	lsl	x10, x10, #3
	ldr	w24, [x9, x10]
	ldp	w9, w26, [x0]
Lloh2:
	adrp	x11, _cx18_first_minor@GOTPAGE
Lloh3:
	ldr	x11, [x11, _cx18_first_minor@GOTPAGEOFF]
Lloh4:
	ldr	w13, [x11]
	mov	w11, #88
	smaddl	x27, w1, w11, x23
	mov	x22, x27
	str	xzr, [x22, #48]!
	mov	x25, x27
	str	xzr, [x25, #72]!
	str	x0, [x27, #80]
	str	w1, [x27]
	ldr	x11, [x8]
	add	x10, x11, x10
	ldr	x10, [x10, #8]
	mov	x28, x27
	str	x10, [x28, #8]!
Lloh5:
	adrp	x10, _CX18_ENC_STREAM_TYPE_RAD@GOTPAGE
Lloh6:
	ldr	x10, [x10, _CX18_ENC_STREAM_TYPE_RAD@GOTPAGEOFF]
Lloh7:
	ldr	w10, [x10]
	cmp	w10, w1
	b.ne	LBB0_2
; %bb.1:
Lloh8:
	adrp	x10, _V4L2_CAP_RADIO@GOTPAGE
Lloh9:
	ldr	x10, [x10, _V4L2_CAP_RADIO@GOTPAGEOFF]
Lloh10:
	ldr	w10, [x10]
	tst	w10, w9
	b.eq	LBB0_14
LBB0_2:
Lloh11:
	adrp	x10, _CX18_ENC_STREAM_TYPE_VBI@GOTPAGE
Lloh12:
	ldr	x10, [x10, _CX18_ENC_STREAM_TYPE_VBI@GOTPAGEOFF]
Lloh13:
	ldr	w10, [x10]
	cmp	w10, w20
	b.ne	LBB0_4
; %bb.3:
Lloh14:
	adrp	x10, _V4L2_CAP_VBI_CAPTURE@GOTPAGE
Lloh15:
	ldr	x10, [x10, _V4L2_CAP_VBI_CAPTURE@GOTPAGEOFF]
Lloh16:
	ldr	w10, [x10]
Lloh17:
	adrp	x11, _V4L2_CAP_SLICED_VBI_CAPTURE@GOTPAGE
Lloh18:
	ldr	x11, [x11, _V4L2_CAP_SLICED_VBI_CAPTURE@GOTPAGEOFF]
Lloh19:
	ldr	w11, [x11]
	orr	w10, w11, w10
	tst	w10, w9
	b.eq	LBB0_14
LBB0_4:
	ldr	x8, [x8]
	mov	w9, #24
	madd	x9, x21, x9, x8
	ldr	x9, [x9, #16]
Lloh20:
	adrp	x10, _PCI_DMA_NONE@GOTPAGE
Lloh21:
	ldr	x10, [x10, _PCI_DMA_NONE@GOTPAGEOFF]
Lloh22:
	ldr	x10, [x10]
	cmp	x9, x10
	b.eq	LBB0_6
; %bb.5:
	ldr	x9, [x19, #8]
	ldr	x9, [x9, x21, lsl #3]
	cbz	x9, LBB0_10
LBB0_6:
	str	w13, [sp, #12]                  ; 4-byte Folded Spill
	mov	x0, x19
	mov	x1, x20
	bl	_cx18_stream_init
Lloh23:
	adrp	x8, _CX18_ENC_STREAM_TYPE_TS@GOTPAGE
Lloh24:
	ldr	x8, [x8, _CX18_ENC_STREAM_TYPE_TS@GOTPAGEOFF]
Lloh25:
	ldr	w8, [x8]
	cmp	w8, w20
	b.ne	LBB0_12
; %bb.7:
	ldr	x8, [x19, #24]
	ldr	w8, [x8]
Lloh26:
	adrp	x9, _CX18_HW_DVB@GOTPAGE
Lloh27:
	ldr	x9, [x9, _CX18_HW_DVB@GOTPAGEOFF]
Lloh28:
	ldr	w9, [x9]
	tst	w9, w8
	b.eq	LBB0_11
; %bb.8:
Lloh29:
	adrp	x8, _GFP_KERNEL@GOTPAGE
Lloh30:
	ldr	x8, [x8, _GFP_KERNEL@GOTPAGEOFF]
Lloh31:
	ldr	w1, [x8]
	mov	w0, #4
	bl	_kzalloc
	str	x0, [x25]
	cbnz	x0, LBB0_12
; %bb.9:
	ldr	x1, [x28]
Lloh32:
	adrp	x0, l_.str.1@PAGE
Lloh33:
	add	x0, x0, l_.str.1@PAGEOFF
	bl	_CX18_ERR
Lloh34:
	adrp	x8, _ENOMEM@GOTPAGE
Lloh35:
	ldr	x8, [x8, _ENOMEM@GOTPAGEOFF]
Lloh36:
	ldr	w8, [x8]
	neg	w0, w8
	b	LBB0_15
LBB0_10:
	mov	w9, #24
	madd	x8, x21, x9, x8
	ldr	x1, [x8, #8]
Lloh37:
	adrp	x0, l_.str@PAGE
Lloh38:
	add	x0, x0, l_.str@PAGEOFF
	bl	_CX18_INFO
	b	LBB0_14
LBB0_11:
	mov	w8, #88
	madd	x8, x21, x8, x23
	str	xzr, [x8, #64]
LBB0_12:
	cmn	w24, #1
	b.eq	LBB0_14
; %bb.13:
	add	w8, w26, w24
	ldr	w9, [sp, #12]                   ; 4-byte Folded Reload
	add	w24, w8, w9
	add	x20, x27, #16
	mov	w8, #88
	madd	x21, x21, x8, x23
	ldr	w0, [x21, #56]
	ldr	x3, [x19, #32]!
	ldr	x4, [x28]
Lloh39:
	adrp	x2, l_.str.2@PAGE
Lloh40:
	add	x2, x2, l_.str.2@PAGEOFF
	mov	w1, #4
	bl	_snprintf
	str	w24, [x20]
	str	x19, [x22]
Lloh41:
	adrp	x8, _cx18_v4l2_enc_fops@GOTPAGE
Lloh42:
	ldr	x8, [x8, _cx18_v4l2_enc_fops@GOTPAGEOFF]
Lloh43:
	adrp	x9, _video_device_release_empty@GOTPAGE
Lloh44:
	ldr	x9, [x9, _video_device_release_empty@GOTPAGEOFF]
	str	x8, [x21, #40]
Lloh45:
	ldr	w8, [x9]
	str	w8, [x21, #36]
	ldur	x8, [x19, #-8]
	ldr	x8, [x8, #8]
	ldr	x8, [x8]
Lloh46:
	adrp	x9, _CX18_CARD_INPUT_VID_TUNER@GOTPAGE
Lloh47:
	ldr	x9, [x9, _CX18_CARD_INPUT_VID_TUNER@GOTPAGEOFF]
Lloh48:
	ldr	x9, [x9]
	sub	x10, x19, #12
Lloh49:
	adrp	x11, _V4L2_STD_ALL@GOTPAGE
Lloh50:
	ldr	x11, [x11, _V4L2_STD_ALL@GOTPAGEOFF]
	cmp	x8, x9
	csel	x8, x10, x11, eq
	ldr	w8, [x8]
	str	w8, [x21, #32]
	sub	x8, x19, #16
	str	x8, [x21, #24]
	mov	x0, x20
	bl	_cx18_set_funcs
LBB0_14:
	mov	w0, #0
LBB0_15:
	ldp	x29, x30, [sp, #96]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #80]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #64]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #48]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #32]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #112
	ret
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.loh AdrpLdrGotLdr	Lloh17, Lloh18, Lloh19
	.loh AdrpLdrGotLdr	Lloh14, Lloh15, Lloh16
	.loh AdrpLdrGotLdr	Lloh20, Lloh21, Lloh22
	.loh AdrpLdrGotLdr	Lloh23, Lloh24, Lloh25
	.loh AdrpLdrGotLdr	Lloh26, Lloh27, Lloh28
	.loh AdrpLdrGotLdr	Lloh29, Lloh30, Lloh31
	.loh AdrpLdrGotLdr	Lloh34, Lloh35, Lloh36
	.loh AdrpAdd	Lloh32, Lloh33
	.loh AdrpAdd	Lloh37, Lloh38
	.loh AdrpLdrGot	Lloh49, Lloh50
	.loh AdrpLdrGotLdr	Lloh46, Lloh47, Lloh48
	.loh AdrpLdrGotLdr	Lloh43, Lloh44, Lloh45
	.loh AdrpLdrGot	Lloh41, Lloh42
	.loh AdrpAdd	Lloh39, Lloh40
	.cfi_endproc
                                        ; -- End function
	.comm	_cx18_stream_info,8,3           ; @cx18_stream_info
	.comm	_cx18_first_minor,4,2           ; @cx18_first_minor
	.comm	_CX18_ENC_STREAM_TYPE_RAD,4,2   ; @CX18_ENC_STREAM_TYPE_RAD
	.comm	_V4L2_CAP_RADIO,4,2             ; @V4L2_CAP_RADIO
	.comm	_CX18_ENC_STREAM_TYPE_VBI,4,2   ; @CX18_ENC_STREAM_TYPE_VBI
	.comm	_V4L2_CAP_VBI_CAPTURE,4,2       ; @V4L2_CAP_VBI_CAPTURE
	.comm	_V4L2_CAP_SLICED_VBI_CAPTURE,4,2 ; @V4L2_CAP_SLICED_VBI_CAPTURE
	.comm	_PCI_DMA_NONE,8,3               ; @PCI_DMA_NONE
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Disabled %s device\n"

	.comm	_CX18_ENC_STREAM_TYPE_TS,4,2    ; @CX18_ENC_STREAM_TYPE_TS
	.comm	_CX18_HW_DVB,4,2                ; @CX18_HW_DVB
	.comm	_GFP_KERNEL,4,2                 ; @GFP_KERNEL
l_.str.1:                               ; @.str.1
	.asciz	"Couldn't allocate cx18_dvb structure for %s\n"

	.comm	_ENOMEM,4,2                     ; @ENOMEM
l_.str.2:                               ; @.str.2
	.asciz	"%s %s"

	.comm	_cx18_v4l2_enc_fops,4,2         ; @cx18_v4l2_enc_fops
	.comm	_video_device_release_empty,4,2 ; @video_device_release_empty
	.comm	_CX18_CARD_INPUT_VID_TUNER,8,3  ; @CX18_CARD_INPUT_VID_TUNER
	.comm	_V4L2_STD_ALL,4,2               ; @V4L2_STD_ALL
	.no_dead_strip	_cx18_prep_dev
.subsections_via_symbols
