	.file	"extr_rt73usb.c_rt73usb_config_ant.c"
	.intel_syntax noprefix
	.text
	.p2align 4
	.type	rt73usb_config_ant, @function
rt73usb_config_ant:
.LFB0:
	.cfi_startproc
	endbr64
	push	r14
	.cfi_def_cfa_offset 16
	.cfi_offset 14, -16
	mov	r14, rsi
	push	r13
	.cfi_def_cfa_offset 24
	.cfi_offset 13, -24
	push	r12
	.cfi_def_cfa_offset 32
	.cfi_offset 12, -32
	push	rbp
	.cfi_def_cfa_offset 40
	.cfi_offset 6, -40
	mov	rbp, rdi
	mov	edi, 1
	push	rbx
	.cfi_def_cfa_offset 48
	.cfi_offset 3, -48
	sub	rsp, 16
	.cfi_def_cfa_offset 64
	mov	rax, QWORD PTR fs:40
	mov	QWORD PTR 8[rsp], rax
	xor	eax, eax
	mov	rax, QWORD PTR ANTENNA_SW_DIVERSITY[rip]
	cmp	QWORD PTR [rsi], rax
	je	.L2
	xor	edi, edi
	cmp	QWORD PTR 8[rsi], rax
	sete	dil
.L2:
	call	BUG_ON@PLT
	mov	rax, QWORD PTR IEEE80211_BAND_5GHZ[rip]
	lea	rsi, 8[rbp]
	cmp	QWORD PTR 0[rbp], rax
	je	.L17
	mov	edi, DWORD PTR CAPABILITY_EXTERNAL_LNA_BG[rip]
	mov	r13, QWORD PTR antenna_sel_bg[rip]
	call	test_bit@PLT
	mov	r12d, eax
.L4:
	sal	r12, 2
	xor	ebx, ebx
	jmp	.L5
	.p2align 4,,10
	.p2align 3
.L6:
	mov	eax, ebx
	mov	rdi, rbp
	add	ebx, 1
	sal	rax, 4
	add	rax, r13
	mov	rdx, QWORD PTR [rax]
	mov	esi, DWORD PTR 8[rax]
	mov	edx, DWORD PTR [rdx+r12]
	call	rt73usb_bbp_write@PLT
.L5:
	mov	rdi, QWORD PTR antenna_sel_a[rip]
	call	ARRAY_SIZE@PLT
	cmp	eax, ebx
	ja	.L6
	lea	r12, 4[rsp]
	mov	esi, DWORD PTR PHY_CSR0[rip]
	mov	rdi, rbp
	mov	rdx, r12
	call	rt2x00usb_register_read@PLT
	mov	esi, DWORD PTR PHY_CSR0_PA_PE_BG[rip]
	xor	edx, edx
	mov	rdi, r12
	mov	rax, QWORD PTR IEEE80211_BAND_2GHZ[rip]
	cmp	QWORD PTR 0[rbp], rax
	sete	dl
	call	rt2x00_set_field32@PLT
	mov	esi, DWORD PTR PHY_CSR0_PA_PE_A[rip]
	xor	edx, edx
	mov	rdi, r12
	mov	rax, QWORD PTR IEEE80211_BAND_5GHZ[rip]
	cmp	QWORD PTR 0[rbp], rax
	sete	dl
	call	rt2x00_set_field32@PLT
	mov	esi, DWORD PTR PHY_CSR0[rip]
	mov	edx, DWORD PTR 4[rsp]
	mov	rdi, rbp
	call	rt2x00usb_register_write@PLT
	mov	esi, DWORD PTR RF5226[rip]
	mov	rdi, rbp
	call	rt2x00_rf@PLT
	test	rax, rax
	jne	.L9
	mov	esi, DWORD PTR RF5225[rip]
	mov	rdi, rbp
	call	rt2x00_rf@PLT
	test	rax, rax
	je	.L18
.L9:
	mov	rsi, r14
	mov	rdi, rbp
	call	rt73usb_config_antenna_5x@PLT
