	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function stv0900_sw_algo
_stv0900_sw_algo:                       ## @stv0900_sw_algo
	.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	$40, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movl	%esi, %ebx
	movq	%rdi, %r15
	leaq	-72(%rbp), %rsi
	leaq	-44(%rbp), %rdx
	leaq	-68(%rbp), %rcx
	movl	%ebx, %r8d
	callq	_stv0900_get_sw_loop_params
	movq	(%r15), %rax
	movl	%ebx, -64(%rbp)                 ## 4-byte Spill
	movl	%ebx, %ecx
	movl	(%rax,%rcx,4), %eax
	leal	-129(%rax), %ecx
	cmpl	$2, %ecx
	movq	%r15, -56(%rbp)                 ## 8-byte Spill
	jae	LBB0_1
## %bb.17:
	cmpl	$32, 8(%r15)
	movq	_CARFREQ@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movl	$59, %eax
	movl	$239, %edx
	cmovgel	%eax, %edx
	movq	%r15, %rdi
	callq	_stv0900_write_reg
	movq	_FALSE@GOTPCREL(%rip), %r14
	movl	$73, %edx
	jmp	LBB0_4
LBB0_1:
	cmpl	$128, %eax
	jne	LBB0_3
## %bb.2:
	movq	-56(%rbp), %r15                 ## 8-byte Reload
	cmpl	$32, 8(%r15)
	movq	_CORRELABS@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movl	$121, %eax
	movl	$104, %edx
	cmovgel	%eax, %edx
	movq	%r15, %rdi
	callq	_stv0900_write_reg
	movq	_TRUE@GOTPCREL(%rip), %r14
	movl	$137, %edx
	jmp	LBB0_4
LBB0_3:
	movq	-56(%rbp), %r15                 ## 8-byte Reload
	cmpl	$32, 8(%r15)
	movq	_CARFREQ@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movl	$59, %eax
	movl	$239, %edx
	cmovgel	%eax, %edx
	movl	$121, %eax
	movl	$104, %r14d
	cmovgel	%eax, %r14d
	movq	%r15, %rdi
	callq	_stv0900_write_reg
	movq	_CORRELABS@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r15, %rdi
	movl	%r14d, %edx
	callq	_stv0900_write_reg
	movq	_FALSE@GOTPCREL(%rip), %r14
	movl	$201, %edx
LBB0_4:
	movq	_DMDCFGMD@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r15, %rdi
	callq	_stv0900_write_reg
	movl	(%r14), %eax
	movl	%eax, -60(%rbp)                 ## 4-byte Spill
	movb	$1, %r14b
	xorl	%r15d, %r15d
	.p2align	4, 0x90
LBB0_5:                                 ## =>This Inner Loop Header: Depth=1
	movl	-72(%rbp), %esi
	movl	-44(%rbp), %edx
	movl	-68(%rbp), %r8d
	movq	-56(%rbp), %r13                 ## 8-byte Reload
	movq	%r13, %rdi
	movl	-60(%rbp), %ecx                 ## 4-byte Reload
	movl	-64(%rbp), %ebx                 ## 4-byte Reload
	movl	%ebx, %r9d
	callq	_stv0900_search_carr_sw_loop
	movl	%eax, %r12d
	movq	%r13, %rdi
	movl	%ebx, %esi
	callq	_stv0900_check_signal_presence
	movl	%eax, %r13d
	movq	_TRUE@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	cmpl	%eax, %r12d
	je	LBB0_8
## %bb.6:                               ##   in Loop: Header=BB0_5 Depth=1
	testb	$1, %r15b
	jne	LBB0_8
## %bb.7:                               ##   in Loop: Header=BB0_5 Depth=1
	cmpl	%eax, %r13d
	je	LBB0_8
LBB0_14:                                ##   in Loop: Header=BB0_5 Depth=1
	movq	_FALSE@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	cmpl	%eax, %r12d
	setne	%cl
	notb	%r14b
	orb	%cl, %r14b
	testb	$1, %r14b
	jne	LBB0_16
## %bb.15:                              ##   in Loop: Header=BB0_5 Depth=1
	movb	$1, %r15b
	xorl	%r14d, %r14d
	cmpl	%eax, %r13d
	je	LBB0_5
	jmp	LBB0_16
	.p2align	4, 0x90
