	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function msp3400c_detect_stereo
_msp3400c_detect_stereo:                ## @msp3400c_detect_stereo
	.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, %r14
	callq	_i2c_get_clientdata
	movl	%eax, %edi
	callq	_to_state
	movq	%rax, %r15
	movl	8(%rax), %eax
	leal	-129(%rax), %ecx
	cmpl	$3, %ecx
	jae	LBB0_3
## %bb.1:
	movq	%r14, %rdi
	movl	$35, %esi
	callq	_msp_read_dem
	movl	%eax, %r13d
	movq	_msp_debug@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movl	%r13d, %ebx
	shrl	%ebx
	andl	$15, %ebx
	leaq	L_.str.1(%rip), %rcx
	movl	%r13d, %r8d
	andl	$1, %r8d
	xorl	%r12d, %r12d
	movq	%r14, %rdi
	movl	$2, %esi
	movl	%ebx, %r9d
	xorl	%eax, %eax
	callq	_dev_dbg_lvl
	andl	$1, %r13d
	jne	LBB0_7
## %bb.2:
	movq	_V4L2_TUNER_SUB_MONO@GOTPCREL(%rip), %rax
	jmp	LBB0_6
LBB0_3:
	cmpl	$128, %eax
	jne	LBB0_12
## %bb.4:
	movq	%r14, %rdi
	movl	$24, %esi
	callq	_msp_read_dsp
                                        ## kill: def $eax killed $eax def $rax
	leal	-65536(%rax), %ebx
	cmpl	$32768, %eax                    ## imm = 0x8000
	cmovll	%eax, %ebx
	movq	_msp_debug@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	leaq	L_.str(%rip), %rcx
	xorl	%r12d, %r12d
	movq	%r14, %rdi
	movl	$2, %esi
	movl	%ebx, %r8d
	xorl	%eax, %eax
	callq	_dev_dbg_lvl
	cmpl	$8193, %ebx                     ## imm = 0x2001
	jl	LBB0_14
## %bb.5:
	movq	_V4L2_TUNER_SUB_STEREO@GOTPCREL(%rip), %rax
LBB0_6:
	movl	(%rax), %r13d
	jmp	LBB0_20
LBB0_7:
	cmpl	$10, %ebx
	ja	LBB0_13
## %bb.8:
	movl	$257, %eax                      ## imm = 0x101
	btl	%ebx, %eax
	jb	LBB0_16
## %bb.9:
	movl	$514, %eax                      ## imm = 0x202
	btl	%ebx, %eax
	jb	LBB0_13
## %bb.10:
	movl	$1028, %eax                     ## imm = 0x404
	btl	%ebx, %eax
	jae	LBB0_13
## %bb.11:
	movq	_V4L2_TUNER_SUB_LANG1@GOTPCREL(%rip), %rax
	movq	_V4L2_TUNER_SUB_LANG2@GOTPCREL(%rip), %rcx
	movl	(%rcx), %r13d
	orl	(%rax), %r13d
	movl	$1, %r12d
	jmp	LBB0_20
LBB0_12:
	movl	(%r15), %r13d
	movl	4(%r15), %r12d
	jmp	LBB0_20
LBB0_13:
	movq	_V4L2_TUNER_SUB_MONO@GOTPCREL(%rip), %rax
	jmp	LBB0_17
LBB0_14:
	cmpl	$-4097, %ebx                    ## imm = 0xEFFF
	jg	LBB0_18
## %bb.15:
	movq	_V4L2_TUNER_SUB_LANG1@GOTPCREL(%rip), %rax
	movq	_V4L2_TUNER_SUB_LANG2@GOTPCREL(%rip), %rcx
	movl	(%rcx), %r13d
	orl	(%rax), %r13d
	jmp	LBB0_19
LBB0_16:
	movq	_V4L2_TUNER_SUB_STEREO@GOTPCREL(%rip), %rax
LBB0_17:
	movl	(%rax), %r13d
	movl	$1, %r12d
	jmp	LBB0_20
LBB0_18:
	movq	_V4L2_TUNER_SUB_MONO@GOTPCREL(%rip), %rax
	movl	(%rax), %r13d
LBB0_19:
	xorl	%r12d, %r12d
LBB0_20:
	movl	(%r15), %r8d
	xorl	%ebx, %ebx
	cmpl	%r8d, %r13d
	je	LBB0_22
## %bb.21:
	movq	_msp_debug@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	leaq	L_.str.2(%rip), %rcx
	movl	$1, %ebx
	movq	%r14, %rdi
	movl	$1, %esi
	movl	%r13d, %r9d
	xorl	%eax, %eax
	callq	_dev_dbg_lvl
	movl	%r13d, (%r15)
LBB0_22:
	movl	4(%r15), %r8d
	cmpl	%r8d, %r12d
	je	LBB0_24
