	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_gk20a_pllg_calc_mnp            ## -- Begin function gk20a_pllg_calc_mnp
	.p2align	4, 0x90
_gk20a_pllg_calc_mnp:                   ## @gk20a_pllg_calc_mnp
	.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	$88, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdx, %r8
	movq	%rsi, %rax
	movq	%rdi, %rbx
	addq	%rsi, %rax
	movq	_KHZ@GOTPCREL(%rip), %rcx
	movq	(%rcx), %rcx
	movq	%rax, %rdx
	orq	%rcx, %rdx
	shrq	$32, %rdx
	je	LBB0_1
## %bb.2:
	xorl	%edx, %edx
	divq	%rcx
	movq	%rax, %rsi
	jmp	LBB0_3
LBB0_1:
                                        ## kill: def $eax killed $eax killed $rax
	xorl	%edx, %edx
	divl	%ecx
	movl	%eax, %esi
LBB0_3:
	leaq	32(%rbx), %rax
	movq	%rax, -64(%rbp)                 ## 8-byte Spill
	movq	(%rbx), %rax
	movq	%rax, %rdx
	orq	%rcx, %rdx
	shrq	$32, %rdx
	movq	%r8, -96(%rbp)                  ## 8-byte Spill
	je	LBB0_4
## %bb.5:
	xorl	%edx, %edx
	divq	%rcx
	jmp	LBB0_6
LBB0_4:
                                        ## kill: def $eax killed $eax killed $rax
	xorl	%edx, %edx
	divl	%ecx
                                        ## kill: def $eax killed $eax def $rax
LBB0_6:
	movq	%rax, -56(%rbp)                 ## 8-byte Spill
	movq	%rsi, -104(%rbp)                ## 8-byte Spill
	movslq	%esi, %r14
	imulq	$1374389535, %r14, %rax         ## imm = 0x51EB851F
	movq	%rax, %rcx
	shrq	$63, %rcx
	sarq	$36, %rax
	addl	%ecx, %eax
	addl	%eax, %r14d
	movq	24(%rbx), %rax
	movl	(%rax), %edi
	movl	%r14d, %esi
	callq	_max
	movl	%eax, %edx
	movq	24(%rbx), %rcx
	movl	4(%rcx), %r15d
	movl	8(%rcx), %eax
	movl	%eax, -76(%rbp)                 ## 4-byte Spill
	movl	12(%rcx), %eax
	movl	%eax, -72(%rbp)                 ## 4-byte Spill
	movl	16(%rcx), %eax
	movl	%eax, -68(%rbp)                 ## 4-byte Spill
	movq	%rdx, -112(%rbp)                ## 8-byte Spill
	leal	(%rdx,%r14), %eax
	decl	%eax
	cltd
	idivl	%r14d
	movl	36(%rcx), %esi
	movl	%eax, %edi
	callq	_min
	movq	24(%rbx), %rcx
	movl	16(%rcx), %esi
	movl	%eax, %edi
	callq	_max
	movl	%eax, %edi
	callq	*8(%rbx)
	movl	%eax, %r13d
	movl	%r15d, -88(%rbp)                ## 4-byte Spill
	movl	%r15d, %eax
	cltd
	idivl	%r14d
	movq	24(%rbx), %rcx
	movl	36(%rcx), %esi
	movl	%eax, %edi
	callq	_min
	movq	24(%rbx), %rcx
	movl	16(%rcx), %esi
	movl	%eax, %edi
	callq	_max
	movl	%eax, %edi
	callq	*8(%rbx)
	movl	%eax, %r12d
	movl	%eax, %edi
	callq	*16(%rbx)
	movl	%eax, %r14d
	movl	%r13d, %edi
	callq	*16(%rbx)
	leaq	L_.str(%rip), %rsi
	movq	-64(%rbp), %rdi                 ## 8-byte Reload
	movl	%r12d, %edx
	movl	%r14d, %ecx
	movl	%r13d, %r8d
	movl	%eax, %r9d
	xorl	%eax, %eax
	callq	_nvkm_debug
	movl	%r13d, -80(%rbp)                ## 4-byte Spill
	cmpl	%r13d, %r12d
	jle	LBB0_7
