	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function setcurchan
_setcurchan:                            ## @setcurchan
	.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	%r12
	pushq	%rbx
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rsi, %rbx
	movq	%rdi, %r15
	movq	40(%rdi), %r14
	movq	_IEEE80211_CHAN_ANYC@GOTPCREL(%rip), %r12
	cmpq	%rsi, (%r12)
	je	LBB0_12
## %bb.1:
	movq	%rbx, %rdi
	callq	_IEEE80211_IS_CHAN_RADAR
	testq	%rax, %rax
	je	LBB0_3
## %bb.2:
	movq	_EBUSY@GOTPCREL(%rip), %rax
	movl	(%rax), %ebx
	jmp	LBB0_22
LBB0_3:
	movq	(%r15), %rax
	movq	_IEEE80211_M_HOSTAP@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jne	LBB0_6
## %bb.4:
	movq	%rbx, %rdi
	callq	_IEEE80211_IS_CHAN_NOHOSTAP
	testq	%rax, %rax
	jne	LBB0_8
## %bb.5:
	movl	36(%r15), %esi
	movq	%rbx, %rdi
	callq	_check_mode_consistency
	testl	%eax, %eax
	jne	LBB0_9
	jmp	LBB0_8
LBB0_6:
	movq	_IEEE80211_M_IBSS@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jne	LBB0_9
## %bb.7:
	movq	%rbx, %rdi
	callq	_IEEE80211_IS_CHAN_NOADHOC
	testq	%rax, %rax
	je	LBB0_9
LBB0_8:
	movq	_EINVAL@GOTPCREL(%rip), %rax
	movl	(%rax), %ebx
	jmp	LBB0_22
LBB0_9:
	movq	8(%r15), %rax
	movq	_IEEE80211_S_RUN@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	je	LBB0_11
## %bb.10:
	movq	_IEEE80211_S_SLEEP@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jne	LBB0_12
LBB0_11:
	movq	24(%r15), %rax
	cmpq	%rbx, (%rax)
	je	LBB0_21
LBB0_12:
	movq	%rbx, 16(%r15)
	movq	(%r15), %rax
	movq	_IEEE80211_M_MONITOR@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jne	LBB0_16
## %bb.13:
	cmpq	%rbx, (%r12)
	je	LBB0_16
## %bb.14:
	movl	32(%r15), %edi
	callq	_IFNET_IS_UP_RUNNING
	movq	16(%r15), %rsi
	testq	%rax, %rax
	je	LBB0_18
## %bb.15:
	movq	%r14, %rdi
	callq	_ieee80211_setcurchan
	movq	(%r14), %rax
	movq	24(%r15), %rcx
	movq	%rax, (%rcx)
	jmp	LBB0_21
LBB0_16:
	movq	%r15, %rdi
	callq	_IS_UP_AUTO
	testq	%rax, %rax
	je	LBB0_19
## %bb.17:
	movq	_IEEE80211_S_SCAN@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	xorl	%ebx, %ebx
	movq	%r15, %rdi
	xorl	%edx, %edx
	callq	_ieee80211_new_state
	jmp	LBB0_22
LBB0_18:
	movq	%rsi, (%r14)
	movq	%rsi, %rdi
	callq	_ieee80211_get_ratetable
	movq	%rax, 8(%r14)
LBB0_21:
	xorl	%ebx, %ebx
LBB0_22:
	movl	%ebx, %eax
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_19:
	movq	16(%r15), %rdi
	xorl	%ebx, %ebx
	cmpq	(%r12), %rdi
	je	LBB0_22
