	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_ch7006_setup_pll               ## -- Begin function ch7006_setup_pll
	.p2align	4, 0x90
_ch7006_setup_pll:                      ## @ch7006_setup_pll
	.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
	callq	_drm_i2c_encoder_get_client
	movq	%rax, -56(%rbp)                 ## 8-byte Spill
	movq	%rbx, %rdi
	callq	_to_ch7006_priv
	movq	8(%rax), %rcx
	movq	%rcx, -64(%rbp)                 ## 8-byte Spill
	movq	_CH7006_MAXN@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	movl	%ecx, -48(%rbp)                 ## 4-byte Spill
	testl	%ecx, %ecx
	jle	LBB0_1
## %bb.2:
	movq	(%rax), %rax
	movq	%rax, -72(%rbp)                 ## 8-byte Spill
	movq	_CH7006_MAXM@GOTPCREL(%rip), %rax
	movl	(%rax), %r11d
	movq	_CH7006_FREQ0@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, -44(%rbp)                 ## 4-byte Spill
	xorl	%ebx, %ebx
	xorl	%r13d, %r13d
	xorl	%edi, %edi
	xorl	%esi, %esi
	jmp	LBB0_3
	.p2align	4, 0x90
LBB0_4:                                 ##   in Loop: Header=BB0_3 Depth=1
	movl	%esi, %r15d
	movl	%edi, %r12d
	movl	%ebx, %r14d
LBB0_9:                                 ##   in Loop: Header=BB0_3 Depth=1
	incl	%r13d
	movl	%r14d, %ebx
	movl	%r12d, %edi
	movl	%r15d, %esi
	cmpl	-48(%rbp), %r13d                ## 4-byte Folded Reload
	je	LBB0_10
LBB0_3:                                 ## =>This Loop Header: Depth=1
                                        ##     Child Loop BB0_6 Depth 2
	testl	%r11d, %r11d
	jle	LBB0_4
## %bb.5:                               ##   in Loop: Header=BB0_3 Depth=1
	leal	2(%r13), %r10d
	imull	-44(%rbp), %r10d                ## 4-byte Folded Reload
	movq	-72(%rbp), %rax                 ## 8-byte Reload
	movq	(%rax), %r8
	xorl	%r9d, %r9d
	jmp	LBB0_6
	.p2align	4, 0x90
LBB0_8:                                 ##   in Loop: Header=BB0_6 Depth=2
	incl	%r9d
	movl	%r14d, %ebx
	movl	%r12d, %edi
	movl	%r15d, %esi
	cmpl	%r9d, %r11d
	je	LBB0_9
LBB0_6:                                 ##   Parent Loop BB0_3 Depth=1
                                        ## =>  This Inner Loop Header: Depth=2
	leal	2(%r9), %ecx
	movl	%r10d, %eax
	cltd
	idivl	%ecx
	movl	%eax, %r14d
	cltq
	subq	%r8, %rax
	movq	%rax, %rcx
	negq	%rcx
	cmovsq	%rax, %rcx
	movslq	%ebx, %rax
	subq	%r8, %rax
	movq	%rax, %rdx
	negq	%rdx
	cmovsq	%rax, %rdx
	movl	%r13d, %r15d
	movl	%r9d, %r12d
	cmpq	%rdx, %rcx
	jb	LBB0_8
## %bb.7:                               ##   in Loop: Header=BB0_6 Depth=2
	movl	%esi, %r15d
	movl	%edi, %r12d
	movl	%ebx, %r14d
	jmp	LBB0_8
LBB0_1:
	xorl	%r15d, %r15d
	xorl	%r12d, %r12d
	xorl	%r14d, %r14d
LBB0_10:
	movq	_CH7006_PLLOV_N_8@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movl	%r15d, %esi
	callq	_bitf
	movl	%eax, %r13d
	movq	_CH7006_PLLOV_M_8@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movl	%r12d, %esi
	callq	_bitf
	orl	%r13d, %eax
	movq	_CH7006_PLLOV@GOTPCREL(%rip), %rcx
	movq	(%rcx), %rcx
	movq	-64(%rbp), %rbx                 ## 8-byte Reload
	movl	%eax, (%rbx,%rcx,4)
	movq	_CH7006_PLLM_0@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movl	%r12d, %esi
	callq	_bitf
	movq	_CH7006_PLLM@GOTPCREL(%rip), %rcx
	movq	(%rcx), %rcx
	movl	%eax, (%rbx,%rcx,4)
	movq	_CH7006_PLLN_0@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movl	%r15d, %esi
	callq	_bitf
	movq	_CH7006_PLLN@GOTPCREL(%rip), %rcx
	movq	(%rcx), %rcx
	movl	%eax, (%rbx,%rcx,4)
	movq	_CH7006_PLL_CONTROL_CAPACITOR@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	cmpl	$107, %r15d
	jg	LBB0_12
## %bb.11:
	movq	_CH7006_PLL_CONTROL@GOTPCREL(%rip), %rcx
	movq	(%rcx), %rcx
	orl	%eax, (%rbx,%rcx,4)
	jmp	LBB0_13
