	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function stb0899_search_tmg
_stb0899_search_tmg:                    ## @stb0899_search_tmg
	.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
	movq	%rdi, %r12
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	%rax, -48(%rbp)
	movq	_NOTIMING@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	%rax, 16(%rdi)
	movq	8(%rdi), %rbx
	movq	24(%rdi), %r14
	movq	32(%rdi), %r15
	callq	_stb0899_check_tmg
	movq	_TIMINGOK@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	je	LBB0_12
## %bb.1:
	movq	%rbx, %rax
	shrq	$63, %rax
	addq	%rbx, %rax
	sarq	%rax
	movq	%rax, %rcx
	orq	%r15, %rcx
	shrq	$32, %rcx
	je	LBB0_2
## %bb.3:
	cqto
	idivq	%r15
	movq	%rax, %rcx
	jmp	LBB0_4
LBB0_2:
                                        ## kill: def $eax killed $eax killed $rax
	xorl	%edx, %edx
	divl	%r15d
	movl	%eax, %ecx
LBB0_4:
	movq	%r14, %rax
	shrq	$63, %rax
	addq	%r14, %rax
	sarq	%rax
	movq	%rax, %rdx
	orq	%r15, %rdx
	shrq	$32, %rdx
	je	LBB0_5
## %bb.6:
	cqto
	idivq	%r15
	jmp	LBB0_7
LBB0_5:
                                        ## kill: def $eax killed $eax killed $rax
	xorl	%edx, %edx
	divl	%r15d
                                        ## kill: def $eax killed $eax def $rax
LBB0_7:
	movswl	%cx, %r15d
	cwtl
	movl	%eax, -68(%rbp)                 ## 4-byte Spill
	xorl	%r13d, %r13d
	movw	$3, %bx
	movl	%r15d, -64(%rbp)                ## 4-byte Spill
	.p2align	4, 0x90
LBB0_8:                                 ## =>This Inner Loop Header: Depth=1
	movl	40(%r12), %eax
	movl	%r15d, %ecx
	imull	%eax, %ecx
	movswl	%r13w, %r13d
	addl	%ecx, %r13d
	movl	%r13d, %ecx
	negw	%cx
	cmovsw	%r13w, %cx
	movzwl	%cx, %ecx
	xorl	%edx, %edx
	cmpl	%ecx, -68(%rbp)                 ## 4-byte Folded Reload
	setl	%dl
	subw	%dx, %bx
	je	LBB0_10
## %bb.9:                               ##   in Loop: Header=BB0_8 Depth=1
	movw	%bx, -58(%rbp)                  ## 2-byte Spill
	movq	_CFRM@GOTPCREL(%rip), %rax
	movl	(%rax), %ebx
	movl	-56(%rbp), %r14d
	movzwl	44(%r12), %eax
	imulw	%r13w, %ax
	movswl	%ax, %edi
	callq	_MSB
	movl	%ebx, %edi
	movl	%r14d, %esi
	movl	%eax, %edx
	callq	_STB0899_SETFIELD_VAL
	movq	_CFRL@GOTPCREL(%rip), %rax
	movl	(%rax), %ebx
	movl	-52(%rbp), %r14d
	movzwl	44(%r12), %eax
	imulw	%r13w, %ax
	movswl	%ax, %edi
	callq	_LSB
	movl	%ebx, %edi
	movzwl	-58(%rbp), %ebx                 ## 2-byte Folded Reload
	movl	%r14d, %esi
	movl	%eax, %edx
	callq	_STB0899_SETFIELD_VAL
	movq	_STB0899_CFRM@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r12, %rdi
	leaq	-56(%rbp), %rdx
	movl	$2, %ecx
	callq	_stb0899_write_regs
	movl	40(%r12), %eax
LBB0_10:                                ##   in Loop: Header=BB0_8 Depth=1
	negl	%eax
	movl	%eax, 40(%r12)
	movq	%r12, %rdi
	callq	_stb0899_check_tmg
	movq	%rax, %rcx
	movq	_TIMINGOK@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	cmpq	%rax, %rcx
	je	LBB0_12