.L1:
	mov	rax, QWORD PTR 8[rsp]
	xor	rax, QWORD PTR fs:40
	jne	.L19
	add	rsp, 16
	.cfi_remember_state
	.cfi_def_cfa_offset 48
	pop	rbx
	.cfi_def_cfa_offset 40
	pop	rbp
	.cfi_def_cfa_offset 32
	pop	r12
	.cfi_def_cfa_offset 24
	pop	r13
	.cfi_def_cfa_offset 16
	pop	r14
	.cfi_def_cfa_offset 8
	ret
	.p2align 4,,10
	.p2align 3
.L17:
	.cfi_restore_state
	mov	edi, DWORD PTR CAPABILITY_EXTERNAL_LNA_A[rip]
	mov	r13, QWORD PTR antenna_sel_a[rip]
	call	test_bit@PLT
	mov	r12d, eax
	jmp	.L4
	.p2align 4,,10
	.p2align 3
.L18:
	mov	esi, DWORD PTR RF2528[rip]
	mov	rdi, rbp
	call	rt2x00_rf@PLT
	test	rax, rax
	jne	.L11
	mov	esi, DWORD PTR RF2527[rip]
	mov	rdi, rbp
	call	rt2x00_rf@PLT
	test	rax, rax
	je	.L1
.L11:
	mov	rsi, r14
	mov	rdi, rbp
	call	rt73usb_config_antenna_2x@PLT
	jmp	.L1
.L19:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE0:
	.size	rt73usb_config_ant, .-rt73usb_config_ant
	.comm	antenna_sel_bg,8,8
	.comm	antenna_sel_a,8,8
	.comm	RF5226,4,4
	.comm	RF5225,4,4
	.comm	RF2528,4,4
	.comm	RF2527,4,4
	.comm	PHY_CSR0_PA_PE_BG,4,4
	.comm	PHY_CSR0_PA_PE_A,4,4
	.comm	PHY_CSR0,4,4
	.comm	IEEE80211_BAND_5GHZ,8,8
	.comm	IEEE80211_BAND_2GHZ,8,8
	.comm	CAPABILITY_EXTERNAL_LNA_BG,4,4
	.comm	CAPABILITY_EXTERNAL_LNA_A,4,4
	.comm	ANTENNA_SW_DIVERSITY,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_rt73usb.c_rt73usb_config_ant.c"
	.text
	.section	.rodata.cst4,"aM",%progbits,4
	.align	2
.LC0:
	.word	__stack_chk_guard
	.text
	.align	2
	.syntax unified
	.arm
	.fpu softvfp
	.type	rt73usb_config_ant, %function
