	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_build_watermark_ranges         ## -- Begin function build_watermark_ranges
	.p2align	4, 0x90
_build_watermark_ranges:                ## @build_watermark_ranges
	.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	%rsi, %r14
	movq	_WM_SET_COUNT@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	testl	%edx, %edx
	jle	LBB0_1
## %bb.2:
	movq	8(%rdi), %r15
	cmpl	$0, 12(%r15)
	je	LBB0_3
## %bb.4:
	movl	8(%r15), %ecx
	movq	16(%r14), %rax
	movl	%ecx, 40(%rax)
	movq	(%r15), %rbx
	movq	%rbx, (%rax)
	movq	_PP_SMU_WM_SET_RANGE_CLK_UNCONSTRAINED_MIN@GOTPCREL(%rip), %rcx
	movq	(%rcx), %r9
	movq	%r9, 32(%rax)
	movq	_PP_SMU_WM_SET_RANGE_CLK_UNCONSTRAINED_MAX@GOTPCREL(%rip), %rcx
	movq	(%rcx), %rcx
	movq	%rcx, 16(%rax)
	movq	_WM_TYPE_PSTATE_CHG@GOTPCREL(%rip), %rsi
	cmpq	(%rsi), %rbx
	jne	LBB0_5
## %bb.6:
	movq	$0, 24(%rax)
	movq	(%rdi), %rcx
	movq	(%rcx), %rcx
	xorl	%esi, %esi
	jmp	LBB0_7
LBB0_1:
	xorl	%r12d, %r12d
	jmp	LBB0_16
LBB0_3:
	xorl	%r12d, %r12d
	cmpl	$2, %edx
	jae	LBB0_9
	jmp	LBB0_16
LBB0_5:
	movq	%r9, 24(%rax)
	movq	%rcx, 8(%rax)
	movq	$-1, %rsi
LBB0_7:
	leaq	(%rsi,%rsi,2), %rsi
	shlq	$4, %rsi
	movq	%rcx, 8(%rax,%rsi)
	movl	$1, %r12d
	cmpl	$2, %edx
	jb	LBB0_16
LBB0_9:
	movl	$1, %esi
	movl	$8, %eax
	movq	_PP_SMU_WM_SET_RANGE_CLK_UNCONSTRAINED_MIN@GOTPCREL(%rip), %r9
	movq	_PP_SMU_WM_SET_RANGE_CLK_UNCONSTRAINED_MAX@GOTPCREL(%rip), %r10
	jmp	LBB0_10
	.p2align	4, 0x90
LBB0_13:                                ##   in Loop: Header=BB0_10 Depth=1
	movq	(%r9), %rcx
	movq	%rcx, 24(%rdx,%rbx)
	movq	(%r10), %rcx
	movq	%rcx, 8(%rdx,%rbx)
	leal	-1(%r12), %ecx
	movslq	%ecx, %r13
	movq	%r10, %rbx
LBB0_14:                                ##   in Loop: Header=BB0_10 Depth=1
	movq	(%rbx), %rcx
	leaq	(,%r13,2), %rbx
	addq	%r13, %rbx
	shlq	$4, %rbx
	movq	%rcx, 8(%rdx,%rbx)
	incl	%r12d
	movq	_WM_SET_COUNT@GOTPCREL(%rip), %rcx
	movl	(%rcx), %edx
LBB0_15:                                ##   in Loop: Header=BB0_10 Depth=1
	incq	%rsi
	movslq	%edx, %rcx
	addq	$8, %rax
	cmpq	%rcx, %rsi
	jge	LBB0_16
LBB0_10:                                ## =>This Inner Loop Header: Depth=1
	cmpl	$0, 12(%r15,%rax,2)
	je	LBB0_15
## %bb.11:                              ##   in Loop: Header=BB0_10 Depth=1
	movl	8(%r15,%rax,2), %ecx
	movq	16(%r14), %rdx
	movslq	%r12d, %r13
	leaq	(,%r13,2), %rbx
	addq	%r13, %rbx
	shlq	$4, %rbx
	movl	%ecx, 40(%rdx,%rbx)
	movq	(%r15,%rax,2), %r11
	movq	%r11, (%rdx,%rbx)
	movq	(%r9), %r8
	movq	%r8, 32(%rdx,%rbx)
	movq	(%r10), %rcx
	movq	%rcx, 16(%rdx,%rbx)
	movq	_WM_TYPE_PSTATE_CHG@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %r11
	jne	LBB0_13
