	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function tvaudio_checkcarrier
_tvaudio_checkcarrier:                  ## @tvaudio_checkcarrier
	.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
	subq	$24, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rsi, %rbx
	movq	%rdi, %r13
	movq	_audio_debug@GOTPCREL(%rip), %rax
	cmpl	$2, (%rax)
	jl	LBB0_6
## %bb.1:
	movq	%rbx, %r12
	movl	(%rbx), %esi
	leaq	L_.str(%rip), %rdi
	xorl	%eax, %eax
	callq	_dprintk
	movl	$-180, %ebx
	movq	_SAA7134_LEVEL_READOUT1@GOTPCREL(%rip), %r15
	leaq	L_.str.2(%rip), %r14
	.p2align	4, 0x90
LBB0_2:                                 ## =>This Inner Loop Header: Depth=1
	movl	(%r12), %eax
	leal	(%rbx,%rax), %edx
	addl	$30, %edx
	movq	%r13, %rdi
	movl	%edx, %esi
	callq	_tvaudio_setcarrier
	movl	(%r15), %edi
	sarl	$2, %edi
	callq	_saa_readl
	movq	_SCAN_SAMPLE_DELAY@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r13, %rdi
	callq	_tvaudio_sleep
	testq	%rax, %rax
	jne	LBB0_3
## %bb.4:                               ##   in Loop: Header=BB0_2 Depth=1
	movl	(%r15), %edi
	sarl	$2, %edi
	callq	_saa_readl
	sarl	$16, %eax
	cmpl	$-30, %ebx
	movq	%r14, %rdi
	leaq	L_.str.1(%rip), %rcx
	cmoveq	%rcx, %rdi
	movl	%eax, %esi
	xorl	%eax, %eax
	callq	_printk
	addl	$30, %ebx
	cmpl	$121, %ebx
	jl	LBB0_2
## %bb.5:
	leaq	L_.str.3(%rip), %rdi
	xorl	%eax, %eax
	callq	_printk
	movq	%r12, %rbx
LBB0_6:
	movq	(%r13), %rax
	movl	(%rbx), %edx
	movl	4(%rbx), %ecx
	testl	%ecx, (%rax)
	je	LBB0_10
## %bb.7:
	addl	$-90, %edx
	movq	%r13, %rdi
	movl	%edx, %esi
	callq	_tvaudio_setcarrier
	movq	_SAA7134_LEVEL_READOUT1@GOTPCREL(%rip), %r14
	movl	(%r14), %edi
	sarl	$2, %edi
	callq	_saa_readl
	movq	_SCAN_SAMPLE_DELAY@GOTPCREL(%rip), %r12
	movl	(%r12), %esi
	movq	%r13, %rdi
	callq	_tvaudio_sleep
	movl	$-1, %r15d
	testq	%rax, %rax
	jne	LBB0_11
## %bb.8:
	movl	(%r14), %edi
	sarl	$2, %edi
	callq	_saa_readl
	movl	%eax, -44(%rbp)                 ## 4-byte Spill
	movl	(%rbx), %edx
	addl	$90, %edx
	movq	%r13, %rdi
	movl	%edx, %esi
	callq	_tvaudio_setcarrier
	movl	(%r14), %edi
	sarl	$2, %edi
	callq	_saa_readl
	movl	(%r12), %esi
	movq	%r13, %rdi
	callq	_tvaudio_sleep
	testq	%rax, %rax
	jne	LBB0_11
## %bb.9:
	movl	(%r14), %edi
	sarl	$2, %edi
	callq	_saa_readl
	movl	-44(%rbp), %r9d                 ## 4-byte Reload
	sarl	$16, %r9d
	sarl	$16, %eax
	movl	%r9d, %ecx
	subl	%eax, %ecx
	negl	%ecx
	movl	%r9d, %r15d
	subl	%eax, %r15d
	cmovlel	%ecx, %r15d
	movslq	(%rbx), %rdx
	imulq	$274877907, %rdx, %rsi          ## imm = 0x10624DD3
	movq	%rsi, %rcx
	shrq	$63, %rcx
	sarq	$38, %rsi
	addl	%ecx, %esi
	imull	$1000, %esi, %ecx               ## imm = 0x3E8
	subl	%ecx, %edx
	movl	8(%rbx), %ecx
	movl	%eax, (%rsp)
	leaq	L_.str.4(%rip), %rdi
                                        ## kill: def $esi killed $esi killed $rsi
                                        ## kill: def $edx killed $edx killed $rdx
	movl	%r15d, %r8d
	xorl	%eax, %eax
	callq	_dprintk
	jmp	LBB0_11