LBB0_23:
	movl	$1, %edi
	callq	_WARN_ON
	movq	-104(%rbp), %rsi                ## 8-byte Reload
	movslq	%esi, %rax
	movq	_KHZ@GOTPCREL(%rip), %r14
	movq	(%r14), %rcx
	movq	%rax, %rdx
	orq	%rcx, %rdx
	shrq	$32, %rdx
	je	LBB0_24
## %bb.25:
	xorl	%edx, %edx
	divq	%rcx
	jmp	LBB0_26
LBB0_7:
	movq	-56(%rbp), %rax                 ## 8-byte Reload
	decl	%eax
	movl	%eax, -84(%rbp)                 ## 4-byte Spill
	jmp	LBB0_8
	.p2align	4, 0x90
LBB0_22:                                ##   in Loop: Header=BB0_8 Depth=1
	leal	1(%r12), %eax
	cmpl	-80(%rbp), %r12d                ## 4-byte Folded Reload
	movl	%eax, %r12d
	je	LBB0_23
LBB0_8:                                 ## =>This Loop Header: Depth=1
                                        ##     Child Loop BB0_10 Depth 2
                                        ##       Child Loop BB0_19 Depth 3
	movl	%r12d, %edi
	callq	*16(%rbx)
	movl	%eax, -44(%rbp)                 ## 4-byte Spill
	movq	24(%rbx), %rsi
	movl	20(%rsi), %r13d
	cmpl	8(%rsi), %r13d
	movq	-56(%rbp), %rdi                 ## 8-byte Reload
	jg	LBB0_22
## %bb.9:                               ##   in Loop: Header=BB0_8 Depth=1
	movl	-44(%rbp), %eax                 ## 4-byte Reload
	imull	-104(%rbp), %eax                ## 4-byte Folded Reload
	movl	%eax, -44(%rbp)                 ## 4-byte Spill
	jmp	LBB0_10
LBB0_20:                                ##   in Loop: Header=BB0_10 Depth=2
	movq	24(%rbx), %rsi
	.p2align	4, 0x90
LBB0_21:                                ##   in Loop: Header=BB0_10 Depth=2
	leal	1(%r13), %eax
	cmpl	8(%rsi), %r13d
	movl	%eax, %r13d
	jge	LBB0_22
LBB0_10:                                ##   Parent Loop BB0_8 Depth=1
                                        ## =>  This Loop Header: Depth=2
                                        ##       Child Loop BB0_19 Depth 3
	movl	%edi, %eax
	cltd
	idivl	%r13d
	cmpl	24(%rsi), %eax
	jl	LBB0_22
## %bb.11:                              ##   in Loop: Header=BB0_10 Depth=2
	cmpl	28(%rsi), %eax
	jg	LBB0_21
## %bb.12:                              ##   in Loop: Header=BB0_10 Depth=2
	movl	-44(%rbp), %ecx                 ## 4-byte Reload
	imull	%r13d, %ecx
	movl	%ecx, %eax
	cltd
	idivl	%edi
	movl	%eax, %r15d
	addl	-84(%rbp), %ecx                 ## 4-byte Folded Reload
	movl	%ecx, %eax
	cltd
	idivl	%edi
	cmpl	32(%rsi), %r15d
	jg	LBB0_22
## %bb.13:                              ##   in Loop: Header=BB0_10 Depth=2
	movl	%eax, %r14d
	cmpl	%eax, %r15d
	jg	LBB0_21
	.p2align	4, 0x90
## %bb.14:                              ##   in Loop: Header=BB0_10 Depth=2
	cmpl	12(%rsi), %r15d
	jl	LBB0_19
LBB0_15:                                ##   in Loop: Header=BB0_10 Depth=2
	cmpl	32(%rsi), %r15d
	jg	LBB0_21
## %bb.16:                              ##   in Loop: Header=BB0_10 Depth=2
	movl	%r15d, %eax
	imull	%edi, %eax
	cltd
	idivl	%r13d
	cmpl	-88(%rbp), %eax                 ## 4-byte Folded Reload
	jl	LBB0_19
## %bb.17:                              ##   in Loop: Header=BB0_10 Depth=2
	cmpl	-112(%rbp), %eax                ## 4-byte Folded Reload
	jg	LBB0_19
## %bb.18:                              ##   in Loop: Header=BB0_10 Depth=2
	movl	%r12d, %edi
	callq	*16(%rbx)
	movl	%r12d, %edi
	callq	*16(%rbx)
	movq	-56(%rbp), %rdi                 ## 8-byte Reload
