	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_clk_mgr_helper_populate_bw_params ## -- Begin function clk_mgr_helper_populate_bw_params
	.p2align	4, 0x90
_clk_mgr_helper_populate_bw_params:     ## @clk_mgr_helper_populate_bw_params
	.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
	movq	%rdx, %r15
	movq	%rsi, %r13
	movq	%rdi, %r14
	movq	_PP_SMU_NUM_FCLK_DPM_LEVELS@GOTPCREL(%rip), %r12
	movl	(%r12), %eax
	movq	_MAX_NUM_DPM_LVL@GOTPCREL(%rip), %rcx
	xorl	%edi, %edi
	cmpl	(%rcx), %eax
	setle	%dil
	callq	_ASSERT
	cmpl	$0, (%r12)
	jle	LBB0_1
## %bb.2:
	movq	(%r13), %rcx
	addq	$8, %rcx
	movl	$5, %edx
	xorl	%eax, %eax
	.p2align	4, 0x90
LBB0_3:                                 ## =>This Inner Loop Header: Depth=1
	movq	-8(%rcx), %rsi
	testq	%rsi, %rsi
	je	LBB0_5
## %bb.4:                               ##   in Loop: Header=BB0_3 Depth=1
	movq	24(%r13), %rdi
	movl	(%rdi,%rax,4), %edi
	movq	32(%r14), %rbx
	movl	%edi, (%rbx,%rdx,4)
	movq	%rsi, -20(%rbx,%rdx,4)
	movq	16(%r13), %rsi
	movl	(%rsi,%rax,4), %esi
	movl	%esi, -4(%rbx,%rdx,4)
	movq	8(%r13), %rsi
	movl	(%rsi,%rax,4), %esi
	movl	%esi, -8(%rbx,%rdx,4)
	movl	(%rcx), %esi
	movl	%esi, -12(%rbx,%rdx,4)
	incq	%rax
	movslq	(%r12), %rsi
	addq	$16, %rcx
	addq	$6, %rdx
	cmpq	%rsi, %rax
	jl	LBB0_3
	jmp	LBB0_5
LBB0_1:
	xorl	%eax, %eax
LBB0_5:
	movl	%eax, 24(%r14)
	movq	(%r15), %r8
	movq	%r8, (%r14)
	movl	8(%r15), %eax
	movq	_DDR4_DRAM_WIDTH@GOTPCREL(%rip), %rcx
	cltd
	idivl	(%rcx)
	movl	%eax, 8(%r14)
	movq	_WM_SET_COUNT@GOTPCREL(%rip), %rax
	cmpl	$0, (%rax)
	jle	LBB0_10
## %bb.6:
	movq	16(%r14), %rdx
	movq	(%r13), %rsi
	xorl	%edi, %edi
	movq	_WM_TYPE_PSTATE_CHG@GOTPCREL(%rip), %r9
	xorl	%ecx, %ecx
	jmp	LBB0_7
	.p2align	4, 0x90
LBB0_9:                                 ##   in Loop: Header=BB0_7 Depth=1
	movl	%ebx, 4(%rdx,%rdi)
	incq	%rcx
	movslq	(%rax), %rbx
	addq	$16, %rdi
	cmpq	%rbx, %rcx
	jge	LBB0_10
LBB0_7:                                 ## =>This Inner Loop Header: Depth=1
	movl	%ecx, (%rdx,%rdi)
	cmpq	$0, (%rsi,%rdi)
	movl	$0, %ebx
	je	LBB0_9
## %bb.8:                               ##   in Loop: Header=BB0_7 Depth=1
	movl	(%r9), %ebx
	movl	%ebx, 8(%rdx,%rdi)
	movl	$1, %ebx
	jmp	LBB0_9
LBB0_10:
	movq	_LpDdr4MemType@GOTPCREL(%rip), %rax
	cmpq	(%rax), %r8
	jne	LBB0_12