## %bb.23:
	movq	_msp_debug@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	leaq	L_.str.3(%rip), %rcx
	movl	$1, %ebx
	movq	%r14, %rdi
	movl	$1, %esi
	movl	%r12d, %r9d
	xorl	%eax, %eax
	callq	_dev_dbg_lvl
	movl	%r12d, 4(%r15)
LBB0_24:
	movl	%ebx, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_msp_debug,4,2                  ## @msp_debug
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"stereo detect register: %d\n"

	.comm	_V4L2_TUNER_SUB_STEREO,4,2      ## @V4L2_TUNER_SUB_STEREO
	.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_MONO,4,2        ## @V4L2_TUNER_SUB_MONO
L_.str.1:                               ## @.str.1
	.asciz	"nicam sync=%d, mode=%d\n"

L_.str.2:                               ## @.str.2
	.asciz	"watch: rxsubchans %02x => %02x\n"

L_.str.3:                               ## @.str.3
	.asciz	"watch: nicam %d => %d\n"

	.no_dead_strip	_msp3400c_detect_stereo
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function msp3400c_detect_stereo
_msp3400c_detect_stereo:                ; @msp3400c_detect_stereo
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #80
	.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
	mov	x19, x0
	bl	_i2c_get_clientdata
	bl	_to_state
	mov	x20, x0
	ldr	w8, [x0, #8]
	sub	w9, w8, #129
	cmp	w9, #3
	b.hs	LBB0_3
; %bb.1:
	mov	x0, x19
	mov	w1, #35
	bl	_msp_read_dem
	mov	x21, x0
Lloh0:
	adrp	x8, _msp_debug@GOTPAGE
Lloh1:
	ldr	x8, [x8, _msp_debug@GOTPAGEOFF]
Lloh2:
	ldr	w2, [x8]
	and	w4, w0, #0x1
	ubfx	w22, w0, #1, #4
Lloh3:
	adrp	x3, l_.str.1@PAGE
Lloh4:
	add	x3, x3, l_.str.1@PAGEOFF
	str	x22, [sp]
	mov	x0, x19
	mov	w1, #2
	bl	_dev_dbg_lvl
	tbnz	w21, #0, LBB0_7
LBB0_2:
	mov	w22, #0
Lloh5:
	adrp	x8, _V4L2_TUNER_SUB_MONO@GOTPAGE
Lloh6:
	ldr	x8, [x8, _V4L2_TUNER_SUB_MONO@GOTPAGEOFF]
	b	LBB0_6
LBB0_3:
	cmp	w8, #128
	b.ne	LBB0_12
; %bb.4:
	mov	x0, x19
	mov	w1, #24
	bl	_msp_read_dsp
	sub	w8, w0, #16, lsl #12            ; =65536
	cmp	w0, #8, lsl #12                 ; =32768
	csel	w21, w8, w0, ge
Lloh7:
	adrp	x8, _msp_debug@GOTPAGE
Lloh8:
	ldr	x8, [x8, _msp_debug@GOTPAGEOFF]
Lloh9:
	ldr	w2, [x8]
Lloh10:
	adrp	x3, l_.str@PAGE
Lloh11:
	add	x3, x3, l_.str@PAGEOFF
	mov	x0, x19
	mov	w1, #2
	mov	x4, x21
	bl	_dev_dbg_lvl
	cmp	w21, #2, lsl #12                ; =8192
	b.le	LBB0_14
; %bb.5:
	mov	w22, #0
Lloh12:
	adrp	x8, _V4L2_TUNER_SUB_STEREO@GOTPAGE
Lloh13:
	ldr	x8, [x8, _V4L2_TUNER_SUB_STEREO@GOTPAGEOFF]
LBB0_6:
	ldr	w23, [x8]
	b	LBB0_19
LBB0_7:
	cmp	w22, #10
	b.hi	LBB0_13
; %bb.8:
	mov	w8, #1
	lsl	w8, w8, w22
	mov	w9, #257
	tst	w8, w9
	b.ne	LBB0_16
; %bb.9:
	mov	w9, #514
	tst	w8, w9
	b.ne	LBB0_13
; %bb.10:
	mov	w8, #1
	lsl	w8, w8, w22
	mov	w9, #1028
	tst	w8, w9
	b.eq	LBB0_13
; %bb.11:
Lloh14:
	adrp	x8, _V4L2_TUNER_SUB_LANG1@GOTPAGE
Lloh15:
	ldr	x8, [x8, _V4L2_TUNER_SUB_LANG1@GOTPAGEOFF]
Lloh16:
	ldr	w8, [x8]
Lloh17:
	adrp	x9, _V4L2_TUNER_SUB_LANG2@GOTPAGE
Lloh18:
	ldr	x9, [x9, _V4L2_TUNER_SUB_LANG2@GOTPAGEOFF]
Lloh19:
	ldr	w9, [x9]
	orr	w23, w9, w8
	b	LBB0_18
LBB0_12:
	ldp	w23, w22, [x20]
	b	LBB0_19
LBB0_13:
Lloh20:
	adrp	x8, _V4L2_TUNER_SUB_MONO@GOTPAGE
Lloh21:
	ldr	x8, [x8, _V4L2_TUNER_SUB_MONO@GOTPAGEOFF]
	b	LBB0_17
LBB0_14:
	mov	w8, #-4097
	cmp	w21, w8
	b.gt	LBB0_2
; %bb.15:
	mov	w22, #0
Lloh22:
	adrp	x8, _V4L2_TUNER_SUB_LANG1@GOTPAGE
Lloh23:
	ldr	x8, [x8, _V4L2_TUNER_SUB_LANG1@GOTPAGEOFF]
Lloh24:
	ldr	w8, [x8]
Lloh25:
	adrp	x9, _V4L2_TUNER_SUB_LANG2@GOTPAGE
Lloh26:
	ldr	x9, [x9, _V4L2_TUNER_SUB_LANG2@GOTPAGEOFF]
Lloh27:
	ldr	w9, [x9]
	orr	w23, w9, w8
	b	LBB0_19
LBB0_16:
Lloh28:
	adrp	x8, _V4L2_TUNER_SUB_STEREO@GOTPAGE
Lloh29:
	ldr	x8, [x8, _V4L2_TUNER_SUB_STEREO@GOTPAGEOFF]
LBB0_17:
	ldr	w23, [x8]
LBB0_18:
	mov	w22, #1
LBB0_19:
	ldr	w4, [x20]
	cmp	w23, w4
	b.ne	LBB0_21
; %bb.20:
	mov	w21, #0
	b	LBB0_22
LBB0_21:
Lloh30:
	adrp	x8, _msp_debug@GOTPAGE
Lloh31:
	ldr	x8, [x8, _msp_debug@GOTPAGEOFF]
Lloh32:
	ldr	w2, [x8]
	str	x23, [sp]
Lloh33:
	adrp	x3, l_.str.2@PAGE
Lloh34:
	add	x3, x3, l_.str.2@PAGEOFF
	mov	w21, #1
	mov	x0, x19
	mov	w1, #1
	bl	_dev_dbg_lvl
	str	w23, [x20]
LBB0_22:
	ldr	w4, [x20, #4]
	cmp	w22, w4
	b.eq	LBB0_24
; %bb.23:
Lloh35:
	adrp	x8, _msp_debug@GOTPAGE
Lloh36:
	ldr	x8, [x8, _msp_debug@GOTPAGEOFF]
Lloh37:
	ldr	w2, [x8]
	str	x22, [sp]
Lloh38:
	adrp	x3, l_.str.3@PAGE
Lloh39:
	add	x3, x3, l_.str.3@PAGEOFF
	mov	w21, #1
	mov	x0, x19
	mov	w1, #1
	bl	_dev_dbg_lvl
	str	w22, [x20, #4]
LBB0_24:
	mov	x0, x21
	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
	add	sp, sp, #80
	ret
	.loh AdrpAdd	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGot	Lloh5, Lloh6
	.loh AdrpAdd	Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh7, Lloh8, Lloh9
	.loh AdrpLdrGot	Lloh12, Lloh13
	.loh AdrpLdrGotLdr	Lloh17, Lloh18, Lloh19
	.loh AdrpLdrGotLdr	Lloh14, Lloh15, Lloh16
	.loh AdrpLdrGot	Lloh20, Lloh21
	.loh AdrpLdrGotLdr	Lloh25, Lloh26, Lloh27
	.loh AdrpLdrGotLdr	Lloh22, Lloh23, Lloh24
	.loh AdrpLdrGot	Lloh28, Lloh29
	.loh AdrpAdd	Lloh33, Lloh34
	.loh AdrpLdrGotLdr	Lloh30, Lloh31, Lloh32
	.loh AdrpAdd	Lloh38, Lloh39
	.loh AdrpLdrGotLdr	Lloh35, Lloh36, Lloh37
	.cfi_endproc
                                        ; -- End function
	.comm	_msp_debug,4,2                  ; @msp_debug
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"stereo detect register: %d\n"

	.comm	_V4L2_TUNER_SUB_STEREO,4,2      ; @V4L2_TUNER_SUB_STEREO
	.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_MONO,4,2        ; @V4L2_TUNER_SUB_MONO
l_.str.1:                               ; @.str.1
	.asciz	"nicam sync=%d, mode=%d\n"

l_.str.2:                               ; @.str.2
	.asciz	"watch: rxsubchans %02x => %02x\n"

l_.str.3:                               ; @.str.3
	.asciz	"watch: nicam %d => %d\n"

	.no_dead_strip	_msp3400c_detect_stereo
.subsections_via_symbols
