	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function rtw8822b_set_channel_cca
_rtw8822b_set_channel_cca:              ## @rtw8822b_set_channel_cca
	.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	%rcx, %rbx
	movl	%edx, %r15d
	movl	%esi, %r14d
	movq	%rdi, %r12
	cmpl	$14, %esi
	jg	LBB0_4
## %bb.1:
	movq	8(%r12), %rdx
	movq	_BB_PATH_A@GOTPCREL(%rip), %rsi
	movq	_BB_PATH_B@GOTPCREL(%rip), %rcx
	movq	_CCUT_IDX_1R_2G@GOTPCREL(%rip), %rdi
	movq	%rdi, %rax
	cmpq	(%rcx), %rdx
	je	LBB0_3
## %bb.2:
	movq	_CCUT_IDX_2R_2G@GOTPCREL(%rip), %rax
LBB0_3:
	leaq	16(%rbx), %rcx
	jmp	LBB0_7
LBB0_4:
	movq	8(%r12), %rdx
	movq	_BB_PATH_A@GOTPCREL(%rip), %rsi
	movq	_BB_PATH_B@GOTPCREL(%rip), %rcx
	movq	_CCUT_IDX_1R_5G@GOTPCREL(%rip), %rdi
	movq	%rdi, %rax
	cmpq	(%rcx), %rdx
	je	LBB0_6
## %bb.5:
	movq	_CCUT_IDX_2R_5G@GOTPCREL(%rip), %rax
LBB0_6:
	leaq	8(%rbx), %rcx
LBB0_7:
	cmpq	(%rsi), %rdx
	cmoveq	%rdi, %rax
	movq	(%rcx), %rdi
	movl	(%rax), %r13d
	leaq	-52(%rbp), %rdx
	leaq	-44(%rbp), %rcx
	leaq	-48(%rbp), %r8
	movl	%r13d, %esi
	callq	_rtw8822b_get_cca_val
	movl	(%rbx), %eax
	cmpl	$128, %eax
	je	LBB0_10
## %bb.8:
	cmpl	$130, %eax
	je	LBB0_9
## %bb.12:
	cmpl	$0, 4(%rbx)
	sete	%al
	jmp	LBB0_13
LBB0_10:
	movb	$1, %al
	cmpl	$14, %r14d
	jg	LBB0_9
LBB0_13:
	movq	16(%r12), %rcx
	movq	_RTW_CHIP_VER_CUT_B@GOTPCREL(%rip), %rdx
	cmpq	(%rdx), %rcx
	jne	LBB0_16
## %bb.14:
	movq	_CCUT_IDX_2R_2G@GOTPCREL(%rip), %rcx
	cmpl	(%rcx), %r13d
	sete	%dl
	movq	_CCUT_IDX_2R_5G@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	cmpl	%ecx, %r13d
	sete	%bl
	orb	%dl, %bl
	movq	_RTW_CHANNEL_WIDTH_40@GOTPCREL(%rip), %rdx
	movl	(%rdx), %edx
	cmpb	$1, %bl
	jne	LBB0_17
## %bb.15:
	cmpl	%r15d, %edx
	je	LBB0_21
	jmp	LBB0_17
LBB0_9:
	xorl	%ebx, %ebx
	jmp	LBB0_22
LBB0_16:
	movq	_CCUT_IDX_2R_5G@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	movq	_RTW_CHANNEL_WIDTH_40@GOTPCREL(%rip), %rdx
	movl	(%rdx), %edx
LBB0_17:
	cmpl	%ecx, %r13d
	sete	%bl
	andb	%bl, %al
	cmpb	$1, %al
	jne	LBB0_19
## %bb.18:
	cmpl	%r15d, %edx
	je	LBB0_21
LBB0_19:
	cmpl	$5, (%r12)
	movb	$1, %bl
	jne	LBB0_22
## %bb.20:
	cmpl	%ecx, %r13d
	jne	LBB0_22
LBB0_21:
	movl	$2040588840, -44(%rbp)          ## imm = 0x79A0EA28
	movb	$1, %bl
LBB0_22:
	movl	%r15d, %r13d
	movq	_REG_CCASEL@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	_MASKDWORD@GOTPCREL(%rip), %r15
	movl	(%r15), %edx
	movl	-52(%rbp), %ecx
	movq	%r12, %rdi
	callq	_rtw_write32_mask
	movq	_REG_PDMFTH@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movl	(%r15), %edx
	movl	-44(%rbp), %ecx
	movq	%r12, %rdi
	callq	_rtw_write32_mask
	movq	_REG_CCA2ND@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movl	(%r15), %edx
	movl	-48(%rbp), %ecx
	movq	%r12, %rdi
	callq	_rtw_write32_mask
	testb	%bl, %bl
	jne	LBB0_25