## %bb.11:                              ##   in Loop: Header=BB0_8 Depth=1
	addl	-64(%rbp), %r15d                ## 4-byte Folded Reload
	testw	%bx, %bx
	jne	LBB0_8
LBB0_12:
	movq	16(%r12), %rcx
	cmpq	%rax, %rcx
	jne	LBB0_14
## %bb.13:
	movq	_STB0899_CFRM@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	leaq	-56(%rbp), %rdx
	movq	%r12, %rdi
	movl	$2, %ecx
	callq	_stb0899_read_regs
	movswl	44(%r12), %ebx
	movl	-56(%rbp), %edi
	movl	-52(%rbp), %esi
	callq	_MAKEWORD16
	imull	%eax, %ebx
	movl	%ebx, 48(%r12)
	movl	(%r12), %edi
	movq	_FE_DEBUG@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	leaq	L_.str(%rip), %rcx
	movl	$1, %edx
	movl	%ebx, %r8d
	callq	_dprintk
	movq	16(%r12), %rcx
LBB0_14:
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	cmpq	-48(%rbp), %rax
	jne	LBB0_16
## %bb.15:
	movl	%ecx, %eax
	addq	$40, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_16:
	callq	___stack_chk_fail
	.cfi_endproc
                                        ## -- End function
	.comm	_NOTIMING,8,3                   ## @NOTIMING
	.comm	_TIMINGOK,8,3                   ## @TIMINGOK
	.comm	_CFRM,4,2                       ## @CFRM
	.comm	_CFRL,4,2                       ## @CFRL
	.comm	_STB0899_CFRM,4,2               ## @STB0899_CFRM
	.comm	_FE_DEBUG,4,2                   ## @FE_DEBUG
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"------->TIMING OK ! Derot Freq = %d"

	.no_dead_strip	_stb0899_search_tmg
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function stb0899_search_tmg
_stb0899_search_tmg:                    ; @stb0899_search_tmg
	.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, x0
Lloh0:
	adrp	x8, ___stack_chk_guard@GOTPAGE
Lloh1:
	ldr	x8, [x8, ___stack_chk_guard@GOTPAGEOFF]
Lloh2:
	ldr	x8, [x8]
Lloh3:
	adrp	x9, _NOTIMING@GOTPAGE