## %bb.20:
	movq	%rdi, (%r14)
	callq	_ieee80211_get_ratetable
	movq	%rax, 8(%r14)
	jmp	LBB0_22
	.cfi_endproc
                                        ## -- End function
	.comm	_IEEE80211_CHAN_ANYC,8,3        ## @IEEE80211_CHAN_ANYC
	.comm	_EBUSY,4,2                      ## @EBUSY
	.comm	_IEEE80211_M_HOSTAP,8,3         ## @IEEE80211_M_HOSTAP
	.comm	_EINVAL,4,2                     ## @EINVAL
	.comm	_IEEE80211_M_IBSS,8,3           ## @IEEE80211_M_IBSS
	.comm	_IEEE80211_S_RUN,8,3            ## @IEEE80211_S_RUN
	.comm	_IEEE80211_S_SLEEP,8,3          ## @IEEE80211_S_SLEEP
	.comm	_IEEE80211_M_MONITOR,8,3        ## @IEEE80211_M_MONITOR
	.comm	_IEEE80211_S_SCAN,4,2           ## @IEEE80211_S_SCAN
	.no_dead_strip	_setcurchan
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function setcurchan
_setcurchan:                            ; @setcurchan
	.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	x20, x0
	ldr	x19, [x0, #40]
Lloh0:
	adrp	x22, _IEEE80211_CHAN_ANYC@GOTPAGE
Lloh1:
	ldr	x22, [x22, _IEEE80211_CHAN_ANYC@GOTPAGEOFF]
	ldr	x8, [x22]
	cmp	x8, x1
	b.eq	LBB0_11
; %bb.1:
	mov	x0, x21
	bl	_IEEE80211_IS_CHAN_RADAR
	cbz	x0, LBB0_3
; %bb.2:
Lloh2:
	adrp	x8, _EBUSY@GOTPAGE
Lloh3:
	ldr	x8, [x8, _EBUSY@GOTPAGEOFF]
Lloh4:
	ldr	w0, [x8]
	b	LBB0_21
LBB0_3:
	ldr	x8, [x20]
Lloh5:
	adrp	x9, _IEEE80211_M_HOSTAP@GOTPAGE
Lloh6:
	ldr	x9, [x9, _IEEE80211_M_HOSTAP@GOTPAGEOFF]
Lloh7:
	ldr	x9, [x9]
	cmp	x8, x9
	b.ne	LBB0_6
; %bb.4:
	mov	x0, x21
	bl	_IEEE80211_IS_CHAN_NOHOSTAP
	cbnz	x0, LBB0_8
; %bb.5:
	ldr	w1, [x20, #36]
	mov	x0, x21
	bl	_check_mode_consistency
	cbnz	w0, LBB0_9
	b	LBB0_8
LBB0_6:
Lloh8:
	adrp	x9, _IEEE80211_M_IBSS@GOTPAGE
Lloh9:
	ldr	x9, [x9, _IEEE80211_M_IBSS@GOTPAGEOFF]
Lloh10:
	ldr	x9, [x9]
	cmp	x8, x9
	b.ne	LBB0_9
; %bb.7:
	mov	x0, x21
	bl	_IEEE80211_IS_CHAN_NOADHOC
	cbz	x0, LBB0_9
LBB0_8:
Lloh11:
	adrp	x8, _EINVAL@GOTPAGE
Lloh12:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
Lloh13:
	ldr	w0, [x8]
	b	LBB0_21
LBB0_9:
	ldr	x8, [x20, #8]
Lloh14:
	adrp	x9, _IEEE80211_S_RUN@GOTPAGE
Lloh15:
	ldr	x9, [x9, _IEEE80211_S_RUN@GOTPAGEOFF]
Lloh16:
	ldr	x9, [x9]
Lloh17:
	adrp	x10, _IEEE80211_S_SLEEP@GOTPAGE
Lloh18:
	ldr	x10, [x10, _IEEE80211_S_SLEEP@GOTPAGEOFF]
Lloh19:
	ldr	x10, [x10]
	cmp	x8, x9
	ccmp	x8, x10, #4, ne
	b.ne	LBB0_11
; %bb.10:
	ldr	x8, [x20, #24]
	ldr	x8, [x8]
	cmp	x8, x21
	b.eq	LBB0_20
LBB0_11:
	str	x21, [x20, #16]
	ldr	x8, [x20]
Lloh20:
	adrp	x9, _IEEE80211_M_MONITOR@GOTPAGE
Lloh21:
	ldr	x9, [x9, _IEEE80211_M_MONITOR@GOTPAGEOFF]
Lloh22:
	ldr	x9, [x9]
	ldr	x10, [x22]
	cmp	x8, x9
	ccmp	x10, x21, #4, eq
	b.ne	LBB0_14
; %bb.12:
	mov	x0, x20
	bl	_IS_UP_AUTO
	cbz	x0, LBB0_16
; %bb.13:
Lloh23:
	adrp	x8, _IEEE80211_S_SCAN@GOTPAGE
Lloh24:
	ldr	x8, [x8, _IEEE80211_S_SCAN@GOTPAGEOFF]
Lloh25:
	ldr	w1, [x8]
	mov	x0, x20
	mov	w2, #0
	bl	_ieee80211_new_state
	mov	w0, #0
	b	LBB0_21
LBB0_14:
	ldr	w0, [x20, #32]
	bl	_IFNET_IS_UP_RUNNING
	ldr	x1, [x20, #16]
	cbz	x0, LBB0_18
; %bb.15:
	mov	x0, x19
	bl	_ieee80211_setcurchan
	mov	w0, #0
	ldr	x8, [x19]
	ldr	x9, [x20, #24]
	str	x8, [x9]
	b	LBB0_21
LBB0_16:
	ldr	x0, [x20, #16]
	ldr	x8, [x22]
	cmp	x0, x8
	b.eq	LBB0_20
; %bb.17:
	str	x0, [x19]
	b	LBB0_19
LBB0_18:
	str	x1, [x19]
	mov	x0, x1
LBB0_19:
	bl	_ieee80211_get_ratetable
	mov	x8, x0
	mov	w0, #0
	str	x8, [x19, #8]
	b	LBB0_21
LBB0_20:
	mov	w0, #0
LBB0_21:
	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 AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.loh AdrpLdrGotLdr	Lloh17, Lloh18, Lloh19
	.loh AdrpLdrGotLdr	Lloh14, Lloh15, Lloh16
	.loh AdrpLdrGotLdr	Lloh20, Lloh21, Lloh22
	.loh AdrpLdrGotLdr	Lloh23, Lloh24, Lloh25
	.cfi_endproc
                                        ; -- End function
	.comm	_IEEE80211_CHAN_ANYC,8,3        ; @IEEE80211_CHAN_ANYC
	.comm	_EBUSY,4,2                      ; @EBUSY
	.comm	_IEEE80211_M_HOSTAP,8,3         ; @IEEE80211_M_HOSTAP
	.comm	_EINVAL,4,2                     ; @EINVAL
	.comm	_IEEE80211_M_IBSS,8,3           ; @IEEE80211_M_IBSS
	.comm	_IEEE80211_S_RUN,8,3            ; @IEEE80211_S_RUN
	.comm	_IEEE80211_S_SLEEP,8,3          ; @IEEE80211_S_SLEEP
	.comm	_IEEE80211_M_MONITOR,8,3        ; @IEEE80211_M_MONITOR
	.comm	_IEEE80211_S_SCAN,4,2           ; @IEEE80211_S_SCAN
	.no_dead_strip	_setcurchan
.subsections_via_symbols
