	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function rv770_construct_vddc_table
_rv770_construct_vddc_table:            ## @rv770_construct_vddc_table
	.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	$56, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdi, %r14
	callq	_rv770_get_pi
	movq	%rax, %rbx
	movq	_SET_VOLTAGE_TYPE_ASIC_VDDC@GOTPCREL(%rip), %r15
	movl	(%r15), %esi
	leaq	-48(%rbp), %rdx
	movq	%r14, %rdi
	callq	_radeon_atom_get_min_voltage
	movl	(%r15), %esi
	leaq	-68(%rbp), %rdx
	movq	%r14, %rdi
	callq	_radeon_atom_get_max_voltage
	movl	(%r15), %esi
	leaq	-44(%rbp), %rdx
	movq	%r14, %rdi
	callq	_radeon_atom_get_voltage_step
	movl	-68(%rbp), %eax
	movl	-48(%rbp), %esi
	subl	%esi, %eax
	cltd
	idivl	-44(%rbp)
	movl	%eax, %r12d
	leal	1(%r12), %eax
	movslq	%eax, %rdx
	movq	_MAX_NO_VREG_STEPS@GOTPCREL(%rip), %rcx
	cmpq	%rdx, (%rcx)
	jae	LBB0_1
## %bb.10:
	movq	_EINVAL@GOTPCREL(%rip), %rcx
	xorl	%eax, %eax
	subl	(%rcx), %eax
	jmp	LBB0_9
LBB0_1:
	movq	%rdx, -80(%rbp)                 ## 8-byte Spill
	testl	%eax, %eax
	je	LBB0_8
## %bb.2:
	movq	-80(%rbp), %rax                 ## 8-byte Reload
	cmpq	$2, %rax
	movl	$1, %ecx
	cmovaeq	%rax, %rcx
	movq	%rcx, -88(%rbp)                 ## 8-byte Spill
	movl	$1, %r15d
	movq	16(%rbx), %rax
	movl	%esi, (%rax)
	movq	_SET_VOLTAGE_TYPE_ASIC_VDDC@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	leaq	-64(%rbp), %rcx
	leaq	-56(%rbp), %r8
	movq	%r14, %rdi
	callq	_radeon_atom_get_voltage_gpio_settings
	movq	-56(%rbp), %rcx
	movq	-64(%rbp), %rdx
	andq	%rcx, %rdx
	movq	16(%rbx), %rax
	movq	%rdx, 8(%rax)
	movq	$0, 16(%rax)
	movq	%rcx, (%rbx)
	movq	$0, 24(%rax)
	testl	%r12d, %r12d
	je	LBB0_8
## %bb.3:
	movl	$32, %r12d
	xorl	%r13d, %r13d
	jmp	LBB0_4
	.p2align	4, 0x90
LBB0_6:                                 ##   in Loop: Header=BB0_4 Depth=1
	incq	%r13
LBB0_7:                                 ##   in Loop: Header=BB0_4 Depth=1
	movq	%r13, 24(%rax,%r12)
	incq	%r15
	addq	$32, %r12
	cmpq	%r15, -88(%rbp)                 ## 8-byte Folded Reload
	je	LBB0_8
LBB0_4:                                 ## =>This Inner Loop Header: Depth=1
	movl	-44(%rbp), %esi
	imull	%r15d, %esi
	addl	-48(%rbp), %esi
	movl	%esi, (%rax,%r12)
	movq	_SET_VOLTAGE_TYPE_ASIC_VDDC@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	%r14, %rdi
	leaq	-64(%rbp), %rcx
	leaq	-56(%rbp), %r8
	callq	_radeon_atom_get_voltage_gpio_settings
	movq	-56(%rbp), %rcx
	andq	-64(%rbp), %rcx
	movq	16(%rbx), %rax
	movq	%rcx, 8(%rax,%r12)
	movq	$0, 16(%rax,%r12)
	movq	-56(%rbp), %rdx
	movq	%rdx, (%rbx)
	cmpq	-24(%rax,%r12), %rcx
	jne	LBB0_6
## %bb.5:                               ##   in Loop: Header=BB0_4 Depth=1
	cmpq	$0, -16(%rax,%r12)
	jne	LBB0_6
	jmp	LBB0_7
LBB0_8:
	movq	-80(%rbp), %rax                 ## 8-byte Reload
	movq	%rax, 8(%rbx)
	xorl	%eax, %eax
