	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function btc8821a2ant_action_hid_a2dp
_btc8821a2ant_action_hid_a2dp:          ## @btc8821a2ant_action_hid_a2dp
	.cfi_startproc
## %bb.0:
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset %rbp, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register %rbp
	pushq	%r15
	pushq	%r14
	pushq	%r13
	pushq	%r12
	pushq	%rbx
	subq	$24, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdi, %r12
	movl	$0, -48(%rbp)
	xorl	%esi, %esi
	movl	$2, %edx
	movl	$15, %ecx
	xorl	%r8d, %r8d
	callq	_btc8821a2ant_wifi_rssi_state
	movl	%eax, -44(%rbp)                 ## 4-byte Spill
	movq	_BT_8821A_2ANT_WIFI_RSSI_COEXSWITCH_THRES@GOTPCREL(%rip), %rax
	movl	(%rax), %ecx
	movq	%r12, %rdi
	movl	$1, %esi
	movl	$2, %edx
	xorl	%r8d, %r8d
	callq	_btc8821a2ant_wifi_rssi_state
	movq	_BT_8821A_2ANT_BT_RSSI_COEXSWITCH_THRES@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	%r12, %rdi
	movl	$3, %esi
	movl	$37, %ecx
	callq	_btc8821a2ant_bt_rssi_state
	movl	%eax, %r15d
	movq	_BTC_RF_A@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r12, %rdi
	movl	$1, %edx
	movl	$1048575, %ecx                  ## imm = 0xFFFFF
	xorl	%r8d, %r8d
	callq	*8(%r12)
	movq	_NORMAL_EXEC@GOTPCREL(%rip), %rbx
	movl	(%rbx), %esi
	movq	%r12, %rdi
	xorl	%edx, %edx
	movl	$1, %ecx
	movl	$5, %r8d
	callq	_btc8821a2ant_limited_rx
	movl	(%rbx), %esi
	movq	%r12, %rdi
	movl	$6, %edx
	callq	_btc8821a2ant_fw_dac_swing_lvl
	movq	_BTC_GET_U4_WIFI_BW@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	leaq	-56(%rbp), %rdx
	movq	%r12, %rdi
	callq	*(%r12)
	movq	-56(%rbp), %r13
	movq	_BTC_WIFI_BW_LEGACY@GOTPCREL(%rip), %rax
	movq	(%rax), %r14
	movl	%r15d, %edi
	callq	_BTC_RSSI_HIGH
	cmpq	%r14, %r13
	jne	LBB0_5
## %bb.1:
	testq	%rax, %rax
	je	LBB0_3
## %bb.2:
	movq	_NORMAL_EXEC@GOTPCREL(%rip), %r14
	movl	(%r14), %esi
	movq	%r12, %rdi
	movl	$2, %edx
	callq	_btc8821a2ant_dec_bt_pwr
	movl	-44(%rbp), %ebx                 ## 4-byte Reload
	jmp	LBB0_10
LBB0_5:
	testq	%rax, %rax
	je	LBB0_3
## %bb.6:
	movq	_BTC_GET_U1_AP_NUM@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	leaq	-48(%rbp), %rdx
	movq	%r12, %rdi
	callq	*(%r12)
	cmpl	$9, -48(%rbp)
	movq	_NORMAL_EXEC@GOTPCREL(%rip), %r14
	movl	(%r14), %esi
	movl	-44(%rbp), %ebx                 ## 4-byte Reload
	jg	LBB0_4
## %bb.7:
	movq	%r12, %rdi
	movl	$4, %edx
	jmp	LBB0_9
LBB0_3:
	movl	%r15d, %edi
	callq	_BTC_RSSI_MEDIUM
	movq	_NORMAL_EXEC@GOTPCREL(%rip), %r14
	movl	(%r14), %esi
	testq	%rax, %rax
	movl	-44(%rbp), %ebx                 ## 4-byte Reload
	je	LBB0_8
LBB0_4:
	movq	%r12, %rdi
	movl	$2, %edx
	jmp	LBB0_9
LBB0_8:
	movq	%r12, %rdi
	xorl	%edx, %edx
LBB0_9:
	callq	_btc8821a2ant_dec_bt_pwr
LBB0_10:
	movq	_BTC_WIFI_BW_LEGACY@GOTPCREL(%rip), %rcx
	movq	-56(%rbp), %rax
	movl	(%r14), %esi
	cmpq	(%rcx), %rax
	jne	LBB0_12
