	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_gt215_pll_calc                 ## -- Begin function gt215_pll_calc
	.p2align	4, 0x90
_gt215_pll_calc:                        ## @gt215_pll_calc
	.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	$24, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movl	%edx, %ebx
	movq	%rsi, %r14
	movl	16(%rsi), %eax
	cltd
	idivl	%ebx
	movq	16(%rbp), %rsi
	movl	%eax, (%rsi)
	movl	(%r14), %edx
	cmpl	%edx, %eax
	cmovll	%eax, %edx
	movl	%edx, (%rsi)
	movl	4(%r14), %eax
	cmpl	%eax, %edx
	cmovlel	%eax, %edx
	movq	%r9, -56(%rbp)                  ## 8-byte Spill
	movq	%r8, %r15
	movq	%rcx, -48(%rbp)                 ## 8-byte Spill
	movq	%rdi, -64(%rbp)                 ## 8-byte Spill
	movl	%edx, (%rsi)
	movl	20(%r14), %ecx
	movl	48(%r14), %esi
	movl	8(%r14), %eax
	addl	%ecx, %eax
	cltd
	idivl	%ecx
	movl	%eax, %edi
	callq	_max
	movl	%eax, %r13d
	movl	24(%r14), %ecx
	movl	40(%r14), %esi
	movl	8(%r14), %eax
	addl	%ecx, %eax
	cltd
	idivl	%ecx
	movl	%eax, %edi
	callq	_min
	movl	%eax, %r12d
	movl	%r13d, %edi
	movl	%eax, %esi
	callq	_min
	cmpl	%r12d, %eax
	jle	LBB0_1
LBB0_10:
	movl	$1, %edi
	callq	_unlikely
	testq	%rax, %rax
	je	LBB0_12
## %bb.11:
	leaq	L_.str(%rip), %rsi
	movq	-64(%rbp), %rdi                 ## 8-byte Reload
	callq	_nvkm_error
	movq	_EINVAL@GOTPCREL(%rip), %rax
	xorl	%r11d, %r11d
	subl	(%rax), %r11d
	jmp	LBB0_13
LBB0_1:
	movl	%ebx, %r11d
	movl	%eax, %ecx
	movq	16(%rbp), %rax
	movl	(%rax), %r10d
	movl	8(%r14), %ebx
	movl	28(%r14), %r8d
	movl	%ebx, %edi
	shrl	$31, %edi
	addl	%ebx, %edi
	sarl	%edi
	subl	%ecx, %r12d
	incl	%r12d
	imull	%r10d, %ecx
	imull	%r11d, %ecx
	imull	%r11d, %r10d
	movl	%ebx, %r9d
	negl	%r9d
	jmp	LBB0_2
	.p2align	4, 0x90
LBB0_9:                                 ##   in Loop: Header=BB0_2 Depth=1
	addl	%r10d, %ecx
	decl	%r12d
	je	LBB0_10
LBB0_2:                                 ## =>This Inner Loop Header: Depth=1
	movl	%ecx, %eax
	cltd
	idivl	%ebx
	xorl	%esi, %esi
	testq	%r15, %r15
	je	LBB0_3
## %bb.4:                               ##   in Loop: Header=BB0_2 Depth=1
	cmpl	%edi, %edx
	setl	%sil
	subl	%esi, %eax
	movl	%r9d, %edx
	imull	%eax, %edx
	addl	%ecx, %edx
	cmpl	%r8d, %eax
	jl	LBB0_9
	jmp	LBB0_6
	.p2align	4, 0x90
LBB0_3:                                 ##   in Loop: Header=BB0_2 Depth=1
	cmpl	%edi, %edx
	setge	%sil
	addl	%esi, %eax
	cmpl	%r8d, %eax
	jl	LBB0_9
LBB0_6:                                 ##   in Loop: Header=BB0_2 Depth=1
	cmpl	32(%r14), %eax
	jg	LBB0_10
## %bb.7:                               ##   in Loop: Header=BB0_2 Depth=1
	testq	%r15, %r15
	je	LBB0_9
## %bb.8:
	shll	$13, %edx
	movl	8(%r14), %ecx
	movl	%ecx, %eax
	shrl	$31, %eax
	addl	%ecx, %eax
	sarl	%eax
	addl	%edx, %eax
	cltd
	idivl	%ecx
	addl	$61440, %eax                    ## imm = 0xF000
	movzwl	%ax, %eax
	movl	%eax, (%r15)
	jmp	LBB0_13
LBB0_12:
	movq	-48(%rbp), %rax                 ## 8-byte Reload
	movl	(%rax), %eax
	imull	8(%r14), %eax
	cltd
	movq	-56(%rbp), %rcx                 ## 8-byte Reload
	idivl	(%rcx)
	cltd
	movq	16(%rbp), %rcx
	idivl	(%rcx)
	movl	%eax, %r11d
