	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function msp34xxg_detect_stereo
_msp34xxg_detect_stereo:                ## @msp34xxg_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	%rbx
	pushq	%rax
	.cfi_offset %rbx, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdi, %r14
	callq	_i2c_get_clientdata
	movl	%eax, %edi
	callq	_to_state
	movq	%rax, %rbx
	movq	%r14, %rdi
	movl	$512, %esi                      ## imm = 0x200
	callq	_msp_read_dem
	movq	8(%rbx), %rdx
	movq	_MSP_MODE_EXTERN@GOTPCREL(%rip), %rsi
	xorl	%ecx, %ecx
	cmpq	(%rsi), %rdx
	je	LBB0_7
## %bb.1:
	movl	%eax, %r10d
	andl	$256, %r10d                     ## imm = 0x100
	movl	%eax, %r9d
	movl	(%rbx), %r15d
	movl	$0, (%rbx)
	andl	$64, %r9d
	jne	LBB0_2
## %bb.3:
	movq	_V4L2_TUNER_SUB_MONO@GOTPCREL(%rip), %rcx
	jmp	LBB0_4
LBB0_2:
	movq	_V4L2_TUNER_SUB_STEREO@GOTPCREL(%rip), %rcx
LBB0_4:
	movl	(%rcx), %r11d
	movl	%r11d, (%rbx)
	testl	%r10d, %r10d
	je	LBB0_6
## %bb.5:
	movq	_V4L2_TUNER_SUB_LANG1@GOTPCREL(%rip), %rcx
	movq	_V4L2_TUNER_SUB_SAP@GOTPCREL(%rip), %rdx
	movq	_V4L2_TUNER_SUB_LANG2@GOTPCREL(%rip), %rsi
	movl	(%rsi), %esi
	orl	(%rdx), %r11d
	orl	(%rcx), %esi
	cmpl	$32, 16(%rbx)
	cmovel	%r11d, %esi
	movl	%esi, (%rbx)
	movl	%esi, %r11d
LBB0_6:
	movq	_msp_debug@GOTPCREL(%rip), %rcx
	movl	(%rcx), %edx
	leaq	L_.str(%rip), %rcx
	movq	%r14, %rdi
	movl	$1, %esi
	movl	%eax, %r8d
	pushq	%r11
	pushq	%r10
	callq	_dev_dbg_lvl
	addq	$16, %rsp
	xorl	%ecx, %ecx
	cmpl	(%rbx), %r15d
	setne	%cl
LBB0_7:
	movl	%ecx, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_MSP_MODE_EXTERN,8,3            ## @MSP_MODE_EXTERN
	.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_SAP,4,2         ## @V4L2_TUNER_SUB_SAP
	.comm	_V4L2_TUNER_SUB_LANG1,4,2       ## @V4L2_TUNER_SUB_LANG1
	.comm	_V4L2_TUNER_SUB_LANG2,4,2       ## @V4L2_TUNER_SUB_LANG2
	.comm	_msp_debug,4,2                  ## @msp_debug
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"status=0x%x, stereo=%d, bilingual=%d -> rxsubchans=%d\n"

	.no_dead_strip	_msp34xxg_detect_stereo
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function msp34xxg_detect_stereo
_msp34xxg_detect_stereo:                ; @msp34xxg_detect_stereo
	.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, x0
	bl	_i2c_get_clientdata
	bl	_to_state
	mov	x20, x0
	mov	x0, x19
	mov	w1, #512
	bl	_msp_read_dem
	ldr	x8, [x20, #8]
Lloh0:
	adrp	x9, _MSP_MODE_EXTERN@GOTPAGE
Lloh1:
	ldr	x9, [x9, _MSP_MODE_EXTERN@GOTPAGEOFF]
Lloh2:
	ldr	x9, [x9]
	cmp	x8, x9
	b.ne	LBB0_2
; %bb.1:
	mov	w0, #0
	b	LBB0_5
LBB0_2:
	mov	x4, x0
	ands	w5, w0, #0x40
	ldr	w21, [x20]
	str	wzr, [x20]
Lloh3:
	adrp	x8, _V4L2_TUNER_SUB_MONO@GOTPAGE
Lloh4:
	ldr	x8, [x8, _V4L2_TUNER_SUB_MONO@GOTPAGEOFF]
Lloh5:
	adrp	x9, _V4L2_TUNER_SUB_STEREO@GOTPAGE
Lloh6:
	ldr	x9, [x9, _V4L2_TUNER_SUB_STEREO@GOTPAGEOFF]
	csel	x8, x8, x9, eq
	ldr	w7, [x8]
	str	w7, [x20]
	and	w6, w0, #0x100
	cbz	w6, LBB0_4
; %bb.3:
	ldr	w8, [x20, #16]
Lloh7:
	adrp	x9, _V4L2_TUNER_SUB_LANG1@GOTPAGE
Lloh8:
	ldr	x9, [x9, _V4L2_TUNER_SUB_LANG1@GOTPAGEOFF]
Lloh9:
	ldr	w9, [x9]
Lloh10:
	adrp	x10, _V4L2_TUNER_SUB_SAP@GOTPAGE
Lloh11:
	ldr	x10, [x10, _V4L2_TUNER_SUB_SAP@GOTPAGEOFF]
Lloh12:
	ldr	w10, [x10]
Lloh13:
	adrp	x11, _V4L2_TUNER_SUB_LANG2@GOTPAGE
Lloh14:
	ldr	x11, [x11, _V4L2_TUNER_SUB_LANG2@GOTPAGEOFF]
Lloh15:
	ldr	w11, [x11]
	orr	w10, w10, w7
	orr	w9, w11, w9
	cmp	w8, #32
	csel	w7, w10, w9, eq
	str	w7, [x20]
LBB0_4:
Lloh16:
	adrp	x8, _msp_debug@GOTPAGE
Lloh17:
	ldr	x8, [x8, _msp_debug@GOTPAGEOFF]
Lloh18:
	ldr	w2, [x8]
Lloh19:
	adrp	x3, l_.str@PAGE
Lloh20:
	add	x3, x3, l_.str@PAGEOFF
	mov	x0, x19
	mov	w1, #1
	bl	_dev_dbg_lvl
	ldr	w8, [x20]
	cmp	w21, w8
	cset	w0, ne
LBB0_5:
	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	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGot	Lloh5, Lloh6
	.loh AdrpLdrGot	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh13, Lloh14, Lloh15
	.loh AdrpLdrGotLdr	Lloh10, Lloh11, Lloh12
	.loh AdrpLdrGotLdr	Lloh7, Lloh8, Lloh9
	.loh AdrpAdd	Lloh19, Lloh20
	.loh AdrpLdrGotLdr	Lloh16, Lloh17, Lloh18
	.cfi_endproc
                                        ; -- End function
	.comm	_MSP_MODE_EXTERN,8,3            ; @MSP_MODE_EXTERN
	.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_SAP,4,2         ; @V4L2_TUNER_SUB_SAP
	.comm	_V4L2_TUNER_SUB_LANG1,4,2       ; @V4L2_TUNER_SUB_LANG1
	.comm	_V4L2_TUNER_SUB_LANG2,4,2       ; @V4L2_TUNER_SUB_LANG2
	.comm	_msp_debug,4,2                  ; @msp_debug
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"status=0x%x, stereo=%d, bilingual=%d -> rxsubchans=%d\n"

	.no_dead_strip	_msp34xxg_detect_stereo
.subsections_via_symbols
