	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_rtl8821ae_phy_sw_chnl          ## -- Begin function rtl8821ae_phy_sw_chnl
	.p2align	4, 0x90
_rtl8821ae_phy_sw_chnl:                 ## @rtl8821ae_phy_sw_chnl
	.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
	pushq	%rax
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdi, %r12
	callq	_rtl_priv
	movq	%rax, %r14
	movq	%r12, %rdi
	callq	_rtl_priv
	movq	%rax, %rdi
	callq	_rtl_hal
	xorl	%ebx, %ebx
	cmpl	$0, 4(%r14)
	jne	LBB0_14
## %bb.1:
	cmpq	$0, 16(%r14)
	jne	LBB0_14
## %bb.2:
	movq	%rax, %r15
	movq	%rax, %rdi
	callq	_is_hal_stop
	testq	%rax, %rax
	jne	LBB0_15
## %bb.3:
	movq	%r12, %rdi
	callq	_RT_CANNOT_IO
	testq	%rax, %rax
	je	LBB0_4
LBB0_15:
	movq	_COMP_CHAN@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	_DBG_LOUD@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	leaq	L_.str(%rip), %rcx
	xorl	%ebx, %ebx
	movq	%r14, %rdi
	xorl	%eax, %eax
	callq	_RT_TRACE
LBB0_14:
	movl	%ebx, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_4:
	cmpq	$0, 8(%r14)
	je	LBB0_8
## %bb.5:
	xorl	%ebx, %ebx
	.p2align	4, 0x90
LBB0_6:                                 ## =>This Inner Loop Header: Depth=1
	movl	$50, %edi
	callq	_mdelay
	cmpq	$0, 8(%r14)
	je	LBB0_8
## %bb.7:                               ##   in Loop: Header=BB0_6 Depth=1
	leaq	50(%rbx), %rax
	cmpq	$950, %rbx                      ## imm = 0x3B6
	movq	%rax, %rbx
	jb	LBB0_6
LBB0_8:
	cmpl	$15, (%r14)
	movq	(%r15), %rax
	jl	LBB0_10
## %bb.9:
	movq	_BAND_ON_5G@GOTPCREL(%rip), %rcx
	jmp	LBB0_11
LBB0_10:
	movq	_BAND_ON_2_4G@GOTPCREL(%rip), %rcx
LBB0_11:
	movq	(%rcx), %rsi
	cmpq	%rsi, %rax
	je	LBB0_13
## %bb.12:
	movq	%r12, %rdi
	callq	_rtl8821ae_phy_switch_wirelessband
LBB0_13:
	movl	$1, 4(%r14)
	movq	_COMP_SCAN@GOTPCREL(%rip), %r13
	movl	(%r13), %esi
	movq	_DBG_TRACE@GOTPCREL(%rip), %rbx
	movl	(%rbx), %edx
	movl	(%r14), %r8d
	movq	(%r15), %r9
	leaq	L_.str.1(%rip), %rcx
	movq	%r14, %rdi
	xorl	%eax, %eax
	callq	_RT_TRACE
	movq	%r12, %rdi
	callq	_rtl8821ae_phy_sw_chnl_callback
	movq	%r12, %rdi
	callq	_rtl8821ae_dm_clear_txpower_tracking_state
	movl	(%r14), %esi
	movq	%r12, %rdi
	callq	_rtl8821ae_phy_set_txpower_level
	movl	(%r13), %esi
	movl	(%rbx), %edx
	leaq	L_.str.2(%rip), %rcx
	movq	%r14, %rdi
	xorl	%eax, %eax
	callq	_RT_TRACE
	movl	$0, 4(%r14)
	movl	$1, %ebx
	jmp	LBB0_14
	.cfi_endproc
                                        ## -- End function
	.comm	_COMP_CHAN,4,2                  ## @COMP_CHAN
	.comm	_DBG_LOUD,4,2                   ## @DBG_LOUD
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"sw_chnl_inprogress false driver sleep or unload\n"

	.comm	_BAND_ON_5G,8,3                 ## @BAND_ON_5G
	.comm	_BAND_ON_2_4G,8,3               ## @BAND_ON_2_4G
	.comm	_COMP_SCAN,4,2                  ## @COMP_SCAN
	.comm	_DBG_TRACE,4,2                  ## @DBG_TRACE
L_.str.1:                               ## @.str.1
	.asciz	"switch to channel%d, band type is %d\n"

L_.str.2:                               ## @.str.2
	.asciz	"\n"

.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_rtl8821ae_phy_sw_chnl          ; -- Begin function rtl8821ae_phy_sw_chnl
	.p2align	2
