	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function m88rs6000t_set_demod_mclk
_m88rs6000t_set_demod_mclk:             ## @m88rs6000t_set_demod_mclk
	.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, %rbx
	movq	16(%rdi), %r12
	movl	8(%r12), %edi
	leaq	-56(%rbp), %rdx
	movl	$21, %esi
	callq	_regmap_read
	movl	%eax, %r13d
	testl	%eax, %eax
	jne	LBB0_21
## %bb.1:
	movl	-56(%rbp), %edi
	cmpl	$45010001, (%rbx)               ## imm = 0x2AECC51
	setge	%r8b
	movl	$115, %eax
	movl	$96, %esi
	cmovgel	%eax, %esi
	movq	8(%rbx), %rax
	movq	_SYS_DVBS@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	movl	$96000, %eax                    ## imm = 0x17700
	movl	$144000, %ecx                   ## imm = 0x23280
	cmovel	%eax, %ecx
	movl	%edi, %eax
	andl	$1, %eax
	shll	$8, %eax
	orl	%esi, %eax
	imull	$36000, %eax, %eax              ## imm = 0x8CA0
	addl	$1152000, %eax                  ## imm = 0x119400
	xorl	%edx, %edx
	divl	%ecx
	movl	%eax, %ebx
	cmpl	$32, %eax
	movl	%esi, -72(%rbp)                 ## 4-byte Spill
	movq	%rdi, -64(%rbp)                 ## 8-byte Spill
	movb	%r8b, -41(%rbp)                 ## 1-byte Spill
	ja	LBB0_3
## %bb.2:
	movl	$0, -48(%rbp)                   ## 4-byte Folded Spill
	movl	%ebx, %r15d
	shrl	%r15d
	subl	%r15d, %ebx
	movl	$1, -52(%rbp)                   ## 4-byte Folded Spill
	xorl	%r14d, %r14d
	jmp	LBB0_8
LBB0_3:
	cmpl	$48, %ebx
	ja	LBB0_5
## %bb.4:
	movzbl	%bl, %eax
	imull	$171, %eax, %eax
	shrl	$9, %eax
	movl	%eax, -48(%rbp)                 ## 4-byte Spill
	subl	%eax, %ebx
	movl	%ebx, %r15d
	shrl	%r15d
	subl	%r15d, %ebx
	xorl	%r14d, %r14d
	movl	$2, -52(%rbp)                   ## 4-byte Folded Spill
	jmp	LBB0_8
LBB0_5:
	cmpl	$64, %ebx
	ja	LBB0_6
## %bb.7:
	movl	$3, -52(%rbp)                   ## 4-byte Folded Spill
	movl	%ebx, %eax
	shrl	$2, %eax
	movl	%eax, -48(%rbp)                 ## 4-byte Spill
	subl	%eax, %ebx
	movzbl	%bl, %eax
	imull	$171, %eax, %r15d
	shrl	$9, %r15d
	subl	%r15d, %ebx
	movl	%ebx, %r14d
	shrl	%ebx
	subl	%ebx, %r14d
	jmp	LBB0_8
LBB0_6:
	movl	$3, -52(%rbp)                   ## 4-byte Folded Spill
	movl	$16, -48(%rbp)                  ## 4-byte Folded Spill
	movl	$16, %r15d
	movl	$16, %ebx
	movl	$16, %r14d
LBB0_8:
	movl	8(%r12), %edi
	leaq	-56(%rbp), %rdx
	movl	$29, %esi
	callq	_regmap_read
	movl	%eax, %r13d
	testl	%eax, %eax
	jne	LBB0_21
## %bb.9:
	xorl	%eax, %eax
	cmpl	$16, %ebx
	cmovel	%eax, %ebx
	movl	-48(%rbp), %ecx                 ## 4-byte Reload
	cmpl	$16, %ecx
	cmovel	%eax, %ecx
	movl	%ecx, -48(%rbp)                 ## 4-byte Spill
	movl	-56(%rbp), %ecx
	movl	%ecx, -68(%rbp)                 ## 4-byte Spill
	movl	%r14d, %ecx
	shll	$4, %ecx
	cmpl	$16, %r14d
	cmovel	%eax, %ecx
	movl	%ecx, %r14d
	movl	%r15d, %ecx
	shll	$4, %ecx
	cmpl	$16, %r15d
	movl	%ecx, %r15d
	cmovel	%eax, %r15d
	movl	8(%r12), %edi
	movl	$5, %esi
	movl	$64, %edx
	callq	_regmap_write
	movl	%eax, %r13d
	testl	%eax, %eax
	jne	LBB0_21
## %bb.10:
	movl	8(%r12), %edi
	movl	$17, %esi
	movl	$8, %edx
	callq	_regmap_write
	movl	%eax, %r13d
	testl	%eax, %eax
	jne	LBB0_21
## %bb.11:
	movq	-64(%rbp), %rcx                 ## 8-byte Reload
	andl	$-3, %ecx
	xorl	%eax, %eax
	movb	-41(%rbp), %dl                  ## 1-byte Reload
	movb	%dl, %al
	movq	%rax, -64(%rbp)                 ## 8-byte Spill
	leal	(%rcx,%rax,2), %edx
	movl	8(%r12), %edi
	movl	$21, %esi
	callq	_regmap_write
	movl	%eax, %r13d
	testl	%eax, %eax
	jne	LBB0_21
