	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function prism2_ioctl_siwfreq
_prism2_ioctl_siwfreq:                  ## @prism2_ioctl_siwfreq
	.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, %rbx
	movq	%rdi, %r14
	callq	_netdev_priv
	movq	(%rax), %r15
	movl	(%rbx), %eax
	testl	%eax, %eax
	je	LBB0_11
## %bb.1:
	cmpl	$1, %eax
	jne	LBB0_18
## %bb.2:
	movslq	4(%rbx), %rcx
	imulq	$351843721, %rcx, %rcx          ## imm = 0x14F8B589
	movq	%rcx, %rdx
	shrq	$63, %rdx
	sarq	$45, %rcx
	addl	%edx, %ecx
	movq	_freq_list@GOTPCREL(%rip), %rdx
	movq	(%rdx), %rsi
	movl	(%rsi), %edi
	cmpl	%edi, %ecx
	jl	LBB0_18
## %bb.3:
	movq	_FREQ_COUNT@GOTPCREL(%rip), %rdx
	movslq	(%rdx), %r8
	cmpl	-4(%rsi,%r8,4), %ecx
	jg	LBB0_18
## %bb.4:
	testl	%r8d, %r8d
	jle	LBB0_18
## %bb.5:
	movl	$1, %edx
	cmpl	%edi, %ecx
	je	LBB0_9
## %bb.6:
	movl	%r8d, %r8d
	movl	$1, %edi
	.p2align	4, 0x90
LBB0_7:                                 ## =>This Inner Loop Header: Depth=1
	cmpq	%rdi, %r8
	je	LBB0_10
## %bb.8:                               ##   in Loop: Header=BB0_7 Depth=1
	leaq	1(%rdi), %rdx
	cmpl	(%rsi,%rdi,4), %ecx
	movq	%rdx, %rdi
	jne	LBB0_7
LBB0_9:
	movl	$0, (%rbx)
	movl	%edx, 4(%rbx)
	testl	%edx, %edx
	jg	LBB0_13
	jmp	LBB0_18
LBB0_10:
	testl	%eax, %eax
	jne	LBB0_18
LBB0_11:
	movl	4(%rbx), %edx
	testl	%edx, %edx
	jle	LBB0_18
LBB0_13:
	movq	_FREQ_COUNT@GOTPCREL(%rip), %rax
	cmpl	(%rax), %edx
	jg	LBB0_18
## %bb.14:
	movl	(%r15), %eax
	leal	-1(%rdx), %ecx
	movzbl	%cl, %ecx
	btl	%ecx, %eax
	jae	LBB0_18
## %bb.15:
	movl	%edx, 4(%r15)
	movq	_HFA384X_RID_CNFOWNCHANNEL@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r14, %rdi
                                        ## kill: def $edx killed $edx killed $rdx
	callq	_hostap_set_word
	testq	%rax, %rax
	jne	LBB0_18
## %bb.16:
	movq	8(%r15), %rax
	movq	%r14, %rdi
	callq	*(%rax)
	testq	%rax, %rax
	je	LBB0_17
LBB0_18:
	movq	_EINVAL@GOTPCREL(%rip), %rcx
	xorl	%eax, %eax
	subl	(%rcx), %eax
LBB0_19:
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_17:
	xorl	%eax, %eax
	jmp	LBB0_19
	.cfi_endproc
                                        ## -- End function
	.comm	_freq_list,8,3                  ## @freq_list
	.comm	_FREQ_COUNT,4,2                 ## @FREQ_COUNT
	.comm	_EINVAL,4,2                     ## @EINVAL
	.comm	_HFA384X_RID_CNFOWNCHANNEL,4,2  ## @HFA384X_RID_CNFOWNCHANNEL
	.no_dead_strip	_prism2_ioctl_siwfreq
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function prism2_ioctl_siwfreq
_prism2_ioctl_siwfreq:                  ; @prism2_ioctl_siwfreq
	.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
	mov	x19, x0
	bl	_netdev_priv
	ldr	x21, [x0]
	ldr	w8, [x20]
	cbz	w8, LBB0_9
