	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function ipw2100_wx_set_freq
_ipw2100_wx_set_freq:                   ## @ipw2100_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	%rbx
	pushq	%rax
	.cfi_offset %rbx, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdx, %r14
	callq	_libipw_priv
	movq	%rax, %rbx
	movq	8(%rax), %rax
	movq	(%rax), %rax
	movq	_IW_MODE_INFRA@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jne	LBB0_2
## %bb.1:
	movq	_EOPNOTSUPP@GOTPCREL(%rip), %rax
	xorl	%ebx, %ebx
	subl	(%rax), %ebx
	jmp	LBB0_20
LBB0_2:
	movq	%rbx, %r15
	addq	$4, %r15
	movq	%r15, %rdi
	callq	_mutex_lock
	movq	_STATUS_INITIALIZED@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	testl	%eax, (%rbx)
	je	LBB0_3
## %bb.5:
	movl	(%r14), %eax
	cmpl	$1, %eax
	jne	LBB0_14
## %bb.6:
	movl	4(%r14), %ecx
	leal	-241200000(%rcx), %eax
	cmpl	$7500000, %eax                  ## imm = 0x7270E0
	ja	LBB0_17
## %bb.7:
	movq	_REG_MAX_CHANNEL@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	testl	%eax, %eax
	jle	LBB0_8
## %bb.9:
	shrl	$5, %ecx
	imulq	$175921861, %rcx, %rcx          ## imm = 0xA7C5AC5
	shrq	$39, %rcx
	movq	_ipw2100_frequencies@GOTPCREL(%rip), %rdx
	movq	(%rdx), %rdx
	xorl	%esi, %esi
	.p2align	4, 0x90
LBB0_10:                                ## =>This Inner Loop Header: Depth=1
	cmpl	(%rdx,%rsi,4), %ecx
	je	LBB0_13
## %bb.11:                              ##   in Loop: Header=BB0_10 Depth=1
	incq	%rsi
	cmpq	%rsi, %rax
	jne	LBB0_10
## %bb.12:
	movl	%eax, %esi
	jmp	LBB0_13
LBB0_3:
	movq	_EIO@GOTPCREL(%rip), %rax
	jmp	LBB0_4
LBB0_14:
	jge	LBB0_17
## %bb.15:
	movl	4(%r14), %esi
	cmpl	$1001, %esi                     ## imm = 0x3E9
	jge	LBB0_17
LBB0_18:
	leaq	L_.str(%rip), %rdi
                                        ## kill: def $esi killed $esi killed $rsi
	callq	_IPW_DEBUG_WX
	movl	4(%r14), %esi
	movq	%rbx, %rdi
	xorl	%edx, %edx
	callq	_ipw2100_set_channel
	movl	%eax, %ebx
	jmp	LBB0_19
LBB0_8:
	xorl	%esi, %esi
LBB0_13:
	movl	$0, (%r14)
	incl	%esi
	movl	%esi, 4(%r14)
	cmpl	$1001, %esi                     ## imm = 0x3E9
	jl	LBB0_18
LBB0_17:
	movq	_EOPNOTSUPP@GOTPCREL(%rip), %rax
LBB0_4:
	xorl	%ebx, %ebx
	subl	(%rax), %ebx
LBB0_19:
	movq	%r15, %rdi
	callq	_mutex_unlock
LBB0_20:
	movl	%ebx, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_IW_MODE_INFRA,8,3              ## @IW_MODE_INFRA
	.comm	_EOPNOTSUPP,4,2                 ## @EOPNOTSUPP
	.comm	_STATUS_INITIALIZED,4,2         ## @STATUS_INITIALIZED
	.comm	_EIO,4,2                        ## @EIO
	.comm	_REG_MAX_CHANNEL,4,2            ## @REG_MAX_CHANNEL
	.comm	_ipw2100_frequencies,8,3        ## @ipw2100_frequencies
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"SET Freq/Channel -> %d\n"

	.no_dead_strip	_ipw2100_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 ipw2100_wx_set_freq