LBB0_19:                                ##   Parent Loop BB0_8 Depth=1
                                        ##     Parent Loop BB0_10 Depth=2
                                        ## =>    This Inner Loop Header: Depth=3
	cmpl	%r15d, %r14d
	je	LBB0_20
## %bb.30:                              ##   in Loop: Header=BB0_19 Depth=3
	incl	%r15d
	movq	24(%rbx), %rsi
	cmpl	12(%rsi), %r15d
	jge	LBB0_15
	jmp	LBB0_19
LBB0_24:
	movl	%esi, %eax
	xorl	%edx, %edx
	divl	%ecx
                                        ## kill: def $eax killed $eax def $rax
LBB0_26:
	movq	-96(%rbp), %r13                 ## 8-byte Reload
	leaq	L_.str.1(%rip), %rsi
	movq	-64(%rbp), %rdi                 ## 8-byte Reload
	movl	%eax, %edx
	xorl	%eax, %eax
	callq	_nvkm_debug
	movl	-76(%rbp), %eax                 ## 4-byte Reload
	movl	%eax, (%r13)
	movl	-72(%rbp), %eax                 ## 4-byte Reload
	movl	%eax, 4(%r13)
	movl	-68(%rbp), %eax                 ## 4-byte Reload
	movl	%eax, 8(%r13)
	movq	%rbx, %rdi
	movq	%r13, %rsi
	callq	_gk20a_pllg_calc_rate
	movslq	%eax, %rcx
	movq	(%r14), %rsi
	movq	%rcx, %rdx
	orq	%rsi, %rdx
	shrq	$32, %rdx
	je	LBB0_27
## %bb.28:
	movq	%rcx, %rax
	xorl	%edx, %edx
	divq	%rsi
	movq	%rax, %r14
	jmp	LBB0_29
LBB0_27:
	xorl	%edx, %edx
	divl	%esi
	movl	%eax, %r14d
LBB0_29:
	movl	(%r13), %r15d
	movl	4(%r13), %r12d
	movl	8(%r13), %r13d
	movl	%r13d, %edi
	callq	*16(%rbx)
	movl	%eax, (%rsp)
	leaq	L_.str.2(%rip), %rsi
	movq	-64(%rbp), %rdi                 ## 8-byte Reload
	movl	%r14d, %edx
	movl	%r15d, %ecx
	movl	%r12d, %r8d
	movl	%r13d, %r9d
	xorl	%eax, %eax
	callq	_nvkm_debug
	xorl	%eax, %eax
	addq	$88, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_KHZ,8,3                        ## @KHZ
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"low_PL %d(div%d), high_PL %d(div%d)"

L_.str.1:                               ## @.str.1
	.asciz	"no best match for target @ %dMHz on gpc_pll"

L_.str.2:                               ## @.str.2
	.asciz	"actual target freq %d KHz, M %d, N %d, PL %d(div%d)\n"

.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_gk20a_pllg_calc_mnp            ; -- Begin function gk20a_pllg_calc_mnp
	.p2align	2