rt73usb_config_ant:
	@ args = 0, pretend = 0, frame = 8
	@ frame_needed = 0, uses_anonymous_args = 0
	ldr	r3, .L19
	ldr	r2, [r1]
	ldr	r3, [r3]
	push	{r4, r5, r6, r7, r8, r9, r10, lr}
	cmp	r2, r3
	mov	r6, r0
	ldrne	r0, [r1, #4]
	ldr	r2, .L19+4
	subne	r0, r0, r3
	clzne	r0, r0
	moveq	r0, #1
	sub	sp, sp, #8
	lsrne	r0, r0, #5
	mov	r9, r1
	ldr	r2, [r2]
	str	r2, [sp, #4]
	mov	r2,#0
	bl	BUG_ON
	mov	r1, r6
	ldr	r10, .L19+8
	ldr	r2, [r1], #4
	ldr	r3, [r10]
	cmp	r2, r3
	beq	.L16
	ldr	r2, .L19+12
	ldr	r3, .L19+16
	ldr	r0, [r2]
	ldr	r4, [r3]
	bl	test_bit
	ldr	r8, .L19+20
.L4:
	mov	r5, #0
	lsl	r7, r0, #2
	b	.L5
.L6:
	ldr	r3, [r4, #-8]
	mov	r0, r6
	ldr	r1, [r4, #-4]
	ldr	r2, [r3, r7]
	bl	rt73usb_bbp_write
	add	r5, r5, #1
.L5:
	ldr	r0, [r8]
	bl	ARRAY_SIZE
	cmp	r0, r5
	add	r4, r4, #8
	bhi	.L6
	ldr	r4, .L19+24
	mov	r2, sp
	ldr	r1, [r4]
	mov	r0, r6
	bl	rt2x00usb_register_read
	ldr	r3, .L19+28
	ldr	r1, [r6]
	ldr	r2, [r3]
	ldr	r3, .L19+32
	sub	r2, r1, r2
	clz	r2, r2
	ldr	r1, [r3]
	lsr	r2, r2, #5
	mov	r0, sp
	bl	rt2x00_set_field32
	ldr	r1, [r6]
	ldr	r2, [r10]
	ldr	r3, .L19+36
	sub	r2, r1, r2
	clz	r2, r2
	ldr	r1, [r3]
	lsr	r2, r2, #5
	mov	r0, sp
	bl	rt2x00_set_field32
	ldr	r1, [r4]
	ldr	r2, [sp]
	mov	r0, r6
	bl	rt2x00usb_register_write
	ldr	r3, .L19+40
	mov	r0, r6
	ldr	r1, [r3]
	bl	rt2x00_rf
	cmp	r0, #0
	bne	.L9
	ldr	r3, .L19+44
	mov	r0, r6
	ldr	r1, [r3]
	bl	rt2x00_rf
	cmp	r0, #0
	beq	.L17
.L9:
	mov	r1, r9
	mov	r0, r6
	bl	rt73usb_config_antenna_5x
.L1:
	ldr	r3, .L19+4
	ldr	r2, [r3]
	ldr	r3, [sp, #4]
	eors	r2, r3, r2
	mov	r3, #0
	bne	.L18
	add	sp, sp, #8
	@ sp needed
	pop	{r4, r5, r6, r7, r8, r9, r10, pc}
.L16:
	ldr	r3, .L19+48
	ldr	r8, .L19+20
	ldr	r0, [r3]
	ldr	r4, [r8]
	bl	test_bit
	b	.L4
.L17:
	ldr	r3, .L19+52
	mov	r0, r6
	ldr	r1, [r3]
	bl	rt2x00_rf
	cmp	r0, #0
	bne	.L11
	ldr	r3, .L19+56
	mov	r0, r6
	ldr	r1, [r3]
	bl	rt2x00_rf
	cmp	r0, #0
	beq	.L1
.L11:
	mov	r1, r9
	mov	r0, r6
	bl	rt73usb_config_antenna_2x
	b	.L1
.L18:
	bl	__stack_chk_fail
.L20:
	.align	2
.L19:
	.word	ANTENNA_SW_DIVERSITY
	.word	.LC0
	.word	IEEE80211_BAND_5GHZ
	.word	CAPABILITY_EXTERNAL_LNA_BG
	.word	antenna_sel_bg
	.word	antenna_sel_a
	.word	PHY_CSR0
	.word	IEEE80211_BAND_2GHZ
	.word	PHY_CSR0_PA_PE_BG
	.word	PHY_CSR0_PA_PE_A
	.word	RF5226
	.word	RF5225
	.word	CAPABILITY_EXTERNAL_LNA_A
	.word	RF2528
	.word	RF2527
	.size	rt73usb_config_ant, .-rt73usb_config_ant
	.comm	antenna_sel_bg,4,4
	.comm	antenna_sel_a,4,4
	.comm	RF5226,4,4
	.comm	RF5225,4,4
	.comm	RF2528,4,4
	.comm	RF2527,4,4
	.comm	PHY_CSR0_PA_PE_BG,4,4
	.comm	PHY_CSR0_PA_PE_A,4,4
	.comm	PHY_CSR0,4,4
	.comm	IEEE80211_BAND_5GHZ,4,4
	.comm	IEEE80211_BAND_2GHZ,4,4
	.comm	CAPABILITY_EXTERNAL_LNA_BG,4,4
	.comm	CAPABILITY_EXTERNAL_LNA_A,4,4
	.comm	ANTENNA_SW_DIVERSITY,4,4
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
