	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function gk20a_pmu_dvfs_get_target_state
_gk20a_pmu_dvfs_get_target_state:       ## @gk20a_pmu_dvfs_get_target_state
	.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	%r12
	pushq	%rbx
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
                                        ## kill: def $edx killed $edx def $rdx
	movq	%rsi, %r14
	movq	%rdi, %r12
	movq	(%rdi), %rcx
	movq	8(%rdi), %rax
	movq	(%rcx), %rbx
	movl	(%rbx), %r15d
	cmpl	%edx, (%rax)
	jge	LBB0_2
## %bb.1:
	movslq	4(%rbx), %rax
	leal	-1(%rax), %edi
	imulq	$1431655766, %rax, %rsi         ## imm = 0x55555556
	movq	%rsi, %rax
	shrq	$63, %rax
	shrq	$32, %rsi
	addl	%eax, %esi
	addl	%r15d, %esi
                                        ## kill: def $esi killed $esi killed $rsi
	jmp	LBB0_3
LBB0_2:
	movl	4(%rax), %ecx
	subl	%ecx, %edx
	addl	%edx, %edx
	leal	(%rdx,%rdx,4), %eax
	cltd
	idivl	%ecx
	movl	%eax, %esi
	shrl	$31, %esi
	addl	%eax, %esi
	sarl	%esi
	addl	%r15d, %esi
	xorl	%edi, %edi
	callq	_max
	movl	4(%rbx), %edi
	decl	%edi
	movl	%eax, %esi
LBB0_3:
	callq	_min
	movl	%eax, %ebx
	leaq	L_.str(%rip), %rsi
	movq	%r12, %rdi
	movl	%r15d, %edx
	movl	%eax, %ecx
	callq	_nvkm_trace
	movl	%ebx, (%r14)
	xorl	%eax, %eax
	cmpl	%r15d, %ebx
	setne	%al
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"cur level = %d, new level = %d\n"

	.no_dead_strip	_gk20a_pmu_dvfs_get_target_state
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function gk20a_pmu_dvfs_get_target_state
_gk20a_pmu_dvfs_get_target_state:       ; @gk20a_pmu_dvfs_get_target_state
	.cfi_startproc
; %bb.0:
	stp	x22, x21, [sp, #-48]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 48
	stp	x20, x19, [sp, #16]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #32]             ; 16-byte Folded Spill
	add	x29, sp, #32
	.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
	mov	x19, x1
	mov	x21, x0
	ldp	x9, x8, [x0]
	ldr	x22, [x9]
	ldr	w20, [x22]
	ldr	w9, [x8]
	cmp	w9, w2
	b.ge	LBB0_2
; %bb.1:
	ldrsw	x8, [x22, #4]
	sub	w0, w8, #1
	mov	w9, #21846
	movk	w9, #21845, lsl #16
	mul	x8, x8, x9
	lsr	x9, x8, #63
	lsr	x8, x8, #32
	add	w8, w8, w9
	add	w1, w8, w20
	b	LBB0_3
LBB0_2:
	ldr	w8, [x8, #4]
	sub	w9, w2, w8
	add	w9, w9, w9, lsl #2
	lsl	w9, w9, #1
	sdiv	w8, w9, w8
	cmp	w8, #0
	cinc	w8, w8, lt
	add	w1, w20, w8, asr #1
	mov	w0, #0
	bl	_max
	mov	x1, x0
	ldr	w8, [x22, #4]
	sub	w0, w8, #1
LBB0_3:
	bl	_min
	mov	x22, x0
Lloh0:
	adrp	x1, l_.str@PAGE
Lloh1:
	add	x1, x1, l_.str@PAGEOFF
	mov	x0, x21
	mov	x2, x20
	mov	x3, x22
	bl	_nvkm_trace
	str	w22, [x19]
	cmp	w22, w20
	cset	w0, ne
	ldp	x29, x30, [sp, #32]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #16]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp], #48             ; 16-byte Folded Reload
	ret
	.loh AdrpAdd	Lloh0, Lloh1
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"cur level = %d, new level = %d\n"

	.no_dead_strip	_gk20a_pmu_dvfs_get_target_state
.subsections_via_symbols
