	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function cx25840_g_tuner
_cx25840_g_tuner:                       ## @cx25840_g_tuner
	.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	%rbx
	pushq	%rax
	.cfi_offset %rbx, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rsi, %r14
	movq	%rdi, %rbx
	callq	_to_state
	movq	%rax, %r15
	movq	%rbx, %rdi
	callq	_v4l2_get_subdevdata
	movq	%rax, %rbx
	movq	%rax, %rdi
	movl	$1038, %esi                     ## imm = 0x40E
	callq	_cx25840_read
	cmpq	$0, 8(%r15)
	jne	LBB0_9
## %bb.1:
	shll	$26, %eax
	sarl	$31, %eax
	movzwl	%ax, %eax
	movl	%eax, (%r14)
	movq	%r15, %rdi
	callq	_is_cx2583x
	testq	%rax, %rax
	jne	LBB0_9
## %bb.2:
	movq	_V4L2_TUNER_CAP_STEREO@GOTPCREL(%rip), %rax
	movq	_V4L2_TUNER_CAP_LANG1@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	orl	(%rax), %ecx
	movq	_V4L2_TUNER_CAP_LANG2@GOTPCREL(%rip), %rax
	orl	(%rax), %ecx
	movq	_V4L2_TUNER_CAP_SAP@GOTPCREL(%rip), %rax
	orl	(%rax), %ecx
	orl	%ecx, 4(%r14)
	movq	%rbx, %rdi
	movl	$2052, %esi                     ## imm = 0x804
	callq	_cx25840_read
                                        ## kill: def $eax killed $eax def $rax
	movl	%eax, %ecx
	andl	$15, %ecx
	cmpl	$1, %ecx
	jne	LBB0_3
## %bb.4:
	movq	_V4L2_TUNER_SUB_STEREO@GOTPCREL(%rip), %rcx
	jmp	LBB0_5
LBB0_3:
	movq	_V4L2_TUNER_SUB_MONO@GOTPCREL(%rip), %rcx
LBB0_5:
	leal	-2(%rax), %edx
	testl	$-3, %edx
	je	LBB0_6
## %bb.7:
	movl	(%rcx), %ecx
	jmp	LBB0_8
LBB0_6:
	movq	_V4L2_TUNER_SUB_LANG1@GOTPCREL(%rip), %rdx
	movq	_V4L2_TUNER_SUB_LANG2@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	orl	(%rdx), %ecx
LBB0_8:
	shll	$27, %eax
	sarl	$31, %eax
	movq	_V4L2_TUNER_SUB_SAP@GOTPCREL(%rip), %rdx
	andl	(%rdx), %eax
	orl	%ecx, %eax
	movl	%eax, 8(%r14)
	movl	(%r15), %eax
	movl	%eax, 12(%r14)
LBB0_9:
	xorl	%eax, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_V4L2_TUNER_CAP_STEREO,4,2      ## @V4L2_TUNER_CAP_STEREO
	.comm	_V4L2_TUNER_CAP_LANG1,4,2       ## @V4L2_TUNER_CAP_LANG1
	.comm	_V4L2_TUNER_CAP_LANG2,4,2       ## @V4L2_TUNER_CAP_LANG2
	.comm	_V4L2_TUNER_CAP_SAP,4,2         ## @V4L2_TUNER_CAP_SAP
	.comm	_V4L2_TUNER_SUB_STEREO,4,2      ## @V4L2_TUNER_SUB_STEREO
	.comm	_V4L2_TUNER_SUB_MONO,4,2        ## @V4L2_TUNER_SUB_MONO
	.comm	_V4L2_TUNER_SUB_LANG1,4,2       ## @V4L2_TUNER_SUB_LANG1
	.comm	_V4L2_TUNER_SUB_LANG2,4,2       ## @V4L2_TUNER_SUB_LANG2
	.comm	_V4L2_TUNER_SUB_SAP,4,2         ## @V4L2_TUNER_SUB_SAP
	.no_dead_strip	_cx25840_g_tuner
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function cx25840_g_tuner
_cx25840_g_tuner:                       ; @cx25840_g_tuner
	.cfi_startproc