LBB0_8:                                 ##   in Loop: Header=BB0_5 Depth=1
	movq	-56(%rbp), %rbx                 ## 8-byte Reload
	cmpl	$32, 8(%rbx)
	movl	$237, %edx
	movl	$73, %eax
	cmovgel	%eax, %edx
	movq	_CARFREQ@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movl	$136, %r15d
	movl	$158, %eax
	cmovgel	%eax, %r15d
	movq	%rbx, %rdi
	callq	_stv0900_write_reg
	movq	_CORRELABS@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%rbx, %rdi
	movl	%r15d, %edx
	callq	_stv0900_write_reg
	movq	_HEADER_MODE@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%rbx, %rdi
	callq	_stv0900_get_bits
	movq	_STV0900_DVBS2_FOUND@GOTPCREL(%rip), %rcx
	cmpl	(%rcx), %eax
	jne	LBB0_14
## %bb.9:                               ##   in Loop: Header=BB0_5 Depth=1
	movq	_TRUE@GOTPCREL(%rip), %rax
	cmpl	(%rax), %r12d
	jne	LBB0_14
## %bb.10:                              ##   in Loop: Header=BB0_5 Depth=1
	movl	-44(%rbp), %edi
	callq	_msleep
	movq	_FLYWHEEL_CPT@GOTPCREL(%rip), %r15
	movl	(%r15), %esi
	movq	%rbx, %rdi
	callq	_stv0900_get_bits
	cmpl	$12, %eax
	jg	LBB0_14
## %bb.11:                              ##   in Loop: Header=BB0_5 Depth=1
	movl	-44(%rbp), %edi
	callq	_msleep
	movl	(%r15), %esi
	movq	%rbx, %rdi
	callq	_stv0900_get_bits
	cmpl	$12, %eax
	jg	LBB0_14
## %bb.12:                              ##   in Loop: Header=BB0_5 Depth=1
	movq	_FALSE@GOTPCREL(%rip), %rax
	movl	(%rax), %r12d
	testb	$1, %r14b
	je	LBB0_16
## %bb.13:                              ##   in Loop: Header=BB0_5 Depth=1
	movq	-56(%rbp), %rbx                 ## 8-byte Reload
	cmpl	$32, 8(%rbx)
	movq	_CORRELABS@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movl	$104, %edx
	movl	$121, %eax
	cmovgel	%eax, %edx
	movq	%rbx, %rdi
	callq	_stv0900_write_reg
	movq	_DMDCFGMD@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%rbx, %rdi
	movl	$137, %edx
	callq	_stv0900_write_reg
	jmp	LBB0_14
