	.file	"extr_rs.c_rs_get_best_rate.c"
	.intel_syntax noprefix
	.text
	.p2align 4
	.type	rs_get_best_rate, @function
rs_get_best_rate:
.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
	mov	r14, rdi
	push	r13
	.cfi_def_cfa_offset 32
	.cfi_offset 13, -32
	mov	r13, rdx
	push	r12
	.cfi_def_cfa_offset 40
	.cfi_offset 12, -40
	push	rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	mov	rbp, r8
	push	rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	sub	rsp, 40
	.cfi_def_cfa_offset 96
	mov	rax, QWORD PTR [rsi]
	mov	r12d, DWORD PTR IWL_RATE_INVALID[rip]
	mov	QWORD PTR 16[rsp], rsi
	lea	rdx, [rax+rax*2]
	mov	rax, QWORD PTR 16[rsi]
	mov	DWORD PTR 24[rsp], ecx
	mov	r15d, r12d
	lea	rax, [rax+rdx*8]
	mov	rdx, QWORD PTR 16[rax]
	mov	rax, QWORD PTR [rax]
	mov	eax, DWORD PTR [rax+r8*4]
	mov	ebx, DWORD PTR [rdx+r8*4]
	mov	DWORD PTR 28[rsp], eax
	mov	rax, QWORD PTR 0[r13]
	mov	QWORD PTR 8[rsp], rax
	.p2align 4,,10
	.p2align 3
.L2:
	mov	ecx, DWORD PTR 8[r13]
	mov	edx, DWORD PTR 24[rsp]
	mov	rsi, rbp
	mov	rdi, r14
	call	rs_get_adjacent_rate@PLT
	mov	rsi, QWORD PTR 8[rsp]
	mov	rdi, QWORD PTR 16[rsp]
	mov	edx, DWORD PTR [rsi+rbp*4]
	imul	ecx, edx, 100
	cmp	ecx, DWORD PTR 8[rdi]
	jle	.L3
	cmp	DWORD PTR IWL_RATE_DECREASE_TH[rip], ebx
	jge	.L3
	cmp	DWORD PTR IWL_RATE_HIGH_TH[rip], ebx
	jl	.L3
	cmp	edx, DWORD PTR 28[rsp]
	jle	.L4
	cmp	ebx, DWORD PTR IWL_RATE_SCALE_SWITCH[rip]
	jl	.L6
	.p2align 4,,10
	.p2align 3
.L4:
	cmp	DWORD PTR IWL_RATE_INVALID[rip], r15d
	jne	.L10
	movzx	eax, al
	mov	r12d, ebp
	cmp	r15d, eax
	je	.L1
	movsx	rbp, eax
	jmp	.L2
	.p2align 4,,10
	.p2align 3
.L3:
	cmp	DWORD PTR IWL_RATE_SCALE_SWITCH[rip], ebx
	jg	.L6
	cmp	edx, DWORD PTR 28[rsp]
	jg	.L4
.L6:
	cmp	DWORD PTR IWL_RATE_INVALID[rip], r12d
	jne	.L1
	movzx	eax, ah
	mov	r15d, eax
	cmp	r12d, eax
	je	.L9
	movsx	rbp, eax
	jmp	.L2
	.p2align 4,,10
	.p2align 3
.L9:
	mov	r12d, ebp
.L1:
	add	rsp, 40
	.cfi_remember_state
	.cfi_def_cfa_offset 56
	mov	eax, r12d
	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
.L10:
	.cfi_restore_state
	mov	r12d, r15d
	jmp	.L1
	.cfi_endproc
.LFE0:
	.size	rs_get_best_rate, .-rs_get_best_rate
	.comm	IWL_RATE_SCALE_SWITCH,4,4
	.comm	IWL_RATE_INVALID,4,4
	.comm	IWL_RATE_HIGH_TH,4,4
	.comm	IWL_RATE_DECREASE_TH,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_rs.c_rs_get_best_rate.c"
	.text
	.align	2
	.syntax unified
	.arm
	.fpu softvfp
	.type	rs_get_best_rate, %function
