	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_brcms_c_channel_set_chanspec   ## -- Begin function brcms_c_channel_set_chanspec
	.p2align	4, 0x90
_brcms_c_channel_set_chanspec:          ## @brcms_c_channel_set_chanspec
	.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
	movl	%edx, %r15d
	movq	%rdi, %rbx
	movq	(%rdi), %r12
	movq	16(%r12), %rax
	movq	(%rax), %rax
	movq	(%rax), %r14
	leaq	-48(%rbp), %r13
	movl	%esi, -52(%rbp)                 ## 4-byte Spill
	movq	%r13, %rdx
	callq	_brcms_c_channel_reg_limits
	movq	%rbx, %rdi
	movq	%r13, %rsi
	movl	%r15d, %edx
	callq	_brcms_c_channel_min_txpower_limits_with_local_constraint
	movq	_IEEE80211_CHAN_NO_OFDM@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	testl	%eax, (%r14)
	je	LBB0_2
## %bb.1:
	movq	_GMODE_LEGACY_B@GOTPCREL(%rip), %rax
	jmp	LBB0_3
LBB0_2:
	movq	8(%r12), %rax
LBB0_3:
	movl	(%rax), %esi
	movq	%r12, %rdi
	xorl	%edx, %edx
	callq	_brcms_c_set_gmode
	movl	(%r12), %edi
	movq	_IEEE80211_CHAN_NO_IR@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	xorl	%edx, %edx
	andl	(%r14), %eax
	setne	%dl
	leaq	-48(%rbp), %rcx
	movl	-52(%rbp), %esi                 ## 4-byte Reload
	callq	_brcms_b_set_chanspec
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_IEEE80211_CHAN_NO_OFDM,4,2     ## @IEEE80211_CHAN_NO_OFDM
	.comm	_GMODE_LEGACY_B,4,2             ## @GMODE_LEGACY_B
	.comm	_IEEE80211_CHAN_NO_IR,4,2       ## @IEEE80211_CHAN_NO_IR
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_brcms_c_channel_set_chanspec   ; -- Begin function brcms_c_channel_set_chanspec
	.p2align	2
_brcms_c_channel_set_chanspec:          ; @brcms_c_channel_set_chanspec
	.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	x21, x2
	mov	x19, x1
	mov	x22, x0
	ldr	x20, [x0]
	ldr	x8, [x20, #16]
	ldr	x8, [x8]
	ldr	x23, [x8]
	add	x2, sp, #8
	bl	_brcms_c_channel_reg_limits
	add	x1, sp, #8
	mov	x0, x22
	mov	x2, x21
	bl	_brcms_c_channel_min_txpower_limits_with_local_constraint
	ldr	w8, [x23]
Lloh0:
	adrp	x9, _IEEE80211_CHAN_NO_OFDM@GOTPAGE
Lloh1:
	ldr	x9, [x9, _IEEE80211_CHAN_NO_OFDM@GOTPAGEOFF]
Lloh2:
	ldr	w9, [x9]
	tst	w9, w8
	b.eq	LBB0_2
; %bb.1:
Lloh3:
	adrp	x8, _GMODE_LEGACY_B@GOTPAGE
Lloh4:
	ldr	x8, [x8, _GMODE_LEGACY_B@GOTPAGEOFF]
	b	LBB0_3
LBB0_2:
	ldr	x8, [x20, #8]
LBB0_3:
	ldr	w1, [x8]
	mov	x0, x20
	mov	w2, #0
	bl	_brcms_c_set_gmode
	ldr	w0, [x20]
	ldr	w8, [x23]
Lloh5:
	adrp	x9, _IEEE80211_CHAN_NO_IR@GOTPAGE
Lloh6:
	ldr	x9, [x9, _IEEE80211_CHAN_NO_IR@GOTPAGEOFF]
Lloh7:
	ldr	w9, [x9]
	tst	w9, w8
	cset	w2, ne
	add	x3, sp, #8
	mov	x1, x19
	bl	_brcms_b_set_chanspec
	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
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGot	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.cfi_endproc
                                        ; -- End function
	.comm	_IEEE80211_CHAN_NO_OFDM,4,2     ; @IEEE80211_CHAN_NO_OFDM
	.comm	_GMODE_LEGACY_B,4,2             ; @GMODE_LEGACY_B
	.comm	_IEEE80211_CHAN_NO_IR,4,2       ; @IEEE80211_CHAN_NO_IR
.subsections_via_symbols
