	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_radeon_compute_pll_avivo       ## -- Begin function radeon_compute_pll_avivo
	.p2align	4, 0x90
_radeon_compute_pll_avivo:              ## @radeon_compute_pll_avivo
	.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	$56, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%r9, -88(%rbp)                  ## 8-byte Spill
	movq	%r8, -72(%rbp)                  ## 8-byte Spill
	movq	%rcx, -64(%rbp)                 ## 8-byte Spill
	movq	%rdx, %r13
	movq	%rdi, %r15
	movslq	%esi, %rax
	imulq	$1717986919, %rax, %r12         ## imm = 0x66666667
	movq	%r12, %rax
	shrq	$63, %rax
	sarq	$34, %r12
	addl	%eax, %r12d
	movl	%r12d, %esi
	callq	_avivo_get_post_div
	movl	%eax, %ebx
	movl	(%r15), %r14d
	movl	$0, -48(%rbp)
	movl	$0, -44(%rbp)
	movl	4(%r15), %eax
	movq	_RADEON_PLL_USE_REF_DIV@GOTPCREL(%rip), %rcx
	testl	%eax, (%rcx)
	je	LBB0_2
## %bb.1:
	movl	8(%r15), %r14d
LBB0_2:
	movq	_RADEON_PLL_USE_FRAC_FB_DIV@GOTPCREL(%rip), %rcx
	testl	%eax, (%rcx)
	movl	%ebx, -52(%rbp)                 ## 4-byte Spill
	movq	%r13, -80(%rbp)                 ## 8-byte Spill
	je	LBB0_3
## %bb.11:
	leaq	-48(%rbp), %r8
	leaq	-44(%rbp), %r9
	movq	%r15, %rdi
	movl	%r12d, %esi
	movl	%ebx, %edx
	movl	%r14d, %ecx
	callq	_avivo_get_fb_div
	imull	$100, -44(%rbp), %eax
	movl	12(%r15), %esi
	cltd
	idivl	%esi
                                        ## kill: def $eax killed $eax def $rax
	cmpl	$4, %eax
	jle	LBB0_12
## %bb.13:
	addl	$-5, %eax
	movl	$3435973837, %ecx               ## imm = 0xCCCCCCCD
	imulq	%rax, %rcx
	shrq	$35, %rcx
	incl	%ecx
	movl	%ecx, -44(%rbp)
	cmpl	$90, %eax
	jb	LBB0_14
## %bb.15:
	incl	-48(%rbp)
	movl	$0, -44(%rbp)
	xorl	%ecx, %ecx
	jmp	LBB0_14
LBB0_3:
	cmpl	16(%r15), %r14d
	jle	LBB0_4
## %bb.10:
	movl	12(%r15), %esi
	xorl	%ecx, %ecx
	movl	%r14d, %r8d
	jmp	LBB0_17
LBB0_12:
	movl	%eax, -44(%rbp)
	movl	%eax, %ecx
LBB0_14:
	movl	%r14d, %r8d
	movl	-52(%rbp), %ebx                 ## 4-byte Reload
LBB0_17:
	movl	-48(%rbp), %r9d
	leal	(%r9,%r9,4), %eax
	leal	(%rcx,%rax,2), %eax
	imull	%esi, %eax
	movl	%ebx, %edx
	imull	%r8d, %edx
	addl	%edx, %edx
	leal	(%rdx,%rdx,4), %esi
	cltd
	idivl	%esi
	movq	-80(%rbp), %rdx                 ## 8-byte Reload
	movl	%eax, (%rdx)
	movq	-64(%rbp), %rax                 ## 8-byte Reload
	movl	%r9d, (%rax)
	movq	-72(%rbp), %rax                 ## 8-byte Reload
	movl	%ecx, (%rax)
	movq	-88(%rbp), %rax                 ## 8-byte Reload
	movl	%r8d, (%rax)
	movq	16(%rbp), %rax
	movl	%ebx, (%rax)
	movl	(%rdx), %esi
	leaq	L_.str(%rip), %rdi
	movl	%r9d, %edx
                                        ## kill: def $ecx killed $ecx killed $rcx
	movl	%ebx, %r9d
	callq	_DRM_DEBUG_KMS
	addq	$56, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_4:
	movl	%ebx, %r13d
	imull	%r14d, %r13d
	jmp	LBB0_5
	.p2align	4, 0x90
