	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function ipw_wx_set_freq
_ipw_wx_set_freq:                       ## @ipw_wx_set_freq
	.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	%rdx, %r14
	callq	_libipw_priv
	movq	%rax, %r15
	movq	8(%rax), %rdi
	callq	_libipw_get_geo
	movq	(%r14), %rbx
	testq	%rbx, %rbx
	je	LBB0_1
## %bb.3:
	movq	%rax, %r12
	cmpl	$1, 8(%r14)
	jne	LBB0_6
## %bb.4:
	movq	8(%r15), %rdi
	movq	%rbx, %rsi
	callq	_libipw_freq_to_channel
	movq	%rax, %rbx
	testq	%rax, %rax
	je	LBB0_5
LBB0_6:
	movq	8(%r15), %rdi
	movq	%rbx, %rsi
	callq	_libipw_is_valid_channel
	testl	%eax, %eax
	je	LBB0_5
## %bb.7:
	movl	%eax, %r13d
	movq	8(%r15), %rdi
	movq	(%rdi), %rax
	movq	_IW_MODE_ADHOC@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jne	LBB0_16
## %bb.8:
	movq	%rbx, %rsi
	callq	_libipw_channel_to_index
	cmpl	$-1, %eax
	je	LBB0_5
## %bb.9:
	movq	_LIBIPW_24GHZ_BAND@GOTPCREL(%rip), %rcx
	cmpl	(%rcx), %r13d
	jne	LBB0_11
## %bb.10:
	cltq
	shlq	$3, %rax
	addq	8(%r12), %rax
	jmp	LBB0_12
LBB0_1:
	leaq	L_.str(%rip), %rdi
	xorl	%eax, %eax
	callq	_IPW_DEBUG_WX
	movq	%r15, %rdi
	callq	_mutex_lock
	movq	%r15, %rdi
	xorl	%esi, %esi
	jmp	LBB0_2
LBB0_5:
	movq	_EINVAL@GOTPCREL(%rip), %rax
	xorl	%ebx, %ebx
LBB0_14:
	subl	(%rax), %ebx
	jmp	LBB0_15
LBB0_11:
	cltq
	shlq	$3, %rax
	addq	(%r12), %rax
LBB0_12:
	movq	_LIBIPW_CH_PASSIVE_ONLY@GOTPCREL(%rip), %rcx
	movq	(%rcx), %rcx
	testq	%rcx, (%rax)
	je	LBB0_16
## %bb.13:
	leaq	L_.str.1(%rip), %rdi
	xorl	%ebx, %ebx
	xorl	%eax, %eax
	callq	_IPW_DEBUG_WX
	movq	_EINVAL@GOTPCREL(%rip), %rax
	jmp	LBB0_14
LBB0_16:
	movq	(%r14), %rsi
	leaq	L_.str.2(%rip), %rdi
	xorl	%eax, %eax
	callq	_IPW_DEBUG_WX
	movq	%r15, %rdi
	callq	_mutex_lock
	movq	%r15, %rdi
	movq	%rbx, %rsi
LBB0_2:
	callq	_ipw_set_channel
	movl	%eax, %ebx
	movq	%r15, %rdi
	callq	_mutex_unlock
LBB0_15:
	movl	%ebx, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"SET Freq/Channel -> any\n"

	.comm	_EINVAL,4,2                     ## @EINVAL
	.comm	_IW_MODE_ADHOC,8,3              ## @IW_MODE_ADHOC
	.comm	_LIBIPW_24GHZ_BAND,4,2          ## @LIBIPW_24GHZ_BAND
	.comm	_LIBIPW_CH_PASSIVE_ONLY,8,3     ## @LIBIPW_CH_PASSIVE_ONLY
L_.str.1:                               ## @.str.1
	.asciz	"Invalid Ad-Hoc channel for 802.11a\n"