## %bb.12:
	movl	8(%r12), %edi
	movl	$22, %esi
	movl	-72(%rbp), %edx                 ## 4-byte Reload
	callq	_regmap_write
	movl	%eax, %r13d
	testl	%eax, %eax
	jne	LBB0_21
## %bb.13:
	movl	-68(%rbp), %edx                 ## 4-byte Reload
	andl	$-4, %edx
	addl	-52(%rbp), %edx                 ## 4-byte Folded Reload
	movl	8(%r12), %edi
	movl	$29, %esi
	callq	_regmap_write
	movl	%eax, %r13d
	testl	%eax, %eax
	jne	LBB0_21
## %bb.14:
	addl	%ebx, %r14d
	movzbl	%r14b, %edx
	movl	8(%r12), %edi
	movl	$30, %esi
	callq	_regmap_write
	movl	%eax, %r13d
	testl	%eax, %eax
	jne	LBB0_21
## %bb.15:
	addl	-48(%rbp), %r15d                ## 4-byte Folded Reload
	movzbl	%r15b, %edx
	movl	8(%r12), %edi
	movl	$31, %esi
	callq	_regmap_write
	movl	%eax, %r13d
	testl	%eax, %eax
	jne	LBB0_21
## %bb.16:
	movl	8(%r12), %edi
	movl	$23, %esi
	movl	$193, %edx
	callq	_regmap_write
	movl	%eax, %r13d
	testl	%eax, %eax
	jne	LBB0_21
## %bb.17:
	movl	8(%r12), %edi
	movl	$23, %esi
	movl	$129, %edx
	callq	_regmap_write
	movl	%eax, %r13d
	testl	%eax, %eax
	jne	LBB0_21
## %bb.18:
	movl	$5000, %edi                     ## imm = 0x1388
	movl	$50000, %esi                    ## imm = 0xC350
	callq	_usleep_range
	movl	8(%r12), %edi
	movl	$5, %esi
	xorl	%edx, %edx
	callq	_regmap_write
	movl	%eax, %r13d
	testl	%eax, %eax
	jne	LBB0_21
## %bb.19:
	movq	-64(%rbp), %rax                 ## 8-byte Reload
	leal	10(,%rax,4), %edx
	movl	8(%r12), %edi
	movl	$17, %esi
	callq	_regmap_write
	movl	%eax, %r13d
	testl	%eax, %eax
	je	LBB0_20
LBB0_21:
	movq	(%r12), %rdi
	leaq	L_.str(%rip), %rsi
	movl	%r13d, %edx
	callq	_dev_dbg
