	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function rv6xx_step_sw_voltage
_rv6xx_step_sw_voltage:                 ## @rv6xx_step_sw_voltage
	.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	$24, %rsp
	.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, %rbx
	movq	%rdi, %r14
	movq	_SET_VOLTAGE_TYPE_ASIC_VDDC@GOTPCREL(%rip), %r12
	movl	(%r12), %esi
	leaq	-64(%rbp), %rdx
	callq	_radeon_atom_get_voltage_step
	testq	%rax, %rax
	jne	LBB0_3
## %bb.1:
	movl	(%r12), %esi
	leaq	-48(%rbp), %rcx
	movq	%r14, %rdi
	movq	%rbx, %rdx
	callq	_radeon_atom_round_to_true_voltage
	testq	%rax, %rax
	jne	LBB0_3
## %bb.2:
	movl	(%r12), %esi
	leaq	-56(%rbp), %rcx
	movq	%r14, %rdi
	movq	%r15, %rdx
	callq	_radeon_atom_round_to_true_voltage
	testq	%rax, %rax
	je	LBB0_4
LBB0_3:
	movq	_EINVAL@GOTPCREL(%rip), %rax
	xorl	%ebx, %ebx
	subl	(%rax), %ebx
LBB0_7:
	movl	%ebx, %eax
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_4:
	movq	-48(%rbp), %rdx
	movq	-56(%rbp), %rax
	xorl	%ebx, %ebx
	cmpq	%rax, %rdx
	je	LBB0_7
## %bb.5:
	movq	-64(%rbp), %rcx
	movl	%ecx, %esi
	negl	%esi
	cmpq	%rdx, %rax
	cmovgeq	%rcx, %rsi
	movslq	%esi, %r15
	movq	_R600_POWER_LEVEL_CTXSW@GOTPCREL(%rip), %r12
	movl	$999, %r13d                     ## imm = 0x3E7
	.p2align	4, 0x90
LBB0_6:                                 ## =>This Inner Loop Header: Depth=1
	addq	%r15, %rdx
	movq	%rdx, -48(%rbp)
	movl	(%r12), %esi
	movq	%r14, %rdi
	callq	_rv6xx_program_voltage_stepping_entry
	movl	(%r14), %eax
	addl	%r13d, %eax
	cltq
	imulq	$274877907, %rax, %rdi          ## imm = 0x10624DD3
	movq	%rdi, %rax
	shrq	$63, %rax
	sarq	$38, %rdi
	addl	%eax, %edi
                                        ## kill: def $edi killed $edi killed $rdi
	callq	_msleep
	movq	-48(%rbp), %rdx
	cmpq	-56(%rbp), %rdx
	jne	LBB0_6
	jmp	LBB0_7
	.cfi_endproc
                                        ## -- End function
	.comm	_SET_VOLTAGE_TYPE_ASIC_VDDC,4,2 ## @SET_VOLTAGE_TYPE_ASIC_VDDC
	.comm	_EINVAL,4,2                     ## @EINVAL
	.comm	_R600_POWER_LEVEL_CTXSW,4,2     ## @R600_POWER_LEVEL_CTXSW
	.no_dead_strip	_rv6xx_step_sw_voltage
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function rv6xx_step_sw_voltage
_rv6xx_step_sw_voltage:                 ; @rv6xx_step_sw_voltage
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #80
	.cfi_def_cfa_offset 80
	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
	mov	x20, x2
	mov	x21, x1
	mov	x19, x0
Lloh0:
	adrp	x22, _SET_VOLTAGE_TYPE_ASIC_VDDC@GOTPAGE
Lloh1:
	ldr	x22, [x22, _SET_VOLTAGE_TYPE_ASIC_VDDC@GOTPAGEOFF]
	ldr	w1, [x22]
	add	x2, sp, #8
	bl	_radeon_atom_get_voltage_step
	cbnz	x0, LBB0_3
; %bb.1:
	ldr	w1, [x22]
	add	x3, sp, #24
	mov	x0, x19
	mov	x2, x21
	bl	_radeon_atom_round_to_true_voltage
	cbnz	x0, LBB0_3
; %bb.2:
	ldr	w1, [x22]
	add	x3, sp, #16
	mov	x0, x19
	mov	x2, x20
	bl	_radeon_atom_round_to_true_voltage
	cbz	x0, LBB0_5
LBB0_3:
Lloh2:
	adrp	x8, _EINVAL@GOTPAGE
Lloh3:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
Lloh4:
	ldr	w8, [x8]
	neg	w0, w8
LBB0_4:
	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
	add	sp, sp, #80
	ret
LBB0_5:
	ldp	x9, x8, [sp, #16]
	cmp	x8, x9
	b.ne	LBB0_7
; %bb.6:
	mov	w0, #0
	b	LBB0_4
LBB0_7:
	ldr	x10, [sp, #8]
	neg	w11, w10
	cmp	x9, x8
	csel	x9, x11, x10, lt
	sxtw	x20, w9
Lloh5:
	adrp	x21, _R600_POWER_LEVEL_CTXSW@GOTPAGE
Lloh6:
	ldr	x21, [x21, _R600_POWER_LEVEL_CTXSW@GOTPAGEOFF]
	mov	w22, #19923
	movk	w22, #4194, lsl #16
LBB0_8:                                 ; =>This Inner Loop Header: Depth=1
	add	x2, x8, x20
	str	x2, [sp, #24]
	ldr	w1, [x21]
	mov	x0, x19
	bl	_rv6xx_program_voltage_stepping_entry
	ldr	w8, [x19]
	add	w8, w8, #999
	smull	x8, w8, w22
	lsr	x9, x8, #63
	asr	x8, x8, #38
	add	w0, w8, w9
	bl	_msleep
	mov	w0, #0
	ldp	x9, x8, [sp, #16]
	cmp	x8, x9
	b.ne	LBB0_8
	b	LBB0_4
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpLdrGot	Lloh5, Lloh6
	.cfi_endproc
                                        ; -- End function
	.comm	_SET_VOLTAGE_TYPE_ASIC_VDDC,4,2 ; @SET_VOLTAGE_TYPE_ASIC_VDDC
	.comm	_EINVAL,4,2                     ; @EINVAL
	.comm	_R600_POWER_LEVEL_CTXSW,4,2     ; @R600_POWER_LEVEL_CTXSW
	.no_dead_strip	_rv6xx_step_sw_voltage
.subsections_via_symbols
