	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function tda9874a_getmode
_tda9874a_getmode:                      ## @tda9874a_getmode
	.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, %r13
	movq	_V4L2_TUNER_MODE_MONO@GOTPCREL(%rip), %rax
	movl	(%rax), %r12d
	movq	_TDA9874A_DSR@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	callq	_chip_read2
	cmpl	$-1, %eax
	je	LBB0_8
## %bb.1:
	movl	%eax, %r14d
	movq	_TDA9874A_NSR@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r13, %rdi
	callq	_chip_read2
	cmpl	$-1, %eax
	je	LBB0_8
## %bb.2:
	movl	%eax, %r15d
	movq	_TDA9874A_NECR@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r13, %rdi
	callq	_chip_read2
                                        ## kill: def $eax killed $eax def $rax
	cmpl	$-1, %eax
	je	LBB0_8
## %bb.3:
	movq	(%r13), %rcx
	addq	$8, %r13
	movq	_MAXREGS@GOTPCREL(%rip), %rdx
	movslq	(%rdx), %rsi
	movl	%r14d, -8(%rcx,%rsi,4)
	movslq	(%rdx), %rdx
	movl	%r15d, -4(%rcx,%rdx,4)
	movq	_tda9874a_mode@GOTPCREL(%rip), %rcx
	cmpq	$0, (%rcx)
	je	LBB0_5
## %bb.4:
	movl	%r15d, %ebx
	shll	$30, %ebx
	sarl	$31, %ebx
	movq	_V4L2_TUNER_MODE_STEREO@GOTPCREL(%rip), %rcx
	andl	(%rcx), %ebx
	orl	%r12d, %ebx
	testb	$1, %r15b
	je	LBB0_7
LBB0_6:
	movq	_V4L2_TUNER_MODE_LANG1@GOTPCREL(%rip), %rcx
	movq	_V4L2_TUNER_MODE_LANG2@GOTPCREL(%rip), %rdx
	orl	(%rcx), %ebx
	orl	(%rdx), %ebx
LBB0_7:
	movq	_debug@GOTPCREL(%rip), %rcx
	movl	(%rcx), %esi
	leaq	L_.str(%rip), %rcx
	movl	$1, %edi
	movq	%r13, %rdx
	movl	%r14d, %r8d
	movl	%r15d, %r9d
	pushq	%rbx
	pushq	%rax
	callq	_v4l2_dbg
	addq	$16, %rsp
	movl	%ebx, %r12d
LBB0_8:
	movl	%r12d, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_5:
	movl	%r14d, %ebx
	shll	$30, %ebx
	sarl	$31, %ebx
	movq	_V4L2_TUNER_MODE_STEREO@GOTPCREL(%rip), %rcx
	andl	(%rcx), %ebx
	orl	%r12d, %ebx
	testb	$4, %r14b
	jne	LBB0_6
	jmp	LBB0_7
	.cfi_endproc
                                        ## -- End function
	.comm	_V4L2_TUNER_MODE_MONO,4,2       ## @V4L2_TUNER_MODE_MONO
	.comm	_TDA9874A_DSR,4,2               ## @TDA9874A_DSR
	.comm	_TDA9874A_NSR,4,2               ## @TDA9874A_NSR
	.comm	_TDA9874A_NECR,4,2              ## @TDA9874A_NECR
	.comm	_MAXREGS,4,2                    ## @MAXREGS
	.comm	_tda9874a_mode,8,3              ## @tda9874a_mode
	.comm	_V4L2_TUNER_MODE_STEREO,4,2     ## @V4L2_TUNER_MODE_STEREO
	.comm	_V4L2_TUNER_MODE_LANG1,4,2      ## @V4L2_TUNER_MODE_LANG1
	.comm	_V4L2_TUNER_MODE_LANG2,4,2      ## @V4L2_TUNER_MODE_LANG2
	.comm	_debug,4,2                      ## @debug
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"tda9874a_getmode(): DSR=0x%X, NSR=0x%X, NECR=0x%X, return: %d.\n"

	.no_dead_strip	_tda9874a_getmode
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function tda9874a_getmode
_tda9874a_getmode:                      ; @tda9874a_getmode
	.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	x22, x0
Lloh0:
	adrp	x8, _V4L2_TUNER_MODE_MONO@GOTPAGE
Lloh1:
	ldr	x8, [x8, _V4L2_TUNER_MODE_MONO@GOTPAGEOFF]
Lloh2:
	ldr	w19, [x8]
Lloh3:
	adrp	x8, _TDA9874A_DSR@GOTPAGE
Lloh4:
	ldr	x8, [x8, _TDA9874A_DSR@GOTPAGEOFF]
Lloh5:
	ldr	w1, [x8]
	bl	_chip_read2
	cmn	w0, #1
	b.eq	LBB0_7
; %bb.1:
	mov	x20, x0
Lloh6:
	adrp	x8, _TDA9874A_NSR@GOTPAGE
Lloh7:
	ldr	x8, [x8, _TDA9874A_NSR@GOTPAGEOFF]
Lloh8:
	ldr	w1, [x8]
	mov	x0, x22
	bl	_chip_read2
	cmn	w0, #1
	b.eq	LBB0_7
