	.file	"extr_halbtc8821a2ant.c_btc8821a2ant_action_hid_a2dp.c"
	.intel_syntax noprefix
	.text
	.p2align 4
	.type	btc8821a2ant_action_hid_a2dp, @function
btc8821a2ant_action_hid_a2dp:
.LFB0:
	.cfi_startproc
	endbr64
	push	r12
	.cfi_def_cfa_offset 16
	.cfi_offset 12, -16
	xor	r8d, r8d
	mov	ecx, 15
	mov	edx, 2
	push	rbp
	.cfi_def_cfa_offset 24
	.cfi_offset 6, -24
	xor	esi, esi
	mov	rbp, rdi
	push	rbx
	.cfi_def_cfa_offset 32
	.cfi_offset 3, -32
	sub	rsp, 32
	.cfi_def_cfa_offset 64
	mov	rax, QWORD PTR fs:40
	mov	QWORD PTR 24[rsp], rax
	xor	eax, eax
	mov	DWORD PTR 12[rsp], 0
	call	btc8821a2ant_wifi_rssi_state@PLT
	xor	r8d, r8d
	mov	edx, 2
	mov	rdi, rbp
	mov	ecx, DWORD PTR BT_8821A_2ANT_WIFI_RSSI_COEXSWITCH_THRES[rip]
	mov	esi, 1
	mov	r12d, eax
	call	btc8821a2ant_wifi_rssi_state@PLT
	mov	edx, DWORD PTR BT_8821A_2ANT_BT_RSSI_COEXSWITCH_THRES[rip]
	mov	ecx, 37
	mov	rdi, rbp
	mov	esi, 3
	call	btc8821a2ant_bt_rssi_state@PLT
	xor	r8d, r8d
	mov	ecx, 1048575
	mov	rdi, rbp
	mov	esi, DWORD PTR BTC_RF_A[rip]
	mov	ebx, eax
	mov	edx, 1
	call	[QWORD PTR 8[rbp]]
	mov	esi, DWORD PTR NORMAL_EXEC[rip]
	mov	ecx, 1
	xor	edx, edx
	mov	r8d, 5
	mov	rdi, rbp
	call	btc8821a2ant_limited_rx@PLT
	mov	esi, DWORD PTR NORMAL_EXEC[rip]
	mov	edx, 6
	mov	rdi, rbp
	call	btc8821a2ant_fw_dac_swing_lvl@PLT
	mov	rdi, rbp
	mov	esi, DWORD PTR BTC_GET_U4_WIFI_BW[rip]
	lea	rdx, 16[rsp]
	call	[QWORD PTR 0[rbp]]
	mov	rax, QWORD PTR BTC_WIFI_BW_LEGACY[rip]
	mov	edi, ebx
	cmp	QWORD PTR 16[rsp], rax
	je	.L27
	call	BTC_RSSI_HIGH@PLT
	test	rax, rax
	je	.L6
	mov	esi, DWORD PTR BTC_GET_U1_AP_NUM[rip]
	lea	rdx, 12[rsp]
	mov	rdi, rbp
	call	[QWORD PTR 0[rbp]]
	cmp	DWORD PTR 12[rsp], 9
	jg	.L22
	mov	esi, DWORD PTR NORMAL_EXEC[rip]
	mov	edx, 4
	mov	rdi, rbp
	call	btc8821a2ant_dec_bt_pwr@PLT
.L4:
	mov	esi, DWORD PTR NORMAL_EXEC[rip]
	mov	rax, QWORD PTR BTC_WIFI_BW_LEGACY[rip]
	cmp	QWORD PTR 16[rsp], rax
	je	.L28
	mov	edx, 14
	mov	rdi, rbp
	call	btc8821a2ant_coex_table_with_type@PLT
	mov	esi, DWORD PTR BTC_PS_LPS_ON[rip]
	mov	ecx, 4
	mov	rdi, rbp
	mov	edx, 80
	call	btc8821a2ant_power_save_state@PLT