LBB0_13:
	movl	%r11d, %eax
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"unable to find matching pll values\n"

	.comm	_EINVAL,4,2                     ## @EINVAL
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_gt215_pll_calc                 ; -- Begin function gt215_pll_calc
	.p2align	2
_gt215_pll_calc:                        ; @gt215_pll_calc
	.cfi_startproc
; %bb.0:
	stp	x28, x27, [sp, #-96]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 96
	stp	x26, x25, [sp, #16]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #32]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #48]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #64]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #80]             ; 16-byte Folded Spill
	add	x29, sp, #80
	.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	x20, x6
	mov	x21, x5
	mov	x23, x4
	mov	x22, x3
	mov	x19, x2
	mov	x24, x1
	mov	x25, x0
	ldr	w8, [x1, #16]
	sdiv	w8, w8, w2
	str	w8, [x6]
	ldr	w9, [x1]
	cmp	w8, w9
	csel	w8, w8, w9, lt
	str	w8, [x6]
	ldr	w9, [x1, #4]
	cmp	w8, w9
	csel	w8, w8, w9, gt
	str	w8, [x6]
	ldr	w8, [x1, #8]
	ldr	w9, [x1, #20]
	add	w8, w9, w8
	sdiv	w0, w8, w9
	ldr	w1, [x1, #48]
	bl	_max
	mov	x27, x0
	ldr	w8, [x24, #8]
	ldr	w9, [x24, #24]
	add	w8, w9, w8
	ldr	w1, [x24, #40]
	sdiv	w0, w8, w9
	bl	_min
	mov	x26, x0
	mov	x0, x27
	mov	x1, x26
	bl	_min
	cmp	w0, w26
	b.le	LBB0_3
LBB0_1:
	mov	w0, #1
	bl	_unlikely
	cbz	x0, LBB0_9
; %bb.2:
Lloh0:
	adrp	x1, l_.str@PAGE
Lloh1:
	add	x1, x1, l_.str@PAGEOFF
	mov	x0, x25
	bl	_nvkm_error
Lloh2:
	adrp	x8, _EINVAL@GOTPAGE
Lloh3:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
Lloh4:
	ldr	w8, [x8]
	neg	w19, w8
	b	LBB0_10
LBB0_3:
	ldr	w13, [x20]
	ldr	w8, [x24, #8]
	cmp	w8, #0
	cinc	w9, w8, lt
	asr	w9, w9, #1
	ldr	w10, [x24, #28]
	sub	w11, w26, w0
	add	w11, w11, #1
	mul	w12, w0, w13
	mul	w12, w12, w19
	mul	w13, w13, w19
	neg	w14, w8
	b	LBB0_5
LBB0_4:                                 ;   in Loop: Header=BB0_5 Depth=1
	add	w12, w12, w13
	subs	w11, w11, #1
	b.eq	LBB0_1
LBB0_5:                                 ; =>This Inner Loop Header: Depth=1
	sdiv	w15, w12, w8
	msub	w17, w15, w8, w12
	cmp	w17, w9
	cset	w16, lt
	sub	w16, w15, w16
	madd	w0, w14, w16, w12
	cmp	w17, w9
	cinc	w15, w15, ge
	cmp	x23, #0
	csel	w16, w16, w15, ne
	csel	w15, w0, w17, ne
	cmp	w16, w10
	b.lt	LBB0_4
; %bb.6:                                ;   in Loop: Header=BB0_5 Depth=1
	ldr	w17, [x24, #32]
	cmp	w16, w17
	b.gt	LBB0_1
; %bb.7:                                ;   in Loop: Header=BB0_5 Depth=1
	cbz	x23, LBB0_4
; %bb.8:
	ldr	w8, [x24, #8]
	cmp	w8, #0
	cinc	w9, w8, lt
	asr	w9, w9, #1
	add	w9, w9, w15, lsl #13
	sdiv	w8, w9, w8
	add	w8, w8, #15, lsl #12            ; =61440
	and	w8, w8, #0xffff
	str	w8, [x23]
	b	LBB0_10
LBB0_9:
	ldr	w8, [x24, #8]
	ldr	w9, [x22]
	mul	w8, w9, w8
	ldr	w9, [x21]
	sdiv	w8, w8, w9
	ldr	w9, [x20]
	sdiv	w19, w8, w9
LBB0_10:
	mov	x0, x19
	ldp	x29, x30, [sp, #80]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #64]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #48]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #32]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #16]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp], #96             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpAdd	Lloh0, Lloh1
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"unable to find matching pll values\n"

	.comm	_EINVAL,4,2                     ; @EINVAL
.subsections_via_symbols