_rtl8821ae_phy_sw_chnl:                 ; @rtl8821ae_phy_sw_chnl
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #80
	.cfi_def_cfa_offset 80
	stp	x24, x23, [sp, #16]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #32]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #48]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #64]             ; 16-byte Folded Spill
	add	x29, sp, #64
	.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
	mov	x20, x0
	bl	_rtl_priv
	mov	x19, x0
	mov	x0, x20
	bl	_rtl_priv
	bl	_rtl_hal
	ldr	w8, [x19, #4]
	cbnz	w8, LBB0_5
; %bb.1:
	ldr	x8, [x19, #16]
	cbnz	x8, LBB0_5
; %bb.2:
	mov	x21, x0
	bl	_is_hal_stop
	cbnz	x0, LBB0_4
; %bb.3:
	mov	x0, x20
	bl	_RT_CANNOT_IO
	cbz	x0, LBB0_7
LBB0_4:
Lloh0:
	adrp	x8, _COMP_CHAN@GOTPAGE
Lloh1:
	ldr	x8, [x8, _COMP_CHAN@GOTPAGEOFF]
Lloh2:
	ldr	w1, [x8]
Lloh3:
	adrp	x8, _DBG_LOUD@GOTPAGE
Lloh4:
	ldr	x8, [x8, _DBG_LOUD@GOTPAGEOFF]
Lloh5:
	ldr	w2, [x8]
Lloh6:
	adrp	x3, l_.str@PAGE
Lloh7:
	add	x3, x3, l_.str@PAGEOFF
	mov	x0, x19
	bl	_RT_TRACE
LBB0_5:
	mov	w22, #0
LBB0_6:
	mov	x0, x22
	ldp	x29, x30, [sp, #64]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #48]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #32]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #80
	ret
LBB0_7:
	ldr	x8, [x19, #8]
	cbz	x8, LBB0_11
; %bb.8:
	mov	x22, #0
LBB0_9:                                 ; =>This Inner Loop Header: Depth=1
	mov	w0, #50
	bl	_mdelay
	ldr	x8, [x19, #8]
	cbz	x8, LBB0_11
; %bb.10:                               ;   in Loop: Header=BB0_9 Depth=1
	add	x8, x22, #50
	cmp	x22, #950
	mov	x22, x8
	b.lo	LBB0_9
LBB0_11:
	ldr	w9, [x19]
	ldr	x8, [x21]
	cmp	w9, #15
	b.lt	LBB0_13
; %bb.12:
Lloh8:
	adrp	x9, _BAND_ON_5G@GOTPAGE
Lloh9:
	ldr	x9, [x9, _BAND_ON_5G@GOTPAGEOFF]
	b	LBB0_14
LBB0_13:
Lloh10:
	adrp	x9, _BAND_ON_2_4G@GOTPAGE
Lloh11:
	ldr	x9, [x9, _BAND_ON_2_4G@GOTPAGEOFF]
LBB0_14:
	ldr	x1, [x9]
	cmp	x8, x1
	b.eq	LBB0_16
; %bb.15:
	mov	x0, x20
	bl	_rtl8821ae_phy_switch_wirelessband
LBB0_16:
	mov	w22, #1
	str	w22, [x19, #4]
Lloh12:
	adrp	x23, _COMP_SCAN@GOTPAGE
Lloh13:
	ldr	x23, [x23, _COMP_SCAN@GOTPAGEOFF]
	ldr	w1, [x23]
Lloh14:
	adrp	x24, _DBG_TRACE@GOTPAGE
Lloh15:
	ldr	x24, [x24, _DBG_TRACE@GOTPAGEOFF]
	ldr	w2, [x24]
	ldr	x8, [x21]
	ldr	w9, [x19]
	stp	x9, x8, [sp]
Lloh16:
	adrp	x3, l_.str.1@PAGE
Lloh17:
	add	x3, x3, l_.str.1@PAGEOFF
	mov	x0, x19
	bl	_RT_TRACE
	mov	x0, x20
	bl	_rtl8821ae_phy_sw_chnl_callback
	mov	x0, x20
	bl	_rtl8821ae_dm_clear_txpower_tracking_state
	ldr	w1, [x19]
	mov	x0, x20
	bl	_rtl8821ae_phy_set_txpower_level
	ldr	w1, [x23]
	ldr	w2, [x24]
Lloh18:
	adrp	x3, l_.str.2@PAGE
Lloh19:
	add	x3, x3, l_.str.2@PAGEOFF
	mov	x0, x19
	bl	_RT_TRACE
	str	wzr, [x19, #4]
	b	LBB0_6
	.loh AdrpAdd	Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGot	Lloh8, Lloh9
	.loh AdrpLdrGot	Lloh10, Lloh11
	.loh AdrpAdd	Lloh18, Lloh19
	.loh AdrpAdd	Lloh16, Lloh17
	.loh AdrpLdrGot	Lloh14, Lloh15
	.loh AdrpLdrGot	Lloh12, Lloh13
	.cfi_endproc
                                        ; -- End function
	.comm	_COMP_CHAN,4,2                  ; @COMP_CHAN
	.comm	_DBG_LOUD,4,2                   ; @DBG_LOUD
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"sw_chnl_inprogress false driver sleep or unload\n"

	.comm	_BAND_ON_5G,8,3                 ; @BAND_ON_5G
	.comm	_BAND_ON_2_4G,8,3               ; @BAND_ON_2_4G
	.comm	_COMP_SCAN,4,2                  ; @COMP_SCAN
	.comm	_DBG_TRACE,4,2                  ; @DBG_TRACE
l_.str.1:                               ; @.str.1
	.asciz	"switch to channel%d, band type is %d\n"

l_.str.2:                               ; @.str.2
	.asciz	"\n"

.subsections_via_symbols