## %bb.11:
	movq	_LPDDR_MEM_RETRAIN_LATENCY@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movq	16(%r14), %rcx
	movq	_WM_D@GOTPCREL(%rip), %rdx
	movq	(%rdx), %rdx
	movq	%rdx, %rsi
	shlq	$4, %rsi
	movl	%eax, 12(%rcx,%rsi)
	movl	%edx, (%rcx,%rsi)
	movq	_WM_TYPE_RETRAINING@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, 8(%rcx,%rsi)
	movl	$1, 4(%rcx,%rsi)
LBB0_12:
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_PP_SMU_NUM_FCLK_DPM_LEVELS,4,2 ## @PP_SMU_NUM_FCLK_DPM_LEVELS
	.comm	_MAX_NUM_DPM_LVL,4,2            ## @MAX_NUM_DPM_LVL
	.comm	_DDR4_DRAM_WIDTH,4,2            ## @DDR4_DRAM_WIDTH
	.comm	_WM_SET_COUNT,4,2               ## @WM_SET_COUNT
	.comm	_WM_TYPE_PSTATE_CHG,4,2         ## @WM_TYPE_PSTATE_CHG
	.comm	_LpDdr4MemType,8,3              ## @LpDdr4MemType
	.comm	_LPDDR_MEM_RETRAIN_LATENCY,4,2  ## @LPDDR_MEM_RETRAIN_LATENCY
	.comm	_WM_D,8,3                       ## @WM_D
	.comm	_WM_TYPE_RETRAINING,4,2         ## @WM_TYPE_RETRAINING
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_clk_mgr_helper_populate_bw_params ; -- Begin function clk_mgr_helper_populate_bw_params
	.p2align	2
_clk_mgr_helper_populate_bw_params:     ; @clk_mgr_helper_populate_bw_params
	.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	x21, x2
	mov	x20, x1
	mov	x19, x0
Lloh0:
	adrp	x22, _PP_SMU_NUM_FCLK_DPM_LEVELS@GOTPAGE
Lloh1:
	ldr	x22, [x22, _PP_SMU_NUM_FCLK_DPM_LEVELS@GOTPAGEOFF]
	ldr	w8, [x22]
Lloh2:
	adrp	x9, _MAX_NUM_DPM_LVL@GOTPAGE
Lloh3:
	ldr	x9, [x9, _MAX_NUM_DPM_LVL@GOTPAGEOFF]
Lloh4:
	ldr	w9, [x9]
	cmp	w8, w9
	cset	w0, le
	bl	_ASSERT
	ldr	w8, [x22]
	cmp	w8, #1
	b.lt	LBB0_4
; %bb.1:
	mov	x8, #0
	ldr	x9, [x20]
	add	x9, x9, #8
	mov	w10, #20