## %bb.23:
	movq	16(%r12), %rax
	movq	_RTW_CHIP_VER_CUT_B@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	je	LBB0_25
## %bb.24:
	movq	_REG_L1WT@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movl	(%r15), %edx
	movq	%r12, %rdi
	movl	$-1852525895, %ecx              ## imm = 0x9194B2B9
	callq	_rtw_write32_mask
LBB0_25:
	movq	_RTW_CHANNEL_WIDTH_20@GOTPCREL(%rip), %rax
	cmpl	%r13d, (%rax)
	jne	LBB0_29
## %bb.26:
	leal	-52(%r14), %eax
	cmpl	$13, %eax
	jb	LBB0_28
## %bb.27:
	addl	$-100, %r14d
	cmpl	$44, %r14d
	ja	LBB0_29
LBB0_28:
	movq	_REG_CCA2ND@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r12, %rdi
	movl	$240, %edx
	movl	$4, %ecx
	callq	_rtw_write32_mask
LBB0_29:
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_BB_PATH_A,8,3                  ## @BB_PATH_A
	.comm	_BB_PATH_B,8,3                  ## @BB_PATH_B
	.comm	_CCUT_IDX_1R_2G,4,2             ## @CCUT_IDX_1R_2G
	.comm	_CCUT_IDX_2R_2G,4,2             ## @CCUT_IDX_2R_2G
	.comm	_CCUT_IDX_1R_5G,4,2             ## @CCUT_IDX_1R_5G
	.comm	_CCUT_IDX_2R_5G,4,2             ## @CCUT_IDX_2R_5G
	.comm	_RTW_CHIP_VER_CUT_B,8,3         ## @RTW_CHIP_VER_CUT_B
	.comm	_RTW_CHANNEL_WIDTH_40,4,2       ## @RTW_CHANNEL_WIDTH_40
	.comm	_REG_CCASEL,4,2                 ## @REG_CCASEL
	.comm	_MASKDWORD,4,2                  ## @MASKDWORD
	.comm	_REG_PDMFTH,4,2                 ## @REG_PDMFTH
	.comm	_REG_CCA2ND,4,2                 ## @REG_CCA2ND
	.comm	_REG_L1WT,4,2                   ## @REG_L1WT
	.comm	_RTW_CHANNEL_WIDTH_20,4,2       ## @RTW_CHANNEL_WIDTH_20
	.no_dead_strip	_rtw8822b_set_channel_cca
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function rtw8822b_set_channel_cca
_rtw8822b_set_channel_cca:              ; @rtw8822b_set_channel_cca
	.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	x23, x3
	mov	x21, x2
	mov	x20, x1
	mov	x19, x0
	cmp	w1, #14
	b.gt	LBB0_2
; %bb.1:
	add	x8, x23, #16
Lloh0:
	adrp	x9, _BB_PATH_A@GOTPAGE
