	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function navi10_get_clock_by_type_with_latency
_navi10_get_clock_by_type_with_latency: ## @navi10_get_clock_by_type_with_latency
	.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
	pushq	%rax
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movl	%esi, %r12d
	movl	$0, -44(%rbp)
	movl	$0, -48(%rbp)
	leal	-128(%r12), %ecx
	xorl	%eax, %eax
	cmpl	$2, %ecx
	ja	LBB0_7
## %bb.1:
	movq	%rdx, %r14
	movq	%rdi, %r15
	leaq	-44(%rbp), %rdx
	movl	%r12d, %esi
	callq	_smu_get_dpm_level_count
	testl	%eax, %eax
	je	LBB0_2
LBB0_7:
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_2:
	movl	-44(%rbp), %edi
	movq	_MAX_NUM_CLOCKS@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	callq	_min
	movl	%eax, %ecx
	movl	%eax, -44(%rbp)
	movl	%eax, (%r14)
	movl	$0, %eax
	testl	%ecx, %ecx
	jle	LBB0_7
## %bb.3:
	xorl	%ebx, %ebx
	leaq	-48(%rbp), %r13
	.p2align	4, 0x90
LBB0_4:                                 ## =>This Inner Loop Header: Depth=1
	movq	%r15, %rdi
	movl	%r12d, %esi
	movl	%ebx, %edx
	movq	%r13, %rcx
	callq	_smu_get_dpm_freq_by_index
	testl	%eax, %eax
	jne	LBB0_7
## %bb.5:                               ##   in Loop: Header=BB0_4 Depth=1
	imull	$1000, -48(%rbp), %eax          ## imm = 0x3E8
	movq	8(%r14), %rcx
	movl	%eax, (%rcx,%rbx,8)
	movl	$0, 4(%rcx,%rbx,8)
	incq	%rbx
	movslq	-44(%rbp), %rax
	cmpq	%rax, %rbx
	jl	LBB0_4
## %bb.6:
	xorl	%eax, %eax
	jmp	LBB0_7
	.cfi_endproc
                                        ## -- End function
	.comm	_MAX_NUM_CLOCKS,4,2             ## @MAX_NUM_CLOCKS
	.no_dead_strip	_navi10_get_clock_by_type_with_latency
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function navi10_get_clock_by_type_with_latency
_navi10_get_clock_by_type_with_latency: ; @navi10_get_clock_by_type_with_latency
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #80
	.cfi_def_cfa_offset 80
	stp	x24, x23, [sp, #16]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #32]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #48]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #64]             ; 16-byte Folded Spill
	add	x29, sp, #64
	.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	x21, x0
	mov	w0, #0
	str	xzr, [sp, #8]
	sub	w8, w1, #128
	cmp	w8, #2
	b.hi	LBB0_7
; %bb.1:
	mov	x19, x2
	mov	x20, x1
	add	x2, sp, #12
	mov	x0, x21
	bl	_smu_get_dpm_level_count
	cbnz	w0, LBB0_7
; %bb.2:
	ldr	w0, [sp, #12]
Lloh0:
	adrp	x8, _MAX_NUM_CLOCKS@GOTPAGE
Lloh1:
	ldr	x8, [x8, _MAX_NUM_CLOCKS@GOTPAGEOFF]
Lloh2:
	ldr	w1, [x8]
	bl	_min
	str	w0, [sp, #12]
	str	w0, [x19]
	cmp	w0, #1
	b.lt	LBB0_6
; %bb.3:
	mov	x23, #0
	mov	x22, #0
	mov	w24, #1000
LBB0_4:                                 ; =>This Inner Loop Header: Depth=1
	add	x3, sp, #8
	mov	x0, x21
	mov	x1, x20
	mov	x2, x22
	bl	_smu_get_dpm_freq_by_index
	cbnz	w0, LBB0_7
; %bb.5:                                ;   in Loop: Header=BB0_4 Depth=1
	ldr	w8, [sp, #8]
	mul	w8, w8, w24
	ldr	x9, [x19, #8]
	add	x9, x9, x23
	stp	w8, wzr, [x9]
	add	x22, x22, #1
	ldrsw	x8, [sp, #12]
	add	x23, x23, #8
	cmp	x22, x8
	b.lt	LBB0_4
LBB0_6:
	mov	w0, #0
LBB0_7:
	ldp	x29, x30, [sp, #64]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #48]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #32]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #80
	ret
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.cfi_endproc
                                        ; -- End function
	.comm	_MAX_NUM_CLOCKS,4,2             ; @MAX_NUM_CLOCKS
	.no_dead_strip	_navi10_get_clock_by_type_with_latency
.subsections_via_symbols