## %bb.12:                              ##   in Loop: Header=BB0_10 Depth=1
	movq	(%rdi), %rcx
	movq	-8(%rcx,%rax), %rcx
	incq	%rcx
	movq	%rcx, 24(%rdx,%rbx)
	movq	(%rdi), %rbx
	addq	%rax, %rbx
	jmp	LBB0_14
LBB0_16:
	xorl	%edi, %edi
	movl	%r12d, %ebx
	addl	$-1, %ebx
	setb	%dil
	callq	_ASSERT
	movl	%r12d, (%r14)
	movq	_PP_SMU_WM_SET_RANGE_CLK_UNCONSTRAINED_MIN@GOTPCREL(%rip), %rax
	movq	(%rax), %rcx
	movq	16(%r14), %rdx
	movq	%rcx, 32(%rdx)
	movq	%rcx, 24(%rdx)
	movq	_PP_SMU_WM_SET_RANGE_CLK_UNCONSTRAINED_MAX@GOTPCREL(%rip), %rcx
	movq	(%rcx), %rsi
	movslq	%ebx, %rdi
	leaq	(%rdi,%rdi,2), %rdi
	shlq	$4, %rdi
	movq	%rsi, 16(%rdx,%rdi)
	movq	(%rcx), %rsi
	movq	%rsi, 8(%rdx,%rdi)
	movl	$1, 4(%r14)
	movq	_WM_A@GOTPCREL(%rip), %rdx
	movl	(%rdx), %edx
	movq	8(%r14), %rsi
	movl	%edx, 32(%rsi)
	movq	(%rax), %rax
	movq	%rax, 24(%rsi)
	movq	(%rcx), %rcx
	movq	%rcx, 16(%rsi)
	movq	%rax, 8(%rsi)
	movq	%rcx, (%rsi)
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_WM_SET_COUNT,4,2               ## @WM_SET_COUNT
	.comm	_PP_SMU_WM_SET_RANGE_CLK_UNCONSTRAINED_MIN,8,3 ## @PP_SMU_WM_SET_RANGE_CLK_UNCONSTRAINED_MIN
	.comm	_PP_SMU_WM_SET_RANGE_CLK_UNCONSTRAINED_MAX,8,3 ## @PP_SMU_WM_SET_RANGE_CLK_UNCONSTRAINED_MAX
	.comm	_WM_TYPE_PSTATE_CHG,8,3         ## @WM_TYPE_PSTATE_CHG
	.comm	_WM_A,4,2                       ## @WM_A
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_build_watermark_ranges         ; -- Begin function build_watermark_ranges
	.p2align	2
_build_watermark_ranges:                ; @build_watermark_ranges
	.cfi_startproc