rs_get_best_rate:
	@ args = 4, pretend = 0, frame = 16
	@ frame_needed = 0, uses_anonymous_args = 0
	push	{r4, r5, r6, r7, r8, r9, r10, fp, lr}
	ldr	r9, .L19
	mov	r6, r3
	ldr	r5, [r9]
	ldr	r3, [r1]
	mov	r4, r5
	mov	r7, r1
	ldr	r1, [r1, #8]
	add	r3, r3, r3, lsl #1
	sub	sp, sp, #20
	mov	r8, r0
	add	r0, r1, r3, lsl #2
	ldr	r10, [sp, #56]
	ldr	r0, [r0, #8]
	ldr	r3, [r1, r3, lsl #2]
	str	r2, [sp, #12]
	ldr	r2, [r2]
	ldr	r3, [r3, r10, lsl #2]
	str	r2, [sp, #8]
	ldr	r2, [r0, r10, lsl #2]
	ldr	fp, .L19+4
	str	r2, [sp]
	str	r3, [sp, #4]
.L2:
	ldr	r3, [sp, #12]
	mov	r1, r10
	ldr	r3, [r3, #4]
	mov	r2, r6
	mov	r0, r8
	bl	rs_get_adjacent_rate
	ldr	r3, [sp, #8]
	ldr	ip, [r7, #4]
	ldr	r1, [r3, r10, lsl #2]
	add	r3, r1, r1, lsl #2
	add	r3, r3, r3, lsl #2
	cmp	ip, r3, lsl #2
	bge	.L3
	ldr	r3, .L19+8
	ldr	r2, [sp]
	ldr	r3, [r3]
	cmp	r3, r2
	bge	.L3
	ldr	r3, .L19+12
	ldr	r3, [r3]
	cmp	r3, r2
	blt	.L3
	ldr	r3, [sp, #4]
	cmp	r1, r3
	ble	.L4
	ldr	r3, [fp]
	ldr	r2, [sp]
	cmp	r2, r3
	blt	.L6
.L4:
	ldr	r3, [r9]
	cmp	r3, r4
	bne	.L10
	and	r0, r0, #255
	cmp	r4, r0
	mov	r5, r10
	beq	.L1
	mov	r10, r0
	b	.L2
.L3:
	ldr	r3, [fp]
	ldm	sp, {r2, ip}
	cmp	r3, r2
	movle	r2, #1
	movgt	r2, #0
	cmp	r1, ip
	movle	r2, #0
	cmp	r2, #0
	bne	.L4
.L6:
	ldr	r3, [r9]
	cmp	r3, r5
	bne	.L1
	asr	r0, r0, #8
	and	r4, r0, #255
	cmp	r5, r4
	movne	r10, r4
	bne	.L2
.L9:
	mov	r5, r10
.L1:
	mov	r0, r5
	add	sp, sp, #20
	@ sp needed
	pop	{r4, r5, r6, r7, r8, r9, r10, fp, pc}
.L10:
	mov	r5, r4
	mov	r0, r5
	add	sp, sp, #20
	@ sp needed
	pop	{r4, r5, r6, r7, r8, r9, r10, fp, pc}
.L20:
	.align	2
.L19:
	.word	IWL_RATE_INVALID
	.word	IWL_RATE_SCALE_SWITCH
	.word	IWL_RATE_DECREASE_TH
	.word	IWL_RATE_HIGH_TH
	.size	rs_get_best_rate, .-rs_get_best_rate
	.comm	IWL_RATE_SCALE_SWITCH,4,4
	.comm	IWL_RATE_INVALID,4,4
	.comm	IWL_RATE_HIGH_TH,4,4
	.comm	IWL_RATE_DECREASE_TH,4,4
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
