	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function stv6110x_set_bandwidth
_stv6110x_set_bandwidth:                ## @stv6110x_set_bandwidth
	.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), %rbx
	cmpl	$72000002, %esi                 ## imm = 0x44AA202
	jl	LBB0_2
## %bb.1:
	movq	(%rbx), %rax
	movq	_STV6110x_CTRL3@GOTPCREL(%rip), %rcx
	movq	(%rcx), %rcx
	movl	(%rax,%rcx,4), %edi
	movq	_CTRL3_CF@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movl	$31, %edx
	jmp	LBB0_5
LBB0_2:
	movl	%esi, %eax
	movq	(%rbx), %rcx
	movq	_STV6110x_CTRL3@GOTPCREL(%rip), %rdx
	movq	(%rdx), %rdx
	movl	(%rcx,%rdx,4), %edi
	movq	_CTRL3_CF@GOTPCREL(%rip), %rcx
	movl	(%rcx), %esi
	cmpl	$9999999, %eax                  ## imm = 0x98967F
	jg	LBB0_4
## %bb.3:
	xorl	%edx, %edx
	jmp	LBB0_5
LBB0_4:
	sarl	%eax
	cltq
	imulq	$1125899907, %rax, %rax         ## imm = 0x431BDE83
	movq	%rax, %rcx
	sarq	$50, %rcx
	shrq	$63, %rax
	leal	(%rcx,%rax), %edx
	addl	$-5, %edx
LBB0_5:
	callq	_STV6110x_SETFIELD
	movq	(%rbx), %rax
	movq	_STV6110x_CTRL3@GOTPCREL(%rip), %r14
	movq	(%r14), %rcx
	movl	(%rax,%rcx,4), %edi
	movq	_CTRL3_RCCLK_OFF@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	xorl	%edx, %edx
	callq	_STV6110x_SETFIELD
	movq	(%rbx), %rax
	movq	_STV6110x_STAT1@GOTPCREL(%rip), %r12
	movq	(%r12), %rcx
	movl	(%rax,%rcx,4), %edi
	movq	_STAT1_CALRC_STRT@GOTPCREL(%rip), %r13
	movl	(%r13), %esi
	movl	$1, %edx
	callq	_STV6110x_SETFIELD
	movq	(%r14), %rsi
	movq	(%rbx), %rax
	movl	(%rax,%rsi,4), %edx
	movq	%rbx, %rdi
	callq	_stv6110x_write_reg
	movq	(%r12), %rsi
	movq	(%rbx), %rax
	movl	(%rax,%rsi,4), %edx
	movq	%rbx, %rdi
	callq	_stv6110x_write_reg
	movq	_TRIALS@GOTPCREL(%rip), %r15
	cmpq	$0, (%r15)
	jle	LBB0_9
## %bb.6:
	xorl	%r14d, %r14d
	.p2align	4, 0x90
LBB0_7:                                 ## =>This Inner Loop Header: Depth=1
	movq	(%r12), %rsi
	leaq	(,%rsi,4), %rdx
	addq	(%rbx), %rdx
	movq	%rbx, %rdi
	callq	_stv6110x_read_reg
	movl	(%r13), %edi
	movq	(%rbx), %rax
	movq	(%r12), %rcx
	movl	(%rax,%rcx,4), %esi
	callq	_STV6110x_GETFIELD
	testl	%eax, %eax
	je	LBB0_9
## %bb.8:                               ##   in Loop: Header=BB0_7 Depth=1
	movl	$1, %edi
	callq	_msleep
	incq	%r14
	cmpq	(%r15), %r14
	jl	LBB0_7
LBB0_9:
	movq	(%rbx), %rax
	movq	_STV6110x_CTRL3@GOTPCREL(%rip), %r14
	movq	(%r14), %rcx
	movl	(%rax,%rcx,4), %edi
	movq	_CTRL3_RCCLK_OFF@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movl	$1, %edx
	callq	_STV6110x_SETFIELD
	movq	(%r14), %rsi
	movq	(%rbx), %rax
	movl	(%rax,%rsi,4), %edx
	movq	%rbx, %rdi
	callq	_stv6110x_write_reg
	xorl	%eax, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_STV6110x_CTRL3,8,3             ## @STV6110x_CTRL3
	.comm	_CTRL3_CF,4,2                   ## @CTRL3_CF
	.comm	_CTRL3_RCCLK_OFF,4,2            ## @CTRL3_RCCLK_OFF
	.comm	_STV6110x_STAT1,8,3             ## @STV6110x_STAT1
	.comm	_STAT1_CALRC_STRT,4,2           ## @STAT1_CALRC_STRT
	.comm	_TRIALS,8,3                     ## @TRIALS
	.no_dead_strip	_stv6110x_set_bandwidth
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function stv6110x_set_bandwidth
_stv6110x_set_bandwidth:                ; @stv6110x_set_bandwidth
	.cfi_startproc