LBB0_16:
	movl	%r12d, %eax
	addq	$40, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_FALSE,4,2                      ## @FALSE
	.comm	_CARFREQ,4,2                    ## @CARFREQ
	.comm	_DMDCFGMD,4,2                   ## @DMDCFGMD
	.comm	_CORRELABS,4,2                  ## @CORRELABS
	.comm	_TRUE,4,2                       ## @TRUE
	.comm	_HEADER_MODE,4,2                ## @HEADER_MODE
	.comm	_STV0900_DVBS2_FOUND,4,2        ## @STV0900_DVBS2_FOUND
	.comm	_FLYWHEEL_CPT,4,2               ## @FLYWHEEL_CPT
	.no_dead_strip	_stv0900_sw_algo
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function stv0900_sw_algo
_stv0900_sw_algo:                       ; @stv0900_sw_algo
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #112
	.cfi_def_cfa_offset 112
	stp	x28, x27, [sp, #16]             ; 16-byte Folded Spill
	stp	x26, x25, [sp, #32]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #48]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #64]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #80]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #96]             ; 16-byte Folded Spill
	add	x29, sp, #96
	.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
	.cfi_offset w27, -88
	.cfi_offset w28, -96
	mov	x19, x1
	mov	x20, x0
	add	x1, sp, #12
	add	x2, sp, #8
	add	x3, sp, #4
	mov	x4, x19
	bl	_stv0900_get_sw_loop_params
	ldr	x8, [x20]
	ldr	w8, [x8, w19, uxtw #2]
	sub	w9, w8, #129
Lloh0:
	adrp	x10, _CARFREQ@GOTPAGE
Lloh1:
	ldr	x10, [x10, _CARFREQ@GOTPAGEOFF]
	cmp	w9, #2
	b.hs	LBB0_2
; %bb.1:
	ldr	w8, [x20, #8]
	mov	x26, x10
	ldr	w1, [x10]
	mov	w9, #239
	mov	w10, #59
	cmp	w8, #31
	csel	w2, w10, w9, gt
	mov	x0, x20
	bl	_stv0900_write_reg
Lloh2:
	adrp	x21, _FALSE@GOTPAGE
Lloh3:
	ldr	x21, [x21, _FALSE@GOTPAGEOFF]
	mov	w2, #73
	b	LBB0_5
LBB0_2:
	cmp	w8, #128
	b.ne	LBB0_4
; %bb.3:
	mov	x26, x10
	ldr	w8, [x20, #8]
Lloh4:
	adrp	x9, _CORRELABS@GOTPAGE
Lloh5:
	ldr	x9, [x9, _CORRELABS@GOTPAGEOFF]
Lloh6:
	ldr	w1, [x9]
	mov	w9, #104
	mov	w10, #121
	cmp	w8, #31
	csel	w2, w10, w9, gt
	mov	x0, x20
	bl	_stv0900_write_reg
Lloh7:
	adrp	x21, _TRUE@GOTPAGE
Lloh8:
	ldr	x21, [x21, _TRUE@GOTPAGEOFF]
	mov	w2, #137
	b	LBB0_5
LBB0_4:
	ldr	w8, [x20, #8]
	mov	x26, x10
	ldr	w1, [x10]
	mov	w9, #239
	mov	w10, #59
	cmp	w8, #31
	csel	w2, w10, w9, gt
	mov	w8, #104
	mov	w9, #121
	csel	w21, w9, w8, gt
	mov	x0, x20
	bl	_stv0900_write_reg
Lloh9:
	adrp	x8, _CORRELABS@GOTPAGE
Lloh10:
	ldr	x8, [x8, _CORRELABS@GOTPAGEOFF]
Lloh11:
	ldr	w1, [x8]
	mov	x0, x20
	mov	x2, x21
	bl	_stv0900_write_reg
Lloh12:
	adrp	x21, _FALSE@GOTPAGE
Lloh13:
	ldr	x21, [x21, _FALSE@GOTPAGEOFF]
	mov	w2, #201
LBB0_5:
Lloh14:
	adrp	x27, _TRUE@GOTPAGE
Lloh15:
	ldr	x27, [x27, _TRUE@GOTPAGEOFF]
Lloh16:
	adrp	x28, _FALSE@GOTPAGE
Lloh17:
	ldr	x28, [x28, _FALSE@GOTPAGEOFF]
Lloh18:
	adrp	x8, _DMDCFGMD@GOTPAGE
Lloh19:
	ldr	x8, [x8, _DMDCFGMD@GOTPAGEOFF]
Lloh20:
	ldr	w1, [x8]
	mov	x0, x20
	bl	_stv0900_write_reg
	mov	w24, #0
	ldr	w21, [x21]
	mov	w25, #1
LBB0_6:                                 ; =>This Inner Loop Header: Depth=1
	ldp	w2, w1, [sp, #8]
	ldr	w4, [sp, #4]
	mov	x0, x20
	mov	x3, x21
	mov	x5, x19
	bl	_stv0900_search_carr_sw_loop
	mov	x22, x0
	mov	x0, x20
	mov	x1, x19
	bl	_stv0900_check_signal_presence
	mov	x23, x0
	ldr	w8, [x27]
	cmp	w22, w8
	b.eq	LBB0_9
; %bb.7:                                ;   in Loop: Header=BB0_6 Depth=1
	tbnz	w24, #0, LBB0_9
; %bb.8:                                ;   in Loop: Header=BB0_6 Depth=1
	cmp	w23, w8
	b.ne	LBB0_14
LBB0_9:                                 ;   in Loop: Header=BB0_6 Depth=1
	ldr	w8, [x20, #8]
	ldr	w1, [x26]
	cmp	w8, #31
	mov	w8, #237
	mov	w9, #73
	csel	w2, w9, w8, gt
	mov	w8, #136
	mov	w9, #158
	csel	w24, w9, w8, gt
	mov	x0, x20
	bl	_stv0900_write_reg
Lloh21:
	adrp	x8, _CORRELABS@GOTPAGE
Lloh22:
	ldr	x8, [x8, _CORRELABS@GOTPAGEOFF]
Lloh23:
	ldr	w1, [x8]
	mov	x0, x20
	mov	x2, x24
	bl	_stv0900_write_reg
Lloh24:
	adrp	x8, _HEADER_MODE@GOTPAGE
Lloh25:
	ldr	x8, [x8, _HEADER_MODE@GOTPAGEOFF]
Lloh26:
	ldr	w1, [x8]
	mov	x0, x20
	bl	_stv0900_get_bits
Lloh27:
	adrp	x8, _STV0900_DVBS2_FOUND@GOTPAGE
Lloh28:
	ldr	x8, [x8, _STV0900_DVBS2_FOUND@GOTPAGEOFF]
Lloh29:
	ldr	w8, [x8]
	ldr	w9, [x27]
	cmp	w0, w8
	ccmp	w22, w9, #0, eq
	b.ne	LBB0_14
; %bb.10:                               ;   in Loop: Header=BB0_6 Depth=1
	ldr	w0, [sp, #8]
	bl	_msleep
Lloh30:
	adrp	x24, _FLYWHEEL_CPT@GOTPAGE
Lloh31:
	ldr	x24, [x24, _FLYWHEEL_CPT@GOTPAGEOFF]
	ldr	w1, [x24]
	mov	x0, x20
	bl	_stv0900_get_bits
	cmp	w0, #12
	b.gt	LBB0_14
; %bb.11:                               ;   in Loop: Header=BB0_6 Depth=1
	ldr	w0, [sp, #8]
	bl	_msleep
	ldr	w1, [x24]
	mov	x0, x20
	bl	_stv0900_get_bits
	cmp	w0, #12
	b.gt	LBB0_14
; %bb.12:                               ;   in Loop: Header=BB0_6 Depth=1
	ldr	w22, [x28]
	tbz	w25, #0, LBB0_16
; %bb.13:                               ;   in Loop: Header=BB0_6 Depth=1
	ldr	w8, [x20, #8]
Lloh32:
	adrp	x9, _CORRELABS@GOTPAGE
Lloh33:
	ldr	x9, [x9, _CORRELABS@GOTPAGEOFF]
Lloh34:
	ldr	w1, [x9]
	cmp	w8, #31
	mov	w8, #104
	mov	w9, #121
	csel	w2, w9, w8, gt
	mov	x0, x20
	bl	_stv0900_write_reg
Lloh35:
	adrp	x8, _DMDCFGMD@GOTPAGE
Lloh36:
	ldr	x8, [x8, _DMDCFGMD@GOTPAGEOFF]
Lloh37:
	ldr	w1, [x8]
	mov	x0, x20
	mov	w2, #137
	bl	_stv0900_write_reg
LBB0_14:                                ;   in Loop: Header=BB0_6 Depth=1
	ldr	w8, [x28]
	cmp	w22, w8
	cset	w9, ne
	orn	w9, w9, w25
	tbnz	w9, #0, LBB0_16
; %bb.15:                               ;   in Loop: Header=BB0_6 Depth=1
	mov	w25, #0
	mov	w24, #1
	cmp	w23, w8
	b.eq	LBB0_6
LBB0_16:
	mov	x0, x22
	ldp	x29, x30, [sp, #96]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #80]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #64]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #48]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #32]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #112
	ret
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpLdrGot	Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh4, Lloh5, Lloh6
	.loh AdrpLdrGot	Lloh12, Lloh13
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh18, Lloh19, Lloh20
	.loh AdrpLdrGot	Lloh16, Lloh17
	.loh AdrpLdrGot	Lloh14, Lloh15
	.loh AdrpLdrGotLdr	Lloh27, Lloh28, Lloh29
	.loh AdrpLdrGotLdr	Lloh24, Lloh25, Lloh26
	.loh AdrpLdrGotLdr	Lloh21, Lloh22, Lloh23
	.loh AdrpLdrGot	Lloh30, Lloh31
	.loh AdrpLdrGotLdr	Lloh35, Lloh36, Lloh37
	.loh AdrpLdrGotLdr	Lloh32, Lloh33, Lloh34
	.cfi_endproc
                                        ; -- End function
	.comm	_FALSE,4,2                      ; @FALSE
	.comm	_CARFREQ,4,2                    ; @CARFREQ
	.comm	_DMDCFGMD,4,2                   ; @DMDCFGMD
	.comm	_CORRELABS,4,2                  ; @CORRELABS
	.comm	_TRUE,4,2                       ; @TRUE
	.comm	_HEADER_MODE,4,2                ; @HEADER_MODE
	.comm	_STV0900_DVBS2_FOUND,4,2        ; @STV0900_DVBS2_FOUND
	.comm	_FLYWHEEL_CPT,4,2               ; @FLYWHEEL_CPT
	.no_dead_strip	_stv0900_sw_algo
.subsections_via_symbols
