	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function tda9840_s_tuner
_tda9840_s_tuner:                       ## @tda9840_s_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, %rbx
	movq	%rdi, %r15
	callq	_tda9840_status
	cmpq	$0, 8(%rbx)
	je	LBB0_2
## %bb.1:
	movq	_EINVAL@GOTPCREL(%rip), %rcx
	xorl	%eax, %eax
	subl	(%rcx), %eax
	jmp	LBB0_15
LBB0_2:
	xorl	%ecx, %ecx
	testl	%eax, %eax
	cmovgl	%eax, %ecx
	jle	LBB0_7
## %bb.3:
	cmpl	$96, %ecx
	je	LBB0_7
## %bb.4:
	movl	(%rbx), %eax
	cmpl	$64, %ecx
	jne	LBB0_8
## %bb.5:
	movq	_V4L2_TUNER_MODE_MONO@GOTPCREL(%rip), %rcx
	cmpl	(%rcx), %eax
	jne	LBB0_11
LBB0_7:
	movq	_TDA9840_SET_MONO@GOTPCREL(%rip), %rax
LBB0_14:
	movl	(%rax), %r14d
	movq	_debug@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	leaq	L_.str(%rip), %rcx
	movl	$1, %edi
	movq	%r15, %rdx
	movl	%r14d, %r8d
	callq	_v4l2_dbg
	movq	_SWITCH@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r15, %rdi
	movl	%r14d, %edx
	callq	_tda9840_write
	xorl	%eax, %eax
LBB0_15:
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_8:
	cmpl	$128, %eax
	je	LBB0_12
## %bb.9:
	cmpl	$129, %eax
	jne	LBB0_13
## %bb.10:
	movq	_TDA9840_SET_BOTH@GOTPCREL(%rip), %rax
	jmp	LBB0_14
LBB0_11:
	movq	_TDA9840_SET_STEREO@GOTPCREL(%rip), %rax
	jmp	LBB0_14
LBB0_12:
	movq	_TDA9840_SET_LANG2@GOTPCREL(%rip), %rax
	jmp	LBB0_14
LBB0_13:
	movq	_TDA9840_SET_LANG1@GOTPCREL(%rip), %rax
	jmp	LBB0_14
	.cfi_endproc
                                        ## -- End function
	.comm	_EINVAL,4,2                     ## @EINVAL
	.comm	_TDA9840_SET_MONO,4,2           ## @TDA9840_SET_MONO
	.comm	_V4L2_TUNER_MODE_MONO,4,2       ## @V4L2_TUNER_MODE_MONO
	.comm	_TDA9840_SET_STEREO,4,2         ## @TDA9840_SET_STEREO
	.comm	_TDA9840_SET_BOTH,4,2           ## @TDA9840_SET_BOTH
	.comm	_TDA9840_SET_LANG2,4,2          ## @TDA9840_SET_LANG2
	.comm	_TDA9840_SET_LANG1,4,2          ## @TDA9840_SET_LANG1
	.comm	_debug,4,2                      ## @debug
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"TDA9840_SWITCH: 0x%02x\n"

	.comm	_SWITCH,4,2                     ## @SWITCH
	.no_dead_strip	_tda9840_s_tuner
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function tda9840_s_tuner
_tda9840_s_tuner:                       ; @tda9840_s_tuner
	.cfi_startproc
