	.file	"extr_si_dpm.c_si_populate_smc_t.c"
	.intel_syntax noprefix
	.text
	.p2align 4
	.type	si_populate_smc_t, @function
si_populate_smc_t:
.LFB0:
	.cfi_startproc
	endbr64
	push	r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	push	r14
	.cfi_def_cfa_offset 24
	.cfi_offset 14, -24
	push	r13
	.cfi_def_cfa_offset 32
	.cfi_offset 13, -32
	push	r12
	.cfi_def_cfa_offset 40
	.cfi_offset 12, -40
	mov	r12, rdx
	push	rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	mov	rbp, rsi
	push	rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	sub	rsp, 56
	.cfi_def_cfa_offset 112
	mov	rax, QWORD PTR fs:40
	mov	QWORD PTR 40[rsp], rax
	xor	eax, eax
	call	rv770_get_pi@PLT
	mov	rdi, rbp
	mov	r13, rax
	call	si_get_ps@PLT
	mov	r15, rax
	mov	eax, DWORD PTR [rax]
	cmp	eax, 8
	jg	.L16
	cmp	eax, 1
	jle	.L17
	mov	rbx, QWORD PTR [r12]
	xor	edi, edi
	call	cpu_to_be32@PLT
	cmp	DWORD PTR [r15], 1
	mov	QWORD PTR [rbx], rax
	jle	.L5
	lea	rax, 36[rsp]
	mov	ebp, 4
	xor	r14d, r14d
	mov	QWORD PTR 24[rsp], rax
	lea	rax, 32[rsp]
	mov	QWORD PTR 16[rsp], rax
	.p2align 4,,10
	.p2align 3
.L8:
	mov	rax, QWORD PTR 8[r15]
	lea	edi, 1[r14]
	mov	r9, QWORD PTR 24[rsp]
	imul	esi, DWORD PTR R600_AH_DFLT[rip], 100
	mov	r8, QWORD PTR 16[rsp]
	mov	r10d, DWORD PTR [rax+rbp]
	mov	ecx, DWORD PTR [rax+r14*4]
	mov	eax, 50
	cdq
	idiv	DWORD PTR SISLANDS_MAX_HARDWARE_POWERLEVELS[rip]
	mov	edx, r10d
	imul	eax, edi
	imul	edi, eax, 100
	call	r600_calculate_at@PLT
	test	eax, eax
	je	.L6
	mov	eax, DWORD PTR R600_AH_DFLT[rip]
	imul	edx, ebp, 250
	imul	ecx, eax, -50
	imul	eax, eax, 100
	add	edx, ecx
	add	eax, edx
	mov	DWORD PTR 36[rsp], edx
	mov	DWORD PTR 32[rsp], eax
.L6:
	mov	rax, QWORD PTR [r12]
	lea	rdx, 0[0+r14*8]
	mov	QWORD PTR 8[rsp], rdx
	mov	rdi, QWORD PTR [rax+r14*8]
	call	be32_to_cpu@PLT
	mov	ebx, DWORD PTR CG_R_MASK[rip]
	not	ebx
	and	ebx, eax
	mov	eax, DWORD PTR 0[r13]
	imul	eax, DWORD PTR 32[rsp]
	movsx	rdi, eax
	sar	eax, 31
	imul	rdi, rdi, 1759218605
	sar	rdi, 45
	sub	edi, eax
	call	CG_R@PLT
	mov	rdx, QWORD PTR 8[rsp]
	add	rdx, QWORD PTR [r12]
	or	ebx, eax
	mov	QWORD PTR 8[rsp], rdx
	mov	edi, ebx
	call	cpu_to_be32@PLT
	mov	rdx, QWORD PTR 8[rsp]
	mov	edi, 65535
	mov	ebx, DWORD PTR 4[r13]
	mov	QWORD PTR [rdx], rax
	mov	eax, DWORD PTR [r15]
	sub	eax, 2
	cmp	eax, r14d
	cmovne	ebx, DWORD PTR 0[r13]
	add	r14, 1
	call	CG_R@PLT
	imul	ebx, DWORD PTR 36[rsp]
	mov	DWORD PTR 8[rsp], eax
	movsx	rdi, ebx
	mov	rdx, rdi
	imul	rdi, rdi, 1759218605
	sar	edx, 31
	sar	rdi, 45
	sub	edi, edx
	call	CG_L@PLT
	mov	edi, DWORD PTR 8[rsp]
	mov	rdx, QWORD PTR [r12]
	or	edi, eax
	lea	rbx, [rdx+rbp*2]
	add	rbp, 4
	call	cpu_to_be32@PLT
	mov	QWORD PTR [rbx], rax
	mov	eax, DWORD PTR [r15]
	sub	eax, 1
	cmp	eax, r14d
	jg	.L8