L_.str.2:                               ## @.str.2
	.asciz	"SET Freq/Channel -> %d\n"

	.no_dead_strip	_ipw_wx_set_freq
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function ipw_wx_set_freq
_ipw_wx_set_freq:                       ; @ipw_wx_set_freq
	.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, x2
	bl	_libipw_priv
	mov	x19, x0
	ldr	x0, [x0, #8]
	bl	_libipw_get_geo
	ldr	x21, [x20]
	cbz	x21, LBB0_8
; %bb.1:
	mov	x22, x0
	ldr	w8, [x20, #8]
	cmp	w8, #1
	b.ne	LBB0_3
; %bb.2:
	ldr	x0, [x19, #8]
	mov	x1, x21
	bl	_libipw_freq_to_channel
	mov	x21, x0
	cbz	x0, LBB0_12
LBB0_3:
	ldr	x0, [x19, #8]
	mov	x1, x21
	bl	_libipw_is_valid_channel
	cbz	w0, LBB0_12
; %bb.4:
	mov	x23, x0
	ldr	x0, [x19, #8]
	ldr	x8, [x0]
Lloh0:
	adrp	x9, _IW_MODE_ADHOC@GOTPAGE
Lloh1:
	ldr	x9, [x9, _IW_MODE_ADHOC@GOTPAGEOFF]
Lloh2:
	ldr	x9, [x9]
	cmp	x8, x9
	b.ne	LBB0_13
; %bb.5:
	mov	x1, x21
	bl	_libipw_channel_to_index
	cmn	w0, #1
	b.eq	LBB0_12
; %bb.6:
Lloh3:
	adrp	x8, _LIBIPW_24GHZ_BAND@GOTPAGE
Lloh4:
	ldr	x8, [x8, _LIBIPW_24GHZ_BAND@GOTPAGEOFF]
Lloh5:
	ldr	w8, [x8]
	cmp	w23, w8
	b.ne	LBB0_9
; %bb.7:
	ldr	x8, [x22, #8]
	b	LBB0_10
LBB0_8:
Lloh6:
	adrp	x0, l_.str@PAGE
Lloh7:
	add	x0, x0, l_.str@PAGEOFF
	bl	_IPW_DEBUG_WX
	mov	x0, x19
	bl	_mutex_lock
	mov	x0, x19
	mov	x1, #0
	b	LBB0_14
LBB0_9:
	ldr	x8, [x22]
LBB0_10:
	add	x8, x8, w0, sxtw #3
	ldr	x8, [x8]
Lloh8:
	adrp	x9, _LIBIPW_CH_PASSIVE_ONLY@GOTPAGE
Lloh9:
	ldr	x9, [x9, _LIBIPW_CH_PASSIVE_ONLY@GOTPAGEOFF]
Lloh10:
	ldr	x9, [x9]
	tst	x9, x8
	b.eq	LBB0_13
; %bb.11:
Lloh11:
	adrp	x0, l_.str.1@PAGE
Lloh12:
	add	x0, x0, l_.str.1@PAGEOFF
	bl	_IPW_DEBUG_WX
LBB0_12:
Lloh13:
	adrp	x8, _EINVAL@GOTPAGE
Lloh14:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
Lloh15:
	ldr	w8, [x8]
	neg	w0, w8
	b	LBB0_15
LBB0_13:
	ldr	x8, [x20]
	str	x8, [sp]
Lloh16:
	adrp	x0, l_.str.2@PAGE
Lloh17:
	add	x0, x0, l_.str.2@PAGEOFF
	bl	_IPW_DEBUG_WX
	mov	x0, x19
	bl	_mutex_lock
	mov	x0, x19
	mov	x1, x21
LBB0_14:
	bl	_ipw_set_channel
	mov	x20, x0
	mov	x0, x19
	bl	_mutex_unlock
	mov	x0, x20
LBB0_15:
	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 AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpAdd	Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpAdd	Lloh11, Lloh12
	.loh AdrpLdrGotLdr	Lloh13, Lloh14, Lloh15
	.loh AdrpAdd	Lloh16, Lloh17
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"SET Freq/Channel -> any\n"

	.comm	_EINVAL,4,2                     ; @EINVAL
	.comm	_IW_MODE_ADHOC,8,3              ; @IW_MODE_ADHOC
	.comm	_LIBIPW_24GHZ_BAND,4,2          ; @LIBIPW_24GHZ_BAND
	.comm	_LIBIPW_CH_PASSIVE_ONLY,8,3     ; @LIBIPW_CH_PASSIVE_ONLY
l_.str.1:                               ; @.str.1
	.asciz	"Invalid Ad-Hoc channel for 802.11a\n"

l_.str.2:                               ; @.str.2
	.asciz	"SET Freq/Channel -> %d\n"

	.no_dead_strip	_ipw_wx_set_freq
.subsections_via_symbols