; %bb.0:
	stp	x22, x21, [sp, #-48]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 48
	stp	x20, x19, [sp, #16]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #32]             ; 16-byte Folded Spill
	add	x29, sp, #32
	.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
	mov	x19, x1
	mov	x21, x0
	bl	_to_state
	mov	x20, x0
	mov	x0, x21
	bl	_v4l2_get_subdevdata
	mov	x21, x0
	mov	w1, #1038
	bl	_cx25840_read
	ldr	x8, [x20, #8]
	cbnz	x8, LBB0_3
; %bb.1:
	sbfx	w8, w0, #5, #1
	and	w8, w8, #0xffff
	str	w8, [x19]
	mov	x0, x20
	bl	_is_cx2583x
	cbnz	x0, LBB0_3
; %bb.2:
Lloh0:
	adrp	x8, _V4L2_TUNER_CAP_STEREO@GOTPAGE
Lloh1:
	ldr	x8, [x8, _V4L2_TUNER_CAP_STEREO@GOTPAGEOFF]
Lloh2:
	ldr	w8, [x8]
Lloh3:
	adrp	x9, _V4L2_TUNER_CAP_LANG1@GOTPAGE
Lloh4:
	ldr	x9, [x9, _V4L2_TUNER_CAP_LANG1@GOTPAGEOFF]
Lloh5:
	ldr	w9, [x9]
	orr	w8, w9, w8
Lloh6:
	adrp	x9, _V4L2_TUNER_CAP_LANG2@GOTPAGE
Lloh7:
	ldr	x9, [x9, _V4L2_TUNER_CAP_LANG2@GOTPAGEOFF]
Lloh8:
	ldr	w9, [x9]
Lloh9:
	adrp	x10, _V4L2_TUNER_CAP_SAP@GOTPAGE
Lloh10:
	ldr	x10, [x10, _V4L2_TUNER_CAP_SAP@GOTPAGEOFF]
	orr	w8, w8, w9
Lloh11:
	ldr	w9, [x10]
	orr	w8, w8, w9
	ldr	w9, [x19, #4]
	orr	w8, w8, w9
	str	w8, [x19, #4]
	mov	x0, x21
	mov	w1, #2052
	bl	_cx25840_read
	and	w8, w0, #0xf
Lloh12:
	adrp	x9, _V4L2_TUNER_SUB_STEREO@GOTPAGE
Lloh13:
	ldr	x9, [x9, _V4L2_TUNER_SUB_STEREO@GOTPAGEOFF]
Lloh14:
	adrp	x10, _V4L2_TUNER_SUB_MONO@GOTPAGE
Lloh15:
	ldr	x10, [x10, _V4L2_TUNER_SUB_MONO@GOTPAGEOFF]
	cmp	w8, #1
	csel	x8, x9, x10, eq
	ldr	w8, [x8]
	cmp	w0, #4
	ccmp	w0, #2, #4, ne
Lloh16:
	adrp	x9, _V4L2_TUNER_SUB_LANG1@GOTPAGE
Lloh17:
	ldr	x9, [x9, _V4L2_TUNER_SUB_LANG1@GOTPAGEOFF]
Lloh18:
	ldr	w9, [x9]
Lloh19:
	adrp	x10, _V4L2_TUNER_SUB_LANG2@GOTPAGE
Lloh20:
	ldr	x10, [x10, _V4L2_TUNER_SUB_LANG2@GOTPAGEOFF]
Lloh21:
	ldr	w10, [x10]
	orr	w9, w10, w9
	csel	w8, w9, w8, eq
	lsl	w9, w0, #27
Lloh22:
	adrp	x10, _V4L2_TUNER_SUB_SAP@GOTPAGE
Lloh23:
	ldr	x10, [x10, _V4L2_TUNER_SUB_SAP@GOTPAGEOFF]
Lloh24:
	ldr	w10, [x10]
	and	w9, w10, w9, asr #31
	orr	w8, w8, w9
	ldr	w9, [x20]
	stp	w8, w9, [x19, #8]
LBB0_3:
	mov	w0, #0
	ldp	x29, x30, [sp, #32]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #16]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp], #48             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGotLdr	Lloh22, Lloh23, Lloh24
	.loh AdrpLdrGotLdr	Lloh19, Lloh20, Lloh21
	.loh AdrpLdrGotLdr	Lloh16, Lloh17, Lloh18
	.loh AdrpLdrGot	Lloh14, Lloh15
	.loh AdrpLdrGot	Lloh12, Lloh13
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.cfi_endproc
                                        ; -- End function
	.comm	_V4L2_TUNER_CAP_STEREO,4,2      ; @V4L2_TUNER_CAP_STEREO
	.comm	_V4L2_TUNER_CAP_LANG1,4,2       ; @V4L2_TUNER_CAP_LANG1
	.comm	_V4L2_TUNER_CAP_LANG2,4,2       ; @V4L2_TUNER_CAP_LANG2
	.comm	_V4L2_TUNER_CAP_SAP,4,2         ; @V4L2_TUNER_CAP_SAP
	.comm	_V4L2_TUNER_SUB_STEREO,4,2      ; @V4L2_TUNER_SUB_STEREO
	.comm	_V4L2_TUNER_SUB_MONO,4,2        ; @V4L2_TUNER_SUB_MONO
	.comm	_V4L2_TUNER_SUB_LANG1,4,2       ; @V4L2_TUNER_SUB_LANG1
	.comm	_V4L2_TUNER_SUB_LANG2,4,2       ; @V4L2_TUNER_SUB_LANG2
	.comm	_V4L2_TUNER_SUB_SAP,4,2         ; @V4L2_TUNER_SUB_SAP
	.no_dead_strip	_cx25840_g_tuner
.subsections_via_symbols