LBB0_16:                                ##   in Loop: Header=BB0_5 Depth=1
	leal	1(%r14), %r8d
	addl	%ebx, %r13d
	cmpl	16(%r15), %r14d
	movl	%r8d, %r14d
	jge	LBB0_17
LBB0_5:                                 ## =>This Inner Loop Header: Depth=1
	movq	%r15, %rdi
	movl	%r12d, %esi
	movl	%ebx, %edx
	movl	%r14d, %ecx
	leaq	-48(%rbp), %r8
	leaq	-44(%rbp), %r9
	callq	_avivo_get_fb_div
	movl	12(%r15), %esi
	movl	%esi, %ecx
	shrl	$31, %ecx
	addl	%esi, %ecx
	sarl	%ecx
	movl	-48(%rbp), %eax
	cmpl	%ecx, -44(%rbp)
	jl	LBB0_7
## %bb.6:                               ##   in Loop: Header=BB0_5 Depth=1
	incl	%eax
	movl	%eax, -48(%rbp)
LBB0_7:                                 ##   in Loop: Header=BB0_5 Depth=1
	movl	$0, -44(%rbp)
	imull	%esi, %eax
	cltd
	idivl	%r13d
	imull	$10000, %eax, %eax              ## imm = 0x2710
	cltd
	idivl	%r12d
	movq	_MAX_TOLERANCE@GOTPCREL(%rip), %rcx
	movl	(%rcx), %edx
	leal	10000(%rdx), %edi
	xorl	%ecx, %ecx
	cmpl	%edi, %eax
	movl	-52(%rbp), %ebx                 ## 4-byte Reload
	jg	LBB0_16
## %bb.8:                               ##   in Loop: Header=BB0_5 Depth=1
	movl	$10000, %edi                    ## imm = 0x2710
	subl	%edx, %edi
	cmpl	%edi, %eax
	jl	LBB0_16
## %bb.9:
	movl	%r14d, %r8d
	jmp	LBB0_17
	.cfi_endproc
                                        ## -- End function
	.comm	_RADEON_PLL_USE_REF_DIV,4,2     ## @RADEON_PLL_USE_REF_DIV
	.comm	_RADEON_PLL_USE_FRAC_FB_DIV,4,2 ## @RADEON_PLL_USE_FRAC_FB_DIV
	.comm	_MAX_TOLERANCE,4,2              ## @MAX_TOLERANCE
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"%d, pll dividers - fb: %d.%d ref: %d, post %d\n"

.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_radeon_compute_pll_avivo       ; -- Begin function radeon_compute_pll_avivo
	.p2align	2
