	.file	"extr_rt2800lib.c_rt2800_config_3572bt_ant.c"
	.intel_syntax noprefix
	.text
	.p2align 4
	.type	rt2800_config_3572bt_ant, @function
rt2800_config_3572bt_ant:
.LFB0:
	.cfi_startproc
	endbr64
	push	r14
	.cfi_def_cfa_offset 16
	.cfi_offset 14, -16
	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
	sub	rsp, 24
	.cfi_def_cfa_offset 64
	mov	esi, DWORD PTR GPIO_SWITCH[rip]
	mov	rax, QWORD PTR fs:40
	mov	QWORD PTR 8[rsp], rax
	xor	eax, eax
	lea	r14, 4[rsp]
	call	rt2800_register_read@PLT
	mov	DWORD PTR 4[rsp], eax
	mov	rax, QWORD PTR NL80211_BAND_5GHZ[rip]
	cmp	QWORD PTR 0[rbp], rax
	je	.L17
	mov	esi, DWORD PTR GPIO_SWITCH_0[rip]
	xor	edx, edx
	mov	rdi, r14
	call	rt2x00_set_field32@PLT
	mov	esi, DWORD PTR GPIO_SWITCH_1[rip]
	xor	edx, edx
	mov	rdi, r14
	call	rt2x00_set_field32@PLT
.L3:
	mov	edx, DWORD PTR 4[rsp]
	mov	esi, DWORD PTR GPIO_SWITCH[rip]
	mov	rdi, rbp
	call	rt2800_register_write@PLT
	mov	esi, DWORD PTR LED_CFG[rip]
	mov	rdi, rbp
	call	rt2800_register_read@PLT
	mov	esi, DWORD PTR LED_CFG_LED_POLAR[rip]
	mov	edi, eax
	mov	DWORD PTR 4[rsp], eax
	call	rt2x00_get_field32@PLT
	mov	esi, DWORD PTR LED_CFG_LED_POLAR[rip]
	mov	edi, DWORD PTR 4[rsp]
	test	eax, eax
	mov	r12d, eax
	mov	eax, 3
	cmovne	r12d, eax
	call	rt2x00_get_field32@PLT
	mov	esi, DWORD PTR LED_CFG_G_LED_MODE[rip]
	mov	edi, DWORD PTR 4[rsp]
	cmp	eax, 1
	sbb	r13d, r13d
	and	r13d, 3
	call	rt2x00_get_field32@PLT
	cmp	eax, r12d
	je	.L6
.L9:
	mov	esi, DWORD PTR EEPROM_FREQ[rip]
	mov	rdi, rbp
	call	rt2800_eeprom_read@PLT
	mov	esi, DWORD PTR EEPROM_FREQ_LED_MODE[rip]
	mov	edi, eax
	call	rt2x00_get_field16@PLT
	test	eax, eax
	je	.L7
	cmp	eax, 64
	jg	.L7
	lea	ecx, 0[0+r12*4]
	mov	esi, DWORD PTR MCU_BAND_SELECT[rip]
	mov	edx, 255
	mov	rdi, rbp
	or	ecx, r13d
	mov	r8d, 1
	call	rt2800_mcu_request@PLT
.L1:
	mov	rax, QWORD PTR 8[rsp]
	xor	rax, QWORD PTR fs:40
	jne	.L18
	add	rsp, 24
	.cfi_remember_state
	.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
.L7:
	.cfi_restore_state
	mov	esi, DWORD PTR LED_CFG_G_LED_MODE[rip]
	mov	edx, r12d
	mov	rdi, r14
	call	rt2x00_set_field32@PLT
	mov	esi, DWORD PTR LED_CFG_R_LED_MODE[rip]
	mov	edx, r13d
	mov	rdi, r14
	call	rt2x00_set_field32@PLT
	mov	edx, DWORD PTR 4[rsp]
	mov	esi, DWORD PTR LED_CFG[rip]
	mov	rdi, rbp
	call	rt2800_register_write@PLT
	jmp	.L1
	.p2align 4,,10
	.p2align 3
.L6:
	mov	esi, DWORD PTR LED_CFG_R_LED_MODE[rip]
	mov	edi, DWORD PTR 4[rsp]
	call	rt2x00_get_field32@PLT
	cmp	eax, r13d
	jne	.L9
	jmp	.L1
	.p2align 4,,10
	.p2align 3
.L17:
	mov	esi, DWORD PTR GPIO_SWITCH_0[rip]
	mov	rdi, r14
	mov	edx, 1
	call	rt2x00_set_field32@PLT
	mov	esi, DWORD PTR GPIO_SWITCH_1[rip]
	mov	edx, 1
	mov	rdi, r14
	call	rt2x00_set_field32@PLT
	jmp	.L3
.L18:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE0:
	.size	rt2800_config_3572bt_ant, .-rt2800_config_3572bt_ant
	.comm	NL80211_BAND_5GHZ,8,8
	.comm	MCU_BAND_SELECT,4,4
	.comm	LED_CFG_R_LED_MODE,4,4
	.comm	LED_CFG_LED_POLAR,4,4
	.comm	LED_CFG_G_LED_MODE,4,4
	.comm	LED_CFG,4,4
	.comm	GPIO_SWITCH_1,4,4
	.comm	GPIO_SWITCH_0,4,4
	.comm	GPIO_SWITCH,4,4
	.comm	EEPROM_FREQ_LED_MODE,4,4
	.comm	EEPROM_FREQ,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_rt2800lib.c_rt2800_config_3572bt_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	rt2800_config_3572bt_ant, %function
