	.file	"extr_rt61pci.c_rt61pci_link_tuner.c"
	.intel_syntax noprefix
	.text
	.p2align 4
	.type	rt61pci_link_tuner, @function
rt61pci_link_tuner:
.LFB0:
	.cfi_startproc
	endbr64
	push	r12
	.cfi_def_cfa_offset 16
	.cfi_offset 12, -16
	mov	r12, rsi
	push	rbp
	.cfi_def_cfa_offset 24
	.cfi_offset 6, -24
	mov	rbp, rdi
	sub	rsp, 8
	.cfi_def_cfa_offset 32
	mov	rax, QWORD PTR NL80211_BAND_5GHZ[rip]
	cmp	QWORD PTR [rdi], rax
	je	.L17
	call	rt2x00_has_cap_external_lna_bg@PLT
	cmp	rax, 1
	sbb	ecx, ecx
	and	ecx, -16
	add	ecx, 48
	cmp	rax, 1
	sbb	edx, edx
	and	edx, -16
	add	edx, 80
.L3:
	mov	eax, DWORD PTR 8[rbp]
	test	eax, eax
	je	.L4
	mov	eax, DWORD PTR [r12]
	cmp	eax, -35
	jge	.L18
	cmp	eax, -58
	jge	.L14
	cmp	eax, -66
	jge	.L19
	cmp	eax, -74
	jge	.L20
	mov	esi, -74
	sub	esi, eax
	mov	eax, esi
	add	eax, eax
	sub	edx, eax
	cmp	ecx, edx
	cmovge	edx, ecx
	cmp	edx, DWORD PTR 4[r12]
	jl	.L14
.L4:
	mov	eax, DWORD PTR 8[r12]
	cmp	eax, 512
	jg	.L21
	cmp	eax, 99
	jg	.L1
	mov	edx, DWORD PTR 4[r12]
	cmp	edx, ecx
	jg	.L22
.L1:
	add	rsp, 8
	.cfi_remember_state
	.cfi_def_cfa_offset 24
	pop	rbp
	.cfi_def_cfa_offset 16
	pop	r12
	.cfi_def_cfa_offset 8
	ret
	.p2align 4,,10
	.p2align 3
.L21:
	.cfi_restore_state
	mov	eax, DWORD PTR 4[r12]
	cmp	eax, edx
	jge	.L1
	lea	edx, 1[rax]
.L15:
	mov	DWORD PTR 4[r12], edx
.L14:
	add	rsp, 8
	.cfi_remember_state
	.cfi_def_cfa_offset 24
	mov	rsi, r12
	mov	rdi, rbp
	pop	rbp
	.cfi_def_cfa_offset 16
	pop	r12
	.cfi_def_cfa_offset 8
	jmp	rt61pci_set_vgc@PLT
	.p2align 4,,10
	.p2align 3
.L17:
	.cfi_restore_state
	call	rt2x00_has_cap_external_lna_a@PLT
	cmp	rax, 1
	sbb	ecx, ecx
	and	ecx, -16
	add	ecx, 56
	cmp	rax, 1
	sbb	edx, edx
	and	edx, -16
	add	edx, 88
	jmp	.L3
	.p2align 4,,10
	.p2align 3
.L22:
	sub	edx, 1
	jmp	.L15
	.p2align 4,,10
	.p2align 3
.L18:
	mov	edx, 96
	jmp	.L14
	.p2align 4,,10
	.p2align 3
.L19:
	lea	edx, 16[rcx]
	jmp	.L14
	.p2align 4,,10
	.p2align 3
.L20:
	lea	edx, 8[rcx]
	jmp	.L14
	.cfi_endproc
.LFE0:
	.size	rt61pci_link_tuner, .-rt61pci_link_tuner
	.comm	NL80211_BAND_5GHZ,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_rt61pci.c_rt61pci_link_tuner.c"
	.text
	.align	2
	.syntax unified
	.arm
	.fpu softvfp
	.type	rt61pci_link_tuner, %function
rt61pci_link_tuner:
	@ args = 0, pretend = 0, frame = 0
	@ frame_needed = 0, uses_anonymous_args = 0
	ldr	r3, .L26
	ldr	r2, [r0]
	ldr	r3, [r3]
	push	{r4, r5, r6, lr}
	cmp	r2, r3
	mov	r5, r0
	mov	r4, r1
	beq	.L21
	bl	rt2x00_has_cap_external_lna_bg
	cmp	r0, #0
	moveq	r1, #32
	movne	r1, #48
	moveq	r2, #64
	movne	r2, #80
.L3:
	ldr	r3, [r5, #4]
	cmp	r3, #0
	beq	.L4
	ldr	r3, [r4]
	cmn	r3, #35
	bge	.L22
	cmn	r3, #58
	bge	.L17
	cmn	r3, #66
	bge	.L23
	cmn	r3, #74
	bge	.L24
	mvn	r0, #73
	sub	r3, r0, r3
	sub	r2, r2, r3, lsl #1
	cmp	r1, r2
	movge	r2, r1
	ldr	r3, [r4, #4]
	cmp	r2, r3
	blt	.L17
.L4:
	ldr	r3, [r4, #8]
	cmp	r3, #512
	bgt	.L25
	cmp	r3, #99
	popgt	{r4, r5, r6, pc}
	ldr	r2, [r4, #4]
	cmp	r2, r1
	pople	{r4, r5, r6, pc}
	sub	r2, r2, #1
.L18:
	str	r2, [r4, #4]
.L17:
	mov	r1, r4
	mov	r0, r5
	pop	{r4, r5, r6, lr}
	b	rt61pci_set_vgc
.L25:
	ldr	r3, [r4, #4]
	cmp	r3, r2
	addlt	r2, r3, #1
	popge	{r4, r5, r6, pc}
	b	.L18
.L21:
	bl	rt2x00_has_cap_external_lna_a
	cmp	r0, #0
	moveq	r1, #40
	movne	r1, #56
	moveq	r2, #72
	movne	r2, #88
	b	.L3
.L22:
	mov	r1, r4
	mov	r0, r5
	pop	{r4, r5, r6, lr}
	mov	r2, #96
	b	rt61pci_set_vgc
.L23:
	mov	r0, r5
	add	r2, r1, #16
	mov	r1, r4
	pop	{r4, r5, r6, lr}
	b	rt61pci_set_vgc
.L24:
	mov	r0, r5
	add	r2, r1, #8
	mov	r1, r4
	pop	{r4, r5, r6, lr}
	b	rt61pci_set_vgc
.L27:
	.align	2
.L26:
	.word	NL80211_BAND_5GHZ
	.size	rt61pci_link_tuner, .-rt61pci_link_tuner
	.comm	NL80211_BAND_5GHZ,4,4
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
