	.file	"extr_kv_dpm.c_kv_calculate_nbps_level_settings.c"
	.intel_syntax noprefix
	.text
	.p2align 4
	.type	kv_calculate_nbps_level_settings, @function
kv_calculate_nbps_level_settings:
.LFB0:
	.cfi_startproc
	endbr64
	push	rbx
	.cfi_def_cfa_offset 16
	.cfi_offset 3, -16
	mov	rbx, rdi
	call	kv_get_pi@PLT
	mov	rcx, QWORD PTR [rax]
	mov	rsi, QWORD PTR 8[rax]
	cmp	rcx, rsi
	ja	.L20
	mov	rdx, QWORD PTR [rbx]
	cmp	rdx, QWORD PTR CHIP_KABINI[rip]
	mov	r9, QWORD PTR 16[rbx]
	mov	rdi, QWORD PTR 16[rax]
	je	.L4
	cmp	rdx, QWORD PTR CHIP_MULLINS[rip]
	je	.L4
	lea	rdx, [rcx+rcx*2]
	lea	r8, [rdi+rdx*4]
	mov	rdi, rcx
	mov	rdx, r8
	.p2align 4,,10
	.p2align 3
.L13:
	add	rdi, 1
	mov	DWORD PTR [rdx], 1
	add	rdx, 12
	mov	DWORD PTR -8[rdx], 0
	mov	DWORD PTR -4[rdx], 0
	cmp	rsi, rdi
	jnb	.L13
	cmp	QWORD PTR 40[rax], 0
	je	.L18
	cmp	QWORD PTR 24[rax], 0
	je	.L18
	mov	DWORD PTR 8[r8], 40
	mov	DWORD PTR [r8], 0
	cmp	rcx, rsi
	je	.L18
	mov	DWORD PTR 4[r8], 1
	.p2align 4,,10
	.p2align 3
.L18:
	xor	eax, eax
.L1:
	pop	rbx
	.cfi_remember_state
	.cfi_def_cfa_offset 8
	ret
	.p2align 4,,10
	.p2align 3
.L4:
	.cfi_restore_state
	lea	rdx, [rcx+rcx*2]
	lea	r8, [rdi+rdx*4]
	mov	rdx, r8
	.p2align 4,,10
	.p2align 3
.L6:
	add	rcx, 1
	mov	DWORD PTR [rdx], 1
	add	rdx, 12
	mov	DWORD PTR -8[rdx], 0
	mov	DWORD PTR -4[rdx], 0
	cmp	rsi, rcx
	jnb	.L6
	cmp	QWORD PTR 40[rax], 0
	je	.L18
	mov	rdx, QWORD PTR 32[rax]
	cmp	QWORD PTR 24[rdx], r9
	ja	.L21
.L8:
	lea	rax, [rsi+rsi*2]
	lea	rdx, [rdi+rax*4]
	.p2align 4,,10
	.p2align 3
.L11:
	mov	rax, r8
	mov	DWORD PTR [r8], 0
	add	r8, 12
	cmp	rax, rdx
	jne	.L11
	xor	eax, eax
	jmp	.L1
	.p2align 4,,10
	.p2align 3
.L20:
	mov	eax, DWORD PTR EINVAL[rip]
	pop	rbx
	.cfi_remember_state
	.cfi_def_cfa_offset 8
	neg	eax
	ret
	.p2align 4,,10
	.p2align 3
.L21:
	.cfi_restore_state
	cmp	DWORD PTR 8[rbx], 2
	jg	.L8
	cmp	QWORD PTR 48[rax], 0
	jne	.L8
	cmp	QWORD PTR 24[rax], 0
	je	.L10
	mov	DWORD PTR 4[rdi], 1