rt2800_config_3572bt_ant:
	@ args = 0, pretend = 0, frame = 8
	@ frame_needed = 0, uses_anonymous_args = 0
	push	{r4, r5, r6, r7, r8, r9, lr}
	mov	r5, r0
	ldr	r4, .L19
	ldr	r3, .L19+4
	sub	sp, sp, #20
	ldr	r1, [r4]
	ldr	r3, [r3]
	str	r3, [sp, #12]
	mov	r3,#0
	bl	rt2800_register_read
	ldr	r3, .L19+8
	ldr	r2, [r5]
	ldr	r3, [r3]
	add	r6, sp, #8
	cmp	r2, r3
	ldr	r3, .L19+12
	str	r0, [sp, #8]
	ldr	r1, [r3]
	mov	r0, r6
	beq	.L17
	mov	r2, #0
	bl	rt2x00_set_field32
	ldr	r3, .L19+16
	mov	r0, r6
	mov	r2, #0
	ldr	r1, [r3]
	bl	rt2x00_set_field32
.L3:
	ldr	r7, .L19+20
	ldr	r2, [sp, #8]
	ldr	r1, [r4]
	mov	r0, r5
	bl	rt2800_register_write
	ldr	r1, [r7]
	mov	r0, r5
	bl	rt2800_register_read
	ldr	r4, .L19+24
	str	r0, [sp, #8]
	ldr	r1, [r4]
	bl	rt2x00_get_field32
	ldr	r1, [r4]
	subs	r4, r0, #0
	ldr	r0, [sp, #8]
	movne	r4, #3
	bl	rt2x00_get_field32
	ldr	r8, .L19+28
	cmp	r0, #0
	ldr	r1, [r8]
	ldr	r0, [sp, #8]
	movne	r9, #0
	moveq	r9, #3
	bl	rt2x00_get_field32
	cmp	r0, r4
	beq	.L6
.L9:
	ldr	r3, .L19+32
	mov	r0, r5
	ldr	r1, [r3]
	bl	rt2800_eeprom_read
	ldr	r3, .L19+36
	ldr	r1, [r3]
	bl	rt2x00_get_field16
	cmp	r0, #64
	movle	r3, #0
	movgt	r3, #1
	cmp	r0, #0
	moveq	r3, #1
	cmp	r3, #0
	bne	.L7
	mov	r1, #1
	ldr	r2, .L19+40
	str	r1, [sp]
	ldr	r1, [r2]
	mov	r0, r5
	mov	r2, #255
	orr	r3, r9, r4, lsl #2
	bl	rt2800_mcu_request
.L1:
	ldr	r3, .L19+4
	ldr	r2, [r3]
	ldr	r3, [sp, #12]
	eors	r2, r3, r2
	mov	r3, #0
	bne	.L18
	add	sp, sp, #20
	@ sp needed
	pop	{r4, r5, r6, r7, r8, r9, pc}
.L7:
	mov	r2, r4
	ldr	r1, [r8]
	mov	r0, r6
	bl	rt2x00_set_field32
	ldr	r3, .L19+44
	mov	r2, r9
	ldr	r1, [r3]
	mov	r0, r6
	bl	rt2x00_set_field32
	mov	r0, r5
	ldr	r1, [r7]
	ldr	r2, [sp, #8]
	bl	rt2800_register_write
	b	.L1
.L6:
	ldr	r3, .L19+44
	ldr	r0, [sp, #8]
	ldr	r1, [r3]
	bl	rt2x00_get_field32
	cmp	r0, r9
	bne	.L9
	b	.L1
.L17:
	mov	r2, #1
	bl	rt2x00_set_field32
	ldr	r3, .L19+16
	mov	r0, r6
	mov	r2, #1
	ldr	r1, [r3]
	bl	rt2x00_set_field32
	b	.L3
.L18:
	bl	__stack_chk_fail
.L20:
	.align	2
.L19:
	.word	GPIO_SWITCH
	.word	.LC0
	.word	NL80211_BAND_5GHZ
	.word	GPIO_SWITCH_0
	.word	GPIO_SWITCH_1
	.word	LED_CFG
	.word	LED_CFG_LED_POLAR
	.word	LED_CFG_G_LED_MODE
	.word	EEPROM_FREQ
	.word	EEPROM_FREQ_LED_MODE
	.word	MCU_BAND_SELECT
	.word	LED_CFG_R_LED_MODE
	.size	rt2800_config_3572bt_ant, .-rt2800_config_3572bt_ant
	.comm	NL80211_BAND_5GHZ,4,4
	.comm	MCU_BAND_SELECT,4,4
	.comm	LED_CFG_R_LED_MODE,4,4
	.comm	LED_CFG_LED_POLAR,4,4
	.comm	LED_CFG_G_LED_MODE,4,4
	.comm	LED_CFG,4,4
	.comm	GPIO_SWITCH_1,4,4
	.comm	GPIO_SWITCH_0,4,4
	.comm	GPIO_SWITCH,4,4
	.comm	EEPROM_FREQ_LED_MODE,4,4
	.comm	EEPROM_FREQ,4,4
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