_radeon_compute_pll_avivo:              ; @radeon_compute_pll_avivo
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #128
	.cfi_def_cfa_offset 128
	stp	x28, x27, [sp, #32]             ; 16-byte Folded Spill
	stp	x26, x25, [sp, #48]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #64]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #80]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #96]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #112]            ; 16-byte Folded Spill
	add	x29, sp, #112
	.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, x6
	mov	x20, x5
	mov	x22, x4
	mov	x23, x3
	mov	x21, x2
	mov	x26, x0
	mov	w8, #26215
	movk	w8, #26214, lsl #16
	smull	x8, w1, w8
	lsr	x9, x8, #63
	asr	x8, x8, #34
	add	w27, w8, w9
	mov	x1, x27
	bl	_avivo_get_post_div
	mov	x24, x0
	str	xzr, [sp, #24]
	ldp	w25, w8, [x26]
Lloh0:
	adrp	x9, _RADEON_PLL_USE_REF_DIV@GOTPAGE
Lloh1:
	ldr	x9, [x9, _RADEON_PLL_USE_REF_DIV@GOTPAGEOFF]
Lloh2:
	ldr	w9, [x9]
	tst	w9, w8
	b.eq	LBB0_2
; %bb.1:
	ldr	w25, [x26, #8]
LBB0_2:
Lloh3:
	adrp	x9, _RADEON_PLL_USE_FRAC_FB_DIV@GOTPAGE
Lloh4:
	ldr	x9, [x9, _RADEON_PLL_USE_FRAC_FB_DIV@GOTPAGEOFF]
Lloh5:
	ldr	w9, [x9]
	tst	w9, w8
	b.eq	LBB0_6
; %bb.3:
	add	x4, sp, #28
	add	x5, sp, #24
	mov	x0, x26
	mov	x1, x27
	mov	x2, x24
	mov	x3, x25
	bl	_avivo_get_fb_div
	ldr	w8, [sp, #24]
	mov	w9, #100
	mul	w9, w8, w9
	ldr	w8, [x26, #12]
	sdiv	w3, w9, w8
	cmp	w3, #4
	b.le	LBB0_8
; %bb.4:
	sub	w9, w3, #5
	mov	w10, #52429
	movk	w10, #52428, lsl #16
	umull	x10, w9, w10
	lsr	x10, x10, #35
	add	w3, w10, #1
	str	w3, [sp, #24]
	cmp	w9, #90
	b.lo	LBB0_17
; %bb.5:
	mov	w3, #0
	ldr	w9, [sp, #28]
	add	w9, w9, #1
	stp	wzr, w9, [sp, #24]
	b	LBB0_17
LBB0_6:
	ldr	w8, [x26, #16]
	cmp	w25, w8
	b.le	LBB0_9
; %bb.7:
	mov	w3, #0
	ldr	w8, [x26, #12]
	b	LBB0_17
LBB0_8:
	str	w3, [sp, #24]
	b	LBB0_17
LBB0_9:
	stp	x20, x19, [sp, #8]              ; 16-byte Folded Spill
	mul	w28, w24, w25
	mov	w19, #10000
Lloh6:
	adrp	x20, _MAX_TOLERANCE@GOTPAGE
Lloh7:
	ldr	x20, [x20, _MAX_TOLERANCE@GOTPAGEOFF]
LBB0_10:                                ; =>This Inner Loop Header: Depth=1
	add	x4, sp, #28
	add	x5, sp, #24
	mov	x0, x26
	mov	x1, x27
	mov	x2, x24
	mov	x3, x25
	bl	_avivo_get_fb_div
	ldp	w10, w9, [sp, #24]
	ldr	w8, [x26, #12]
	cmp	w8, #0
	cinc	w11, w8, lt
	cmp	w10, w11, asr #1
	b.lt	LBB0_12
; %bb.11:                               ;   in Loop: Header=BB0_10 Depth=1
	add	w9, w9, #1
	str	w9, [sp, #28]
LBB0_12:                                ;   in Loop: Header=BB0_10 Depth=1
	str	wzr, [sp, #24]
	mul	w9, w9, w8
	sdiv	w9, w9, w28
	mul	w9, w9, w19
	sdiv	w9, w9, w27
	ldr	w10, [x20]
	sub	w11, w19, w10
	add	w10, w10, w19
	cmp	w9, w10
	ccmp	w9, w11, #8, le
	b.ge	LBB0_15
; %bb.13:                               ;   in Loop: Header=BB0_10 Depth=1
	add	w9, w25, #1
	ldr	w10, [x26, #16]
	add	w28, w28, w24
	cmp	w25, w10
	mov	x25, x9
	b.lt	LBB0_10
; %bb.14:
	mov	w3, #0
	mov	x25, x9
	b	LBB0_16
LBB0_15:
	mov	w3, #0
LBB0_16:
	ldp	x20, x19, [sp, #8]              ; 16-byte Folded Reload
LBB0_17:
	ldr	w2, [sp, #28]
	mov	w9, #10
	madd	w9, w2, w9, w3
	mul	w8, w9, w8
	mul	w9, w24, w25
	add	w9, w9, w9, lsl #2
	lsl	w9, w9, #1
	sdiv	w8, w8, w9
	str	w8, [x21]
	str	w2, [x23]
	str	w3, [x22]
	str	w25, [x20]
	str	w24, [x19]
	ldr	w1, [x21]
Lloh8:
	adrp	x0, l_.str@PAGE
Lloh9:
	add	x0, x0, l_.str@PAGEOFF
	mov	x4, x25
	mov	x5, x24
	bl	_DRM_DEBUG_KMS
	ldp	x29, x30, [sp, #112]            ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #96]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #80]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #64]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #48]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp, #32]             ; 16-byte Folded Reload
	add	sp, sp, #128
	ret
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGot	Lloh6, Lloh7
	.loh AdrpAdd	Lloh8, Lloh9
	.cfi_endproc
                                        ; -- End function
	.comm	_RADEON_PLL_USE_REF_DIV,4,2     ; @RADEON_PLL_USE_REF_DIV
	.comm	_RADEON_PLL_USE_FRAC_FB_DIV,4,2 ; @RADEON_PLL_USE_FRAC_FB_DIV
	.comm	_MAX_TOLERANCE,4,2              ; @MAX_TOLERANCE
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"%d, pll dividers - fb: %d.%d ref: %d, post %d\n"

.subsections_via_symbols