LBB0_12:
	notl	%eax
	movq	_CH7006_PLL_CONTROL@GOTPCREL(%rip), %rcx
	movq	(%rcx), %rcx
	andl	%eax, (%rbx,%rcx,4)
LBB0_13:
	movq	-56(%rbp), %rdi                 ## 8-byte Reload
	xorl	%r9d, %r9d
	cmpl	$108, %r15d
	setl	%r9b
	leaq	L_.str(%rip), %rsi
	movl	%r15d, %edx
	movl	%r12d, %ecx
	movl	%r14d, %r8d
	addq	$40, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_ch7006_dbg                     ## TAILCALL
	.cfi_endproc
                                        ## -- End function
	.comm	_CH7006_MAXN,4,2                ## @CH7006_MAXN
	.comm	_CH7006_MAXM,4,2                ## @CH7006_MAXM
	.comm	_CH7006_FREQ0,4,2               ## @CH7006_FREQ0
	.comm	_CH7006_PLLOV_N_8,4,2           ## @CH7006_PLLOV_N_8
	.comm	_CH7006_PLLOV_M_8,4,2           ## @CH7006_PLLOV_M_8
	.comm	_CH7006_PLLOV,8,3               ## @CH7006_PLLOV
	.comm	_CH7006_PLLM_0,4,2              ## @CH7006_PLLM_0
	.comm	_CH7006_PLLM,8,3                ## @CH7006_PLLM
	.comm	_CH7006_PLLN_0,4,2              ## @CH7006_PLLN_0
	.comm	_CH7006_PLLN,8,3                ## @CH7006_PLLN
	.comm	_CH7006_PLL_CONTROL_CAPACITOR,4,2 ## @CH7006_PLL_CONTROL_CAPACITOR
	.comm	_CH7006_PLL_CONTROL,8,3         ## @CH7006_PLL_CONTROL
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"n=%d m=%d f=%d c=%d\n"

.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_ch7006_setup_pll               ; -- Begin function ch7006_setup_pll
	.p2align	2
_ch7006_setup_pll:                      ; @ch7006_setup_pll
	.cfi_startproc