## %bb.11:
	movq	%r12, %rdi
	movl	$7, %edx
	callq	_btc8821a2ant_coex_table_with_type
	movq	_BTC_PS_WIFI_NATIVE@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r12, %rdi
	xorl	%edx, %edx
	xorl	%ecx, %ecx
	jmp	LBB0_13
LBB0_12:
	movq	%r12, %rdi
	movl	$14, %edx
	callq	_btc8821a2ant_coex_table_with_type
	movq	_BTC_PS_LPS_ON@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r12, %rdi
	movl	$80, %edx
	movl	$4, %ecx
LBB0_13:
	callq	_btc8821a2ant_power_save_state
	movl	(%r14), %esi
	movq	%r12, %rdi
	movl	$1, %edx
	movl	$23, %ecx
	callq	_btc8821a2ant_ps_tdma
	movq	-56(%rbp), %rax
	movq	_BTC_WIFI_BW_HT40@GOTPCREL(%rip), %rcx
	xorl	%esi, %esi
	cmpq	(%rcx), %rax
	sete	%sil
	movq	_BTC_RSSI_STATE_HIGH@GOTPCREL(%rip), %rax
	cmpl	(%rax), %ebx
	sete	%al
	movq	_BTC_RSSI_STATE_STAY_HIGH@GOTPCREL(%rip), %rcx
	cmpl	(%rcx), %ebx
	sete	%bl
	orb	%al, %bl
	movq	%r12, %rdi
	movl	$1, %edx
	xorl	%ecx, %ecx
	xorl	%r8d, %r8d
	callq	_btc8821a2ant_sw_mechanism1
	movzbl	%bl, %esi
	movq	%r12, %rdi
	xorl	%edx, %edx
	xorl	%ecx, %ecx
	movl	$24, %r8d
	callq	_btc8821a2ant_sw_mechanism2
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_BT_8821A_2ANT_WIFI_RSSI_COEXSWITCH_THRES,4,2 ## @BT_8821A_2ANT_WIFI_RSSI_COEXSWITCH_THRES
	.comm	_BT_8821A_2ANT_BT_RSSI_COEXSWITCH_THRES,4,2 ## @BT_8821A_2ANT_BT_RSSI_COEXSWITCH_THRES
	.comm	_BTC_RF_A,4,2                   ## @BTC_RF_A
	.comm	_NORMAL_EXEC,4,2                ## @NORMAL_EXEC
	.comm	_BTC_GET_U4_WIFI_BW,4,2         ## @BTC_GET_U4_WIFI_BW
	.comm	_BTC_WIFI_BW_LEGACY,8,3         ## @BTC_WIFI_BW_LEGACY
	.comm	_BTC_GET_U1_AP_NUM,4,2          ## @BTC_GET_U1_AP_NUM
	.comm	_BTC_PS_WIFI_NATIVE,4,2         ## @BTC_PS_WIFI_NATIVE
	.comm	_BTC_PS_LPS_ON,4,2              ## @BTC_PS_LPS_ON
	.comm	_BTC_RSSI_STATE_HIGH,4,2        ## @BTC_RSSI_STATE_HIGH
	.comm	_BTC_RSSI_STATE_STAY_HIGH,4,2   ## @BTC_RSSI_STATE_STAY_HIGH
	.comm	_BTC_WIFI_BW_HT40,8,3           ## @BTC_WIFI_BW_HT40
	.no_dead_strip	_btc8821a2ant_action_hid_a2dp
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function btc8821a2ant_action_hid_a2dp
_btc8821a2ant_action_hid_a2dp:          ; @btc8821a2ant_action_hid_a2dp
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #96
	.cfi_def_cfa_offset 96
	stp	x26, x25, [sp, #16]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #32]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #48]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #64]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #80]             ; 16-byte Folded Spill
	add	x29, sp, #80
	.cfi_def_cfa w29, 16
	.cfi_offset w30, -8
	.cfi_offset w29, -16
	.cfi_offset w19, -24
	.cfi_offset w20, -32
	.cfi_offset w21, -40
	.cfi_offset w22, -48
	.cfi_offset w23, -56
	.cfi_offset w24, -64
	.cfi_offset w25, -72
	.cfi_offset w26, -80
	mov	x19, x0
	str	wzr, [sp, #4]
	mov	w1, #0
	mov	w2, #2
	mov	w3, #15
	mov	w4, #0
	bl	_btc8821a2ant_wifi_rssi_state
	mov	x20, x0
Lloh0:
	adrp	x8, _BT_8821A_2ANT_WIFI_RSSI_COEXSWITCH_THRES@GOTPAGE
Lloh1:
	ldr	x8, [x8, _BT_8821A_2ANT_WIFI_RSSI_COEXSWITCH_THRES@GOTPAGEOFF]
Lloh2:
	ldr	w3, [x8]
	mov	x0, x19
	mov	w1, #1
	mov	w2, #2
	mov	w4, #0
	bl	_btc8821a2ant_wifi_rssi_state
Lloh3:
	adrp	x8, _BT_8821A_2ANT_BT_RSSI_COEXSWITCH_THRES@GOTPAGE
Lloh4:
	ldr	x8, [x8, _BT_8821A_2ANT_BT_RSSI_COEXSWITCH_THRES@GOTPAGEOFF]
Lloh5:
	ldr	w2, [x8]
	mov	x0, x19
	mov	w1, #3
	mov	w3, #37
	bl	_btc8821a2ant_bt_rssi_state
	mov	x21, x0
	ldr	x8, [x19, #8]
Lloh6:
	adrp	x9, _BTC_RF_A@GOTPAGE
Lloh7:
	ldr	x9, [x9, _BTC_RF_A@GOTPAGEOFF]
Lloh8:
	ldr	w1, [x9]
	mov	x0, x19
	mov	w2, #1
	mov	w3, #1048575
	mov	w4, #0
	blr	x8
Lloh9:
	adrp	x22, _NORMAL_EXEC@GOTPAGE
Lloh10:
	ldr	x22, [x22, _NORMAL_EXEC@GOTPAGEOFF]
	ldr	w1, [x22]
	mov	x0, x19
	mov	w2, #0
	mov	w3, #1
	mov	w4, #5
	bl	_btc8821a2ant_limited_rx
	ldr	w1, [x22]
	mov	x0, x19
	mov	w2, #6
	bl	_btc8821a2ant_fw_dac_swing_lvl
	ldr	x8, [x19]
Lloh11:
	adrp	x9, _BTC_GET_U4_WIFI_BW@GOTPAGE
Lloh12:
	ldr	x9, [x9, _BTC_GET_U4_WIFI_BW@GOTPAGEOFF]
Lloh13:
	ldr	w1, [x9]
	add	x2, sp, #8
	mov	x0, x19
	blr	x8
	ldr	x24, [sp, #8]
Lloh14:
	adrp	x23, _BTC_WIFI_BW_LEGACY@GOTPAGE
Lloh15:
	ldr	x23, [x23, _BTC_WIFI_BW_LEGACY@GOTPAGEOFF]
	ldr	x25, [x23]
	mov	x0, x21
	bl	_BTC_RSSI_HIGH
	cmp	x24, x25
	b.ne	LBB0_3
; %bb.1:
	cbz	x0, LBB0_6
; %bb.2:
	ldr	w1, [x22]
	b	LBB0_7
LBB0_3:
	cbz	x0, LBB0_6
; %bb.4:
	ldr	x8, [x19]
Lloh16:
	adrp	x9, _BTC_GET_U1_AP_NUM@GOTPAGE
Lloh17:
	ldr	x9, [x9, _BTC_GET_U1_AP_NUM@GOTPAGEOFF]
Lloh18:
	ldr	w1, [x9]
	add	x2, sp, #4
	mov	x0, x19
	blr	x8
	ldr	w8, [sp, #4]
	ldr	w1, [x22]
	cmp	w8, #9
	b.gt	LBB0_7
; %bb.5:
	mov	x0, x19
	mov	w2, #4
	b	LBB0_8
LBB0_6:
	mov	x0, x21
	bl	_BTC_RSSI_MEDIUM
	ldr	w1, [x22]
	cbz	x0, LBB0_12
LBB0_7:
	mov	x0, x19
	mov	w2, #2
LBB0_8:
	bl	_btc8821a2ant_dec_bt_pwr
	ldr	x8, [sp, #8]
	ldr	x9, [x23]
	ldr	w1, [x22]
	mov	x0, x19
	cmp	x8, x9
	b.ne	LBB0_10
; %bb.9:
	mov	w2, #7
	bl	_btc8821a2ant_coex_table_with_type
Lloh19:
	adrp	x8, _BTC_PS_WIFI_NATIVE@GOTPAGE
Lloh20:
	ldr	x8, [x8, _BTC_PS_WIFI_NATIVE@GOTPAGEOFF]
Lloh21:
	ldr	w1, [x8]
	mov	x0, x19
	mov	w2, #0
	mov	w3, #0
	b	LBB0_11
LBB0_10:
	mov	w2, #14
	bl	_btc8821a2ant_coex_table_with_type
Lloh22:
	adrp	x8, _BTC_PS_LPS_ON@GOTPAGE
Lloh23:
	ldr	x8, [x8, _BTC_PS_LPS_ON@GOTPAGEOFF]
Lloh24:
	ldr	w1, [x8]
	mov	x0, x19
	mov	w2, #80
	mov	w3, #4
LBB0_11:
	bl	_btc8821a2ant_power_save_state
	ldr	w1, [x22]
	mov	x0, x19
	mov	w2, #1
	mov	w3, #23
	bl	_btc8821a2ant_ps_tdma
	ldr	x8, [sp, #8]
Lloh25:
	adrp	x9, _BTC_WIFI_BW_HT40@GOTPAGE
Lloh26:
	ldr	x9, [x9, _BTC_WIFI_BW_HT40@GOTPAGEOFF]
Lloh27:
	ldr	x9, [x9]
	cmp	x8, x9
	cset	w1, eq
Lloh28:
	adrp	x8, _BTC_RSSI_STATE_HIGH@GOTPAGE
Lloh29:
	ldr	x8, [x8, _BTC_RSSI_STATE_HIGH@GOTPAGEOFF]
Lloh30:
	ldr	w8, [x8]
	cmp	w20, w8
Lloh31:
	adrp	x8, _BTC_RSSI_STATE_STAY_HIGH@GOTPAGE
Lloh32:
	ldr	x8, [x8, _BTC_RSSI_STATE_STAY_HIGH@GOTPAGEOFF]
Lloh33:
	ldr	w8, [x8]
	ccmp	w20, w8, #4, ne
	cset	w20, eq
	mov	x0, x19
	mov	w2, #1
	mov	w3, #0
	mov	w4, #0
	bl	_btc8821a2ant_sw_mechanism1
	mov	x0, x19
	mov	x1, x20
	mov	w2, #0
	mov	w3, #0
	mov	w4, #24
	bl	_btc8821a2ant_sw_mechanism2
	ldp	x29, x30, [sp, #80]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #64]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #48]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #32]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #96
	ret
LBB0_12:
	mov	x0, x19
	mov	w2, #0
	b	LBB0_8
	.loh AdrpLdrGot	Lloh14, Lloh15
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.loh AdrpLdrGot	Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh16, Lloh17, Lloh18
	.loh AdrpLdrGotLdr	Lloh19, Lloh20, Lloh21
	.loh AdrpLdrGotLdr	Lloh22, Lloh23, Lloh24
	.loh AdrpLdrGotLdr	Lloh31, Lloh32, Lloh33
	.loh AdrpLdrGotLdr	Lloh28, Lloh29, Lloh30
	.loh AdrpLdrGotLdr	Lloh25, Lloh26, Lloh27
	.cfi_endproc
                                        ; -- End function
	.comm	_BT_8821A_2ANT_WIFI_RSSI_COEXSWITCH_THRES,4,2 ; @BT_8821A_2ANT_WIFI_RSSI_COEXSWITCH_THRES
	.comm	_BT_8821A_2ANT_BT_RSSI_COEXSWITCH_THRES,4,2 ; @BT_8821A_2ANT_BT_RSSI_COEXSWITCH_THRES
	.comm	_BTC_RF_A,4,2                   ; @BTC_RF_A
	.comm	_NORMAL_EXEC,4,2                ; @NORMAL_EXEC
	.comm	_BTC_GET_U4_WIFI_BW,4,2         ; @BTC_GET_U4_WIFI_BW
	.comm	_BTC_WIFI_BW_LEGACY,8,3         ; @BTC_WIFI_BW_LEGACY
	.comm	_BTC_GET_U1_AP_NUM,4,2          ; @BTC_GET_U1_AP_NUM
	.comm	_BTC_PS_WIFI_NATIVE,4,2         ; @BTC_PS_WIFI_NATIVE
	.comm	_BTC_PS_LPS_ON,4,2              ; @BTC_PS_LPS_ON
	.comm	_BTC_RSSI_STATE_HIGH,4,2        ; @BTC_RSSI_STATE_HIGH
	.comm	_BTC_RSSI_STATE_STAY_HIGH,4,2   ; @BTC_RSSI_STATE_STAY_HIGH
	.comm	_BTC_WIFI_BW_HT40,8,3           ; @BTC_WIFI_BW_HT40
	.no_dead_strip	_btc8821a2ant_action_hid_a2dp
.subsections_via_symbols