Lloh1:
	ldr	x9, [x9, _BB_PATH_A@GOTPAGEOFF]
	ldr	x10, [x19, #8]
Lloh2:
	ldr	x9, [x9]
Lloh3:
	adrp	x11, _BB_PATH_B@GOTPAGE
Lloh4:
	ldr	x11, [x11, _BB_PATH_B@GOTPAGEOFF]
Lloh5:
	ldr	x11, [x11]
	cmp	x10, x11
	ccmp	x10, x9, #4, ne
Lloh6:
	adrp	x9, _CCUT_IDX_2R_2G@GOTPAGE
Lloh7:
	ldr	x9, [x9, _CCUT_IDX_2R_2G@GOTPAGEOFF]
Lloh8:
	adrp	x10, _CCUT_IDX_1R_2G@GOTPAGE
Lloh9:
	ldr	x10, [x10, _CCUT_IDX_1R_2G@GOTPAGEOFF]
	b	LBB0_3
LBB0_2:
	add	x8, x23, #8
Lloh10:
	adrp	x9, _BB_PATH_A@GOTPAGE
Lloh11:
	ldr	x9, [x9, _BB_PATH_A@GOTPAGEOFF]
	ldr	x10, [x19, #8]
Lloh12:
	ldr	x9, [x9]
Lloh13:
	adrp	x11, _BB_PATH_B@GOTPAGE
Lloh14:
	ldr	x11, [x11, _BB_PATH_B@GOTPAGEOFF]
Lloh15:
	ldr	x11, [x11]
	cmp	x10, x11
	ccmp	x10, x9, #4, ne
Lloh16:
	adrp	x9, _CCUT_IDX_2R_5G@GOTPAGE
Lloh17:
	ldr	x9, [x9, _CCUT_IDX_2R_5G@GOTPAGEOFF]
Lloh18:
	adrp	x10, _CCUT_IDX_1R_5G@GOTPAGE
Lloh19:
	ldr	x10, [x10, _CCUT_IDX_1R_5G@GOTPAGEOFF]
LBB0_3:
	csel	x9, x10, x9, eq
	ldr	x0, [x8]
	ldr	w22, [x9]
	add	x2, sp, #12
	add	x3, sp, #8
	add	x4, sp, #4
	mov	x1, x22
	bl	_rtw8822b_get_cca_val
	ldr	w8, [x23]
Lloh20:
	adrp	x24, _RTW_CHIP_VER_CUT_B@GOTPAGE
Lloh21:
	ldr	x24, [x24, _RTW_CHIP_VER_CUT_B@GOTPAGEOFF]
	cmp	w8, #128
	b.eq	LBB0_6
; %bb.4:
	cmp	w8, #130
	b.eq	LBB0_10
; %bb.5:
	ldr	w8, [x23, #4]
	cmp	w8, #0
	cset	w8, eq
	b	LBB0_8
LBB0_6:
	cmp	w20, #14
	b.gt	LBB0_10
; %bb.7:
	mov	w8, #1
LBB0_8:
	ldr	x9, [x19, #16]
	ldr	x10, [x24]
	cmp	x9, x10
	b.ne	LBB0_11
; %bb.9:
Lloh22:
	adrp	x9, _CCUT_IDX_2R_2G@GOTPAGE
Lloh23:
	ldr	x9, [x9, _CCUT_IDX_2R_2G@GOTPAGEOFF]
Lloh24:
	ldr	w10, [x9]
Lloh25:
	adrp	x9, _CCUT_IDX_2R_5G@GOTPAGE
Lloh26:
	ldr	x9, [x9, _CCUT_IDX_2R_5G@GOTPAGEOFF]
Lloh27:
	ldr	w9, [x9]
	cmp	w22, w9
	ccmp	w22, w10, #4, ne
Lloh28:
	adrp	x10, _RTW_CHANNEL_WIDTH_40@GOTPAGE
Lloh29:
	ldr	x10, [x10, _RTW_CHANNEL_WIDTH_40@GOTPAGEOFF]
Lloh30:
	ldr	w10, [x10]
	ccmp	w10, w21, #0, eq
	b.ne	LBB0_12
	b	LBB0_15
LBB0_10:
	mov	w23, #0
	b	LBB0_16
LBB0_11:
Lloh31:
	adrp	x9, _CCUT_IDX_2R_5G@GOTPAGE
Lloh32:
	ldr	x9, [x9, _CCUT_IDX_2R_5G@GOTPAGEOFF]
Lloh33:
	ldr	w9, [x9]
Lloh34:
	adrp	x10, _RTW_CHANNEL_WIDTH_40@GOTPAGE
Lloh35:
	ldr	x10, [x10, _RTW_CHANNEL_WIDTH_40@GOTPAGEOFF]
Lloh36:
	ldr	w10, [x10]
LBB0_12:
	cmp	w22, w9
	cset	w11, eq
	and	w8, w8, w11
	cmp	w8, #1
	ccmp	w10, w21, #0, eq
	b.eq	LBB0_15
; %bb.13:
	ldr	w8, [x19]
	mov	w23, #1
	cmp	w8, #5
	b.ne	LBB0_16
; %bb.14:
	cmp	w22, w9
	b.ne	LBB0_16
LBB0_15:
	mov	w8, #59944
	movk	w8, #31136, lsl #16
	str	w8, [sp, #8]
	mov	w23, #1
LBB0_16:
Lloh37:
	adrp	x8, _REG_CCASEL@GOTPAGE
Lloh38:
	ldr	x8, [x8, _REG_CCASEL@GOTPAGEOFF]
Lloh39:
	ldr	w1, [x8]
Lloh40:
	adrp	x25, _MASKDWORD@GOTPAGE
Lloh41:
	ldr	x25, [x25, _MASKDWORD@GOTPAGEOFF]
	ldr	w2, [x25]
	ldr	w3, [sp, #12]
	mov	x0, x19
	bl	_rtw_write32_mask
Lloh42:
	adrp	x8, _REG_PDMFTH@GOTPAGE
Lloh43:
	ldr	x8, [x8, _REG_PDMFTH@GOTPAGEOFF]
Lloh44:
	ldr	w1, [x8]
	ldr	w2, [x25]
	ldr	w3, [sp, #8]
	mov	x0, x19
	bl	_rtw_write32_mask
Lloh45:
	adrp	x22, _REG_CCA2ND@GOTPAGE
Lloh46:
	ldr	x22, [x22, _REG_CCA2ND@GOTPAGEOFF]
	ldr	w1, [x22]
	ldr	w2, [x25]
	ldr	w3, [sp, #4]
	mov	x0, x19
	bl	_rtw_write32_mask
	tbnz	w23, #0, LBB0_19
; %bb.17:
	ldr	x8, [x19, #16]
	ldr	x9, [x24]
	cmp	x8, x9
	b.eq	LBB0_19
; %bb.18:
Lloh47:
	adrp	x8, _REG_L1WT@GOTPAGE
Lloh48:
	ldr	x8, [x8, _REG_L1WT@GOTPAGEOFF]
Lloh49:
	ldr	w1, [x8]
	ldr	w2, [x25]
	mov	x0, x19
	mov	w3, #45753
	movk	w3, #37268, lsl #16
	bl	_rtw_write32_mask
LBB0_19:
Lloh50:
	adrp	x8, _RTW_CHANNEL_WIDTH_20@GOTPAGE
Lloh51:
	ldr	x8, [x8, _RTW_CHANNEL_WIDTH_20@GOTPAGEOFF]
Lloh52:
	ldr	w8, [x8]
	cmp	w8, w21
	b.ne	LBB0_23
; %bb.20:
	sub	w8, w20, #52
	cmp	w8, #13
	b.lo	LBB0_22
; %bb.21:
	sub	w8, w20, #100
	cmp	w8, #44
	b.hi	LBB0_23
LBB0_22:
	ldr	w1, [x22]
	mov	x0, x19
	mov	w2, #240
	mov	w3, #4
	bl	_rtw_write32_mask
LBB0_23:
	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
	.loh AdrpLdrGot	Lloh8, Lloh9
	.loh AdrpLdrGot	Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGot	Lloh18, Lloh19
	.loh AdrpLdrGot	Lloh16, Lloh17
	.loh AdrpLdrGotLdr	Lloh13, Lloh14, Lloh15
	.loh AdrpLdrGotLdr	Lloh10, Lloh11, Lloh12
	.loh AdrpLdrGot	Lloh20, Lloh21
	.loh AdrpLdrGotLdr	Lloh28, Lloh29, Lloh30
	.loh AdrpLdrGotLdr	Lloh25, Lloh26, Lloh27
	.loh AdrpLdrGotLdr	Lloh22, Lloh23, Lloh24
	.loh AdrpLdrGotLdr	Lloh34, Lloh35, Lloh36
	.loh AdrpLdrGotLdr	Lloh31, Lloh32, Lloh33
	.loh AdrpLdrGot	Lloh45, Lloh46
	.loh AdrpLdrGotLdr	Lloh42, Lloh43, Lloh44
	.loh AdrpLdrGot	Lloh40, Lloh41
	.loh AdrpLdrGotLdr	Lloh37, Lloh38, Lloh39
	.loh AdrpLdrGotLdr	Lloh47, Lloh48, Lloh49
	.loh AdrpLdrGotLdr	Lloh50, Lloh51, Lloh52
	.cfi_endproc
                                        ; -- End function
	.comm	_BB_PATH_A,8,3                  ; @BB_PATH_A
	.comm	_BB_PATH_B,8,3                  ; @BB_PATH_B
	.comm	_CCUT_IDX_1R_2G,4,2             ; @CCUT_IDX_1R_2G
	.comm	_CCUT_IDX_2R_2G,4,2             ; @CCUT_IDX_2R_2G
	.comm	_CCUT_IDX_1R_5G,4,2             ; @CCUT_IDX_1R_5G
	.comm	_CCUT_IDX_2R_5G,4,2             ; @CCUT_IDX_2R_5G
	.comm	_RTW_CHIP_VER_CUT_B,8,3         ; @RTW_CHIP_VER_CUT_B
	.comm	_RTW_CHANNEL_WIDTH_40,4,2       ; @RTW_CHANNEL_WIDTH_40
	.comm	_REG_CCASEL,4,2                 ; @REG_CCASEL
	.comm	_MASKDWORD,4,2                  ; @MASKDWORD
	.comm	_REG_PDMFTH,4,2                 ; @REG_PDMFTH
	.comm	_REG_CCA2ND,4,2                 ; @REG_CCA2ND
	.comm	_REG_L1WT,4,2                   ; @REG_L1WT
	.comm	_RTW_CHANNEL_WIDTH_20,4,2       ; @RTW_CHANNEL_WIDTH_20
	.no_dead_strip	_rtw8822b_set_channel_cca
.subsections_via_symbols
