	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_cx88_dsp_detect_stereo_sap     ## -- Begin function cx88_dsp_detect_stereo_sap
	.p2align	4, 0x90
_cx88_dsp_detect_stereo_sap:            ## @cx88_dsp_detect_stereo_sap
	.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, %r12
	movl	$0, -44(%rbp)
	movq	_UNSET@GOTPCREL(%rip), %r13
	movl	(%r13), %r14d
	movq	_MO_AUD_DMACNTRL@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	callq	_cx_read
	testb	$4, %al
	je	LBB0_11
## %bb.1:
	movq	_AUD_CTL@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	callq	_cx_read
	movq	_EN_FMRADIO_EN_RDS@GOTPCREL(%rip), %rcx
	testl	%eax, (%rcx)
	je	LBB0_11
## %bb.2:
	movq	_jiffies@GOTPCREL(%rip), %rax
	movl	(%rax), %r15d
	movq	8(%r12), %rbx
	movl	$500, %edi                      ## imm = 0x1F4
	callq	_msecs_to_jiffies
	addq	%rax, %rbx
	movl	%r15d, %edi
	movq	%rbx, %rsi
	callq	_time_before
	testq	%rax, %rax
	je	LBB0_3
LBB0_11:
	movl	%r14d, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_3:
	leaq	-44(%rbp), %rsi
	movq	%r12, %rdi
	callq	_read_rds_samples
	testq	%rax, %rax
	je	LBB0_11
## %bb.4:
	movq	%rax, %r15
	movl	$-129, %eax
	addl	(%r12), %eax
	cmpl	$9, %eax
	ja	LBB0_9
## %bb.5:
	movl	$705, %ecx                      ## imm = 0x2C1
	btl	%eax, %ecx
	jae	LBB0_6
## %bb.12:
	movl	-44(%rbp), %edx
	movq	%r12, %rdi
	movq	%r15, %rsi
	callq	_detect_a2_a2m_eiaj
	jmp	LBB0_8
LBB0_6:
	cmpl	$8, %eax
	jne	LBB0_9
## %bb.7:
	movl	-44(%rbp), %edx
	movq	%r12, %rdi
	movq	%r15, %rsi
	callq	_detect_btsc
LBB0_8:
	movl	%eax, %r14d
LBB0_9:
	movq	%r15, %rdi
	callq	_kfree
	cmpl	(%r13), %r14d
	je	LBB0_11
## %bb.10:
	movq	_V4L2_TUNER_SUB_MONO@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	andl	%r14d, %eax
	leaq	L_.str.2(%rip), %rax
	leaq	L_.str.1(%rip), %rdx
	cmoveq	%rax, %rdx
	movq	_V4L2_TUNER_SUB_STEREO@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	andl	%r14d, %ecx
	leaq	L_.str.3(%rip), %rcx
	cmoveq	%rax, %rcx
	movq	_V4L2_TUNER_SUB_LANG2@GOTPCREL(%rip), %rsi
	movl	(%rsi), %esi
	andl	%r14d, %esi
	leaq	L_.str.4(%rip), %r8
	cmoveq	%rax, %r8
	leaq	L_.str(%rip), %rsi
	movl	$1, %edi
	callq	_dprintk
	jmp	LBB0_11
	.cfi_endproc
                                        ## -- End function
	.comm	_UNSET,4,2                      ## @UNSET
	.comm	_MO_AUD_DMACNTRL,4,2            ## @MO_AUD_DMACNTRL
	.comm	_AUD_CTL,4,2                    ## @AUD_CTL
	.comm	_EN_FMRADIO_EN_RDS,4,2          ## @EN_FMRADIO_EN_RDS
	.comm	_jiffies,4,2                    ## @jiffies
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"stereo/sap detection result:%s%s%s\n"

	.comm	_V4L2_TUNER_SUB_MONO,4,2        ## @V4L2_TUNER_SUB_MONO
L_.str.1:                               ## @.str.1
	.asciz	" mono"

L_.str.2:                               ## @.str.2
	.space	1

	.comm	_V4L2_TUNER_SUB_STEREO,4,2      ## @V4L2_TUNER_SUB_STEREO
L_.str.3:                               ## @.str.3
	.asciz	" stereo"

	.comm	_V4L2_TUNER_SUB_LANG2,4,2       ## @V4L2_TUNER_SUB_LANG2
L_.str.4:                               ## @.str.4
	.asciz	" dual"

.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_cx88_dsp_detect_stereo_sap     ; -- Begin function cx88_dsp_detect_stereo_sap
	.p2align	2