; %bb.2:
	mov	x21, x0
Lloh9:
	adrp	x8, _TDA9874A_NECR@GOTPAGE
Lloh10:
	ldr	x8, [x8, _TDA9874A_NECR@GOTPAGEOFF]
Lloh11:
	ldr	w1, [x8]
	mov	x0, x22
	bl	_chip_read2
	cmn	w0, #1
	b.eq	LBB0_7
; %bb.3:
	mov	x6, x0
	add	x2, x22, #8
	ldr	x8, [x22]
Lloh12:
	adrp	x9, _MAXREGS@GOTPAGE
Lloh13:
	ldr	x9, [x9, _MAXREGS@GOTPAGEOFF]
	ldrsw	x10, [x9]
	add	x10, x8, x10, lsl #2
	stur	w20, [x10, #-8]
	ldrsw	x9, [x9]
	add	x8, x8, x9, lsl #2
	stur	w21, [x8, #-4]
Lloh14:
	adrp	x8, _tda9874a_mode@GOTPAGE
Lloh15:
	ldr	x8, [x8, _tda9874a_mode@GOTPAGEOFF]
Lloh16:
	ldr	x8, [x8]
	cbz	x8, LBB0_8
; %bb.4:
	lsl	w8, w21, #30
Lloh17:
	adrp	x9, _V4L2_TUNER_MODE_STEREO@GOTPAGE
Lloh18:
	ldr	x9, [x9, _V4L2_TUNER_MODE_STEREO@GOTPAGEOFF]
Lloh19:
	ldr	w9, [x9]
	and	w8, w9, w8, asr #31
	orr	w19, w8, w19
	tbz	w21, #0, LBB0_6
LBB0_5:
Lloh20:
	adrp	x8, _V4L2_TUNER_MODE_LANG1@GOTPAGE
Lloh21:
	ldr	x8, [x8, _V4L2_TUNER_MODE_LANG1@GOTPAGEOFF]
Lloh22:
	ldr	w8, [x8]
Lloh23:
	adrp	x9, _V4L2_TUNER_MODE_LANG2@GOTPAGE
Lloh24:
	ldr	x9, [x9, _V4L2_TUNER_MODE_LANG2@GOTPAGEOFF]
Lloh25:
	ldr	w9, [x9]
	orr	w8, w8, w19
	orr	w19, w8, w9
LBB0_6:
Lloh26:
	adrp	x8, _debug@GOTPAGE
Lloh27:
	ldr	x8, [x8, _debug@GOTPAGEOFF]
Lloh28:
	ldr	w1, [x8]
Lloh29:
	adrp	x3, l_.str@PAGE
Lloh30:
	add	x3, x3, l_.str@PAGEOFF
	mov	w0, #1
	mov	x4, x20
	mov	x5, x21
	mov	x7, x19
	bl	_v4l2_dbg
LBB0_7:
	mov	x0, x19
	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
LBB0_8:
	lsl	w8, w20, #30
Lloh31:
	adrp	x9, _V4L2_TUNER_MODE_STEREO@GOTPAGE
Lloh32:
	ldr	x9, [x9, _V4L2_TUNER_MODE_STEREO@GOTPAGEOFF]
Lloh33:
	ldr	w9, [x9]
	and	w8, w9, w8, asr #31
	orr	w19, w8, w19
	tbnz	w20, #2, LBB0_5
	b	LBB0_6
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh14, Lloh15, Lloh16
	.loh AdrpLdrGot	Lloh12, Lloh13
	.loh AdrpLdrGotLdr	Lloh17, Lloh18, Lloh19
	.loh AdrpLdrGotLdr	Lloh23, Lloh24, Lloh25
	.loh AdrpLdrGotLdr	Lloh20, Lloh21, Lloh22
	.loh AdrpAdd	Lloh29, Lloh30
	.loh AdrpLdrGotLdr	Lloh26, Lloh27, Lloh28
	.loh AdrpLdrGotLdr	Lloh31, Lloh32, Lloh33
	.cfi_endproc
                                        ; -- End function
	.comm	_V4L2_TUNER_MODE_MONO,4,2       ; @V4L2_TUNER_MODE_MONO
	.comm	_TDA9874A_DSR,4,2               ; @TDA9874A_DSR
	.comm	_TDA9874A_NSR,4,2               ; @TDA9874A_NSR
	.comm	_TDA9874A_NECR,4,2              ; @TDA9874A_NECR
	.comm	_MAXREGS,4,2                    ; @MAXREGS
	.comm	_tda9874a_mode,8,3              ; @tda9874a_mode
	.comm	_V4L2_TUNER_MODE_STEREO,4,2     ; @V4L2_TUNER_MODE_STEREO
	.comm	_V4L2_TUNER_MODE_LANG1,4,2      ; @V4L2_TUNER_MODE_LANG1
	.comm	_V4L2_TUNER_MODE_LANG2,4,2      ; @V4L2_TUNER_MODE_LANG2
	.comm	_debug,4,2                      ; @debug
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"tda9874a_getmode(): DSR=0x%X, NSR=0x%X, NECR=0x%X, return: %d.\n"

	.no_dead_strip	_tda9874a_getmode
.subsections_via_symbols