; %bb.0:
	stp	x20, x19, [sp, #-32]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 32
	stp	x29, x30, [sp, #16]             ; 16-byte Folded Spill
	add	x29, sp, #16
	.cfi_def_cfa w29, 16
	.cfi_offset w30, -8
	.cfi_offset w29, -16
	.cfi_offset w19, -24
	.cfi_offset w20, -32
	mov	x20, x1
	mov	x19, x0
	bl	_tda9840_status
	ldr	x8, [x20, #8]
	cbz	x8, LBB0_2
; %bb.1:
Lloh0:
	adrp	x8, _EINVAL@GOTPAGE
Lloh1:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
Lloh2:
	ldr	w8, [x8]
	neg	w0, w8
	b	LBB0_8
LBB0_2:
	cmp	w0, #0
	csel	w9, w0, wzr, gt
	cmp	w0, #1
	b.lt	LBB0_6
; %bb.3:
	cmp	w9, #96
	b.eq	LBB0_6
; %bb.4:
	ldr	w8, [x20]
	cmp	w9, #64
	b.ne	LBB0_9
; %bb.5:
Lloh3:
	adrp	x9, _V4L2_TUNER_MODE_MONO@GOTPAGE
Lloh4:
	ldr	x9, [x9, _V4L2_TUNER_MODE_MONO@GOTPAGEOFF]
Lloh5:
	adrp	x10, _TDA9840_SET_MONO@GOTPAGE
Lloh6:
	ldr	x10, [x10, _TDA9840_SET_MONO@GOTPAGEOFF]
Lloh7:
	ldr	w9, [x9]
Lloh8:
	adrp	x11, _TDA9840_SET_STEREO@GOTPAGE
Lloh9:
	ldr	x11, [x11, _TDA9840_SET_STEREO@GOTPAGEOFF]
	cmp	w8, w9
	csel	x8, x10, x11, eq
	b	LBB0_7
LBB0_6:
Lloh10:
	adrp	x8, _TDA9840_SET_MONO@GOTPAGE
Lloh11:
	ldr	x8, [x8, _TDA9840_SET_MONO@GOTPAGEOFF]
LBB0_7:
	ldr	w20, [x8]
Lloh12:
	adrp	x8, _debug@GOTPAGE
Lloh13:
	ldr	x8, [x8, _debug@GOTPAGEOFF]
Lloh14:
	ldr	w1, [x8]
Lloh15:
	adrp	x3, l_.str@PAGE
Lloh16:
	add	x3, x3, l_.str@PAGEOFF
	mov	w0, #1
	mov	x2, x19
	mov	x4, x20
	bl	_v4l2_dbg
Lloh17:
	adrp	x8, _SWITCH@GOTPAGE
Lloh18:
	ldr	x8, [x8, _SWITCH@GOTPAGEOFF]
Lloh19:
	ldr	w1, [x8]
	mov	x0, x19
	mov	x2, x20
	bl	_tda9840_write
	mov	w0, #0
LBB0_8:
	ldp	x29, x30, [sp, #16]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp], #32             ; 16-byte Folded Reload
	ret
LBB0_9:
	cmp	w8, #128
	b.eq	LBB0_12
; %bb.10:
	cmp	w8, #129
	b.ne	LBB0_13
; %bb.11:
Lloh20:
	adrp	x8, _TDA9840_SET_BOTH@GOTPAGE
Lloh21:
	ldr	x8, [x8, _TDA9840_SET_BOTH@GOTPAGEOFF]
	b	LBB0_7
LBB0_12:
Lloh22:
	adrp	x8, _TDA9840_SET_LANG2@GOTPAGE
Lloh23:
	ldr	x8, [x8, _TDA9840_SET_LANG2@GOTPAGEOFF]
	b	LBB0_7
LBB0_13:
Lloh24:
	adrp	x8, _TDA9840_SET_LANG1@GOTPAGE
Lloh25:
	ldr	x8, [x8, _TDA9840_SET_LANG1@GOTPAGEOFF]
	b	LBB0_7
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGot	Lloh8, Lloh9
	.loh AdrpLdrGot	Lloh5, Lloh6
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh7
	.loh AdrpLdrGot	Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh17, Lloh18, Lloh19
	.loh AdrpAdd	Lloh15, Lloh16
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.loh AdrpLdrGot	Lloh20, Lloh21
	.loh AdrpLdrGot	Lloh22, Lloh23
	.loh AdrpLdrGot	Lloh24, Lloh25
	.cfi_endproc
                                        ; -- End function
	.comm	_EINVAL,4,2                     ; @EINVAL
	.comm	_TDA9840_SET_MONO,4,2           ; @TDA9840_SET_MONO
	.comm	_V4L2_TUNER_MODE_MONO,4,2       ; @V4L2_TUNER_MODE_MONO
	.comm	_TDA9840_SET_STEREO,4,2         ; @TDA9840_SET_STEREO
	.comm	_TDA9840_SET_BOTH,4,2           ; @TDA9840_SET_BOTH
	.comm	_TDA9840_SET_LANG2,4,2          ; @TDA9840_SET_LANG2
	.comm	_TDA9840_SET_LANG1,4,2          ; @TDA9840_SET_LANG1
	.comm	_debug,4,2                      ; @debug
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"TDA9840_SWITCH: 0x%02x\n"

	.comm	_SWITCH,4,2                     ; @SWITCH
	.no_dead_strip	_tda9840_s_tuner
.subsections_via_symbols