.L5:
	xor	eax, eax
.L1:
	mov	rsi, QWORD PTR 40[rsp]
	xor	rsi, QWORD PTR fs:40
	jne	.L18
	add	rsp, 56
	.cfi_remember_state
	.cfi_def_cfa_offset 56
	pop	rbx
	.cfi_def_cfa_offset 48
	pop	rbp
	.cfi_def_cfa_offset 40
	pop	r12
	.cfi_def_cfa_offset 32
	pop	r13
	.cfi_def_cfa_offset 24
	pop	r14
	.cfi_def_cfa_offset 16
	pop	r15
	.cfi_def_cfa_offset 8
	ret
	.p2align 4,,10
	.p2align 3
.L16:
	.cfi_restore_state
	mov	eax, DWORD PTR EINVAL[rip]
	neg	eax
	jmp	.L1
	.p2align 4,,10
	.p2align 3
.L17:
	mov	edi, 65535
	call	CG_R@PLT
	xor	edi, edi
	mov	ebx, eax
	call	CG_L@PLT
	mov	rbp, QWORD PTR [r12]
	or	ebx, eax
	mov	edi, ebx
	call	cpu_to_be32@PLT
	mov	QWORD PTR 0[rbp], rax
	xor	eax, eax
	jmp	.L1
.L18:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE0:
	.size	si_populate_smc_t, .-si_populate_smc_t
	.comm	SISLANDS_MAX_HARDWARE_POWERLEVELS,4,4
	.comm	R600_AH_DFLT,4,4
	.comm	EINVAL,4,4
	.comm	CG_R_MASK,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_si_dpm.c_si_populate_smc_t.c"
	.text
	.global	__aeabi_idiv
	.section	.rodata.cst4,"aM",%progbits,4
	.align	2
.LC0:
	.word	__stack_chk_guard
	.text
	.align	2
	.syntax unified
	.arm
	.fpu softvfp
	.type	si_populate_smc_t, %function