LBB0_10:
	movslq	%edx, %rax
	imulq	$274877907, %rax, %rsi          ## imm = 0x10624DD3
	movq	%rsi, %rax
	shrq	$63, %rax
	sarq	$38, %rsi
	addl	%eax, %esi
	imull	$1000, %esi, %eax               ## imm = 0x3E8
	subl	%eax, %edx
	movl	8(%rbx), %ecx
	leaq	L_.str.5(%rip), %rdi
	xorl	%r15d, %r15d
                                        ## kill: def $esi killed $esi killed $rsi
	xorl	%eax, %eax
	callq	_dprintk
	jmp	LBB0_11
LBB0_3:
	movl	$-1, %r15d
LBB0_11:
	movl	%r15d, %eax
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_audio_debug,4,2                ## @audio_debug
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"debug %d:"

	.comm	_SAA7134_LEVEL_READOUT1,4,2     ## @SAA7134_LEVEL_READOUT1
	.comm	_SCAN_SAMPLE_DELAY,4,2          ## @SCAN_SAMPLE_DELAY
L_.str.1:                               ## @.str.1
	.asciz	"  #  %6d  # "

L_.str.2:                               ## @.str.2
	.asciz	" %6d"

L_.str.3:                               ## @.str.3
	.asciz	"\n"

L_.str.4:                               ## @.str.4
	.asciz	"scanning %d.%03d MHz [%4s] =>  dc is %5d [%d/%d]\n"