; %bb.0:
	stp	x24, x23, [sp, #-64]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 64
	stp	x22, x21, [sp, #16]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #32]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #48]             ; 16-byte Folded Spill
	add	x29, sp, #48
	.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
	mov	x20, x0
	bl	_drm_i2c_encoder_get_client
	mov	x19, x0
	mov	x0, x20
	bl	_to_ch7006_priv
	ldr	x24, [x0, #8]
Lloh0:
	adrp	x8, _CH7006_MAXN@GOTPAGE
Lloh1:
	ldr	x8, [x8, _CH7006_MAXN@GOTPAGEOFF]
Lloh2:
	ldr	w8, [x8]
	cmp	w8, #1
	b.lt	LBB0_6
; %bb.1:
	mov	w20, #0
	mov	w9, #0
	mov	w21, #0
	mov	w22, #0
	ldr	x10, [x0]
Lloh3:
	adrp	x11, _CH7006_MAXM@GOTPAGE
Lloh4:
	ldr	x11, [x11, _CH7006_MAXM@GOTPAGEOFF]
Lloh5:
	ldr	w11, [x11]
Lloh6:
	adrp	x12, _CH7006_FREQ0@GOTPAGE
Lloh7:
	ldr	x12, [x12, _CH7006_FREQ0@GOTPAGEOFF]
Lloh8:
	ldr	w12, [x12]
	b	LBB0_3
LBB0_2:                                 ;   in Loop: Header=BB0_3 Depth=1
	add	w9, w9, #1
	cmp	w9, w8
	b.eq	LBB0_7
LBB0_3:                                 ; =>This Loop Header: Depth=1
                                        ;     Child Loop BB0_5 Depth 2
	cmp	w11, #1
	b.lt	LBB0_2
; %bb.4:                                ;   in Loop: Header=BB0_3 Depth=1
	mov	w13, #0
	add	w14, w9, #2
	mul	w14, w12, w14
	ldr	x15, [x10]
LBB0_5:                                 ;   Parent Loop BB0_3 Depth=1
                                        ; =>  This Inner Loop Header: Depth=2
	add	w16, w13, #2
	sdiv	w16, w14, w16
	sxtw	x17, w16
	subs	x17, x17, x15
	cneg	x17, x17, mi
	sxtw	x0, w20
	subs	x0, x0, x15
	cneg	x0, x0, mi
	cmp	x17, x0
	csel	w22, w9, w22, lo
	csel	w21, w13, w21, lo
	csel	w20, w16, w20, lo
	add	w13, w13, #1
	cmp	w11, w13
	b.ne	LBB0_5
	b	LBB0_2
LBB0_6:
	mov	w22, #0
	mov	w21, #0
	mov	w20, #0
LBB0_7:
Lloh9:
	adrp	x8, _CH7006_PLLOV_N_8@GOTPAGE
Lloh10:
	ldr	x8, [x8, _CH7006_PLLOV_N_8@GOTPAGEOFF]
Lloh11:
	ldr	w0, [x8]
	mov	x1, x22
	bl	_bitf
	mov	x23, x0
Lloh12:
	adrp	x8, _CH7006_PLLOV_M_8@GOTPAGE
Lloh13:
	ldr	x8, [x8, _CH7006_PLLOV_M_8@GOTPAGEOFF]
Lloh14:
	ldr	w0, [x8]
	mov	x1, x21
	bl	_bitf
	orr	w8, w0, w23
Lloh15:
	adrp	x9, _CH7006_PLLOV@GOTPAGE
Lloh16:
	ldr	x9, [x9, _CH7006_PLLOV@GOTPAGEOFF]
Lloh17:
	ldr	x9, [x9]
	str	w8, [x24, x9, lsl #2]
Lloh18:
	adrp	x8, _CH7006_PLLM_0@GOTPAGE
Lloh19:
	ldr	x8, [x8, _CH7006_PLLM_0@GOTPAGEOFF]
Lloh20:
	ldr	w0, [x8]
	mov	x1, x21
	bl	_bitf
Lloh21:
	adrp	x8, _CH7006_PLLM@GOTPAGE
Lloh22:
	ldr	x8, [x8, _CH7006_PLLM@GOTPAGEOFF]
Lloh23:
	ldr	x8, [x8]
	str	w0, [x24, x8, lsl #2]
Lloh24:
	adrp	x8, _CH7006_PLLN_0@GOTPAGE
Lloh25:
	ldr	x8, [x8, _CH7006_PLLN_0@GOTPAGEOFF]
Lloh26:
	ldr	w0, [x8]
	mov	x1, x22
	bl	_bitf
Lloh27:
	adrp	x8, _CH7006_PLLN@GOTPAGE
Lloh28:
	ldr	x8, [x8, _CH7006_PLLN@GOTPAGEOFF]
Lloh29:
	ldr	x8, [x8]
	str	w0, [x24, x8, lsl #2]
Lloh30:
	adrp	x8, _CH7006_PLL_CONTROL_CAPACITOR@GOTPAGE
Lloh31:
	ldr	x8, [x8, _CH7006_PLL_CONTROL_CAPACITOR@GOTPAGEOFF]
Lloh32:
	ldr	w8, [x8]
Lloh33:
	adrp	x9, _CH7006_PLL_CONTROL@GOTPAGE
Lloh34:
	ldr	x9, [x9, _CH7006_PLL_CONTROL@GOTPAGEOFF]
	cmp	w22, #107
	b.gt	LBB0_9
; %bb.8:
	ldr	x9, [x9]
	lsl	x9, x9, #2
	ldr	w10, [x24, x9]
	orr	w8, w10, w8
	b	LBB0_10
LBB0_9:
	ldr	x9, [x9]
	lsl	x9, x9, #2
	ldr	w10, [x24, x9]
	bic	w8, w10, w8
LBB0_10:
	str	w8, [x24, x9]
	cmp	w22, #108
	cset	w5, lt
Lloh35:
	adrp	x1, l_.str@PAGE
Lloh36:
	add	x1, x1, l_.str@PAGEOFF
	mov	x0, x19
	mov	x2, x22
	mov	x3, x21
	mov	x4, x20
	ldp	x29, x30, [sp, #48]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #32]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #16]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp], #64             ; 16-byte Folded Reload
	b	_ch7006_dbg
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGot	Lloh33, Lloh34
	.loh AdrpLdrGotLdr	Lloh30, Lloh31, Lloh32
	.loh AdrpLdrGotLdr	Lloh27, Lloh28, Lloh29
	.loh AdrpLdrGotLdr	Lloh24, Lloh25, Lloh26
	.loh AdrpLdrGotLdr	Lloh21, Lloh22, Lloh23
	.loh AdrpLdrGotLdr	Lloh18, Lloh19, Lloh20
	.loh AdrpLdrGotLdr	Lloh15, Lloh16, Lloh17
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpAdd	Lloh35, Lloh36
	.cfi_endproc
                                        ; -- End function
	.comm	_CH7006_MAXN,4,2                ; @CH7006_MAXN
	.comm	_CH7006_MAXM,4,2                ; @CH7006_MAXM
	.comm	_CH7006_FREQ0,4,2               ; @CH7006_FREQ0
	.comm	_CH7006_PLLOV_N_8,4,2           ; @CH7006_PLLOV_N_8
	.comm	_CH7006_PLLOV_M_8,4,2           ; @CH7006_PLLOV_M_8
	.comm	_CH7006_PLLOV,8,3               ; @CH7006_PLLOV
	.comm	_CH7006_PLLM_0,4,2              ; @CH7006_PLLM_0
	.comm	_CH7006_PLLM,8,3                ; @CH7006_PLLM
	.comm	_CH7006_PLLN_0,4,2              ; @CH7006_PLLN_0
	.comm	_CH7006_PLLN,8,3                ; @CH7006_PLLN
	.comm	_CH7006_PLL_CONTROL_CAPACITOR,4,2 ; @CH7006_PLL_CONTROL_CAPACITOR
	.comm	_CH7006_PLL_CONTROL,8,3         ; @CH7006_PLL_CONTROL
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"n=%d m=%d f=%d c=%d\n"

.subsections_via_symbols
