	.file	"extr_rv6xx_dpm.c_rv6xx_step_sw_voltage.c"
	.intel_syntax noprefix
	.text
	.p2align 4
	.type	rv6xx_step_sw_voltage, @function
rv6xx_step_sw_voltage:
.LFB0:
	.cfi_startproc
	endbr64
	push	r13
	.cfi_def_cfa_offset 16
	.cfi_offset 13, -16
	mov	r13, rsi
	push	r12
	.cfi_def_cfa_offset 24
	.cfi_offset 12, -24
	mov	r12, rdx
	push	rbp
	.cfi_def_cfa_offset 32
	.cfi_offset 6, -32
	push	rbx
	.cfi_def_cfa_offset 40
	.cfi_offset 3, -40
	mov	rbx, rdi
	sub	rsp, 40
	.cfi_def_cfa_offset 80
	mov	esi, DWORD PTR SET_VOLTAGE_TYPE_ASIC_VDDC[rip]
	mov	rax, QWORD PTR fs:40
	mov	QWORD PTR 24[rsp], rax
	xor	eax, eax
	lea	rdx, 16[rsp]
	call	radeon_atom_get_voltage_step@PLT
	test	rax, rax
	je	.L2
.L4:
	mov	eax, DWORD PTR EINVAL[rip]
	neg	eax
.L1:
	mov	rcx, QWORD PTR 24[rsp]
	xor	rcx, QWORD PTR fs:40
	jne	.L13
	add	rsp, 40
	.cfi_remember_state
	.cfi_def_cfa_offset 40
	pop	rbx
	.cfi_def_cfa_offset 32
	pop	rbp
	.cfi_def_cfa_offset 24
	pop	r12
	.cfi_def_cfa_offset 16
	pop	r13
	.cfi_def_cfa_offset 8
	ret
	.p2align 4,,10
	.p2align 3
.L2:
	.cfi_restore_state
	mov	esi, DWORD PTR SET_VOLTAGE_TYPE_ASIC_VDDC[rip]
	mov	rcx, rsp
	mov	rdx, r13
	mov	rdi, rbx
	call	radeon_atom_round_to_true_voltage@PLT
	test	rax, rax
	jne	.L4
	mov	esi, DWORD PTR SET_VOLTAGE_TYPE_ASIC_VDDC[rip]
	lea	rcx, 8[rsp]
	mov	rdx, r12
	mov	rdi, rbx
	call	radeon_atom_round_to_true_voltage@PLT
	test	rax, rax
	jne	.L4
	mov	rax, QWORD PTR 16[rsp]
	mov	rdx, QWORD PTR [rsp]
	mov	ebp, eax
	cmp	QWORD PTR 8[rsp], rdx
	jge	.L5
	neg	ebp
.L6:
	movsx	rbp, ebp
	.p2align 4,,10
	.p2align 3
.L7:
	mov	esi, DWORD PTR R600_POWER_LEVEL_CTXSW[rip]
	add	rdx, rbp
	mov	rdi, rbx
	mov	QWORD PTR [rsp], rdx
	call	rv6xx_program_voltage_stepping_entry@PLT
	mov	eax, DWORD PTR [rbx]
	add	eax, 999
	movsx	rdi, eax
	sar	eax, 31
	imul	rdi, rdi, 274877907
	sar	rdi, 38
	sub	edi, eax
	call	msleep@PLT
	mov	rdx, QWORD PTR [rsp]
	cmp	rdx, QWORD PTR 8[rsp]
	jne	.L7
	xor	eax, eax
	jmp	.L1
	.p2align 4,,10
	.p2align 3
.L5:
	jne	.L6
	xor	eax, eax
	jmp	.L1
.L13:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE0:
	.size	rv6xx_step_sw_voltage, .-rv6xx_step_sw_voltage
	.comm	SET_VOLTAGE_TYPE_ASIC_VDDC,4,4
	.comm	R600_POWER_LEVEL_CTXSW,4,4
	.comm	EINVAL,4,4
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",@progbits
	.section	.note.gnu.property,"a"
	.align 8
	.long	 1f - 0f
	.long	 4f - 1f
	.long	 5