L_.str.5:                               ## @.str.5
	.asciz	"skipping %d.%03d MHz [%4s]\n"

	.no_dead_strip	_tvaudio_checkcarrier
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function tvaudio_checkcarrier
_tvaudio_checkcarrier:                  ; @tvaudio_checkcarrier
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #128
	.cfi_def_cfa_offset 128
	stp	x26, x25, [sp, #48]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #64]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #80]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #96]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #112]            ; 16-byte Folded Spill
	add	x29, sp, #112
	.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
	.cfi_offset w25, -72
	.cfi_offset w26, -80
	mov	x19, x1
	mov	x20, x0
Lloh0:
	adrp	x8, _audio_debug@GOTPAGE
Lloh1:
	ldr	x8, [x8, _audio_debug@GOTPAGEOFF]
Lloh2:
	ldr	w8, [x8]
	cmp	w8, #2
	b.lt	LBB0_5
; %bb.1:
	ldr	w1, [x19]
Lloh3:
	adrp	x0, l_.str@PAGE
Lloh4:
	add	x0, x0, l_.str@PAGEOFF
	bl	_dprintk
	mov	w21, #-180
Lloh5:
	adrp	x22, _SAA7134_LEVEL_READOUT1@GOTPAGE
Lloh6:
	ldr	x22, [x22, _SAA7134_LEVEL_READOUT1@GOTPAGEOFF]
Lloh7:
	adrp	x23, _SCAN_SAMPLE_DELAY@GOTPAGE
Lloh8:
	ldr	x23, [x23, _SCAN_SAMPLE_DELAY@GOTPAGEOFF]
Lloh9:
	adrp	x24, l_.str.2@PAGE
Lloh10:
	add	x24, x24, l_.str.2@PAGEOFF
Lloh11:
	adrp	x25, l_.str.1@PAGE
Lloh12:
	add	x25, x25, l_.str.1@PAGEOFF
LBB0_2:                                 ; =>This Inner Loop Header: Depth=1
	ldr	w8, [x19]
	add	w8, w21, w8
	add	w1, w8, #30
	mov	x0, x20
	mov	x2, x1
	bl	_tvaudio_setcarrier
	ldr	w8, [x22]
	asr	w0, w8, #2
	bl	_saa_readl
	ldr	w1, [x23]
	mov	x0, x20
	bl	_tvaudio_sleep
	cbnz	x0, LBB0_8
; %bb.3:                                ;   in Loop: Header=BB0_2 Depth=1
	ldr	w8, [x22]
	asr	w0, w8, #2
	bl	_saa_readl
	asr	w8, w0, #16
	cmn	w21, #30
	csel	x0, x25, x24, eq
	str	x8, [sp]
	bl	_printk
	add	w21, w21, #30
	cmp	w21, #121
	b.lt	LBB0_2
; %bb.4:
Lloh13:
	adrp	x0, l_.str.3@PAGE
Lloh14:
	add	x0, x0, l_.str.3@PAGEOFF
	bl	_printk
LBB0_5:
	ldr	x8, [x20]
	ldr	w9, [x8]
	ldp	w8, w10, [x19]
	tst	w10, w9
	b.eq	LBB0_9
; %bb.6:
	sub	w1, w8, #90
	mov	x0, x20
	mov	x2, x1
	bl	_tvaudio_setcarrier
Lloh15:
	adrp	x22, _SAA7134_LEVEL_READOUT1@GOTPAGE
Lloh16:
	ldr	x22, [x22, _SAA7134_LEVEL_READOUT1@GOTPAGEOFF]
	ldr	w8, [x22]
	asr	w0, w8, #2
	bl	_saa_readl
Lloh17:
	adrp	x23, _SCAN_SAMPLE_DELAY@GOTPAGE
Lloh18:
	ldr	x23, [x23, _SCAN_SAMPLE_DELAY@GOTPAGEOFF]
	ldr	w1, [x23]
	mov	x0, x20
	bl	_tvaudio_sleep
	cbnz	x0, LBB0_8
; %bb.7:
	ldr	w8, [x22]
	asr	w0, w8, #2
	bl	_saa_readl
	mov	x21, x0
	ldr	w8, [x19]
	add	w1, w8, #90
	mov	x0, x20
	mov	x2, x1
	bl	_tvaudio_setcarrier
	ldr	w8, [x22]
	asr	w0, w8, #2
	bl	_saa_readl
	ldr	w1, [x23]
	mov	x0, x20
	bl	_tvaudio_sleep
	cbz	x0, LBB0_10
LBB0_8:
	mov	w20, #-1
	b	LBB0_11
LBB0_9:
	mov	w9, #19923
	movk	w9, #4194, lsl #16
	smull	x9, w8, w9
	lsr	x10, x9, #63
	asr	x9, x9, #38
	add	w1, w9, w10
	mov	w9, #1000
	msub	w8, w1, w9, w8
	ldr	w9, [x19, #8]
	stp	x8, x9, [sp]
Lloh19:
	adrp	x0, l_.str.5@PAGE
Lloh20:
	add	x0, x0, l_.str.5@PAGEOFF
	bl	_dprintk
	mov	w20, #0
	b	LBB0_11
LBB0_10:
	ldr	w8, [x22]
	asr	w0, w8, #2
	bl	_saa_readl
	asr	w8, w21, #16
	asr	w9, w0, #16
	sub	w10, w9, w8
	subs	w11, w8, w9
	csel	w20, w11, w10, gt
	ldr	w10, [x19]
	mov	w11, #19923
	movk	w11, #4194, lsl #16
	smull	x11, w10, w11
	lsr	x12, x11, #32
	lsr	x11, x11, #63
	add	w1, w11, w12, asr #6
	mov	w11, #1000
	msub	w10, w1, w11, w10
	ldr	w11, [x19, #8]
	stp	x8, x9, [sp, #24]
	stp	x11, x20, [sp, #8]
	str	x10, [sp]
Lloh21:
	adrp	x0, l_.str.4@PAGE
Lloh22:
	add	x0, x0, l_.str.4@PAGEOFF
	bl	_dprintk
LBB0_11:
	mov	x0, x20
	ldp	x29, x30, [sp, #112]            ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #96]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #80]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #64]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #48]             ; 16-byte Folded Reload
	add	sp, sp, #128
	ret
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpAdd	Lloh11, Lloh12
	.loh AdrpAdd	Lloh9, Lloh10
	.loh AdrpLdrGot	Lloh7, Lloh8
	.loh AdrpLdrGot	Lloh5, Lloh6
	.loh AdrpAdd	Lloh3, Lloh4
	.loh AdrpAdd	Lloh13, Lloh14
	.loh AdrpLdrGot	Lloh17, Lloh18
	.loh AdrpLdrGot	Lloh15, Lloh16
	.loh AdrpAdd	Lloh19, Lloh20
	.loh AdrpAdd	Lloh21, Lloh22
	.cfi_endproc
                                        ; -- End function
	.comm	_audio_debug,4,2                ; @audio_debug
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"debug %d:"

	.comm	_SAA7134_LEVEL_READOUT1,4,2     ; @SAA7134_LEVEL_READOUT1
	.comm	_SCAN_SAMPLE_DELAY,4,2          ; @SCAN_SAMPLE_DELAY
l_.str.1:                               ; @.str.1
	.asciz	"  #  %6d  # "

l_.str.2:                               ; @.str.2
	.asciz	" %6d"

l_.str.3:                               ; @.str.3
	.asciz	"\n"

l_.str.4:                               ; @.str.4
	.asciz	"scanning %d.%03d MHz [%4s] =>  dc is %5d [%d/%d]\n"

l_.str.5:                               ; @.str.5
	.asciz	"skipping %d.%03d MHz [%4s]\n"

	.no_dead_strip	_tvaudio_checkcarrier
.subsections_via_symbols