.L10:
	mov	esi, DWORD PTR NORMAL_EXEC[rip]
	mov	ecx, 23
	mov	edx, 1
	mov	rdi, rbp
	call	btc8821a2ant_ps_tdma@PLT
	xor	r8d, r8d
	xor	ecx, ecx
	mov	edx, 1
	mov	rax, QWORD PTR BTC_WIFI_BW_HT40[rip]
	cmp	QWORD PTR 16[rsp], rax
	je	.L29
	xor	esi, esi
	cmp	DWORD PTR BTC_RSSI_STATE_HIGH[rip], r12d
	mov	rdi, rbp
	je	.L18
.L25:
	cmp	DWORD PTR BTC_RSSI_STATE_STAY_HIGH[rip], r12d
	je	.L18
	call	btc8821a2ant_sw_mechanism1@PLT
	mov	r8d, 24
	xor	ecx, ecx
	xor	edx, edx
	xor	esi, esi
	mov	rdi, rbp
	call	btc8821a2ant_sw_mechanism2@PLT
.L1:
	mov	rax, QWORD PTR 24[rsp]
	xor	rax, QWORD PTR fs:40
	jne	.L30
	add	rsp, 32
	.cfi_remember_state
	.cfi_def_cfa_offset 32
	pop	rbx
	.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
.L27:
	.cfi_restore_state
	call	BTC_RSSI_HIGH@PLT
	test	rax, rax
	jne	.L22
.L6:
	mov	edi, ebx
	call	BTC_RSSI_MEDIUM@PLT
	test	rax, rax
	je	.L8
.L22:
	mov	esi, DWORD PTR NORMAL_EXEC[rip]
	mov	edx, 2
	mov	rdi, rbp
	call	btc8821a2ant_dec_bt_pwr@PLT
	jmp	.L4
	.p2align 4,,10
	.p2align 3
.L29:
	cmp	DWORD PTR BTC_RSSI_STATE_HIGH[rip], r12d
	mov	esi, 1
	mov	rdi, rbp
	jne	.L25
	.p2align 4,,10
	.p2align 3
.L18:
	call	btc8821a2ant_sw_mechanism1@PLT
	mov	r8d, 24
	xor	ecx, ecx
	xor	edx, edx
	mov	esi, 1
	mov	rdi, rbp
	call	btc8821a2ant_sw_mechanism2@PLT
	jmp	.L1
	.p2align 4,,10
	.p2align 3
.L28:
	mov	rdi, rbp
	mov	edx, 7
	call	btc8821a2ant_coex_table_with_type@PLT
	mov	esi, DWORD PTR BTC_PS_WIFI_NATIVE[rip]
	xor	ecx, ecx
	xor	edx, edx
	mov	rdi, rbp
	call	btc8821a2ant_power_save_state@PLT
	jmp	.L10
	.p2align 4,,10
	.p2align 3
.L8:
	mov	esi, DWORD PTR NORMAL_EXEC[rip]
	xor	edx, edx
	mov	rdi, rbp
	call	btc8821a2ant_dec_bt_pwr@PLT
	jmp	.L4
.L30:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE0:
	.size	btc8821a2ant_action_hid_a2dp, .-btc8821a2ant_action_hid_a2dp
	.comm	NORMAL_EXEC,4,4
	.comm	BT_8821A_2ANT_WIFI_RSSI_COEXSWITCH_THRES,4,4
	.comm	BT_8821A_2ANT_BT_RSSI_COEXSWITCH_THRES,4,4
	.comm	BTC_WIFI_BW_LEGACY,8,8
	.comm	BTC_WIFI_BW_HT40,8,8
	.comm	BTC_RSSI_STATE_STAY_HIGH,4,4
	.comm	BTC_RSSI_STATE_HIGH,4,4
	.comm	BTC_RF_A,4,4
	.comm	BTC_PS_WIFI_NATIVE,4,4
	.comm	BTC_PS_LPS_ON,4,4
	.comm	BTC_GET_U4_WIFI_BW,4,4
	.comm	BTC_GET_U1_AP_NUM,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_halbtc8821a2ant.c_btc8821a2ant_action_hid_a2dp.c"
	.text
	.section	.rodata.cst4,"aM",%progbits,4
	.align	2