_ipw2100_wx_set_freq:                   ; @ipw2100_wx_set_freq
	.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	x20, x2
	bl	_libipw_priv
	ldr	x8, [x0, #8]
	ldr	x8, [x8]
Lloh0:
	adrp	x9, _IW_MODE_INFRA@GOTPAGE
Lloh1:
	ldr	x9, [x9, _IW_MODE_INFRA@GOTPAGEOFF]
Lloh2:
	ldr	x9, [x9]
	cmp	x8, x9
	b.ne	LBB0_2
; %bb.1:
Lloh3:
	adrp	x8, _EOPNOTSUPP@GOTPAGE
Lloh4:
	ldr	x8, [x8, _EOPNOTSUPP@GOTPAGEOFF]
Lloh5:
	ldr	w8, [x8]
	neg	w20, w8
	b	LBB0_19
LBB0_2:
	mov	x21, x0
	add	x19, x0, #4
	mov	x0, x19
	bl	_mutex_lock
	ldr	w8, [x21]
Lloh6:
	adrp	x9, _STATUS_INITIALIZED@GOTPAGE
Lloh7:
	ldr	x9, [x9, _STATUS_INITIALIZED@GOTPAGEOFF]
Lloh8:
	ldr	w9, [x9]
	tst	w9, w8
	b.eq	LBB0_10
; %bb.3:
	ldr	w8, [x20]
	cmp	w8, #1
	b.ne	LBB0_11
; %bb.4:
	ldr	w10, [x20, #4]
	mov	w8, #38016
	movk	w8, #61855, lsl #16
	mov	w9, #28896
	movk	w9, #114, lsl #16
	add	w8, w10, w8
	cmp	w8, w9
	b.hi	LBB0_16
; %bb.5:
Lloh9:
	adrp	x8, _REG_MAX_CHANNEL@GOTPAGE
Lloh10:
	ldr	x8, [x8, _REG_MAX_CHANNEL@GOTPAGEOFF]
Lloh11:
	ldr	w8, [x8]
	cmp	w8, #1
	b.lt	LBB0_14
; %bb.6:
	mov	x9, #0
	lsr	w10, w10, #5
	mov	w11, #23237
	movk	w11, #2684, lsl #16
	umull	x10, w10, w11
	lsr	x10, x10, #39
Lloh12:
	adrp	x11, _ipw2100_frequencies@GOTPAGE
Lloh13:
	ldr	x11, [x11, _ipw2100_frequencies@GOTPAGEOFF]
Lloh14:
	ldr	x11, [x11]
LBB0_7:                                 ; =>This Inner Loop Header: Depth=1
	ldr	w12, [x11, x9, lsl #2]
	cmp	w10, w12
	b.eq	LBB0_15
; %bb.8:                                ;   in Loop: Header=BB0_7 Depth=1
	add	x9, x9, #1
	cmp	x8, x9
	b.ne	LBB0_7
; %bb.9:
	mov	x9, x8
	b	LBB0_15
LBB0_10:
Lloh15:
	adrp	x8, _EIO@GOTPAGE
Lloh16:
	ldr	x8, [x8, _EIO@GOTPAGEOFF]
	b	LBB0_17
LBB0_11:
	cmp	w8, #0
	b.gt	LBB0_16
; %bb.12:
	ldr	w1, [x20, #4]
	cmp	w1, #1001
	b.ge	LBB0_16
LBB0_13:
Lloh17:
	adrp	x0, l_.str@PAGE
Lloh18:
	add	x0, x0, l_.str@PAGEOFF
	bl	_IPW_DEBUG_WX
	ldr	w1, [x20, #4]
	mov	x0, x21
	mov	w2, #0
	bl	_ipw2100_set_channel
	mov	x20, x0
	b	LBB0_18
LBB0_14:
	mov	w9, #0
LBB0_15:
	add	w1, w9, #1
	stp	wzr, w1, [x20]
	cmp	w1, #1001
	b.lt	LBB0_13
LBB0_16:
Lloh19:
	adrp	x8, _EOPNOTSUPP@GOTPAGE
Lloh20:
	ldr	x8, [x8, _EOPNOTSUPP@GOTPAGEOFF]
LBB0_17:
	ldr	w8, [x8]
	neg	w20, w8
LBB0_18:
	mov	x0, x19
	bl	_mutex_unlock
LBB0_19:
	mov	x0, x20
	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
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.loh AdrpLdrGot	Lloh15, Lloh16
	.loh AdrpAdd	Lloh17, Lloh18
	.loh AdrpLdrGot	Lloh19, Lloh20
	.cfi_endproc
                                        ; -- End function
	.comm	_IW_MODE_INFRA,8,3              ; @IW_MODE_INFRA
	.comm	_EOPNOTSUPP,4,2                 ; @EOPNOTSUPP
	.comm	_STATUS_INITIALIZED,4,2         ; @STATUS_INITIALIZED
	.comm	_EIO,4,2                        ; @EIO
	.comm	_REG_MAX_CHANNEL,4,2            ; @REG_MAX_CHANNEL
	.comm	_ipw2100_frequencies,8,3        ; @ipw2100_frequencies
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"SET Freq/Channel -> %d\n"

	.no_dead_strip	_ipw2100_wx_set_freq
.subsections_via_symbols