LBB0_22:
	movl	%r13d, %eax
	addq	$40, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_20:
	movl	$5000, %edi                     ## imm = 0x1388
	movl	$50000, %esi                    ## imm = 0xC350
	callq	_usleep_range
	xorl	%r13d, %r13d
	jmp	LBB0_22
	.cfi_endproc
                                        ## -- End function
	.comm	_SYS_DVBS,8,3                   ## @SYS_DVBS
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"failed=%d\n"

	.no_dead_strip	_m88rs6000t_set_demod_mclk
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function m88rs6000t_set_demod_mclk
_m88rs6000t_set_demod_mclk:             ; @m88rs6000t_set_demod_mclk
	.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	x23, x0
	ldr	x24, [x0, #16]
	ldr	w0, [x24, #8]
	add	x2, sp, #12
	mov	w1, #21
	bl	_regmap_read
	mov	x22, x0
	cbnz	w0, LBB0_20
; %bb.1:
	ldr	w21, [sp, #12]
	ldr	w8, [x23]
	mov	w9, #52304
	movk	w9, #686, lsl #16
	mov	w10, #96
	mov	w11, #115
	cmp	w8, w9
	csel	w20, w11, w10, gt
	cset	w25, gt
	mov	w8, #10
	mov	w9, #14
	csel	w12, w9, w8, gt
	ldr	x8, [x23, #8]
Lloh0:
	adrp	x9, _SYS_DVBS@GOTPAGE
Lloh1:
	ldr	x9, [x9, _SYS_DVBS@GOTPAGEOFF]
Lloh2:
	ldr	x9, [x9]
	cmp	x8, x9
	mov	w8, #12928
	movk	w8, #2, lsl #16
	mov	w9, #30464
	movk	w9, #1, lsl #16
	csel	w8, w9, w8, eq
	mov	x9, x20
	bfi	w9, w21, #8, #1
	mov	w10, #36000
	mov	w11, #37888
	movk	w11, #17, lsl #16
	madd	w9, w9, w10, w11
	udiv	w8, w9, w8
	cmp	w8, #32
	str	w12, [sp, #8]                   ; 4-byte Folded Spill
	b.hi	LBB0_3
; %bb.2:
	mov	w26, #0
	mov	w19, #0
	lsr	w27, w8, #1
	sub	w28, w8, w27
	mov	w23, #1
	b	LBB0_8
LBB0_3:
	cmp	w8, #48
	b.hi	LBB0_5
; %bb.4:
	mov	w19, #0
	and	w9, w8, #0xff
	mov	w10, #171
	mul	w9, w9, w10
	lsr	w26, w9, #9
	sub	w8, w8, w26
	lsr	w27, w8, #1
	sub	w28, w8, w27
	mov	w23, #2
	b	LBB0_8
LBB0_5:
	cmp	w8, #64
	b.hi	LBB0_7
; %bb.6:
	lsr	w26, w8, #2
	sub	w8, w8, w26
	and	w9, w8, #0xff
	mov	w10, #171
	mul	w9, w9, w10
	lsr	w27, w9, #9
	sub	w8, w8, w27
	lsr	w28, w8, #1
	sub	w19, w8, w28
	mov	w23, #3
	b	LBB0_8
LBB0_7:
	mov	w26, #16
	mov	w23, #3
	mov	w27, #16
	mov	w28, #16
	mov	w19, #16
LBB0_8:
	ldr	w0, [x24, #8]
	add	x2, sp, #12
	mov	w1, #29
	bl	_regmap_read
	mov	x22, x0
	cbnz	w0, LBB0_20
; %bb.9:
	cmp	w28, #16
	csel	w9, wzr, w28, eq
	cmp	w26, #16
	csel	w8, wzr, w26, eq
	stp	w8, w9, [sp]                    ; 8-byte Folded Spill
	ldr	w28, [sp, #12]
	lsl	w8, w19, #4
	cmp	w19, #16
	csel	w26, wzr, w8, eq
	lsl	w8, w27, #4
	ldr	w0, [x24, #8]
	cmp	w27, #16
	csel	w27, wzr, w8, eq
	mov	w1, #5
	mov	w2, #64
	bl	_regmap_write
	mov	x22, x0
	cbnz	w0, LBB0_20
; %bb.10:
	ldr	w0, [x24, #8]
	mov	w1, #17
	mov	w2, #8
	bl	_regmap_write
	mov	x22, x0
	cbnz	w0, LBB0_20
; %bb.11:
	bfi	w21, w25, #1, #1
	ldr	w0, [x24, #8]
	mov	w1, #21
	mov	x2, x21
	bl	_regmap_write
	mov	x22, x0
	cbnz	w0, LBB0_20
; %bb.12:
	ldr	w0, [x24, #8]
	mov	w1, #22
	mov	x2, x20
	bl	_regmap_write
	mov	x22, x0
	cbnz	w0, LBB0_20
; %bb.13:
	and	w8, w28, #0xfffffffc
	orr	w2, w8, w23
	ldr	w0, [x24, #8]
	mov	w1, #29
	bl	_regmap_write
	mov	x22, x0
	cbnz	w0, LBB0_20
; %bb.14:
	ldr	w8, [sp, #4]                    ; 4-byte Folded Reload
	add	w8, w26, w8
	and	w2, w8, #0xff
	ldr	w0, [x24, #8]
	mov	w1, #30
	bl	_regmap_write
	mov	x22, x0
	cbnz	w0, LBB0_20
; %bb.15:
	ldr	w8, [sp]                        ; 4-byte Folded Reload
	add	w8, w27, w8
	and	w2, w8, #0xff
	ldr	w0, [x24, #8]
	mov	w1, #31
	bl	_regmap_write
	mov	x22, x0
	cbnz	w0, LBB0_20
; %bb.16:
	ldr	w0, [x24, #8]
	mov	w1, #23
	mov	w2, #193
	bl	_regmap_write
	mov	x22, x0
	cbnz	w0, LBB0_20
; %bb.17:
	ldr	w0, [x24, #8]
	mov	w1, #23
	mov	w2, #129
	bl	_regmap_write
	mov	x22, x0
	cbnz	w0, LBB0_20
; %bb.18:
	mov	w0, #5000
	mov	w1, #50000
	bl	_usleep_range
	ldr	w0, [x24, #8]
	mov	w1, #5
	mov	w2, #0
	bl	_regmap_write
	mov	x22, x0
	cbnz	w0, LBB0_20
; %bb.19:
	ldr	w0, [x24, #8]
	mov	w1, #17
	ldr	w2, [sp, #8]                    ; 4-byte Folded Reload
	bl	_regmap_write
	mov	x22, x0
	cbz	w0, LBB0_22
LBB0_20:
	ldr	x0, [x24]
Lloh3:
	adrp	x1, l_.str@PAGE
Lloh4:
	add	x1, x1, l_.str@PAGEOFF
	mov	x2, x22
	bl	_dev_dbg
LBB0_21:
	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
LBB0_22:
	mov	w0, #5000
	mov	w1, #50000
	bl	_usleep_range
	b	LBB0_21
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpAdd	Lloh3, Lloh4
	.cfi_endproc
                                        ; -- End function
	.comm	_SYS_DVBS,8,3                   ; @SYS_DVBS
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"failed=%d\n"

	.no_dead_strip	_m88rs6000t_set_demod_mclk
.subsections_via_symbols