; %bb.0:
	stp	x26, x25, [sp, #-80]!           ; 16-byte Folded Spill
	.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
	.cfi_offset w25, -72
	.cfi_offset w26, -80
	ldr	x19, [x0]
	mov	w9, #41474
	movk	w9, #1098, lsl #16
Lloh0:
	adrp	x20, _STV6110x_CTRL3@GOTPAGE
Lloh1:
	ldr	x20, [x20, _STV6110x_CTRL3@GOTPAGEOFF]
	cmp	w1, w9
	b.lt	LBB0_2
; %bb.1:
	ldr	x8, [x19]
	ldr	x9, [x20]
	ldr	w0, [x8, x9, lsl #2]
Lloh2:
	adrp	x8, _CTRL3_CF@GOTPAGE
Lloh3:
	ldr	x8, [x8, _CTRL3_CF@GOTPAGEOFF]
Lloh4:
	ldr	w1, [x8]
	mov	w2, #31
	b	LBB0_5
LBB0_2:
	mov	x8, x1
	ldr	x9, [x19]
	ldr	x10, [x20]
	ldr	w0, [x9, x10, lsl #2]
Lloh5:
	adrp	x9, _CTRL3_CF@GOTPAGE
Lloh6:
	ldr	x9, [x9, _CTRL3_CF@GOTPAGEOFF]
Lloh7:
	ldr	w1, [x9]
	mov	w9, #38527
	movk	w9, #152, lsl #16
	cmp	w8, w9
	b.gt	LBB0_4
; %bb.3:
	mov	w2, #0
	b	LBB0_5
LBB0_4:
	asr	w8, w8, #1
	mov	w9, #56963
	movk	w9, #17179, lsl #16
	smull	x8, w8, w9
	lsr	x9, x8, #63
	asr	x8, x8, #50
	add	w8, w8, w9
	sub	w2, w8, #5
LBB0_5:
	bl	_STV6110x_SETFIELD
	ldr	x8, [x19]
	ldr	x9, [x20]
	ldr	w0, [x8, x9, lsl #2]
Lloh8:
	adrp	x21, _CTRL3_RCCLK_OFF@GOTPAGE
Lloh9:
	ldr	x21, [x21, _CTRL3_RCCLK_OFF@GOTPAGEOFF]
	ldr	w1, [x21]
	mov	w2, #0
	bl	_STV6110x_SETFIELD
	ldr	x8, [x19]
Lloh10:
	adrp	x22, _STV6110x_STAT1@GOTPAGE
Lloh11:
	ldr	x22, [x22, _STV6110x_STAT1@GOTPAGEOFF]
	ldr	x9, [x22]
	ldr	w0, [x8, x9, lsl #2]
Lloh12:
	adrp	x23, _STAT1_CALRC_STRT@GOTPAGE
Lloh13:
	ldr	x23, [x23, _STAT1_CALRC_STRT@GOTPAGEOFF]
	ldr	w1, [x23]
	mov	w2, #1
	bl	_STV6110x_SETFIELD
	ldr	x1, [x20]
	ldr	x8, [x19]
	ldr	w2, [x8, x1, lsl #2]
	mov	x0, x19
	bl	_stv6110x_write_reg
	ldr	x1, [x22]
	ldr	x8, [x19]
	ldr	w2, [x8, x1, lsl #2]
	mov	x0, x19
	bl	_stv6110x_write_reg
Lloh14:
	adrp	x24, _TRIALS@GOTPAGE
Lloh15:
	ldr	x24, [x24, _TRIALS@GOTPAGEOFF]
	ldr	x8, [x24]
	cmp	x8, #1
	b.lt	LBB0_9
; %bb.6:
	mov	x25, #0
LBB0_7:                                 ; =>This Inner Loop Header: Depth=1
	ldr	x1, [x22]
	ldr	x8, [x19]
	add	x2, x8, x1, lsl #2
	mov	x0, x19
	bl	_stv6110x_read_reg
	ldr	w0, [x23]
	ldr	x8, [x19]
	ldr	x9, [x22]
	ldr	w1, [x8, x9, lsl #2]
	bl	_STV6110x_GETFIELD
	cbz	w0, LBB0_9
; %bb.8:                                ;   in Loop: Header=BB0_7 Depth=1
	mov	w0, #1
	bl	_msleep
	add	x25, x25, #1
	ldr	x8, [x24]
	cmp	x25, x8
	b.lt	LBB0_7
LBB0_9:
	ldr	x8, [x19]
	ldr	x9, [x20]
	ldr	w0, [x8, x9, lsl #2]
	ldr	w1, [x21]
	mov	w2, #1
	bl	_STV6110x_SETFIELD
	ldr	x1, [x20]
	ldr	x8, [x19]
	ldr	w2, [x8, x1, lsl #2]
	mov	x0, x19
	bl	_stv6110x_write_reg
	mov	w0, #0
	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
	ldp	x26, x25, [sp], #80             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpLdrGot	Lloh14, Lloh15
	.loh AdrpLdrGot	Lloh12, Lloh13
	.loh AdrpLdrGot	Lloh10, Lloh11
	.loh AdrpLdrGot	Lloh8, Lloh9
	.cfi_endproc
                                        ; -- End function
	.comm	_STV6110x_CTRL3,8,3             ; @STV6110x_CTRL3
	.comm	_CTRL3_CF,4,2                   ; @CTRL3_CF
	.comm	_CTRL3_RCCLK_OFF,4,2            ; @CTRL3_RCCLK_OFF
	.comm	_STV6110x_STAT1,8,3             ; @STV6110x_STAT1
	.comm	_STAT1_CALRC_STRT,4,2           ; @STAT1_CALRC_STRT
	.comm	_TRIALS,8,3                     ; @TRIALS
	.no_dead_strip	_stv6110x_set_bandwidth
.subsections_via_symbols
