	.file	"extr_ladder.c_ladder_select_state.c"
	.intel_syntax noprefix
	.text
	.p2align 4
	.type	ladder_select_state, @function
ladder_select_state:
.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
	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
	mov	rbx, rdi
	lea	rdi, ladder_devices[rip]
	sub	rsp, 8
	.cfi_def_cfa_offset 64
	call	this_cpu_ptr@PLT
	mov	edi, DWORD PTR 16[rbp]
	mov	r13d, DWORD PTR 0[rbp]
	mov	r14, rax
	mov	rax, QWORD PTR 8[rbx]
	mov	eax, DWORD PTR [rax]
	test	DWORD PTR CPUIDLE_FLAG_POLLING[rip], eax
	setne	r15b
	call	cpuidle_governor_latency_req@PLT
	xor	edi, edi
	test	eax, eax
	mov	r12d, eax
	sete	dil
	call	unlikely@PLT
	test	rax, rax
	jne	.L14
	movsx	rsi, r13d
	mov	r9, QWORD PTR 8[rbx]
	mov	ecx, DWORD PTR [rbx]
	movzx	r15d, r15b
	mov	r8, rsi
	mov	edi, DWORD PTR 4[rbp]
	lea	rdx, [rsi+rsi*2]
	sal	r8, 4
	sub	ecx, 1
	sal	rdx, 4
	add	rdx, QWORD PTR [r14]
	lea	rax, [r9+r8]
	mov	r10d, DWORD PTR 4[rax]
	sub	edi, r10d
	cmp	ecx, r13d
	jle	.L4
	lea	rcx, 16[r9+r8]
	lea	r11, 1[rsi]
	cmp	QWORD PTR 8[rcx], 0
	jne	.L4
	mov	r8, QWORD PTR 8[rbp]
	cmp	QWORD PTR [r8+r11*8], 0
	jne	.L4
	cmp	DWORD PTR [rdx], edi
	jge	.L4
	cmp	DWORD PTR 4[rcx], r12d
	jg	.L4
	mov	rcx, QWORD PTR 32[rdx]
	mov	QWORD PTR 40[rdx], 0
	lea	ebx, 1[r13]
	add	rcx, 1
	mov	QWORD PTR 32[rdx], rcx
	cmp	rcx, QWORD PTR 8[rdx]
	jge	.L12
	.p2align 4,,10
	.p2align 3
.L4:
	cmp	r13d, r15d
	jle	.L1
	cmp	QWORD PTR 8[rax], 0
	jne	.L5
	mov	rcx, QWORD PTR 8[rbp]
	cmp	QWORD PTR [rcx+rsi*8], 0
	jne	.L5
	cmp	r10d, r12d
	jg	.L5
	cmp	DWORD PTR 16[rdx], edi
	jle	.L1
	mov	rax, QWORD PTR 40[rdx]
	mov	QWORD PTR 32[rdx], 0
	add	rax, 1
	mov	QWORD PTR 40[rdx], rax
	cmp	rax, QWORD PTR 24[rdx]
	jge	.L15
.L1:
	add	rsp, 8
	.cfi_remember_state
	.cfi_def_cfa_offset 56
	mov	eax, r13d
	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
.L5:
	.cfi_restore_state
	lea	ebx, -1[r13]
	cmp	r15d, ebx
	jl	.L9
	jmp	.L12
	.p2align 4,,10
	.p2align 3
.L16:
	sub	ebx, 1
	sub	rax, 16
	cmp	r15d, ebx
	je	.L12
.L9:
	cmp	DWORD PTR -12[rax], r12d
	jg	.L16
.L12:
	mov	edx, r13d
	mov	ecx, ebx
	mov	rsi, r14
	mov	rdi, rbp
	call	ladder_do_selection@PLT
	mov	r13d, ebx
	jmp	.L1
	.p2align 4,,10
	.p2align 3
.L14:
	mov	edx, r13d
	xor	ecx, ecx
	mov	rsi, r14
	mov	rdi, rbp
	call	ladder_do_selection@PLT
	xor	r13d, r13d
	jmp	.L1
.L15:
	lea	ebx, -1[r13]
	jmp	.L12
	.cfi_endproc
.LFE0:
	.size	ladder_select_state, .-ladder_select_state
	.comm	ladder_devices,4,4
	.comm	CPUIDLE_FLAG_POLLING,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_ladder.c_ladder_select_state.c"
	.text
	.align	2
	.syntax unified
	.arm
	.fpu softvfp
	.type	ladder_select_state, %function
