	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_brcms_c_set_channel            ## -- Begin function brcms_c_set_channel
	.p2align	4, 0x90
_brcms_c_set_channel:                   ## @brcms_c_set_channel
	.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	%rbx
	pushq	%rax
	.cfi_offset %rbx, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rsi, %rbx
	movq	%rdi, %r15
	movq	%rsi, %rdi
	callq	_ch20mhz_chspec
	testq	%rbx, %rbx
	js	LBB0_2
## %bb.1:
	movq	%rax, %r14
	movq	_MAXCHANNEL@GOTPCREL(%rip), %rax
	cmpq	%rbx, (%rax)
	jl	LBB0_2
## %bb.3:
	movl	32(%r15), %edi
	movq	%r14, %rsi
	callq	_brcms_c_valid_chanspec_db
	testl	%eax, %eax
	je	LBB0_2
## %bb.4:
	movq	16(%r15), %rax
	cmpq	$0, (%rax)
	jne	LBB0_7
## %bb.5:
	movq	%r15, %rdi
	callq	_brcms_is_mband_unlocked
	testq	%rax, %rax
	je	LBB0_7
## %bb.6:
	movq	8(%r15), %rax
	movq	(%rax), %rbx
	movq	%r14, %rdi
	callq	_chspec_bandunit
	xorl	%ecx, %ecx
	cmpq	%rax, %rbx
	setne	%cl
	movl	%ecx, (%r15)
LBB0_7:
	movq	24(%r15), %rax
	movq	%r14, (%rax)
	movq	16(%r15), %rax
	xorl	%ebx, %ebx
	cmpq	$0, (%rax)
	je	LBB0_10
## %bb.8:
	movq	8(%r15), %rax
	movl	8(%rax), %edi
	callq	_wlc_phy_chanspec_get
	cmpq	%r14, %rax
	je	LBB0_10
## %bb.9:
	movq	%r15, %rdi
	movq	%r14, %rsi
	callq	_brcms_c_set_home_chanspec
	movq	%r15, %rdi
	callq	_brcms_c_suspend_mac_and_wait
	movq	%r15, %rdi
	movq	%r14, %rsi
	callq	_brcms_c_set_chanspec
	movq	%r15, %rdi
	callq	_brcms_c_enable_mac
	jmp	LBB0_10
LBB0_2:
	movq	_EINVAL@GOTPCREL(%rip), %rax
	xorl	%ebx, %ebx
	subl	(%rax), %ebx
LBB0_10:
	movl	%ebx, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_MAXCHANNEL,8,3                 ## @MAXCHANNEL
	.comm	_EINVAL,4,2                     ## @EINVAL
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_brcms_c_set_channel            ; -- Begin function brcms_c_set_channel
	.p2align	2
_brcms_c_set_channel:                   ; @brcms_c_set_channel
	.cfi_startproc
; %bb.0:
	stp	x22, x21, [sp, #-48]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 48
	stp	x20, x19, [sp, #16]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #32]             ; 16-byte Folded Spill
	add	x29, sp, #32
	.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
	mov	x21, x1
	mov	x19, x0
	mov	x0, x1
	bl	_ch20mhz_chspec
	tbnz	x21, #63, LBB0_10
; %bb.1:
Lloh0:
	adrp	x8, _MAXCHANNEL@GOTPAGE
Lloh1:
	ldr	x8, [x8, _MAXCHANNEL@GOTPAGEOFF]
Lloh2:
	ldr	x8, [x8]
	cmp	x8, x21
	b.lt	LBB0_10
; %bb.2:
	mov	x20, x0
	ldr	w0, [x19, #32]
	mov	x1, x20
	bl	_brcms_c_valid_chanspec_db
	cbz	w0, LBB0_10
; %bb.3:
	ldr	x8, [x19, #16]
	ldr	x8, [x8]
	cbnz	x8, LBB0_6
; %bb.4:
	mov	x0, x19
	bl	_brcms_is_mband_unlocked
	cbz	x0, LBB0_6
; %bb.5:
	ldr	x8, [x19, #8]
	ldr	x21, [x8]
	mov	x0, x20
	bl	_chspec_bandunit
	cmp	x21, x0
	cset	w8, ne
	str	w8, [x19]
LBB0_6:
	ldp	x9, x8, [x19, #16]
	str	x20, [x8]
	ldr	x8, [x9]
	cbz	x8, LBB0_9
; %bb.7:
	ldr	x8, [x19, #8]
	ldr	w0, [x8, #8]
	bl	_wlc_phy_chanspec_get
	cmp	x0, x20
	b.eq	LBB0_9
; %bb.8:
	mov	x0, x19
	mov	x1, x20
	bl	_brcms_c_set_home_chanspec
	mov	x0, x19
	bl	_brcms_c_suspend_mac_and_wait
	mov	x0, x19
	mov	x1, x20
	bl	_brcms_c_set_chanspec
	mov	x0, x19
	bl	_brcms_c_enable_mac
LBB0_9:
	mov	w0, #0
	b	LBB0_11
LBB0_10:
Lloh3:
	adrp	x8, _EINVAL@GOTPAGE
Lloh4:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
Lloh5:
	ldr	w8, [x8]
	neg	w0, w8
LBB0_11:
	ldp	x29, x30, [sp, #32]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #16]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp], #48             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.cfi_endproc
                                        ; -- End function
	.comm	_MAXCHANNEL,8,3                 ; @MAXCHANNEL
	.comm	_EINVAL,4,2                     ; @EINVAL
.subsections_via_symbols