_gk20a_pllg_calc_mnp:                   ; @gk20a_pllg_calc_mnp
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #192
	.cfi_def_cfa_offset 192
	stp	d9, d8, [sp, #80]               ; 16-byte Folded Spill
	stp	x28, x27, [sp, #96]             ; 16-byte Folded Spill
	stp	x26, x25, [sp, #112]            ; 16-byte Folded Spill
	stp	x24, x23, [sp, #128]            ; 16-byte Folded Spill
	stp	x22, x21, [sp, #144]            ; 16-byte Folded Spill
	stp	x20, x19, [sp, #160]            ; 16-byte Folded Spill
	stp	x29, x30, [sp, #176]            ; 16-byte Folded Spill
	add	x29, sp, #176
	.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
	.cfi_offset b8, -104
	.cfi_offset b9, -112
	str	x2, [sp, #48]                   ; 8-byte Folded Spill
	mov	x21, x0
	add	x23, x0, #32
Lloh0:
	adrp	x9, _KHZ@GOTPAGE
Lloh1:
	ldr	x9, [x9, _KHZ@GOTPAGEOFF]
	lsl	x8, x1, #1
Lloh2:
	ldr	x19, [x9]
	udiv	x10, x8, x19
	ldr	x20, [x0]
	mov	w8, #34079
	movk	w8, #20971, lsl #16
	smull	x8, w10, w8
	lsr	x9, x8, #32
	lsr	x8, x8, #63
	add	w8, w8, w9, asr #4
	str	x10, [sp, #64]                  ; 8-byte Folded Spill
	add	w24, w8, w10
	ldr	x8, [x0, #24]
	ldr	w0, [x8]
	mov	x1, x24
	bl	_max
	mov	x22, x0
	ldr	x8, [x21, #24]
	ldr	w26, [x8, #4]
	ldr	d8, [x8, #8]
	ldr	w9, [x8, #16]
	str	w9, [sp, #44]                   ; 4-byte Folded Spill
	add	w9, w24, w0
	sub	w9, w9, #1
	ldr	w1, [x8, #36]
	sdiv	w0, w9, w24
	bl	_min
	ldr	x8, [x21, #24]
	ldr	w1, [x8, #16]
	bl	_max
	ldr	x8, [x21, #8]
	blr	x8
	mov	x27, x0
	ldr	x8, [x21, #24]
	ldr	w1, [x8, #36]
	sdiv	w0, w26, w24
	bl	_min
	ldr	x8, [x21, #24]
	ldr	w1, [x8, #16]
	bl	_max
	ldr	x8, [x21, #8]
	blr	x8
	mov	x24, x0
	ldr	x8, [x21, #16]
	blr	x8
	mov	x25, x0
	ldr	x8, [x21, #16]
	mov	x0, x27
	blr	x8
                                        ; kill: def $w0 killed $w0 def $x0
	stp	x27, x0, [sp, #8]
	str	x25, [sp]
Lloh3:
	adrp	x1, l_.str@PAGE
Lloh4:
	add	x1, x1, l_.str@PAGEOFF
	str	x23, [sp, #56]                  ; 8-byte Folded Spill
	mov	x0, x23
	mov	x2, x24
	bl	_nvkm_debug
	str	x27, [sp, #72]                  ; 8-byte Folded Spill
	cmp	w24, w27
	b.le	LBB0_2
LBB0_1:
	mov	w0, #1
	bl	_WARN_ON
	ldp	x23, x8, [sp, #56]              ; 16-byte Folded Reload
	sxtw	x8, w8
Lloh5:
	adrp	x19, _KHZ@GOTPAGE
Lloh6:
	ldr	x19, [x19, _KHZ@GOTPAGEOFF]
	ldr	x9, [x19]
	udiv	x2, x8, x9
Lloh7:
	adrp	x1, l_.str.1@PAGE
Lloh8:
	add	x1, x1, l_.str.1@PAGEOFF
	mov	x0, x23
                                        ; kill: def $w2 killed $w2 killed $x2
	bl	_nvkm_debug
	ldr	x20, [sp, #48]                  ; 8-byte Folded Reload
	str	d8, [x20]
	ldr	w8, [sp, #44]                   ; 4-byte Folded Reload
	str	w8, [x20, #8]
	mov	x0, x21
	mov	x1, x20
	bl	_gk20a_pllg_calc_rate
                                        ; kill: def $w0 killed $w0 def $x0
	sxtw	x8, w0
	ldr	x9, [x19]
	ldr	x10, [x21, #16]
	ldr	w19, [x20]
	ldp	w21, w22, [x20, #4]
	udiv	x20, x8, x9
	mov	x0, x22
	blr	x10
                                        ; kill: def $w0 killed $w0 def $x0
	stp	x22, x0, [sp, #16]
	stp	x19, x21, [sp]
Lloh9:
	adrp	x1, l_.str.2@PAGE
Lloh10:
	add	x1, x1, l_.str.2@PAGEOFF
	mov	x0, x23
	mov	x2, x20
	bl	_nvkm_debug
	mov	w0, #0
	ldp	x29, x30, [sp, #176]            ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #160]            ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #144]            ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #128]            ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #112]            ; 16-byte Folded Reload
	ldp	x28, x27, [sp, #96]             ; 16-byte Folded Reload
	ldp	d9, d8, [sp, #80]               ; 16-byte Folded Reload
	add	sp, sp, #192
	ret
LBB0_2:
	udiv	x25, x20, x19
	sub	w28, w25, #1
	b	LBB0_4
LBB0_3:                                 ;   in Loop: Header=BB0_4 Depth=1
	add	w8, w24, #1
	ldr	x9, [sp, #72]                   ; 8-byte Folded Reload
	cmp	w24, w9
	mov	x24, x8
	b.eq	LBB0_1
LBB0_4:                                 ; =>This Loop Header: Depth=1
                                        ;     Child Loop BB0_8 Depth 2
                                        ;       Child Loop BB0_12 Depth 3
	ldr	x8, [x21, #16]
	mov	x0, x24
	blr	x8
	ldr	x8, [x21, #24]
	ldr	w19, [x8, #20]
	ldr	w9, [x8, #8]
	cmp	w19, w9
	b.gt	LBB0_3
; %bb.5:                                ;   in Loop: Header=BB0_4 Depth=1
	ldr	x9, [sp, #64]                   ; 8-byte Folded Reload
	mul	w20, w0, w9
	b	LBB0_8
LBB0_6:                                 ;   in Loop: Header=BB0_8 Depth=2
	ldr	x8, [x21, #24]
LBB0_7:                                 ;   in Loop: Header=BB0_8 Depth=2
	add	w9, w19, #1
	ldr	w10, [x8, #8]
	cmp	w19, w10
	mov	x19, x9
	b.ge	LBB0_3
LBB0_8:                                 ;   Parent Loop BB0_4 Depth=1
                                        ; =>  This Loop Header: Depth=2
                                        ;       Child Loop BB0_12 Depth 3
	sdiv	w9, w25, w19
	ldr	w10, [x8, #24]
	cmp	w9, w10
	b.lt	LBB0_3
; %bb.9:                                ;   in Loop: Header=BB0_8 Depth=2
	ldr	w10, [x8, #28]
	cmp	w9, w10
	b.gt	LBB0_7
; %bb.10:                               ;   in Loop: Header=BB0_8 Depth=2
	mul	w9, w20, w19
	sdiv	w27, w9, w25
	ldr	w10, [x8, #32]
	cmp	w27, w10
	b.gt	LBB0_3
; %bb.11:                               ;   in Loop: Header=BB0_8 Depth=2
	add	w9, w28, w9
	sdiv	w23, w9, w25
	cmp	w27, w23
	b.gt	LBB0_7
LBB0_12:                                ;   Parent Loop BB0_4 Depth=1
                                        ;     Parent Loop BB0_8 Depth=2
                                        ; =>    This Inner Loop Header: Depth=3
	ldr	w9, [x8, #12]
	cmp	w27, w9
	b.lt	LBB0_16
; %bb.13:                               ;   in Loop: Header=BB0_12 Depth=3
	ldr	w9, [x8, #32]
	cmp	w27, w9
	b.gt	LBB0_7
; %bb.14:                               ;   in Loop: Header=BB0_12 Depth=3
	mul	w8, w27, w25
	sdiv	w8, w8, w19
	cmp	w8, w26
	ccmp	w8, w22, #0, ge
	b.gt	LBB0_16
; %bb.15:                               ;   in Loop: Header=BB0_12 Depth=3
	ldr	x8, [x21, #16]
	mov	x0, x24
	blr	x8
	ldr	x8, [x21, #16]
	mov	x0, x24
	blr	x8
LBB0_16:                                ;   in Loop: Header=BB0_12 Depth=3
	cmp	w23, w27
	b.eq	LBB0_6
; %bb.17:                               ;   in Loop: Header=BB0_12 Depth=3
	add	w27, w27, #1
	ldr	x8, [x21, #24]
	b	LBB0_12
	.loh AdrpAdd	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpAdd	Lloh9, Lloh10
	.loh AdrpAdd	Lloh7, Lloh8
	.loh AdrpLdrGot	Lloh5, Lloh6
	.cfi_endproc
                                        ; -- End function
	.comm	_KHZ,8,3                        ; @KHZ
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"low_PL %d(div%d), high_PL %d(div%d)"

l_.str.1:                               ; @.str.1
	.asciz	"no best match for target @ %dMHz on gpc_pll"

l_.str.2:                               ; @.str.2
	.asciz	"actual target freq %d KHz, M %d, N %d, PL %d(div%d)\n"

.subsections_via_symbols