.LC0:
	.word	__stack_chk_guard
	.text
	.align	2
	.syntax unified
	.arm
	.fpu softvfp
	.type	btc8821a2ant_action_hid_a2dp, %function
btc8821a2ant_action_hid_a2dp:
	@ args = 0, pretend = 0, frame = 16
	@ frame_needed = 0, uses_anonymous_args = 0
	push	{r4, r5, r6, r7, r8, lr}
	mov	r5, #0
	sub	sp, sp, #24
	ldr	ip, .L31
	mov	r1, r5
	str	r5, [sp]
	mov	r3, #15
	mov	r2, #2
	mov	r4, r0
	ldr	ip, [ip]
	str	ip, [sp, #20]
	mov	ip,#0
	str	r5, [sp, #16]
	bl	btc8821a2ant_wifi_rssi_state
	ldr	r3, .L31+4
	str	r5, [sp]
	mov	r2, #2
	mov	r1, #1
	ldr	r3, [r3]
	mov	r8, r0
	mov	r0, r4
	bl	btc8821a2ant_wifi_rssi_state
	ldr	r3, .L31+8
	mov	r1, #3
	ldr	r2, [r3]
	mov	r0, r4
	mov	r3, #37
	bl	btc8821a2ant_bt_rssi_state
	ldr	r3, .L31+12
	str	r5, [sp]
	ldr	r1, [r3]
	mov	r6, r0
	mov	r2, #1
	ldr	r7, [r4, #4]
	ldr	r3, .L31+16
	mov	r0, r4
	blx	r7
	mov	r3, #5
	ldr	r7, .L31+20
	str	r3, [sp]
	mov	r2, r5
	mov	r3, #1
	ldr	r1, [r7]
	mov	r0, r4
	bl	btc8821a2ant_limited_rx
	mov	r2, #6
	ldr	r1, [r7]
	mov	r0, r4
	bl	btc8821a2ant_fw_dac_swing_lvl
	ldr	r2, .L31+24
	ldr	r5, .L31+28
	ldr	r3, [r4]
	ldr	r1, [r2]
	mov	r0, r4
	add	r2, sp, #12
	blx	r3
	ldr	r3, [r5]
	ldr	r2, [sp, #12]
	mov	r0, r6
	cmp	r2, r3
	beq	.L27
	bl	BTC_RSSI_HIGH
	cmp	r0, #0
	beq	.L6
	ldr	r2, .L31+32
	ldr	r3, [r4]
	ldr	r1, [r2]
	mov	r0, r4
	add	r2, sp, #16
	blx	r3
	ldr	r3, [sp, #16]
	cmp	r3, #9
	bgt	.L22
	mov	r2, #4
	mov	r0, r4
	ldr	r1, [r7]
	bl	btc8821a2ant_dec_bt_pwr
.L4:
	ldr	r3, [r5]
	ldr	r2, [sp, #12]
	ldr	r1, [r7]
	cmp	r2, r3
	beq	.L28
	mov	r2, #14
	mov	r0, r4
	bl	btc8821a2ant_coex_table_with_type
	ldr	r2, .L31+36
	mov	r3, #4
	ldr	r1, [r2]
	mov	r0, r4
	mov	r2, #80
	bl	btc8821a2ant_power_save_state
.L10:
	mov	r3, #23
	mov	r2, #1
	mov	r0, r4
	ldr	r1, [r7]
	bl	btc8821a2ant_ps_tdma
	ldr	r3, .L31+40
	ldr	r2, [sp, #12]
	ldr	r3, [r3]
	ldr	r5, .L31+44
	cmp	r2, r3
	ldr	r3, [r5]
	mov	r2, #1
	mov	r5, #0
	beq	.L29
	cmp	r3, r8
	beq	.L18
	ldr	r3, .L31+48
	ldr	r3, [r3]
	cmp	r3, r8
	beq	.L18
	mov	r3, r5
	mov	r1, r5
	str	r5, [sp]
.L23:
	mov	r0, r4
	bl	btc8821a2ant_sw_mechanism1
	mov	ip, #24
	mov	r0, r4
	mov	r3, r5
	mov	r2, r5
	mov	r1, r5
	str	ip, [sp]
	bl	btc8821a2ant_sw_mechanism2
.L1:
	ldr	r3, .L31
	ldr	r2, [r3]
	ldr	r3, [sp, #20]
	eors	r2, r3, r2
	mov	r3, #0
	bne	.L30
	add	sp, sp, #24
	@ sp needed
	pop	{r4, r5, r6, r7, r8, pc}
.L27:
	bl	BTC_RSSI_HIGH
	cmp	r0, #0
	bne	.L22
.L6:
	mov	r0, r6
	bl	BTC_RSSI_MEDIUM
	subs	r2, r0, #0
	beq	.L8
.L22:
	mov	r2, #2
	mov	r0, r4
	ldr	r1, [r7]
	bl	btc8821a2ant_dec_bt_pwr
	b	.L4
.L18:
	mov	r3, r5
	mov	r1, r5
	str	r5, [sp]
.L24:
	mov	r0, r4
	bl	btc8821a2ant_sw_mechanism1
	mov	r1, #24
	mov	r0, r4
	str	r1, [sp]
	mov	r3, r5
	mov	r2, r5
	mov	r1, #1
	bl	btc8821a2ant_sw_mechanism2
	b	.L1
.L29:
	cmp	r3, r8
	beq	.L15
	ldr	r3, .L31+48
	ldr	r3, [r3]
	cmp	r3, r8
	bne	.L16
.L15:
	mov	r3, r5
	mov	r1, r2
	str	r5, [sp]
	b	.L24
.L28:
	mov	r2, #7
	mov	r0, r4
	bl	btc8821a2ant_coex_table_with_type
	mov	r3, #0
	ldr	r1, .L31+52
	mov	r2, r3
	mov	r0, r4
	ldr	r1, [r1]
	bl	btc8821a2ant_power_save_state
	b	.L10
.L8:
	mov	r0, r4
	ldr	r1, [r7]
	bl	btc8821a2ant_dec_bt_pwr
	b	.L4
.L16:
	mov	r3, r5
	mov	r1, r2
	str	r5, [sp]
	b	.L23
.L30:
	bl	__stack_chk_fail
.L32:
	.align	2
.L31:
	.word	.LC0
	.word	BT_8821A_2ANT_WIFI_RSSI_COEXSWITCH_THRES
	.word	BT_8821A_2ANT_BT_RSSI_COEXSWITCH_THRES
	.word	BTC_RF_A
	.word	1048575
	.word	NORMAL_EXEC
	.word	BTC_GET_U4_WIFI_BW
	.word	BTC_WIFI_BW_LEGACY
	.word	BTC_GET_U1_AP_NUM
	.word	BTC_PS_LPS_ON
	.word	BTC_WIFI_BW_HT40
	.word	BTC_RSSI_STATE_HIGH
	.word	BTC_RSSI_STATE_STAY_HIGH
	.word	BTC_PS_WIFI_NATIVE
	.size	btc8821a2ant_action_hid_a2dp, .-btc8821a2ant_action_hid_a2dp
	.comm	NORMAL_EXEC,4,4
	.comm	BT_8821A_2ANT_WIFI_RSSI_COEXSWITCH_THRES,4,4
	.comm	BT_8821A_2ANT_BT_RSSI_COEXSWITCH_THRES,4,4
	.comm	BTC_WIFI_BW_LEGACY,4,4
	.comm	BTC_WIFI_BW_HT40,4,4
	.comm	BTC_RSSI_STATE_STAY_HIGH,4,4
	.comm	BTC_RSSI_STATE_HIGH,4,4
	.comm	BTC_RF_A,4,4
	.comm	BTC_PS_WIFI_NATIVE,4,4
	.comm	BTC_PS_LPS_ON,4,4
	.comm	BTC_GET_U4_WIFI_BW,4,4
	.comm	BTC_GET_U1_AP_NUM,4,4
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