LBB0_9:
	addq	$56, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_SET_VOLTAGE_TYPE_ASIC_VDDC,4,2 ## @SET_VOLTAGE_TYPE_ASIC_VDDC
	.comm	_MAX_NO_VREG_STEPS,8,3          ## @MAX_NO_VREG_STEPS
	.comm	_EINVAL,4,2                     ## @EINVAL
	.no_dead_strip	_rv770_construct_vddc_table
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function rv770_construct_vddc_table
_rv770_construct_vddc_table:            ; @rv770_construct_vddc_table
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #112
	.cfi_def_cfa_offset 112
	stp	x26, x25, [sp, #32]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #48]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #64]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #80]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #96]             ; 16-byte Folded Spill
	add	x29, sp, #96
	.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
	mov	x19, x0
	bl	_rv770_get_pi
	mov	x20, x0
Lloh0:
	adrp	x21, _SET_VOLTAGE_TYPE_ASIC_VDDC@GOTPAGE
Lloh1:
	ldr	x21, [x21, _SET_VOLTAGE_TYPE_ASIC_VDDC@GOTPAGEOFF]
	ldr	w1, [x21]
	add	x2, sp, #28
	mov	x0, x19
	bl	_radeon_atom_get_min_voltage
	ldr	w1, [x21]
	add	x2, sp, #24
	mov	x0, x19
	bl	_radeon_atom_get_max_voltage
	ldr	w1, [x21]
	add	x2, sp, #20
	mov	x0, x19
	bl	_radeon_atom_get_voltage_step
	ldp	w8, w1, [sp, #24]
	sub	w8, w8, w1
	ldr	w9, [sp, #20]
	sdiv	w24, w8, w9
	add	w8, w24, #1
	sxtw	x22, w8
Lloh2:
	adrp	x8, _MAX_NO_VREG_STEPS@GOTPAGE
Lloh3:
	ldr	x8, [x8, _MAX_NO_VREG_STEPS@GOTPAGEOFF]
Lloh4:
	ldr	x8, [x8]
	cmp	x8, x22
	b.hs	LBB0_2
; %bb.1:
Lloh5:
	adrp	x8, _EINVAL@GOTPAGE
Lloh6:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
Lloh7:
	ldr	w8, [x8]
	neg	w0, w8
	b	LBB0_10
LBB0_2:
	cbz	w22, LBB0_9
; %bb.3:
	cmp	x22, #1
	csinc	x23, x22, xzr, hi
	ldr	x8, [x20, #16]
	str	w1, [x8]
	ldr	w2, [x21]
	add	x3, sp, #8
	mov	x4, sp
	mov	x0, x19
	bl	_radeon_atom_get_voltage_gpio_settings
	ldp	x9, x8, [sp]
	and	x10, x9, x8
	ldr	x8, [x20, #16]
	stp	xzr, xzr, [x8, #16]
	str	x10, [x8, #8]
	str	x9, [x20]
	cbz	w24, LBB0_9
; %bb.4:
	mov	x24, #0
	mov	x25, #0
	mov	w26, #1
	b	LBB0_7
LBB0_5:                                 ;   in Loop: Header=BB0_7 Depth=1
	add	x25, x25, #1
LBB0_6:                                 ;   in Loop: Header=BB0_7 Depth=1
	add	x9, x8, x24
	str	x25, [x9, #56]
	add	x26, x26, #1
	add	x24, x24, #32
	cmp	x23, x26
	b.eq	LBB0_9
LBB0_7:                                 ; =>This Inner Loop Header: Depth=1
	ldr	w9, [sp, #28]
	ldr	w10, [sp, #20]
	madd	w1, w10, w26, w9
	add	x8, x8, x24
	str	w1, [x8, #32]
	ldr	w2, [x21]
	add	x3, sp, #8
	mov	x4, sp
	mov	x0, x19
	bl	_radeon_atom_get_voltage_gpio_settings
	ldp	x9, x8, [sp]
	and	x10, x9, x8
	ldr	x8, [x20, #16]
	add	x9, x8, x24
	stp	x10, xzr, [x9, #40]
	ldr	x11, [sp]
	str	x11, [x20]
	ldr	x11, [x9, #8]
	cmp	x10, x11
	b.ne	LBB0_5
; %bb.8:                                ;   in Loop: Header=BB0_7 Depth=1
	ldr	x9, [x9, #16]
	cbnz	x9, LBB0_5
	b	LBB0_6
LBB0_9:
	mov	w0, #0
	str	x22, [x20, #8]
LBB0_10:
	ldp	x29, x30, [sp, #96]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #80]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #64]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #48]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #32]             ; 16-byte Folded Reload
	add	sp, sp, #112
	ret
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.cfi_endproc
                                        ; -- End function
	.comm	_SET_VOLTAGE_TYPE_ASIC_VDDC,4,2 ; @SET_VOLTAGE_TYPE_ASIC_VDDC
	.comm	_MAX_NO_VREG_STEPS,8,3          ; @MAX_NO_VREG_STEPS
	.comm	_EINVAL,4,2                     ; @EINVAL
	.no_dead_strip	_rv770_construct_vddc_table
.subsections_via_symbols