Lloh4:
	ldr	x9, [x9, _NOTIMING@GOTPAGEOFF]
	str	x8, [sp, #8]
Lloh5:
	ldr	x8, [x9]
	str	x8, [x0, #16]
	ldp	x21, x20, [x0, #24]
	ldr	x22, [x0, #8]
	bl	_stb0899_check_tmg
Lloh6:
	adrp	x23, _TIMINGOK@GOTPAGE
Lloh7:
	ldr	x23, [x23, _TIMINGOK@GOTPAGEOFF]
	ldr	x8, [x23]
	cmp	x0, x8
	b.ne	LBB0_5
LBB0_1:
	ldr	x8, [x19, #16]
	cmp	x8, x0
	b.ne	LBB0_3
; %bb.2:
Lloh8:
	adrp	x8, _STB0899_CFRM@GOTPAGE
Lloh9:
	ldr	x8, [x8, _STB0899_CFRM@GOTPAGEOFF]
Lloh10:
	ldr	w1, [x8]
	mov	x2, sp
	mov	x0, x19
	mov	w3, #2
	bl	_stb0899_read_regs
	ldrsh	w20, [x19, #44]
	ldp	w0, w1, [sp]
	bl	_MAKEWORD16
	mul	w4, w0, w20
	str	w4, [x19, #48]
	ldr	w0, [x19]
Lloh11:
	adrp	x8, _FE_DEBUG@GOTPAGE
Lloh12:
	ldr	x8, [x8, _FE_DEBUG@GOTPAGEOFF]
Lloh13:
	ldr	w1, [x8]
Lloh14:
	adrp	x3, l_.str@PAGE
Lloh15:
	add	x3, x3, l_.str@PAGEOFF
	mov	w2, #1
	bl	_dprintk
	ldr	x8, [x19, #16]
LBB0_3:
	ldr	x9, [sp, #8]
Lloh16:
	adrp	x10, ___stack_chk_guard@GOTPAGE
Lloh17:
	ldr	x10, [x10, ___stack_chk_guard@GOTPAGEOFF]
Lloh18:
	ldr	x10, [x10]
	cmp	x10, x9
	b.ne	LBB0_9
; %bb.4:
	mov	x0, x8
	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
LBB0_5:
	mov	w24, #0
	cmp	x22, #0
	cinc	x8, x22, lt
	asr	x8, x8, #1
	sdiv	x8, x8, x20
	cmp	x21, #0
	cinc	x9, x21, lt
	asr	x9, x9, #1
	sxth	w28, w8
	sdiv	x8, x9, x20
	sxth	w26, w8
	mov	w27, #3
Lloh19:
	adrp	x22, _CFRL@GOTPAGE
Lloh20:
	ldr	x22, [x22, _CFRL@GOTPAGEOFF]
	mov	x25, x28
	b	LBB0_7
LBB0_6:                                 ;   in Loop: Header=BB0_7 Depth=1
	neg	w8, w8
	str	w8, [x19, #40]
	mov	x0, x19
	bl	_stb0899_check_tmg
	mov	x8, x0
	ldr	x0, [x23]
	add	w25, w25, w28
	cmp	x8, x0
	and	w8, w27, #0xffff
	ccmp	w8, #0, #4, ne
	b.eq	LBB0_1
LBB0_7:                                 ; =>This Inner Loop Header: Depth=1
	ldr	w8, [x19, #40]
	mul	w9, w25, w8
	add	w24, w9, w24, sxth
	sxth	w9, w24
	cmp	w9, #0
	cneg	w9, w9, mi
	cmp	w26, w9, uxth
	cset	w9, lt
	sub	w27, w27, w9
	tst	w27, #0xffff
	b.eq	LBB0_6
; %bb.8:                                ;   in Loop: Header=BB0_7 Depth=1
Lloh21:
	adrp	x8, _CFRM@GOTPAGE
Lloh22:
	ldr	x8, [x8, _CFRM@GOTPAGEOFF]
Lloh23:
	ldr	w20, [x8]
	ldr	w21, [sp]
	ldrh	w8, [x19, #44]
	mul	w8, w8, w24
	sxth	w0, w8
	bl	_MSB
	mov	x2, x0
	mov	x0, x20
	mov	x1, x21
	bl	_STB0899_SETFIELD_VAL
	ldr	w20, [x22]
	ldr	w21, [sp, #4]
	ldrh	w8, [x19, #44]
	mul	w8, w8, w24
	sxth	w0, w8
	bl	_LSB
	mov	x2, x0
	mov	x0, x20
	mov	x1, x21
	bl	_STB0899_SETFIELD_VAL
Lloh24:
	adrp	x8, _STB0899_CFRM@GOTPAGE
Lloh25:
	ldr	x8, [x8, _STB0899_CFRM@GOTPAGEOFF]
Lloh26:
	ldr	w1, [x8]
	mov	x2, sp
	mov	x0, x19
	mov	w3, #2
	bl	_stb0899_write_regs
	ldr	w8, [x19, #40]
	b	LBB0_6
LBB0_9:
	bl	___stack_chk_fail
	.loh AdrpLdrGot	Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpAdd	Lloh14, Lloh15
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh16, Lloh17, Lloh18
	.loh AdrpLdrGot	Lloh19, Lloh20
	.loh AdrpLdrGotLdr	Lloh24, Lloh25, Lloh26
	.loh AdrpLdrGotLdr	Lloh21, Lloh22, Lloh23
	.cfi_endproc
                                        ; -- End function
	.comm	_NOTIMING,8,3                   ; @NOTIMING
	.comm	_TIMINGOK,8,3                   ; @TIMINGOK
	.comm	_CFRM,4,2                       ; @CFRM
	.comm	_CFRL,4,2                       ; @CFRL
	.comm	_STB0899_CFRM,4,2               ; @STB0899_CFRM
	.comm	_FE_DEBUG,4,2                   ; @FE_DEBUG
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"------->TIMING OK ! Derot Freq = %d"

	.no_dead_strip	_stb0899_search_tmg
.subsections_via_symbols