; %bb.0:
	stp	x24, x23, [sp, #-64]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 64
	stp	x22, x21, [sp, #16]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #32]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #48]             ; 16-byte Folded Spill
	add	x29, sp, #48
	.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	x19, x1
Lloh0:
	adrp	x8, _WM_SET_COUNT@GOTPAGE
Lloh1:
	ldr	x8, [x8, _WM_SET_COUNT@GOTPAGEOFF]
	ldr	w10, [x8]
Lloh2:
	adrp	x21, _PP_SMU_WM_SET_RANGE_CLK_UNCONSTRAINED_MIN@GOTPAGE
Lloh3:
	ldr	x21, [x21, _PP_SMU_WM_SET_RANGE_CLK_UNCONSTRAINED_MIN@GOTPAGEOFF]
Lloh4:
	adrp	x20, _PP_SMU_WM_SET_RANGE_CLK_UNCONSTRAINED_MAX@GOTPAGE
Lloh5:
	ldr	x20, [x20, _PP_SMU_WM_SET_RANGE_CLK_UNCONSTRAINED_MAX@GOTPAGEOFF]
	cmp	w10, #1
	b.lt	LBB0_4
; %bb.1:
	ldr	x12, [x0, #8]
	ldr	w11, [x12, #12]
Lloh6:
	adrp	x9, _WM_TYPE_PSTATE_CHG@GOTPAGE
Lloh7:
	ldr	x9, [x9, _WM_TYPE_PSTATE_CHG@GOTPAGEOFF]
	cbz	w11, LBB0_5
; %bb.2:
	ldr	w13, [x12, #8]
	ldr	x11, [x19, #16]
	str	w13, [x11, #40]
	ldr	x15, [x12]
	str	x15, [x11]
	ldr	x14, [x21]
	str	x14, [x11, #32]
	ldr	x13, [x20]
	str	x13, [x11, #16]
	ldr	x16, [x9]
	cmp	x15, x16
	b.ne	LBB0_6
; %bb.3:
	mov	x14, #0
	str	xzr, [x11, #24]
	ldr	x13, [x0]
	ldr	x13, [x13]
	b	LBB0_7
LBB0_4:
	mov	w22, #0
	b	LBB0_15
LBB0_5:
	mov	w22, #0
	cmp	w10, #2
	b.hs	LBB0_8
	b	LBB0_15
LBB0_6:
	str	x14, [x11, #24]
	str	x13, [x11, #8]
	mov	x14, #-1
LBB0_7:
	mov	w15, #48
	madd	x11, x14, x15, x11
	str	x13, [x11, #8]
	mov	w22, #1
	cmp	w10, #2
	b.lo	LBB0_15
LBB0_8:
	mov	x11, #0
	add	x12, x12, #28
	mov	w13, #1
	mov	w14, #48
	b	LBB0_12
LBB0_9:                                 ;   in Loop: Header=BB0_12 Depth=1
	ldr	x16, [x21]
	madd	x15, x15, x14, x10
	str	x16, [x15, #24]
	ldr	x16, [x20]
	str	x16, [x15, #8]
	sub	w15, w22, #1
	sxtw	x15, w15
	mov	x16, x20
LBB0_10:                                ;   in Loop: Header=BB0_12 Depth=1
	ldr	x16, [x16]
	madd	x10, x15, x14, x10
	str	x16, [x10, #8]
	add	w22, w22, #1
	ldr	w10, [x8]
LBB0_11:                                ;   in Loop: Header=BB0_12 Depth=1
	add	x13, x13, #1
	add	x12, x12, #16
	add	x11, x11, #8
	cmp	x13, w10, sxtw
	b.ge	LBB0_15
LBB0_12:                                ; =>This Inner Loop Header: Depth=1
	ldr	w15, [x12]
	cbz	w15, LBB0_11
; %bb.13:                               ;   in Loop: Header=BB0_12 Depth=1
	ldur	w16, [x12, #-4]
	ldr	x10, [x19, #16]
	sxtw	x15, w22
	smaddl	x17, w22, w14, x10
	str	w16, [x17, #40]
	ldur	x16, [x12, #-12]
	str	x16, [x17]
	ldr	x1, [x21]
	str	x1, [x17, #32]
	ldr	x1, [x20]
	str	x1, [x17, #16]
	ldr	x17, [x9]
	cmp	x16, x17
	b.ne	LBB0_9
; %bb.14:                               ;   in Loop: Header=BB0_12 Depth=1
	ldr	x16, [x0]
	ldr	x16, [x16, x11]
	add	x16, x16, #1
	madd	x17, x15, x14, x10
	str	x16, [x17, #24]
	ldr	x16, [x0]
	add	x16, x16, x11
	add	x16, x16, #8
	b	LBB0_10
LBB0_15:
	subs	w23, w22, #1
	cset	w0, hs
	bl	_ASSERT
	ldr	x8, [x21]
	ldp	x10, x9, [x19, #8]
	stp	x8, x8, [x9, #24]
	mov	w8, #48
	smaddl	x8, w23, w8, x9
	ldr	x9, [x20]
	str	x9, [x8, #16]
	ldr	x9, [x20]
	str	x9, [x8, #8]
	mov	w8, #1
	stp	w22, w8, [x19]
Lloh8:
	adrp	x8, _WM_A@GOTPAGE
Lloh9:
	ldr	x8, [x8, _WM_A@GOTPAGEOFF]
Lloh10:
	ldr	w8, [x8]
	str	w8, [x10, #32]
	ldr	x8, [x21]
	ldr	x9, [x20]
	stp	x9, x8, [x10, #16]
	stp	x9, x8, [x10]
	ldp	x29, x30, [sp, #48]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #32]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #16]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp], #64             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGot	Lloh4, Lloh5
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGot	Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.cfi_endproc
                                        ; -- End function
	.comm	_WM_SET_COUNT,4,2               ; @WM_SET_COUNT
	.comm	_PP_SMU_WM_SET_RANGE_CLK_UNCONSTRAINED_MIN,8,3 ; @PP_SMU_WM_SET_RANGE_CLK_UNCONSTRAINED_MIN
	.comm	_PP_SMU_WM_SET_RANGE_CLK_UNCONSTRAINED_MAX,8,3 ; @PP_SMU_WM_SET_RANGE_CLK_UNCONSTRAINED_MAX
	.comm	_WM_TYPE_PSTATE_CHG,8,3         ; @WM_TYPE_PSTATE_CHG
	.comm	_WM_A,4,2                       ; @WM_A
.subsections_via_symbols