0:
	.string	 "GNU"
1:
	.align 8
	.long	 0xc0000002
	.long	 3f - 2f
2:
	.long	 0x3
3:
	.align 8
4:

	.arch armv5t
	.eabi_attribute 20, 1
	.eabi_attribute 21, 1
	.eabi_attribute 23, 3
	.eabi_attribute 24, 1
	.eabi_attribute 25, 1
	.eabi_attribute 26, 2
	.eabi_attribute 30, 2
	.eabi_attribute 34, 0
	.eabi_attribute 18, 4
	.file	"extr_rv6xx_dpm.c_rv6xx_step_sw_voltage.c"
	.text
	.section	.rodata.cst4,"aM",%progbits,4
	.align	2
.LC0:
	.word	__stack_chk_guard
	.text
	.align	2
	.syntax unified
	.arm
	.fpu softvfp
	.type	rv6xx_step_sw_voltage, %function
rv6xx_step_sw_voltage:
	@ args = 0, pretend = 0, frame = 16
	@ frame_needed = 0, uses_anonymous_args = 0
	push	{r4, r5, r6, r7, r8, lr}
	ldr	r7, .L14
	sub	sp, sp, #16
	ldr	r3, .L14+4
	mov	r5, r1
	mov	r6, r2
	ldr	r1, [r7]
	add	r2, sp, #8
	ldr	r3, [r3]
	str	r3, [sp, #12]
	mov	r3,#0
	mov	r4, r0
	bl	radeon_atom_get_voltage_step
	cmp	r0, #0
	beq	.L2
.L4:
	ldr	r3, .L14+8
	ldr	r8, [r3]
	rsb	r8, r8, #0
.L1:
	ldr	r3, .L14+4
	ldr	r2, [r3]
	ldr	r3, [sp, #12]
	eors	r2, r3, r2
	mov	r3, #0
	bne	.L13
	mov	r0, r8
	add	sp, sp, #16
	@ sp needed
	pop	{r4, r5, r6, r7, r8, pc}
.L2:
	mov	r2, r5
	mov	r3, sp
	mov	r0, r4
	ldr	r1, [r7]
	bl	radeon_atom_round_to_true_voltage
	cmp	r0, #0
	bne	.L4
	mov	r2, r6
	mov	r0, r4
	ldr	r1, [r7]
	add	r3, sp, #4
	bl	radeon_atom_round_to_true_voltage
	subs	r8, r0, #0
	bne	.L4
	ldm	sp, {r2, r3, r5}
	cmp	r3, r2
	rsblt	r5, r5, #0
	blt	.L6
	beq	.L1
.L6:
	ldr	r7, .L14+12
	ldr	r6, .L14+16
.L7:
	add	r2, r2, r5
	ldr	r1, [r7]
	mov	r0, r4
	str	r2, [sp]
	bl	rv6xx_program_voltage_stepping_entry
	ldr	r3, [r4]
	add	r3, r3, #996
	add	r3, r3, #3
	smull	r2, r0, r6, r3
	asr	r3, r3, #31
	rsb	r0, r3, r0, asr #6
	bl	msleep
	ldm	sp, {r2, r3}
	cmp	r2, r3
	bne	.L7
	b	.L1
.L13:
	bl	__stack_chk_fail
.L15:
	.align	2
.L14:
	.word	SET_VOLTAGE_TYPE_ASIC_VDDC
	.word	.LC0
	.word	EINVAL
	.word	R600_POWER_LEVEL_CTXSW
	.word	274877907
	.size	rv6xx_step_sw_voltage, .-rv6xx_step_sw_voltage
	.comm	SET_VOLTAGE_TYPE_ASIC_VDDC,4,4
	.comm	R600_POWER_LEVEL_CTXSW,4,4
	.comm	EINVAL,4,4
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