.L10:
	mov	DWORD PTR 12[rdi], 0
	xor	eax, eax
	mov	DWORD PTR 24[rdi], 0
	mov	DWORD PTR 36[rdi], 0
	mov	DWORD PTR 48[rdi], 0
	pop	rbx
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE0:
	.size	kv_calculate_nbps_level_settings, .-kv_calculate_nbps_level_settings
	.comm	EINVAL,4,4
	.comm	CHIP_MULLINS,8,8
	.comm	CHIP_KABINI,8,8
	.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_kv_dpm.c_kv_calculate_nbps_level_settings.c"
	.text
	.align	2
	.syntax unified
	.arm
	.fpu softvfp
	.type	kv_calculate_nbps_level_settings, %function
kv_calculate_nbps_level_settings:
	@ args = 0, pretend = 0, frame = 0
	@ frame_needed = 0, uses_anonymous_args = 0
	push	{r4, r5, r6, r7, r8, lr}
	mov	r5, r0
	bl	kv_get_pi
	ldr	r2, [r0]
	ldr	r1, [r0, #4]
	cmp	r2, r1
	bhi	.L25
	mov	lr, r0
	ldr	r0, .L27
	ldr	r3, [r5]
	ldr	r0, [r0]
	ldr	r8, [r5, #8]
	cmp	r3, r0
	ldr	r7, [lr, #8]
	beq	.L4
	ldr	r0, .L27+4
	ldr	r0, [r0]
	cmp	r3, r0
	beq	.L4
	add	r5, r2, r2, lsl #1
	add	r6, r7, r5, lsl #2
	mov	r3, r6
	mov	ip, r2
	mov	r4, #1
	mov	r0, #0
	lsl	r5, r5, #2
.L13:
	add	ip, ip, #1
	cmp	r1, ip
	str	r4, [r3]
	str	r0, [r3, #4]
	str	r0, [r3, #8]
	add	r3, r3, #12
	bcs	.L13
	ldr	r3, [lr, #20]
	cmp	r3, #0
	beq	.L12
	ldr	r3, [lr, #12]
	cmp	r3, #0
	beq	.L12
	mov	r3, #40
	cmp	r2, r1
	str	r3, [r6, #8]
	str	r0, [r7, r5]
	beq	.L12
	mov	r0, #0
	str	r4, [r6, #4]
	pop	{r4, r5, r6, r7, r8, pc}
.L4:
	add	ip, r2, r2, lsl #1
	add	ip, r7, ip, lsl #2
	mov	r3, ip
	mov	r6, #1
	mov	r4, #0
.L6:
	add	r2, r2, #1
	cmp	r1, r2
	str	r6, [r3]
	str	r4, [r3, #4]
	str	r4, [r3, #8]
	add	r3, r3, #12
	bcs	.L6
	ldr	r3, [lr, #20]
	cmp	r3, #0
	beq	.L12
	ldr	r3, [lr, #16]
	ldr	r3, [r3, #12]
	cmp	r3, r8
	bhi	.L26
.L8:
	mov	r2, #0
	add	r1, r1, r1, lsl #1
	add	r1, r7, r1, lsl #2
.L11:
	cmp	ip, r1
	str	r2, [ip]
	add	ip, ip, #12
	bne	.L11
.L12:
	mov	r0, #0
	pop	{r4, r5, r6, r7, r8, pc}
.L25:
	ldr	r3, .L27+8
	ldr	r0, [r3]
	rsb	r0, r0, #0
	pop	{r4, r5, r6, r7, r8, pc}
.L26:
	ldr	r3, [r5, #4]
	cmp	r3, #2
	bgt	.L8
	ldr	r0, [lr, #24]
	cmp	r0, #0
	bne	.L8
	ldr	r3, [lr, #12]
	cmp	r3, #0
	mov	r3, #0
	strne	r6, [r7, #4]
	str	r3, [r7, #12]
	str	r3, [r7, #24]
	str	r3, [r7, #36]
	str	r3, [r7, #48]
	pop	{r4, r5, r6, r7, r8, pc}
.L28:
	.align	2
.L27:
	.word	CHIP_KABINI
	.word	CHIP_MULLINS
	.word	EINVAL
	.size	kv_calculate_nbps_level_settings, .-kv_calculate_nbps_level_settings
	.comm	EINVAL,4,4
	.comm	CHIP_MULLINS,4,4
	.comm	CHIP_KABINI,4,4
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