ladder_select_state:
	@ args = 0, pretend = 0, frame = 0
	@ frame_needed = 0, uses_anonymous_args = 0
	push	{r3, r4, r5, r6, r7, r8, r9, r10, fp, lr}
	mov	r10, r0
	ldr	r0, .L14
	mov	r7, r1
	bl	this_cpu_ptr
	ldr	r2, [r10, #4]
	ldr	r3, .L14+4
	ldr	r2, [r2]
	ldr	r3, [r3]
	mov	r9, r0
	tst	r2, r3
	ldr	r0, [r7, #12]
	movne	r8, #1
	moveq	r8, #0
	ldr	r5, [r7]
	bl	cpuidle_governor_latency_req
	mov	r6, r0
	clz	r0, r0
	lsr	r0, r0, #5
	bl	unlikely
	cmp	r0, #0
	bne	.L12
	ldr	r4, [r10, #4]
	add	r3, r5, r5, lsl #1
	ldr	lr, [r10]
	add	ip, r4, r3, lsl #2
	sub	lr, lr, #1
	ldr	r2, [ip, #4]
	ldr	r1, [r7, #4]
	ldr	r0, [r9]
	cmp	lr, r5
	lsl	r10, r3, #3
	add	lr, r0, r3, lsl #3
	sub	r1, r1, r2
	lsl	r3, r3, #2
	ble	.L4
	add	r3, r3, #12
	add	r3, r4, r3
	ldr	fp, [r3, #8]
	add	r4, r5, #1
	cmp	fp, #0
	bne	.L4
	ldr	fp, [r7, #8]
	ldr	fp, [fp, r4, lsl #2]
	cmp	fp, #0
	bne	.L4
	ldr	r0, [r0, r10]
	cmp	r0, r1
	bge	.L4
	ldr	r3, [r3, #4]
	cmp	r3, r6
	bgt	.L4
	ldr	r3, [lr, #16]
	ldr	r0, [lr, #4]
	add	r3, r3, #1
	cmp	r3, r0
	str	fp, [lr, #20]
	str	r3, [lr, #16]
	bge	.L7
.L4:
	cmp	r5, r8
	ble	.L1
	ldr	r3, [ip, #8]
	cmp	r3, #0
	bne	.L5
	ldr	r3, [r7, #8]
	cmp	r2, r6
	ldr	r3, [r3, r5, lsl #2]
	movle	r2, #0
	movgt	r2, #1
	cmp	r3, #0
	movne	r2, #1
	cmp	r2, #0
	beq	.L6
.L5:
	sub	r4, r5, #1
	cmp	r8, r4
	blt	.L8
	b	.L7
.L13:
	sub	r4, r4, #1
	cmp	r8, r4
	beq	.L7
.L8:
	ldr	r3, [ip, #-8]
	sub	ip, ip, #12
	cmp	r3, r6
	bgt	.L13
.L7:
	mov	r2, r5
	mov	r1, r9
	mov	r0, r7
	mov	r3, r4
	bl	ladder_do_selection
	mov	r5, r4
.L1:
	mov	r0, r5
	pop	{r3, r4, r5, r6, r7, r8, r9, r10, fp, pc}
.L6:
	ldr	r3, [lr, #8]
	cmp	r3, r1
	ble	.L1
	ldr	r3, [lr, #20]
	ldr	r1, [lr, #12]
	add	r3, r3, #1
	cmp	r3, r1
	str	r2, [lr, #16]
	str	r3, [lr, #20]
	blt	.L1
	sub	r4, r5, #1
	mov	r2, r5
	mov	r1, r9
	mov	r0, r7
	mov	r3, r4
	bl	ladder_do_selection
	mov	r5, r4
	b	.L1
.L12:
	mov	r2, r5
	mov	r5, #0
	mov	r1, r9
	mov	r0, r7
	mov	r3, #0
	bl	ladder_do_selection
	mov	r0, r5
	pop	{r3, r4, r5, r6, r7, r8, r9, r10, fp, pc}
.L15:
	.align	2
.L14:
	.word	ladder_devices
	.word	CPUIDLE_FLAG_POLLING
	.size	ladder_select_state, .-ladder_select_state
	.comm	ladder_devices,4,4
	.comm	CPUIDLE_FLAG_POLLING,4,4
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