LBB0_2:                                 ; =>This Inner Loop Header: Depth=1
	ldur	x11, [x9, #-8]
	cbz	x11, LBB0_5
; %bb.3:                                ;   in Loop: Header=BB0_2 Depth=1
	ldr	x12, [x20, #24]
	lsl	x13, x8, #2
	ldr	w12, [x12, x13]
	ldr	x14, [x19, #32]
	add	x14, x14, x10
	str	w12, [x14]
	ldp	x15, x12, [x20, #8]
	ldr	w12, [x12, x13]
	stur	x11, [x14, #-20]
	stur	w12, [x14, #-4]
	ldr	w11, [x15, x13]
	ldr	w12, [x9], #16
	stp	w12, w11, [x14, #-12]
	add	x8, x8, #1
	ldrsw	x11, [x22]
	add	x10, x10, #24
	cmp	x8, x11
	b.lt	LBB0_2
	b	LBB0_5
LBB0_4:
	mov	w8, #0
LBB0_5:
	str	w8, [x19, #24]
	ldr	x8, [x21]
	str	x8, [x19]
	ldr	w9, [x21, #8]
Lloh5:
	adrp	x10, _DDR4_DRAM_WIDTH@GOTPAGE
Lloh6:
	ldr	x10, [x10, _DDR4_DRAM_WIDTH@GOTPAGEOFF]
Lloh7:
	ldr	w10, [x10]
	sdiv	w9, w9, w10
	str	w9, [x19, #8]
Lloh8:
	adrp	x9, _WM_SET_COUNT@GOTPAGE
Lloh9:
	ldr	x9, [x9, _WM_SET_COUNT@GOTPAGEOFF]
	ldr	w10, [x9]
	cmp	w10, #1
	b.lt	LBB0_10
; %bb.6:
	mov	x10, #0
	ldr	x12, [x19, #16]
	ldr	x11, [x20]
	add	x12, x12, #4
Lloh10:
	adrp	x13, _WM_TYPE_PSTATE_CHG@GOTPAGE
Lloh11:
	ldr	x13, [x13, _WM_TYPE_PSTATE_CHG@GOTPAGEOFF]
	b	LBB0_8
LBB0_7:                                 ;   in Loop: Header=BB0_8 Depth=1
	str	w14, [x12], #16
	add	x10, x10, #1
	ldrsw	x14, [x9]
	add	x11, x11, #16
	cmp	x10, x14
	b.ge	LBB0_10
LBB0_8:                                 ; =>This Inner Loop Header: Depth=1
	stur	w10, [x12, #-4]
	ldr	x14, [x11]
	cbz	x14, LBB0_7
; %bb.9:                                ;   in Loop: Header=BB0_8 Depth=1
	ldr	w14, [x13]
	str	w14, [x12, #4]
	mov	w14, #1
	b	LBB0_7
LBB0_10:
Lloh12:
	adrp	x9, _LpDdr4MemType@GOTPAGE
Lloh13:
	ldr	x9, [x9, _LpDdr4MemType@GOTPAGEOFF]
Lloh14:
	ldr	x9, [x9]
	cmp	x8, x9
	b.ne	LBB0_12
; %bb.11:
Lloh15:
	adrp	x8, _LPDDR_MEM_RETRAIN_LATENCY@GOTPAGE
Lloh16:
	ldr	x8, [x8, _LPDDR_MEM_RETRAIN_LATENCY@GOTPAGEOFF]
Lloh17:
	ldr	w8, [x8]
	ldr	x9, [x19, #16]
Lloh18:
	adrp	x10, _WM_D@GOTPAGE
Lloh19:
	ldr	x10, [x10, _WM_D@GOTPAGEOFF]
Lloh20:
	ldr	x10, [x10]
	add	x9, x9, x10, lsl #4
	str	w8, [x9, #12]
	str	w10, [x9]
Lloh21:
	adrp	x8, _WM_TYPE_RETRAINING@GOTPAGE
Lloh22:
	ldr	x8, [x8, _WM_TYPE_RETRAINING@GOTPAGEOFF]
Lloh23:
	ldr	w8, [x8]
	mov	w10, #1
	stp	w10, w8, [x9, #4]
LBB0_12:
	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 AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGot	Lloh8, Lloh9
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpLdrGot	Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh21, Lloh22, Lloh23
	.loh AdrpLdrGotLdr	Lloh18, Lloh19, Lloh20
	.loh AdrpLdrGotLdr	Lloh15, Lloh16, Lloh17
	.cfi_endproc
                                        ; -- End function
	.comm	_PP_SMU_NUM_FCLK_DPM_LEVELS,4,2 ; @PP_SMU_NUM_FCLK_DPM_LEVELS
	.comm	_MAX_NUM_DPM_LVL,4,2            ; @MAX_NUM_DPM_LVL
	.comm	_DDR4_DRAM_WIDTH,4,2            ; @DDR4_DRAM_WIDTH
	.comm	_WM_SET_COUNT,4,2               ; @WM_SET_COUNT
	.comm	_WM_TYPE_PSTATE_CHG,4,2         ; @WM_TYPE_PSTATE_CHG
	.comm	_LpDdr4MemType,8,3              ; @LpDdr4MemType
	.comm	_LPDDR_MEM_RETRAIN_LATENCY,4,2  ; @LPDDR_MEM_RETRAIN_LATENCY
	.comm	_WM_D,8,3                       ; @WM_D
	.comm	_WM_TYPE_RETRAINING,4,2         ; @WM_TYPE_RETRAINING
.subsections_via_symbols