si_populate_smc_t:
	@ args = 0, pretend = 0, frame = 32
	@ frame_needed = 0, uses_anonymous_args = 0
	push	{r4, r5, r6, r7, r8, r9, r10, fp, lr}
	ldr	r3, .L19
	sub	sp, sp, #44
	mov	r4, r1
	ldr	r3, [r3]
	str	r3, [sp, #36]
	mov	r3,#0
	mov	r8, r2
	bl	rv770_get_pi
	mov	r9, r0
	mov	r0, r4
	bl	si_get_ps
	ldr	r3, [r0]
	cmp	r3, #8
	bgt	.L16
	cmp	r3, #1
	ble	.L17
	mov	r6, r0
	mov	r0, #0
	ldr	r4, [r8]
	bl	cpu_to_be32
	ldr	r3, [r6]
	str	r0, [r4]
	cmp	r3, #1
	ble	.L5
	mov	r5, #0
	ldr	fp, .L19+4
.L8:
	str	r5, [sp, #12]
	add	r5, r5, #1
	ldr	r2, [r6, #4]
	ldr	r3, .L19+8
	lsl	r10, r5, #2
	sub	r7, r10, #4
	ldr	r1, [r3]
	ldr	r3, [r2, r7]
	ldr	r2, [r2, r5, lsl #2]
	mov	r0, #50
	str	r3, [sp, #20]
	str	r2, [sp, #16]
	bl	__aeabi_idiv
	mul	r0, r5, r0
	ldr	r4, [fp]
	add	ip, sp, #32
	add	r4, r4, r4, lsl #2
	add	r4, r4, r4, lsl #2
	add	r0, r0, r0, lsl #2
	str	ip, [sp, #4]
	lsl	r4, r4, #2
	add	ip, sp, #28
	add	r0, r0, r0, lsl #2
	mov	r1, r4
	ldr	r3, [sp, #20]
	ldr	r2, [sp, #16]
	lsl	r0, r0, #2
	str	ip, [sp]
	bl	r600_calculate_at
	cmp	r0, #0
	beq	.L6
	mvn	r2, #49
	ldr	r3, [fp]
	rsb	r1, r5, r5, lsl #5
	mul	r2, r3, r2
	add	r1, r5, r1, lsl #2
	add	r3, r3, r3, lsl #2
	add	r2, r2, r1, lsl #3
	add	r3, r3, r3, lsl #2
	add	r3, r2, r3, lsl #2
	str	r3, [sp, #28]
	str	r2, [sp, #32]
.L6:
	ldr	r3, [r8]
	ldr	r0, [r3, r7]
	bl	be32_to_cpu
	mov	r4, r0
	ldr	r3, [r9]
	ldr	r0, [sp, #28]
	ldr	r2, .L19+12
	mul	r3, r0, r3
	ldr	r0, .L19+16
	ldr	r2, [r2]
	smull	r1, r0, r3, r0
	asr	r3, r3, #31
	rsb	r0, r3, r0, asr #13
	bic	r4, r4, r2
	bl	CG_R
	ldr	r2, [r8]
	orr	r0, r4, r0
	str	r2, [sp, #16]
	bl	cpu_to_be32
	ldr	r2, [sp, #16]
	ldr	r3, [r6]
	ldr	r1, [r9]
	ldr	r4, [r9, #4]
	str	r0, [r2, r7]
	ldr	r2, [sp, #12]
	sub	r3, r3, #2
	cmp	r3, r2
	movne	r4, r1
	ldr	r0, .L19+20
	bl	CG_R
	ldr	r3, [sp, #32]
	mov	r7, r0
	mul	r4, r3, r4
	ldr	r0, .L19+16
	smull	r3, r0, r4, r0
	asr	r4, r4, #31
	rsb	r0, r4, r0, asr #13
	bl	CG_L
	orr	r0, r7, r0
	ldr	r4, [r8]
	bl	cpu_to_be32
	ldr	r3, [r6]
	str	r0, [r4, r10]
	sub	r3, r3, #1
	cmp	r5, r3
	blt	.L8
.L5:
	mov	r0, #0
.L1:
	ldr	r3, .L19
	ldr	r2, [r3]
	ldr	r3, [sp, #36]
	eors	r2, r3, r2
	mov	r3, #0
	bne	.L18
	add	sp, sp, #44
	@ sp needed
	pop	{r4, r5, r6, r7, r8, r9, r10, fp, pc}
.L16:
	ldr	r3, .L19+24
	ldr	r0, [r3]
	rsb	r0, r0, #0
	b	.L1
.L17:
	ldr	r0, .L19+20
	bl	CG_R
	mov	r4, r0
	mov	r0, #0
	bl	CG_L
	orr	r0, r4, r0
	ldr	r4, [r8]
	bl	cpu_to_be32
	mov	r3, r0
	mov	r0, #0
	str	r3, [r4]
	b	.L1
.L18:
	bl	__stack_chk_fail
.L20:
	.align	2
.L19:
	.word	.LC0
	.word	R600_AH_DFLT
	.word	SISLANDS_MAX_HARDWARE_POWERLEVELS
	.word	CG_R_MASK
	.word	1759218605
	.word	65535
	.word	EINVAL
	.size	si_populate_smc_t, .-si_populate_smc_t
	.comm	SISLANDS_MAX_HARDWARE_POWERLEVELS,4,4
	.comm	R600_AH_DFLT,4,4
	.comm	EINVAL,4,4
	.comm	CG_R_MASK,4,4
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