; %bb.1:
	cmp	w8, #1
	b.ne	LBB0_14
; %bb.2:
	ldrsw	x9, [x20, #4]
	mov	w10, #46473
	movk	w10, #5368, lsl #16
	mul	x9, x9, x10
	lsr	x10, x9, #63
	asr	x11, x9, #45
Lloh0:
	adrp	x9, _freq_list@GOTPAGE
Lloh1:
	ldr	x9, [x9, _freq_list@GOTPAGEOFF]
Lloh2:
	ldr	x9, [x9]
	ldr	w12, [x9]
	add	w10, w11, w10
	cmp	w10, w12
	b.lt	LBB0_14
; %bb.3:
Lloh3:
	adrp	x11, _FREQ_COUNT@GOTPAGE
Lloh4:
	ldr	x11, [x11, _FREQ_COUNT@GOTPAGEOFF]
Lloh5:
	ldr	w11, [x11]
	sub	w13, w11, #1
	ldr	w13, [x9, w13, sxtw #2]
	cmp	w10, w13
	ccmp	w11, #1, #8, le
	b.lt	LBB0_14
; %bb.4:
	mov	w2, #1
	cmp	w10, w12
	b.eq	LBB0_7
LBB0_5:                                 ; =>This Inner Loop Header: Depth=1
	cmp	x11, x2
	b.eq	LBB0_8
; %bb.6:                                ;   in Loop: Header=BB0_5 Depth=1
	ldr	w12, [x9, x2, lsl #2]
	add	x2, x2, #1
	cmp	w10, w12
	b.ne	LBB0_5
LBB0_7:
	stp	wzr, w2, [x20]
	b	LBB0_10
LBB0_8:
	cbnz	w8, LBB0_14
LBB0_9:
	ldr	w2, [x20, #4]
LBB0_10:
Lloh6:
	adrp	x8, _FREQ_COUNT@GOTPAGE
Lloh7:
	ldr	x8, [x8, _FREQ_COUNT@GOTPAGEOFF]
Lloh8:
	ldr	w9, [x8]
	subs	w8, w2, #1
	ccmp	w2, w9, #0, ge
	b.gt	LBB0_14
; %bb.11:
	ldr	w9, [x21]
	lsr	w8, w9, w8
	tbz	w8, #0, LBB0_14
; %bb.12:
	str	w2, [x21, #4]
Lloh9:
	adrp	x8, _HFA384X_RID_CNFOWNCHANNEL@GOTPAGE
Lloh10:
	ldr	x8, [x8, _HFA384X_RID_CNFOWNCHANNEL@GOTPAGEOFF]
Lloh11:
	ldr	w1, [x8]
	mov	x0, x19
                                        ; kill: def $w2 killed $w2 killed $x2
	bl	_hostap_set_word
	cbnz	x0, LBB0_14
; %bb.13:
	ldr	x8, [x21, #8]
	ldr	x8, [x8]
	mov	x0, x19
	blr	x8
	cbz	x0, LBB0_15
LBB0_14:
Lloh12:
	adrp	x8, _EINVAL@GOTPAGE
Lloh13:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
Lloh14:
	ldr	w8, [x8]
	neg	w0, w8
LBB0_15:
	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
	.cfi_endproc
                                        ; -- End function
	.comm	_freq_list,8,3                  ; @freq_list
	.comm	_FREQ_COUNT,4,2                 ; @FREQ_COUNT
	.comm	_EINVAL,4,2                     ; @EINVAL
	.comm	_HFA384X_RID_CNFOWNCHANNEL,4,2  ; @HFA384X_RID_CNFOWNCHANNEL
	.no_dead_strip	_prism2_ioctl_siwfreq
.subsections_via_symbols