_cx88_dsp_detect_stereo_sap:            ; @cx88_dsp_detect_stereo_sap
	.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	x20, x0
	str	wzr, [sp, #12]
Lloh0:
	adrp	x22, _UNSET@GOTPAGE
Lloh1:
	ldr	x22, [x22, _UNSET@GOTPAGEOFF]
	ldr	w19, [x22]
Lloh2:
	adrp	x8, _MO_AUD_DMACNTRL@GOTPAGE
Lloh3:
	ldr	x8, [x8, _MO_AUD_DMACNTRL@GOTPAGEOFF]
Lloh4:
	ldr	w0, [x8]
	bl	_cx_read
	tbz	w0, #2, LBB0_3
; %bb.1:
Lloh5:
	adrp	x8, _AUD_CTL@GOTPAGE
Lloh6:
	ldr	x8, [x8, _AUD_CTL@GOTPAGEOFF]
Lloh7:
	ldr	w0, [x8]
	bl	_cx_read
Lloh8:
	adrp	x8, _EN_FMRADIO_EN_RDS@GOTPAGE
Lloh9:
	ldr	x8, [x8, _EN_FMRADIO_EN_RDS@GOTPAGEOFF]
Lloh10:
	ldr	w8, [x8]
	tst	w8, w0
	b.eq	LBB0_3
; %bb.2:
Lloh11:
	adrp	x8, _jiffies@GOTPAGE
Lloh12:
	ldr	x8, [x8, _jiffies@GOTPAGEOFF]
Lloh13:
	ldr	w21, [x8]
	ldr	x23, [x20, #8]
	mov	w0, #500
	bl	_msecs_to_jiffies
	add	x1, x0, x23
	mov	x0, x21
	bl	_time_before
	cbz	x0, LBB0_4
LBB0_3:
	mov	x0, x19
	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
LBB0_4:
	add	x1, sp, #12
	mov	x0, x20
	bl	_read_rds_samples
	cbz	x0, LBB0_3
; %bb.5:
	mov	x21, x0
	ldr	w8, [x20]
	sub	w8, w8, #129
	cmp	w8, #9
	b.hi	LBB0_11
; %bb.6:
	mov	w9, #1
	lsl	w9, w9, w8
	mov	w10, #705
	tst	w9, w10
	b.eq	LBB0_8
; %bb.7:
	ldr	w2, [sp, #12]
	mov	x0, x20
	mov	x1, x21
	bl	_detect_a2_a2m_eiaj
	b	LBB0_10
LBB0_8:
	cmp	w8, #8
	b.ne	LBB0_11
; %bb.9:
	ldr	w2, [sp, #12]
	mov	x0, x20
	mov	x1, x21
	bl	_detect_btsc
LBB0_10:
	mov	x19, x0
LBB0_11:
	mov	x0, x21
	bl	_kfree
	ldr	w8, [x22]
	cmp	w19, w8
	b.eq	LBB0_3
; %bb.12:
Lloh14:
	adrp	x8, _V4L2_TUNER_SUB_MONO@GOTPAGE
Lloh15:
	ldr	x8, [x8, _V4L2_TUNER_SUB_MONO@GOTPAGEOFF]
Lloh16:
	ldr	w8, [x8]
Lloh17:
	adrp	x9, l_.str.1@PAGE
Lloh18:
	add	x9, x9, l_.str.1@PAGEOFF
Lloh19:
	adrp	x10, l_.str.2@PAGE
Lloh20:
	add	x10, x10, l_.str.2@PAGEOFF
	tst	w8, w19
	csel	x2, x10, x9, eq
Lloh21:
	adrp	x8, _V4L2_TUNER_SUB_STEREO@GOTPAGE
Lloh22:
	ldr	x8, [x8, _V4L2_TUNER_SUB_STEREO@GOTPAGEOFF]
Lloh23:
	ldr	w8, [x8]
Lloh24:
	adrp	x9, l_.str.3@PAGE
Lloh25:
	add	x9, x9, l_.str.3@PAGEOFF
	tst	w8, w19
Lloh26:
	adrp	x8, _V4L2_TUNER_SUB_LANG2@GOTPAGE
Lloh27:
	ldr	x8, [x8, _V4L2_TUNER_SUB_LANG2@GOTPAGEOFF]
	csel	x3, x10, x9, eq
Lloh28:
	ldr	w8, [x8]
Lloh29:
	adrp	x9, l_.str.4@PAGE
Lloh30:
	add	x9, x9, l_.str.4@PAGEOFF
	tst	w8, w19
	csel	x4, x10, x9, eq
Lloh31:
	adrp	x1, l_.str@PAGE
Lloh32:
	add	x1, x1, l_.str@PAGEOFF
	mov	w0, #1
	bl	_dprintk
	b	LBB0_3
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.loh AdrpAdd	Lloh31, Lloh32
	.loh AdrpAdd	Lloh29, Lloh30
	.loh AdrpLdrGotLdr	Lloh26, Lloh27, Lloh28
	.loh AdrpAdd	Lloh24, Lloh25
	.loh AdrpLdrGotLdr	Lloh21, Lloh22, Lloh23
	.loh AdrpAdd	Lloh19, Lloh20
	.loh AdrpAdd	Lloh17, Lloh18
	.loh AdrpLdrGotLdr	Lloh14, Lloh15, Lloh16
	.cfi_endproc
                                        ; -- End function
	.comm	_UNSET,4,2                      ; @UNSET
	.comm	_MO_AUD_DMACNTRL,4,2            ; @MO_AUD_DMACNTRL
	.comm	_AUD_CTL,4,2                    ; @AUD_CTL
	.comm	_EN_FMRADIO_EN_RDS,4,2          ; @EN_FMRADIO_EN_RDS
	.comm	_jiffies,4,2                    ; @jiffies
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"stereo/sap detection result:%s%s%s\n"

	.comm	_V4L2_TUNER_SUB_MONO,4,2        ; @V4L2_TUNER_SUB_MONO
l_.str.1:                               ; @.str.1
	.asciz	" mono"

l_.str.2:                               ; @.str.2
	.space	1

	.comm	_V4L2_TUNER_SUB_STEREO,4,2      ; @V4L2_TUNER_SUB_STEREO
l_.str.3:                               ; @.str.3
	.asciz	" stereo"

	.comm	_V4L2_TUNER_SUB_LANG2,4,2       ; @V4L2_TUNER_SUB_LANG2
l_.str.4:                               ; @.str.4
	.asciz	" dual"

.subsections_via_symbols
